[go: up one dir, main page]

WO2025228033A1 - Data processing method and apparatus, computing device, and storage medium - Google Patents

Data processing method and apparatus, computing device, and storage medium

Info

Publication number
WO2025228033A1
WO2025228033A1 PCT/CN2025/085794 CN2025085794W WO2025228033A1 WO 2025228033 A1 WO2025228033 A1 WO 2025228033A1 CN 2025085794 W CN2025085794 W CN 2025085794W WO 2025228033 A1 WO2025228033 A1 WO 2025228033A1
Authority
WO
WIPO (PCT)
Prior art keywords
dimension
multidimensional
members
array
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/085794
Other languages
French (fr)
Chinese (zh)
Inventor
李传龙
陈鲁飞
张智为
梁锦伦
周易
刘超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2025228033A1 publication Critical patent/WO2025228033A1/en
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP

Definitions

  • This application relates to the field of multi-dimensional data (MDD) technology, and more particularly to a data processing method, apparatus, computing device, and storage medium.
  • MDD multi-dimensional data
  • a multidimensional database is a type of database used to process multidimensional data. It organizes and stores data in the form of multidimensional arrays (or multidimensional data cubes). Each dimension of the multidimensional array represents an observation of the data, and each dimension includes multiple dimension members (i.e., the values that the dimension can take). Each element in the multidimensional array represents a measure.
  • the data is typically displayed to the user in the form of forms. However, to correctly construct and display these forms on the client side, the database management system first needs to send the form-related information from the multidimensional database to the client.
  • One current implementation involves the database management system determining all values in the multidimensional form to be displayed within the multidimensional database, as well as the row and column coordinates of each value in the form and the corresponding dimension member. This information is then transmitted to the client along with each value, its row and column coordinates, and the correspondence between each value and its dimension member.
  • this approach requires transmitting a large amount of data, resulting in lengthy data transmission times and making it unsuitable for multidimensional forms with a large number of values to display on the client side.
  • This application provides a data processing method, apparatus, computing device, and storage medium that can reduce the amount of data transmitted.
  • this application provides a data processing method executed by a database management system.
  • the method includes: the database management system receiving a query request from a client; determining multiple dimension members associated with a multidimensional form based on the query request; determining data and location information based on the multiple dimension members; converting the data into an array; compressing the location information to obtain compressed information; and finally transmitting the query result to the client.
  • the query result includes the array and the compressed information.
  • the query request instructs data query processing for a multidimensional form associated with a multidimensional database.
  • the multiple dimension members belong to multiple dimensions in the multidimensional database.
  • the data consists of multiple values corresponding to the multiple dimension members in the multidimensional database.
  • the location information indicates the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value among the multiple dimension members.
  • this approach reduces the overall data transmission volume from the database management system to the client by compressing the location information and then sending the compressed information and the generated array (including the aforementioned values) to the client, thereby shortening the data transmission time.
  • the database management system can write the multiple values into an array according to their order in the multidimensional form, and then transmit the array to the client. It should be understood that since the database management system fills the array with the multiple values according to their order in the multidimensional form, when the client receives the array, it can directly load the multiple values into the multidimensional form according to the order of the values in the array. This helps improve the form display speed on the client side, thereby enhancing the user experience.
  • the location information includes row numbers.
  • the database management system can first determine the correspondence between different row numbers of the multidimensional form and the above-mentioned multiple dimension members based on the location information, and then generate compressed information to indicate the above-mentioned correspondence.
  • the database management system first determines the correspondence between different row numbers in the form and the aforementioned multiple dimension members based on location information. Each row number corresponds to a portion of the dimension members, and the dimension members corresponding to different row numbers are not entirely the same. Each row number corresponds to a dimension member under each of the multiple dimensions associated with the multidimensional form, and each row in the form includes one or more values. Then, the database management system generates compressed information to indicate the above correspondence and sends the compressed information to the client. In other words, the database management system converts the correspondence between different values and row/column coordinates and dimension members into the correspondence between different rows and dimension members.
  • this solution can reduce the amount of data transmission to a certain extent.
  • the location information can also include the column number.
  • the database management system can first determine the correspondence between the different column numbers of the multidimensional form and the above-mentioned multiple dimension members based on the location information, and then generate another compressed information, which is used to indicate the above correspondence, and then send the compressed information to the client.
  • the compressed information includes the target row number, the operand corresponding to the first dimension, and the order relationship among members belonging to the first dimension among multiple dimension members.
  • the first dimension is one of multiple dimensions.
  • the index value of the first dimension member corresponding to the target row number in the above order relationship is equal to the remainder obtained by dividing the first value by the number of members belonging to the first dimension among multiple dimension members.
  • the first dimension member belongs to the first dimension, and the first value is the quotient obtained by dividing the target row number by the operand.
  • the operand value is 1; if the number of other dimensions is 1, the operand value is the number of members of other dimensions associated with the multidimensional form; if the number of other dimensions is greater than 1, the operand value is the product of the number of members of other dimensions associated with the multidimensional form.
  • the database management system includes the target row number, the operands corresponding to the first dimension, and the order relationship between members belonging to the first dimension among multiple dimension members in the compressed information.
  • the client receives this compressed information, it can calculate the index value of the first dimension member corresponding to the target row number in the above order relationship based on the target row number (which can be any row number in the form) and the operands corresponding to the first dimension. Then, based on the calculated index value, it determines the first dimension member in the above order relationship.
  • the target row number, the operands corresponding to the first dimension, and the above order relationship implicitly contain the correspondence between the target row number and the first dimension members.
  • the client can determine the first dimension member under the first dimension corresponding to the target row number by calculating based on the target row number, the operands corresponding to the first dimension, and the above order relationship. Dimension members under other dimensions corresponding to the target row number can also be calculated in a similar way.
  • the compressed information also includes a row number array, which contains the different row numbers of the multidimensional form, and the length of the row number array is less than or equal to the product of the number of members of each dimension associated with the multidimensional form.
  • This solution uses a row number array to indicate the number of rows in the form. Based on this row number array and the previously described array containing multiple values from the form, the client can quickly fill in these values in the form according to the row number order, thereby improving the form's display speed on the client.
  • the query results also include style metadata, which indicates the style used by the client when displaying the above values.
  • style can be font size, font, alignment, whether it is bold, background color, the size of the cell containing the value, etc. This application does not make specific limitations on this.
  • the client receives the style metadata, it can control the style used when the above values are displayed in the form based on the style metadata.
  • the query results also include status information, which indicates the status of multiple values in the multidimensional database.
  • the status includes writable and read-only states.
  • a writable state indicates that the value can be modified, while a read-only state indicates that modification is not allowed.
  • the client can control whether users are allowed to modify the value on the client based on the value's status.
  • this application also provides a data processing apparatus, which includes modules for performing the data processing method in the first aspect or any possible implementation of the first aspect.
  • this application also provides a computing device including a processor and a memory.
  • the processor is configured to execute instructions stored in the memory to cause the computing device to perform operational steps of the method as described in any possible implementation of the first aspect.
  • this application also provides a computing device cluster, including at least one computing device, each computing device including a processor and a memory.
  • the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the operational steps of the method as described in any possible implementation of the first aspect.
  • this application also provides a chip system, the chip system including a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, and the processor being used to execute the operation steps of the method corresponding to the first aspect or any possible implementation of the first aspect.
  • this application also provides a computer-readable storage medium including computer program instructions that, when executed by a cluster of computing devices (including at least one computing device), perform the operational steps of the method as described in any possible implementation of the first aspect.
  • this application also provides a computer program product containing instructions.
  • the instructions When the instructions are executed by a cluster of computing devices (including at least one computing device), the cluster of computing devices causes the cluster of computing devices to perform the operational steps of the method as described in any possible implementation of the first aspect.
  • FIG. 1 is a system architecture diagram provided in this application.
  • Figure 2 is a schematic diagram of a multidimensional form provided in this application.
  • FIG. 3 is a schematic diagram of another multidimensional form provided in this application.
  • Figure 4 is a schematic diagram of the structure of a query result provided in this application.
  • Figure 5 is a schematic diagram of a multidimensional form after blanking provided in this application.
  • FIG. 6 is a flowchart illustrating a data processing method provided in this application.
  • Figure 7 is a schematic diagram of the structure of a computing device provided in this application.
  • Figure 8 is a schematic diagram of a computing device cluster provided in this application.
  • Figure 9 is a schematic diagram of two computing devices provided in this application interacting via a network.
  • This application provides a data processing method executed by a database management system.
  • the system first receives a query request from a client, then determines multiple dimension members associated with a multidimensional form based on the query request, and then determines data and location information based on the multiple dimension members. Subsequently, the data is converted into an array, and the location information is compressed to obtain compressed information. Finally, the query result, including the array and the compressed information, is transmitted to the client.
  • the query request instructs the data query processing of a multidimensional form associated with a multidimensional database.
  • the multiple dimension members belong to multiple dimensions in the multidimensional database.
  • the data consists of multiple values corresponding to the multiple dimension members in the multidimensional database.
  • the location information indicates the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value among the multiple dimension members.
  • this system reduces the amount of data transmitted and thus shortens the data transmission time by compressing the location information and then sending the compressed information and the generated array (including the aforementioned values) to the client.
  • Figure 1 is a system architecture diagram provided in this application, including a client 100, a database management system 200, and a multidimensional database 300.
  • the client 100 and the database management system 200 have a communication connection, which can be a wired connection or a wireless connection.
  • the number of clients 100 establishing a communication connection with the database management system 200 can be one or more ( Figure 1 only shows one client 100 as an example), and this application does not specifically limit this.
  • the multidimensional database 300 and the database management system 200 have a communication connection, which can be a wired connection or a wireless connection.
  • the number of multidimensional databases 300 establishing a communication connection with the database management system 200 can be one or more ( Figure 1 only shows one multidimensional database 300 as an example), and this application embodiment does not specifically limit this either.
  • the client 100 is used to implement human-computer interaction and can be deployed on terminal devices or computing devices.
  • the terminal device can be a smartphone, wearable device, laptop, tablet, in-vehicle device, or smart conferencing device, etc.
  • the computing device can be a server, personal computer (PC), etc.
  • PC personal computer
  • client 100 can be an application (APP) client/mobile client running on a mobile terminal such as a smartphone or wearable device, or software or application running on a computing device (such as a PC client), or a web client accessed through a web browser, or a front-end console of a cloud platform.
  • APP application
  • client 100 can be an application (APP) client/mobile client running on a mobile terminal such as a smartphone or wearable device, or software or application running on a computing device (such as a PC client), or a web client accessed through a web browser, or a front-end console of a cloud platform.
  • APP application
  • a database management system 200 is used to manage a multidimensional database 300.
  • the database management system 200 can be deployed on a single computing device, a cluster of multiple computing devices, or a terminal device.
  • the computing device can be a physical server, a virtual machine, a container, or an edge computing device.
  • a virtual machine refers to a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. When creating a virtual machine on a computing device, a portion of the physical machine's hard drive and memory capacity is used as the virtual machine's hard drive and memory capacity.
  • Each virtual machine has an independent basic input/output system (BIOS), hard drive, and operating system, and can be operated like a physical machine.
  • BIOS basic input/output system
  • a container is a portable software unit that can combine an application and all its dependencies into a single software package. This package is not limited by the underlying host operating system, thus eliminating the need to build complex environments and simplifying the application development and deployment process.
  • Edge computing devices refer to devices closer to the data source and end users, characterized by low latency and high bandwidth, such as intelligent routers and edge servers; this application does not specifically limit this. Terminal devices are described above and will not be elaborated upon here.
  • Multidimensional Database 300 is a database used to store multidimensional data. It organizes and stores data in the form of multidimensional arrays (or multidimensional data cubes). Each dimension of the multidimensional array represents an angle/aspect/direction of observing data. Each dimension includes one or more dimension members, that is, the dimension can have one or more values. Each element in the multidimensional array represents a metric.
  • a multidimensional database 300 includes dimensions such as company, year, product, region, and account (i.e., accounting subject) dimensions.
  • the company dimension includes members such as Company A and Company B; the year dimension includes members such as 2019, 2020, and 2021; the product dimension includes members such as Product 1, Product 2, and Product 3; the region dimension includes members such as Region 1 and Region 2; and the account dimension includes members such as sales revenue, sales volume, inventory, and profit margin.
  • the number and types of dimensions and members given in this example are for illustrative purposes only and do not constitute specific limitations. In practical applications, a multidimensional database 300 can have more or fewer dimensions, and each dimension can have one or more members. This application does not impose specific limitations on this.
  • the client 100 and the database management system 200 can be deployed on the same terminal device or computing device; or, the client 100 can be deployed on a terminal device, and the database management system 200 can be deployed on a single computing device or a cluster of computing devices.
  • the multidimensional database 300 and the database management system 200 can be deployed on the same or different computing devices or terminal devices, and this application embodiment is not specifically limited. It should be understood that the examples are for illustration only, and the specific deployment of the client 100, database management system 200, and multidimensional database 300 can be determined according to the actual application scenario.
  • both the client 100 and the database management system 200 can be divided into multiple unit modules.
  • Figure 1 exemplarily illustrates one division method of the client 100 and the database management system 200, wherein the client 100 includes a sending module 110, a receiving module 120, a processing module 130, and an interaction module 140, and the database management system 200 includes a receiving module 210, a processing module 220, and a sending module 230, which will be described in detail below.
  • Sending Module 110 Used to send query requests to the database management system 200.
  • the query request instructs for data query processing of the multidimensional form associated with the multidimensional database 300.
  • the multidimensional form refers to a multidimensional form constructed based on data in the multidimensional database 300.
  • the multidimensional form is associated with multiple dimension members, which belong to multiple dimensions in the multidimensional database 300. These multiple dimensions can be considered as the dimensions associated with the multidimensional form. Each dimension member belongs to only one dimension, and each of these multiple dimensions has at least one dimension member among these multiple dimension members.
  • Query requests can include the following types:
  • the query request includes the identifier (ID) or name of a multidimensional form.
  • the database management system 200 records the correspondence between the ID/name of a multidimensional form and the associated multidimensional members.
  • its sending module 110 sends the query request to the database management system 200 by including the multidimensional form's ID or name in the request, thereby querying the database management system 200 for the data of that multidimensional form.
  • the database management system 200 determines that the client 100 needs to display this multidimensional form, and further determines that the multidimensional form is associated with these multiple dimension members. Subsequently, it retrieves the corresponding values of these multiple dimension members in the multidimensional database 300 (described later).
  • Scenario 2 The query request includes multiple dimension members associated with a multidimensional form.
  • client 100 sends a query request to database management system 200, including multiple dimension members associated with the multidimensional form, thereby querying the database management system 200 for data from the multidimensional form.
  • Database management system 200 can then directly determine the multiple dimension members associated with the multidimensional form based on the query request, and subsequently obtain the corresponding values of these dimension members in the multidimensional database 300 (described later).
  • Scenario 3 The query request includes multiple dimensions associated with a multidimensional form.
  • client 100 sends a query request to database management system 200, including multiple dimensions associated with the multidimensional form, thereby retrieving data from the multidimensional form.
  • Database management system 200 determines each dimension associated with the multidimensional form based on the query request. It then uses all or some dimension members under each dimension as multiple dimension members associated with the multidimensional form, and subsequently retrieves the corresponding values (described later) of these multiple dimension members in multidimensional database 300.
  • some dimension members under each dimension can be a specified number (configurable) of dimension members under that dimension, or specific dimension members under that dimension (which can be specified by the user or set by default in multidimensional database 300). This application does not impose specific limitations on this.
  • a multidimensional form associates multiple dimensions within a multidimensional database 300. For each of these dimensions, the multidimensional form specifically associates with at least one dimension member within that dimension.
  • the number of values corresponding to the multidimensional form in the multidimensional database 300 i.e., the values corresponding to the multiple dimension members associated with multiple forms in the multidimensional database 300
  • the number of values corresponding to the multidimensional form in the multidimensional database 300 is equal to the product of the dimension member data for each dimension associated with the multidimensional form.
  • Each value corresponds to one dimension member in each of the multiple dimensions associated with multiple forms.
  • all dimension members corresponding to each value are referred to as the member tuple for that value; different values have different member tuples.
  • Figure 2 provides an example of a multidimensional form that associates four dimensions in a multidimensional database 300, including the year dimension, product dimension, subject dimension, and region dimension.
  • the multidimensional form associates the two dimension members 2015 and 2016 under the year dimension, the three dimension members Product A, Product B, and Product C under the product dimension, the one dimension member sales volume under the subject dimension, and the two dimension members region 1 and region 2 under the region dimension.
  • Each value corresponds to 4 of the 8 dimension members (belonging to 4 different dimensions associated with a multidimensional form). These 4 dimension members are called the member tuples of that value. Different values have different member tuples, therefore these 12 values have 12 different member tuples.
  • the Cartesian product algorithm can be used to calculate which specific member tuples exist. In mathematics, the Cartesian product refers to an operation between two sets (or more sets) that combines the elements of these sets into ordered pairs, obtaining all possible ordered pairs.
  • the three dimension members under the product dimension as set 2 ⁇ Product A, Product B, Product C ⁇
  • the one dimension member under the subject dimension as set 3 ⁇ Sales ⁇
  • the two dimension members under the region dimension as set 4 ⁇ Region 1, Region 2 ⁇ .
  • the row structure of the multidimensional form can be associated with M dimensions in the multidimensional database 300 (which can be some or all of the multiple dimensions associated with the multidimensional form), where M is greater than or equal to 1, and this application does not specifically limit this.
  • the M dimensions corresponding to the row structure have an order relationship in the multidimensional form. This order relationship can be specified by the user (e.g., through the interaction module 140) or it can be the system default, and this application does not specifically limit this.
  • the row structure of the multidimensional database 300 is associated with one or more dimension members under that dimension (which may be some or all of the dimension members under that dimension). If the row structure is associated with multiple dimension members under that dimension, then these multiple dimension members under that dimension have an order relationship in the multidimensional form. This order relationship can be specified by the user (e.g., through the interaction module 140) or it can be the system default.
  • the row structure of this multidimensional form is associated with the year dimension, product dimension, and subject dimension of the above four dimensions.
  • the order of these three dimensions in the multidimensional form is year dimension ⁇ product dimension ⁇ subject dimension.
  • the multidimensional form is associated with four dimensions in the multidimensional database 300: year, product, subject, and region.
  • the row structure is associated with three of these four dimensions: year, product, and region.
  • the row structure is associated with the two dimension members 2015 and 2016, with their order in the multidimensional form being 2015 ⁇ 2016, corresponding to different rows in the multidimensional form.
  • the row structure is associated with the three dimension members: product A, product B, and product C, with their order in the multidimensional form being product A ⁇ product B ⁇ product C, corresponding to different rows in the multidimensional form.
  • the row structure is associated with the single dimension member "sales volume,” which corresponds to all rows in the multidimensional form.
  • the number of dimension members in each dimension associated with the row structure of a multidimensional form determines the number of rows in the multidimensional form.
  • the number of rows in a multidimensional form is equal to the product of the number of dimension members in each dimension associated with the row structure.
  • the column structure of the multidimensional form can be associated with N dimensions in the multidimensional database 300 (which may be some or all of the multiple dimensions associated with the multidimensional form), where N is greater than or equal to 1, and this application does not specifically limit this.
  • the N dimensions associated with the column structure have an order relationship in the multidimensional form, which can be user-specified or system default, and this application does not limit this.
  • the column structure of the multidimensional database 300 is associated with one or more dimension members under that dimension (which may be some or all of the dimension members under that dimension). If the column structure is associated with multiple dimension members under that dimension, then the multiple dimension members under that dimension have an order relationship in the multidimensional form, which can be user-specified or system default.
  • the number of dimension members in each dimension associated with the column structure of the multidimensional form determines the number of columns in the multidimensional form, and the number of columns in the multidimensional form is equal to the product of the number of dimension members in each dimension associated with the column structure.
  • the column structure of the multidimensional form in Figure 2 only relates to one dimension of the multidimensional database 300, namely the region dimension. Specifically, the column structure relates to two dimension members under the region dimension: Region 1 and Region 2. Their order in the multidimensional form is Region 1 ⁇ Region 2, with Region 1 and Region 2 corresponding to different columns in the multidimensional form. Since the column structure of this multidimensional form only relates to the region dimension, the number of columns in the multidimensional form equals the number of dimension members of the region dimension associated with the column structure, which equals 2 (column numbers from 0 to 1).
  • the number of cells used to populate the values can be determined by multiplying the number of rows by the number of columns.
  • These 12 cells are used to populate the 12 values corresponding to the multidimensional form in the multidimensional database 300.
  • the header or row/column headings are for ease of understanding only; in actual application scenarios, client 100 may not directly display the header in Figure 2.
  • Receiving module 210 Used to receive query requests sent by client 100.
  • Processing module 220 Used to retrieve multiple values from the multidimensional database 300 according to the query request, and then generate query results.
  • the processing module 220 in the database management system 200 by parsing the query request sent by the client 100, can determine the multiple dimension members associated with the multidimensional form (refer to cases one through three described above), and then retrieve the multiple values corresponding to these multiple dimension members from the multidimensional database 300. After the database management system 200 retrieves these multiple values from the multidimensional database 300, it fills these multiple values into the cells at the corresponding row and column positions in the multidimensional form.
  • the multidimensional form in Figure 2 is associated with 8 dimension members. These 8 dimension members belong to 4 dimensions in the multidimensional database 300, namely the year dimension, product dimension, subject dimension, and region dimension. The number of values corresponding to these 8 dimension members in the multidimensional form is 12, and different values have different member tuples.
  • the database management system 200 When the database management system 200 receives a query request from the client 100, it can determine the multiple dimension members associated with the multidimensional form and then retrieve the corresponding values of these dimension members in the multidimensional database 300. For example, in Figure 2, the cell with row number 0 and column number 1 needs to be filled with the member tuple including 2015, product A, sales volume, and region 2. The database management system 200 can retrieve the corresponding value of this member tuple from the multidimensional database 300. The method for retrieving the values to be filled in other cells is similar and will not be described in detail here.
  • the database management system 200 After the database management system 200 obtains these 12 values from the multidimensional database 300, it fills them into the corresponding cells of the multidimensional form in Figure 2, thus obtaining the multidimensional form in Figure 3. It should be noted that the 12 values filled in Figure 3 are only examples and do not constitute specific limitations.
  • the previous section introduced how to obtain the corresponding values of multiple dimension members associated with a multidimensional form in the multidimensional database 300 and fill them into the multidimensional form.
  • the following section explains how to generate query results based on these multiple values.
  • Figure 4 is a schematic diagram of the structure of a query result, including data information and definition information.
  • the data information includes an array of cell values (which is an array). This array of cells indicates the multiple values corresponding to the multiple dimension members associated with the multidimensional form in the multidimensional database 300.
  • the processing module 220 can sequentially fill the values of these 12 cells in the multidimensional form into a cell value array according to the arrangement order of rows 0 to 5 (each row from left to right), resulting in [100,200,NULL,NULL,150,180,200,300,80,120,160,150].
  • the processing module 220 can write the values of these 12 cells into a cell value array according to the arrangement order of rows 5 to 0 (each row from left to right), resulting in [160,150,80,120,200,300,150,180,NULL,NULL,100,200].
  • processing module 220 can sequentially write the values of these 12 cells into a cell value array according to the arrangement order of columns 0 to 1 (each column from top to bottom), resulting in [100,NULL,150,200,80,160,200,NULL,180,300,120,150].
  • processing module 220 can also fill the values of the 12 cells into the cell value array in other arrangements. This application does not impose specific limitations on this. Subsequently, client 100 only needs to use the cell value array and the order in which the values were previously filled into the array to quickly draw these 12 cells on client 100.
  • the data information also includes a cell status array.
  • This array indicates the status of multiple values in the multidimensional form within the multidimensional database 300.
  • the status can include read-only and writable states.
  • a writable state indicates that the value can be modified, while a read-only state indicates that modification is not allowed. If a value is in a writable state, the client 100 can notify the user that the value can be modified, thus allowing the user to modify the value on the client 100. Conversely, if a value is in a read-only state, the client 100 can notify the user that the value cannot be modified, thus preventing the user from modifying the value on the client 100.
  • processing module 220 fills the 12 values in the multidimensional form into the cell value array in the order of rows 0 to 5 (each row from left to right), resulting in [100,200,NULL,NULL,150,180,200,300,80,120,160,150].
  • the processing module 220 can sequentially fill the state flags of the 12 values in the multidimensional form into the cell state array, thus obtaining [0,0,0,0,0,0,1,1,1,1,1,1].
  • the client 100 determines the state of each value through the cell state array, it can render the cells containing values of different states in different ways, such as filling the cells containing read-only values with gray, filling the cells containing writable values with white, etc. This application does not specifically limit this.
  • the position of the same value in the cell value array is consistent with the position of the state marker of that value in the cell state array.
  • the value of the cell in row 2, column 0 of Figure 2 is 150, and its position in the cell value array is the 4th (assuming the position starts from 0). Therefore, the position of the state marker of this value in the cell state array is also the 4th.
  • client 100 can assign values to the corresponding cells and set the cell states according to the correspondence between the two arrays and the order of the elements (value/state) in the arrays.
  • the processing module 220 in the database management system 200 can first obtain the values corresponding to all cells in the multidimensional form from the multidimensional database 300, and then determine whether there are any rows and/or columns in the multidimensional form with all values empty (referred to as empty-cancellable rows and columns). If so, the processing module 220 performs empty-cancellable operation on the empty-cancellable rows and columns, that is, it does not carry the values of the cells in the empty-cancellable rows and columns in the cell value array, and it does not carry the status flags of the cells in the empty-cancellable rows and columns in the cell status array, thereby reducing the amount of data transmitted.
  • the client 100 since the cell value array received by the client 100 does not carry the values of the empty-cancellable rows and columns, and the cell status array does not carry the status flags of the empty-cancellable rows and columns, the client 100 will not display the empty-cancellable rows and columns in the multidimensional form, which can optimize the display effect and user experience of the multidimensional form to a certain extent.
  • this multidimensional form includes 12 cells.
  • the values in these cells are obtained by the database management system 200 from the multidimensional database 300 and filled into the multidimensional form (refer to the previous introduction). Some cells are filled with specific numerical values, while others are filled with NULL, indicating that the corresponding value obtained from the multidimensional database 300 is empty. Of course, other symbols can also be used to indicate that the value is empty, and this application does not specifically limit this. It can be seen that the values of all cells in the first row of this multidimensional form are empty, therefore the first row is a row that can be cleared of empty cells.
  • the processing module 220 of the database management system 200 can write all the values of these 12 cells into a cell value array. For example, the processing module 220 can fill the values of these 12 cells into an array sequentially from row 0 to row 5, resulting in the following cell value array: [100,200,NULL,NULL,150,180,200,300,80,120,160,150]. It can be understood that when the client 100 receives this cell value array, it does not need complex calculations; it can quickly render these 12 cells simply by following the order of row 0 to row 5. Similarly, the database management system 200 can fill the status markers of the values in these 12 cells into a cell status array sequentially from row 0 to row 5. When the client 100 receives this cell status array, it can quickly render the status of the values in these 12 cells simply by following the order of row 0 to row 5.
  • the processing module 220 of the database management system 200 only needs to write the values of the cells in the multidimensional form other than the rows and columns that can be cleared into the cell value array. That is, the values of the cells in Figure 2 other than the first row are sequentially filled into the cell value array, resulting in [100, 200, 150, 180, 200, 300, 80, 120, 160, 150], and the length of this array is 10. It can be understood that when the client 100 receives this cell value array, it does not need to perform complex calculations, but only needs to draw these 10 cells in the order of rows 0 to 5 (excluding the first row) to obtain the multidimensional form after clearing as shown in Figure 5.
  • the database management system 200 can sequentially fill the status markers of the values in the cells other than the first row in Figure 2 into the cell status array.
  • the client 100 receives the cell status array, it only needs to render the status of the values in these 10 cells in the order of rows 0 to 5 (excluding the first row).
  • the query results also include definition information, which is used to indicate the number of rows and columns in the multidimensional form, as well as the dimension members corresponding to each row and column in the multidimensional form.
  • the definition information includes row and column metadata and member metadata.
  • Row and column metadata is used to indicate the number of rows and columns in a multidimensional form. For example, without considering blanking, the number of rows and columns in the multidimensional form can be given directly.
  • the row and column metadata includes a row number array and a column number array.
  • the row number array contains the row numbers of different rows in the multidimensional form, and its length is equal to the number of rows in the multidimensional form. Therefore, the client 100 can determine the number of rows in the multidimensional form based on the row number array.
  • the column number array contains the column numbers of different columns in the multidimensional form, and its length is equal to the number of columns in the multidimensional form. Therefore, the client 100 can determine the number of columns in the multidimensional form based on the column number array, so as to render and display the multidimensional form on the client 100.
  • the database management system 200 can generate a row number array [0,1,2,3,4,5] and a column number array [0,1].
  • the row number array indicates that the multidimensional form has 6 rows
  • the column number array indicates that the multidimensional form has 2 columns.
  • the database management system 200 includes the row number array and column number array in the query results and sends them to the client 100.
  • the client 100 can then determine the number of rows and columns of the multidimensional form based on the row number array and column number array, and by combining this with the cell value array (including the values of 12 cells) in the form information, it can complete the depiction of the 12 cells.
  • the database management system 200 can generate a row number array [0,2,3,4,5] and a column number array [0,1].
  • the row number array indicates that the multidimensional form after the emptying has 5 rows
  • the column number array indicates that the multidimensional form after the emptying has 2 columns. It can be seen that since the first row is empty, the row number array does not carry the row number of the first row. Therefore, the client 100 does not need to render the cells of the first row. It only needs to draw 10 cells based on the row number array, column number array, and cell value array (including the values of the 10 empty cells), so that the multidimensional form after the emptying in Figure 5 can be displayed on the client 100.
  • Member metadata is used to indicate the dimensions corresponding to the row and column structures of a multidimensional form, as well as the information of the dimension members.
  • Member metadata can include the following first and second implementation methods.
  • the member metadata includes the order relationship of the dimension members under each dimension of the row structure in the multidimensional form, the order relationship of the dimension members under each dimension of the column structure in the multidimensional form, and the number of operations for each dimension in the M and N dimensions.
  • the operands of the first dimension fall into the following categories:
  • Type 1 If the number of other dimensions after the first dimension in the M dimensions is 0, then the number of operations for the first dimension is 1.
  • Type 2 If the number of other dimensions following the first dimension in the M dimensions is 1, then the operand of the first dimension is the number of dimension members of the other dimensions in the multidimensional form.
  • Type 3 If the number of other dimensions after the first dimension in the M dimensions is 1, then the operand of the first dimension is the product of the number of dimension members of each of the other dimensions in the multidimensional form.
  • client 100 When client 100 receives the query results transmitted by database management system 200, it can determine the index value of a dimension member corresponding to the target row number (which can be any row in the multidimensional form) under the first dimension based on the operands of the first dimension in the query results and the following decompression algorithm:
  • the order relationship of the dimension members under the first dimension in the multidimensional form is obtained by querying the member metadata based on the index value, and the first dimension member corresponding to the target row number under the first dimension can be determined.
  • the row structure corresponds to three dimensions: year, product, and subject.
  • Their order in the multidimensional form is year ⁇ product ⁇ subject.
  • the multidimensional form associates the two dimension members 2015 and 2016 under the year dimension (which can be some or all of the dimension members under the year dimension), with an order of 2015 ⁇ 2016, which can be represented by the array [2015, 2016], where the index of 2015 is 0 and the index of 2016 is 1.
  • the multidimensional form also associates the three dimension members A, B, and C under the product dimension, with an order of product A ⁇ product B ⁇ product C, which can be represented by the array [product A, product B, product C], where the index of product A is 0, the index of product B is 1, and the index of product C is 2.
  • the multidimensional form only associates the sales volume dimension member under the subject dimension.
  • the number of operands for each dimension of the row structure can be determined as follows:
  • the operand count for the subject dimension is 1;
  • the dimension members corresponding to other rows under each dimension can be determined in the same way as described above, which will not be elaborated on here.
  • the operands of the second dimension fall into the following categories:
  • Type 4 If the number of other dimensions after the second dimension in the N dimensions is 0, then the number of operations for the second dimension is 1.
  • Type 5 If the number of other dimensions following the second dimension in the N dimensions is 1, then the operand of the second dimension is the number of dimension members of the other dimensions in the multidimensional form.
  • Type 6 If the number of other dimensions after the second dimension in N dimensions is 1, then the operand of the second dimension is the product of the number of dimension members of each of the other dimensions in the multidimensional form.
  • client 100 can determine the index value of a dimension member corresponding to the target column number (which can be any column in the multidimensional form) under the second dimension using the following decompression algorithm:
  • the index value of the target row corresponding to a dimension member in the second dimension (target column number / second dimension operand) % the number of dimension members in the second dimension associated with the multidimensional form.
  • the order of the second-dimensional members in the multidimensional form given in the member metadata can be queried based on the index value to determine the second-dimensional member corresponding to the target column number in the second dimension.
  • the column structure of the multidimensional form corresponds to the region dimension.
  • the column structure corresponds to the two dimension members, Region 1 and Region 2, under the region dimension.
  • Their order in the multidimensional form is Region 1 ⁇ Region 2, which can be represented by the array [Region 1, Region 2].
  • the index value of Region 1 is 0, and the index value of Region B is 1.
  • the operand of the region dimension can be determined to be 1.
  • the defined information includes the order of the M dimensions corresponding to the row structure of the multidimensional form in the multidimensional form, the order of the N dimensions corresponding to the column structure of the multidimensional form in the multidimensional form, the order of the dimension members under each dimension corresponding to the row structure in the multidimensional form, the order of the dimension members under each dimension corresponding to the column structure in the multidimensional form, and the number of operations for each of the M and N dimensions.
  • the second implementation does not carry the operands for each dimension in its member metadata. However, it adds the order relationships of the M dimensions and N dimensions in the multidimensional form. As mentioned earlier, the operands for each dimension can be calculated based on the order relationships. Therefore, in the second implementation, when client 100 receives the query results from database management system 200, if client 100 wants to determine which dimension member under the first target dimension corresponds to the target row number in the multidimensional form, it can first calculate the operands of the first target dimension based on the aforementioned order relationships of the M dimensions, and then determine which dimension member under the first target dimension corresponds to the target row based on the operands of the first target dimension (the determination process is the same as described in the first implementation and will not be repeated here).
  • client 100 wants to determine which dimension member under the second target dimension corresponds to the target column in the multidimensional form, it can first calculate the operand of the second target dimension based on the order relationship of the above N dimensions in the multidimensional form, and then determine which dimension member under the second target dimension corresponds to the target column based on the operand of the second target dimension (the determination process is the same as described in the first implementation, and will not be repeated here).
  • the query results may also include basic information of the members of each dimension associated with the multidimensional form.
  • the basic information of the dimension members includes the ID (used to uniquely identify the corresponding dimension member), name, attributes, etc.
  • the query results also include style metadata.
  • Style metadata indicates the style used by the client when displaying multiple values in a multidimensional form.
  • style metadata may include the width and height of the cell, the number of decimal places in the value within the cell, whether the font is bold, the background color, the alignment, and so on.
  • style metadata given in this example is only illustrative and does not constitute a specific limitation.
  • style metadata may include more or fewer descriptions of the style of the cells containing the values.
  • Style metadata can indicate the style of some or all cells in a multidimensional form. These cells uniformly reference this style metadata for cell style rendering. This eliminates the need to specify the style of each cell containing each value in the query results, helping to reduce the amount of data transmitted and improving the form rendering performance of the client.
  • Sending module 230 Used to transmit the query results to the client 100.
  • Receiving module 120 Used to receive query results transmitted from the database management system 200.
  • Processing module 130 Used to parse the obtained query results, and then instruct the interaction module 140 to render and display the multidimensional form based on the parsed content.
  • the receiving module 120 in client 100 receives the query result sent by the database management system 200, it sends the query result to the processing module 130 for parsing.
  • the processing module 130 determines the number of rows and columns of the multidimensional form based on the query result, and then uses the values from the cell value array in the query result to sequentially fill multiple cells of the corresponding number of rows and columns, thus achieving fast rendering and display of the multidimensional form.
  • client 100 needs to determine the dimension member corresponding to a certain value on the multidimensional form, the processing module 130 in client 100 can determine it based on the member metadata and row/column metadata in the query result.
  • client 100 For example, suppose client 100 successfully displays a multidimensional form on client 100 by parsing the query results. Then, the user performs an operation on the interaction module 140 of client 100 to request to view the dimension member corresponding to a certain value in the multidimensional form. Client 100 can determine the dimension member corresponding to the cell based on the member metadata and row and column metadata in the query results (the specific determination method can be referred to the previous introduction), and then prompt the user with the dimension member corresponding to the value.
  • Client 100 can determine the corresponding dimension member based on the member metadata and row/column metadata in the query results (the specific determination method can be found above). It then sends the determined dimension member information and the modified value to the database management system 200. The data management system, based on the received dimension member information, saves the modified value to the corresponding location of that dimension member in the multidimensional database 300. After saving, the database management system 200 can also send a save success message to client 100 to indicate that the modified value has been successfully saved to the multidimensional database 300.
  • Interaction Module 140 This module displays the multidimensional form and facilitates human-computer interaction. Users can specify the dimensions and members associated with the multidimensional form, as well as the order of these dimensions, through the interaction module 140. The specific functions of the interaction module 140 are detailed above and will not be repeated here.
  • the client 100 and database management system 200 in Figure 1 are only exemplarily divided into the functional modules described above based on their functions.
  • the client 100 and database management system 200 in Figure 1 can contain more or fewer modules.
  • one of the modules mentioned above can be split into multiple functional modules, or two or more modules in the client 100/database management system 200 can be merged into one functional module.
  • Other functional modules can also be added to the client 100 and database management system 200.
  • the sending module 110, receiving module 120, processing module 130, interaction module 140, receiving module 210, processing module 220, and sending module 230 can all be implemented in software or in hardware.
  • the implementation method of processing module 220 will be described below.
  • the implementation methods of other modules can refer to the implementation method of processing module 220.
  • processing module 220 may include code running on a compute instance.
  • the compute instance may include at least one of a physical host (compute device), a virtual machine, or a container. Further, there may be one or more compute instances.
  • processing module 220 may include code running on multiple hosts/virtual machines/containers. It should be noted that the multiple hosts/virtual machines/containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts/virtual machines/containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region may include multiple AZs.
  • AZ availability zone
  • the multiple hosts/virtual machines/containers used to run the code may be distributed within the same virtual private cloud (VPC) or in multiple VPCs.
  • VPC virtual private cloud
  • a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC. The interconnection between VPCs is achieved through the communication gateway.
  • processing module 220 may include at least one computing device, such as a server.
  • processing module 220 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • the PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL generic array logic
  • the processing module 220 includes multiple computing devices that can be distributed within the same region or in different regions. Similarly, the processing module 220 can be distributed within the same Availability Zone (AZ) or in different AZs. Likewise, the processing module 220 can be distributed within the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
  • FIG. 6 is a flowchart of a data processing method provided in this application, including the following steps S601 to S606.
  • Client 100 sends a query request to Database Management System 200.
  • the query request is used to instruct data query processing for the multidimensional forms associated with the multidimensional database 300.
  • the database management system 200 receives the query request sent by the client 100.
  • Database Management System 200 determines the multiple dimension members associated with the multidimensional form based on the query request.
  • the aforementioned multiple dimension members belong to multiple dimensions in the multidimensional database 300.
  • Database Management System 200 determines data and location information based on multiple dimensions of members.
  • the data consists of multiple values corresponding to multiple dimension members in the multidimensional database 300.
  • the location information is used to indicate the row and column positions of these multiple values in the multidimensional form and the member corresponding to each value among the multiple dimension members.
  • the database management system 200 first requests the multidimensional database 300 to retrieve the multiple values corresponding to the multiple dimension members in the multidimensional database 300. Then, the multidimensional database 300 responds to the request and sends the multiple values back to the database management system 200.
  • the database management system 200 can directly send information (such as ID or name) of multiple dimension members to the multidimensional database 300. Then, the multidimensional database 300 extracts the corresponding values of the multiple dimension members in the multidimensional database 300 based on the received information, and then returns the multiple values to the database management system 200.
  • information such as ID or name
  • the multidimensional form in Figure 2 is associated with eight dimension members.
  • the database management system 200 can send the IDs of these eight dimension members to the multidimensional database 300, which is equivalent to extending the data query scope to the multidimensional database 300. Then, based on the IDs of these eight dimension members, the multidimensional database 300 extracts the corresponding values of these eight dimension members in the multidimensional database 300 and returns the extracted values to the database management system 200.
  • the database management system 200 may first calculate the member tuple for each of the multiple values, and then send the member tuple corresponding to each value to the multidimensional database 300.
  • the multidimensional database 300 extracts the value at the corresponding position in the multidimensional database 300, which is the value corresponding to the member tuple, and then returns the value and the member tuple to the database management system 200.
  • the database management system 200 can use the Cartesian product algorithm to calculate the member tuples for each of the multiple values. For details, please refer to the previous description; it will not be repeated here. Then, the database management system 200 can send the member tuple of each value to the multidimensional database 300 to request the value corresponding to each member tuple. For any received member tuple, the multidimensional database 300 can extract a value from the corresponding position of that member tuple in the multidimensional database 300, and then return that value along with the member tuple to the database management system 200.
  • the database management system 200 When the database management system 200 obtains multiple values from the multidimensional database 300, it can fill each value into a cell in the multidimensional form that corresponds to the same member tuple, and then use the row and column position of the cell in the multidimensional form as the position information of the value.
  • the database management system 200 has obtained 12 values from the multidimensional database 300, one of which is 100.
  • the member tuples for this value include 2015, Product A, Sales Volume, and Region 1. Since the cell in row 0, column 0 of the multidimensional form also corresponds to this member tuple, the database management system 200 can fill this value into that cell and use the row and column position of that cell in the multidimensional form as the row and column position of the value, i.e., row 0, column 0. It can be understood that other values besides the 12 can also be filled into corresponding cells and their row and column positions determined in a similar way; this will not be discussed further here.
  • the multidimensional form shown in Figure 3 can be obtained, and the position information can be determined.
  • the position information is used to indicate the row and column position of each of the 12 values and the member tuple of each value (i.e., the member corresponding to each value in the multiple dimensions associated with multiple forms).
  • the database management system 200 converts the data into an array and compresses the location information to obtain compressed information.
  • the data consists of multiple values corresponding to various dimensions in the multidimensional database 300. These values can be written into an array according to their order in the multidimensional form. For details on converting the obtained values into an array, please refer to the previous explanation; it will not be repeated here.
  • Location information is used to indicate the row and column positions of multiple values in a multidimensional form and the member corresponding to each value among multiple dimensions.
  • the database management system 200 can first determine the correspondence between different row numbers in the multidimensional form and multiple dimension members based on the location information, and then generate compressed information to indicate this correspondence.
  • the database management system 200 when it receives the multidimensional form in Figure 3, it can determine the location information.
  • This location information indicates the row and column positions of the 12 values and the corresponding member of each value among multiple dimension members. Then, the database management system 200 can determine the dimension members corresponding to each row number in the multidimensional form based on the location information.
  • the dimension members corresponding to row number 0 include 2015, product A, and sales volume; row number 1 includes 2015, product B, and sales volume; row number 2 includes 2015, product C, and sales volume; row number 3 includes 2016, product A, and sales volume; row number 4 includes 2016, product B, and sales volume; and row number 5 includes 2016, product C, and sales volume.
  • the database management system 200 can generate compressed information based on the previously determined correspondence between the 6 row numbers and dimension members.
  • the compressed information is used to indicate the above correspondence.
  • the compressed information includes the above correspondence.
  • the compressed information includes the target row number, the operands corresponding to the first dimension, and the order relationship between members belonging to the first dimension among multiple dimension members associated with the multidimensional form.
  • the first dimension is one of the multiple dimensions associated with the multidimensional form (it can be any dimension associated with a row structure)
  • the target row number is any row number in the multidimensional form
  • the target row number corresponds to a dimension member under the first dimension (denoted as the first dimension member)
  • the index value of the first dimension member in the above order relationship is equal to the remainder obtained by dividing the first value by the number of members belonging to the first dimension among the multiple dimension members
  • the first value is the quotient obtained by dividing the target row number by the operands of the first dimension.
  • the database management system 200 can also determine the correspondence between different column numbers in the multidimensional form and multiple dimension members associated with the multidimensional form based on the location information, and then carry the correspondence in the compressed information, or generate information in the compressed information to indicate the correspondence.
  • the database management system 200 when the database management system 200 receives the multidimensional form in Figure 3, it can determine the location information. This location information indicates the row and column positions of the 12 values and the member corresponding to each value among multiple dimension members. Then, the database management system 200 can determine the dimension member corresponding to each column number in the multidimensional form based on the location information. For example, column number 0 corresponds to region 1, and column number 2 corresponds to region 2. At this point, the database management system 200 can directly include this correspondence in the compressed information, or generate information to indicate this correspondence.
  • This information includes the target column number, the operands corresponding to the second dimension, and the order relationship between members belonging to the second dimension among the multiple dimension members associated with the multidimensional form.
  • the second dimension is one of the multiple dimensions associated with the multidimensional form (it can be any dimension in the column structure)
  • the target column number is any column number in the multidimensional form
  • the target column number corresponds to a dimension member under the second dimension (denoted as the second dimension member)
  • the index value of the second dimension member in the above order relationship is equal to the remainder obtained by dividing the second value by the number of members belonging to the second dimension among the multiple dimension members
  • the second value is the quotient obtained by dividing the target column number by the operands of the second dimension.
  • the compression information also includes a row number array, which contains different row numbers from the multidimensional form.
  • the length of the row number array is less than or equal to the product of the number of members in each dimension associated with the multidimensional form, and the length of the row number array is less than or equal to the product of the number of members in each dimension corresponding to the row structure of the multidimensional form.
  • the length of the row number array is less than the product of the number of members in each dimension corresponding to the row structure of the multidimensional form, thereby reducing the amount of data transmitted to the client 100. If one or more rows in the multidimensional form are not cleared, the length of the row number array is equal to the product of the number of members in each dimension corresponding to the row structure of the multidimensional form.
  • the compressed information may also include a column number array, which includes the different column numbers in the multidimensional form.
  • the length of the column number array is less than or equal to the product of the number of members in each dimension corresponding to the column structure of the multidimensional form. As described above, if one or more columns in the multidimensional form are cleared, the length of the column number array is less than the product of the number of members in each dimension corresponding to the column structure of the multidimensional form. If one or more rows in the multidimensional form are not cleared, the length of the column number array is equal to the product of the number of members in each dimension corresponding to the column structure of the multidimensional form.
  • the database management system 200 transmits query results to the client 100.
  • the query results include arrays and compressed information.
  • the query results may also include style metadata, which indicates the style used when the client displays multiple values.
  • style metadata indicates the style used when the client displays multiple values.
  • the query results also include status information, which indicates the status of multiple values in the multidimensional database 300.
  • Status includes writable and read-only states. Status information can be represented as an array of cell statuses. For details on cell value status arrays, please refer to the previous section; they will not be repeated here.
  • S606 and Client 100 display multidimensional forms based on query results.
  • the database management system 200 first determines the multiple dimension members associated with the multidimensional form based on the query results sent by the client 100. Then, based on these multiple dimension members, it determines the data and location information.
  • the data consists of multiple values corresponding to the multiple dimension members in the multidimensional database 300.
  • the location information indicates the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value among the aforementioned multiple dimension members.
  • the data is then converted into an array, and the location information is compressed to obtain compressed information. Finally, the array and compressed information are carried in the query results for transmission to the client 100.
  • the method provided in this application compresses the location information and then sends the compressed information and the generated array (including the aforementioned values) to client 100. This reduces the overall data transmission volume from database management system 200 to client 100, thereby shortening data transmission time.
  • the array is filled with the values according to their order in the multidimensional form. When client 100 receives this array, it can directly load these values into the multidimensional form displayed on client 100 according to the order of the values in the array, improving the form display speed on client 100 and thus enhancing user experience.
  • This application also provides a data processing apparatus, which includes a receiving module 210, a processing module 220, and a transmitting module 230 as shown in FIG1.
  • This apparatus is specifically used to execute the method steps of the database management system 200 shown in FIG6.
  • FIG6 For details regarding the specific functions and hardware/software implementation of the receiving module 210, processing module 220, and transmitting module 230, please refer to the relevant description in FIG1, which will not be repeated here.
  • this application also provides a computing device 700, including a bus 702, a processor 704, a memory 706, and a communication interface 708.
  • the processor 704, the memory 706, and the communication interface 708 communicate with each other via the bus 702.
  • the computing device 700 may be a server, a laptop computer, a desktop computer, an edge device, etc., and this application does not specifically limit the number of processors and memories in the computing device 700.
  • Bus 702 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one line is used in Figure 7, but this does not imply that there is only one bus or one type of bus. Bus 702 can include pathways for transmitting information between various components of computing device 700 (e.g., memory 706, processor 704, communication interface 708).
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • Processor 704 may include any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).
  • CPU central processing unit
  • GPU graphics processing unit
  • MP microprocessor
  • DSP digital signal processor
  • the memory 706 may include volatile memory, such as random access memory (RAM).
  • RAM random access memory
  • the processor 704 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
  • ROM read-only memory
  • HDD hard disk drive
  • SSD solid state drive
  • the memory 706 stores executable program code.
  • the processor 704 executes the executable program code to implement the functions of the receiving module 210, processing module 220 and sending module 230 in FIG1, respectively, thereby implementing the method steps of the database management system 200 in FIG6 of this application.
  • the communication interface 708 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 700 and other devices or communication networks.
  • transceiver modules such as, but not limited to, network interface cards and transceivers
  • the computing device 700 may correspond to the database management system 200 or client 100 shown in FIG1 of this application, and may correspond to the corresponding subject in executing the data processing methods shown in FIG2 to FIG6 of this application.
  • Each module of the computing device 700 is for implementing the corresponding process of each method in FIG2 to FIG6. For the sake of brevity, it will not be described in detail here.
  • the computing device 700 may also include a chip system, which includes a processor and a power supply circuit.
  • the power supply circuit supplies power to the processor, and the processor executes the operation steps corresponding to the data processing method.
  • the processor can be implemented using a CPU, or it can be implemented using computing devices or AI chips such as GPUs, DPUs, NPUs, XPUs, SoCs, offloading cards, or accelerator cards.
  • the computing device 700 may include multiple types of processors 704, meaning the computing device 700 is a heterogeneous device.
  • the computing device 700 may include a CPU and a GPU, and the operation steps corresponding to the data processing method can be executed by at least one of the processors 704.
  • the processors 704. For the sake of brevity, further details will not be provided here.
  • the computing device cluster includes at least one computing device.
  • the computing device can be a server, such as a central server, an edge server, or a local server in a local data center.
  • the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
  • the computing device cluster includes at least one computing device 700.
  • the memory 706 of one or more computing devices 700 in the computing device cluster may store the same instructions for executing the methods on the database management system 200 side of Figure 6.
  • the memory 706 of one or more computing devices 700 in the computing device cluster may also store partial instructions for executing the methods on the database management system 200 side of FIG6.
  • a combination of one or more computing devices 700 can jointly execute instructions for the methods on the database management system 200 side of FIG6.
  • the memory 706 in different computing devices 700 within the computing device cluster can store different instructions, which are used to execute some functions of the database management system 200 in Figure 1. That is, the instructions stored in the memory 706 of different computing devices 700 can implement the functions of one or more modules among the receiving module 210, processing module 220, and sending module 230.
  • one or more computing devices in a computing device cluster can be connected via a network.
  • This network can be a wide area network (WAN) or a local area network (LAN), etc.
  • Figure 9 illustrates one possible implementation.
  • two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device.
  • the memory 706 in computing device 700A stores instructions for performing the functions of the receiving module 210 and the transmitting module 230.
  • the memory 706 in computing device 700B stores instructions for performing the functions of the processing module 220.
  • computing device 700A shown in Figure 9 can also be performed by multiple computing devices 700.
  • the function of computing device 700B can also be performed by multiple computing devices 700.
  • This application also provides another computing device cluster.
  • the connection relationship between the computing devices in this computing device cluster can be similar to the connection method of the computing device cluster shown in FIG9. The difference is that the memory 706 in one or more computing devices 700 in this computing device cluster can store the same instructions for executing the methods on the database management system 200 side of FIG6.
  • the memory 706 of one or more computing devices 700 in the computing device cluster may also store partial instructions for executing the methods that implement the database management system 200 side of FIG6.
  • a combination of one or more computing devices 700 can jointly execute instructions for implementing the method steps of the database management system 200 side of FIG6.
  • the computer-readable storage medium can be any available medium capable of being 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., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).
  • the computer-readable storage medium includes instructions that instruct a cluster of computing devices (including at least one computing device) to perform the method steps of the database management system 200 side of FIG. 6.
  • the computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any available medium.
  • the computer program product When the computer program product is run on at least one computing device, it causes the at least one computing device to perform the method steps of the database management system 200 side of FIG6.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application provides a data processing method and apparatus, a computing device, and a storage medium. The method comprises: a database management system receives a query request sent by a client, determines, on the basis of the query request, a plurality of dimension members associated with a multi-dimensional form, determines data and position information on the basis of the plurality of dimension members, then converts the data into an array, compresses the position information to obtain compressed information, and finally transmits a query result to a client, wherein the query result comprises the array and the compressed information. The query request is used for indicating data query processing of a multi-dimensional form associated with a multi-dimensional database, the plurality of dimension members belong to a plurality of dimensions in the multi-dimensional database, the data is a plurality of values corresponding to the plurality of dimension members in the multi-dimensional database, and the position information is used for indicating row and column positions of the plurality of values in the multi-dimensional form and the corresponding member of each value among the plurality of dimension members. The method of the present application can reduce the amount of data transmission and the transmission duration.

