A Fire Fighting Q&A Method, System and Storage Medium for an AI Large Language Model

Through the fire protection Q&A system of AI large language model, the interface type is automatically identified and the area category knowledge base is called for content similarity search, which solves the problems of medium and high costs and professional thresholds in the field of fire emergency, and realizes efficient and accurate information acquisition and multiple rounds of dialogue interaction.

CN119646274BActive Publication Date: 2025-07-25杭州峰景科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411819763.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-07-25
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

The existing knowledge graph and label system in the field of fire emergency has high cost, high professional threshold, low efficiency and accuracy, making it difficult for grassroots personnel to raise accurate questions, resulting in low information acquisition efficiency and insufficient accuracy.

Method used

Using the AI large language model, through front-end module, AI preprocessing thread pool, knowledge base module and large-model computing engine module, the interface type is automatically identified, and the area category knowledge base is called for content similarity search, realizing professional Q&A without keyword input, combining multiple rounds of dialogue and parallel processing, supporting multi-user concurrency.

Benefits of technology

It reduces the workload of data governance, reduces costs, improves query efficiency and accuracy, supports multiple rounds of dialogue, conforms to human questioning habits, adapts to the scale of the knowledge base, and achieves seamless language interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646274B_ABST
    Figure CN119646274B_ABST
Patent Text Reader

Abstract

The present invention discloses a fire fighting Q&A method, system and storage medium for an AI large language model, which relates to the field of artificial intelligence technology. It includes a front-end module, an AI preprocessing thread pool, a knowledge base module and a large model computing engine module. The AI preprocessing thread pool receives the service requests sent from the front-end module, allocates different task threads, automatically calls the knowledge base of the corresponding regional category for content similarity retrieval according to the regional category input in the service request, and organizes and uniformly sends the retrieved knowledge content data and the corresponding service requests to the large model computing engine module that supports parallel processing for analysis and calculation. By using the technical means of the present invention, users do not need to think about what the keywords of the current question are. They can completely organize questions according to the actual on-site situation, directly ask questions, automatically query the local professional knowledge base, and give professional and accurate answers, realizing true barrier-free communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and specifically to a fire fighting Q&A method, system and storage medium for an AI large language model, aiming to improve the efficiency of information acquisition and decision-making support in fire fighting emergency scenarios through advanced language models and knowledge processing technologies. Background Technique

[0002] The field of emergency fire fighting is a highly professional field, involving a large number of complex laws, regulations, operation specifications and work experience data. The main contradiction currently faced is the mismatch between the speed of skill improvement of grass-roots personnel and the urgent need for professional talents by grass-roots units and enterprises; the currently more commonly used methods are mainly based on big data technology, by building a knowledge graph of laws and regulations, using label technology to annotate structured data, and combining keyword matching algorithms to achieve data query and knowledge search. For example, for the laws and regulations on the storage requirements of hazardous chemicals, relevant personnel need to first think about and organize problem texts containing professional terms, and then rely on keyword input for data search;

[0003] However, these methods have the following limitations:

[0004] 1. High cost: The construction of knowledge graphs and label systems requires a large amount of human and material resources, with high promotion and application costs, and continuous investment in maintenance is required.

[0005] 2. Professional threshold: A large number of grass-roots staff (such as grid workers, etc.) lack the ability to master professional terms, resulting in difficulty in posing accurate questions during use, and the function is not very user-friendly for non-professional users.

[0006] 3. Low efficiency and accuracy: In actual applications, there are often situations where no suitable knowledge data can be matched, or the matching results deviate from the user's needs, resulting in low knowledge search efficiency and insufficient accuracy.

[0007] Therefore, there is an urgent need for an intelligent, low-threshold and high-efficiency emergency fire fighting Q&A system to better meet the professional needs of grass-roots personnel and enterprises in the field of fire fighting. Summary of the Invention

[0008] The purpose of the present invention is to provide a fire fighting Q&A method, system and storage medium for an AI large language model. Users do not need to think about what the keywords of the current question are. They can completely organize questions according to the actual situation on site and directly ask questions. The industry large language model system can automatically query the local professional knowledge base and give professional and accurate answers, and also conduct secondary and tertiary questions based on the content of the AI answer to achieve true barrier-free communication and effectively obtain professional knowledge in the field of emergency fire fighting, so as to solve the problems raised in the above background technique.

