Multitask time sequence analysis method and system driven by knowledge-enhanced large model

Through the multi-task time series analysis method driven by knowledge-enhanced large models, domain knowledge graphs and comparative learning algorithms are used to optimize time series data encoding, which solves the problems of low multi-model deployment efficiency and unreliable results in the existing technology, and achieves high accuracy. and interpretable timing analysis, suitable for multiple application scenarios.

CN118535747APending Publication Date: 2024-08-23INST OF AUTOMATION CHINESE ACAD OF SCI

Patent Information

Application Number
CN202410581476.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing time series analysis methods based on deep learning require the deployment of multiple models, resulting in low efficiency and waste of resources. At the same time, due to the black box characteristics of the model and the lack of training data, the credibility of the time series analysis results generated by large models is uncontrollable and difficult to interpret. It is used in professional fields with high performance requirements.

Method used

A multi-task time series analysis method driven by a knowledge-enhanced large model is used to optimize the target knowledge retrieval subgraph from the domain knowledge graph, and combine the contrastive learning algorithm to encode the time series data, generate target instructions and perform large model reasoning to achieve decoding. Visual presentation of results.

Benefits of technology

It improves the accuracy and interpretability of multi-task time series analysis, and realizes comprehensive, accurate, highly reliable, and scalable large-model multi-task time series analysis, which is suitable for industrial process monitoring, smart traffic scheduling, financial risk assessment and other scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535747A
    Figure CN118535747A
Patent Text Reader

Abstract

The invention provides a multi-task time sequence analysis method and system driven by a knowledge enhancement large model, and the method comprises the steps: determining a target knowledge retrieval sub-graph from a domain knowledge graph according to a keyword in a time sequence analysis task, and carrying out the pruning optimization of the target knowledge retrieval sub-graph, and obtaining a first cue word; the method comprises the following steps: preprocessing time sequence data acquired in real time to obtain new time sequence data, and performing time sequence encoding on a segmented sequence corresponding to the new time sequence data according to a time sequence encoder to obtain time sequence characteristics; obtaining a second cue word according to the statistical information corresponding to the new time sequence data and the time sequence characteristics; and obtaining a target instruction according to the time sequence analysis task, the first cue word and the second cue word, and performing time sequence reasoning and decoding on the target instruction based on the large model to obtain a decoding result. According to the method, the multi-task time sequence analysis accuracy is improved, and comprehensive, accurate, highly reliable, explainable and extensible large-model multi-task time sequence analysis is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data analysis technology, and in particular to a multi-task time series analysis method and system driven by a knowledge-enhanced large model. Background Art

[0002] With the widespread access to IoT sensors, modeling and analysis of time series data are of great significance in understanding the development laws of things, guiding complex decision-making, and optimizing system operation performance.

[0003] In recent years, generative big models represented by ChatGPT have set off a new wave of development in artificial intelligence. Experts and scholars have proposed using big models for time series analysis tasks, such as long / short-term prediction of time series. Big models have powerful semantic understanding and emergence capabilities, and can interact with users through question-and-answer interaction to perform a series of complex tasks.

[0004] In related technologies, deep learning-based time series analysis methods usually design different models according to specific task requirements. In actual time series analysis, multiple models may need to be deployed, resulting in inefficiency and waste of resources. However, due to the black box characteristics of the model and the lack of time series training data, the credibility of the time series analysis results generated by large models cannot be controlled, making it difficult to apply them in professional fields with high requirements for interpretability. Summary of the invention

[0005] The present invention provides a multi-task time series analysis method and system driven by a knowledge-enhanced large model, which is used to solve the problem that the time series analysis method based on deep learning in the prior art needs to deploy multiple models when implementing time series analysis, resulting in low efficiency and waste of resources; and due to the black box characteristics of the model and the lack of time series training data, the credibility of the time series analysis results generated by the large model cannot be controlled, thereby improving the accuracy of multi-task time series analysis.

[0006] The present invention provides a knowledge-enhanced large model-driven multi-task time series analysis method, comprising:

[0007] Determine a target knowledge retrieval subgraph from a domain knowledge graph according to keywords in the time series analysis task, and perform pruning optimization on the target knowledge retrieval subgraph to obtain a first prompt word; the domain knowledge graph is obtained based on cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis;

[0008] Preprocessing the time series data collected in real time to obtain new time series data, and performing time series encoding on the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; obtaining a second prompt word according to the statistical information corresponding to the new time series data and the time series features; wherein the time series encoder is determined based on a contrastive learning algorithm;

[0009] A target instruction is obtained according to the timing analysis task, the first prompt word and the second prompt word, and timing reasoning and decoding are performed on the target instruction based on a large model to obtain a decoding result.

[0010] According to a knowledge-enhanced large model-driven multi-task time series analysis method provided by the present invention, the domain knowledge graph is obtained through the following steps:

[0011] Acquire text data relevant to time series analysis in the target domain from multiple data sources;

[0012] Performing text denoising, word segmentation, part-of-speech tagging, and removal of stop words and special-care characters on the text data to obtain new text data;

