Emergency fire fighting question answering method and system based on AI big language model technology, and storage medium
By adopting AI large language model technology in the emergency fire protection Q&A system, the function of obtaining professional answers without keyword input is achieved, which solves the problems of high cost, high professional threshold, low efficiency and accuracy of the existing system, and improves the efficiency of information acquisition and decision-making support.
Patent Information
- Application Number
- CN202411819763.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The existing emergency fire protection Q&A system has problems such as high cost, high professional threshold, low efficiency and accuracy, which is difficult to meet the professional needs of grassroots personnel and enterprises in the fire protection field.
The emergency fire fighting Q&A method based on AI large language model technology is adopted. Through the front-end module, AI preprocessing thread pool, knowledge base module and large-model computing engine module, the function of obtaining professional answers without keyword input, and supports simultaneous interaction of multiple users through multiple rounds of dialogue and concurrent output modules.
It reduces the workload of data governance, reduces the need for professional keyword sorting, improves the efficiency of information acquisition and decision-making support, reduces the cost of system deployment and maintenance, and achieves more efficient and accurate knowledge search and analysis.
Smart Images

Figure CN119646274A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and specifically to an emergency firefighting question-and-answer method, system, and storage medium based on AI large language model technology. The method aims to improve the efficiency of information acquisition and decision support in firefighting emergency scenarios through advanced language models and knowledge processing technologies. Background Art
[0002] The field of emergency firefighting is a highly professional field, involving a large number of complex laws and regulations, operating specifications and work experience data. The main contradiction currently faced is the mismatch between the speed of skill improvement of grassroots personnel and the urgent need for professional talents at the grassroots and in enterprises. The more commonly used methods are mainly based on big data technology, by establishing a knowledge graph of laws and regulations, using labeling technology to annotate structured data, and combining keyword matching algorithms to achieve data query and knowledge search. For example, for laws and regulations on hazardous chemical storage requirements, relevant personnel need to first think about and organize question texts containing professional terms, and then rely on keyword input to search data;
[0003] However, these methods have the following limitations:
[0004] 1. High cost: The construction of knowledge graphs and labeling systems requires a lot of manpower and material resources, the promotion and application costs are high, and continuous investment and maintenance are required.
[0005] 2. Professional threshold: A large number of grassroots staff (such as grid workers) lack the ability to master professional terminology, which makes it difficult to ask accurate questions during use, and the functions are not friendly to non-professional users.
[0006] 3. Low efficiency and accuracy: In practical applications, it is often impossible to match appropriate knowledge data, or the matching results deviate from user needs, resulting in low knowledge search efficiency and insufficient accuracy.
[0007] Therefore, there is an urgent need for an intelligent, low-threshold, and highly efficient emergency firefighting question-and-answer system to better meet the professional needs of grassroots personnel and enterprises in the field of firefighting. Summary of the Invention
[0008] The purpose of the present invention is to provide an emergency firefighting question-and-answer method, system and storage medium based on AI large language model technology. Users do not need to think about the keywords of the current question. They can organize questions according to the actual situation on the scene and ask questions directly. The industry large language model system can automatically query the local professional knowledge base and give professional and accurate answers. It can also ask secondary and tertiary questions based on the content of the AI answer to achieve truly barrier-free communication and effectively obtain professional knowledge in the field of emergency firefighting to solve the problems raised in the above background technology.
[0009] To achieve the above-mentioned objectives, the present invention provides the following technical solutions: an emergency firefighting question-and-answer method based on AI large language model technology, comprising 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 business request issued by the front-end module, automatically identifies the type of interface, performs corresponding interface processing, and allocates different task threads. The knowledge base module is equipped with knowledge bases of different regional categories. During the thread execution of tasks, 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. 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.
[0010] Preferably, the method for building knowledge bases of different regional categories in the knowledge base module includes the following steps:
[0011] S101: Data collection and collation: collect relevant experience data and public legal and regulatory text data in the field of emergency firefighting, classify the collected data by field and industry, and grade the hidden dangers;
[0012] S102: Text extraction processing, performing text extraction on the classified and graded data, segmenting the extracted text into text blocks according to chapters, controlling the text blocks of each chapter to be within a set range, and performing multiple segmentations if the text blocks exceed the set range;
[0013] S103: Calculate the vector of the text block, segment the segmented text block, and construct an embedding vector with position encoding;
[0014] S104: Image data extraction and processing: extracting tables and images from the classified and graded data, converting the table data into images, and performing vectorization processing on the obtained image data;
[0015] S105: Establish a vector knowledge base, and use pre-training to combine the above text block vectors and image data vectors to establish a vector knowledge base that can be used independently.
[0016] As an advantage, the system also includes a security defense mechanism module that provides defensive responses to illegal inputs. The specific defense methods are as follows:
[0017] S201: Perform language conversion verification on the question request received by the front-end module to avoid malicious attacks through other languages;
[0018] S202: Using an illegal terminology classifier, the input question request is monitored. If malicious attack content is detected in the input question request, an automatic warning is issued and a prompt indicating that an answer cannot be given is directly returned. If the input question is detected to be benign text content, the next step is entered.
[0019] S203: The question raised by the test is put into the knowledge base for retrieval. If the corresponding knowledge can be detected, the output answer is calculated. If the corresponding knowledge cannot be detected, a prompt indicating that no answer can be given is directly returned.
[0020] As an optimal solution, the system also includes a multi-round dialogue and concurrent output module that can ensure that multiple users can simultaneously reply to multiple rounds of questions and answers by memorizing historical dialogues. The specific operation steps are as follows:
[0021] S301: The AI pre-processing thread pool receives several service requests from several users to the front-end module at the same time, and the AI pre-processing thread pool configures threads on demand;
[0022] S302: After each user establishes an interactive connection, the interaction record of this round of conversation is pre-stored. The large model calculation engine module does not need to record the information of the previous round of conversation. When the user continues to make a service request based on the original conversation, the pre-stored interaction record will automatically add the conversation information of the nearest time.
[0023] S303: The added conversation information of the adjacent time is sent to the knowledge base together with the current business request for vector search and matching. The acquired knowledge content data and the corresponding business request are sorted and sent to the large model computing engine module supporting parallel processing for analysis and calculation, and the corresponding answer is output. Data is sent to multiple users at the same time in one time sequence. Multiple users can receive the text in the corresponding answer at the same time, and then continue to receive the text in the corresponding answer in the next time sequence until the end of this round of conversation for a certain user.
[0024] Preferably, the vector calculation method of the text block is specifically as follows:
[0025] First, preprocess the text by selecting a specific tokenizer to split the text into individual tokens. Special tokens are added at the beginning and end of the input sequence, and the tokens after tokenization are converted into corresponding IDs.
[0026] Secondly, the long sequence is truncated, the short sequence is padded, the attention mask is constructed, and the position code is added 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 position code formula is:
[0027]
[0028] Preferably, the content similarity search in the knowledge base module adopts a cosine similarity comparison method, and the specific steps are as follows:
[0029] Q1: Extract the subject from the input sentence, strengthen the subject, and put it at the beginning of the sentence to form a new sentence;
[0030] Q2: Calculate the positional 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 characters at the beginning of the original sentence. When calculating the positional encoding PE value for the characters in the original sentence and later, K is set to 1. The positional encoding formula is as follows:
[0031]
[0032] Q3: Select 20 sets of knowledge content data from the results retrieved from the knowledge base, set up a scoring mechanism to score each set of knowledge content data, and sort the scoring results at a statistical level;
[0033] Q4: The top 10 groups of knowledge after sorting are selected 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 to avoid loss of embedded information.
[0035] Preferably, the front-end module includes a mini-program end, a PC end and an APP end, and the business requests issued include AI question and answer requests, knowledge search requests, rectification opinion generation requests, hidden danger disassembly requests and automatic generation of report documents.
[0036] Preferably, the hazard levels are arranged from large to small including: major hazards, key issues, general hazards, and general issues.
[0037] To solve the above technical problems, the present invention further provides an emergency firefighting question-and-answer system based on AI large language model technology, comprising:
[0038] memory for storing computer programs;
[0039] A processor is used to execute the computer program, which, when executed by the processor, implements the steps of an emergency firefighting question-and-answer method based on AI large language model technology as described in any one of the above items.
[0040] In order to solve the above technical problems, the present invention further provides a readable storage medium having a computer program stored thereon.
[0041] When the computer program is executed by the processor, the steps of the emergency firefighting question-and-answer method based on AI large language model technology as described in any one of the above items are implemented.
[0042] In summary, the beneficial effects of the present invention are:
[0043] The present invention further optimizes the query, search, extraction, understanding, analysis, and reasoning capabilities of specialized data in the emergency firefighting field by utilizing specialized vector knowledge bases, data augmentation, and general large language models, and can achieve seamless language interaction through human-computer dialogue. Compared to existing technologies such as knowledge graphs and tags, the present invention can reduce the workload of data management on the one hand, eliminating the need for manual data cleaning, standardization, labeling, and classification. Data can be directly fed into the AI model, which automatically completes all the manual tasks required for traditional data management, enabling rapid data training, rapid application, and rapid deployment. On the other hand, there is no need to organize specialized keywords during queries. Instead, data search, query, classification, analysis, and reasoning can be performed using colloquial language based on actual needs. Multiple questions can be asked through multiple rounds of dialogue, which is more in line with human questioning habits and logic. Compared to traditional technologies using general large models, the present invention does not require large-scale data training, can automatically adapt the size of the knowledge base based on the number of specialized data knowledge bases, and supports the simultaneous deployment of multiple knowledge bases in the same system, making it easier to implement engineering applications, with lower costs, higher efficiency, faster time, wider application, more accurate calculations, and greater ease of use. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 This is a schematic diagram of the architecture of an emergency firefighting question-answering method based on AI large language model technology in the present invention;
[0046] Figure 2 A schematic diagram of the framework flow of the knowledge base of the emergency firefighting question-answering method based on AI large language model technology of the present invention;
[0047] Figure 3 This is a schematic diagram of the business request process framework of an emergency firefighting question-and-answer method based on AI large language model technology in the present invention;
[0048] Figure 4Schematic diagram of the defensive mechanism process framework of an emergency fire fighting Q&A method based on AI large language model technology according to the present invention;
[0049] Figure 5 Schematic diagram of the multi-round dialogue and concurrent output process framework of an emergency fire fighting Q&A method based on AI large language model technology according to the present invention;
[0050] Figure 6 Schematic diagram of the Pe distribution of the Chinese character "peak" in an embodiment of an emergency fire fighting Q&A method based on AI large language model technology according to 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 thus 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 below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. 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 features with similar purposes. 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. should 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 defined. 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] Below in combination with Figure 1-6 The present invention is described in detail. An embodiment of the present invention is: an emergency firefighting question-and-answer method based on AI large language model technology, 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 into defensive answers for illegal inputs by the security defense mechanism module, and then the AI preprocessing thread pool receives the business request issued by the front-end module, automatically identifies the type of interface, performs corresponding interface processing, and allocates 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 those for mini-programs, PCs, and apps, initiate AI question-and-answer requests to the back-end services. The request protocols are HTTP, TCP, and other protocols. These front-end requests include AI question-and-answer requests, knowledge search requests, rectification opinion generation requests, hidden danger resolution requests, and automatic report document generation.
[0059] Step 2: After receiving requests from the mini-program, PC, or app, the backend sends the requests to the AI pre-processing 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's concurrency requirements. After receiving a request from any front-end, the system automatically identifies the interface type, 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 and obtain professional knowledge. The system can automatically call different types of knowledge bases based on the regional category input by the front end. For example, requests from Zhejiang can call the knowledge base in Zhejiang (pre-trained), and requests from Sichuan can call the knowledge base in Sichuan.
[0061] Step 4. The thread executing the task organizes the questions and the retrieved knowledge data, and pushes them to the large model calculation engine module for analysis and calculation to obtain the final answer. Considering that it takes 2 to 10 seconds for the large model calculation engine to output the answer (depending on the amount of text output, the corresponding time is required), AI supports parallel processing. After multiple users initiate requests at the same time, based on multiple rounds of dialogue and concurrent output modules, the system can output answers in the form of text streams to multiple users at the same time, ensuring the overall concurrency effect of the system.
[0062] It is worth mentioning that the reference 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 collation: The company's accumulated experience data in the field of emergency firefighting is collated and compiled, as well as the legal and regulatory documents published on the Internet and government public websites. The data is classified according to the following fields: hazardous chemicals, construction, industry and trade, firefighting, road traffic, marine and fishery-related, tourism, urban operations, etc.
[0064] The data is classified by industry, including: agriculture, forestry, animal husbandry, fishery, mining, manufacturing, electricity, construction, transportation, warehousing and postal services, information transmission, computer services and software, wholesale and retail, accommodation and catering, finance, real estate, leasing and business services, scientific research, technical services and geological exploration, water conservancy, environment and public facilities management, resident services and other services, education, health, social security and social welfare, culture, sports and entertainment, etc.
[0065] The data is classified into several levels, including major hidden dangers, key issues, general hidden dangers, and general issues;
[0066] S102: Text extraction processing: The classified and graded data is subjected to text extraction to extract all texts. The extracted texts are divided into blocks according to chapters. A large amount of chapter-level texts are segmented into text blocks. If a block contains more than 512 characters, further processing is performed. The number of characters in each block cannot exceed 512. For blocks with more than 512 characters, multiple segmentation is performed.
[0067] S103: Calculate the vector of the text block, segment the segmented text block, and construct an embedding vector with position encoding;
[0068] S104: Extract and process image data. 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, encode the image vectorization 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: Build a vector knowledge base. Use pre-training to build an independently usable 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 position encoding. The formula for position encoding is as follows:
[0076]
[0077] The corresponding code is:
[0078]
[0079] Suppose the sentence: 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 map of the Chinese character "Feng" (pe value) is as shown in the reference Figure 6 :
[0080] Finally, add the position encoding to the embedding vector. The corresponding formula is: Pc(x) = y1 + Pe(x), 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.
[0081] In the traditional method, since the pe value is much larger than y1, it may drown y1 and cause the loss of embedding information. The method adopted by the present invention is to perform square root and cube root processing on the pe value, increase the value of y1, and avoid the loss of embedding information;
[0082] It is also worth mentioning that in this embodiment, a method for performing content similarity retrieval in the knowledge base module is also provided, specifically using cosine similarity comparison. However, it should be noted that the traditional method only calculates the cosine similarity of two sets of vectors, which may cause the following problems:
[0083] Sentence A: What is the maximum speed limit for bicycles?
[0084] Sentence B: What is the maximum speed limit for a car?
[0085] The two sentences are very similar, but in actual situations, they need to be distinguished.
[0086] Therefore, a more advanced and practical method is adopted in this embodiment:
[0087] 1) Use the 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;
[0088] 2) Strengthen the subject and put it at the beginning of the sentence. For example, sentence A becomes: This is a question about bicycle speed. What is the maximum speed limit for bicycles?
[0089] 3) When calculating the positional encoding of each Chinese character in a 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 bicycle speed question). By adjusting this K value, the weight of the subject in the question can be strengthened, alleviating the overall problem as follows:
[0090]
[0091] 4) When calculating the position code PE value for the second and subsequent words in the sentence, K is set to 1;
[0092] 5) Using the initial vector searcher, we selected 20 sets of knowledge from the massive vector knowledge base and used a self-developed scoring mechanism to score each set of knowledge selected from the knowledge base.
[0093] 6) Sort and select the scoring results at the statistical level, and select the top 10 groups of knowledge after sorting as the knowledge obtained by the final similarity calculation.
[0094] refer to Figure 4 In addition, in one embodiment, the security defense mechanism module provides defensive answers to malicious questions, illegal question text input, etc., to ensure the legality and compliance of the system's answer output. The specific steps are as follows:
[0095] Step 1: The front end receives a question request from the user.
[0096] Step 2: Based on the capabilities of the large model, convert it into foreign languages such as English, French, Japanese, German, Spanish, Russian, and Italian to prevent malicious attacks through common languages such as English.
[0097] Step 3: Generate Base64 code for the text to prevent malicious language attacks on the large model through text encoding input.
[0098] Step 4: Use the illegal term classifier to monitor the input language for malicious and benign text, and identify text input that indicates malicious attacks;
[0099] Step 5: If malicious attack content is detected in the input question, an automatic warning will be issued;
[0100] Step 6: Detect that the input question is benign text content;
[0101] Step 7: Check whether the question raised can be found in the knowledge base.
[0102] Step 8: For the question raised by the user, if the corresponding knowledge is detected in the knowledge base, the output answer is calculated.
[0103] Step 9: If step 5 is triggered, or the corresponding knowledge is not found in step 7, directly return a prompt that cannot give an answer.
[0104] refer to Figure 5 In addition, 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 module, and a general large model computing engine, the internal data calls and interface calls are relatively complex. Therefore, the present invention has designed a mechanism to ensure that multiple users can ask questions simultaneously, the AI industry model system can answer them in parallel, and the answer output simulates the text flow effect of a typewriter, and can also remember previous conversations and conduct multiple rounds of conversations.
[0105] The multi-round dialogue and concurrent output module can ensure that multiple users can simultaneously reply to multiple rounds of questions and answers by memorizing historical dialogues. The specific operation steps are as follows:
[0106] Step 1: User A asks a question to the industry language model system. At the same time, within 1 second, user B, user C, ..., user N also ask questions to the industry language model system.
[0107] Step 2: After the industry large language model system receives questions from user A, user B, user C, ..., user N, the system thread pool will configure threads on demand to carry out module calculation tasks, including vector search, knowledge matching, calculation engine, and data stream output.
[0108] Step 3: After each user establishes an interactive connection with the industry large language model system, the interaction record of this round of conversation will be pre-stored. The large model calculation engine module does not need to record the information of the previous round of conversation. When the user continues to ask questions based on the original conversation, the pre-stored interaction record will automatically add the conversation information of the previous rounds to the user's conversation, interact with the industry large language model system, and realize multi-user, multi-round conversation interaction.
[0109] Step 4: A separate data stream output module is set up in the industry large language model system. The conversation information and the current business request are sent to the knowledge base for vector retrieval and matching. The acquired knowledge content data and the corresponding business request are sorted and sent to the large model calculation engine module that supports parallel processing for analysis and calculation. The corresponding answer is output and data is sent to multiple users at the same time in one time sequence. Multiple users can receive the text in the corresponding answer at the same time, and then continue to receive the text in the corresponding answer in the next time sequence until the end of this round of conversation for a certain user.
[0110] In addition, an embodiment of the present invention further provides an emergency firefighting question-and-answer system based on AI large language model technology, including:
[0111] memory for storing computer programs;
[0112] A processor is used to execute the computer program, which, when executed by the processor, implements the steps of an emergency firefighting question-and-answer method based on AI large language model technology.
[0113] The processor may include one or more processing cores, such as a core processor, a core processor, etc. The processor may be implemented in at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state.
[0114] In some embodiments, the processor may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may also include an artificial intelligence (AI) processor, which is used to handle computing operations related to machine learning.
[0115] The memory may include one or more readable storage media, which 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, flash memory storage devices. In this embodiment, the memory is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor, it can implement the relevant steps in the emergency firefighting question-and-answer method based on AI large language model technology disclosed in any of the aforementioned embodiments. 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 Wi ndows. The data may include but is not limited to the data involved in the above method.
[0116] In addition, the functional modules in the various embodiments of the present invention can be integrated into a processing module, or each module can exist physically separately, 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 modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this 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, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in the various embodiments of the present invention.
[0117] To this end, an embodiment of the present invention also provides a readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of an emergency firefighting question-and-answer method based on AI large language model technology.
[0118] The readable storage medium may include: a U disk, a mobile hard disk, a read-only memory ROM (Read-Only Memory), a random access memory RAM (Random Access Memory), a magnetic disk or an optical disk, and other media that can store program codes.
[0119] The computer program contained in the readable storage medium provided in this embodiment can implement the steps of the emergency firefighting question-and-answer method based on AI large language model technology when executed by the processor, and the effect is the same as above.
[0120] The above is a detailed introduction to the emergency firefighting question-and-answer method, system and storage medium based on AI large language model technology provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between 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 method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
[0121] In summary, this system supports local deployment and can be adapted for deployment in domestic information technology environments. Knowledge bases can be trained and called locally, meeting specific user needs for local deployment and storage of knowledge data. Compared to calling large internet model interfaces, this system protects local data from external transmission while also enabling data connection and business integration with various locally deployed information systems, and enabling concurrent access on demand.
[0122] In the face of the development of big data and big model technology, the industry data enhancement solution proposed in this invention adapts to the future needs of industry data development, and can sustainably meet the needs of increasingly complex data applications, AI empowerment, business embedding, etc., and quickly, accurately and effectively configure and deploy corresponding AI systems.
[0123] The above description is merely a specific embodiment of the invention, but the scope of protection of the invention is not limited thereto. Any changes or substitutions that are not conceived through creative effort should be included within the scope of protection of the invention. Therefore, the scope of protection of the invention should be based on the scope of protection defined in the claims.
Claims
1. An emergency firefighting question-answering method based on AI large language model technology, comprising a front-end module, an AI preprocessing thread pool, a knowledge base module and a large model computing engine module, characterized in that: The AI preprocessing thread pool receives the business request issued by the front-end module, automatically identifies the type of interface, performs corresponding interface processing, and allocates different task threads. The knowledge base module is equipped with knowledge bases of different regional categories. During the thread execution of tasks, 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. The retrieval results and the business request content are collated and sent to the large model computing engine module that supports parallel processing for analysis to generate the final answer.
2. According to claim 1, an emergency firefighting question-answering method based on AI large language model technology is characterized by: The method for building knowledge bases of different regional categories in the knowledge base module includes the following steps: S101: Data collection and collation, collecting relevant experience data and public legal and regulatory text data in the field of emergency firefighting, and classifying them by field and industry, and grading them according to the level of hidden dangers; S102: Text extraction processing, extracting text from the classified and graded data, and dividing the data into text blocks by chapter, ensuring that the size of the text block is within a set range, and dividing the content that exceeds the range multiple times; S103: Calculate the vector of the text block, segment the segmented text block, and construct an embedding vector with position encoding; S104: Image data extraction and processing, extracting tables and images from the classified and graded data, converting the table data into images, and performing vectorization processing on the obtained image data; S105: Establish a knowledge base, and use a pre-training method to establish a knowledge base of text block vectors and image data vectors.
3. According to claim 2, an emergency firefighting question-answering method based on AI large language model technology is characterized by: It also includes a security defense mechanism module that provides defensive responses to illegal inputs. The specific defense methods are as follows: S201: Performing language conversion verification on the question request received by the front-end module to prevent malicious attacks through other languages; S202: Use the illegal term classifier to detect the input question request. If malicious attack content is found, it will return a prompt that the answer cannot be generated; if the detected content complies with the rules, proceed to the next step; S203: Requesting input into the knowledge base for the question raised by the test, if relevant knowledge is retrieved, an answer is generated, if not, a prompt is returned that the answer cannot be generated.
4. According to claim 3, an emergency firefighting question-answering method based on AI large language model technology is characterized in that: It also includes a multi-round dialogue and concurrent output module, which is used to ensure that multiple users can remember historical dialogues and make multiple rounds of answers. The specific operation steps are as follows: S301: the AI preprocessing thread pool receives several 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 stored in advance after the interactive connection is established. The large model calculation engine module does not need to record the information of the previous round of conversation. When the user continues to make a service request based on the original conversation, the pre-stored interaction record will automatically associate the conversation information of the nearby time. S303: The added conversation information of adjacent time is sent to the knowledge base together with the current business request for vector search and matching. The acquired knowledge content data and the corresponding business request are sorted and sent to the large model computing engine module supporting parallel processing for analysis and calculation, and the corresponding answer is output. Response data is sent to multiple users at the same time until all users complete the current round of conversation.
5. The emergency firefighting question-answering method based on AI large language model technology according to claim 4 is characterized in that: The vector calculation method of the text block comprises the following steps: First, the text is preprocessed by using a specific tokenizer to split the text into tokens. Special tokens are added at the beginning and end of the input sequence, and the tokens after tokenization are converted into corresponding IDs. Secondly, the long sequence is truncated, the short sequence is padded, the attention mask is constructed and the position encoding is added 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, pe is the position vector, and the number of samples in the code is the set number of text blocks. The formula for position encoding is:
6. The emergency firefighting question-answering method based on AI large language model technology according to claim 5 is characterized by: The content similarity search in the knowledge base module adopts the cosine similarity comparison method, and the specific steps are as follows: Q1: Extract the subject from the input sentence and strengthen it and place it at the beginning of the sentence to form a new sentence; Q2: Calculate the position code 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 code PE value for the original sentence and subsequent text, K takes the value of 1. The position code formula is as follows: Q3: Select a set number of groups of knowledge content data from the results retrieved from the knowledge base, set up a scoring mechanism to score each group of knowledge content data, and sort the scoring results at a statistical level; Q4: The top 10 groups of knowledge content after sorting are selected as the final similarity calculation results.
7. The emergency firefighting question-answering method based on AI large language model technology according to claim 6 is characterized by: The position encoding value of the position vector is processed by square root or cube root to increase the value of y1 to avoid loss of embedded information.
8. The emergency firefighting question-answering method based on AI large language model technology according to claim 7 is characterized by: The front-end module supports multiple platforms, including mini-programs, PCs and APPs. The business requests issued include AI question-and-answer requests, knowledge search requests, rectification opinion generation requests, hidden danger dismantling requests and automatic generation of report documents. The hidden danger levels are arranged from high to low, including: major hidden dangers, key issues, general hidden dangers, and general issues.
9. An emergency firefighting question-and-answer system based on AI large language model technology, characterized by: comprising a memory for storing a computer program; A processor is used to execute the computer program, and when the computer program is executed by the processor, the steps of an emergency firefighting question and answer method based on AI large language model technology as described in any one of claims 1 to 8 are implemented.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the steps of an emergency firefighting question-and-answer method based on AI large language model technology as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Question and answer method and system based on LangChain and large language model
CN117313859A
Intelligent coal mine method based on local knowledge base and natural language processing large model
CN117891956A
NLP-based industry data analysis method and system
CN118070812A
Large language model intelligent question and answer work order processing method and device based on optimized knowledge base
CN118535702A
Safety knowledge generation method and system based on large language model
CN118797077A
Cited By
Language model service performance evaluation method, device, equipment, system and medium
CN120780574A
Large language model generation content security test system and method in black box scene
CN121390056A
A black box scenario large language model generated content security test system and method
CN121390056B
Model knowledge updating and question answering method integrating retrieval enhancement and feedback learning
CN122287844A