Description

数据处理方法、装置、计算设备及存储介质Data processing methods, apparatus, computing devices and storage media

本申请要求于2024年04月30日提交中国专利局、申请号为202410547898.8、申请名称为"数据处理方法、装置、计算设备及存储介质"的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 202410547898.8, filed on April 30, 2024, entitled "Data Processing Method, Apparatus, Computing Device and Storage Medium", the entire contents of which are incorporated herein by reference.

技术领域Technical Field

本申请涉及多维数据库(Multi Dimension Data,MDD)技术领域,尤其涉及一种数据处理方法、装置、计算设备及存储介质。This application relates to the field of multi-dimensional data (MDD) technology, and more particularly to a data processing method, apparatus, computing device, and storage medium.

背景技术Background Technology

多维数据库是一种用于处理多维数据的数据库,它以多维数组(或者说多维数据立方体,Cube)的形式来组织和存储数据,多维数组的每个维度表示一个观察数据的角度,每个维度包括多个维度成员(维度成员即维度的取值),多维数组中的每个元素表示一个度量值。为便于用户查看或编辑多维数据库中的数据,多维数据库中的数据通常是以表单形式向用户显示的。而为了在客户端上正确构建和显示表单,数据库管理系统需要先将多维数据库中与表单相关的信息发送至客户端。A multidimensional database is a type of database used to process multidimensional data. It organizes and stores data in the form of multidimensional arrays (or multidimensional data cubes). Each dimension of the multidimensional array represents an observation of the data, and each dimension includes multiple dimension members (i.e., the values that the dimension can take). Each element in the multidimensional array represents a measure. To facilitate user viewing or editing of data in a multidimensional database, the data is typically displayed to the user in the form of forms. However, to correctly construct and display these forms on the client side, the database management system first needs to send the form-related information from the multidimensional database to the client.