[0013] Perform entity recognition and relationship extraction on multiple new text data according to the large model to obtain multiple triple data. Each triple data source includes a head entity, a relationship, and a tail entity.

[0014] Entity alignment is performed on the multiple triple data to obtain the domain knowledge graph.

[0015] According to a knowledge-enhanced large model-driven multi-task time series analysis method provided by the present invention, the time series encoder performs time series encoding on the segmented sequence corresponding to the new time series data to obtain the time series features, including:

[0016] Performing sliding window processing on the new time series data to obtain multiple non-overlapping segmented sequences;

[0017] Performing data enhancement on the segmented sequence to obtain positive sample data corresponding to the segmented sequence, obtaining negative sample data corresponding to the segmented sequence by adding noise and scaling to the segmented sequence, and obtaining a target sample according to the segmented sequence, the positive sample data and the negative sample data;

[0018] The target sample is encoded based on the time series encoder to obtain the time series feature.

[0019] According to a knowledge-enhanced large model-driven multi-task time series analysis method provided by the present invention, the contrast loss function of the time series encoder is expressed by the following formula:

[0020]

[0021] in, is the contrast loss function, e is the embedding representation of the segmented sequence, and e + is the embedding representation of the positive sample data, e - is the embedding representation of negative sample data, φ is the similarity calculation between the embedding representations of two segmented sequences, which is implemented by a similarity function with a temperature coefficient parameter, i is the batch, and B is the maximum batch value.

[0022] According to a multi-task time series analysis method driven by a knowledge-enhanced large model provided by the present invention, the step of determining a target knowledge retrieval subgraph from a domain knowledge graph according to keywords in the time series analysis task comprises:

[0023] Using the big model to extract keywords in the time series analysis task, and generate SPARQL query commands;

[0024] Inputting the SPARQL query command into the query engine of the database, performing query matching on the domain knowledge graph, and obtaining the target knowledge retrieval subgraph;

[0025] The pruning optimization of the target knowledge retrieval subgraph to obtain the first prompt word includes:

[0026] The similarity between the time series analysis task keyword and the triple data corresponding to the target knowledge retrieval subgraph is calculated to obtain a calculation result, and the knowledge retrieval subgraph is pruned and optimized according to the similarity threshold and the calculation result to obtain the first prompt word.

[0027] According to a knowledge-enhanced large model-driven multi-task time series analysis method provided by the present invention, performing time series reasoning and decoding on the target instruction to obtain a decoding result includes:

[0028] According to the large model, the target instruction is reasoned step by step according to a preset number of steps to obtain a reasoning result;

[0029] The temporal feature embedding part corresponding to the inference result is decoded according to the temporal decoder to obtain the decoding result.

[0030] According to a knowledge-enhanced large model-driven multi-task time series analysis method provided by the present invention, after obtaining the decoding result, the method further includes:

[0031] The decoding result is displayed in a target form, and the target form includes at least one of a number, a graph and a table.

[0032] The present invention also provides a knowledge-enhanced large model-driven multi-task time series analysis system, comprising:

[0033] A first prompt word acquisition module is used to determine a target knowledge retrieval subgraph from a domain knowledge graph according to keywords in a time series analysis task, and to prune and optimize the target knowledge retrieval subgraph to obtain a first prompt word; the domain knowledge graph is obtained by cleaning, preprocessing, entity recognition, relationship extraction, and knowledge graph fusion of text data related to time series analysis;

[0034] A second prompt word acquisition module is used to pre-process the time series data collected in real time to obtain new time series data, and perform time series encoding on the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; obtain a second prompt word according to the statistical information corresponding to the new time series data and the time series features; wherein the time series encoder is determined based on a contrastive learning algorithm;

[0035] A decoding module is used to obtain a target instruction according to the timing analysis task, the first prompt word and the second prompt word, and to perform timing reasoning and decoding on the target instruction based on a large model to obtain a decoding result.

[0036] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements a multi-task time series analysis method driven by a knowledge-enhanced large model as described above.

