Data analysis method and device, computer equipment and storage medium
By using LLM and LangChain technology to automate the data analysis process, insurance companies have solved the problems of high training costs, difficult business understanding and cumbersome analysis in data analysis, and achieved efficient and accurate data analysis, lowering the threshold and improving efficiency.
Patent Information
- Application Number
- CN202411648207.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-04
AI Technical Summary
In terms of data analysis, insurance companies face high training costs, difficult business understanding, and cumbersome and inefficient data analysis processes.
By obtaining input data and defining data analysis ideas, disassembly the data to generate subtasks, generate number acquisition logic based on subtasks, and call the task interface to output analysis results, and use LLM and LangChain technology to automate the data analysis process.
It lowers the threshold for data analysis, improves the efficiency and accuracy of data analysis, reduces manual intervention and operation complexity, saves time and costs, and improves the transparency and credibility of data analysis.
Smart Images

Figure CN119557361A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to data analysis technology, and more specifically to data analysis methods, devices, computer equipment and storage media. Background Art
[0002] In the current insurance industry, data analysis is not only a core skill for back-office staff, but also a key support for corporate decision-making, risk management and business optimization. However, faced with the complex and ever-changing business scenarios and cumbersome business processes of insurance companies, new data analysts often find it difficult to quickly and comprehensively grasp the company's overall operating conditions. This not only requires data analysts to have a deep foundation in statistics, mathematics and computer science, but also requires them to be able to quickly familiarize themselves with and understand the company's various insurance products and services, as well as the market logic and customer needs behind these products and services.
[0003] At present, despite the growing demand for data analysis talents in the financial industry, there is a general shortage of data analysis talents and high mobility in the market. In order to fill this talent gap, many insurance companies have to invest a lot of time and resources in pre-job business training for new data analysts. However, this kind of training is not only time-consuming and labor-intensive, but also when data analysts leave for various reasons, the company needs to recruit and train again, which undoubtedly increases the operating costs and time costs of the company.
[0004] In addition, due to the complexity and diversity of insurance companies' businesses, in-depth correlation analysis and multi-dimensional drill-down analysis are often required during the data analysis process. Traditional data analysis methods can only provide preliminary analysis conclusions, but cannot directly reveal the specific reasons behind data fluctuations. Therefore, data analysts need to propose drill-down analysis requirements many times, and only through in-depth analysis and mining can they finally find the root cause of the problem. This analysis method not only has a long process, but also has low efficiency, and it is difficult to meet the needs of enterprises for rapid decision-making and timely response to market changes.
[0005] In summary, insurance companies are currently facing many challenges in data analysis, including high training costs for new data analysts, difficulty in understanding business, and cumbersome and inefficient data analysis processes. Therefore, it is particularly important to develop an intelligent assistant that can lower the threshold for data analysis and improve the efficiency and accuracy of data analysis. Data analysis methods based on advanced technologies such as LLM (Large Language Model) and LangChain are expected to provide a new idea and solution to these problems. Summary of the invention
[0006] The present invention provides a data analysis method, apparatus, computer equipment and storage medium to solve the technical problems of high training costs for new data analysts, difficulty in business understanding, and cumbersome and inefficient data analysis processes.
[0007] First, a data analysis method is provided, including:
[0008] Obtain input data and define data analysis ideas;
[0009] Decomposing the input data according to the data analysis ideas to generate a number of subtasks;
[0010] Generate data acquisition logic according to the subtask;
[0011] The corresponding task interface is called according to the data acquisition logic to output the task analysis result.
[0012] In a second aspect, a data analysis device is provided, comprising:
[0013] The acquisition definition unit is used to obtain input data and define data analysis ideas;
[0014] A disassembly generation unit, used for disassembling the input data according to the data analysis idea to generate a plurality of subtasks;
[0015] A generating unit, used for generating data acquisition logic according to the subtask;
[0016] The calling output unit is used to call the corresponding task interface according to the data acquisition logic to output the task analysis result.
[0017] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data analysis method when executing the computer program.
[0018] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned data analysis method are implemented.
[0019] The above data analysis method obtains input data and defines data analysis ideas, disassembles the input data according to the data analysis ideas to generate several subtasks, generates data acquisition logic according to the subtasks, and calls the corresponding task interface according to the data acquisition logic to output the task analysis results. By using data analysis, the threshold of data analysis can be lowered and the efficiency and accuracy of data analysis can be improved.
[0020] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0022] Figure 1 A schematic diagram of an application scenario of the data analysis method provided by an embodiment of the present invention;
[0023] Figure 2 A schematic diagram of a flow chart of a data analysis method provided by an embodiment of the present invention;
[0024] Figure 3 A schematic block diagram of a data analysis device provided by an embodiment of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0028] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0029] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0030] See also Figure 1 and Figure 2 , Figure 1A schematic diagram of an application scenario of the data analysis method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a data analysis method provided in an embodiment of the present invention. The data analysis method is applied in a server. The server interacts with a terminal, which can obtain input data and define data analysis ideas, disassemble the input data according to the data analysis ideas to generate a number of subtasks, generate data acquisition logic according to the subtasks, call the corresponding task interface according to the data acquisition logic, and output the task analysis results, thereby lowering the threshold for data analysis and improving the efficiency and accuracy of data analysis.
[0031] Figure 2 FIG. 1 is a flow chart of a data analysis method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S140.
[0032] S110, obtaining input data and defining data analysis ideas;
[0033] In this embodiment, in the initial stage of data analysis, it is necessary to obtain relevant input data, which may come from a variety of data sources, such as databases, files, API interfaces, etc. Through the LangChain framework, these data sources can be easily connected and managed. LangChain provides a unified data loading interface that supports loading data from various data sources and converting it into a format suitable for analysis. In practical applications, the DataLoaders component of LangChain can be used to load data, and the data can be passed to subsequent analysis components through the Chains module.
[0034] Defining data analysis ideas is a key link in the data analysis process. It involves determining the analysis goals, selecting analysis methods, designing analysis processes, etc. In the LangChain framework, data analysis ideas can be defined by building chain structures (Chains). Chain structures allow multiple analysis components (such as data preprocessing, feature extraction, model training, etc.) to be organically connected together to form a complete data analysis process. Using LLM (Large Language Model) can help generate high-quality data analysis ideas. LLM learns the statistical laws of language by training a large amount of text data, so that it can generate coherent and logical sentences and paragraphs. In data analysis, LLM can be used to generate analysis goals, describe analysis methods, explain analysis results, etc. Specifically, LLM can be guided to generate text content related to data analysis by providing questions or prompt words to it. Then, these contents are converted into specific analysis steps and processes and implemented in the LangChain framework.
[0035] Through the application of the LangChain framework and LLM, multiple steps in the data analysis process can be automatically executed, thereby reducing manual intervention and reducing the complexity of operations. This not only saves time costs, but also improves the accuracy and consistency of data analysis. For non-professional data analysts, the use of LangChain and LLM can simplify the data analysis process and reduce learning costs and technical difficulties. Data analysts can interact with LLM through natural language to generate data analysis ideas and processes that meet their needs without having to deeply understand the underlying technical details. The LangChain framework supports the integration of multiple data sources and components, so that the data analysis process can be flexibly adjusted and optimized according to actual needs. At the same time, the generation capability of LLM also enables data analysis ideas to be continuously updated and improved as problems change.
[0036] More specifically, data analysts are required to input data analysis ideas in text form, without having to output specific demand templates in advance, so as to lower the threshold for data analysts to explore data for the first time. The data analysis ideas need to be input according to the template, and the analysis steps need to be described as detailed as possible, otherwise the large model will not be able to understand how to perform specific analysis tasks in the subsequent process. Examples of data analysis idea templates are as follows:
[0037] Background and purpose: To analyze the reasons for the abnormal AI outbound call connection rate in September 2024.
[0038] Analysis ideas: First look at the overall trend, and then drill down from the abnormal dates to locate the problem in terms of region / time period / number segment.
[0039] Analysis steps: 1. Look at the trend of the overall connection rate and extract dates with fluctuations of ±5% or more; 2. Check whether there are obvious abnormalities from the single dimension of region / time period / number segment (fluctuation of ±10%); 3. Check whether there are obvious abnormalities from the combined dimension of region / time period / number segment (fluctuation of ±10%).
[0040] Indicator definition: Connection rate = number of task connections / total number of tasks.
[0041] Analysis methods: comparative analysis, multidimensional analysis, attribution analysis, and cluster analysis.
[0042] Output content: abnormal task list, in .CSV format.
[0043] S120, disassembling the input data according to the data analysis idea to generate a plurality of subtasks;
[0044] In this embodiment, before starting to disassemble the input data, it is first necessary to clarify the specific ideas and goals of data analysis, which includes determining the purpose of the analysis, the required data type, the analysis method, etc. The clarification of the data analysis ideas helps to guide the subsequent data disassembly and generation of subtasks. According to the data analysis ideas, the input data is disassembled into multiple parts or dimensions, which may correspond to different variables, categories or time periods in the data analysis. The process of disassembling the data needs to ensure that each part or dimension can be analyzed independently and help achieve the ultimate goal of data analysis. For each data part or dimension after disassembly, specific subtasks are generated, which may include data cleaning, data conversion, feature extraction, model training, etc. The generation of subtasks requires clarifying the specific goals, input data, output results, and required tools or methods of each task. By disassembling the data analysis process into multiple subtasks, the analysis process can be made clearer and more organized, and it is helpful to achieve parallel processing and division of labor.
[0045] By breaking down the data analysis process into multiple subtasks, each task can be handled more focused and carefully, which helps improve the accuracy and efficiency of data analysis. At the same time, the generation of subtasks also helps avoid omissions or repeated analysis during the data analysis process. The broken down data parts or dimensions can be analyzed and processed independently, which makes the data analysis process more scalable and flexible. When new analysis dimensions or methods need to be added, they only need to be modified and expanded in the corresponding subtasks without the need to reconstruct the entire data analysis process. After breaking down the data analysis process into multiple subtasks, the work responsibilities and boundaries of team members can be more clearly divided, which helps promote collaboration and division of labor among team members and improve the efficiency and productivity of the entire data analysis team.
[0046] Specifically, the input data is disassembled according to the data analysis idea to generate a number of subtasks, including:
[0047] Disassemble and analyze the input data according to the data analysis ideas to obtain an analysis list;
[0048] A task list, namely, a plurality of subtasks, is generated according to the analysis list.
[0049] More specifically, by calling chatGLM, the analyst's data analysis ideas are broken down into specific subtasks. The calling process of chatGLM is as follows:
[0050] Input prompt:
[0051] I am a data analyst, and I need to [analyze the abnormal reasons for the AI outbound call connection rate in September 23]. My analysis idea is [first look at the overall trend, and drill down from the abnormal date to locate the problem in the region / time period / number segment dimension, which can be analyzed through comparative analysis, multidimensional analysis, attribution analysis, cluster analysis and other methods]. The steps I plan to analyze are [1. Look at the trend of the overall connection rate, and extract the dates with fluctuations of ±5% and above; 2. From the single dimension of region / time period / number segment, see if there are obvious abnormalities (fluctuation ±10%); 3. From the combined dimension of region / time period / number segment, see if there are obvious abnormalities (fluctuation ±10%); Among them, the indicator definition connection rate = number of task connections / total number of tasks]. Now please help me disassemble the specific analysis step task list and output it to LangChain to complete the analysis task.
[0052] Output subtask:
[0053] Based on the analysis ideas you provided, the following is a specific task list of analysis steps:
[0054] 1. Overall trend analysis;
[0055] Extract all dates in September 23;
[0056] Calculate the AI outbound call connection rate for each date;
[0057] Draw a trend chart of the connection rate;
[0058] Observe the trend chart and find the dates with fluctuations of ±5% or more;
[0059] 2. Single-dimensional analysis of region / time period / number segment;
[0060] Extract all dates in September 23;
[0061] Group by region / time period / number segment;
[0062] Calculate the AI outbound call connection rate for each date / region;
[0063] Draw trend charts of connection rate by region / time period / number segment;
[0064] Observe the trend chart and find out the areas / time periods / number segments with fluctuations of ±10% or more;
[0065] 3. Analysis of region / time period / number segment combination dimensions;
[0066] Extract all dates in September 23;
[0067] Group by region / time period / number segment combination;
[0068] Calculate the AI outbound call connection rate for each date / region / time period / number segment;
[0069] Draw a trend chart of the connection rate by region / time period / number segment combination;
[0070] Observe the trend chart and find the region / time period / number segment combinations with fluctuations of ±10% or more;
[0071] After completing the above tasks, we can analyze the reasons for the abnormal AI outbound call connection rate in September 2024.
[0072] S130, generating data acquisition logic according to the subtask;
[0073] In this embodiment, first of all, it is necessary to deeply understand the specific requirements of each subtask, including the required data type, data range, data granularity, etc. According to the requirements of the subtask, design a suitable data acquisition strategy, which may include determining the data source, selecting a data extraction method, formulating data filtering conditions, etc. When designing a data acquisition strategy, it is necessary to consider the integrity, accuracy and timeliness of the data. According to the designed data acquisition strategy, write a corresponding data acquisition script or query statement, which may involve SQL queries, Python scripts, Excel formulas, etc. When writing a data acquisition script or query, it is necessary to ensure the correctness of the statement and consider possible abnormal situation handling. Before formally executing the data acquisition, the written script or query needs to be tested to ensure that it can correctly extract the required data. If the test results do not meet expectations, the script or query needs to be optimized and adjusted. After the test and optimization are completed, the data acquisition operation is formally executed to extract the required data from the data source. When executing the data acquisition, it is necessary to pay attention to the data extraction speed and the quality of the extraction results.
[0074] By designing a reasonable data acquisition strategy and writing efficient data acquisition scripts or queries, the efficiency of data extraction can be significantly improved, which helps to shorten the data analysis cycle and improve the response speed of the entire data analysis process. Through rigorous testing and optimization processes, it can be ensured that the written data acquisition scripts or queries can correctly extract the required data, which helps to avoid data errors or omissions and improve the accuracy of data analysis. Clear data acquisition logic and clear subtask division help enhance the interpretability of data, which makes data analysis results easier to understand and accept, and helps to improve the transparency and credibility of data analysis.
[0075] Specifically, generating data acquisition logic according to the subtask includes:
[0076] The subtasks are decomposed to generate a SQL statement, namely, data retrieval logic.
[0077] More specifically, LangChain is called to decompose the task as follows:
[0078] Step 1 is as follows:
[0079] Task breakdown: Get all dates in September 23;
[0080] Action: Generate SQL;
[0081] Input: I want to extract the outbound call task list for September 23 from database H, including outbound call area, outbound call number segment, outbound call time, outbound call duration, whether connected, etc. Please help me generate a SQL statement;
[0082] Output: SELECT DATEADD(day, DATEDIFF(day, 0, task date), 0) AS outbound call date, COUNT(*) AS number of connections, COUNT(CASE task status when 'connected' then1end) AS number of successes; FROM H.dbo.Outbound call task; WHERE task date >= '2023-09-01' AND task date < '2023-09-30' GROUP BY outbound call date; ORDER BY outbound call date ASC.
[0083] Step 2 is as follows:
[0084] Task breakdown: Calculate the AI outbound call connection rate for each date and draw a connection rate trend chart;
[0085] Action: Call BI component;
[0086] Input: Please help me call python to draw a daily trend chart, and mark the abnormal dates with fluctuations of ±5% with red circles;
[0087] Output: importpandas as pd;
[0088] import matplotlib.pyplot as plt;
[0089] #Import outbound call task data;
[0090] df = pd.read_csv('outbound call task.csv');
[0091] #Calculate the number of connections and successes for each date;
[0092] df['Connection times'] = df['Task status'].eq('Connection').sum();
[0093] df['Number of successes'] = df['Task status'].eq('Connected').sum();
[0094] #Group by date and calculate the connection rate and success rate;
[0095] grouped = df.groupby('outbound call date');
[0096] grouped['Connection rate'] = grouped['Connection times'] / grouped['Successful times'];
[0097] grouped['success rate'] = grouped['success times'] / grouped['connect times'];
[0098] #Draw a trend chart;
[0099] plt.plot(grouped['Outbound call date'], grouped['Connection rate'], color = '#00ff00', label = 'Connection rate');
[0100] plt.plot(grouped['Outbound call date'], grouped['Success rate'], color = '#ff0000', label = 'Success rate');
[0101] plt.title('Daily outbound call connection rate trend chart');
[0102] plt.xlabel('date');
[0103] plt.ylabel('Connection rate / success rate');
[0104] plt.legend(loc='upperright');
[0105] #Dates with a 5% fluctuation are marked with red circles;
[0106] for index, group in grouped.groups.items():
[0107] if grouped[group]['connection rate'].mean()>(grouped[group]['connection rate'].mean()+0.05):
[0108] plt.scatter(grouped[group]['Outbound call date'], grouped[group]['Connection rate'], color = '#ff0000', s = 200, label = group);
[0109] plt.show().
[0110] In this embodiment, after generating the data acquisition logic according to the subtask, the method further includes:
[0111] The data acquisition logic is reviewed; if an error is found during the review, the data acquisition logic is modified to obtain a new data acquisition logic.
[0112] Specifically, the data analyst confirms the input and output of each step of the LangChain disassembly. By adjusting the description text of the task input, a new task output can be generated online in real time, reducing the traditional process of multiple adjustments from data requirement description to data development data, and further improving data analysis efficiency. In other words, through the manual two-time review link, there is actually less content that needs to be manually adjusted. The main thing is to check whether the content generated by LLM can fully meet the analysis ideas input by the data analyst in the first step. For example: the data analyst may be relatively simple in the description of the first step. Through this step, it will be found that the output data fields and sorting actually need to be refined, so corrections are made in this step. The data analyst can directly modify the prompt in the content returned by LLM without performing other operations.
[0113] More specifically, the SQL code outputted by the supplementary optimization of the input prompt is as follows:
[0114] Before step optimization:
[0115] Task breakdown: Extract the outbound call list for September 2023;
[0116] Action: Generate SQL;
[0117] Input: I want to extract the outbound call task list for September 23 from database H. Please help me generate a SQL statement [there is no specific description of which fields need to be selected, whether the data needs to be sorted, etc.];
[0118] Output: SELECT * FROM H.dbo.Outbound call task WHERE task date >= 'September 1, 2023' AND task date < 'September 30, 2023'.
[0119] After step optimization:
[0120] Task breakdown: Extract the outbound call list for September 2023;
[0121] Action: Generate SQL;
[0122] Input: I want to extract the outbound call task list for September 23 from database H, including the outbound call area, outbound call number segment, outbound call time, outbound call duration, whether connected, etc., and sort them in ascending order by date. Please help me generate a SQL statement.
[0123] Output: SELECT DATEADD(day,DATEDIFF(day,0,task date),0)AS outbound call date, COUNT(*)AS number of connections, COUNT(CASE task status when 'connected' then 1end)AS number of successes; FROM H.dbo.outbound call task; WHERE task date >= '2023-09-01' AND task date < '2023-09-30'; GROUP BY outbound call date; ORDER BY outbound call date ASC.
[0124] S140. Call the corresponding task interface according to the data acquisition logic to output the task analysis result.
[0125] In this embodiment, first, it is necessary to clarify the data acquisition logic, which usually includes determining the required data source, data field, data screening conditions, and data conversion rules. The data acquisition logic should be closely related to the task requirements to ensure that the key data required for analysis can be extracted. According to the task requirements, identify and determine the task interface that needs to be called. The task interface may be an API (application programming interface), a database query interface, or other types of interfaces, used to perform specific data analysis or data processing tasks. According to the data acquisition logic, configure the parameters required for the task interface, which may include the data source address, data field name, screening condition value, conversion rules, etc. The configuration of the parameters should be accurate to ensure that the interface can be executed correctly and return the expected results. Use an appropriate programming language or tool (such as Postman, curl, Python, etc.) to call the task interface according to the configured parameters. During the call, you need to pay attention to the response status of the interface, the returned data format, and possible exceptions or errors. Process and analyze the results returned by the interface, which may include steps such as data parsing, data conversion, and data verification. According to the task requirements, the processed results are output in an appropriate format, such as reports, charts, log files, etc. Verify whether the output results meet the task requirements. If the output results do not meet expectations, it is necessary to recheck the data acquisition logic, interface parameter configuration, and calling process, and make corresponding adjustments and optimizations.
[0126] By combining the data acquisition logic with the task interface, the automated execution of data analysis tasks is achieved, which greatly improves the efficiency of data analysis and reduces the tediousness and errors of manual operations. The data acquisition logic and task interface can be flexibly configured and adjusted according to task requirements, which enables the data analysis process to adapt to different business needs and data environments and has good scalability. Through strict parameter configuration and result verification, the accuracy and reliability of data analysis results are ensured, which helps to improve the quality of data-driven decision-making and provide strong support for the development of the enterprise. By recording information such as the interface call process, parameter configuration, and output results, the data analysis process is traceable and auditable, which helps to quickly locate the cause when a problem occurs, and make corresponding repairs and improvements.
[0127] The calling of the corresponding task interface according to the data acquisition logic to output the task analysis result includes:
[0128] The corresponding task interface is executed through API interface calls, and the content of each module is output. The corresponding content is filled into a fixed position through background writing, and finally the PPT content of a unified template is output, that is, the task analysis result.
[0129] Specifically, the corresponding task interface will be called according to the task description modified by the data analyst (i.e., the new data acquisition logic) to output the final task result. At the same time, the corresponding draft analysis report will be automatically generated according to the data analyst's data analysis ideas and interpretation of abnormal data. Data analysts can also upload past data analysis report PPTs, and LangChain will replace and update similar content to further improve data analysis efficiency.
[0130] More specifically, the data extracted from the database is generated and output in the form of prompt template + slot filling according to the PPT template.
[0131] The prompt template is as follows:
[0132] I am a data analyst. I have completed the analysis of [Background Purpose] and the relevant detailed data has been saved in the [Result Data.CSV] document. Now I need to write an analysis report. Please output the analysis conclusions according to the following modules:
[0133] Analysis topic: XXX analysis report;
[0134] Background and significance: research background, purpose and significance;
[0135] Analysis content: analysis ideas, analysis steps, indicator selection, data range description, etc.;
[0136] Analysis methods: What data methods were used? List them one by one;
[0137] Analysis conclusion: Output the analysis conclusion based on the above data results. If there are multiple conclusions, output them one by one, with a maximum of 5 conclusions.
[0138] Then, the above-mentioned Prompt instruction is input into the large model LLM through API interface calling. The large model will output the content of each module, and fill the corresponding content into a fixed position through background writing, and finally output the PPT content of a unified template.
[0139] The above data analysis method, through the data analysis intelligent assistant based on LLM+LangChain, can, on the one hand, transform the data analyst's ideas into multiple data analysis subtasks through LLM's text understanding ability, thus lowering the threshold for data analysts; on the other hand, through LangChain, a one-stop full-process service from data extraction, chart drawing, data analysis, and data reporting can be realized, further improving the work efficiency of data analysts. In other words, by using data analysis, the threshold for data analysis can be lowered and the efficiency and accuracy of data analysis can be improved.
[0140] Figure 3 is a schematic block diagram of a data analysis device 300 provided in an embodiment of the present invention. Figure 3 As shown, corresponding to the above data analysis method, the present invention also provides a data analysis device 300. The data analysis device 300 includes a unit for executing the above data analysis method, and the device can be configured in a server. Figure 3 , the data analysis device 300 includes an acquisition definition unit 301, a disassembly generation unit 302, a generation unit 303 and a call output unit 304;
[0141] An acquisition and definition unit 301 is used to acquire input data and define a data analysis idea;
[0142] A disassembly generation unit 302, configured to disassemble the input data according to the data analysis idea to generate a plurality of subtasks;
[0143] A generating unit 303, configured to generate data acquisition logic according to the subtask;
[0144] The calling output unit 304 is used to call the corresponding task interface according to the data acquisition logic to output the task analysis result.
[0145] In one embodiment, the data analysis strategy consists of background purpose, analysis strategy, analysis steps, indicator definition, analysis method and output content.
[0146] In one embodiment, the analysis method includes comparative analysis, multidimensional analysis, attribution analysis and cluster analysis.
[0147] In one embodiment, the disassembly generation unit 302 disassembles and analyzes the input data according to the data analysis idea to obtain an analysis list; and generates a task list, that is, a plurality of subtasks, according to the analysis list.
[0148] In one embodiment, in the generating unit 303, the subtask is decomposed to generate a SQL statement, namely, data retrieval logic.
[0149] In one embodiment, the device further comprises: a review unit, configured to review the data acquisition logic; if an error is found during the review, the data acquisition logic is modified to obtain a new data acquisition logic.
[0150] In one embodiment, in the calling output unit 304, the corresponding task interface is executed by calling the API interface, and the content of each module is output, and the corresponding content is filled into a fixed position by background writing, and finally the PPT content of the unified template is output, that is, the task analysis result.
[0151] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned data analysis device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0152] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of a data analysis method.
[0153] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0154] Obtain input data and define data analysis ideas; disassemble the input data according to the data analysis ideas to generate several subtasks; generate data acquisition logic according to the subtasks; call the corresponding task interface according to the data acquisition logic to output the task analysis results.
[0155] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0156] Obtain input data and define data analysis ideas; disassemble the input data according to the data analysis ideas to generate several subtasks; generate data acquisition logic according to the subtasks; call the corresponding task interface according to the data acquisition logic to output the task analysis results.
[0157] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0159] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0160] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A data analysis method, characterized in that: include: Obtain input data and define data analysis ideas; Decomposing the input data according to the data analysis ideas to generate a number of subtasks; Generate data acquisition logic according to the subtask; The corresponding task interface is called according to the data acquisition logic to output the task analysis result.
2. The data analysis method according to claim 1, characterized in that: The data analysis ideas are composed of background purpose, analysis ideas, analysis steps, indicator definition, analysis method and output content.
3. The data analysis method according to claim 2, characterized in that: The analysis methods include comparative analysis, multidimensional analysis, attribution analysis and cluster analysis.
4. The data analysis method according to claim 1, characterized in that: The step of disassembling the input data according to the data analysis idea to generate a number of subtasks includes: Disassemble and analyze the input data according to the data analysis ideas to obtain an analysis list; A task list, namely, a plurality of subtasks, is generated according to the analysis list.
5. The data analysis method according to claim 1, characterized in that: The step of generating data acquisition logic according to the subtask includes: The subtasks are decomposed to generate a SQL statement, namely, data retrieval logic.
6. The data analysis method according to claim 1, characterized in that: After generating the data acquisition logic according to the subtask, the method further includes: The data acquisition logic is reviewed; if an error is found during the review, the data acquisition logic is modified to obtain a new data acquisition logic.
7. The data analysis method according to claim 1, characterized in that: The calling of the corresponding task interface according to the data acquisition logic to output the task analysis result includes: The corresponding task interface is executed through API interface calls, and the content of each module is output. The corresponding content is filled into a fixed position through background writing, and finally the PPT content of a unified template is output, that is, the task analysis result.
8. A data analysis device, characterized in that include: The acquisition definition unit is used to obtain input data and define data analysis ideas; A disassembly generation unit, used for disassembling the input data according to the data analysis idea to generate a plurality of subtasks; A generating unit, used for generating data acquisition logic according to the subtask; The calling output unit is used to call the corresponding task interface according to the data acquisition logic to output the task analysis result.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the data analysis method according to any one of claims 1 to 7 are implemented.
10. A storage medium, wherein the computer-readable storage medium stores a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data analysis method according to any one of claims 1 to 7 are implemented.