目前的一种实现方案是,数据库管理系统确定待显示的多维表单在多维数据库中对应的所有值,并确定每个值在表单中的行列坐标和每个值对应的维度成员,然后将每个值、每个值的行列坐标以及每个值与维度成员的对应关系全都传输至客户端。然而,该方案需要传输的数据量较大,导致数据传输时间较长,难以支持在客户端上显示值的数量较多的多维表单。One current implementation involves the database management system determining all values in the multidimensional form to be displayed within the multidimensional database, as well as the row and column coordinates of each value in the form and the corresponding dimension member. This information is then transmitted to the client along with each value, its row and column coordinates, and the correspondence between each value and its dimension member. However, this approach requires transmitting a large amount of data, resulting in lengthy data transmission times and making it unsuitable for multidimensional forms with a large number of values to display on the client side.

发明内容Summary of the Invention

本申请提供了一种数据处理方法、装置、计算设备及存储介质,能够减少传输数据量。This application provides a data processing method, apparatus, computing device, and storage medium that can reduce the amount of data transmitted.

第一方面,本申请提供一种数据处理方法,该方法由数据库管理系统执行,该方法包括:数据库管理系统接收客户端发送的查询请求,然后根据查询请求确定多维表单关联的多个维度成员,再根据多个维度成员确定数据和位置信息,随后将数据转换为数组,并对位置信息进行压缩得到压缩信息,最后向客户端传输查询结果,查询结果包括数组和压缩信息。其中,查询请求用于指示对多维数据库关联的多维表单的数据查询处理,多个维度成员属于多维数据库中的多个维度,数据为多个维度成员在多维数据库中对应的多个值,位置信息用于指示多个值在多维表单中的行列位置以及每个值在所述多个维度成员中对应的成员。Firstly, this application provides a data processing method executed by a database management system. The method includes: the database management system receiving a query request from a client; determining multiple dimension members associated with a multidimensional form based on the query request; determining data and location information based on the multiple dimension members; converting the data into an array; compressing the location information to obtain compressed information; and finally transmitting the query result to the client. The query result includes the array and the compressed information. The query request instructs data query processing for a multidimensional form associated with a multidimensional database. The multiple dimension members belong to multiple dimensions in the multidimensional database. The data consists of multiple values corresponding to the multiple dimension members in the multidimensional database. The location information indicates the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value among the multiple dimension members.

相较于将多维表单中的所有值以及每个值的行列坐标及对应的维度成员直接发送至客户端的常规方案,本方案通过对位置信息进行压缩,随后将压缩得到的压缩信息和生成的数组(包括上述多个值)发送至客户端,从而减少数据库管理系统向客户端的整体数据传输量,进而缩短了数据传输时间。Compared to the conventional approach of directly sending all values from a multidimensional form, along with the row and column coordinates of each value and its corresponding dimension members, to the client, this approach reduces the overall data transmission volume from the database management system to the client by compressing the location information and then sending the compressed information and the generated array (including the aforementioned values) to the client, thereby shortening the data transmission time.

基于第一方面,在可能的实施方案中,数据库管理系统可以按照多个值在多维表单中的排列顺序,将这多个值写入数组中,进而将该数组传输至客户端。应理解,由于数据库管理系统是按照多个值在多维表单中的排列顺序来将这多个值填入数组中的,因此,当客户端接收到该数组时,可以直接按照该数组中的这多个值的顺序在多维表单中加载这多个值,有助于提升客户端的表单显示速度,进而提升用户体验。Based on the first aspect, in a possible implementation, the database management system can write the multiple values into an array according to their order in the multidimensional form, and then transmit the array to the client. It should be understood that since the database management system fills the array with the multiple values according to their order in the multidimensional form, when the client receives the array, it can directly load the multiple values into the multidimensional form according to the order of the values in the array. This helps improve the form display speed on the client side, thereby enhancing the user experience.

在一种可能实现方式中,位置信息包括行号,数据库管理系统可以先根据位置信息确定多维表单的不同行号与上述多个维度成员的对应关系,然后生成压缩信息,压缩信息用于指示上述对应关系。In one possible implementation, the location information includes row numbers. The database management system can first determine the correspondence between different row numbers of the multidimensional form and the above-mentioned multiple dimension members based on the location information, and then generate compressed information to indicate the above-mentioned correspondence.

在本方案中,数据库管理系统先根据位置信息确定表单中的不同行号与上述多个维度成员之间的对应关系,每个行号对应上述多个维度中的部分维度成员,不同行号对应的维度成员不完全相同,每个行号对应多维表单关联的多个维度中的每个维度下的一个维度成员,表单中的每一行包括一个或多个值。然后,数据库管理系统生成用于指示上述对应关系的压缩信息,将压缩信息发送至客户端。也就是说,数据库管理系统将不同值与行列坐标以及维度成员的对应关系,转换为了不同行与维度成员的对应关系,而行的数量通常是远小于值的数量,因此,相较于直接将多维表单中的每个值的行列坐标以及每个值与维度成员的对应关系传输至客户端的常规方案,本方案可以在一定程度上减少数据传输量。In this solution, the database management system first determines the correspondence between different row numbers in the form and the aforementioned multiple dimension members based on location information. Each row number corresponds to a portion of the dimension members, and the dimension members corresponding to different row numbers are not entirely the same. Each row number corresponds to a dimension member under each of the multiple dimensions associated with the multidimensional form, and each row in the form includes one or more values. Then, the database management system generates compressed information to indicate the above correspondence and sends the compressed information to the client. In other words, the database management system converts the correspondence between different values and row/column coordinates and dimension members into the correspondence between different rows and dimension members. Since the number of rows is usually much smaller than the number of values, compared to the conventional solution of directly transmitting the row/column coordinates of each value in the multidimensional form and the correspondence between each value and dimension members to the client, this solution can reduce the amount of data transmission to a certain extent.

如果表单的列数大于1,则位置信息还可以包括列号,数据库管理系统可以先根据位置信息确定多维表单的不同列号与上述多个维度成员的对应关系,然后生成另一份压缩信息,该压缩信息用于指示上述对应关系,进而将该压缩信息发送至客户端。If the number of columns in the form is greater than 1, the location information can also include the column number. The database management system can first determine the correspondence between the different column numbers of the multidimensional form and the above-mentioned multiple dimension members based on the location information, and then generate another compressed information, which is used to indicate the above correspondence, and then send the compressed information to the client.

在另一种可能实现方式中,压缩信息包括目标行号、第一维度对应的运算数和多个维度成员中属于第一维度的成员之间的顺序关系,第一维度是多个维度中的其中一个维度,目标行号对应的第一维度成员在上述顺序关系中的索引值等于第一值除以多个维度成员中属于第一维度的成员数量得到的余数,第一维度成员属于第一维度,第一值为目标行号除以运算数得到的商。其中,若多个维度中位于第一维度之后的其他维度的数量为零,则运算数的值为1,若其他维度的数量为1,则运算数的值为多维表单关联的其他维度的成员数量,若其他维度的数量大于1,则运算数的值为多维表单关联的其他维度的成员数量的乘积。In another possible implementation, the compressed information includes the target row number, the operand corresponding to the first dimension, and the order relationship among members belonging to the first dimension among multiple dimension members. The first dimension is one of multiple dimensions. The index value of the first dimension member corresponding to the target row number in the above order relationship is equal to the remainder obtained by dividing the first value by the number of members belonging to the first dimension among multiple dimension members. The first dimension member belongs to the first dimension, and the first value is the quotient obtained by dividing the target row number by the operand. Specifically, if the number of other dimensions following the first dimension is zero, the operand value is 1; if the number of other dimensions is 1, the operand value is the number of members of other dimensions associated with the multidimensional form; if the number of other dimensions is greater than 1, the operand value is the product of the number of members of other dimensions associated with the multidimensional form.

在本方案中,数据库管理系统在压缩信息中携带了目标行号、第一维度对应的运算数和多个维度成员中属于第一维度的成员之间的顺序关系,当客户端接收到该压缩信息时,可以根据目标行号(可以是表单中的任一行号)和第一维度对应的运算数计算出目标行号对应的第一维度成员在上述顺序关系中的索引值,然后基于计算的索引值在上述顺序关系中确定第一维度成员。也就是说,目标行号、第一维度对应的运算数和上述顺序关系隐含了目标行号和第一维度成员之间的对应关系,客户端根据目标行号、第一维度对应的运算数和上述顺序关系进行计算即可确定目标行号对应第一维度下的第一维度成员。目标行号对应的其他维度下的维度成员,也可以通过类似方式计算得到。In this solution, the database management system includes the target row number, the operands corresponding to the first dimension, and the order relationship between members belonging to the first dimension among multiple dimension members in the compressed information. When the client receives this compressed information, it can calculate the index value of the first dimension member corresponding to the target row number in the above order relationship based on the target row number (which can be any row number in the form) and the operands corresponding to the first dimension. Then, based on the calculated index value, it determines the first dimension member in the above order relationship. In other words, the target row number, the operands corresponding to the first dimension, and the above order relationship implicitly contain the correspondence between the target row number and the first dimension members. The client can determine the first dimension member under the first dimension corresponding to the target row number by calculating based on the target row number, the operands corresponding to the first dimension, and the above order relationship. Dimension members under other dimensions corresponding to the target row number can also be calculated in a similar way.

在另一种可能实现方式中,压缩信息还包括行号数组,行号数组包括多维表单的不同行号,行号数组的长度小于或等于多维表单关联的每个维度的成员数量的乘积。In another possible implementation, the compressed information also includes a row number array, which contains the different row numbers of the multidimensional form, and the length of the row number array is less than or equal to the product of the number of members of each dimension associated with the multidimensional form.

本方案是通过一个行号数组来指示表单有多少行,客户端根据该行号数组和前面描述的包括表单中的多个值的数组,即可按照行号的顺序在表单中快速填充这多个值,从而提升表单在客户端的显示速度。This solution uses a row number array to indicate the number of rows in the form. Based on this row number array and the previously described array containing multiple values from the form, the client can quickly fill in these values in the form according to the row number order, thereby improving the form's display speed on the client.

在另一种可能实现方式中,查询结果还包括样式元数据,样式元数据用于指示客户端显示上述多个值时采用的样式。比如,样式可以是字号、字体、对其方式、是否加粗、背景颜色、值所在的单元格的尺寸等等,本申请对此不做具体限定,当客户端接收到样式元数据时,可以根据样式元数据来控制上述多个值在表单中显示时采用的样式。In another possible implementation, the query results also include style metadata, which indicates the style used by the client when displaying the above values. For example, the style can be font size, font, alignment, whether it is bold, background color, the size of the cell containing the value, etc. This application does not make specific limitations on this. When the client receives the style metadata, it can control the style used when the above values are displayed in the form based on the style metadata.

在另一种可能实现方式中,查询结果还包括状态信息,状态信息用于指示多个值在多维数据库中的状态,状态包括可写状态和只读状态。其中,可写状态表示可以进行修改,只读状态表示不允许进行修改,客户端可以根据值的状态控制是否允许用户在客户端上执行修改值的操作。In another possible implementation, the query results also include status information, which indicates the status of multiple values in the multidimensional database. The status includes writable and read-only states. A writable state indicates that the value can be modified, while a read-only state indicates that modification is not allowed. The client can control whether users are allowed to modify the value on the client based on the value's status.

第二方面,本申请还提供一种数据处理装置,所述数据处理装置包括用于执行第一方面或第一方面任一种可能实现方式中的数据处理方法的各个模块。Secondly, this application also provides a data processing apparatus, which includes modules for performing the data processing method in the first aspect or any possible implementation of the first aspect.

第三方面,本申请还提供一种计算设备,包括处理器和存储器。该处理器用于执行该存储器中存储的指令,以使得计算设备执行如第一方面中任一可能实现方式所述方法的操作步骤。Thirdly, this application also provides a computing device including a processor and a memory. The processor is configured to execute instructions stored in the memory to cause the computing device to perform operational steps of the method as described in any possible implementation of the first aspect.

第四方面,本申请还提供一种计算设备集群,包括至少一个计算设备,每个计算设备包括处理器和存储器。上述至少一个计算设备的处理器用于执行上述至少一个计算设备的存储器中存储的指令,以使得该计算设备集群执行如第一方面中任一可能实现方式所述方法的操作步骤。Fourthly, this application also provides a computing device cluster, including at least one computing device, each computing device including a processor and a memory. The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the operational steps of the method as described in any possible implementation of the first aspect.

第五方面,本申请还提供一种芯片系统,所述芯片系统包括处理器和供电电路,供电电路用于对处理器执行供电,处理器用于执行第一方面或第一方面中任一可能实现方式所对应方法的操作步骤。Fifthly, this application also provides a chip system, the chip system including a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, and the processor being used to execute the operation steps of the method corresponding to the first aspect or any possible implementation of the first aspect.

第六方面,本申请还提供一种计算机可读存储介质,包括计算机程序指令,当上述计算机程序指令由计算设备集群(包括至少一个计算设备)执行时,该计算设备集群执行如第一方面中任一可能实现方式所述方法的操作步骤。In a sixth aspect, this application also provides a computer-readable storage medium including computer program instructions that, when executed by a cluster of computing devices (including at least one computing device), perform the operational steps of the method as described in any possible implementation of the first aspect.