[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a multi-task time series analysis method driven by a knowledge-enhanced large model as described above.

[0038] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements a multi-task time series analysis method driven by a knowledge-enhanced large model as described above.

[0039] The knowledge-enhanced large model-driven multi-task time series analysis method and system provided by the present invention determines the target knowledge retrieval subgraph from the domain knowledge graph through the keywords in the time series analysis task, and prunes and optimizes the target knowledge retrieval subgraph to obtain the first prompt word; pre-processes the time series data collected in real time, and performs time series encoding on the segmented sequence corresponding to the new time series data, obtains the second prompt word according to the statistical information and time series characteristics corresponding to the new time series data, obtains the target instruction according to the time series analysis task, the first prompt word and the second prompt word, and performs time series reasoning and decoding on the target instruction to obtain the decoding result, thereby improving the accuracy of multi-task time series analysis and realizing comprehensive, accurate, highly reliable, interpretable and scalable large model multi-task time series analysis. It is helpful to realize intelligent optimization decision-making of multi-task time series analysis based on knowledge engineering and large models, and has important application value in scenarios such as industrial process monitoring, smart traffic scheduling, and financial risk assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a flow chart of the multi-task time series analysis method driven by the knowledge-enhanced large model provided by the present invention;

[0042] Figure 2 It is a weather field knowledge graph display diagram provided by the present invention;

[0043] Figure 3 It is a working diagram of the temporal feature codec based on contrastive learning provided by the present invention;

[0044] Figure 4 is a schematic diagram of an interface for obtaining a first prompt word provided by the present invention;

[0045] Figure 5 It is a flowchart of target instruction decoding and visual display provided by the present invention;

[0046] Figure 6 This is one of the structural schematic diagrams of the multi-task time series analysis system driven by the knowledge-enhanced large model provided by the present invention;

[0047] Figure 7 This is the second structural schematic diagram of the multi-task time series analysis system driven by the knowledge-enhanced large model provided by the present invention;

[0048] Figure 8It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.

[0050] Combine the following Figure 1-Figure 6 The present invention describes the knowledge-enhanced large model-driven multi-task time series analysis method and system.

[0051] Figure 1 : is a flow chart of the multi-task time series analysis method driven by the knowledge-enhanced large model provided by the present invention, such as Figure 1 As shown in FIG, the knowledge-enhanced large model-driven multi-task time series analysis method includes the following steps:

[0052] Step 110: determine the target knowledge retrieval subgraph from the domain knowledge graph according to the keywords in the time series analysis task, and prune and optimize the target knowledge retrieval subgraph to obtain the first prompt word; the domain knowledge graph is obtained based on cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis.

[0053] In this step, time series analysis tasks include time series long / short-range prediction, classification, filling, and anomaly detection.

[0054] For example, the time series analysis task is "This is a time series data about the weather in June at weather station A. Predict the change of the variable 'temperature T (degC)' at the next 96 time points."

[0055] In this embodiment, the keywords may be segmented words with different parts of speech such as "A weather station", "June", "future", "96 time points" or "temperature" in the above-mentioned time series analysis task.

[0056] In this embodiment, the domain knowledge graph can be obtained by performing pre-processing such as data cleaning on text data, video data or image data in multiple data sources, and then performing entity recognition, and simply fusing the data.

[0057] In this embodiment, the domain knowledge graph may include multiple different data domains, for example, the multiple different data domains include meteorology, biology, and Internet big data, etc.

[0058] In this embodiment, the domain knowledge graph is obtained by multiple groups of different triple structures, different head entities can be associated with different tail entities through a one-to-one correspondence, and multiple groups of different triple structures can share a head entity or a tail entity.

[0059] In this embodiment, the domain knowledge graph can be stored in the database and called in real time according to user instructions.

[0060] In this embodiment, by designing a timed data update mechanism, the domain knowledge graph can regularly obtain the latest relevant data from the scientific research database, and then incrementally update the domain knowledge graph.

[0061] In this embodiment, entities and corresponding relationships with low relevance to the original time series analysis task in the target knowledge retrieval subgraph are eliminated, and a specified number of triple structures are retained, which can reduce data redundancy and improve model calculation efficiency.

[0062] Step 120: pre-process the time series data collected in real time to obtain new time series data, and perform time series encoding on the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; obtain a second prompt word according to the statistical information and time series features corresponding to the new time series data; wherein the time series encoder is determined based on a contrastive learning algorithm.

[0063] In this step, the time series data may be meteorological data such as temperature, air pressure, wind speed, humidity, precipitation or air water vapor concentration measured in real time.

[0064] In this step, the above preprocessing includes preprocessing operations such as noise reduction, missing value filling and normalization on the time series data.

[0065] In this embodiment, the temporal encoder is designed by a contrastive learning algorithm, and the temporal encoder is designed by aligning temporal embedding and text embedding.

[0066] In this embodiment, the contrast loss function of the temporal encoder is expressed by the following formula:

[0067]

[0068] in, is the contrast loss function, e is the embedding representation of the segmented sequence, and e + is the embedding representation of the positive sample data, e - is the embedding representation of negative sample data, φ is the similarity calculation between the embedding representations of two segmented sequences, which is implemented by a similarity function with a temperature coefficient parameter, i is the batch, and B is the maximum batch value.

[0069] In this embodiment, when obtaining new time series data Then, the statistical information such as the mean and variance corresponding to the new time series data is calculated.

[0070] In this embodiment, the statistical information (mean, variance) and time series features of the time series are embedded in the representation The second prompt word is constructed by splicing to provide timing feature information for multi-task timing analysis of the large model.

[0071] Step 130: Obtain a target instruction according to the timing analysis task, the first prompt word, and the second prompt word, and perform timing reasoning and decoding on the target instruction based on the large model to obtain a decoding result.

[0072] In this step, the target instruction can be obtained by splicing the timing analysis task, the first prompt word and the second prompt word.

[0073] In this embodiment, a complete target instruction Prompt is input into the large model, and the large model can perform reasoning based on professional knowledge content (first prompt word) and timing data features (second prompt word), output timing analysis results, and decode the timing analysis results through the timing decoder corresponding to the timing encoder to obtain a decoding result.

[0074] In this embodiment, the above-mentioned big model includes a local big model, GPT4 or a "Wenxinyiyan" model, etc. This embodiment does not train the big model, but enhances the timing analysis capability of the big model through prompts.

[0075] The knowledge-enhanced large model-driven multi-task time series analysis method provided in the embodiment of the present invention determines the target knowledge retrieval subgraph from the domain knowledge graph through the keywords in the time series analysis task, and prunes and optimizes the target knowledge retrieval subgraph to obtain a first prompt word; preprocesses the time series data collected in real time, and performs time series encoding on the segmented sequence corresponding to the new time series data, obtains the second prompt word according to the statistical information and time series characteristics corresponding to the new time series data, obtains the target instruction according to the time series analysis task, the first prompt word and the second prompt word, and performs time series reasoning and decoding on the target instruction to obtain a decoding result, thereby improving the accuracy of multi-task time series analysis, and realizing comprehensive, accurate, highly reliable, interpretable and scalable large model multi-task time series analysis, which is helpful to realize intelligent optimization decision-making of multi-task time series analysis based on knowledge engineering and large models, and has important application value in scenarios such as industrial process monitoring, smart traffic scheduling, and financial risk assessment.

[0076] In some embodiments, the domain knowledge graph is obtained through the following steps: obtaining text data related to time series analysis in the target domain from multiple data sources; performing text denoising, word segmentation, part-of-speech tagging, stop word removal, and special character removal on the text data to obtain new text data; performing entity recognition and relationship extraction on the multiple new text data according to a large model to obtain multiple triple data, where each triple data source includes a head entity, a relationship, and a tail entity; performing entity alignment on the different multiple triple data to obtain the domain knowledge graph.

[0077] In this embodiment, different triple structures include a head entity, a relationship, and a tail entity. For example, for a set of triple structures <A meteorological station, longitude and latitude, (55°N, 11°E)>, the head entity can be "A meteorological station", the tail entity can be "(55°N, 11°E)", and the relationship between the two is "longitude and latitude". The information contained in this triple is "The longitude and latitude of A meteorological station is (55°N, 11°E)".

[0078] In this embodiment, the system corresponding to the domain knowledge graph includes a multi-source knowledge acquisition and integration module, a domain knowledge graph construction and fusion module based on a large model, and a domain knowledge graph storage and update module; the domain knowledge graph system is constructed through the following steps:

[0079] I. Multi-source knowledge acquisition and integration module: Develop a connection interface between the system and the scientific research database, and obtain technical documents, reports, specifications, and books related to time series analysis in the specified domain from multiple data sources. Clean and preprocess the obtained text data, including text denoising, word segmentation, part-of-speech tagging, stop word removal, and special character removal, to ensure the accuracy and consistency of the data.

[0080] II. Domain knowledge graph construction and fusion module based on a large model: (1) For each preprocessed text data, use the large model for entity recognition and relationship extraction, and output a list of <head entity, relationship, tail entity> triples as the domain knowledge graph generated by single-text construction based on the large model; (2) Perform entity alignment on different single-text domain knowledge graphs to fuse the description information about the same entity or concept from multiple sources; for two entities e1 and e2 that need to verify entity alignment, perform embedding representation on them through the BERT model, which are <w 11 , w 12 , …, w 1n > and <w 21 , w 22 , …, w 2n >, and then perform entity alignment judgment based on the cosine similarity. The entity alignment similarity calculation formula is:

[0081]

[0082] Among them, sim cos (e1,e2) represents the cosine similarity between e1 and e2; when the entity alignment similarity sim cos If (e1, e2) is greater than a preset threshold s, the two entities are considered to belong to the same entity, and their relationship is aligned and merged to achieve the fusion of the two knowledge graphs; (3) a unified domain knowledge graph G = (E, R, F) is obtained, where E = {e1, e2, …, e |E|} and R = {r1, r2, …, r |R|} are the sets of entities and relations respectively, |E| and |R| are the number of entities and relations in the graph, and F={(h,r,t)|h,t∈E; r∈R} represents the set of <head entity, relation, tail entity> triples.

[0083] 3. Domain knowledge graph storage and update module: The constructed domain knowledge graph is stored in the server internal database or external database in the form of a resource description framework (RDF) graph. A timed data update mechanism is designed so that the system can regularly obtain the latest relevant data from the scientific research database and perform incremental updates on the domain knowledge graph.

[0084] Figure 2 This is a weather knowledge graph display diagram provided by the present invention. Figure 2 In the illustrated embodiment, the head entity may be "Weather Station A", and the corresponding tail entity includes thermodynamic temperature, air pressure, wind speed, relative humidity, water vapor concentration, precipitation, (55°N, 11°E), flat terrain, far from the ocean, temperate continental climate and temperature, etc. The corresponding relationships include indicators, longitude and latitude, topography, climate, and the tail entity may also serve as the head entity of a new triplet of data. The corresponding tail entities include the "urban heat island" phenomenon, obvious seasonality, drought and little rain, severe cold in winter, hot in summer, and large annual changes in temperature.

[0085] The multi-task time series analysis method driven by a knowledge-enhanced big model provided in an embodiment of the present invention obtains text data related to time series analysis in a target domain from multiple data sources; performs text denoising, word segmentation, part-of-speech tagging, and removal of stop words and special-care characters on the text data to obtain new text data; performs entity recognition and relationship extraction on multiple new text data according to the big model to obtain multiple first triplet data; performs entity alignment on different first triplet data to obtain a domain knowledge graph, uses the big model to efficiently construct the domain knowledge graph, and uses knowledge retrieval technology to generate professional and authoritative knowledge prompt words, which can assist the time series reasoning of the big model and provide explainability for the analysis results.

[0086] In some embodiments, time series encoding is performed on a segmented sequence corresponding to new time series data according to a time series encoder to obtain time series features, including: performing sliding window processing on the new time series data to obtain multiple non-overlapping segmented sequences; performing data enhancement on the segmented sequence to obtain positive sample data corresponding to the segmented sequence, adding noise and scaling to the segmented sequence to obtain negative sample data corresponding to the segmented sequence, and obtaining a target sample based on the segmented sequence, the positive sample data and the negative sample data; encoding the target sample based on the time series encoder to obtain time series features.

[0087] In this embodiment, the temporal encoder is able to align the encoded time series with the semantic space of the large model.

[0088] Figure 3 is a schematic diagram of the temporal feature codec based on contrastive learning provided by the present invention. Figure 3 In the embodiment shown, the preprocessed new time series data is first segmented, and the new time series data is segmented by sliding window processing. Divide into K non-overlapping subsequences The token list of the time series x; then use the subsequence z as the anchor data for contrastive learning, and obtain the positive sample data z through data enhancement + , by adding noise and scaling to obtain negative sample data z - , and use z, z + and z - Construct the target sample, and finally map each token to the M-dimensional representation space through the temporal encoder Get the corresponding time series characteristics.

[0089] In this embodiment, the contrast loss function of the temporal encoder is expressed by the following formula:

[0090]

[0091] in, is the contrast loss function, e is the embedding representation of the segmented sequence, and e + is the embedding representation of the positive sample data, e - is the embedding representation of negative sample data, φ is the similarity calculation between the embedding representations of two segmented sequences, which is implemented by a similarity function with a temperature coefficient parameter, i is the batch, and B is the maximum batch value; where φ is expressed by the following formula:

[0092]

[0093] Among them, sim() is the similarity calculation function (cosine similarity), and γ is the temperature coefficient during training.

[0094] The knowledge-enhanced large model-driven multi-task time series analysis method provided in the embodiment of the present invention performs sliding window processing on new time series data to obtain multiple non-overlapping segmented sequences; performs data enhancement on the segmented sequences to obtain positive sample data corresponding to the segmented sequences, obtains negative sample data corresponding to the segmented sequences by adding noise and scaling to the segmented sequences, and obtains target samples based on the segmented sequences, positive sample data and negative sample data; encodes the target samples based on the time series encoder to obtain time series features, which can fully mine the potential dependency information of the time series data and provide an accurate and effective data basis for subsequent time series analysis.

[0095] In some embodiments, determining a target knowledge retrieval subgraph from a domain knowledge graph based on keywords in a timing analysis task includes: extracting keywords in the timing analysis task using a large model to generate a SPARQL query command; inputting the SPARQL query command into a query engine of a database, performing query matching on the domain knowledge graph, and obtaining a target knowledge retrieval subgraph; pruning and optimizing the target knowledge retrieval subgraph to obtain a first prompt word includes: performing similarity calculation on triple data corresponding to the keywords of the timing analysis task and the target knowledge retrieval subgraph to obtain a calculation result, and pruning and optimizing the knowledge retrieval subgraph based on a similarity threshold and the calculation result to obtain a first prompt word.

[0096] Figure 4 is a schematic diagram of an interface for obtaining a first prompt word provided by the present invention. Figure 4 In the embodiment shown, the target knowledge retrieval subgraph and the first prompt word are obtained through the following steps:

[0097] (1) Describe the time series analysis task in natural language, for example, "This is a time series data about the hourly electricity consumption of a community in Haidian District in summer. Predict the change of this variable at 96 time points in the future." Use the big model to extract the keywords in the task description and generate the corresponding SPARQL query command. Input the SPARQL query command into the query engine of the database, perform query matching on the domain knowledge graph, and obtain the target knowledge retrieval subgraph related to the task.

[0098] (2) The similarity is calculated between each triple in the task description statement and the target knowledge retrieval subgraph to achieve pruning optimization of the knowledge retrieval subgraph, retaining only the top-k knowledge triples most relevant to the task requirements and using them as the first prompt words to provide prior knowledge guidance for large models to perform multi-task timing analysis.

[0099] In this embodiment, the similarity threshold and the value of k can be set according to user requirements, for example, k=30.

[0100] The multi-task time series analysis method driven by a knowledge-enhanced large model provided in an embodiment of the present invention calculates the similarity between each second triplet data and the corresponding third triplet data to obtain a calculation result, and prunes and optimizes the knowledge retrieval subgraph according to the similarity threshold and the calculation result to obtain the first prompt word, thereby reducing data redundancy in the time series analysis task and improving the model calculation speed.

[0101] In some embodiments, performing timing reasoning and decoding on the target instruction to obtain a decoding result includes: performing step-by-step reasoning on the target instruction according to a preset number of steps based on a large model to obtain an inference result; and decoding the timing feature embedding part corresponding to the inference result according to a timing decoder to obtain a decoding result.

[0102] In this embodiment, a multi-task time series analysis system based on a large model is designed to perform timing reasoning and decoding on the target instruction, wherein the multi-task time series analysis system based on a large model includes a large model timing analysis reasoning module and a timing reasoning result decoding module. The specific steps of performing timing reasoning and decoding on the target instruction using the multi-task time series analysis system based on a large model are as follows:

[0103] (1) Large model timing analysis reasoning module: The timing analysis task, the first prompt word, and the second prompt word are spliced ​​together to form a complete target instruction Prompt, which is input into the large model. The large model can perform reasoning based on professional knowledge content (first prompt word) and timing data features (second prompt word) and output timing analysis results.

[0104] It should be noted that the large model used in this application can perform "step-by-step analysis" on the target instructions to guide the large model to perform multi-step reasoning and enhance the interpretability of the reasoning results.

[0105] (2) Time series reasoning result decoding module: For the time series feature embedding part in the output result of the large model, a pre-trained time series decoder is used to decode it to obtain the final time series analysis result, that is, the decoding result.

[0106] Specifically, the time series decoder is trained according to the principle of the autoencoder and is used for decoding and restoring the output results of the subsequent time series analysis; the loss function calculation formula for the training of the time series decoder f is as follows:

[0107]

[0108] The knowledge-enhanced large model-driven multi-task time series analysis method provided in an embodiment of the present invention uses a large model to gradually infer the target instruction according to a preset number of steps to obtain an inference result; and decodes the timing feature embedding part corresponding to the inference result according to the timing decoder to obtain a decoding result.

[0109] In some embodiments, after obtaining the decoding result, the method further includes: displaying the decoding result in a target form, where the target form includes at least one of a number, a graph, and a table.

[0110] Specifically, the above-mentioned multi-task time series analysis system based on a large model also includes a visualization result display module, which can display the time series analysis task results (decoding results) in the form of numbers, charts, etc. through a visual interactive interface. At the same time, it can also briefly display the large model reasoning process in text form to improve the credibility of the time series analysis task results.

[0111] In this embodiment, the database can also be linked in the interface so that the user can intuitively understand the domain knowledge graph used.

[0112] Figure 5 is a flowchart of target instruction decoding and visual display provided by the present invention. Figure 5 In the illustrated embodiment, the timing analysis task, the first prompt word, and the second prompt word are spliced ​​to form a complete target instruction Prompt, which is input into the big model. The big model can perform reasoning based on the professional knowledge content (first prompt word) and the timing data features (second prompt word), output the timing analysis results, and decode the timing analysis results (Decoder) to obtain the decoding results, and visualize the decoding results on the visualization display platform.

[0113] The knowledge-enhanced large model-driven multi-task time series analysis method provided in an embodiment of the present invention realizes a visual display of the multi-task timing series analysis process by displaying the decoding results in the form of at least one of numbers, graphs and tables.

[0114] The multi-task time series analysis system driven by the knowledge-enhanced large model provided by the present invention is described below. The multi-task time series analysis system driven by the knowledge-enhanced large model described below and the multi-task time series analysis method driven by the knowledge-enhanced large model described above can be referenced to each other.

[0115] Figure 6 This is one of the structural diagrams of the multi-task time series analysis system driven by the knowledge-enhanced large model provided by the present invention, such as Figure 6 As shown, the knowledge-enhanced large model-driven multi-task time series analysis system includes: a first prompt word acquisition module 610, a second prompt word acquisition module 620 and a decoding module 630.

[0116] The first prompt word acquisition module 610 is used to determine the target knowledge retrieval subgraph from the domain knowledge graph according to the keywords in the time series analysis task, and prune and optimize the target knowledge retrieval subgraph to obtain the first prompt word; the domain knowledge graph is obtained based on the cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis;

[0117] The second prompt word acquisition module 620 is used to pre-process the time series data collected in real time to obtain new time series data, and perform time series encoding on the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; obtain the second prompt word according to the statistical information and time series features corresponding to the new time series data; wherein the time series encoder is determined based on a contrastive learning algorithm;

[0118] The decoding module 630 is used to obtain the target instruction according to the timing analysis task, the first prompt word and the second prompt word, and perform timing reasoning and decoding on the target instruction based on the large model to obtain a decoding result.

[0119] The knowledge-enhanced large-model driven multi-task time series analysis system provided in the embodiment of the present invention determines the target knowledge retrieval subgraph from the domain knowledge graph through the keywords in the time series analysis task, and prunes and optimizes the target knowledge retrieval subgraph to obtain a first prompt word; preprocesses the time series data collected in real time, and performs time series encoding on the segmented sequence corresponding to the new time series data, obtains the second prompt word according to the statistical information and time series characteristics corresponding to the new time series data, obtains the target instruction according to the time series analysis task, the first prompt word and the second prompt word, and performs time series reasoning and decoding on the target instruction to obtain a decoding result, thereby improving the accuracy of multi-task time series analysis, realizing comprehensive, accurate, highly reliable, interpretable and scalable large-model multi-task time series analysis, and helping to realize intelligent optimization decision-making of multi-task time series analysis based on knowledge engineering and large models, and has important application value in scenarios such as industrial process monitoring, smart traffic scheduling, and financial risk assessment.

[0120] Figure 7 This is the second structural diagram of the multi-task time series analysis system driven by the knowledge-enhanced large model provided by the present invention. Figure 7In the illustrated embodiment, the knowledge-enhanced big model-driven multi-task time series analysis system also includes a domain knowledge graph construction and update system, a prompt word construction system combining domain knowledge and temporal features, and a multi-task time series analysis system based on the big model; specifically, the domain knowledge graph construction and update system includes a multi-source knowledge acquisition and integration module, a domain knowledge graph construction and fusion module based on the big model, and a domain knowledge graph storage and update module; the prompt word construction system combining domain knowledge and temporal features includes a first prompt word construction module based on knowledge graph retrieval and a second prompt word construction module based on temporal features of contrastive learning; the multi-task time series analysis system based on the big model includes a big model temporal analysis reasoning module, a temporal reasoning result decoding module, and a visualization result display module.

[0121] Figure 8 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 8 As shown, the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute the multi-task time series analysis method driven by the knowledge-enhanced large model, which includes: determining the target knowledge retrieval subgraph from the domain knowledge graph according to the keywords in the time series analysis task, and pruning and optimizing the target knowledge retrieval subgraph to obtain a first prompt word; the domain knowledge graph is obtained based on the cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion processing of text data related to the time series analysis; preprocessing the time series data collected in real time to obtain new time series data, and time series encoding the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; obtaining a second prompt word according to the statistical information and time series features corresponding to the new time series data; wherein the time series encoder is determined based on a contrastive learning algorithm; obtaining a target instruction according to the time series analysis task, the first prompt word and the second prompt word, and performing time series reasoning and decoding on the target instruction based on the large model to obtain a decoding result.

[0122] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0123] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the knowledge-enhanced large model-driven multi-task time series analysis method provided by the above methods, the method including: determining a target knowledge retrieval subgraph from a domain knowledge graph according to keywords in the time series analysis task, and pruning and optimizing the target knowledge retrieval subgraph to obtain a first prompt word; the domain knowledge graph is obtained based on cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis; preprocessing the time series data collected in real time to obtain new time series data, and time-series encoding the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; obtaining a second prompt word according to the statistical information and time series features corresponding to the new time series data; wherein the time series encoder is determined based on a contrastive learning algorithm; obtaining a target instruction according to the time series analysis task, the first prompt word and the second prompt word, and performing time series reasoning and decoding on the target instruction based on the large model to obtain a decoding result.