[0009] To achieve the above object, the present invention provides the following technical solution: A fire fighting Q&A method for an AI large language model, including a front-end module, an AI preprocessing thread pool, a knowledge base module, and a large model computing engine module. The AI preprocessing thread pool receives the service requests sent from the front-end module, automatically identifies the type of the interface, performs corresponding interface processing, and allocates different task threads. Different regional knowledge bases are built in the knowledge base module. During the process of the thread executing the task, the knowledge base of the corresponding regional category is automatically called according to the regional category input in the service request for content similarity retrieval. The retrieved knowledge content data and the corresponding service request are sorted out and uniformly sent to the large model computing engine module that supports parallel processing for analysis and calculation to obtain the final answer.

[0010] Preferably, the method for building different regional category knowledge bases in the knowledge base module includes the following steps:

[0011] S101: Data collection and collation. Collect experience data related to the emergency fire fighting field and publicly available laws and regulations text data, and classify and grade the collected data by field and industry and by potential hazard level.

[0012] S102: Text extraction and processing. Extract the text from the classified and graded data, and cut the extracted text into text blocks according to chapters, control the text blocks of each chapter within a set range, and perform multiple cuts for those exceeding the set range.

[0013] S103: Vector calculation of text blocks. Segment the cut text blocks, and at the same time construct an embedding vector with position encoding.

[0014] S104: Picture data extraction and processing. Extract tables and pictures from the classified and graded data, and at the same time convert the table data into pictures, and perform vectorization processing on the obtained picture data.

[0015] S105: Establish a vector knowledge base. Use pre-training to establish an independently usable vector knowledge base from the above text block vectors and picture data vectors.

[0016] Preferably, the system further includes a security defense mechanism module for defensive answering of illegal inputs. The specific defense method is as follows:

[0017] S201: Conduct language conversion verification on the question requests received by the front-end module to avoid malicious attacks through other languages.

[0018] S202: Use a violation term classifier to monitor the input question request. If malicious attack content is detected in the input question request, an early warning will be automatically issued and a prompt indicating that no answer can be given will be directly returned. If the detected input question is benign text content, proceed to the next step.

[0019] S203: Put the detected question into the knowledge base for retrieval. If the corresponding knowledge can be detected, calculate the output answer. If the corresponding knowledge cannot be detected, directly return a prompt indicating that no answer can be given.

[0020] Preferably, the system also includes a multi-round dialogue and concurrent output module that can ensure multi-user memory of historical conversations and provide simultaneous reply services during multi-round Q&A. The specific operation steps are as follows:

[0021] S301: The AI preprocessing thread pool receives several business requests sent by several users to the front-end module at the same time, and the AI preprocessing thread pool configures threads as needed.

[0022] S302: After each user establishes an interactive connection, the interactive record of this round of conversation will be pre-stored. The large model computing engine module does not need to record the information of the previous round of conversation. After the user continues to submit a business request based on the original conversation, the pre-stored interactive record will automatically add the conversation information of the adjacent time.

[0023] S303: The added conversation information of the adjacent time and the current business request are sent to the knowledge base for vector retrieval and matching together. The obtained knowledge content data and the corresponding business request are sorted out and uniformly sent to the large model computing engine module that supports parallel processing for analysis and calculation to output the corresponding answer. Data is sent to multiple users simultaneously within one time series. Multiple users can receive the text in the corresponding answer at the same time, and then in the next time series, continue to receive the text in the corresponding answer until the conversation of a certain user in this round ends.

[0024] Preferably, the vector calculation method of the text block is specifically as follows:

[0025] First, preprocess the text. Select a specific tokenizer to split the text into individual tokens, and at the same time add special Tokens at the beginning and end of the input sequence, and convert the tokenized tokens into corresponding IDs.

[0026] Secondly, truncate the long sequence and pad the short sequence, construct the attention mask and add the position encoding to the embedding vector. The corresponding formula is: Pc(x) = y1 + Pe(x), where x represents the position of the text in the sentence, y1 is the embedding vector, and pe is the position vector. The number of samples in the code is the set number of text blocks. The formula for the position encoding is:

[0027] 。

[0028] Preferably, the content similarity retrieval in the knowledge base module adopts the method of cosine similarity comparison, and the specific steps are as follows:

[0029] Q1: Extract the subject in the input sentence, strengthen the subject, and place it at the beginning of the sentence to form a new sentence;

[0030] Q2: Calculate the position encoding of each Chinese character in the newly formed sentence, add a weight value K greater than 1 to the PE value of the newly added text at the beginning of the original sentence, and when calculating the position encoding PE value of the original sentence and subsequent text, K takes the value of 1. The position encoding formula is as follows:

[0031] ;

[0032] Q3: Select 20 groups of knowledge content data from the results retrieved from the knowledge base, set a scoring mechanism to score each group of knowledge content data, and sort the scoring results at the statistical level;

[0033] Q4: Select the top 10 groups of knowledge after sorting as the knowledge content data obtained by the final similarity calculation.

[0034] Preferably, the value of the position vector is processed by square root or cube root to increase the value of y1 and avoid loss of embedded information.

[0035] Preferably, the front-end module includes a mini-program terminal, a PC terminal and an APP terminal, and the business requests sent include AI question-and-answer requests, knowledge search requests, rectification opinion generation requests, hidden danger decomposition requests and automatic report document generation requests.

[0036] Preferably, the classification of the hidden danger levels from large to small includes: major hidden dangers, key problems, general hidden dangers, and general problems.

[0037] To solve the above technical problems, the present invention also provides a fire protection question-and-answer system for an AI large language model, including:

[0038] A memory for storing a computer program;

[0039] A processor for executing the computer program, and when the computer program is executed by the processor, the steps of a fire protection question-and-answer method for an AI large language model as described in any one of the above are implemented.

[0040] To solve the above technical problems, the present invention also provides a readable storage medium, on which a computer program is stored,

[0041] When the computer program is executed by a processor, it implements the steps of the fire fighting question-answering method of an AI large language model as described in any one of the above.

[0042] In summary, the beneficial effects of the present invention are as follows:

[0043] By using technologies such as professional vector knowledge bases, data augmentation, and general large language models, the present invention further optimizes the querying, searching, extraction, understanding, analysis, and reasoning capabilities of professional data in the field of emergency fire fighting, and can achieve seamless language interaction through human-computer dialogue. Compared with existing technologies such as knowledge graphs and tags, on the one hand, the present invention can reduce the workload of data governance. There is no need for manual data cleaning, standardization, annotation, classification, etc. The data can be directly sent to the AI model, and the AI model can automatically complete all the work that humans need to complete during traditional data governance, realizing rapid data training, rapid application, and rapid deployment. On the other hand, when querying, there is no need to organize professional keywords. Only according to actual needs, use colloquial language for data searching, querying, classification, analysis, and reasoning, etc., and multiple questions can be asked through multiple rounds of dialogue, which is more in line with the habits and logic of human questioning. Compared with traditional technologies using general large models, the present invention does not require large-scale data training, can automatically adapt to the scale of the knowledge base according to the amount of the professional data knowledge base, and supports the simultaneous deployment of multiple knowledge bases in the same system, which is convenient for engineering application implementation, has lower costs, higher efficiency, faster time, wider application, more accurate calculation, and more convenient use. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0045] Figure 1 It is a schematic diagram of the architecture of a fire fighting question-answering method of an AI large language model of the present invention;

[0046] Figure 2 It is a schematic diagram of the framework process of building a knowledge base for a fire fighting question-answering method of an AI large language model of the present invention;

[0047] Figure 3 It is a schematic diagram of the framework of the business request process for a fire fighting question-answering method of an AI large language model of the present invention;

[0048] Figure 4 It is a schematic diagram of the framework of the defensive mechanism process for a fire fighting question-answering method of an AI large language model of the present invention;

[0049] Figure 5 Schematic diagram of the multi-round dialogue and concurrent output process framework for the fire fighting Q&A method of an AI large language model of the present invention;

[0050] Figure 6 Schematic diagram of the Pe distribution of the Chinese character "Feng" in the embodiment of the fire fighting Q&A method of an AI large language model of the present invention. Detailed implementation manners