第七方面,本申请还提供一种包含指令的计算机程序产品。当上述指令被计算设备集群(包括至少一个计算设备)运行时,使得该计算设备集群执行如第一方面中任一可能实现方式所述方法的操作步骤。In a seventh aspect, this application also provides a computer program product containing instructions. When the instructions are executed by a cluster of computing devices (including at least one computing device), the cluster of computing devices causes the cluster of computing devices to perform the operational steps of the method as described in any possible implementation of the first aspect.

本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.

附图说明Attached Figure Description

图1是本申请提供的一种系统架构图;Figure 1 is a system architecture diagram provided in this application;

图2是本申请提供的一种多维表单的示意图;Figure 2 is a schematic diagram of a multidimensional form provided in this application;

图3是本申请提供的另一种多维表单的示意图;Figure 3 is a schematic diagram of another multidimensional form provided in this application;

图4是本申请提供的一种查询结果的结构示意图;Figure 4 is a schematic diagram of the structure of a query result provided in this application;

图5是本申请提供的一种消空后的多维表单的示意图;Figure 5 is a schematic diagram of a multidimensional form after blanking provided in this application;

图6是本申请提供的一种数据处理方法的流程示意图;Figure 6 is a flowchart illustrating a data processing method provided in this application;

图7是本申请提供的一种计算设备的结构示意图;Figure 7 is a schematic diagram of the structure of a computing device provided in this application;

图8是本申请提供的一种计算设备集群的示意图;Figure 8 is a schematic diagram of a computing device cluster provided in this application;

图9是本申请提供的两个计算设备通过网络进行交互的示意图。Figure 9 is a schematic diagram of two computing devices provided in this application interacting via a network.

具体实施方式Detailed Implementation

本申请提供一种数据处理方法,该方法由数据库管理系统执行,该系统先接收客户端发送的查询请求,然后根据查询请求确定多维表单关联的多个维度成员,再根据多个维度成员确定数据和位置信息,随后将数据转换为数组,并对位置信息进行压缩得到压缩信息,最后向客户端传输查询结果,查询结果包括数组和压缩信息。其中,查询请求用于指示对多维数据库关联的多维表单的数据查询处理,多个维度成员属于多维数据库中的多个维度,数据为多个维度成员在多维数据库中对应的多个值,位置信息用于指示多个值在多维表单中的行列位置以及每个值在所述多个维度成员中对应的成员。This application provides a data processing method executed by a database management system. The system first receives a query request from a client, then determines multiple dimension members associated with a multidimensional form based on the query request, and then determines data and location information based on the multiple dimension members. Subsequently, the data is converted into an array, and the location information is compressed to obtain compressed information. Finally, the query result, including the array and the compressed information, is transmitted to the client. The query request instructs the data query processing of a multidimensional form associated with a multidimensional database. The multiple dimension members belong to multiple dimensions in the multidimensional database. The data consists of multiple values corresponding to the multiple dimension members in the multidimensional database. The location information indicates the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value among the multiple dimension members.

相较于将多维表单中的所有值以及每个值的行列坐标及对应的维度成员直接发送至客户端的常规方案,该系统通过对位置信息进行压缩,随后将压缩得到的压缩信息和生成的数组(包括上述多个值)发送至客户端,从而减少了数据传输量,进而缩短了数据传输时间。Compared to the conventional approach of directly sending all values in a multidimensional form, along with the row and column coordinates of each value and its corresponding dimension members, to the client, this system reduces the amount of data transmitted and thus shortens the data transmission time by compressing the location information and then sending the compressed information and the generated array (including the aforementioned values) to the client.

下面对本申请提供的数据库管理系统进行详细介绍。The database management system provided in this application will be described in detail below.

请参见图1,图1是本申请提供的一种系统架构图,包括客户端100、数据库管理系统200和多维数据库300。客户端100和数据库管理系统200之间具有通信连接,可以是有线连接或无线连接,与数据库管理系统200建立通信连接的客户端100的数量可以是一个或多个(图1只是以一个客户端100为例),本申请对此不做具体限定。类似的,多维数据库300与数据库管理系统200之间具有通信连接,可以是有线连接或无线连接,与数据库管理系统200建立通信连接的多维数据库300的数量可以是一个或多个(图1只是以一个多维数据库300为例),本申请实施例也不做具体限定。Please refer to Figure 1, which is a system architecture diagram provided in this application, including a client 100, a database management system 200, and a multidimensional database 300. The client 100 and the database management system 200 have a communication connection, which can be a wired connection or a wireless connection. The number of clients 100 establishing a communication connection with the database management system 200 can be one or more (Figure 1 only shows one client 100 as an example), and this application does not specifically limit this. Similarly, the multidimensional database 300 and the database management system 200 have a communication connection, which can be a wired connection or a wireless connection. The number of multidimensional databases 300 establishing a communication connection with the database management system 200 can be one or more (Figure 1 only shows one multidimensional database 300 as an example), and this application embodiment does not specifically limit this either.

客户端100用于实现人机交互,可以部署在终端设备或计算设备上。其中,终端设备可以是智能手机、可穿戴设备、笔记本电脑、平板电脑、车载设备或智能会议设备等,计算设备可以是服务器、个人电脑(personal computer,PC)等等,本申请实施例均不做具体限定。The client 100 is used to implement human-computer interaction and can be deployed on terminal devices or computing devices. The terminal device can be a smartphone, wearable device, laptop, tablet, in-vehicle device, or smart conferencing device, etc., and the computing device can be a server, personal computer (PC), etc. The embodiments of this application do not make specific limitations.

在一些具体实现中,客户端100可以是在如智能手机、可穿戴设备等移动终端上运行的应用程序(application,APP)客户端/移动客户端,也可以是在计算设备上运行的软件或应用程序(如PC客户端),也可以是基于网页(web)浏览器访问的web客户端,还可以是云平台的前端控制台(console),本申请对此不做具体限定。In some specific implementations, client 100 can be an application (APP) client/mobile client running on a mobile terminal such as a smartphone or wearable device, or software or application running on a computing device (such as a PC client), or a web client accessed through a web browser, or a front-end console of a cloud platform. This application does not specifically limit it in this regard.

数据库管理系统200,用于管理多维数据库300,数据库管理系统200可以部署在一个计算设备、多个计算设备组成的计算设备集群或终端设备上。其中,计算设备可以是物理服务器、虚拟机、容器或边缘计算设备等。虚拟机指的是通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。在计算设备中创建虚拟机时,需要将实体机的部分硬盘和内存容量作为虚拟机的硬盘和内存容量。每个虚拟机都有独立的基础输入/输出系统(basic input/output system,BIOS)、硬盘和操作系统,可以像使用实体机一样对虚拟机进行操作。容器是一种便携式软件单元,可以将应用及其所有依赖项合并为一个软件包,该软件包不受底层主机操作系统的限制,这样无需再构建复杂的环境,简化了应用开发到部署的过程。边缘计算设备是指更加接近数据源和终端用户,具有低延迟、高带宽特点的设备,如智能路由、边缘服务器等,本申请对此不做具体限定。终端设备可参考前面的描述,这里不赘述。A database management system 200 is used to manage a multidimensional database 300. The database management system 200 can be deployed on a single computing device, a cluster of multiple computing devices, or a terminal device. The computing device can be a physical server, a virtual machine, a container, or an edge computing device. A virtual machine refers to a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. When creating a virtual machine on a computing device, a portion of the physical machine's hard drive and memory capacity is used as the virtual machine's hard drive and memory capacity. Each virtual machine has an independent basic input/output system (BIOS), hard drive, and operating system, and can be operated like a physical machine. A container is a portable software unit that can combine an application and all its dependencies into a single software package. This package is not limited by the underlying host operating system, thus eliminating the need to build complex environments and simplifying the application development and deployment process. Edge computing devices refer to devices closer to the data source and end users, characterized by low latency and high bandwidth, such as intelligent routers and edge servers; this application does not specifically limit this. Terminal devices are described above and will not be elaborated upon here.

多维数据库300是一种用于存储多维数据的数据库,它以多维数组(或者说多维数据立方体,Cube)的形式来组织和存储数据,多维数组的每个维度表示一个观察数据的角度/方面/方向,每个维度下包括一个或多个维度成员,即该维度的取值可以有一个或多个,多维数组中的每个元素表示一个度量值。Multidimensional Database 300 is a database used to store multidimensional data. It organizes and stores data in the form of multidimensional arrays (or multidimensional data cubes). Each dimension of the multidimensional array represents an angle/aspect/direction of observing data. Each dimension includes one or more dimension members, that is, the dimension can have one or more values. Each element in the multidimensional array represents a metric.

例如,假设多维数据库300包括公司维度、年维度、产品维度、地区维度、科目(即会计科目)维度等维度,其中,公司维度包括A公司、B公司等维度成员,年维度包括2019年、2020年、2021年等维度成员,产品维度包括产品1、产品2、产品3等维度成员,地区维度包括地区1、地区2等维度成员,科目维度包括销售额、销量、库存量、利润率等维度成员。需要说明的是,此例中给出的维度、维度成员的数量和类型仅作为示例,不构成具体限定,在实际应用场景中,多维数据库300还可以设置更多或更少的维度,每个维度下可以设置一个或多个维度成员,本申请对此不做具体限定。For example, suppose a multidimensional database 300 includes dimensions such as company, year, product, region, and account (i.e., accounting subject) dimensions. The company dimension includes members such as Company A and Company B; the year dimension includes members such as 2019, 2020, and 2021; the product dimension includes members such as Product 1, Product 2, and Product 3; the region dimension includes members such as Region 1 and Region 2; and the account dimension includes members such as sales revenue, sales volume, inventory, and profit margin. It should be noted that the number and types of dimensions and members given in this example are for illustrative purposes only and do not constitute specific limitations. In practical applications, a multidimensional database 300 can have more or fewer dimensions, and each dimension can have one or more members. This application does not impose specific limitations on this.

可选地,客户端100和数据库管理系统200可以部署在相同的终端设备或计算设备上;或者,客户端100部署在终端设备上,数据库管理系统200部署在单个计算设备或计算设备集群上。类似的,多维数据库300和数据库管理系统200可以部署在相同或不同的计算设备或终端设备上,本申请实施例也不具体限定。应理解,举例仅用于说明,具体可根据实际应用场景决定客户端100、数据库管理系统200和多维数据库300的部署情况。Optionally, the client 100 and the database management system 200 can be deployed on the same terminal device or computing device; or, the client 100 can be deployed on a terminal device, and the database management system 200 can be deployed on a single computing device or a cluster of computing devices. Similarly, the multidimensional database 300 and the database management system 200 can be deployed on the same or different computing devices or terminal devices, and this application embodiment is not specifically limited. It should be understood that the examples are for illustration only, and the specific deployment of the client 100, database management system 200, and multidimensional database 300 can be determined according to the actual application scenario.

进一步的,客户端100和数据库管理系统200均可以划分为多个单元模块。图1示例性地给出了一种客户端100和数据库管理系统200的划分方式,其中,客户端100包括发送模块110、接收模块120、处理模块130和交互模块140,数据库管理系统200包括接收模块210、处理模块220和发送模块230,下面分别进行具体介绍。Furthermore, both the client 100 and the database management system 200 can be divided into multiple unit modules. Figure 1 exemplarily illustrates one division method of the client 100 and the database management system 200, wherein the client 100 includes a sending module 110, a receiving module 120, a processing module 130, and an interaction module 140, and the database management system 200 includes a receiving module 210, a processing module 220, and a sending module 230, which will be described in detail below.

1、发送模块110:用于向数据库管理系统200发送查询请求,查询请求用于指示对多维数据库300关联的多维表单的数据查询处理。其中,多维表单是指基于多维数据库300中的数据构建的多维表单,多维表单关联多个维度成员,这多个维度成员属于多维数据库300中的多个维度,这多个维度可认为是多维表单关联的维度,每个维度成员只属于一个维度,这多个维度中的每个维度具有这多个维度成员中的至少一个维度成员。1. Sending Module 110: Used to send query requests to the database management system 200. The query request instructs for data query processing of the multidimensional form associated with the multidimensional database 300. The multidimensional form refers to a multidimensional form constructed based on data in the multidimensional database 300. The multidimensional form is associated with multiple dimension members, which belong to multiple dimensions in the multidimensional database 300. These multiple dimensions can be considered as the dimensions associated with the multidimensional form. Each dimension member belongs to only one dimension, and each of these multiple dimensions has at least one dimension member among these multiple dimension members.

首先介绍查询请求,查询请求可以包括如下几种情况:First, let's introduce query requests. Query requests can include the following types:

情况一、查询请求包括多维表单的标识(identifier,ID)或名称。Scenario 1: The query request includes the identifier (ID) or name of a multidimensional form.

在这种情况下,数据库管理系统200中记录有多维表单的ID/名称与多维表单关联的多个维度成员之间的对应关系。当客户端100需要显示多维表单时,客户端100的发送模块110通过在查询请求中携带多维表单的ID或名称,并将查询请求发送至数据库管理系统200,从而达到向数据库管理系统200查询该多维表单的数据的目的。然后,数据库管理系统200根据查询请求中的多维表单的ID/名称以及记录的上述对应关系,即可确定客户端100需要显示的是这个多维表单,进而确定该多维表单关联的是这多个维度成员,随后去获取这多个维度成员在多维数据库300中对应的多个值(后文介绍)。In this scenario, the database management system 200 records the correspondence between the ID/name of a multidimensional form and the associated multidimensional members. When the client 100 needs to display a multidimensional form, its sending module 110 sends the query request to the database management system 200 by including the multidimensional form's ID or name in the request, thereby querying the database management system 200 for the data of that multidimensional form. Then, based on the multidimensional form's ID/name in the query request and the recorded correspondence, the database management system 200 determines that the client 100 needs to display this multidimensional form, and further determines that the multidimensional form is associated with these multiple dimension members. Subsequently, it retrieves the corresponding values of these multiple dimension members in the multidimensional database 300 (described later).

情况二、查询请求包括多维表单关联的多个维度成员。Scenario 2: The query request includes multiple dimension members associated with a multidimensional form.

在这种情况下,客户端100通过在查询请求中携带多维表单关联的多个维度成员,并将查询请求发送至数据库管理系统200,从而达到向数据库管理系统200查询该多维表单的数据的目的。然后,数据库管理系统200根据查询请求可以直接确定多维表单关联的多个维度成员,进而获取这多个维度成员在多维数据库300中对应的多个值(后文介绍)。In this scenario, client 100 sends a query request to database management system 200, including multiple dimension members associated with the multidimensional form, thereby querying the database management system 200 for data from the multidimensional form. Database management system 200 can then directly determine the multiple dimension members associated with the multidimensional form based on the query request, and subsequently obtain the corresponding values of these dimension members in the multidimensional database 300 (described later).

情况三、查询请求包括多维表单关联的多个维度。Scenario 3: The query request includes multiple dimensions associated with a multidimensional form.

在这种情况下,客户端100通过在查询请求中携带多维表单关联的多个维度,并将查询请求发送至数据库管理系统200,从而达到向数据库管理系统200查询该多维表单的数据的目的。然后,数据库管理系统200根据查询请求可以确定多维表单关联的每个维度,进而将每个维度下的全部维度成员或部分维度成员一起作为多维表单关联的多个维度成员,随后去获取这多个维度成员在多维数据库300中对应的多个值(后文介绍)。可选的,每个维度下的部分维度成员可以是该维度下的指定数量(可设置)的维度成员,也可以是该维度下特定的维度成员(可由用户指定或者是多维数据库300默认设置的),本申请对此不做具体限定。In this scenario, client 100 sends a query request to database management system 200, including multiple dimensions associated with the multidimensional form, thereby retrieving data from the multidimensional form. Database management system 200 then determines each dimension associated with the multidimensional form based on the query request. It then uses all or some dimension members under each dimension as multiple dimension members associated with the multidimensional form, and subsequently retrieves the corresponding values (described later) of these multiple dimension members in multidimensional database 300. Optionally, some dimension members under each dimension can be a specified number (configurable) of dimension members under that dimension, or specific dimension members under that dimension (which can be specified by the user or set by default in multidimensional database 300). This application does not impose specific limitations on this.

下面对多维表单进行具体介绍。The following is a detailed introduction to multidimensional forms.

由前文介绍可知,多维表单关联多维数据库300中的多个维度,对于这多个维度的每个维度,多维表单具体关联这个维度下的至少一个维度成员。多维表单在多维数据库300中对应的值(即多个表单关联的多个维度成员在多维数据库300中对应的值)的数量,等于多维表单关联的每个维度的维度成员数据的乘积。每个值对应多个表单关联的多个维度中每个维度的一个维度成员,为便于描述,将每个值对应的所有维度成员称为该值的成员元组,不同值具有不同的成员元组。As introduced earlier, a multidimensional form associates multiple dimensions within a multidimensional database 300. For each of these dimensions, the multidimensional form specifically associates with at least one dimension member within that dimension. The number of values corresponding to the multidimensional form in the multidimensional database 300 (i.e., the values corresponding to the multiple dimension members associated with multiple forms in the multidimensional database 300) is equal to the product of the dimension member data for each dimension associated with the multidimensional form. Each value corresponds to one dimension member in each of the multiple dimensions associated with multiple forms. For ease of description, all dimension members corresponding to each value are referred to as the member tuple for that value; different values have different member tuples.

例如,图2示例性地给出了一个多维表单,该多维表单关联多维数据库300中的4个维度,包括年维度、产品维度、科目维度和地区维度,其中,多维表单关联年维度下的2015和2016这两个维度成员,也关联产品维度下的产品A、产品B和产品C这三个维度成员,还关联科目维度下的销量这一个维度成员以及地区维度下的地区1和地区2这两个维度成员。For example, Figure 2 provides an example of a multidimensional form that associates four dimensions in a multidimensional database 300, including the year dimension, product dimension, subject dimension, and region dimension. Specifically, the multidimensional form associates the two dimension members 2015 and 2016 under the year dimension, the three dimension members Product A, Product B, and Product C under the product dimension, the one dimension member sales volume under the subject dimension, and the two dimension members region 1 and region 2 under the region dimension.

因此,多维表单关联2+3+1+2=8个维度成员,这8个维度成员属于多维数据库300中的4个维度,该多维表单在多维数据库300中对应的值的数量=多维表单关联的每个维度的维度成员数据的乘积=2×3×1×2=12个。这12个值需要从多维数据库300中获取,以填入图2表单中的12个单元格(图中以空白方框表示)。Therefore, the multidimensional form is associated with 2 + 3 + 1 + 2 = 8 dimension members. These 8 dimension members belong to 4 dimensions in the multidimensional database 300. The number of values corresponding to this multidimensional form in the multidimensional database 300 is equal to the product of the dimension member data of each dimension associated with the multidimensional form, which is 2 × 3 × 1 × 2 = 12. These 12 values need to be retrieved from the multidimensional database 300 to fill the 12 cells in the form in Figure 2 (represented by blank boxes in the figure).

每个值对应8个维度成员中的4个维度成员(属于多维表单关联的4个不同维度),将这4个维度成员称为该值的成员元组,不同值有不同的成员元组,因此这12个值有12种不同的成员元组。通过笛卡尔积算法可以计算具体有哪些成员元组,其中,数学领域中笛卡尔积是指两个集合(或更多集合)之间的一种操作,它将这些集合中的元素组合成有序对的形式,得到所有可能的有序对。Each value corresponds to 4 of the 8 dimension members (belonging to 4 different dimensions associated with a multidimensional form). These 4 dimension members are called the member tuples of that value. Different values have different member tuples, therefore these 12 values have 12 different member tuples. The Cartesian product algorithm can be used to calculate which specific member tuples exist. In mathematics, the Cartesian product refers to an operation between two sets (or more sets) that combines the elements of these sets into ordered pairs, obtaining all possible ordered pairs.

比如,将多维表单关联的年维度下的两个维度成员记为集合1={2015,2016},多维表单关联的产品维度下的三个维度成员记为集合2={产品A,产品B,产品C},多维表单关联的科目维度下的一个维度成员记为集合3={销量},多维表单关联的地区维度下的两个维度成员记为集合4={地区1,地区2}。笛卡尔积=集合1×集合2×集合3×集合4={(2015,产品A,销量,地区1),(2015,产品A,销量,地区2),...,(2016,产品C,销量,地区2)},其中,小括号表示一个有序对(即成员元组),小括号中的内容即一个成员元组所包含的维度成员。For example, let's denote the two dimension members under the year dimension of a multidimensional form as set 1 = {2015, 2016}, the three dimension members under the product dimension as set 2 = {Product A, Product B, Product C}, the one dimension member under the subject dimension as set 3 = {Sales}, and the two dimension members under the region dimension as set 4 = {Region 1, Region 2}. The Cartesian product = set 1 × set 2 × set 3 × set 4 = {(2015, Product A, Sales, Region 1), (2015, Product A, Sales, Region 2), ..., (2016, Product C, Sales, Region 2)}, where parentheses represent an ordered pair (i.e., a member tuple), and the content within the parentheses represents the dimension members contained in that member tuple.

可选的,多维表单的行结构可以关联多维数据库300中的M个维度(可以是多维表单关联的多个维度中的部分或全部维度),M大于或等于1,本申请对此不作具体限定。行结构对应的M个维度在多维表单中具有顺序关系,该顺序关系可以是用户指定的(如通过交互模块140指定),也可以是系统默认的,本申请对此不做具体限定。对于M个维度中的任意一个维度,多维数据库300的行结构关联的该维度下的一个或多个维度成员(可能是该维度下的部分或全部维度成员)。若行结构关联该维度下的多个维度成员,则该维度下的这多个维度成员在多维表单中具有顺序关系,该顺序关系可以是用户指定的(如通过交互模块140指定),也可以是系统默认的。Optionally, the row structure of the multidimensional form can be associated with M dimensions in the multidimensional database 300 (which can be some or all of the multiple dimensions associated with the multidimensional form), where M is greater than or equal to 1, and this application does not specifically limit this. The M dimensions corresponding to the row structure have an order relationship in the multidimensional form. This order relationship can be specified by the user (e.g., through the interaction module 140) or it can be the system default, and this application does not specifically limit this. For any one of the M dimensions, the row structure of the multidimensional database 300 is associated with one or more dimension members under that dimension (which may be some or all of the dimension members under that dimension). If the row structure is associated with multiple dimension members under that dimension, then these multiple dimension members under that dimension have an order relationship in the multidimensional form. This order relationship can be specified by the user (e.g., through the interaction module 140) or it can be the system default.

继续以图2为例,该多维表单的行结构关联上述4个维度中的年维度、产品维度和科目维度,这三个维度在多维表单中的顺序依次为年维度→产品维度→科目维度。Taking Figure 2 as an example, the row structure of this multidimensional form is associated with the year dimension, product dimension, and subject dimension of the above four dimensions. The order of these three dimensions in the multidimensional form is year dimension → product dimension → subject dimension.