[0124] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the knowledge-enhanced large model-driven multi-task time series analysis method provided by the above-mentioned methods, the method comprising: determining a target knowledge retrieval subgraph from a domain knowledge graph according to keywords in the time series analysis task, and pruning and optimizing the target knowledge retrieval subgraph to obtain a first prompt word; the domain knowledge graph is obtained based on cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis; preprocessing the time series data collected in real time to obtain new time series data, and time series encoding the segmented sequence corresponding to the new time series data according to a time series encoder to obtain time series features; obtaining a second prompt word according to the statistical information and time series features corresponding to the new time series data; wherein the time series encoder is determined based on a contrastive learning algorithm; obtaining a target instruction according to the time series analysis task, the first prompt word and the second prompt word, and performing time series reasoning and decoding on the target instruction based on the large model to obtain a decoding result.

[0125] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these 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.

Claims

1. A knowledge-enhanced large model-driven multi-task time series analysis method, characterized in that: include: Determine a target knowledge retrieval subgraph from the domain knowledge graph according to the keywords in the time series analysis task, and perform pruning optimization on the target knowledge retrieval subgraph to obtain a first prompt word; The domain knowledge graph is obtained based on cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis; Preprocessing the time series data collected in real time to obtain new time series data, and performing time series encoding on the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; Obtaining a second prompt word according to the statistical information corresponding to the new time series data and the time series feature; wherein the time series encoder is determined based on a contrastive learning algorithm; A target instruction is obtained according to the timing analysis task, the first prompt word and the second prompt word, and timing reasoning and decoding are performed on the target instruction based on a large model to obtain a decoding result.