[0051] Now, the present invention will be further described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention. These drawings are all simplified schematic diagrams, only illustrating the basic structure of the present invention in a schematic manner, and therefore only showing the components related to the present invention.

[0052] To facilitate the understanding of the present invention, the present invention will be described more comprehensively with reference to the relevant accompanying drawings. The accompanying drawings give several embodiments of the present invention. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0053] All features disclosed in this specification, or all steps in the disclosed methods or processes, except for mutually exclusive features and / or steps, can be combined in any way.

[0054] Any feature disclosed in this specification (including any additional claims, abstract, and drawings), unless specifically stated, can be replaced by other equivalent or similar-purpose alternative features. That is, unless specifically stated, each feature is only an example of a series of equivalent or similar features.

[0055] In the present invention, unless otherwise clearly defined and limited, terms such as "installation", "connection", "connection", "fixation", etc. shall be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium. It can be the communication inside at least two elements or the interaction relationship between at least two elements, unless otherwise clearly limited. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0056] The following is combined with Figure 1-6The present invention is described in detail. An embodiment of the present invention is: a fire protection question-answering method of an AI large language model, comprising a front-end module, an AI preprocessing thread pool, a knowledge base module and a large model computing engine module. When a user asks a question, the front-end module receives the user's question and sends a business request to the background service, wherein the business request will first be classified by a security defense mechanism module for defensive answers to illegal inputs, and then the AI preprocessing thread pool will receive the business request issued by the front-end module, automatically identify the type of interface, perform corresponding interface processing, and allocate different task threads. Knowledge bases of different regional categories are built in the knowledge base module. During the thread execution of the task, the knowledge base of the corresponding regional category is automatically called according to the regional category input by the business request to perform content similarity retrieval, and the retrieved knowledge content data and the corresponding business request are sorted and sent to the large model computing engine module that supports parallel processing for analysis and calculation to obtain the final answer.

[0057] refer to Figure 1 , the specific operation steps in the entire large model system are as follows:

[0058] Step 1: The front-end modules, mainly the mini-program end, PC end, and APP end, initiate AI question-answering requests to the back-end service. The request protocols are HTTP, TCP, and other protocols. The front-end requests include: AI question-answering requests, knowledge search requests, rectification opinion generation requests, hidden danger dismantling requests, automatic generation of report documents, and other business requests;

[0059] Step 2: After the background receives the request from the mini program, PC, or APP, it sends the request to the AI preprocessing thread pool. The thread pool can flexibly configure the number of threads based on the number of calls. When the concurrency exceeds the preset value, the system can implement clustered deployment to meet the system concurrency requirements. After receiving a request from any front-end, the system automatically identifies the type of interface, processes the interface, and assigns it to different task threads.

[0060] Step 3: Different tasks are executed by different threads, and the knowledge base in the field of emergency firefighting is called to perform content similarity retrieval to obtain professional knowledge. The system can automatically call different types of knowledge bases according to the regional category input by the front end. For example, a request from Zhejiang can call the knowledge base in Zhejiang (pre-trained), and a request from Sichuan can call the knowledge base in Sichuan;

[0061] Step 4: After the threads executing the tasks organize the problems and the retrieved knowledge data, they uniformly push them to the large model computing engine module for analysis and calculation to obtain the final answer. Considering that it takes 2 to 10 seconds for the large model computing engine to output the answer (corresponding time is required according to the number of words in the output answer), AI supports parallel processing. After multiple users initiate requests simultaneously, according to the multi-round dialogue and concurrent output module, the system can output answers in the form of text streams to multiple users simultaneously to ensure the overall concurrent effect of the system.

[0062] It is worth mentioning that, referring to Figure 2 , in this embodiment, a specific method for building a knowledge base is also provided, including the following steps:

[0063] S101: Data collection and organization. Organize and collect the experience data in the field of emergency fire protection accumulated by the company, and organize and collect the laws and regulations documents published on the Internet and government public websites sorted out by the company. At the same time, classify them according to fields, and the classification types include: fields such as hazardous chemicals, construction, industry and trade, fire protection, road traffic, sea and fishing, tourism, urban operation, etc.;