对于年维度,多维表单关联多维数据库300中的4个维度,包括年维度、产品维度、科目维度和地区维度,其中,行结构关联上述4个维度中的年维度、产品维度和地区维度这3个维度。对于年维度,行结构具体关联该维度下的2015和2016这两个维度成员,且它们在多维表单中的顺序关系为2015→2016,2015和2016对应多维表单中的不同行。对于产品维度,行结构具体关联的是该维度下的产品A、产品B和产品C这三个维度成员,且它们在多维表单中的顺序关系为产品A→产品B→产品C,产品A、产品B和产品C对应多维表单中的不同行。对于科目维度,行结构具体关联的是该维度下的销量这一个维度成员,销量对应多维表单中的所有行。For the year dimension, the multidimensional form is associated with four dimensions in the multidimensional database 300: year, product, subject, and region. The row structure is associated with three of these four dimensions: year, product, and region. Specifically, for the year dimension, the row structure is associated with the two dimension members 2015 and 2016, with their order in the multidimensional form being 2015→2016, corresponding to different rows in the multidimensional form. For the product dimension, the row structure is associated with the three dimension members: product A, product B, and product C, with their order in the multidimensional form being product A→product B→product C, corresponding to different rows in the multidimensional form. For the subject dimension, the row structure is associated with the single dimension member "sales volume," which corresponds to all rows in the multidimensional form.

应理解,多维表单的行结构关联的每个维度的维度成员数量,决定了多维表单的行数,多维表单的行数等于行结构关联的每个维度的维度成员数量的乘积。It should be understood that the number of dimension members in each dimension associated with the row structure of a multidimensional form determines the number of rows in the multidimensional form. The number of rows in a multidimensional form is equal to the product of the number of dimension members in each dimension associated with the row structure.

承接上一个例子,图2中的多维表单的行结构关联年维度下的2个维度成员、产品维度下的3个维度成员以及科目维度下的1个维度成员,则该多维表单的行数=2×3×1=6行(行号为0~5)。Continuing from the previous example, the row structure of the multidimensional form in Figure 2 is associated with two members under the year dimension, three members under the product dimension, and one member under the subject dimension. Therefore, the number of rows in this multidimensional form is 2 × 3 × 1 = 6 rows (row numbers are 0 to 5).

可选的,多维表单的列结构可以关联多维数据库300中的N个维度(是多维表单关联的多个维度中的部分或全部维度),N大于或等于1,本申请对此不具体限定。列结构关联的N个维度在多维表单中具有顺序关系,该顺序关系可以是用户指定的,也可以是系统默认,本申请对此不作限定。对于N个维度中的任意一个维度,多维数据库300的列结构关联该维度下的一个或多个维度成员(可能是该维度下的部分或全部维度成员)。若列结构关联该维度下的多个维度成员,则该维度下的多个维度成员在多维表单中具有顺序关系,该顺序关系可以是用户指定的,也可以是系统默认的。应理解,多维表单的列结构关联的每个维度的维度成员数量,决定了多维表单的列数,多维表单的列数等于列结构关联的每个维度的维度成员数的乘积。Optionally, the column structure of the multidimensional form can be associated with N dimensions in the multidimensional database 300 (which may be some or all of the multiple dimensions associated with the multidimensional form), where N is greater than or equal to 1, and this application does not specifically limit this. The N dimensions associated with the column structure have an order relationship in the multidimensional form, which can be user-specified or system default, and this application does not limit this. For any one of the N dimensions, the column structure of the multidimensional database 300 is associated with one or more dimension members under that dimension (which may be some or all of the dimension members under that dimension). If the column structure is associated with multiple dimension members under that dimension, then the multiple dimension members under that dimension have an order relationship in the multidimensional form, which can be user-specified or system default. It should be understood that the number of dimension members in each dimension associated with the column structure of the multidimensional form determines the number of columns in the multidimensional form, and the number of columns in the multidimensional form is equal to the product of the number of dimension members in each dimension associated with the column structure.

继续以图2进行举例,图2的多维表单的列结构只关联多维数据库300中的一个维度,即地区维度。列结构具体关联地区维度下的地区1和地区2这两个维度成员,它们在多维表单中的顺序关系为地区1→地区2,地区1和地区2对应多维表单中的不同列。由于该多维表单的列结构只关联地区维度这一个维度,因此,多维表单的列数=列结构关联的地区维度的维度成员数量=2(列号为0~1)。Continuing with Figure 2 as an example, the column structure of the multidimensional form in Figure 2 only relates to one dimension of the multidimensional database 300, namely the region dimension. Specifically, the column structure relates to two dimension members under the region dimension: Region 1 and Region 2. Their order in the multidimensional form is Region 1 → Region 2, with Region 1 and Region 2 corresponding to different columns in the multidimensional form. Since the column structure of this multidimensional form only relates to the region dimension, the number of columns in the multidimensional form equals the number of dimension members of the region dimension associated with the column structure, which equals 2 (column numbers from 0 to 1).

在确定了多维表单的行数和列数之后,通过计算行数和行数的乘积,可以确定多维表单中用于填充值的单元格的数量。单元格的数量=行数×列数=6×2=12个,这12个单元格用于填充多维表单在多维数据库300对应的12个值。需要说明的是,图2中除了这12单元格的其他部分(称为表头或者行列标题)只是为了便于理解,在实际应用场景中,客户端100可能不会直接显示图2中的表头。After determining the number of rows and columns in the multidimensional form, the number of cells used to populate the values can be determined by multiplying the number of rows by the number of columns. The number of cells = number of rows × number of columns = 6 × 2 = 12. These 12 cells are used to populate the 12 values corresponding to the multidimensional form in the multidimensional database 300. It should be noted that the other parts in Figure 2 besides these 12 cells (called the header or row/column headings) are for ease of understanding only; in actual application scenarios, client 100 may not directly display the header in Figure 2.

2、接收模块210:用于接收客户端100发送的查询请求。2. Receiving module 210: Used to receive query requests sent by client 100.

3、处理模块220:用于根据查询请求向多维数据库300获取多个值,进而生成查询结果。3. Processing module 220: Used to retrieve multiple values from the multidimensional database 300 according to the query request, and then generate query results.

具体的,数据库管理系统200中的处理模块220通过解析客户端100发送的查询请求,可以确定多维表单关联的多个维度成员(可参考前文介绍的情况一~情况三),进而向多维数据库300获取这多个维度成员对应的多个值。当数据库管理系统200从多维数据库300获取到这多个值后,将这多个值填入多维表单中相应行列位置上的单元格。Specifically, the processing module 220 in the database management system 200, by parsing the query request sent by the client 100, can determine the multiple dimension members associated with the multidimensional form (refer to cases one through three described above), and then retrieve the multiple values corresponding to these multiple dimension members from the multidimensional database 300. After the database management system 200 retrieves these multiple values from the multidimensional database 300, it fills these multiple values into the cells at the corresponding row and column positions in the multidimensional form.

继续以图2进行举例,由前文介绍可知,图2的多维表单关联8个维度成员,这8个维度成员属于多维数据库300中的4个维度,分别为年维度、产品维度、科目维度和地区维度,这8个维度成员在多维表单中对应的值的数量为12个,不同值具有不同的成员元组。Continuing with Figure 2 as an example, as mentioned earlier, the multidimensional form in Figure 2 is associated with 8 dimension members. These 8 dimension members belong to 4 dimensions in the multidimensional database 300, namely the year dimension, product dimension, subject dimension, and region dimension. The number of values corresponding to these 8 dimension members in the multidimensional form is 12, and different values have different member tuples.

在数据库管理系统200接收到客户端100发送的查询请求时,可以确定多维表单关联的多个维度成员,进而获取这多个维度成员在多维数据库300中对应的多个值。比如,图2中行号为0列号为1的单元格需要填入的值的成员元组包括2015、产品A、销量和地区2,数据库管理系统200可以从多维数据库300中获取该成员元组对应的值。其他单元格上所需要填充的值的获取方式类似,这里不过多介绍。When the database management system 200 receives a query request from the client 100, it can determine the multiple dimension members associated with the multidimensional form and then retrieve the corresponding values of these dimension members in the multidimensional database 300. For example, in Figure 2, the cell with row number 0 and column number 1 needs to be filled with the member tuple including 2015, product A, sales volume, and region 2. The database management system 200 can retrieve the corresponding value of this member tuple from the multidimensional database 300. The method for retrieving the values to be filled in other cells is similar and will not be described in detail here.

当数据库管理系统200向多维数据库300获取到这12个值之后,将它们填入图2的多维表单中的相应单元格,从而得到图3的多维表单。需要说明的是,图3中填入的12个值仅为示例,不构成具体限定。After the database management system 200 obtains these 12 values from the multidimensional database 300, it fills them into the corresponding cells of the multidimensional form in Figure 2, thus obtaining the multidimensional form in Figure 3. It should be noted that the 12 values filled in Figure 3 are only examples and do not constitute specific limitations.

前面介绍了如何获取多维表单关联的多个维度成员在多维数据库300中对应的多个值并填入多维表单,下面说明如何根据这多个值生成查询结果。The previous section introduced how to obtain the corresponding values of multiple dimension members associated with a multidimensional form in the multidimensional database 300 and fill them into the multidimensional form. The following section explains how to generate query results based on these multiple values.

请参见图4,图4是一种查询结果的结构示意图,包括数据信息和定义信息。Please refer to Figure 4, which is a schematic diagram of the structure of a query result, including data information and definition information.

首先介绍数据信息。如图4所示,数据信息包括单元格值数组(是一个数组),单元格数组用于指示多维表单关联的多个维度成员在多维数据库300中对应的多个值。First, let's introduce the data information. As shown in Figure 4, the data information includes an array of cell values (which is an array). This array of cells indicates the multiple values corresponding to the multiple dimension members associated with the multidimensional form in the multidimensional database 300.

承接上一个例子,当数据库管理系统200中的处理模块220向多维数据库300获得12个值,可以进一步将这12个值转换为一个数组,即按照这12个值在图3的多维表单中的排列顺序写入单元格值数组中。Continuing from the previous example, when the processing module 220 in the database management system 200 obtains 12 values from the multidimensional database 300, these 12 values can be further converted into an array, that is, written into the cell value array according to the arrangement order of these 12 values in the multidimensional form in Figure 3.

如图3所示,处理模块220可以按照第0行到第5行(每行从左到右)的排列顺序,将多维表单中的这12个单元格的值依次填入单元格值数组中,得到[100,200,NULL,NULL,150,180,200,300,80,120,160,150]。或者,处理模块220可以按照第5行到第0行(每行从左到右)的排列顺序,将这12个单元格的值写入单元格值数组中,得到[160,150,80,120,200,300,150,180,NULL,NULL,100,200]。或者,处理模块220可以按照第0列到第1列(每列从上到下)的排列顺序,将这12个单元格的值依次写入单元格值数组中,得到[100,NULL,150,200,80,160,200,NULL,180,300,120,150]。当然,处理模块220还可以按照其他排列顺序将12个单元格的值依次填入单元格值数组中,本申请对此不做具体限定,后续客户端100只需要根据单元格值数组以及该数组之前填充值时的顺序,即可在客户端100上快速描画出这12个单元格。As shown in Figure 3, the processing module 220 can sequentially fill the values of these 12 cells in the multidimensional form into a cell value array according to the arrangement order of rows 0 to 5 (each row from left to right), resulting in [100,200,NULL,NULL,150,180,200,300,80,120,160,150]. Alternatively, the processing module 220 can write the values of these 12 cells into a cell value array according to the arrangement order of rows 5 to 0 (each row from left to right), resulting in [160,150,80,120,200,300,150,180,NULL,NULL,100,200]. Alternatively, processing module 220 can sequentially write the values of these 12 cells into a cell value array according to the arrangement order of columns 0 to 1 (each column from top to bottom), resulting in [100,NULL,150,200,80,160,200,NULL,180,300,120,150]. Of course, processing module 220 can also fill the values of the 12 cells into the cell value array in other arrangements. This application does not impose specific limitations on this. Subsequently, client 100 only needs to use the cell value array and the order in which the values were previously filled into the array to quickly draw these 12 cells on client 100.

可选的,如图4所示,数据信息还包括一个单元格状态数组,单元格状态数组用于指示多维表单中的多个值在多维数据库300中的状态,状态可以包括只读状态和可写状态。其中,可写状态表示可以进行修改,只读状态表示不允许进行修改。如果某个值是可写状态,则客户端100可以向用户提示该值是可以修改的,进而允许用户在客户端100上执行修改该值的操作;而如果某个值是只读状态,则客户端100可以向用户提示该值是不允许修改的,从而禁止用户在客户端100上执行修改该值的操作。Optionally, as shown in Figure 4, the data information also includes a cell status array. This array indicates the status of multiple values in the multidimensional form within the multidimensional database 300. The status can include read-only and writable states. A writable state indicates that the value can be modified, while a read-only state indicates that modification is not allowed. If a value is in a writable state, the client 100 can notify the user that the value can be modified, thus allowing the user to modify the value on the client 100. Conversely, if a value is in a read-only state, the client 100 can notify the user that the value cannot be modified, thus preventing the user from modifying the value on the client 100.

承接上一个例子,假设处理模块220是按照第0行到第5行(每行从左到右)的排列顺序,将多维表单中的12个值依次填入单元格值数组,得到[100,200,NULL,NULL,150,180,200,300,80,120,160,150]。Continuing from the previous example, suppose the processing module 220 fills the 12 values in the multidimensional form into the cell value array in the order of rows 0 to 5 (each row from left to right), resulting in [100,200,NULL,NULL,150,180,200,300,80,120,160,150].

假设图3中的第0~2行中的单元格中的值的状态都为只读状态,第3~5行中的单元格中的值的状态都为可写状态,并且以状态标记0表示只读状态、以状态标记1表示可选状态。同样按照第0行到第5行(每行从左到右)的排列顺序,处理模块220可以将多维表单中的12个值的状态标记依次填入单元格状态数组,从而得到[0,0,0,0,0,0,1,1,1,1,1,1]。应理解,当客户端100通过单元格状态数组确定每个值的状态时,可以用不同的方式来渲染不同状态的值所在的单元格,比如,用灰色填充只读状态的值所在的单元格,用白色填充可写状态的值所在的单元格,等等,本申请对此不做具体限定。Assume that the values in the cells of rows 0-2 in Figure 3 are all in a read-only state, and the values in the cells of rows 3-5 are all in a writable state, with state flag 0 representing read-only and state flag 1 representing writable. Following the same arrangement order from row 0 to row 5 (each row from left to right), the processing module 220 can sequentially fill the state flags of the 12 values in the multidimensional form into the cell state array, thus obtaining [0,0,0,0,0,0,1,1,1,1,1,1]. It should be understood that when the client 100 determines the state of each value through the cell state array, it can render the cells containing values of different states in different ways, such as filling the cells containing read-only values with gray, filling the cells containing writable values with white, etc. This application does not specifically limit this.

应理解,同一个值在单元格值数组中的位置与该值在单元格状态数组中的状态标记的位置是一致的。比如,图2中的第2行第0列的单元格的值为150,该值在单元格值数组中的位置是第4(假设位置是从0开始),则该值在单元格状态数组中的状态标记的位置也是第4。因此,客户端100可以根据两个数组的对应关系,按照数组中的元素(值/状态)顺序给相应的单元格进行赋值以及设置单元格的状态。It should be understood that the position of the same value in the cell value array is consistent with the position of the state marker of that value in the cell state array. For example, the value of the cell in row 2, column 0 of Figure 2 is 150, and its position in the cell value array is the 4th (assuming the position starts from 0). Therefore, the position of the state marker of this value in the cell state array is also the 4th. Thus, client 100 can assign values to the corresponding cells and set the cell states according to the correspondence between the two arrays and the order of the elements (value/state) in the arrays.

需要说明的是,上述例子中的状态数量、名称和状态标记都仅作为示例,不构成具体限定,在实际应用场景中,还可以划分更多或更少的状态,不同状态采用不同的状态标记进行区分,本申请对此不做具体限定。It should be noted that the number of states, names, and state labels in the above examples are merely examples and do not constitute specific limitations. In actual application scenarios, more or fewer states can be divided, and different states can be distinguished by different state labels. This application does not impose any specific limitations on this.

可选的,数据库管理系统200中的处理模块220可以先向多维数据库300获取多维表单中的所有单元格对应的值,然后判断多维表单中是否存在值全为空的整行和/或整列(称为可消空行列)。如果存在,则处理模块220对可消空行列执行消空,即在单元格值数组中不携带可消空行列中的单元格的值,并且在单元格状态数组中不携带可消空行列中的单元格的状态标记,从而减少传输数据量。此时,由于客户端100接收到的单元格值数组中不携带可消空行列的值、单元格状态数组中不携带可消空行列的状态标记,因此,客户端100不会显示多维表单中的可消空行列,在一定程度上可以优化多维表单的显示效果和用户体验。Optionally, the processing module 220 in the database management system 200 can first obtain the values corresponding to all cells in the multidimensional form from the multidimensional database 300, and then determine whether there are any rows and/or columns in the multidimensional form with all values empty (referred to as empty-cancellable rows and columns). If so, the processing module 220 performs empty-cancellable operation on the empty-cancellable rows and columns, that is, it does not carry the values of the cells in the empty-cancellable rows and columns in the cell value array, and it does not carry the status flags of the cells in the empty-cancellable rows and columns in the cell status array, thereby reducing the amount of data transmitted. At this time, since the cell value array received by the client 100 does not carry the values of the empty-cancellable rows and columns, and the cell status array does not carry the status flags of the empty-cancellable rows and columns, the client 100 will not display the empty-cancellable rows and columns in the multidimensional form, which can optimize the display effect and user experience of the multidimensional form to a certain extent.

继续以图3为例,该多维表单包括12个单元格,这些单元格上的值是数据库管理系统200向多维数据库300获取并填入多维表单中的(可参考前文介绍),其中一些单元格填充了具体数值,另一些单元格填充了NULL,表示从多维数据库300中获取到的相应值为空。当然,也可以换用其他标志来表示值为空,本申请对此不做具体限定。可以看出,该多维表单中的第1行的单元格的值全为空,因而第1行为可消空行列。Continuing with Figure 3 as an example, this multidimensional form includes 12 cells. The values in these cells are obtained by the database management system 200 from the multidimensional database 300 and filled into the multidimensional form (refer to the previous introduction). Some cells are filled with specific numerical values, while others are filled with NULL, indicating that the corresponding value obtained from the multidimensional database 300 is empty. Of course, other symbols can also be used to indicate that the value is empty, and this application does not specifically limit this. It can be seen that the values of all cells in the first row of this multidimensional form are empty, therefore the first row is a row that can be cleared of empty cells.

如果不对图3的多维表单执行消空,则数据库管理系统200的处理模块220可以将这12个单元格的值全都写入单元格值数组。比如,处理模块220可以按照第0行到第5行顺序将这12个单元格的值依次填入一个数组,即得到如下的单元格值数组:[100,200,NULL,NULL,150,180,200,300,80,120,160,150]。可以理解,当客户端100接收到该单元格值数组时,不需要经过复杂计算,只需要按照第0行到第5行的顺序即可快速描画出这12个单元格。类似的,数据库管理系统200可以按照第0行到第5行的顺序将这12个单元格上的值的状态标记依次填入单元格状态数组,当客户端100接收到该单元格状态数组时,只需要按照第0行到第5行的顺序即可快速渲染这12个单元格上的值的状态。If the multidimensional form in Figure 3 is not cleared, the processing module 220 of the database management system 200 can write all the values of these 12 cells into a cell value array. For example, the processing module 220 can fill the values of these 12 cells into an array sequentially from row 0 to row 5, resulting in the following cell value array: [100,200,NULL,NULL,150,180,200,300,80,120,160,150]. It can be understood that when the client 100 receives this cell value array, it does not need complex calculations; it can quickly render these 12 cells simply by following the order of row 0 to row 5. Similarly, the database management system 200 can fill the status markers of the values in these 12 cells into a cell status array sequentially from row 0 to row 5. When the client 100 receives this cell status array, it can quickly render the status of the values in these 12 cells simply by following the order of row 0 to row 5.

如果对图3的多维表单执行消空,则数据库管理系统200的处理模块220只需要将多维表单中除了可消空行列之外的其他行列上的单元格的值写入单元格值数组,也就是将图2中除第1行之外的其他单元格的值依次填入单元格值数组,得到[100,200,150,180,200,300,80,120,160,150],该数组的长度为10。可以理解,当客户端100接收到该单元格值数组时,不需要经过复杂计算,只需要按照第0行到第5行(除了第1行)的顺序即可快速描画出这10个单元格,从而得到图5所示的消空后的多维表单。类似的,数据库管理系统200可以将图2中除了第1行之外的其他单元格上的值的状态标记依次填入单元格状态数组,当客户端100接收到该单元格状态数组时,只需要按照第0行到第5行(除了第1行)的顺序即可快速渲染这10个单元格上的值的状态。If the multidimensional form in Figure 3 is cleared, the processing module 220 of the database management system 200 only needs to write the values of the cells in the multidimensional form other than the rows and columns that can be cleared into the cell value array. That is, the values of the cells in Figure 2 other than the first row are sequentially filled into the cell value array, resulting in [100, 200, 150, 180, 200, 300, 80, 120, 160, 150], and the length of this array is 10. It can be understood that when the client 100 receives this cell value array, it does not need to perform complex calculations, but only needs to draw these 10 cells in the order of rows 0 to 5 (excluding the first row) to obtain the multidimensional form after clearing as shown in Figure 5. Similarly, the database management system 200 can sequentially fill the status markers of the values in the cells other than the first row in Figure 2 into the cell status array. When the client 100 receives the cell status array, it only needs to render the status of the values in these 10 cells in the order of rows 0 to 5 (excluding the first row).

如图3所示,除了上面介绍的数值信息,查询结果还包括定义信息,定义信息用于指示多维表单的行数和列数以及多维表单中的每行和每列对应的维度成员。As shown in Figure 3, in addition to the numerical information mentioned above, the query results also include definition information, which is used to indicate the number of rows and columns in the multidimensional form, as well as the dimension members corresponding to each row and column in the multidimensional form.

定义信息包括行列元数据和成员元数据。The definition information includes row and column metadata and member metadata.

行列元数据用于指示多维表单的行数和列数。比如,在不考虑消空的情况下,可以直接给出多维表单的行数和列数。Row and column metadata is used to indicate the number of rows and columns in a multidimensional form. For example, without considering blanking, the number of rows and columns in the multidimensional form can be given directly.

可选的,如图2所示,行列元数据包括行号数组和列号数组。行号数组包括多维表单中的不同行的行号,行号数组的长度等于多维表单的行数,因此,根据客户端100根据行号数组便可以确定多维表单有多少行。列号数组包括多维表单中的不同列的列号,列号数组的长度等于多维表单的列数,因此,客户端100根据列号数组便可以确定多维表单有多少列,以便在客户端100上渲染显示多维表单。Optionally, as shown in Figure 2, the row and column metadata includes a row number array and a column number array. The row number array contains the row numbers of different rows in the multidimensional form, and its length is equal to the number of rows in the multidimensional form. Therefore, the client 100 can determine the number of rows in the multidimensional form based on the row number array. The column number array contains the column numbers of different columns in the multidimensional form, and its length is equal to the number of columns in the multidimensional form. Therefore, the client 100 can determine the number of columns in the multidimensional form based on the column number array, so as to render and display the multidimensional form on the client 100.