2. The multi-task time series analysis method driven by a knowledge-enhanced large model according to claim 1 is characterized in that: The domain knowledge graph is obtained through the following steps: Acquire text data relevant to time series analysis in the target domain from multiple data sources; Performing text denoising, word segmentation, part-of-speech tagging, and removal of stop words and special-care characters on the text data to obtain new text data; Perform entity recognition and relationship extraction on multiple new text data according to the large model to obtain multiple triple data. Each triple data source includes a head entity, a relationship, and a tail entity. Entity alignment is performed on the multiple triple data to obtain the domain knowledge graph.

3. The multi-task time series analysis method driven by a knowledge-enhanced large model according to claim 1 is characterized in that: The performing time series encoding on the segment sequence corresponding to the new time series data according to the time series encoder to obtain the time series features includes: Performing sliding window processing on the new time series data to obtain multiple non-overlapping segmented sequences; Performing data enhancement on the segmented sequence to obtain positive sample data corresponding to the segmented sequence, obtaining negative sample data corresponding to the segmented sequence by adding noise and scaling to the segmented sequence, and obtaining a target sample according to the segmented sequence, the positive sample data and the negative sample data; The target sample is encoded based on the time series encoder to obtain the time series feature.

4. The multi-task time series analysis method driven by a knowledge-enhanced large model according to any one of claims 1 and 3, characterized in that: The contrast loss function of the temporal encoder is expressed as follows: in, is the contrast loss function, e is the embedding representation of the segmented sequence, and e + is the embedding representation of the positive sample data, e - is the embedding representation of negative sample data, φ is the similarity calculation between the embedding representations of two segmented sequences, which is implemented by a similarity function with a temperature coefficient parameter, i is the batch, and B is the maximum value of the batch.

