Data analysis method and device, electronic equipment and computer program product
The method leverages a language model to automatically generate analysis solutions and codes for data analysis, addressing the complexity of manual coding and enhancing user experience and efficiency in data processing.
Patent Information
- Application Number
- CN202411658067.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2024-12-17
AI Technical Summary
Existing data analysis technologies require users to manually write complex query statements and logic codes, making it difficult to meet dynamic analysis needs and lack flexible support for subsequent analysis requests, leading to low efficiency and poor user experience.
A data analysis method that uses a language model to automatically generate analysis solutions and codes for subsequent analysis requests based on initial query results, allowing users to input natural language queries and process data without writing complex codes.
Enables in-depth data processing and analysis with improved flexibility and efficiency, enhancing user experience by allowing users to initiate subsequent analysis requests without manual coding.
Smart Images

Figure CN119149966A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a method, device, electronic device and computer program product for data analysis. Background Art
[0002] With the rapid development of big data and artificial intelligence technologies, the field of data analysis has made significant progress. Various tools and platforms have emerged, providing more efficient and intelligent data processing capabilities. In particular, with the improvement of data storage and computing capabilities, the scale and complexity of data collection, storage and analysis have increased significantly, promoting the widespread application of data analysis technology.
[0003] At the same time, the development of language models has continuously improved the ability of automated data analysis. By introducing language models, the system can more intelligently understand and process users' natural language input, and is widely used in various data analysis scenarios, promoting the development of technology in the field of data processing. Summary of the invention
[0004] Embodiments of the present disclosure provide a method, apparatus, electronic device, and computer program product for data analysis.
[0005] According to a first aspect of the present disclosure, a method for data analysis is provided. The method includes determining an initial query result based on an initial query request of a user, wherein the initial query result includes data columns corresponding to fields specified in the initial query request, and each data column includes a field name and a field value. The method also includes obtaining a subsequent analysis request of the user, wherein the subsequent analysis request indicates, in natural language form, processing related to the data columns in the initial query result. The method also includes determining a target prompt word based on the initial query result and the subsequent analysis request. The method also includes generating an analysis scheme and a target code for the subsequent analysis request using a language model based on the target prompt word. The method also includes generating a target data column for the subsequent analysis request by executing the target code. In addition, the method also includes determining a target analysis result for the subsequent analysis request based on the analysis scheme and the target data column.
[0006] According to a second aspect of the present disclosure, a device for data analysis is provided. The device includes an initial result determination module, which is configured to determine an initial query result based on an initial query request of a user, wherein the initial query result includes a data column corresponding to a field specified in the initial query request, and each data column includes a field name and a field value. The device also includes a subsequent request acquisition module, which is configured to acquire a subsequent analysis request of the user, wherein the subsequent analysis request indicates a process related to the data column in the initial query result in a natural language form. The device also includes a target prompt determination module, which is configured to determine a target prompt word based on the initial query result and the subsequent analysis request. The device also includes a solution code generation module, which is configured to generate an analysis solution and a target code for the subsequent analysis request using a language model based on the target prompt word. The device also includes a target data generation module, which is configured to generate a target data column for the subsequent analysis request by executing the target code. In addition, the device also includes a target result determination module, which is configured to determine a target analysis result for the subsequent analysis request based on the analysis solution and the target data column.
[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory coupled to the processor, wherein the memory has instructions stored therein, and when the instructions are executed by the processor, the electronic device executes the method according to the first aspect.
[0008] In a fourth aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a non-transitory computer readable medium and includes computer executable instructions, which when executed cause a computer to perform the steps of the method of the first aspect of the present disclosure.
[0009] The purpose of this Summary is to introduce a selection of concepts in a simplified form that are further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein: Figure 1 A schematic diagram showing an example environment in which devices and / or methods according to embodiments of the present disclosure may be implemented; Figure 2 A flow chart showing a method for data analysis according to an embodiment of the present disclosure is shown; Figure 3A schematic diagram showing a system architecture 300 for secondary analysis according to an embodiment of the present disclosure is shown; Figure 4A A timing diagram showing a process of performing secondary analysis through visual query according to an embodiment of the present disclosure; Figure 4B A timing diagram showing a process of performing secondary analysis through SQL query according to an embodiment of the present disclosure; Figure 5 A block diagram showing a device for data analysis according to an embodiment of the present disclosure; and Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0011] Throughout the drawings, the same or similar reference numbers denote the same or similar elements. DETAILED DESCRIPTION
[0012] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information (such as voice) involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0013] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0014] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects, unless explicitly stated. Other explicit and implicit definitions may also be included below.
[0015] In data analysis related technologies, users are often required to manually write complex query statements and logic codes. Especially when performing multiple data processing, users need to constantly adjust query conditions and analysis logic. This approach places high demands on users and is difficult to meet the dynamic needs of complex data analysis. In addition, related technologies lack flexible support for subsequent analysis requests, and users cannot quickly generate derivative analysis based on initial query results, resulting in low data processing efficiency and poor user experience.
[0016] To this end, an embodiment of the present disclosure provides a data analysis solution. The solution first obtains query results through the user's initial query request, performs subsequent analysis based on subsequent natural language analysis requests, automatically generates analysis solutions and codes for subsequent requests using a language model, and further processes the data by executing these codes to generate subsequent analysis results.
[0017] Therefore, through the solution of the embodiments of the present invention, users can initiate subsequent analysis requests based on the initial query results without writing complex query codes, and use language models to process subsequent analysis requests, thereby achieving in-depth processing and analysis of data, improving the flexibility and efficiency of data analysis, and improving the user experience.
[0018] Figure 1 Schematic diagram of an example environment in which the device and / or method according to an embodiment of the present disclosure may be implemented. Figure 1 As shown, the example environment 100 may include a computing device 110, which may be a user terminal, a mobile device, a computer, etc., and may also be a computing system, a single server, a distributed server, or a cloud-based server. The computing device 110 may receive an initial query request 112 from a user, and determine an initial query result 116 based on the initial query request 112. The initial query result 116 includes data columns corresponding to the fields specified in the initial query request 112, and each data column includes a field name and a field value. For example, a user may specify a date field and a click volume field in the initial query request 112, and the initial query result 116 may include a data column for the date and a data column for the click volume.
[0019] The computing device 110 may obtain a subsequent analysis request 114 from the user, where the subsequent analysis request 114 indicates in natural language the processing related to the data column in the initial query result 116. For example, the subsequent analysis request 114 may be "add a new column and calculate the difference in the number of clicks from the previous day". The computing device 110 may determine a target prompt word 118 based on the initial query result 116 and the subsequent analysis request 114. For example, the target prompt word 118 may include a field name in the initial query result 116 and the text of the subsequent analysis request 114.
[0020] The computing device 110 can generate a target code 122 and an analysis plan 124 for the subsequent analysis request 114 based on the target prompt word 118 and using the language model 120. For example, the analysis plan 124 can describe how to process data according to the subsequent analysis request 114, such as "extract the click volume data column from the initial query result, and then calculate the difference between the click volume of the current day and the click volume of the previous day". The target code 122 is a specific implementation (for example, Python code) of executing the analysis plan 124.
[0021] The computing device 110 can generate a target data column 126 for the subsequent analysis request 114 by executing the target code 122. For example, the target data column 126 can be a newly added data column, which is the difference between the number of clicks on each day and the number of clicks on the previous day. The target data column can be presented together with the data column in the initial query result and provided for further analysis or processing by the user. It should be understood that the target data column can also be presented separately, and the present disclosure does not limit this. For example, the user's subsequent analysis request can be "please filter data with a click volume greater than 100", then the generated target data column can be presented separately.
[0022] The computing device 110 may determine a target analysis result 128 for the subsequent analysis request 114 based on the analysis scheme 124 and the target data column 126. For example, the analysis scheme 124 and the target data column 126 may be format-converted and presented simultaneously on the front-end page, so that the user may view the generated target data column and the specific analysis steps or logic simultaneously, so that the user may have a clearer understanding of the analysis process and make adjustments or optimizations when necessary, thereby improving the flexibility and efficiency of data analysis.
[0023] It should be understood that the architecture and functions in the example environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure. Embodiments of the present disclosure may also be applied to other environments with different structures and / or functions.
[0024] The following will combine Figures 2 to 6 The process according to the embodiment of the present disclosure is described in detail. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It is understood that the embodiments described below may also include additional actions not shown and / or the actions shown may be omitted, and the scope of the present disclosure is not limited in this respect.
[0025] Figure 2 A flowchart of a method 200 for data analysis according to an embodiment of the present disclosure is shown. The method can be executed by a computing device, which can be a user terminal, a mobile device, a computer, etc. It can also be a computing system, a single server, a distributed server, or a cloud-based server. At box 202, an initial query result can be determined based on the user's initial query request. The initial query result includes data columns corresponding to the fields specified in the initial query request, and each data column includes a field name and a field value. For example, referring to Figure 1 The computing device 110 may determine an initial query result 116 based on the user's initial query request 112 , where the initial query result 116 includes data columns corresponding to the fields specified in the initial query request 112 , and each data column includes a field name and a field value.
[0026] At block 204, a subsequent analysis request from the user may be obtained, the subsequent analysis request indicating in natural language the processing related to the data column in the initial query result. Figure 1 , the computing device 110 may obtain a subsequent analysis request 114 from the user, the subsequent analysis request 114 indicating in natural language the processing related to the data column in the initial query result. At block 206, a target prompt word may be determined based on the initial query result and the subsequent analysis request. For example, referring to Figure 1 The computing device 110 may determine a target prompt word 118 based on the initial query result 116 and the subsequent analysis request 114 .
[0027] At block 208, the language model may be used to generate an analysis solution and a target code for subsequent analysis requests based on the target prompt word. Figure 1 , the computing device 110 can generate an analysis scheme 124 and a target code 122 for the subsequent analysis request 114 based on the target prompt word 118 using the language model 120. At block 210, a target data column for the subsequent analysis request can be generated by executing the target code. Figure 1 , the computing device 110 can generate a target data column 126 for the subsequent analysis request 114 by executing the target code 122. At block 212, a target analysis result for the subsequent analysis request can be determined based on the analysis scheme and the target data column. Figure 1 The computing device 110 may determine a target analysis result 128 for a subsequent analysis request based on the analysis scheme 124 and the target data column 126 .
[0028] Therefore, according to method 200 of an embodiment of the present disclosure, users can initiate subsequent analysis requests based on the initial query results without writing complex query codes, and use language models to process subsequent analysis requests, thereby achieving in-depth processing and analysis of data, improving the flexibility and efficiency of data analysis, and improving the user experience.
[0029] Figure 3 FIG. 3 is a schematic diagram of a system architecture 300 for secondary analysis according to an embodiment of the present disclosure. Figure 3 As shown, the system architecture 300 includes multiple modules, each of which performs a specific function. The access module 302 may include a visual query page 304, an SQL query page 306, and a dashboard page 308. The visual query page 304 and the SQL query page 306 provide a way for users to interact with data through a visual interface or SQL statements, and the dashboard page 308 is used to display the analysis results and a comprehensive view of the data.
[0030] The application module 310 may include an intelligent processing module 312, a query data service module 324, and an SQL query engine module 328. The intelligent processing module 312 may include a dialogue component 314, a download component 316, a dashboard save component 318, and a re-edit component 320. For example, the various components of the intelligent processing module 312 can perform operations such as having a dialogue with a user, processing a download request, saving and managing a dashboard, and editing an existing dashboard. The query data service module 324 includes a query data acquisition component 326, which can be used to retrieve and obtain data from a database. The SQL query engine module 328 includes a task ID acquisition component 330, a data acquisition component 332, and an SQL robot drainage component 334, which can process the execution of SQL query tasks and implement drainage.
[0031] The support module 336 may include an evaluation module 338 and a compliance module 346. The evaluation module 338 may include a visualization evaluation component 340, a query evaluation component 342, and a difference evaluation component 344, which are used to evaluate the visualization results and SQL query results generated in the system and automatically perform difference analysis. For example, the difference evaluation component 344 can automatically detect and mark the differences between data sets. The compliance module 346 includes an automated compliance activation component 348, which can be used to automatically complete compliance activation and verification to ensure that the data processing and analysis process meets the preset specifications.
[0032] The basic module 350 may include a middleware 352 and a storage module 358. The middleware 352 may include a language model component 354 and a distributed storage service component 356, which may provide necessary computing and storage function support during data processing. The storage module 358 may include a MySQL database 360 and a Redis database 362, which are used to store and manage structured and unstructured data in the system. For example, the MySQL database may be used to store relational data in the system to ensure efficient data query and storage performance, and the Redis database may be used to cache high-frequency access data of the system to improve the speed of data reading and the response performance of the system.
[0033] Figure 4A FIG. 4 shows a timing diagram of a process 400A for performing secondary analysis through visual query according to an embodiment of the present disclosure. Figure 4AAs shown, the user front-end module 402 is used to receive the user's initial query request, for example, the initial query request can be an SQL query. The query data service module 404 executes the corresponding SQL query in step 412 according to the user's initial query request, obtains the initial query result from the database, and returns the initial query result in step 414. The initial query result is presented in a tabular form (for example, DataTable), which may include field names, field types, and information about each row of data. The initial query result provides a data basis for subsequent secondary analysis. In addition, in some embodiments, the user can specify the target field and filter conditions on the visualization page without obtaining data through SQL query. For example, the required field indicators can be dragged on the visualization page, and the filter conditions can be specified to present the initial query results on the visualization page.
[0034] In step 416, the user front-end module 402 transmits the user question and the query result to the intelligent processing module 406. The user question is a secondary analysis request, also known as a subsequent analysis request, which can be further analyzed and processed based on the initial query result. In step 418, the intelligent processing module 406 sends the user question, the table fields and the prompt words to the language model 408 for processing to generate the code and processing ideas related to the question. For example, the table fields (i.e., the various fields in the initial query results) can be used as the context part of the prompt word, and the instruction part of the prompt word can instruct the language model to generate the processing ideas and processing code. The processing ideas (also known as the analysis plan) are the analysis process of the language model on the user question.
[0035] In step 420, the language model 408 can return the analysis ideas and processing code. In step 422, the intelligent processing module 406 executes the generated processing code to generate the data for secondary analysis (i.e., the target data column). In step 424, the intelligent processing module 406 stores the generated processing code and user questions as analysis records in the database 410, and generates an identifier (ID) associated with the storage. In step 426, the identifier is returned to the intelligent processing module 406. In step 428, the intelligent processing module 406 returns the code, ideas, and executes the DataTable interface to generate a visualization component. After the user front-end module 402 receives this information, in step 430, it renders the latest table data, and the user can view the updated visualization data, i.e., the results of the secondary analysis, on the interface. For example, the visualization component can be loaded on the visualization page to display the results of the secondary analysis.
[0036] Figure 4B FIG. 4 shows a timing diagram of a process 400B of performing secondary analysis through SQL query according to an embodiment of the present disclosure. Figure 4BThe user front-end module 452 is used to receive the user's initial query request. In step 462, the user front-end module 452 passes the user question and data pattern to the intelligent processing module 454. After receiving this information, the intelligent processing module 454 reads the SQL query data through the distributed storage service module 456 in step 464. Different from the visual query, the data of the SQL query is read from the distributed storage service module 456. In step 466, the data read by the frame is returned to the intelligent processing module 454.
[0037] In step 468, the intelligent processing module 454 sends the user question, the form fields and the prompt words to the language model module 458. The language model module 458 generates the corresponding code and processing ideas based on the prompt words, and returns them to the intelligent processing module 454 in step 470. The intelligent processing module 454 executes the returned code in step 472 to modify the data in the initial query result. In step 474, the intelligent processing module 454 stores the generated code and user question in the database 460, and generates an identifier associated with the stored content. In step 476, the identifier is returned to the intelligent processing module 454, and the code and user question can be obtained through the identifier.
[0038] In step 478, the intelligent processing module 454 interacts with the distributed storage service module 456 and stores the generated result data in a specific location in the distributed storage service module 456. In step 480, the distributed storage service module 456 returns the path information (e.g., file path or storage address) related to the storage file, and the path information is returned to the intelligent processing module 454. In step 482, the intelligent processing module 454 returns the executed code, processing ideas, and DataTable interface to the user front-end module 452. The user front-end module 452 renders the latest table data in step 484, and the user can view the results of the secondary analysis on the interface.
[0039] After the secondary analysis, multiple rounds of conversations can be conducted. Multiple rounds of conversations allow users to continue to make additional analysis requests based on the results of the previous round of analysis, thereby achieving further analysis. During the multi-round conversation process, users can further explore the results after each round of analysis and propose new analysis requirements. For example, after completing an initial analysis, the user can submit an additional analysis request to obtain relevant records of the previous analysis from the database based on the identifier. By obtaining these analysis records, the system can continue to use the language model to generate new analysis results for the additional analysis request based on the user's questions and the results of the previous round of analysis. This multi-round conversation based on historical analysis records can ensure that each analysis is carried out on the basis of previous work, thereby providing a more continuous analysis process.
[0040] In the visual query scenario, each round of analysis in a multi-round conversation can be performed based on the initial table data. Each analysis re-executes the previous round of code in the intelligent processing module to ensure that the execution results of the previous round can be obtained and further operations can be performed, such as returning updated analysis data. In the SQL query scenario, a multi-round conversation can directly read the SQL query result file saved in the previous round from the distributed storage service, and use it as a basis to continue additional analysis operations. Through multi-round conversations, the analysis direction can be flexibly adjusted, and users can ask new questions based on previous results. This approach helps to achieve more in-depth and complex analysis tasks.
[0041] In some embodiments, secondary calculations for derived fields can be performed based on secondary analysis. In practical applications, operations such as year-on-year, comparison, percentage, table calculation, etc. will generate new indicator fields, namely so-called derived fields, such as month-on-month growth rate, month-on-month original value, percentage of indicators, etc. However, these derived fields usually do not create actual physical fields in the database, and thus further calculations cannot be performed directly. This embodiment allows further calculations and processing of these derived fields by introducing secondary analysis. For example, calculations between derived fields, calculations between derived fields and data set fields, derived field screening, etc. can be performed. In some embodiments, retention analysis can be implemented based on secondary analysis. User retention is one of the key indicators in product operation, and retention analysis is an important way to measure user activity. Through the secondary analysis function, the retention rate can be flexibly calculated and trended based on the existing data, helping users understand the retention of users in different time periods, thereby optimizing product strategies and improving user retention rates. For example, retention rate curves and retention rate heat maps can be implemented through secondary analysis.
[0042] In some embodiments, multiple rounds of aggregation of different dimensions can be performed based on secondary analysis. Due to the restrictions on the use of aggregation functions, data query analysis cannot be nested and aggregated, resulting in only one-time aggregation calculations, which cannot meet complex hierarchical or multi-dimensional aggregation requirements. Through the secondary analysis function, it is possible to perform multiple rounds of aggregation calculations on data according to different dimensions based on the existing aggregation, and flexibly handle more complex data analysis scenarios. For example, multiple rounds of aggregation operations can be achieved through secondary analysis. In some embodiments, data filtering can be performed based on secondary analysis. After applying the table calculation function, users may want to focus on analyzing some dimensions. Through the secondary analysis function, filtering operations can be performed based on the final generated chart results to ensure that the filtering conditions are limited to the fields displayed in the chart, thereby avoiding the impact on the original calculation results. For example, dimension filtering can be performed based on the final results of the chart, or data that meets multiple field conditions at the same time can be filtered.
[0043] In some embodiments, a new virtual column can be added to a pivot table based on secondary analysis. Pivot tables are commonly used table tools for summarizing and displaying data in different dimensions. Through the secondary analysis function, virtual columns can be flexibly added to the pivot table to achieve calculations between different enumeration values. For example, sum operations can be performed between different column dimensions in a pivot table. In some embodiments, data table calculations can be performed based on secondary analysis. The secondary analysis function can support diversified data table calculations. For example, multi-indicator calculations, cross-row calculations, or long-tail indicators can be summarized into one row for display, etc.
[0044] In some embodiments, the merge row operation can be performed based on the same dimension enumeration value based on secondary analysis. In some data analysis scenarios, there may be multiple event data sets, including the same dimension field (such as ID) and different timestamp information. In order to achieve the matching of these events and the calculation of the time difference, it is necessary to merge the data of the two events according to the same ID and calculate their timestamps. For example, there is the same ID in event A and event B. Through the secondary analysis function, the data rows of these same IDs can be merged, and the timestamp of event B can be calculated minus the timestamp of event A, so as to obtain the required time difference index. In some embodiments, custom rules can be sorted based on secondary analysis. In the chart display, when there are many enumeration values of the dimension, some key enumeration values can be displayed in a specific order first. Through the secondary analysis function, the enumeration values in the chart can be quickly sorted according to the rules specified by the user, and the relevant data can be displayed in a predetermined order.
[0045] Figure 5 A block diagram of an apparatus 800 for data analysis according to some embodiments of the present disclosure is shown. The apparatus 500 includes an initial result determination module 502, which is configured to determine an initial query result based on an initial query request of a user, wherein the initial query result includes data columns corresponding to fields specified in the initial query request, and each data column includes a field name and a field value. The apparatus 500 also includes a subsequent request acquisition module 504, which is configured to acquire a subsequent analysis request of the user, wherein the subsequent analysis request indicates processing related to the data columns in the initial query result in a natural language form. The apparatus 500 also includes a target prompt determination module 506, which is configured to determine a target prompt word based on the initial query result and the subsequent analysis request.
[0046] The apparatus 500 further includes a solution code generation module 508, which is configured to generate an analysis solution and a target code for a subsequent analysis request using a language model based on the target prompt word. The apparatus 500 further includes a target data generation module 510, which is configured to generate a target data column for a subsequent analysis request by executing the target code. In addition, the apparatus 500 further includes a target result determination module 512, which is configured to determine a target analysis result for a subsequent analysis request based on the analysis solution and the target data column.
[0047] Figure 6 A block diagram of an electronic device 600 is shown in accordance with certain embodiments of the present disclosure. Figure 6 1 shows a block diagram of an electronic device 600 according to some embodiments of the present disclosure, and the device 600 may be a device or apparatus described in an embodiment of the present disclosure. Figure 6 As shown, the device 600 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The CPU / GPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604. Although not shown in FIG. Figure 6 As shown in FIG. 6 , device 600 may also include a co-processor.
[0048] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0049] The various methods or processes described above may be performed by the CPU / GPU 601. For example, in some embodiments, the methods may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the CPU / GPU 601, one or more steps or actions in the methods or processes described above may be performed.
[0050] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0051] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0052] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0053] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, and conventional procedural programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.
[0054] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0055] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0056] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the equipment, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved. It should also be noted that each frame in the block diagram and / or flow chart, and the combination of frames in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0057] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
[0058] Some example implementations of the present disclosure are listed below.
[0059] Example 1. A method of data analysis, comprising: Determine an initial query result based on the user's initial query request, the initial query result including data columns corresponding to the fields specified in the initial query request, each data column including a field name and a field value; Obtaining a subsequent analysis request from the user, wherein the subsequent analysis request indicates, in a natural language form, processing related to the data column in the initial query result; Determining a target prompt word based on the initial query result and the subsequent analysis request; Based on the target prompt word, using a language model to generate an analysis scheme and a target code for the subsequent analysis request; Generate a target data column for the subsequent analysis request by executing the target code; and Based on the analysis scheme and the target data column, a target analysis result for the subsequent analysis request is determined.
[0060] Example 2. The method according to Example 1, wherein determining the initial query result comprises: Obtaining the initial query request, where the initial query request is a structured query language SQL query; and The initial query result is obtained from the database by executing the SQL query.
[0061] Example 3. The method according to any one of Examples 1-2, wherein determining the initial query result comprises: Obtaining the initial query request, where the initial query request is used to specify a target field and a filter condition on a visualization page; and Based on the target field and the screening condition, the initial query result is obtained from a database corresponding to the visualization page.
[0062] Example 4. The method according to any one of Examples 1-3, wherein determining the target prompt word comprises: Determining a context portion for the target prompt word based on the field name and field type of the data column; determining an instruction portion for the target prompt word, wherein the instruction content instructs the language model to generate an output related to the analysis scheme and the target code; and The target cue word is determined based on the subsequent analysis request, the context portion and the instruction portion.
[0063] Example 5. The method according to any one of Examples 1-4, further comprising: Based on the target analysis result, generating a visualization component for display; and The target analysis result is displayed by loading the visualization component on the visualization page.
[0064] Example 6. The method according to any one of Examples 1-5, further comprising: storing the target code and the subsequent analysis request in a database as an analysis record; and An identifier for the analysis record is generated.
[0065] Example 7. The method according to any one of Examples 1-6, further comprising: Obtaining an additional analysis request from the user; Based on the identifier, obtaining the analysis record from the database; and Based on the analysis record and the additional analysis request, an analysis result for the additional analysis request is generated using the language model.
[0066] Example 8. The method of any one of Examples 1-7, wherein the subsequent analysis request includes at least one of the following: Analysis requests related to field operations; Analytical requests related to data screening; Analytical requests related to multi-dimensional aggregation; or Analysis requests related to custom sorting.
[0067] Example 9. A data analysis device, comprising: An initial result determination module is configured to determine an initial query result based on an initial query request of a user, wherein the initial query result includes data columns corresponding to fields specified in the initial query request, and each data column includes a field name and a field value; a subsequent request acquisition module, configured to acquire a subsequent analysis request of the user, wherein the subsequent analysis request indicates, in a natural language form, a process related to the data column in the initial query result; A target prompt determination module, configured to determine a target prompt word based on the initial query result and the subsequent analysis request; A solution code generation module is configured to generate an analysis solution and a target code for the subsequent analysis request based on the target prompt word and using a language model; a target data generation module configured to generate a target data column for the subsequent analysis request by executing the target code; and The target result determination module is configured to determine a target analysis result for the subsequent analysis request based on the analysis scheme and the target data column.
[0068] Example 10. The apparatus according to Example 9, wherein the initial result determination module comprises: an initial request acquisition module, configured to acquire the initial query request, wherein the initial query request is a structured query language SQL query; and The initial result second determination module is configured to obtain the initial query result from the database by executing the SQL query.
[0069] Example 11. The apparatus according to any one of Examples 9-10, wherein the initial result determination module comprises: An initial request second acquisition module is configured to acquire the initial query request, where the initial query request is used to specify a target field and a filter condition on a visualization page; and The third initial result determination module is configured to obtain the initial query result from a database corresponding to the visualization page based on the target field and the screening condition.
[0070] Example 12. The apparatus according to any one of Examples 9-11, wherein the target prompt determination module comprises: A context part determination module, configured to determine a context part for the target prompt word based on the field name and field type of the data column; an instruction part determination module, configured to determine an instruction part for the target prompt word, wherein the instruction content instructs the language model to generate an output related to the analysis scheme and the target code; and The target prompt word second determination module is configured to determine the target prompt word based on the subsequent analysis request, the context part and the instruction part.
[0071] Example 13. The apparatus according to any one of Examples 9-12, further comprising: A visualization component generation module, configured to generate a visualization component for display based on the target analysis result; and The target result display module is configured to display the target analysis result by loading the visualization component on the visualization page.
[0072] Example 14. The apparatus of any one of Examples 9-13 further includes: an analysis record storage module, configured to store the target code and the subsequent analysis request in a database as an analysis record; and The identifier generation module is configured to generate an identifier for the analysis record.
[0073] Example 15. The apparatus of any one of Examples 9-14, further comprising: An additional request acquisition module, configured to acquire an additional analysis request from the user; an analysis record acquisition module, configured to acquire the analysis record from the database based on the identifier; and The additional result generating module is configured to generate an analysis result for the additional analysis request by using the language model based on the analysis record and the additional analysis request.
[0074] Example 16. The apparatus of any of Examples 9-15, wherein the subsequent analysis request comprises at least one of the following: Analysis requests related to field operations; Analytical requests related to data screening; Analytical requests related to multi-dimensional aggregation; or Analysis requests related to custom sorting.
[0075] Example 17. An electronic device comprising: Processor; and A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device performs actions, the actions comprising: Determine an initial query result based on the user's initial query request, the initial query result including data columns corresponding to the fields specified in the initial query request, each data column including a field name and a field value; Obtaining a subsequent analysis request from the user, wherein the subsequent analysis request indicates, in a natural language form, processing related to the data column in the initial query result; Determining a target prompt word based on the initial query result and the subsequent analysis request; Based on the target prompt word, using a language model to generate an analysis scheme and a target code for the subsequent analysis request; Generate a target data column for the subsequent analysis request by executing the target code; and Based on the analysis scheme and the target data column, a target analysis result for the subsequent analysis request is determined.
[0076] Example 18. The electronic device of Example 17, wherein determining the initial query result comprises: Obtaining the initial query request, where the initial query request is a structured query language SQL query; and The initial query result is obtained from the database by executing the SQL query.
[0077] Example 19. The electronic device of any of Examples 17-18, wherein determining the initial query result comprises: Obtaining the initial query request, where the initial query request is used to specify a target field and a filter condition on a visualization page; and Based on the target field and the screening condition, the initial query result is obtained from a database corresponding to the visualization page.
[0078] Example 20. The electronic device according to any one of Examples 17-19, wherein determining the target prompt word comprises: Determining a context portion for the target prompt word based on the field name and field type of the data column; determining an instruction portion for the target prompt word, wherein the instruction content instructs the language model to generate an output related to the analysis scheme and the target code; and The target cue word is determined based on the subsequent analysis request, the context portion and the instruction portion.
[0079] Example 21. The electronic device according to any one of Examples 17-20, wherein the actions further include: Based on the target analysis result, generating a visualization component for display; and The target analysis result is displayed by loading the visualization component on the visualization page.
[0080] Example 22. The electronic device according to any one of Examples 17-21, wherein the actions further include: storing the target code and the subsequent analysis request in a database as an analysis record; and An identifier for the analysis record is generated.
[0081] Example 23. The electronic device according to any one of Examples 17-22, wherein the actions further include: Obtaining an additional analysis request from the user; Based on the identifier, obtaining the analysis record from the database; and Based on the analysis record and the additional analysis request, an analysis result for the additional analysis request is generated using the language model.
[0082] Example 24. An electronic device according to any of Examples 17-23, wherein the subsequent analysis request includes at least one of the following: Analysis requests related to field operations; Analytical requests related to data screening; Analytical requests related to multi-dimensional aggregation; or Analysis requests related to custom sorting.
[0083] Example 25. A computer-readable storage medium having one or more computer instructions stored thereon, wherein the one or more computer instructions are executed by a processor to implement the method according to any one of Examples 1 to 8.
[0084] Example 26. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform the method according to any one of Examples 1 to 8.
[0085] Although the disclosure has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Instead, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method of data analysis, include: Determine an initial query result based on the user's initial query request, the initial query result including data columns corresponding to the fields specified in the initial query request, each data column including a field name and a field value; Obtaining a subsequent analysis request from the user, wherein the subsequent analysis request indicates, in a natural language form, processing related to the data column in the initial query result; Determining a target prompt word based on the initial query result and the subsequent analysis request; Based on the target prompt word, using a language model to generate an analysis scheme and a target code for the subsequent analysis request; Generate a target data column for the subsequent analysis request by executing the target code; as well as Based on the analysis scheme and the target data column, a target analysis result for the subsequent analysis request is determined.
2. The method according to claim 1, wherein determining the initial query result include: Obtaining the initial query request, where the initial query request is a structured query language SQL query; as well as The initial query result is obtained from the database by executing the SQL query.
3. The method according to claim 1, wherein determining the initial query result include: Obtaining the initial query request, where the initial query request is used to specify a target field and a screening condition on a visualization page; as well as Based on the target field and the screening condition, the initial query result is obtained from a database corresponding to the visualization page.
4. The method according to claim 1, wherein determining the target prompt word include: Determining a context portion for the target prompt word based on the field name and field type of the data column; Determining an instruction portion for the target prompt word, wherein the instruction content instructs the language model to generate an output related to the analysis scheme and the target code; as well as The target cue word is determined based on the subsequent analysis request, the context portion and the instruction portion.
5. The method according to claim 1, further comprising: include: Based on the target analysis results, generate a visualization component for display; as well as The target analysis result is displayed by loading the visualization component on the visualization page.
6. The method according to claim 5, further comprising: include: storing the target code and the subsequent analysis request in a database as an analysis record; as well as An identifier for the analysis record is generated.
7. The method according to claim 6, further comprising: include: Obtaining an additional analysis request from the user; Based on the identifier, obtaining the analysis record from the database; as well as Based on the analysis record and the additional analysis request, an analysis result for the additional analysis request is generated using the language model.
8. The method of claim 1, wherein the subsequent analysis request comprises at least one of the following: Analysis requests related to field operations; Analytical requests related to data screening; Analytical requests related to multi-dimensional aggregation; or Analysis requests related to custom sorting.
9. A device for data analysis, include: An initial result determination module is configured to determine an initial query result based on an initial query request of a user, wherein the initial query result includes data columns corresponding to fields specified in the initial query request, and each data column includes a field name and a field value; a subsequent request acquisition module, configured to acquire a subsequent analysis request of the user, wherein the subsequent analysis request indicates, in a natural language form, a process related to the data column in the initial query result; A target prompt determination module, configured to determine a target prompt word based on the initial query result and the subsequent analysis request; A solution code generation module is configured to generate an analysis solution and a target code for the subsequent analysis request based on the target prompt word and using a language model; a target data generation module, configured to generate a target data column for the subsequent analysis request by executing the target code; as well as The target result determination module is configured to determine a target analysis result for the subsequent analysis request based on the analysis scheme and the target data column.
10. An electronic device, include: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 8.
11. A computer program product tangibly stored on a non-transitory computer readable medium and comprising computer executable instructions for performing the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Database query method and device based on natural language and electronic equipment
CN118535679A
Data query method and device, electronic equipment and storage medium
CN118861077A
Cited By
Human body pressure data null value analysis method and device, medium and equipment
CN119889710A
Data query analysis method and device based on hybrid retrieval and code generation, equipment and medium
CN122262180A