例如,对于图2示出的多维表单,数据库管理系统200可以生成行号数组[0,1,2,3,4,5]和列号数组[0,1],该行号数组表示多维表单有6行,该列号数组表示多维表单有2列。然后,数据库管理系统200将行号数组和列号数组携带于查询结果中,以发送至客户端100。然后,客户端100根据该行号数组和列号数组,即可确定多维表单的行数和列数,再结合表单信息中的单元格值数组(包括12个单元格的值),便可以完成12个单元格的描画。For example, for the multidimensional form shown in Figure 2, the database management system 200 can generate a row number array [0,1,2,3,4,5] and a column number array [0,1]. The row number array indicates that the multidimensional form has 6 rows, and the column number array indicates that the multidimensional form has 2 columns. Then, the database management system 200 includes the row number array and column number array in the query results and sends them to the client 100. The client 100 can then determine the number of rows and columns of the multidimensional form based on the row number array and column number array, and by combining this with the cell value array (including the values of 12 cells) in the form information, it can complete the depiction of the 12 cells.

再如,对于图5示出的消空后的多维表单,数据库管理系统200可以生成行号数组[0,2,3,4,5]和列号数组[0,1],该行号数组表示消空后的多维表单有5行,该列号数组表示消空后的多维表单有2列。可以看出,由于第1行被消空了,因此行号数组没有携带第1行的行号,进而客户端100也不需要渲染第1行的单元格,只需要根据该行号数组、列号数组和单元格值数组(包括消空后的10个单元格的值)描画出10个单元格,从而能够在客户端100上显示图5的消空后的多维表单。For example, for the multidimensional form after the emptying is shown in Figure 5, the database management system 200 can generate a row number array [0,2,3,4,5] and a column number array [0,1]. The row number array indicates that the multidimensional form after the emptying has 5 rows, and the column number array indicates that the multidimensional form after the emptying has 2 columns. It can be seen that since the first row is empty, the row number array does not carry the row number of the first row. Therefore, the client 100 does not need to render the cells of the first row. It only needs to draw 10 cells based on the row number array, column number array, and cell value array (including the values of the 10 empty cells), so that the multidimensional form after the emptying in Figure 5 can be displayed on the client 100.

成员元数据用于指示多维表单的行结构和列结构对应的维度以及维度成员的信息,成员元数据可以包括如下第一种实现方式和第二种实现方式。Member metadata is used to indicate the dimensions corresponding to the row and column structures of a multidimensional form, as well as the information of the dimension members. Member metadata can include the following first and second implementation methods.

在第一种实现方式中,成员元数据包括行结构对应的每个维度下的维度成员在多维表单中的顺序关系、列结构对应的每个维度下的维度成员在多维表单中的顺序关系以及M个维度和N个维度中的每个维度的运算数。In the first implementation, the member metadata includes the order relationship of the dimension members under each dimension of the row structure in the multidimensional form, the order relationship of the dimension members under each dimension of the column structure in the multidimensional form, and the number of operations for each dimension in the M and N dimensions.

对于M个维度中的任意一个维度(记为第一维度),第一维度的运算数分为如下几种类型:For any one of the M dimensions (denoted as the first dimension), the operands of the first dimension fall into the following categories:

类型一、若M个维度中位于第一维度之后的其他维度的数量为0,则第一维度的运算数为1。Type 1: If the number of other dimensions after the first dimension in the M dimensions is 0, then the number of operations for the first dimension is 1.

类型二、若M个维度中位于第一维度之后的其他维度的数量为1,则第一维度的运算数为其他维度在多维表单中的维度成员的数量。Type 2: If the number of other dimensions following the first dimension in the M dimensions is 1, then the operand of the first dimension is the number of dimension members of the other dimensions in the multidimensional form.

类型三、若M个维度中位于第一维度之后的其他维度的数量为1,则第一维度的运算数为其他维度中的每个维度在多维表单中的维度成员的数量的乘积。Type 3: If the number of other dimensions after the first dimension in the M dimensions is 1, then the operand of the first dimension is the product of the number of dimension members of each of the other dimensions in the multidimensional form.

当客户端100获得数据库管理系统200传输的查询结果时,可以根据查询结果中的第一维度的运算数以及如下解压算法确定多维表单中的目标行号(可以是多维表单中的任一行)在第一维度下对应的一个维度成员的索引值:When client 100 receives the query results transmitted by database management system 200, it can determine the index value of a dimension member corresponding to the target row number (which can be any row in the multidimensional form) under the first dimension based on the operands of the first dimension in the query results and the following decompression algorithm:

目标行在第一维度下对应的一个维度成员(记为第一维度成员)的索引值=(目标行号/第一维度的运算数)%多维表单关联的第一维度下的维度成员数。The index value of the dimension member (denoted as the first dimension member) corresponding to the target row under the first dimension = (target row number / first dimension operand) % the number of dimension members under the first dimension associated with the multidimensional form.

在得到第一维度成员的索引值之后,根据该索引值去查询成员元数据中给出的第一维度下的维度成员在多维表单中的顺序关系,即可确定目标行号在第一维度下对应的第一维度成员。After obtaining the index value of the first dimension member, the order relationship of the dimension members under the first dimension in the multidimensional form is obtained by querying the member metadata based on the index value, and the first dimension member corresponding to the target row number under the first dimension can be determined.

例如,对于图3所示的多维表单,该多维表单的行结构对应年维度、产品维度和科目维度这三个维度,且它们在多维表单中的顺序关系为年维度→产品维度→科目维度。其中,多维表单具体关联的是年维度下的2015和2016这两个维度成员(可以是年维度下的部分或全部维度成员),它们在多维表单中的顺序关系为2015→2016,可以用数组[2015,2016]来表示,该数组中的2015的索引值为0,2016的索引值为1。多维表单还关联产品维度下的产品A、产品B、产品C这三个维度成员,它们在多维表单中的顺序关系为产品A→产品B→产品C,可以用数组[产品A,产品B,产品C]来表示,该数组中的产品A的索引值为0,产品B的索引值为1,产品C的索引值为2。多维表单仅关联科目维度下的销量这一个维度成员。For example, in the multidimensional form shown in Figure 3, the row structure corresponds to three dimensions: year, product, and subject. Their order in the multidimensional form is year → product → subject. Specifically, the multidimensional form associates the two dimension members 2015 and 2016 under the year dimension (which can be some or all of the dimension members under the year dimension), with an order of 2015 → 2016, which can be represented by the array [2015, 2016], where the index of 2015 is 0 and the index of 2016 is 1. The multidimensional form also associates the three dimension members A, B, and C under the product dimension, with an order of product A → product B → product C, which can be represented by the array [product A, product B, product C], where the index of product A is 0, the index of product B is 1, and the index of product C is 2. The multidimensional form only associates the sales volume dimension member under the subject dimension.

依照行结构对应的这三个维度之间的顺序关系,可以确定行结构对应的各个维度的运算数如下:Based on the order of these three dimensions corresponding to the row structure, the number of operands for each dimension of the row structure can be determined as follows:

年维度的运算数=产品维度的维度成员数×科目维度的维度成员数=3×1=3;The number of operations in the year dimension = the number of dimension members in the product dimension × the number of dimension members in the subject dimension = 3 × 1 = 3;

产品维度的运算数=科目维度的成员数=1;The number of operations in the product dimension = the number of members in the subject dimension = 1;

科目维度的运算数=1;The operand count for the subject dimension is 1;

对于图2所示的多维表单,当客户端100获得数据库管理系统200传输过来的查询结果时,如果想确定第4行对应年维度下的哪个维度成员,则可以从查询结果中获得年维度、产品维度和科目维度各自的运算数,再按照解压算法,计算该行的行号除以年维度的运算数的商,即4/3=1,然后用求得的值1对多维表单关联的年维度下的维度成员数进行取余,即1%2=1。根据计算出来的该索引值去查询数组[2015,2016],即可确定第4行对应的是年维度下的2016这个维度成员。For the multidimensional form shown in Figure 2, when client 100 receives the query results transmitted from database management system 200, if it wants to determine which dimension member under the year dimension corresponds to the 4th row, it can obtain the operands of the year dimension, product dimension, and subject dimension from the query results. Then, according to the decompression algorithm, it calculates the quotient of the row number divided by the operand of the year dimension, i.e., 4/3 = 1. Then, it takes the remainder of the obtained value 1 with the number of dimension members under the year dimension associated with the multidimensional form, i.e., 1%2 = 1. Based on the calculated index value, it queries the array [2015, 2016] to determine that the 4th row corresponds to the dimension member 2016 under the year dimension.

类似的,如果客户端100想确定第2行对应产品维度下的哪个维度成员,则可以从查询结果中获得产品维度的运算数,再按照解压算法,计算该行的行号除以产品维度的运算数的商,即2/1=2,然后用求得的值2对多维表单关联的产品维度下的维度成员数进行取余,即2%3=2。根据计算出来的该索引值去查询数组[产品A,产品B,产品C],即可确定第2行对应的是产品维度下的产品C。Similarly, if client 100 wants to determine which dimension member under the product dimension corresponds to the second row, it can obtain the operand of the product dimension from the query results. Then, according to the decompression algorithm, it calculates the quotient of the row number divided by the operand of the product dimension, i.e., 2/1 = 2. Then, it takes the remainder of the calculated value 2 divided by the number of dimension members under the product dimension associated with the multidimensional form, i.e., 2%3 = 2. Using this calculated index value, it queries the array [Product A, Product B, Product C] to determine that the second row corresponds to Product C under the product dimension.

其他行在各维度下对应的维度成员可以参照上述方式进行确定,这里不过多介绍。The dimension members corresponding to other rows under each dimension can be determined in the same way as described above, which will not be elaborated on here.

类似的,对于N个维度中的任意一个维度(记为第二维度),第二维度的运算数分为如下几种类型:Similarly, for any one of the N dimensions (denoted as the second dimension), the operands of the second dimension fall into the following categories:

类型四、若N个维度中位于第二维度之后的其他维度的数量为0,则第二维度的运算数为1。Type 4: If the number of other dimensions after the second dimension in the N dimensions is 0, then the number of operations for the second dimension is 1.

类型五、若N个维度中位于第二维度之后的其他维度的数量为1,则第二维度的运算数为其他维度在多维表单中的维度成员的数量。Type 5: If the number of other dimensions following the second dimension in the N dimensions is 1, then the operand of the second dimension is the number of dimension members of the other dimensions in the multidimensional form.

类型六、若N个维度中位于第二维度之后的其他维度的数量为1,则第二维度的运算数为其他维度中的每个维度在多维表单中的维度成员的数量的乘积。Type 6: If the number of other dimensions after the second dimension in N dimensions is 1, then the operand of the second dimension is the product of the number of dimension members of each of the other dimensions in the multidimensional form.

在确定第二维度的运算数之后,客户端100可以按照如下解压算法确定多维表单中的目标列号(可以是多维表单中的任意一列)在第二维度下对应的一个维度成员的索引值:After determining the operands of the second dimension, client 100 can determine the index value of a dimension member corresponding to the target column number (which can be any column in the multidimensional form) under the second dimension using the following decompression algorithm:

目标行在第二维度下对应的一个维度成员(记为第二维度成员)的索引值=(目标列号/第二维度的运算数)%多维表单关联的第二维度下的维度成员数。The index value of the target row corresponding to a dimension member in the second dimension (denoted as the second dimension member) = (target column number / second dimension operand) % the number of dimension members in the second dimension associated with the multidimensional form.

在得到第二维度成员的索引值之后,根据该索引值去查询成员元数据中给出的第二维度下的维度成员在多维表单中的顺序,即可确定目标列号在第二维度下对应的第二维度成员。After obtaining the index value of the second-dimensional member, the order of the second-dimensional members in the multidimensional form given in the member metadata can be queried based on the index value to determine the second-dimensional member corresponding to the target column number in the second dimension.

例如,对于图2所示的多维表单,该多维表单的列结构对应地区维度这一个维度,列结构具体对应地区维度下的地区1和地区2这两个维度成员,它们在多维表单中的顺序为地区1→地区2,可以用数组[地区1,地区2]来表示,其中,地区1在该数组中的索引值为0,地区B在该数组中的索引值为1。For example, in the multidimensional form shown in Figure 2, the column structure of the multidimensional form corresponds to the region dimension. Specifically, the column structure corresponds to the two dimension members, Region 1 and Region 2, under the region dimension. Their order in the multidimensional form is Region 1 → Region 2, which can be represented by the array [Region 1, Region 2]. In this array, the index value of Region 1 is 0, and the index value of Region B is 1.

由于列结构对应的只有地区维度这一个维度,没有其他维度位于地区维度之后,则可以确定地区维度的运算数=1。Since the column structure only corresponds to the region dimension, and no other dimensions follow the region dimension, the operand of the region dimension can be determined to be 1.

对于图2所示的多维表单,在客户端100接收到数据库管理系统200发送的查询结果之后,如果客户端100想确定第0列对应地区维度下的哪个维度成员,则可以从查询结果中获得地区维度的运算数,再按照解压算法,计算该列的列号除以地区维度的运算数,即0/1=0,然后用求得的值对多维表单关联的地区维度下的维度成员数进行取余,即0%2=0。根据计算出来的索引值0去查询数组[地区1,地区2],可以确定第0行对应的是地区维度下的地区1。For the multidimensional form shown in Figure 2, after the client 100 receives the query results sent by the database management system 200, if the client 100 wants to determine which dimension member under the region dimension corresponds to column 0, it can obtain the operand of the region dimension from the query results. Then, according to the decompression algorithm, it calculates the column number of that column divided by the operand of the region dimension, i.e., 0/1 = 0. Then, it takes the remainder of the obtained value with respect to the number of dimension members under the region dimension associated with the multidimensional form, i.e., 0%2 = 0. Based on the calculated index value 0, it queries the array [region 1, region 2] and determines that row 0 corresponds to region 1 under the region dimension.

类似的,如果客户端100想确定第1列对应地区维度下的哪个维度成员,则按照解压算法,可以先计算该列的列号除以地区维度的运算数,即1/1=1,然后用求得的值对多维表单关联的地区维度下的维度成员数进行取余,即1%2=1。根据计算出来的索引值1去查询数组[地区1,地区2],可以确定第1行对应的是地区维度下的地区2。Similarly, if client 100 wants to determine which dimension member under the region dimension corresponds to the first column, according to the decompression algorithm, it can first calculate the column number of that column divided by the operand of the region dimension, i.e., 1/1 = 1. Then, it can take the remainder of the calculated value by dividing the number of dimension members under the region dimension associated with the multidimensional form, i.e., 1%2 = 1. Based on the calculated index value 1, it can query the array [region 1, region 2] to determine that the first row corresponds to region 2 under the region dimension.

在第二种实现方式中,定义信息包括多维表单的行结构对应的M个维度在多维表单中的顺序关系、多维表单的列结构对应的N个维度在多维表单中的顺序关系、行结构对应的每个维度下的维度成员在多维表单中的顺序关系、列结构对应的每个维度下的维度成员在多维表单中的顺序关系以及M个维度和N个维度中的每个维度的运算数。In the second implementation, the defined information includes the order of the M dimensions corresponding to the row structure of the multidimensional form in the multidimensional form, the order of the N dimensions corresponding to the column structure of the multidimensional form in the multidimensional form, the order of the dimension members under each dimension corresponding to the row structure in the multidimensional form, the order of the dimension members under each dimension corresponding to the column structure in the multidimensional form, and the number of operations for each of the M and N dimensions.

相较于第一种实现方式,第二种实现方式中的成员元数据没有携带各个维度的运算数,但是增加了M个维度在多维表单中的顺序关系以及N个维度在多维表单中的顺序关系。由前文介绍可知,基于顺序关系,是可以计算出各个维度的运算数的。因此,在第二种实现方式中,当客户端100接收到数据库管理系统200发送的查询结果时,客户端100如果想确定多维表单中的目标行号对应第一目标维度下的哪个维度成员,则可以基于上述M个维度的顺序关系先计算出第一目标维度的运算数,进而基于第一目标维度的运算数确定目标行对应第一目标维度下的哪个维度成员(确定过程同第一种实现方式中的介绍,此处不赘述)。类似的,在第二种实现方式中,客户端100如果想确定多维表单中的目标列对应第二目标维度下的哪个维度成员,则可以基于上述N个维度在多维表单中的顺序关系先计算出第二目标维度的运算数,进而基于第二目标维度的运算数确定目标列对应第二目标维度下的哪个维度成员(确定过程同第一种实现方式中的介绍,此处不赘述)。Compared to the first implementation, the second implementation does not carry the operands for each dimension in its member metadata. However, it adds the order relationships of the M dimensions and N dimensions in the multidimensional form. As mentioned earlier, the operands for each dimension can be calculated based on the order relationships. Therefore, in the second implementation, when client 100 receives the query results from database management system 200, if client 100 wants to determine which dimension member under the first target dimension corresponds to the target row number in the multidimensional form, it can first calculate the operands of the first target dimension based on the aforementioned order relationships of the M dimensions, and then determine which dimension member under the first target dimension corresponds to the target row based on the operands of the first target dimension (the determination process is the same as described in the first implementation and will not be repeated here). Similarly, in the second implementation, if client 100 wants to determine which dimension member under the second target dimension corresponds to the target column in the multidimensional form, it can first calculate the operand of the second target dimension based on the order relationship of the above N dimensions in the multidimensional form, and then determine which dimension member under the second target dimension corresponds to the target column based on the operand of the second target dimension (the determination process is the same as described in the first implementation, and will not be repeated here).

可选的,查询结果还可以包括多维表单关联的各维度成员的基础信息,维度成员的基础信息包括维度成员的ID(用于唯一标识相应的维度成员)、名称、属性,等等。Optionally, the query results may also include basic information of the members of each dimension associated with the multidimensional form. The basic information of the dimension members includes the ID (used to uniquely identify the corresponding dimension member), name, attributes, etc.

可选的,如图3所示,查询结果还包括样式元数据,样式元数据用于指示客户端100显示多维表单中的多个值时采用的样式。例如,样式元数据可以包括单元格的宽度和高度、单元格内的值的小数位数、字体是否加粗、背景颜色、对齐方式,等等。此例中给出的样式元数据仅作为示例,不构成具体限定,在实际应用场景中,样式元数据还可以包括更多或更少的描述值所在的单元格的样式。样式元数据可以指示多维表单中的部分或全部单元格的样式,这些单元格统一引用该样式元数据以进行单元格样式渲染,这样不需要在查询结果中一一指定每个值所在的单元格的样式,有助于减少传输数据量,还可提升客户端100表单渲染性能。Optionally, as shown in Figure 3, the query results also include style metadata. Style metadata indicates the style used by the client when displaying multiple values in a multidimensional form. For example, style metadata may include the width and height of the cell, the number of decimal places in the value within the cell, whether the font is bold, the background color, the alignment, and so on. The style metadata given in this example is only illustrative and does not constitute a specific limitation. In actual application scenarios, style metadata may include more or fewer descriptions of the style of the cells containing the values. Style metadata can indicate the style of some or all cells in a multidimensional form. These cells uniformly reference this style metadata for cell style rendering. This eliminates the need to specify the style of each cell containing each value in the query results, helping to reduce the amount of data transmitted and improving the form rendering performance of the client.

4、发送模块230:用于将查询结果传输至客户端100。4. Sending module 230: Used to transmit the query results to the client 100.

5、接收模块120:用于接收数据库管理系统200传输过来的查询结果。5. Receiving module 120: Used to receive query results transmitted from the database management system 200.

6、处理模块130:用于解析获得的查询结果,随后根据解析得到的内容指示交互模块140渲染显示多维表单。6. Processing module 130: Used to parse the obtained query results, and then instruct the interaction module 140 to render and display the multidimensional form based on the parsed content.

具体的,当客户端100中的接收模块120接收到数据库管理系统200发送的查询结果时,将查询结果发送至处理模块130进行解析。处理模块130根据查询结果可以确定多维表单的行数和列数,再使用查询结果中的单元格值数组中的值来依次填充相应行数和列数的多个单元格,即可实现多维表单的快速渲染显示。当客户端100需要确定多维表单上的某个值对应的维度成员时,客户端100中的处理模块130可以根据查询结果中的成员元数据和行列元数据来确定。Specifically, when the receiving module 120 in client 100 receives the query result sent by the database management system 200, it sends the query result to the processing module 130 for parsing. The processing module 130 determines the number of rows and columns of the multidimensional form based on the query result, and then uses the values from the cell value array in the query result to sequentially fill multiple cells of the corresponding number of rows and columns, thus achieving fast rendering and display of the multidimensional form. When client 100 needs to determine the dimension member corresponding to a certain value on the multidimensional form, the processing module 130 in client 100 can determine it based on the member metadata and row/column metadata in the query result.

例如,假设客户端100通过解析查询结果,在客户端100上成功显示了多维表单,然后用户在客户端100的交互模块140上进行操作,以请求查看多维表单中的某个值对应的维度成员,则客户端100可以根据查询结果中的成员元数据和行列元数据确定该单元格对应的维度成员(具体确定方式可参考前文介绍),进而向用户提示该值对应的维度成员。For example, suppose client 100 successfully displays a multidimensional form on client 100 by parsing the query results. Then, the user performs an operation on the interaction module 140 of client 100 to request to view the dimension member corresponding to a certain value in the multidimensional form. Client 100 can determine the dimension member corresponding to the cell based on the member metadata and row and column metadata in the query results (the specific determination method can be referred to the previous introduction), and then prompt the user with the dimension member corresponding to the value.

再如,假设用户在客户端100的交互模块140上进行操作,该操作指示对多维表单中的某个值进行了修改,然后用户请求保存本次修改,则客户端100可以根据查询结果中的成员元数据和行列元数据确定该值对应的维度成员(具体确定方式可参考前文介绍),然后将确定的维度成员的信息和修改后的值发送至数据库管理系统200。数据管理系统根据接收到的维度成员的信息,将修改后的值保存到该维度成员的信息在多维数据库300中对应的位置。保存完成之后,数据库管理系统200还可以向客户端100发送保存成功信息,以表示修改后的值已经被成功保存至多维数据库300中。For example, suppose a user performs an operation on the interaction module 140 of client 100, modifying a value in a multidimensional form. The user then requests to save the modification. Client 100 can determine the corresponding dimension member based on the member metadata and row/column metadata in the query results (the specific determination method can be found above). It then sends the determined dimension member information and the modified value to the database management system 200. The data management system, based on the received dimension member information, saves the modified value to the corresponding location of that dimension member in the multidimensional database 300. After saving, the database management system 200 can also send a save success message to client 100 to indicate that the modified value has been successfully saved to the multidimensional database 300.

7、交互模块140:用于显示多维表单,还用于实现人机交互,如用户可以通过交互模块140指定多维表单关联的维度和维度成员,还可以指定多维表单关联的维度之间的顺序关系,等等。交互模块140的具体功能可参考前文介绍,此处不赘述。7. Interaction Module 140: This module displays the multidimensional form and facilitates human-computer interaction. Users can specify the dimensions and members associated with the multidimensional form, as well as the order of these dimensions, through the interaction module 140. The specific functions of the interaction module 140 are detailed above and will not be repeated here.

