Multi-dimensional data query method, system and equipment and storage medium
By receiving and processing multi-dimensional data query requests, determining query scripts and executing queries, the problem of poor flexibility in traditional reporting is solved, and efficient multi-dimensional data query is realized, reducing costs and load.
Patent Information
- Application Number
- CN202510596475.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-19
AI Technical Summary
Traditional reporting is poor in multi-dimensional data query, resulting in low data query efficiency and difficulty in supporting dynamic multi-dimensional analysis.
By receiving multi-dimensional data query requests, performing parameterized processing, determining the query script, and executing the query script, querying data from the preset database, using primary keys and foreign keys to support related queries between data tables, and using cached data to improve query efficiency.
It improves the query efficiency of multi-dimensional data in banking financial systems and medical systems, reduces the cost of multi-dimensional data query, and avoids duplicate execution and database load.
Smart Images

Figure CN120508567A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, system, device and storage medium for querying multi-dimensional data. Background Art
[0002] Data in fields like finance and healthcare often has multiple dimensions. Multidimensional data analysis allows us to observe data from multiple perspectives, avoiding the incomplete information that comes with relying solely on single-dimensional analysis. This allows us to more comprehensively and accurately grasp the inherent characteristics and patterns of the data. For example, in the financial sector, with the deepening digital transformation of the banking industry, multidimensional data analysis has become a key means for financial institutions to enhance their core competitiveness. Its demand is growing in many scenarios, including risk assessment, user profiling, and credit approval. In healthcare, multidimensional data analysis plays a vital role in patient medical data and medical resource management.
[0003] However, whether in the financial or medical fields, traditional standardized reports have fixed dimensions and poor flexibility, making it difficult to support dynamic multi-dimensional analysis of data and resulting in inefficient data queries for multi-dimensional data.
[0004] It can be seen that the current traditional standardized reports for the fields of finance, medical care, etc. have the problem of low data query efficiency during the multi-dimensional data query process. Summary of the Invention
[0005] In view of this, one of the objectives of the present application is to provide a multi-dimensional data query method, a multi-dimensional data query system, a computer device and a computer-readable storage medium, which can improve the efficiency of data query on multi-dimensional data.
[0006] To achieve the above objectives, the technical solution of this application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a multi-dimensional data query method, the multi-dimensional data query method comprising:
[0008] receiving a multi-dimensional data query request, where the multi-dimensional data query request includes at least one query dimension information;
[0009] In response to a multi-dimensional data query request, parameterize each query dimension information to obtain a dimension parameter corresponding to each query dimension information;
[0010] When the query field names corresponding to the respective dimension parameters are determined, a query script is determined according to the query field names corresponding to the respective dimension parameters;
[0011] Execute the query script to query query data corresponding to at least one query dimension information from a preset database.
[0012] In a possible implementation, determining a query script based on the query field name corresponding to each dimension parameter includes:
[0013] Dynamically concatenate the query field names corresponding to each dimension parameter with the preset SQL query statement to obtain a query script;
[0014] Among them, the SQL query statement includes selection fields, data table names and filter conditions. The selection fields are used to specify the names of the query fields to be queried, the data table name is the name of the data table to be queried, and the filter conditions are used to limit the query to information corresponding to the query field names.
[0015] In a possible implementation, in response to a multi-dimensional data query request, parameterizing each query dimension information to obtain a dimension parameter corresponding to each query dimension information includes:
[0016] Detecting the multi-dimensional data query request to obtain a first detection result;
[0017] When the first detection result indicates that the query dimension information in the multi-dimensional data query request is empty, in response to the multi-dimensional data query request, each preset dimension information in the preset dimension information set is parameterized to obtain the dimension parameters corresponding to each preset dimension information.
[0018] In a possible implementation, in response to a multi-dimensional data query request, parameterizing each query dimension information to obtain a dimension parameter corresponding to each query dimension information includes:
[0019] Detecting the multi-dimensional data query request to obtain a second detection result;
[0020] Determining a user identifier of a requesting user corresponding to the multi-dimensional data query request;
[0021] If the second detection result indicates that the query dimension information in the multi-dimensional data query request is empty, determining the associated dimension information associated with the user identifier in response to the multi-dimensional data query request;
[0022] Parameterization is performed on the associated dimension information associated with the user identifier to obtain dimension parameters corresponding to each piece of associated dimension information.
[0023] In one possible implementation, executing a query script to query query data corresponding to at least one query dimension information from a preset database includes:
[0024] Determine the data table to be queried corresponding to each dimension parameter;
[0025] Execute the query script to query the query data corresponding to at least one query dimension information from the to-be-queried data table corresponding to each dimension parameter;
[0026] The preset database includes a plurality of data tables to be queried, each of which includes a primary key and a foreign key, and the primary key and the foreign key are used to support an association query between the data tables to be queried.
[0027] In a possible implementation, before executing the query script to query the preset database for query data corresponding to at least one query dimension information, the method further includes:
[0028] Get the cached data in the cache area;
[0029] When it is detected that cache data corresponding to the query script exists in the cache area, the cache data corresponding to the query script is used as query data corresponding to at least one query dimension information.
[0030] In a possible implementation, before executing the query script to query the preset database for query data corresponding to at least one query dimension information, the method further includes:
[0031] Performing syntax check on the query script to obtain a third test result;
[0032] Executing a query script to query query data corresponding to at least one query dimension information from a preset database includes:
[0033] When the third detection result indicates that the query script has no syntax errors, the query script is executed to query query data corresponding to at least one query dimension information from a preset database.
[0034] In a second aspect, an embodiment of the present application provides a multi-dimensional data query system, the multi-dimensional data query system comprising:
[0035] A receiving module, configured to receive a multi-dimensional data query request, the multi-dimensional data query request including at least one query dimension information;
[0036] A response module is used to respond to a multi-dimensional data query request, perform parameterization processing on each query dimension information, and obtain dimension parameters corresponding to each query dimension information;
[0037] A determination module, configured to determine a query script according to the query field names corresponding to the respective dimensional parameters when the query field names corresponding to the respective dimensional parameters are determined;
[0038] The query module is used to execute the query script and query the query data corresponding to at least one query dimension information from the preset database.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory and a processor. A computer program is stored in the memory. When the computer program is executed by the processor, it implements the multi-dimensional data query method provided in the first aspect.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by one or more processors, the multi-dimensional data query method provided in the first aspect is implemented.
[0041] An embodiment of the present application provides a method for querying multidimensional data. The method receives a multidimensional data query request and, in response to the multidimensional data query request, parameterizes each query dimension information to obtain dimension parameters corresponding to each query dimension information. The multidimensional data query request includes at least one query dimension information. Then, after determining the query field names corresponding to each dimension parameter, a query script is determined based on the query field names corresponding to each dimension parameter. Finally, the query script is executed to quickly query query data corresponding to at least one query dimension information from a preset database, thereby improving the efficiency of data queries for multidimensional data in banking, financial, and medical systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. It should be understood that the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A flowchart of a multi-dimensional data query method provided in an embodiment of the present application;
[0044] Figure 2 A flowchart for obtaining dimension parameters corresponding to query dimension information included in a multi-dimensional data query method provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of the functional modules of a multi-dimensional data query system provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0047] Description of reference numerals:
[0048] Multi-dimensional data query system 300, receiving module 310, response module 320, determination module 330, query module 340;
[0049] Processor 401 , memory 402 , communication interface 403 , bus 410 . DETAILED DESCRIPTION
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0051] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.
[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0053] In various embodiments of the present application, the expression "or" or "at least one of A or / and B" includes any or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0054] In the description of this application, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the invented product is usually placed when in use. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application.
[0055] In addition, the terms "first", "second", etc., if used, are merely used to distinguish and describe, and should not be understood as indicating or implying relative importance.
[0056] It should be noted that, in the absence of conflict, the features in the embodiments of this application can be combined with each other.
[0057] Furthermore, in the embodiments of the present application, the term "connection" may refer to "electrical connection" or "direct connection." "Electrical connection" may refer to a direct electrical connection between two components or an electrical connection between two components via one or more normally open tubes or other components.
[0058] To facilitate a better understanding of the solutions of the embodiments of the present application, the relevant technologies are first introduced below.
[0059] Artificial Intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and create new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses theories, methods, technologies, and application systems that use digital computers or digital computer-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0060] Natural Language Processing (NLP): NLP uses computers to process, understand, and apply human languages (such as Chinese and English). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0061] In order to solve the technical problems in the background technology, the embodiments of the present application provide a multi-dimensional data query method, a multi-dimensional data query system, an electronic device, and a computer-readable storage medium. The multi-dimensional data query method provided by the embodiments of the present application is first introduced below.
[0062] See Figure 1 , Figure 1This is a flowchart of a method for querying multidimensional data provided in an embodiment of the present application. This method can be applied to a multidimensional data query system or electronic device in the following embodiments, wherein the electronic device includes a personal computer, a server, a mobile device, a cloud computing platform, and a supercomputer. The following will introduce the method for querying multidimensional data from the perspective of application to electronic devices. The method for querying multidimensional data specifically includes but is not limited to the following steps 110 to 140:
[0063] Step 110: Receive a multi-dimensional data query request, where the multi-dimensional data query request includes at least one query dimension information.
[0064] Step 120 : In response to the multi-dimensional data query request, parameterize each query dimension information to obtain dimension parameters corresponding to each query dimension information.
[0065] Step 130 : When the query field names corresponding to the respective dimensional parameters are determined, a query script is determined according to the query field names corresponding to the respective dimensional parameters.
[0066] Step 140: execute the query script to query the query data corresponding to at least one query dimension information from the preset database.
[0067] An embodiment of the present application provides a method for querying multidimensional data. The method receives a multidimensional data query request and, in response to the multidimensional data query request, parameterizes each query dimension information to obtain dimension parameters corresponding to each query dimension information. The multidimensional data query request includes at least one query dimension information. Then, after determining the query field names corresponding to each dimension parameter, a query script is determined based on the query field names corresponding to each dimension parameter. Finally, the query script is executed to quickly query query data corresponding to at least one query dimension information from a preset database, thereby improving the efficiency of data queries for multidimensional data in banking, financial, and medical systems.
[0068] The embodiments of the present application can acquire and process relevant data, such as historical correlation data, based on artificial intelligence technology. Artificial intelligence refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0069] AI-related foundational technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0071] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0072] The following will be Figure 1 Each step of the method is described in detail.
[0073] In step 110, the electronic device may receive a multi-dimensional data query request submitted by the user through the front end. The electronic device may extract the indicators or statistical results required by the user from massive banking and financial data or medical data based on the multi-dimensional data query request. The multi-dimensional data query request may include several query dimension information.
[0074] The above multi-dimensional data query request can be initiated by the user.
[0075] Taking banking financial data as an example, banking financial data may include basic customer information (such as name, gender, age, occupation, contact information, income level, education level, marital status, etc.), transaction data, credit data, product categories, sales areas, etc.
[0076] Taking medical data as an example, medical data may include basic patient information (such as name, gender, age, occupation, contact information, etc.), medical insurance information, examination and test results (such as blood routine, urine routine, electrocardiogram, etc. containing physiological and pathological information), and medical operation data (such as outpatient volume, hospitalization volume, bed occupancy rate, medical staff workload, etc.).
[0077] It should be noted that the multi-dimensional data query method provided in the embodiment of the present application can be applied in medical scenarios such as the medical system of a hospital, and can also be applied in financial scenarios such as the financial system of a bank.
[0078] Although the above-mentioned banking and financial data and medical data are presented for illustrative purposes, the multi-dimensional data query method provided in the embodiments of the present application can also be applied to other fields, and the implementation of multi-dimensional data query in various fields is within the protection scope of the embodiments of the present application.
[0079] In some embodiments, the electronic device can implement front-end interactive parameter collection, such as providing a drop-down list of options for the user on the front-end display interface through a HyperText Markup Language (HTML) control, allowing the user to select the desired query dimension information, such as the banking and financial data or medical data in the above-mentioned embodiments. After the user selects the corresponding query dimension information, a corresponding multi-dimensional data query request can be generated. After receiving the multi-dimensional data query request, the electronic device can process the multi-dimensional data query request based on the multi-dimensional data query request to obtain query data corresponding to at least one query dimension information in the following embodiments.
[0080] In some embodiments, the user can input the dimension information to be queried into the query box in the front display interface. After the input is completed, the electronic device can use the above-mentioned NLP technology to parse the dimension information entered in the query box and extract the corresponding dimension information.
[0081] The multi-dimensional query request may include one query dimension information, which may indicate that the user is only interested in a certain dimension information. The multi-dimensional query request may include multiple query dimension information, which may indicate that the user is interested in corresponding multiple dimensions of information.
[0082] The query dimension information described above can be specific attributes or features used to describe, categorize, and analyze data from different perspectives. For example, in a bank's sales data, time, product category, sales region, customer group, etc. can all be used as query dimensions. These dimensions describe the different attributes of sales activities, allowing a comprehensive understanding of all aspects of the sales business. Another example is medical operational data in a healthcare system, such as outpatient volume, hospitalization volume, bed occupancy rate, medical staff workload, medical consumables usage, and medical consumables inventory. These dimensions describe the different attributes of medical operational information, allowing a comprehensive understanding of all components of medical operational data.
[0083] The embodiments of this application do not specifically limit the query dimension information. For example, the query dimension information may include customer age range, risk level, type of product held, etc. For another example, the query dimension information may include product code, yield rate, maturity date, etc. For another example, the query dimension information may include transaction amount range, payment method, transaction channel, etc., where the transaction channel may include online and offline. For another example, the query dimension information may include the inspection and test results and medical operation data in the above embodiment.
[0084] It's important to note that, using banking and financial data as an example, traditional data queries might focus on a single dimension, such as viewing sales data in chronological order to understand how sales change over time. Multi-dimensional data queries, on the other hand, allow users to simultaneously view data from multiple dimensions, such as time, region, and product category. This allows for more detailed analysis of sales data, such as understanding sales performance for different product categories in different regions over time, thereby uncovering more valuable insights and patterns.
[0085] In some embodiments, a multi-dimensional data query request may include a user identifier. Upon receiving the multi-dimensional data query request, the electronic device may identify the user identifier in the multi-dimensional data query request to determine, based on the user identifier, whether the requesting user corresponding to the multi-dimensional data query request has query permission. If the electronic device determines that the requesting user has query permission, it may perform a data query based on at least one query dimension information in the multi-dimensional data query request.
[0086] In some embodiments, different data query levels may be set for different user identifiers. After identifying the user identifier in the multi-dimensional data query request, the electronic device may determine the data query level corresponding to the user identifier and perform a data query for at least one query dimension in the multi-dimensional data query request according to the data query level.
[0087] Taking banking and financial data as an example, if the data query level corresponding to the user identifier is level 1, the electronic device can query all dimensions of information in the multi-dimensional data query request. If the data query level corresponding to the user identifier is level 2, and the data query level corresponding to the dimension information amount range and customer ID included in the multi-dimensional data query request is level 1, the electronic device may determine that the requesting user is not eligible to query the dimension information such as the amount range and customer ID. The first level data query level is higher than the second level data query level.
[0088] Taking medical data as an example, if the data query level corresponding to the user identifier is the first level, the electronic device may query all dimensions of information in the multi-dimensional data query request. If the data query level corresponding to the user identifier is the second level, and the data query level corresponding to the dimensional information inspection and test results and medical operation data included in the multi-dimensional data query request is the first level, the electronic device may determine that the requesting user is not qualified to query the inspection and test results and medical operation data.
[0089] In step 120, the electronic device performs parameterized processing on the multi-dimensional data query request received in the above embodiment to obtain dimension parameters corresponding to each query dimension information, thereby converting the query dimension information selected by the user into a database field executable by the backend.
[0090] For example, the electronic device may convert query dimension information such as customer risk level identified at the front end into a field in a Hive table such as customer_risk.
[0091] In some embodiments, the parameterization of each query dimension information can be understood as converting the query dimension information into fields in the Hive table, that is, expressing it with the above-mentioned dimension parameters.
[0092] In some embodiments, the conversion of query dimension information into fields in a Hive table may be achieved by using a conditional expression case when in Structured Query Language (SQL).
[0093] In some embodiments, when the query dimension information is sensitive information, the electronic device may perform sensitive information desensitization and encryption on the query dimension information.
[0094] For example, when the query dimension information is the user's ID number, the electronic device can perform a hash conversion on the user's ID number to obtain a corresponding hash value, thereby reducing the risk of leakage of sensitive information.
[0095] In some embodiments, the electronic device may perform parameter normalization processing on the query dimension information.
[0096] For example, when the query dimension information input by the user is "transaction time = 2000 Q1", it means that the transaction time is in the first quarter of 2000. The electronic device will convert its favorite timestamp range into: 2000-01-01To2000-03-31, thereby realizing standardized processing of the transaction time.
[0097] In step 130 , the electronic device may determine the query field name corresponding to each dimensional parameter, and determine the query script based on the query field name.
[0098] The above query field names correspond to the field names in the Hive table.
[0099] In some embodiments, when a dimension parameter is determined, a query field name corresponding to the dimension parameter may be obtained by querying a preset parameter mapping table.
[0100] For example, see Table 1 below, where the front-end parameter name represents the dimension parameter, and the Hive field name represents the query field name.
[0101] Table 1
[0102] Front-end parameter name Hive field name Data Type Business Notes activity_time al.vily_ai_u_line string Activity time in table (timestamp format) maotai_amount iLemp_uign_in string Total business volume of Moutai (unit: yuan) customer_risk ail-vily_level string Customer risk level (high / medium / low) is_employee is_on_icb_emp enum Employee (yes / no)
[0103] The above preset parameter mapping table, combined with Table 1, indicates that the electronic device can perform parameter standardization on query dimension information. For example, the user-entered query dimension information "activity time = 2000 Q1" is converted to: 2000-01-01To2000-03-31. The electronic device then uses the preset parameter mapping table to map the dimension parameter (e.g., activity_time in Table 1) to a Hive field name (e.g., al.vily_ai_u_line). This determines the query field name "al.vily_ai_u_line" for the dimension parameter "activity_time."
[0104] The above query script can be used to extract specific information from the preset database in the following embodiments, for example, to extract and query all transaction objects with the dimension information "transaction time = 2000 Q1" from the preset database.
[0105] In some embodiments, the query script is a SQL query script.
[0106] In some embodiments, the query script is a NoSQL query script.
[0107] In step 140, if the electronic device has determined the query script in the aforementioned embodiment, it can execute the query script to obtain query data corresponding to at least one query dimension information.
[0108] In some embodiments, the electronic device may execute a query script to enable the corresponding database relational system to query data from a preset database according to the logic and instructions specified in the query script.
[0109] In a possible implementation, determining a query script based on the query field name corresponding to each dimension parameter includes:
[0110] Dynamically concatenate the query field names corresponding to each dimension parameter with the preset SQL query statement to obtain a query script;
[0111] Among them, the SQL query statement includes selection fields, data table names and filter conditions. The selection fields are used to specify the names of the query fields to be queried, the data table name is the name of the data table to be queried, and the filter conditions are used to limit the query to information corresponding to the query field names.
[0112] This embodiment of the application dynamically concatenates query field names with pre-set SQL query statements to create a query script that supports any combination of query dimension information, adapting to complex financial data query scenarios. Furthermore, existing Hive clusters can be directly reused for flexible multi-dimensional data analysis, eliminating the need to purchase a costly Online Analytical Processing (OLAP) engine, thus significantly reducing the cost of querying multi-dimensional data.
[0113] In a possible implementation, in response to a multi-dimensional data query request, parameterizing each query dimension information to obtain a dimension parameter corresponding to each query dimension information includes:
[0114] Detecting the multi-dimensional data query request to obtain a first detection result;
[0115] When the first detection result indicates that the query dimension information in the multi-dimensional data query request is empty, in response to the multi-dimensional data query request, each preset dimension information in the preset dimension information set is parameterized to obtain the dimension parameters corresponding to each preset dimension information.
[0116] In the embodiment of the present application, when it is detected that the query dimension information in the multi-dimensional data query request is empty, all the preset dimension information in the preset dimension information set may be selected by default for processing.
[0117] The embodiment of the present application does not specifically limit the preset dimension information in the above-mentioned preset dimension information set, and the preset dimension information in the preset dimension information set can be added, deleted or replaced according to actual needs.
[0118] In some embodiments, the preset dimension information in the preset temperature information set includes one or more of customer gender, customer age, activity category, and activity subcategory.
[0119] See Figure 2 , Figure 2 A flowchart for obtaining dimension parameters corresponding to query dimension information included in a multi-dimensional data query method provided in an embodiment of the present application.
[0120] In a possible implementation, step 120 performs parameterization processing on each query dimension information in response to the multi-dimensional data query request to obtain dimension parameters corresponding to each query dimension information, including but not limited to the following steps 210 to:
[0121] Step 210: Detect the multi-dimensional data query request to obtain a second detection result.
[0122] Step 220: Determine the user identifier of the requesting user corresponding to the multi-dimensional data query request.
[0123] Step 230 : When the second detection result indicates that the query dimension information in the multi-dimensional data query request is empty, determine the associated dimension information associated with the user identifier in response to the multi-dimensional data query request.
[0124] Step 240 : Parameterize the associated dimension information associated with the user identifier to obtain dimension parameters corresponding to each piece of associated dimension information.
[0125] The embodiment of the present application can automatically determine the associated dimension information associated with the user identifier of the requesting user corresponding to the multi-dimensional data query request, and then parameterize the associated dimension information to obtain the corresponding dimension parameters.
[0126] Taking banking financial data as an example, the requesting user is a bank teller, and the user IDs of the bank tellers are G01 to G10, which can correspond to 10 different bank tellers respectively. The associated dimension information associated with G01 to G10 can be the same. Taking user ID G01 as an example, its associated associated dimension information may include business volume statistics (such as deposits, withdrawals, transfers, account openings, account closings, etc.). When the electronic device recognizes that the user ID is G01, the associated associated dimension information can be automatically selected.
[0127] If the requesting user is a bank lobby manager, the lobby manager user IDs M01 to M05 may correspond to five different lobby managers. The associated dimension information associated with M01 to M05 may be identical. For example, for user ID M01, its associated dimension information may include customer traffic statistics and customer satisfaction statistics. When the electronic device recognizes user ID M01, it may automatically select the associated dimension information.
[0128] Taking medical data as an example, the requesting user is a doctor in a hospital or medical institution, and the doctor's user ID is D001 to D100, which can correspond to 100 different doctors respectively. The associated dimension information associated with D001 to D100 can be the same. Taking the user ID D001 as an example, its associated associated dimension information may include outpatient data (such as the number of patients received, prescription information, etc.) and inpatient data (such as the number of admissions, the number of discharges, etc.). When the electronic device recognizes that the user ID is D001, the associated associated dimension information can be automatically selected.
[0129] If the above-mentioned requesting user is a nurse in a hospital or medical institution, the user IDs of the nurses are N001 to N100, which may correspond to 100 different nurses respectively. The associated dimension information associated with N001 to N100 may be the same. Taking the user ID N001 as an example, its associated associated dimension information may include nursing workload (such as nursing visits, special nursing records, etc.) and medical consumables consumption information (such as issuance volume, inventory, etc.). Similarly, when the electronic device recognizes that the user ID is N001, the associated associated dimension information may be automatically selected.
[0130] In some embodiments, the electronic device automatically selects associated dimension information based on the user identification, but the information can still be manually selected and modified.
[0131] This allows banks to automatically select and parameterize data such as daily transaction amounts, which are often needed by certain groups of people, such as bank staff, without requiring manual selection by bank staff. This significantly improves the efficiency of multi-dimensional data queries within banking and financial systems. Similarly, in healthcare systems, manual selection by medical staff is no longer necessary, significantly improving the efficiency of multi-dimensional data queries within these systems.
[0132] The above “the second detection result indicates that the query dimension information in the multi-dimensional data query request is empty” may mean that the user has not selected the dimension information to be queried.
[0133] If the user does not select the dimensional information to be queried, the electronic device can obtain the user ID of the requesting user corresponding to the multi-dimensional data query request, such as 005. The associated dimensional information associated with the user ID 005, such as today's transaction amount, today's transaction customer age, and today's transaction product type, will be automatically selected and processed in subsequent steps.
[0134] Considering that the dimension information selected by the user may be distributed in multiple tables, such as the customer table, transaction table, and product table in a bank database, the query efficiency is low.
[0135] In one possible implementation, executing a query script to query query data corresponding to at least one query dimension information from a preset database includes:
[0136] Determine the data table to be queried corresponding to each dimension parameter;
[0137] Execute the query script to query the query data corresponding to at least one query dimension information from the to-be-queried data table corresponding to each dimension parameter;
[0138] The preset database includes a plurality of data tables to be queried, each of which includes a primary key and a foreign key, and the primary key and the foreign key are used to support an association query between the data tables to be queried.
[0139] The data table to be queried provided in the embodiment of the present application includes a primary key and a foreign key, wherein the primary key can be regarded as a unique identifier in the table, and the foreign key can be used to associate fields of other data tables to be queried, thereby realizing complex association analysis between financial data and improving the query efficiency of multi-dimensional data.
[0140] The above primary keys and foreign keys can be found in the analysis of related technologies, and the embodiments of this application will not be explained one by one here.
[0141] In a possible implementation, before executing the query script to query the preset database for query data corresponding to at least one query dimension information, the method further includes:
[0142] Get the cached data in the cache area;
[0143] When it is detected that cache data corresponding to the query script exists in the cache area, the cache data corresponding to the query script is used as query data corresponding to at least one query dimension information.
[0144] Before executing the query script, the embodiment of the present application can query the cached data in the cache area, and when it is detected that there is cached data corresponding to the query script in the cache area, the cached data corresponding to the query script is used as query data corresponding to at least one query dimension information, so that the query data can be quickly obtained, further improving the query efficiency of multi-dimensional data.
[0145] Furthermore, on the one hand, the embodiments of the present application avoid repeated execution of the same query script through a caching mechanism, thereby saving computing resources and time. On the other hand, by caching data, the number of direct accesses to the financial and insurance system database can be reduced, thereby alleviating the load on the financial and insurance system database.
[0146] In a possible implementation, before executing the query script to query the preset database for query data corresponding to at least one query dimension information, the method further includes:
[0147] Performing syntax check on the query script to obtain a third test result;
[0148] Executing a query script to query query data corresponding to at least one query dimension information from a preset database includes:
[0149] When the third detection result indicates that the query script has no syntax errors, the query script is executed to query query data corresponding to at least one query dimension information from a preset database.
[0150] The embodiment of the present application performs predictive detection on the query script and executes the query script when a syntax error is detected. This can ensure the correctness of the query script and avoid query failure or query exception due to syntax errors. It can also avoid additional error handling and debugging caused by syntax errors during execution, thereby improving the overall reliability of the system.
[0151] In some embodiments, the electronic device may perform static grammar checking on the query script, for example, performing keyword checking, symbol checking, spelling checking, etc. on multiple query scripts.
[0152] In some embodiments, the electronic device can perform dynamic syntax checking on the query script, for example, by simulating the execution of the query script in a secure environment to detect whether syntax errors occur during execution. Alternatively, the query script can be verified using an SQL interpreter to ensure that the query script can be correctly parsed and executed.
[0153] Corresponding to the above method embodiment, the present application embodiment also provides a multi-dimensional data query system, see Figure 3 , Figure 3 This is a functional module diagram of a multi-dimensional data query system provided in an embodiment of the present application, wherein the multi-dimensional data query system 300 includes:
[0154] The receiving module 310 is configured to receive a multi-dimensional data query request, where the multi-dimensional data query request includes at least one query dimension information.
[0155] The response module 320 is used to respond to the multi-dimensional data query request, perform parameterization processing on each query dimension information, and obtain dimension parameters corresponding to each query dimension information.
[0156] The determination module 330 is used to determine the query script according to the query field name corresponding to each dimensional parameter when the query field name corresponding to each dimensional parameter is determined.
[0157] The query module 340 is configured to execute a query script to query query data corresponding to at least one query dimension information from a preset database.
[0158] The multi-dimensional data query system provided in the embodiment of the present application receives a multi-dimensional data query request through a receiving module, and responds to the multi-dimensional data query request through a response module, parameterizing each query dimension information to obtain the dimension parameters corresponding to each query dimension information, wherein the multi-dimensional data query request includes at least one query dimension information. Then, after determining the query field names corresponding to each dimension parameter, the determination module determines a query script based on the query field names corresponding to each dimension parameter. Finally, the query script is executed by the query module, and query data corresponding to at least one query dimension information can be quickly retrieved from a preset database, thereby improving the efficiency of data queries for multi-dimensional data in banking and financial systems and medical systems.
[0159] In a possible implementation, the determining module 330 is further specifically configured to:
[0160] Dynamically concatenate the query field names corresponding to each dimension parameter with the preset SQL query statement to obtain a query script;
[0161] Among them, the SQL query statement includes selection fields, data table names and filter conditions. The selection fields are used to specify the names of the query fields to be queried, the data table name is the name of the data table to be queried, and the filter conditions are used to limit the query to information corresponding to the query field names.
[0162] In a possible implementation, the response module 320 is further specifically configured to:
[0163] Detecting the multi-dimensional data query request to obtain a first detection result;
[0164] When the first detection result indicates that the query dimension information in the multi-dimensional data query request is empty, in response to the multi-dimensional data query request, each preset dimension information in the preset dimension information set is parameterized to obtain the dimension parameters corresponding to each preset dimension information.
[0165] In a possible implementation, the response module 320 is further specifically configured to:
[0166] Detecting the multi-dimensional data query request to obtain a second detection result;
[0167] Determining a user identifier of a requesting user corresponding to the multi-dimensional data query request;
[0168] If the second detection result indicates that the query dimension information in the multi-dimensional data query request is empty, determining the associated dimension information associated with the user identifier in response to the multi-dimensional data query request;
[0169] Parameterization is performed on the associated dimension information associated with the user identifier to obtain dimension parameters corresponding to each piece of associated dimension information.
[0170] In a possible implementation, the query module 340 is further specifically configured to:
[0171] Determine the data table to be queried corresponding to each dimension parameter;
[0172] Execute the query script to query the query data corresponding to at least one query dimension information from the to-be-queried data table corresponding to each dimension parameter;
[0173] The preset database includes a plurality of data tables to be queried, each of which includes a primary key and a foreign key, and the primary key and the foreign key are used to support an association query between the data tables to be queried.
[0174] In a possible implementation, the multi-dimensional data query system 300 further includes an acquisition module, which is configured to:
[0175] Get the cached data in the cache area;
[0176] When it is detected that cache data corresponding to the query script exists in the cache area, the cache data corresponding to the query script is used as query data corresponding to at least one query dimension information.
[0177] In a possible implementation, the multi-dimensional data query system 300 further includes a detection module, which is configured to:
[0178] Performing syntax check on the query script to obtain a third test result;
[0179] Executing a query script to query query data corresponding to at least one query dimension information from a preset database includes:
[0180] When the third detection result indicates that the query script has no syntax errors, the query script is executed to query query data corresponding to at least one query dimension information from a preset database.
[0181] See Figure 4 , Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0182] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0183] Specifically, the processor 401 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0184] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0185] In some embodiments, the memory 402 may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method embodiments according to an aspect of the present disclosure.
[0186] The processor 401 implements any one of the multi-dimensional data query methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0187] In one example, the electronic device may further include a communication interface 403 and a bus 410. Figure 3 As shown, the processor 401 , the memory 402 , and the communication interface 403 are connected via a bus 410 and communicate with each other.
[0188] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0189] Bus 410 comprises hardware, software or both, couples the parts of electronic equipment to each other.For example, and not limitation, bus can comprise accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations.In suitable cases, bus 410 can comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0190] In addition, in conjunction with the multi-dimensional data query method in the above embodiments, embodiments of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the multi-dimensional data query methods in the above embodiments is implemented.
[0191] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the embodiment of the multi-dimensional data query method as described above, and can achieve similar or identical technical effects. To avoid repetition, it will not be described here.
[0192] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0193] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0194] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0195] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0196] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A method for querying multidimensional data, characterized in that: The method comprises: receiving a multi-dimensional data query request, wherein the multi-dimensional data query request includes at least one query dimension information; In response to the multi-dimensional data query request, parameterize each query dimension information to obtain a dimension parameter corresponding to each query dimension information; When the query field names corresponding to the respective dimension parameters are determined, a query script is determined according to the query field names corresponding to the respective dimension parameters; The query script is executed to query query data corresponding to the at least one query dimension information from a preset database.
2. The method according to claim 1, characterized in that Determining the query script according to the query field name corresponding to each dimension parameter includes: Dynamically concatenate the query field name corresponding to each dimension parameter with the preset SQL query statement to obtain the query script; Among them, the SQL query statement includes a selection field, a data table name and a filter condition. The selection field is used to specify the name of each query field to be queried, the data table name is the name of the data table to be queried, and the filter condition is used to limit the query to information corresponding to each query field name.
3. The method according to claim 1, characterized in that The step of performing parameterization processing on each query dimension information in response to the multi-dimensional data query request to obtain dimension parameters corresponding to each query dimension information includes: Detecting the multi-dimensional data query request to obtain a first detection result; When the first detection result indicates that the query dimension information in the multi-dimensional data query request is empty, in response to the multi-dimensional data query request, each preset dimension information in the preset dimension information set is parameterized to obtain the dimension parameters corresponding to each preset dimension information.
4. The method according to claim 1, wherein The step of performing parameterization processing on each query dimension information in response to the multi-dimensional data query request to obtain dimension parameters corresponding to each query dimension information includes: Detecting the multi-dimensional data query request to obtain a second detection result; Determining a user identifier of a requesting user corresponding to the multi-dimensional data query request; In a case where the second detection result indicates that the query dimension information in the multi-dimensional data query request is empty, determining, in response to the multi-dimensional data query request, associated dimension information associated with the user identifier; Parameterization is performed on the associated dimension information associated with the user identifier to obtain dimension parameters corresponding to each piece of associated dimension information.
5. The method according to claim 1, wherein The executing the query script to query the query data corresponding to the at least one query dimension information from a preset database includes: Determine the data table to be queried corresponding to each dimension parameter; Executing the query script to query the query data corresponding to the at least one query dimension information from the to-be-queried data table corresponding to each of the dimension parameters; The preset database includes a plurality of data tables to be queried, each data table to be queried includes a primary key and a foreign key, and the primary key and the foreign key are used to support an association query between the data tables to be queried.
6. The method according to claim 1, characterized in that Before executing the query script to query the query data corresponding to the at least one query dimension information from a preset database, the method further includes: Get the cached data in the cache area; In the case where it is detected that cache data corresponding to the query script exists in the cache area, the cache data corresponding to the query script is used as query data corresponding to the at least one query dimension information.
7. The method according to claim 1, characterized in that Before executing the query script to query the query data corresponding to the at least one query dimension information from a preset database, the method further includes: Performing a syntax check on the query script to obtain a third test result; The executing the query script to query the query data corresponding to the at least one query dimension information from a preset database includes: When the third detection result indicates that the query script has no syntax errors, the query script is executed to query query data corresponding to the at least one query dimension information from a preset database.
8. A multi-dimensional data query system, characterized in that: The system comprises: A receiving module, configured to receive a multi-dimensional data query request, wherein the multi-dimensional data query request includes at least one query dimension information; a response module, configured to perform parameterization processing on each query dimension information in response to the multi-dimensional data query request to obtain dimension parameters corresponding to each query dimension information; a determination module for determining a query script according to the query field name corresponding to each of the dimension parameters when the query field name corresponding to each of the dimension parameters is determined; The query module is used to execute the query script and query the query data corresponding to the at least one query dimension information from a preset database.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the multi-dimensional data query method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the computer program implements the multi-dimensional data query method according to any one of claims 1 to 7.
Citation Information
Cited By
Information query method and device, computer equipment, readable storage medium and program product
CN121681611A