[0064] Classify the data according to industries, and the classification types include: agriculture, forestry, animal husbandry, and fishery industries, mining industries, manufacturing industries, electric power industries, construction industries, transportation, warehousing and postal industries, information transmission, computer services and software industries, wholesale and retail industries, accommodation and catering industries, financial industries, real estate industries, leasing and business service industries, scientific research, technical services and geological exploration industries, water conservancy, environment and public facilities management industries, resident service and other service industries, education industries, health, social security and social welfare industries, culture, sports and entertainment industries, etc.;

[0065] Grade the data, and the grading types include: multiple levels such as major hidden dangers, key problems, general hidden dangers, general problems, etc.;

[0066] S102: Text extraction and processing. Extract text from the classified and graded data, extract all the text, divide the extracted text into blocks according to chapters, cut the large number of text at the chapter level into text squares one by one. If it is found that the number of words in a square is greater than 512, further processing is required, and the number of words in each word block cannot be greater than 512. For the word blocks with the number of words greater than 512, perform multiple cuts;

[0067] S103: Vector calculation of text blocks. Segment the segmented text blocks, and at the same time construct embedding vectors with positional encoding;

[0068] S104: Image data extraction and processing. Extract tables and images from the classified and graded data. At the same time, convert the table data into images, perform vectorization processing on the obtained image data. The image vectorization is encoded using Base64 code, and then use the encoded data as input and calculate the vector value of the image using the method in step S103.

[0069] S105: Establish a vector knowledge base. Use pre-training to establish an independent vector knowledge base for the above text block vectors and image data vectors.

[0070] It should be noted that in this embodiment, the present invention also provides a specific method for calculating text block vectors:

[0071] 1) Text preprocessing, including lowercase conversion, removing extra spaces, special character processing, etc.;

[0072] 2) Select a specific tokenizer and use the tokenizer to split the text into individual tokens;

[0073] 3) Add special tokens at the beginning and end of the input sequence;

[0074] 4) Convert the tokenized tokens into corresponding IDs, truncate long sequences, and pad short sequences;

[0075] 5) Construct an attention mask and positional encoding. The formula for positional encoding is as follows:

[0076] ;

[0077] The corresponding code is:

[0078] def FJ_Positional_Encoding(pos, pe):

[0079] for i in range(0,512,2):

[0080] pe[0][i] =math.sin(pos / (10000) ** ((2*i) / d_model)))

[0081] pe[0][i+1] =math.cos(pos / (10000) ** ((2*i) / d_model)))

[0082] return pe

[0083] Hypothetical sentence: For Hangzhou Fengjing Technology Co., Ltd., the 3rd Chinese character is: "Feng". Then the position pos of "Feng" is 2 (the pos of the first Chinese character is 0). Therefore, the distribution diagram of the Chinese character "Feng" is (pe value), for reference Figure 6 :

[0084] Finally, add the position encoding into the embedding vector. The corresponding formula is: Pc(x) = y1 + Pe(x),

[0085] where x represents the position of the character in the sentence, y1 is the embedding vector, pe is the position vector, and the number of sampling points in the code is 512.

[0086] In the traditional method, since the pe value is much larger than y1, it may drown out y1, resulting in the loss of embedding information. The method adopted in the present invention is to perform square root and cube root processing on the pe value to increase the value of y1 and avoid the loss of embedding information;

[0087] It is also worth mentioning that in this embodiment, a method for content similarity retrieval in the knowledge base module is also provided. Specifically, cosine similarity comparison is used. It should be noted that in the traditional method, only the cosine similarity of two groups of vectors is calculated, and the following problems will occur:

[0088] Sentence A: What is the maximum speed limit of a bicycle?

[0089] Sentence B: What is the maximum speed limit of a car?

[0090] The similarity degree of these two sentences is very high. However, in actual situations, these two sentences need to be distinguished.

[0091] Therefore, a more advanced and practical method is adopted in this embodiment:

[0092] 1) Use an AI model to extract the subject in the sentence. For example, the nouns extracted from Sentence A are: bicycle, speed; the nouns extracted from Sentence B are: car, speed;