需要说明的是,图1的客户端100和数据库管理系统200只是根据功能,示例性地划分为了前面介绍的这些功能模块。实际上,图1中的客户端100和数据库管理系统200都还可以包含更多或者更少的模块,比如,可以将上面的某个模块拆分为多个功能模块,也可以将客户端100/数据库管理系统200中的两个或两个以上的模块合并为一个功能模块,还可以在客户端100和数据库管理系统200中添加其他功能模块,本申请对此不做具体限定。发送模块110、接收模块120、处理模块130、交互模块140、接收模块210、处理模块220和发送模块230均可以通过软件实现,或者可以通过硬件实现。示例性的,接下来以处理模块220为例,介绍处理模块220的实现方式。类似的,其他模块的实现方式可以参考处理模块220的实现方式。It should be noted that the client 100 and database management system 200 in Figure 1 are only exemplarily divided into the functional modules described above based on their functions. In reality, the client 100 and database management system 200 in Figure 1 can contain more or fewer modules. For example, one of the modules mentioned above can be split into multiple functional modules, or two or more modules in the client 100/database management system 200 can be merged into one functional module. Other functional modules can also be added to the client 100 and database management system 200. This application does not impose specific limitations on this. The sending module 110, receiving module 120, processing module 130, interaction module 140, receiving module 210, processing module 220, and sending module 230 can all be implemented in software or in hardware. For example, the implementation method of processing module 220 will be described below. Similarly, the implementation methods of other modules can refer to the implementation method of processing module 220.

模块作为软件功能单元的一种举例,处理模块220可以包括运行在计算实例上的代码。其中,计算实例可以包括物理主机(计算设备)、虚拟机、容器中的至少一种。进一步地,计算实例可以是一台或者多台。例如,处理模块220可以包括运行在多个主机/虚拟机/容器上的代码。需要说明的是,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的区域(region)中,也可以分布在不同的region中。进一步地,用于运行该代码的多个主机/虚拟机/容器可以分布在相同的可用区(availability zone,AZ)中,也可以分布在不同的AZ中,每个AZ包括一个数据中心或多个地理位置相近的数据中心。其中,通常一个region可以包括多个AZ。同样,用于运行该代码的多个主机/虚拟机/容器可以分布在同一个虚拟私有云(virtual private cloud,VPC)中,也可以分布在多个VPC中。其中,通常一个VPC设置在一个region内,同一region内两个VPC之间,以及不同region的VPC之间跨区通信需在每个VPC内设置通信网关,经通信网关实现VPC之间的互连。As an example of a software functional unit, processing module 220 may include code running on a compute instance. The compute instance may include at least one of a physical host (compute device), a virtual machine, or a container. Further, there may be one or more compute instances. For example, processing module 220 may include code running on multiple hosts/virtual machines/containers. It should be noted that the multiple hosts/virtual machines/containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts/virtual machines/containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region may include multiple AZs. Similarly, the multiple hosts/virtual machines/containers used to run the code may be distributed within the same virtual private cloud (VPC) or in multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC. The interconnection between VPCs is achieved through the communication gateway.

模块作为硬件功能单元的一种举例,处理模块220可以包括至少一个计算设备,如服务器。或者,处理模块220也可以是利用专用集成电路(application-specific integrated circuit,ASIC)实现、或可编程逻辑器件(programmable logic device,PLD)实现的设备等。其中,PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合实现。As an example of a hardware functional unit, processing module 220 may include at least one computing device, such as a server. Alternatively, processing module 220 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

处理模块220包括的多个计算设备可以分布在相同的region中,也可以分布在不同的region中。处理模块220包括的多个计算设备可以分布在相同的AZ中,也可以分布在不同的AZ中。同样,处理模块220包括的多个计算设备可以分布在同一个VPC中,也可以分布在多个VPC中。其中,所述多个计算设备可以是服务器、ASIC、PLD、CPLD、FPGA和GAL等计算设备的任意组合。The processing module 220 includes multiple computing devices that can be distributed within the same region or in different regions. Similarly, the processing module 220 can be distributed within the same Availability Zone (AZ) or in different AZs. Likewise, the processing module 220 can be distributed within the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

基于上述内容,下面介绍本申请提供的数据处理方法。Based on the above, the data processing method provided in this application is described below.

请参见图6,图6是本申请提供的一种数据处理方法的流程示意图,包括如下步骤S601~S606。Please refer to Figure 6, which is a flowchart of a data processing method provided in this application, including the following steps S601 to S606.

S601、客户端100向数据库管理系统200发送查询请求。S601, Client 100 sends a query request to Database Management System 200.

查询请求用于指示对多维数据库300关联的多维表单的数据查询处理。相应的,数据库管理系统200接收客户端100发送的查询请求。The query request is used to instruct data query processing for the multidimensional forms associated with the multidimensional database 300. Correspondingly, the database management system 200 receives the query request sent by the client 100.

关于查询请求以及多维表单的具体内容,请参考前文介绍,此处不赘述。For details regarding query requests and multidimensional forms, please refer to the previous introduction; they will not be repeated here.

S602、数据库管理系统200根据查询请求确定多维表单关联的多个维度成员。S602, Database Management System 200 determines the multiple dimension members associated with the multidimensional form based on the query request.

上述多个维度成员属于多维数据库300中的多个维度。The aforementioned multiple dimension members belong to multiple dimensions in the multidimensional database 300.

关于如何根据查询请求确定多维表单关联的多个维度成员,可参考前文描述的情况一~情况三,此处不赘述。For details on how to determine the multiple dimension members associated with a multidimensional form based on a query request, please refer to Case 1 to Case 3 described above, which will not be repeated here.

S603、数据库管理系统200根据多个维度成员确定数据和位置信息。S603, Database Management System 200 determines data and location information based on multiple dimensions of members.

其中,数据为多个维度成员在多维数据库300中对应的多个值,位置信息用于指示这多个值在多维表单中的行列位置以及每个值在多个维度成员中对应的成员。The data consists of multiple values corresponding to multiple dimension members in the multidimensional database 300. The location information is used to indicate the row and column positions of these multiple values in the multidimensional form and the member corresponding to each value among the multiple dimension members.

首先介绍如何确定数据,即多个维度成员在多维数据库300中对应的多个值。First, we will explain how to determine the data, that is, the multiple values corresponding to multiple dimension members in the multidimensional database 300.

数据库管理系统200先向多维数据库300请求获取多个维度成员在多维数据库300中对应的多个值,然后多维数据库300响应该请求,将多个值发送至数据库管理系统200。The database management system 200 first requests the multidimensional database 300 to retrieve the multiple values corresponding to the multiple dimension members in the multidimensional database 300. Then, the multidimensional database 300 responds to the request and sends the multiple values back to the database management system 200.

可选的,数据库管理系统200可以直接将多个维度成员的信息(如ID或名称)发送至多维数据库300,然后多维数据库300根据收到的信息去提取多个维度成员在多维数据库300中对应的多个值,进而将多个值返回给数据库管理系统200。Optionally, the database management system 200 can directly send information (such as ID or name) of multiple dimension members to the multidimensional database 300. Then, the multidimensional database 300 extracts the corresponding values of the multiple dimension members in the multidimensional database 300 based on the received information, and then returns the multiple values to the database management system 200.

以图2为例,由前文介绍可知,图2的多维表单关联8个维度成员,数据库管理系统200可以将这8个维度成员的ID发送至多维数据库300,相当于将数据查询范围给到了多维数据库300。然后,多维数据库300根据这8个维度成员的ID,提取这8个维度成员在多维数据库300中对应的多个值,将提取到的多个值返回给数据库管理系统200。Taking Figure 2 as an example, as described above, the multidimensional form in Figure 2 is associated with eight dimension members. The database management system 200 can send the IDs of these eight dimension members to the multidimensional database 300, which is equivalent to extending the data query scope to the multidimensional database 300. Then, based on the IDs of these eight dimension members, the multidimensional database 300 extracts the corresponding values of these eight dimension members in the multidimensional database 300 and returns the extracted values to the database management system 200.

可选的,数据库管理系统200可以先计算多个值中的每个值的成员元组,然后将每个值对应的成员元组都发送至多维数据库300。对于每个成员元组,多维数据库300提取该成员元组在多维数据库300中对应的位置上的值,该值即为该成员元组对应的值,然后将该值和该成员元组返回给数据库管理系统200。Optionally, the database management system 200 may first calculate the member tuple for each of the multiple values, and then send the member tuple corresponding to each value to the multidimensional database 300. For each member tuple, the multidimensional database 300 extracts the value at the corresponding position in the multidimensional database 300, which is the value corresponding to the member tuple, and then returns the value and the member tuple to the database management system 200.

继续以图2为例,由前文介绍可知,数据库管理系统200可以使用笛卡尔积算法计算多个值各自的成员元组,具体可参考前文介绍,此处不赘述。然后,数据库管理系统200可以将每个值的成员元组发送至数据库管理系统200,以向多维数据库300请求获取每个成员元组对应的值。对于接收到的任一成员元组时,多维数据库300可以从该成员元组在多维数据库300中对应的位置提取出一个值,然后将该值和该成员元组一起返回给数据库管理系统200。Continuing with Figure 2 as an example, as described above, the database management system 200 can use the Cartesian product algorithm to calculate the member tuples for each of the multiple values. For details, please refer to the previous description; it will not be repeated here. Then, the database management system 200 can send the member tuple of each value to the multidimensional database 300 to request the value corresponding to each member tuple. For any received member tuple, the multidimensional database 300 can extract a value from the corresponding position of that member tuple in the multidimensional database 300, and then return that value along with the member tuple to the database management system 200.

下面介绍如何确定位置信息。The following describes how to determine location information.

当数据库管理系统200从多维数据库300获得多个值时,可以将每个值填入多维表单中与该值对应相同成员元组的单元格中,然后将该单元格在多维表单中的行列位置作为该值的位置信息。When the database management system 200 obtains multiple values from the multidimensional database 300, it can fill each value into a cell in the multidimensional form that corresponds to the same member tuple, and then use the row and column position of the cell in the multidimensional form as the position information of the value.

继续以图2为例,假设数据库管理系统200已经向多维数据库300获得了12个值,其中一个值为100,该值的成员元组包括2015、产品A、销量和地区1。由于多维表单中的第0行第0列上的单元格对应的也是该成员元组,因此数据库管理系统200可以将该值填入该单元格,并且将该单元格在多维表单中的行列位置作为该值的行列位置,即第0行第0列。可以理解,12个值之外的其他值也可以通过类似方法填入相应的单元格,并确定值的行列位置,此处不过多介绍。Continuing with Figure 2 as an example, assume that the database management system 200 has obtained 12 values from the multidimensional database 300, one of which is 100. The member tuples for this value include 2015, Product A, Sales Volume, and Region 1. Since the cell in row 0, column 0 of the multidimensional form also corresponds to this member tuple, the database management system 200 can fill this value into that cell and use the row and column position of that cell in the multidimensional form as the row and column position of the value, i.e., row 0, column 0. It can be understood that other values besides the 12 can also be filled into corresponding cells and their row and column positions determined in a similar way; this will not be discussed further here.

当12个值都填入多维表单时,可以得到图3的多维表单,并且可以确定位置信息,位置信息用于指示12个值中的每个值的行列位置以及每个值的成员元组(即每个值在多个表单关联的多个维度成员中所对应的成员)。When all 12 values are filled into the multidimensional form, the multidimensional form shown in Figure 3 can be obtained, and the position information can be determined. The position information is used to indicate the row and column position of each of the 12 values and the member tuple of each value (i.e., the member corresponding to each value in the multiple dimensions associated with multiple forms).

S604、数据库管理系统200将数据转换为数组,并对位置信息进行压缩得到压缩信息。S604, the database management system 200 converts the data into an array and compresses the location information to obtain compressed information.

其中,数据为多个维度成员在多维数据库300中对应的多个值,可以按照这多个值在多维表单中的排列顺序,将这多个值写入数组中。关于将获取到的多个值转换为数组的具体内容,可参考前文介绍,此处不赘述。The data consists of multiple values corresponding to various dimensions in the multidimensional database 300. These values can be written into an array according to their order in the multidimensional form. For details on converting the obtained values into an array, please refer to the previous explanation; it will not be repeated here.

位置信息用于指示多个值在多维表单中的行列位置以及每个值在多个维度成员中对应的成员。数据库管理系统200可以先根据位置信息确定多维表单中的不同行号与多个维度成员的对应关系,然后生成压缩信息,压缩信息用于指示该对应关系。Location information is used to indicate the row and column positions of multiple values in a multidimensional form and the member corresponding to each value among multiple dimensions. The database management system 200 can first determine the correspondence between different row numbers in the multidimensional form and multiple dimension members based on the location information, and then generate compressed information to indicate this correspondence.

继续以图3进行举例,当数据库管理系统200得到图3的多维表单时,可以确定位置信息,位置信息用于指示12个值的行列位置以及每个值在多个维度成员中对应的成员。然后,数据库管理系统200可以根据位置信息确定多维表单中的各行号所对应的维度成员。如,行号0对应的维度成员包括2015、产品A和销量,行号1对应的维度成员包括2015、产品B和销量,行号2对应的维度成员包括2015、产品C和销量,行号3对应的维度成员包括2016、产品A和销量,行号4对应的维度成员包括2016、产品B和销量,行号5对应的维度成员包括2016、产品C和销量。Continuing with Figure 3 as an example, when the database management system 200 receives the multidimensional form in Figure 3, it can determine the location information. This location information indicates the row and column positions of the 12 values and the corresponding member of each value among multiple dimension members. Then, the database management system 200 can determine the dimension members corresponding to each row number in the multidimensional form based on the location information. For example, the dimension members corresponding to row number 0 include 2015, product A, and sales volume; row number 1 includes 2015, product B, and sales volume; row number 2 includes 2015, product C, and sales volume; row number 3 includes 2016, product A, and sales volume; row number 4 includes 2016, product B, and sales volume; and row number 5 includes 2016, product C, and sales volume.

然后,数据库管理系统200可以根据前面确定的6个行号和维度成员的对应关系生成压缩信息,压缩信息用于指示上述对应关系。Then, the database management system 200 can generate compressed information based on the previously determined correspondence between the 6 row numbers and dimension members. The compressed information is used to indicate the above correspondence.

可选的,压缩信息包括上述对应关系。或者,压缩信息包括目标行号、第一维度对应的运算数和多为表单关联的多个维度成员中属于第一维度的成员之间的顺序关系。其中,第一维度是多维表单关联的多个维度中的一个(可以是行结构关联的任意一个维度),目标行号是多维表单中的任一行号,目标行号对应第一维度下的一个维度成员(记为第一维度成员),第一维度成员在上述顺序关系中的索引值等于第一值除以多个维度成员中属于第一维度的成员数量得到的余数,第一值为目标行号除以第一维度的运算数得到的商。Optionally, the compressed information includes the above correspondence. Alternatively, the compressed information includes the target row number, the operands corresponding to the first dimension, and the order relationship between members belonging to the first dimension among multiple dimension members associated with the multidimensional form. Here, the first dimension is one of the multiple dimensions associated with the multidimensional form (it can be any dimension associated with a row structure), the target row number is any row number in the multidimensional form, the target row number corresponds to a dimension member under the first dimension (denoted as the first dimension member), the index value of the first dimension member in the above order relationship is equal to the remainder obtained by dividing the first value by the number of members belonging to the first dimension among the multiple dimension members, and the first value is the quotient obtained by dividing the target row number by the operands of the first dimension.

关于第一维度的运算数的值,可以参考前文介绍的类型一~类型三,此处不赘述。Regarding the values of the operands in the first dimension, please refer to Type 1 to Type 3 introduced earlier, which will not be repeated here.

可选的,数据库管理系统200还可以根据位置信息确定多维表单中的不同列号与多维表单关联的多个维度成员的对应关系,然后在压缩信息中携带该对应关系,或者在压缩信息中生成用于指示该对应关系的信息。Optionally, the database management system 200 can also determine the correspondence between different column numbers in the multidimensional form and multiple dimension members associated with the multidimensional form based on the location information, and then carry the correspondence in the compressed information, or generate information in the compressed information to indicate the correspondence.

继续以图3进行举例,当数据库管理系统200得到图3的多维表单时,可以确定位置信息,位置信息用于指示12个值的行列位置以及每个值在多个维度成员中对应的成员。然后,数据库管理系统200可以根据位置信息确定多维表单中的各列号所对应的维度成员。如,列号0对应地区1,列号2对应地区2。此时,数据库管理系统200可以直接将该对应关系携带于压缩信息中,或者,生成用于指示该对应关系的信息。Continuing with Figure 3 as an example, when the database management system 200 receives the multidimensional form in Figure 3, it can determine the location information. This location information indicates the row and column positions of the 12 values and the member corresponding to each value among multiple dimension members. Then, the database management system 200 can determine the dimension member corresponding to each column number in the multidimensional form based on the location information. For example, column number 0 corresponds to region 1, and column number 2 corresponds to region 2. At this point, the database management system 200 can directly include this correspondence in the compressed information, or generate information to indicate this correspondence.

该信息包括目标列号、第二维度对应的运算数和多维表单关联的多个维度成员中属于第二维度的成员之间的顺序关系。其中,第二维度是多维表单关联的多个维度中的一个(可以是列结构任意一个维度),目标列号是多维表单中的任一列号,目标列号对应第二维度下的一个维度成员(记为第二维度成员),第二维度成员在上述顺序关系中的索引值等于第二值除以多个维度成员中属于第二维度的成员数量得到的余数,第二值为目标列号除以第二维度的运算数得到的商。This information includes the target column number, the operands corresponding to the second dimension, and the order relationship between members belonging to the second dimension among the multiple dimension members associated with the multidimensional form. Here, the second dimension is one of the multiple dimensions associated with the multidimensional form (it can be any dimension in the column structure), the target column number is any column number in the multidimensional form, the target column number corresponds to a dimension member under the second dimension (denoted as the second dimension member), the index value of the second dimension member in the above order relationship is equal to the remainder obtained by dividing the second value by the number of members belonging to the second dimension among the multiple dimension members, and the second value is the quotient obtained by dividing the target column number by the operands of the second dimension.

关于第二维度的运算数的值,可参考前文介绍的类型四~类型六,此处不赘述。Regarding the values of the operands in the second dimension, please refer to Types 4 to 6 introduced earlier, which will not be repeated here.

可选的,压缩信息还包括行号数组,行号数组包括多维表单中的不同行号,行号数组的长度小于或等于多维表单关联的每个维度的成员数量的乘积,并且行号数组的长度小于或等于多维表单的行结构对应的每个维度的成员数量的乘积。由前文描述可知,如果数据库管理系统200对多维表单中的一行或多行进行消空,则行号数组的长度小于多维表单的行结构对应的每个维度的成员数量的乘积,从而减少后续向客户端100的数据传输量;如果对多维表单中的一行或多行不进行消空,则行号数组的长度等于多维表单的行结构对应的每个维度的成员数量的乘积。Optionally, the compression information also includes a row number array, which contains different row numbers from the multidimensional form. The length of the row number array is less than or equal to the product of the number of members in each dimension associated with the multidimensional form, and the length of the row number array is less than or equal to the product of the number of members in each dimension corresponding to the row structure of the multidimensional form. As described above, if the database management system 200 clears one or more rows in the multidimensional form, the length of the row number array is less than the product of the number of members in each dimension corresponding to the row structure of the multidimensional form, thereby reducing the amount of data transmitted to the client 100. If one or more rows in the multidimensional form are not cleared, the length of the row number array is equal to the product of the number of members in each dimension corresponding to the row structure of the multidimensional form.

可选的,压缩信息还可以包括列号数组,列号数组包括多维表单中的不同列号,列号数组的长度小于或等于多维表单的列结构对应的每个维度的成员数量的乘积。由前文描述可知,如果对多维表单中的一列或多列进行消空,则列号数组的长度小于多维表单的列结构对应的每个维度的成员数量的乘积,如果对多维表单中的一行或多行不进行消空,则列号数组的长度等于多维表单的列结构对应的每个维度的成员数量的乘积。Optionally, the compressed information may also include a column number array, which includes the different column numbers in the multidimensional form. The length of the column number array is less than or equal to the product of the number of members in each dimension corresponding to the column structure of the multidimensional form. As described above, if one or more columns in the multidimensional form are cleared, the length of the column number array is less than the product of the number of members in each dimension corresponding to the column structure of the multidimensional form. If one or more rows in the multidimensional form are not cleared, the length of the column number array is equal to the product of the number of members in each dimension corresponding to the column structure of the multidimensional form.

S605、数据库管理系统200向客户端100传输查询结果,查询结果包括数组和压缩信息。S605, the database management system 200 transmits query results to the client 100. The query results include arrays and compressed information.

关于查询结果中的数组和压缩信息,可参考前文介绍,此处不赘述。For information on arrays and compression in the query results, please refer to the previous text; it will not be repeated here.

可选的,查询结果还包括样式元数据,样式元数据用于指示客户端100显示多个值时采用的样式。关于样式以及样式元数据的具体内容,请参考前文相关介绍,此处不赘述。Optionally, the query results may also include style metadata, which indicates the style used when the client displays multiple values. For details on styles and style metadata, please refer to the previous section; they will not be repeated here.

可选的,查询结果还包括状态信息,状态信息用于指示多个值在多维数据库300中的状态,状态包括可写状态和只读状态。状态信息可以以单元格状态数组的形式来表示,关于单元格值状态数组,可参考前文介绍,此处不赘述。Optionally, the query results also include status information, which indicates the status of multiple values in the multidimensional database 300. Status includes writable and read-only states. Status information can be represented as an array of cell statuses. For details on cell value status arrays, please refer to the previous section; they will not be repeated here.

S606、客户端100根据查询结果显示多维表单。S606 and Client 100 display multidimensional forms based on query results.

关于客户端100如何根据查询结果显示多维表单,可参考前文介绍,此处不赘述。For information on how the client-side 100 displays a multidimensional form based on query results, please refer to the previous introduction; it will not be repeated here.

综上所述,在本申请提供的数据处理方法中,数据库管理系统200先根据客户端100发送的查询结果确定多维表单关联的多个维度成员,再根据多个维度成员确定数据和位置信息,数据为多个维度成员在多维数据库300中对应的多个值,位置信息用于指示多个值在多维表单中的行列位置以及每个值在上述多个维度成员中对应的成员。然后将数据转换为数组,并对位置信息进行压缩得到压缩信息,进而将数组和压缩信息携带于查询结果中,以传输至客户端100。In summary, in the data processing method provided in this application, the database management system 200 first determines the multiple dimension members associated with the multidimensional form based on the query results sent by the client 100. Then, based on these multiple dimension members, it determines the data and location information. The data consists of multiple values corresponding to the multiple dimension members in the multidimensional database 300. The location information indicates the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value among the aforementioned multiple dimension members. The data is then converted into an array, and the location information is compressed to obtain compressed information. Finally, the array and compressed information are carried in the query results for transmission to the client 100.