5. The multi-task time series analysis method driven by a knowledge-enhanced large model according to claim 1 is characterized in that: Determining the target knowledge retrieval subgraph from the domain knowledge graph according to the keywords in the time series analysis task includes: Using the big model to extract keywords in the time series analysis task, and generate SPARQL query commands; Inputting the SPARQL query command into the query engine of the database, performing query matching on the domain knowledge graph, and obtaining the target knowledge retrieval subgraph; The pruning optimization of the target knowledge retrieval subgraph to obtain the first prompt word includes: The similarity between the time series analysis task keyword and the triple data corresponding to the target knowledge retrieval subgraph is calculated to obtain a calculation result, and the knowledge retrieval subgraph is pruned and optimized according to the similarity threshold and the calculation result to obtain the first prompt word.

6. The multi-task time series analysis method driven by a knowledge-enhanced large model according to claim 1 is characterized in that: The performing timing reasoning and decoding on the target instruction to obtain a decoding result comprises: According to the large model, the target instruction is reasoned step by step according to a preset number of steps to obtain a reasoning result; The temporal feature embedding part corresponding to the inference result is decoded according to the temporal decoder to obtain the decoding result.

7. The multi-task time series analysis method driven by a knowledge-enhanced large model according to claim 1 is characterized in that: After obtaining the decoding result, the method further includes: The decoding result is displayed in a target form, and the target form includes at least one of a number, a graph and a table.