[0093] 2) Strengthen the subject and place it at the beginning of the sentence. For example, Sentence A becomes: This is a question about bicycle and speed. What is the maximum speed limit of a bicycle?

[0094] 3) When calculating the position encoding of each Chinese character in the sentence, add a weight K greater than 1 to the PE value of the first paragraph of text (for example, Sentence A: This is a question about bicycle and speed). By adjusting this K value, the weight of the subject in the question can be strengthened. The specific situation is as follows:

[0095] ;

[0096] 4) When calculating the position encoding PE value for the text in the second and subsequent segments of the sentence, K is taken as 1;

[0097] 5) Use the initial vector retriever to select 20 groups of knowledge from the massive vector knowledge base, and adopt a self-developed scoring mechanism to score each group of knowledge selected from the knowledge base;

[0098] 6) Perform statistical-level sorting and selection on the scoring results, and select the top 10 groups of knowledge after sorting as the knowledge obtained from the final similarity calculation.

[0099] Reference Figure 4 , in addition, in one embodiment, the security defense mechanism module performs defensive answers for malicious questions, illegal question text inputs, etc., to ensure the legality and compliance of the system's answer output. The specific steps are as follows:

[0100] Step 1: The front end receives the question request proposed by the user.

[0101] Step 2: Based on the capabilities of the large model, convert it into foreign languages such as English, French, Japanese, German, Spanish, Russian, Italian, etc., to prevent malicious attacks through common languages such as English.

[0102] Step 3: Generate a Base64 code for the text to prevent malicious language attacks on the large model through text encoding input.

[0103] Step 4: Use a prohibited term classifier to monitor malicious and benign texts for the input language and identify malicious attack text inputs;

[0104] Step 5: If malicious attack content is detected in the input question, an automatic warning is issued;

[0105] Step 6: Detect that the input question is benign text content;

[0106] Step 7: Detect whether knowledge can be found in the knowledge base for the question raised;

[0107] Step 8: For the question raised by the user, if the corresponding knowledge is detected in the knowledge base, calculate the output answer.

[0108] Step 9: If Step 5 is triggered, or no corresponding knowledge is found in Step 7, directly return a prompt indicating that no answer can be given.

[0109] Reference Figure 5, additionally, in one embodiment, since the current AI industry model system includes modules such as a vector knowledge base, a vector matching recognition and retrieval module, a malicious attack defense, and a general large model computing engine, the internal data calls and interface calls are relatively complex. Therefore, the present invention designs a set of mechanisms that overall ensure multiple users can ask questions simultaneously, the AI industry model system can answer in parallel, the answer output simulates the typewriter text stream effect, and it can satisfy the multi-round conversation by remembering the previous conversations;

[0110] The multi-round conversation and concurrent output module can ensure that when multiple users remember the historical conversations and conduct multi-round Q&A, it can provide simultaneous reply services. The specific operation steps are as follows:

[0111] Step 1: User A asks a question to the industry large language model system. At the same time, within 1 second, User B, User C,..., User N also ask questions to the industry large language model system;

[0112] Step 2: After the industry large language model system receives the questions from User A, User B, User C,..., User N, the system thread pool will configure threads as needed to carry the tasks of module calculations, including vector search, knowledge matching, computing engine, and data stream output, etc.

[0113] Step 3: After each user establishes an interactive connection with the industry large language model system, it will pre-store the interaction records of this round of conversation. The large model computing engine module does not need to record the information of the previous round of conversation. After the user continues to ask questions based on the original conversation, the pre-stored interaction records will automatically add the conversation information of the previous several rounds for the user's conversation and interact with the industry large language model system to achieve multi-user and multi-round conversation interaction.

[0114] Step 4: A separate data stream output module is set in the industry large language model system. The conversation information and the current business request are sent into the knowledge base for vector retrieval and matching together. The obtained knowledge content data and the corresponding business request are sorted and then uniformly sent to the large model computing engine module that supports parallel processing for analysis and calculation to output the corresponding answers. Data is sent to multiple users simultaneously within one time sequence. Multiple users can receive the text in the corresponding answers simultaneously, and then in the next time sequence, they continue to receive the text in the corresponding answers until the conversation of a certain user in this round ends.