相较于将多维表单中的所有值以及每个值的行列坐标及对应的维度成员直接发送至客户端100的常规方案,本申请提供的方法通过对位置信息进行压缩,随后将压缩得到的压缩信息和生成的数组(包括上述多个值)发送至客户端100,从而减少了数据库管理系统200向客户端100的整体数据传输量,进而缩短了数据传输时间。其中,数组是按照多个值在多维表单中的排列顺序填入数组中的,当客户端100接收到该数组时,可以直接按照该数组中的这多个值的顺序在客户端100显示的多维表单中加载这多个值,有助于提升客户端100的表单显示速度,进而提升用户体验。Compared to the conventional approach of directly sending all values from a multidimensional form, along with the row and column coordinates and corresponding dimension members of each value, to client 100, the method provided in this application compresses the location information and then sends the compressed information and the generated array (including the aforementioned values) to client 100. This reduces the overall data transmission volume from database management system 200 to client 100, thereby shortening data transmission time. The array is filled with the values according to their order in the multidimensional form. When client 100 receives this array, it can directly load these values into the multidimensional form displayed on client 100 according to the order of the values in the array, improving the form display speed on client 100 and thus enhancing user experience.

本申请还提供一种数据处理装置,该装置包括图1的接收模块210、处理模块220和发送模块230。该装置具体用于执行图6中的数据库管理系统200侧的方法步骤。关于接收模块210、处理模块220和发送模块230的具体功能以及软硬件实现方式,可参考图1中的相关介绍,此处不赘述。This application also provides a data processing apparatus, which includes a receiving module 210, a processing module 220, and a transmitting module 230 as shown in FIG1. This apparatus is specifically used to execute the method steps of the database management system 200 shown in FIG6. For details regarding the specific functions and hardware/software implementation of the receiving module 210, processing module 220, and transmitting module 230, please refer to the relevant description in FIG1, which will not be repeated here.

下面介绍用于执行图6的数据处理方法的一种计算设备。The following describes a computing device used to perform the data processing method shown in Figure 6.

请参见图7,本申请还提供一种计算设备700,包括总线702、处理器704、存储器706和通信接口708。处理器704、存储器706和通信接口708之间通过总线702通信。计算设备700可以是服务器、笔记本电脑、台式计算机、边缘设备等,本申请实施例不做具体限定,本申请实施例也不限定计算设备700中的处理器以及存储器的个数。Referring to Figure 7, this application also provides a computing device 700, including a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, the memory 706, and the communication interface 708 communicate with each other via the bus 702. The computing device 700 may be a server, a laptop computer, a desktop computer, an edge device, etc., and this application does not specifically limit the number of processors and memories in the computing device 700.

总线702,可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线702可包括在计算设备700各个部件(例如,存储器706、处理器704、通信接口708)之间传送信息的通路。Bus 702 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one line is used in Figure 7, but this does not imply that there is only one bus or one type of bus. Bus 702 can include pathways for transmitting information between various components of computing device 700 (e.g., memory 706, processor 704, communication interface 708).

处理器704,可以包括中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。Processor 704 may include any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

存储器706可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。处理器704还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard disk drive,HDD)或固态硬盘(solid state drive,SSD)。The memory 706 may include volatile memory, such as random access memory (RAM). The processor 704 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

存储器706中存储有可执行的程序代码。处理器704执行该可执行的程序代码以分别实现图1中的接收模块210、处理模块220和发送模块230的功能,从而实现本申请图6中的数据库管理系统200侧的方法步骤。The memory 706 stores executable program code. The processor 704 executes the executable program code to implement the functions of the receiving module 210, processing module 220 and sending module 230 in FIG1, respectively, thereby implementing the method steps of the database management system 200 in FIG6 of this application.

通信接口708使用例如但不限于网络接口卡、收发器一类的收发模块,来实现计算设备700与其他设备或通信网络之间的通信。The communication interface 708 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 700 and other devices or communication networks.

应理解,根据本申请的计算设备700可对应于本申请图1所示的数据库管理系统200或客户端100,并可以对应于执行本申请图2至图6所示的数据处理方法中的相应主体,并且计算设备700的各个模块分别为了实现图2至图6中的各个方法的相应流程,为了简洁,在此不再赘述。It should be understood that the computing device 700 according to this application may correspond to the database management system 200 or client 100 shown in FIG1 of this application, and may correspond to the corresponding subject in executing the data processing methods shown in FIG2 to FIG6 of this application. Each module of the computing device 700 is for implementing the corresponding process of each method in FIG2 to FIG6. For the sake of brevity, it will not be described in detail here.

作为一种可能的实现方式,计算设备700也可包括芯片系统,芯片系统包括处理器和供电电路,供电电路用于对处理器执行供电,处理器用于执行数据处理方法所对应的操作步骤。为了简洁,在此不再赘述。其中,处理器可通过CPU实现,也可通过GPU、DPU、NPU、XPU、SoC、卸载卡、加速卡等计算设备或AI芯片实现。As one possible implementation, the computing device 700 may also include a chip system, which includes a processor and a power supply circuit. The power supply circuit supplies power to the processor, and the processor executes the operation steps corresponding to the data processing method. For simplicity, further details are omitted here. The processor can be implemented using a CPU, or it can be implemented using computing devices or AI chips such as GPUs, DPUs, NPUs, XPUs, SoCs, offloading cards, or accelerator cards.

作为一种可能的实现方式,计算设备700中可包括多种类型的处理器704,即计算设备700为异构设备,例如,计算设备700中包括CPU和GPU,可以由其中处理器704中至少一个处理器执行数据处理方法所对应的操作步骤。为了简洁,在此不再赘述。As one possible implementation, the computing device 700 may include multiple types of processors 704, meaning the computing device 700 is a heterogeneous device. For example, the computing device 700 may include a CPU and a GPU, and the operation steps corresponding to the data processing method can be executed by at least one of the processors 704. For the sake of brevity, further details will not be provided here.

本申请还提供了一种计算设备集群。该计算设备集群包括至少一台计算设备。该计算设备可以是服务器,例如是中心服务器、边缘服务器,或者是本地数据中心中的本地服务器。在一些实施例中,计算设备也可以是台式机、笔记本电脑或者智能手机等终端设备。This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can 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 can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

如图8所示,所述计算设备集群包括至少一个计算设备700。计算设备集群中的一个或多个计算设备700中的存储器706中可以存有相同的用于执行图6中的数据库管理系统200侧的方法的指令。As shown in Figure 8, the computing device cluster includes at least one computing device 700. The memory 706 of one or more computing devices 700 in the computing device cluster may store the same instructions for executing the methods on the database management system 200 side of Figure 6.

在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备700的存储器706中也可以分别存有用于执行前面图6中的数据库管理系统200侧的方法的部分指令。换言之,一个或多个计算设备700的组合可以共同执行用于图6中的数据库管理系统200侧的方法的指令。In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store partial instructions for executing the methods on the database management system 200 side of FIG6. In other words, a combination of one or more computing devices 700 can jointly execute instructions for the methods on the database management system 200 side of FIG6.

需要说明的是,计算设备集群中的不同的计算设备700中的存储器706可以存储不同的指令,分别用于执行图1的数据库管理系统200的部分功能。也即,不同的计算设备700中的存储器706存储的指令可以实现接收模块210、处理模块220和发送模块230中的一个或多个模块的功能。It should be noted that the memory 706 in different computing devices 700 within the computing device cluster can store different instructions, which are used to execute some functions of the database management system 200 in Figure 1. That is, the instructions stored in the memory 706 of different computing devices 700 can implement the functions of one or more modules among the receiving module 210, processing module 220, and sending module 230.

在一些可能的实现方式中,计算设备集群中的一个或多个计算设备可以通过网络连接。其中,所述网络可以是广域网或局域网等等。图9示出了一种可能的实现方式。如图9所示,两个计算设备700A和700B之间通过网络进行连接。具体地,通过各个计算设备中的通信接口与网络进行连接。在这一类可能的实现方式中,计算设备700A中的存储器706中存有执行接收模块210和发送模块230的功能的指令。同时,计算设备700B中的存储器706中存有执行处理模块220的功能的指令。In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 9 illustrates one possible implementation. As shown in Figure 9, two computing devices 700A and 700B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this type of possible implementation, the memory 706 in computing device 700A stores instructions for performing the functions of the receiving module 210 and the transmitting module 230. Simultaneously, the memory 706 in computing device 700B stores instructions for performing the functions of the processing module 220.

应理解,图9中示出的计算设备700A的功能也可以由多个计算设备700共同完成。同样,计算设备700B的功能也可以由多个计算设备700共同完成。It should be understood that the function of computing device 700A shown in Figure 9 can also be performed by multiple computing devices 700. Similarly, the function of computing device 700B can also be performed by multiple computing devices 700.

本申请还提供了另一种计算设备集群。该计算设备集群中各计算设备之间的连接关系可以类似的参考图9所述计算设备集群的连接方式。不同的是,该计算设备集群中的一个或多个计算设备700中的存储器706中可以存有相同的用于执行前面图6中的数据库管理系统200侧的方法的指令。This application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection method of the computing device cluster shown in FIG9. The difference is that the memory 706 in one or more computing devices 700 in this computing device cluster can store the same instructions for executing the methods on the database management system 200 side of FIG6.

在一些可能的实现方式中,该计算设备集群中的一个或多个计算设备700的存储器706中也可以分别存有用于执行可实现图6中的数据库管理系统200侧的方法的部分指令。换言之,一个或多个计算设备700的组合可以共同执行用于实现图6中的数据库管理系统200侧的方法步骤的指令。In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store partial instructions for executing the methods that implement the database management system 200 side of FIG6. In other words, a combination of one or more computing devices 700 can jointly execute instructions for implementing the method steps of the database management system 200 side of FIG6.

本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备集群(包括至少一个计算设备)执行图6中的数据库管理系统200侧的方法步骤。This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being 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., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct a cluster of computing devices (including at least one computing device) to perform the method steps of the database management system 200 side of FIG. 6.

本申请还提供了一种包含指令的计算机程序产品。所述计算机程序产品可以是包含指令的,能够运行在计算设备上或被储存在任何可用介质中的软件或程序产品。当所述计算机程序产品在至少一个计算设备上运行时,使得至少一个计算设备执行图6中的数据库管理系统200侧的方法步骤。This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to perform the method steps of the database management system 200 side of FIG6.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的保护范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.

Claims (12)

一种数据处理方法,其特征在于,所述方法由数据库管理系统执行,所述方法包括:A data processing method, characterized in that the method is executed by a database management system, the method comprising: 接收客户端发送的查询请求,所述查询请求用于指示对多维数据库关联的多维表单的数据查询处理;Receive a query request sent by a client, the query request being used to instruct data query processing on a multidimensional form associated with a multidimensional database; 根据所述查询请求确定所述多维表单关联的多个维度成员,所述多个维度成员属于多维数据库中的多个维度;The query request determines the multiple dimension members associated with the multidimensional form, and the multiple dimension members belong to multiple dimensions in the multidimensional database; 根据所述多个维度成员确定数据和位置信息,所述数据为所述多个维度成员在所述多维数据库中对应的多个值,所述位置信息用于指示所述多个值在所述多维表单中的行列位置以及每个值在所述多个维度成员中对应的成员;Data and location information are determined based on the multiple dimension members, wherein the data consists of multiple values corresponding to the multiple dimension members in the multidimensional database, and the location information is used to indicate the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value in the multiple dimension members; 将所述数据转换为数组,并对所述位置信息进行压缩得到压缩信息;The data is converted into an array, and the location information is compressed to obtain compressed information; 向所述客户端传输查询结果,所述查询结果包括所述数组和所述压缩信息。The query results are transmitted to the client, and the query results include the array and the compressed information. 根据权利要求1所述的方法,其特征在于,所述将所述数据转换为数组,包括:The method according to claim 1, wherein converting the data into an array comprises: 按照所述多个值在所述多维表单中的排列顺序,将所述多个值写入所述数组中。The values are written into the array according to their order of arrangement in the multidimensional form. 根据权利要求1或2所述的方法,其特征在于,所述位置信息包括行号,所述对所述位置信息进行压缩得到压缩信息,包括:The method according to claim 1 or 2, characterized in that the location information includes a row number, and the step of compressing the location information to obtain compressed information includes: 根据所述位置信息确定所述多维表单的不同行号与所述多个维度成员的对应关系;The correspondence between different row numbers of the multidimensional form and the multiple dimension members is determined based on the location information; 生成压缩信息,所述压缩信息用于指示所述对应关系。Generate compressed information, which is used to indicate the correspondence. 根据权利要求3所述的方法,其特征在于,所述压缩信息包括所述目标行号、第一维度对应的运算数和所述多个维度成员中属于所述第一维度的成员之间的顺序关系,所述第一维度是所述多个维度中的其中一个维度,所述目标行号对应的第一维度成员在所述顺序关系中的索引值等于第一值除以所述多个维度成员中属于所述第一维度的成员数量得到的余数,所述第一维度成员属于所述第一维度,所述第一值为所述目标行号除以所述运算数得到的商;According to the method of claim 3, the compression information includes the target row number, the operands corresponding to the first dimension, and the order relationship between members belonging to the first dimension among the plurality of dimension members, wherein the first dimension is one of the plurality of dimensions, the index value of the first dimension member corresponding to the target row number in the order relationship is equal to the remainder obtained by dividing the first value by the number of members belonging to the first dimension among the plurality of dimension members, the first dimension member belongs to the first dimension, and the first value is the quotient obtained by dividing the target row number by the operands; 其中,若所述多个维度中位于所述第一维度之后的其他维度的数量为零,则所述运算数的值为1,若所述其他维度的数量为1,则所述运算数的值为所述多维表单关联的所述其他维度的成员数量,若所述其他维度的数量大于1,则所述运算数的值为所述多维表单关联的所述其他维度的成员数量的乘积。Wherein, if the number of other dimensions following the first dimension is zero, the value of the operand is 1; if the number of other dimensions is 1, the value of the operand is the number of members of the other dimensions associated with the multidimensional form; if the number of other dimensions is greater than 1, the value of the operand is the product of the number of members of the other dimensions associated with the multidimensional form. 根据权利要求3或4所述的方法,其特征在于,所述压缩信息还包括行号数组,所述行号数组包括所述多维表单的不同行号,所述行号数组的长度小于或等于所述多维表单关联的每个维度的成员数量的乘积。According to the method of claim 3 or 4, the compressed information further includes a row number array, the row number array including different row numbers of the multidimensional form, and the length of the row number array is less than or equal to the product of the number of members of each dimension associated with the multidimensional form. 根据权利要求1至5中任一项所述的方法,其特征在于,所述查询结果还包括样式元数据,所述样式元数据用于指示所述客户端显示所述多个值时采用的样式。The method according to any one of claims 1 to 5 is characterized in that the query result further includes style metadata, the style metadata being used to indicate the style used by the client when displaying the plurality of values. 根据权利要求1至6中任一项所述的方法,其特征在于,所述查询结果还包括状态信息,所述状态信息用于指示所述多个值在所述多维数据库中的状态,所述状态包括可写状态和只读状态。The method according to any one of claims 1 to 6 is characterized in that the query result further includes status information, the status information being used to indicate the status of the plurality of values in the multidimensional database, the status including a writable status and a read-only status. 一种数据处理装置,其特征在于,包括:A data processing apparatus, characterized in that it comprises: 接收模块,用于接收客户端发送的查询请求,所述查询请求用于指示对多维数据库关联的多维表单的数据查询处理;The receiving module is used to receive query requests sent by the client, the query requests being used to instruct data query processing of the multidimensional form associated with the multidimensional database; 处理模块,用于根据所述查询请求确定所述多维表单关联的多个维度成员,所述多个维度成员属于多维数据库中的多个维度;The processing module is used to determine, based on the query request, multiple dimension members associated with the multidimensional form, wherein the multiple dimension members belong to multiple dimensions in the multidimensional database; 所述处理模块,还用于根据所述多个维度成员确定数据和位置信息,所述数据为所述多个维度成员在所述多维数据库中对应的多个值,所述位置信息用于指示所述多个值在所述多维表单中的行列位置以及每个值在所述多个维度成员中对应的成员;The processing module is further configured to determine data and location information based on the multiple dimension members, wherein the data is multiple values corresponding to the multiple dimension members in the multidimensional database, and the location information is used to indicate the row and column positions of the multiple values in the multidimensional form and the member corresponding to each value in the multiple dimension members; 所述处理模块,还用于将所述数据转换为数组,并对所述位置信息进行压缩得到压缩信息;The processing module is further configured to convert the data into an array and compress the position information to obtain compressed information; 发送模块,用于向所述客户端传输查询结果,所述查询结果包括所述数组和所述压缩信息。The sending module is used to transmit query results to the client, the query results including the array and the compressed information. 根据权利要求8所述的装置,其特征在于,所述处理模块具体用于:The apparatus according to claim 8, wherein the processing module is specifically used for: 按照所述多个值在所述多维表单中的排列顺序,将所述多个值写入所述数组中。The values are written into the array according to their order of arrangement in the multidimensional form. 根据权利要求8或9所述的装置,其特征在于,所述位置信息包括行号,所述处理模块具体用于:The apparatus according to claim 8 or 9, wherein the location information includes a row number, and the processing module is specifically used for: 根据所述位置信息确定所述多维表单的不同行号与所述多个维度成员的对应关系;The correspondence between different row numbers of the multidimensional form and the multiple dimension members is determined based on the location information; 生成压缩信息,所述压缩信息用于指示所述对应关系。Generate compressed information, which is used to indicate the correspondence. 根据权利要求10所述的装置,其特征在于,所述压缩信息包括所述目标行号、第一维度对应的运算数和所述多个维度成员中属于所述第一维度的成员之间的顺序关系,所述第一维度是所述多个维度中的其中一个维度,所述目标行号对应的第一维度成员在所述顺序关系中的索引值等于第一值除以所述多个维度成员中属于所述第一维度的成员数量得到的余数,所述第一维度成员属于所述第一维度,所述第一值为所述目标行号除以所述运算数得到的商;The apparatus according to claim 10, wherein the compression information includes the target row number, the operands corresponding to the first dimension, and the order relationship between members belonging to the first dimension among the plurality of dimension members, wherein the first dimension is one of the plurality of dimensions, the index value of the first dimension member corresponding to the target row number in the order relationship is equal to the remainder obtained by dividing the first value by the number of members belonging to the first dimension among the plurality of dimension members, the first dimension member belongs to the first dimension, and the first value is the quotient obtained by dividing the target row number by the operands; 其中,若所述多个维度中位于所述第一维度之后的其他维度的数量为零,则所述运算数的值为1,若所述其他维度的数量为1,则所述运算数的值为所述多维表单关联的所述其他维度的成员数量,若所述其他维度的数量大于1,则所述运算数的值为所述多维表单关联的所述其他维度的成员数量的乘积。Wherein, if the number of other dimensions following the first dimension is zero, the value of the operand is 1; if the number of other dimensions is 1, the value of the operand is the number of members of the other dimensions associated with the multidimensional form; if the number of other dimensions is greater than 1, the value of the operand is the product of the number of members of the other dimensions associated with the multidimensional form. 一种计算设备,其他证在于,所述计算设备包括处理器和存储器;A computing device, further shown in that the computing device includes a processor and a memory; 所述处理器用于执行所述存储器中存储的指令,以使得所述计算设备执行如权利要求1至7任一所述的方法的操作步骤。The processor is configured to execute instructions stored in the memory to cause the computing device to perform the operational steps of the method as described in any one of claims 1 to 7.
PCT/CN2025/085794 2024-04-30 2025-03-28 Data processing method and apparatus, computing device, and storage medium Pending WO2025228033A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410547898.8 2024-04-30
CN202410547898.8A CN120873006A (en) 2024-04-30 2024-04-30 Data processing method, device, computing equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2025228033A1 true WO2025228033A1 (en) 2025-11-06

Family

ID=97459889

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/085794 Pending WO2025228033A1 (en) 2024-04-30 2025-03-28 Data processing method and apparatus, computing device, and storage medium

Country Status (2)

Country Link
CN (1) CN120873006A (en)
WO (1) WO2025228033A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060007731A1 (en) * 2004-07-09 2006-01-12 Microsoft Corporation Database query tools
US20080114793A1 (en) * 2006-11-09 2008-05-15 Cognos Incorporated Compression of multidimensional datasets
CN104361118A (en) * 2014-12-01 2015-02-18 中国人民大学 Mixed OLAP (on-line analytical processing) inquiring treating method adapting coprocessor
CN112632061A (en) * 2020-12-03 2021-04-09 海腾保险代理有限公司 Multidimensional data storage method and device
CN114138821A (en) * 2022-01-12 2022-03-04 广州思迈特软件有限公司 Database query method, system and electronic equipment
CN117648385A (en) * 2023-11-24 2024-03-05 哈尔滨工业大学 Internal and external memory compression and tuple update and insertion methods suitable for multi-dimensional databases

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060007731A1 (en) * 2004-07-09 2006-01-12 Microsoft Corporation Database query tools
US20080114793A1 (en) * 2006-11-09 2008-05-15 Cognos Incorporated Compression of multidimensional datasets
CN104361118A (en) * 2014-12-01 2015-02-18 中国人民大学 Mixed OLAP (on-line analytical processing) inquiring treating method adapting coprocessor
CN112632061A (en) * 2020-12-03 2021-04-09 海腾保险代理有限公司 Multidimensional data storage method and device
CN114138821A (en) * 2022-01-12 2022-03-04 广州思迈特软件有限公司 Database query method, system and electronic equipment
CN117648385A (en) * 2023-11-24 2024-03-05 哈尔滨工业大学 Internal and external memory compression and tuple update and insertion methods suitable for multi-dimensional databases

Also Published As

Publication number Publication date
CN120873006A (en) 2025-10-31

Similar Documents

Publication Publication Date Title
US10558659B2 (en) Techniques for dictionary based join and aggregation
CN108519967B (en) Chart visualization method and device, terminal and storage medium
US9418101B2 (en) Query optimization
JP2021170409A (en) Label data processing method, apparatus therefor, device, and recording medium
CN110851474A (en) Data query method, database middleware, data query device and storage medium
CN116783588A (en) Column technology for big metadata management
US20240393928A1 (en) Generating aggregate data geospatial grid cells for encoding in vector tiles
US20260010548A1 (en) Data management method and computing device
US20220374406A1 (en) KV Database Configuration Method, Query Method, Device, and Storage Medium
US11030177B1 (en) Selectively scanning portions of a multidimensional index for processing queries
CN116257180A (en) Data access method and device
EP4621593A1 (en) Data storage methods and apparatuses for graph database
WO2025228033A1 (en) Data processing method and apparatus, computing device, and storage medium
WO2023220973A1 (en) Data processing method and apparatus, and electronic device and computer-readable storage medium
CN117255992A (en) Efficient storage and querying of schema-free data
CN111767279A (en) Data merging method and apparatus
WO2025222913A1 (en) Data query method and apparatus, computer device, and storage medium
US8171046B1 (en) Converting CQL query results into user-controllable objects
CN117609386A (en) Data fragment storage method, device, equipment and storage medium
CN110427377A (en) Data processing method, device, equipment and storage medium
CN117389960A (en) File parsing method, apparatus, device, storage medium and program product
CN111309704B (en) Database operation method and database operation system
CN118069024A (en) Data storage method, device, storage medium and electronic device
CN121051120A (en) Data writing method and related device
CN120849662A (en) Data display method, system and related equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25797209

Country of ref document: EP

Kind code of ref document: A1