8. A knowledge-enhanced large model-driven multi-task time series analysis system, characterized in that: include: A first prompt word acquisition module is used to determine a target knowledge retrieval subgraph from a domain knowledge graph according to keywords in a time series analysis task, and to perform pruning optimization on the target knowledge retrieval subgraph to obtain a first prompt word; The domain knowledge graph is obtained based on cleaning, preprocessing, entity recognition, relationship extraction and knowledge graph fusion of text data related to time series analysis; The second prompt word acquisition module is used to preprocess the time series data collected in real time to obtain new time series data, and perform time series encoding on the segmented sequence corresponding to the new time series data according to the time series encoder to obtain time series features; Obtaining a second prompt word according to the statistical information corresponding to the new time series data and the time series feature; wherein the time series encoder is determined based on a contrastive learning algorithm; A decoding module is used to obtain a target instruction according to the timing analysis task, the first prompt word and the second prompt word, and to perform timing reasoning and decoding on the target instruction based on a large model to obtain a decoding result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the multi-task time series analysis method driven by the knowledge-enhanced large model as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the multi-task time series analysis method driven by a knowledge-enhanced large model as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Time sequence anomaly detection method based on single-class comparative learning and related device

    CN114580656A

  • Large model reasoning analysis method, system and product based on external knowledge enhancement

    CN117575026A

Cited By

  • Anomaly detection algorithm selection method for cloud monitoring knowledge enhancement time series

    CN119066557A

  • Robot operation task planning method and system based on knowledge graph and large model

    CN119761514A

  • Traditional Chinese medicine prescription data analysis method and device based on OCR (Optical Character Recognition) and large model

    CN119811698A