[0115] In addition, the embodiment of the present invention also provides a fire protection Q&A system for an AI large language model, including:

[0116] A memory for storing computer programs;

[0117] A processor for executing the computer program, and when the computer program is executed by the processor, it implements the steps of a fire protection Q&A method for an AI large language model.

[0118] Among them, the processor may include one or more processing cores, such as a core processor, a core processor, etc. The processor can be implemented in at least one hardware form of digital signal processing DSP (Digital Signal Processing), field programmable gate array FPGA (Field-Programmable Gate Array), and programmable logic array PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the central processing unit CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state.

[0119] In some embodiments, the processor may be integrated with a graphics processing unit GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may further include an artificial intelligence AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0120] The memory may include one or more readable storage media, and the readable storage media may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory is at least used to store the following computer programs. After the computer programs are loaded and executed by the processor, the relevant steps in a fire-fighting Q&A method of an AI large language model disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may be Windows. The data may include, but is not limited to, the data involved in the above method.

[0121] In addition, in each embodiment of the present invention, each functional module can be integrated into a processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in each embodiment of the present invention.

[0122] For this reason, an embodiment of the present invention further provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of a fire fighting Q&A method of an AI large language model.

[0123] The readable storage medium may include: various media such as USB flash drives, mobile hard disks, read-only memory ROM (Read-Only Memory), random access memory RAM (Random Access Memory), magnetic disks or optical discs that can store program codes.

[0124] The computer program included in the readable storage medium provided in this embodiment can implement the steps of a fire fighting Q&A method of an AI large language model as described above when executed by a processor, and the effect is the same as above.

[0125] The above has introduced in detail a fire fighting Q&A method, system and storage medium of an AI large language model provided by the present invention. The embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the devices, equipment and readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

[0126] In summary, the present system supports local deployment and can also be adapted to the domestic information technology innovation environment for deployment. The knowledge base is trained locally and called locally to meet the needs of specific users for local deployment and local storage of knowledge data. Compared with the method of calling the interface of the Internet large model, while protecting local data from being transmitted externally, it can also achieve data docking and business embedding with various information systems deployed locally, and can achieve the ability of concurrent access as needed.

[0127] In the face of the development of big data and large model technologies, the solution for enhancing industry data proposed by the present invention meets the future needs of the future development of industry data, and can continuously and quickly, accurately, and effectively configure and deploy corresponding AI systems for the growing needs of data applications, AI empowerment, business embedding, etc. with increasing complexity.

[0128] As described above, it is only the specific implementation manner of the invention, but the protection scope of the invention is not limited thereto. Any change or replacement that can be thought of without creative work should be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be subject to the protection scope defined by the claims.

Claims

1. A fire - related Q&A method for an AI large - language model, including a front - end module, an AI pre - processing thread pool, a knowledge - base module, and a large - model computing engine module, characterized in that: The AI preprocessing thread pool receives business requests sent from the front-end module, automatically identifies the type of interface, performs corresponding interface processing, and allocates different task threads. Different regional knowledge bases are built in the knowledge base module. During the process of thread task execution, the knowledge base of the corresponding regional category is automatically called according to the regional category input in the business request for content similarity retrieval. After sorting out the retrieval results and the business request content, they are uniformly sent to the large model computing engine module that supports parallel processing for analysis to generate the final answer. The method of content similarity retrieval in the knowledge base module uses cosine similarity comparison, and the specific steps are as follows: Extract the subject in the input sentence, strengthen it, and place it at the beginning of the sentence to form a new sentence; Calculate the position encoding of each character in the newly formed sentence, add a weight value K greater than 1 to the PE value of the newly added text at the beginning of the original sentence, and when calculating the position encoding PE value of the original sentence and subsequent text, K takes the value of 1. The position encoding formula is as follows: ; Select a set number of knowledge content data from the results retrieved from the knowledge base, set a scoring mechanism to score each set of knowledge content data, and sort the scoring results at the statistical level; Select the top 10 groups of knowledge content after sorting as the results obtained from the final similarity calculation.

2. The fire fighting Q&A method of an AI large language model according to claim 1, characterized in that: The method for building different regional category knowledge bases in the knowledge base module includes the following steps: S101: Data collection and collation, collect experience data related to the emergency fire protection field and publicly available laws and regulations text data, classify them according to the field and industry, and at the same time classify them according to the hidden danger level; S102: Text extraction and processing, extract text from the classified and graded data, and cut it into text blocks by chapter to ensure that the size of the text blocks is within the set range, and the content exceeding the range is cut multiple times; S103: Vector calculation of text blocks, tokenize the cut text blocks, and at the same time construct an embedding vector with position encoding; S104: Picture data extraction and processing, extract tables and pictures from the classified and graded data, convert the table data into pictures at the same time, and vectorize the obtained picture data; S105: Establish a knowledge base, and use the pre-training method to establish a knowledge base of text block vectors and picture data vectors.

3. The fire fighting question-answering method for an AI large language model according to claim 2, characterized in that: It also includes a security defense mechanism module for defensive answering of illegal inputs. The specific defense method is as follows: S201: Conduct language conversion verification on the question requests received by the front-end module to prevent malicious attacks through other languages; S202: Use a violation term classifier to detect the input question requests. If malicious attack content is found, a prompt that the answer cannot be generated is returned; if the detected content is compliant, proceed to the next step; S203: Input the detected question requests into the knowledge base for retrieval. If relevant knowledge is retrieved, an answer is generated; if not, a prompt that the answer cannot be generated is returned.

4. The fire fighting Q&A method for an AI large language model according to claim 3, characterized in that: It also includes a multi-round dialogue and concurrent output module, which is used to ensure that multiple users remember the historical dialogue and conduct multi-round answers. The specific operation steps are as follows: S301: The AI preprocessing thread pool receives a number of service requests sent by several users to the front-end module at the same time, and the AI preprocessing thread pool configures threads as needed; S302: The interaction record of each user is pre-stored after establishing an interaction connection. The large model computing engine module does not need to record the information of the previous round of conversation. After the user continues to submit a service request based on the original conversation, the pre-stored interaction record will automatically associate the conversation information near the current time; S303: The added conversation information near the current time and the current service request are sent to the knowledge base for vector retrieval and matching. The obtained knowledge content data and the corresponding service request are sorted out and uniformly sent to the large model computing engine module that supports parallel processing for analysis and calculation to output the corresponding answer. At the same time, response data is sent to multiple users until all users complete the current round of conversation.

5. The fire fighting Q&A method of an AI large language model according to claim 4, characterized in that: The vector calculation method of the text block includes the following steps: First, preprocess the text. Use a tokenizer to split the text into tokens, and add Tokens at the beginning and end of the input sequence. Then convert the tokenized tokens into corresponding IDs; Secondly, truncate the long sequence, pad the short sequence, construct an attention mask and add position encoding to the embedding vector. The corresponding formula is: Pc(x) = y1 + Pe(x), where x represents the position of the word in the sentence, y1 is the embedding vector, and pe is the position vector. The number of samples in the code is the set number of text blocks. The formula for position encoding is: 。 6. The fire fighting Q&A method of an AI large language model according to claim 5, characterized in that: Perform square root or cube root processing on the position encoding value of the position vector to increase the value of y1 and avoid loss of embedding information.

7. The fire fighting Q&A method of an AI large language model according to claim 6, characterized in that: The front-end module supports multiple platforms, including the mini-program end, the PC end, and the APP end. The service requests sent include AI question and answer requests, knowledge search requests, rectification opinion generation requests, hidden danger decomposition requests, and automatic report document generation. The classification of the hidden danger levels from high to low includes: major hidden dangers, key problems, general hidden dangers, and general problems.

8. A fire fighting Q&A system for an AI large language model, characterized in that: including a memory for storing a computer program; a processor for executing the computer program, and when the computer program is executed by the processor, the steps of an AI large language model-based fire protection question and answer method as described in any one of claims 1-7 are implemented.

9. A readable storage medium, on which a computer program is stored, characterized in that: When the computer program is executed by the processor, the steps of an AI large language model-based fire protection question and answer method as described in any one of claims 1-7 are implemented.

Citation Information

Patent Citations

  • Question and answer method and system based on LangChain and large language model

    CN117313859A

  • NLP-based industry data analysis method and system

    CN118070812A