Civil aviation industry intelligent question and answer platform in SaaS mode, storage medium and equipment
By providing an intelligent Q&A platform under the SaaS mode in the civil aviation industry, using natural language understanding and large language models, the problems of fast and low-cost implementation of intelligent Q&A and information security in the civil aviation industry are solved, and efficient and safe intelligent Q&A services are realized.
Patent Information
- Application Number
- CN202411823882.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-15
AI Technical Summary
It is difficult for the existing technology to realize intelligent Q&A in the civil aviation industry quickly and at low cost, and the external network intelligent Q&A system cannot integrate the internal business system of the enterprise and cannot meet the requirements of civil aviation information security and data security.
It provides an intelligent question-and-answer platform for the civil aviation industry under the SaaS mode, including an intelligent question-and-answer assistant module, an AI open platform module, a core question-and-answer working module and a data storage module. Through natural language understanding, open interfaces and large language models, it realizes the Q&A interaction between users and the knowledge base, and ensures data security through domestic relationship databases and storage media.
It has realized a low-cost and fast access intelligent Q&A platform, which has improved business efficiency, improved user experience, reduced operating costs, and solved the problems of information security and data security, which is in line with the data usage specifications of the civil aviation industry.
Smart Images

Figure CN119829707A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence, and in particular, relates to an intelligent question-and-answer platform, storage medium and equipment for the civil aviation industry under a SaaS model. Background Art
[0002] With the continuous expansion of the scale of domestic civil aviation business, the increase in business complexity and the increase in the number of users, in the process of promoting civil aviation business, the relevant stakeholders have continuously increased their demands for the timeliness, accuracy and completeness of information acquisition. Today's information systematization and management model cannot meet the needs of fast and efficient acquisition of information data. A large number of civil aviation information systems face different consultation channels (such as telephone, email, in-application messages, etc.), which are difficult to manage uniformly and respond accurately and quickly, and are still highly dependent on manual channels. Only manually answering a large number of common civil aviation business tasks and related business knowledge will increase the operating costs of the enterprise and inefficiently solve problems.
[0003] The civil aviation industry has its own unique business processes and data standards. To develop an intelligent question-and-answer system suitable for the civil aviation industry, this includes building a specialized knowledge base to meet the specific needs of the civil aviation industry, etc., which requires a lot of time and financial investment. Existing technologies lack a platform-based approach to manage accessed application systems, and cannot solve the problem of low-cost and rapid intelligent question-and-answering in enterprise application systems. The external network intelligent question-and-answer system cannot integrate the internal business systems of enterprises, and only provides data pre-training import methods, and cannot achieve intelligent question-and-answering at the enterprise database level to capture data in real time. The online access method of traditional intelligent question-and-answer assistants involves internal enterprise data, and there will be the following problems when circulating in a public network environment, which cannot meet the requirements of civil aviation information security and data security. Summary of the invention
[0004] In response to the deficiencies in the prior art, this application provides an intelligent question-and-answer platform, storage medium, and equipment for the civil aviation industry under a SaaS model, and builds a low-cost, fast-access intelligent question-and-answer platform with SaaS capabilities to improve business efficiency, enhance user experience, reduce operating costs, and help corporate business development.
[0005] This application is implemented through the following technical solutions:
[0006] An intelligent question-answering platform for the civil aviation industry under the SaaS model, including:
[0007] The intelligent question-answering assistant module is used to provide a front-end application for users to conduct question-answering interactions. The front-end application analyzes the civil aviation related questions raised by users through natural language understanding, and retrieves, enhances, generates corresponding answers or solutions from pre-set knowledge base documents, and returns them to users;
[0008] The AI open platform module accesses different application systems through the open interface provided by the platform. When the user application is successfully created, it automatically generates an ApiKey according to the preset rules, and provides an open application programming interface OpenAPI and corresponding detailed documents and sample codes, so that the user application can call, integrate and use the document content-based intelligent question and answer and function call-based intelligent question and answer provided by the platform through the open interface;
[0009] The core question-answering module is used to use the user input content and the document content or the function call result as context information, assemble the context information into prompt words through the prompt word template, submit it to the large language model configured by the application, summarize and generate results and return them to the user;
[0010] The data storage module is used for data persistence of the entire SaaS platform, including document data storage, platform relational data storage and text vector data storage of access applications. All types of data storage use application ID as the tenant field to logically isolate application data so that users of different applications can only access data and functions authorized under this application.
[0011] In some embodiments, when creating the user application, it also includes: the user specifies the application name, and configures a large language model and a text embedding model.
[0012] In some embodiments, the core question-and-answer work module supports a work mode based on document processing on a SaaS platform. In the work mode based on document processing on a SaaS platform, after the application uploads a document on the platform, it first dynamically selects different types of document loaders by identifying the document format to convert the document content into text form; then the text data is preprocessed so that the input text can be divided into predefined units according to the specified granularity for subsequent analysis or processing; after the document is segmented into document fragments, the text embedding model configured by the application is used, combined with the self-attention mechanism of the model, to learn the semantic information of sentences or text segments in the text, without relying on the position information of the sequence, and the text is converted into a continuous digital vector with a fixed dimension. After the document fragments are embedded respectively to obtain vector data, the element objects in the following format are traversed and constructed in a loop and stored in the vector database; after the user inputs a question, the text embedding model is used to embed the input content into text to obtain vector data, and the distance is calculated with the vector data stored in the vector database respectively. According to the calculation results, the text corresponding to the vector data with the closest distance and the user input content are finally used as context information, assembled into prompt words through prompt word templates and submitted to the large language model configured by the application to generate an answer result.
[0013] In some embodiments, the distance calculation specifically adopts the following formula:
[0014]
[0015] Where A represents the vector value of the user input content, B represents the vector value of the document segment, A·B represents the dot product of vectors A and B, ||A|| and ||B|| represent the moduli of vectors A and B respectively, and the calculation result range is [-1, 1]. After the calculation is completed, the top_k vector data are recalled from the calculation results, where top_k represents the k vector data with the closest semantics to the user input content, k>0.
[0016] In some embodiments, dividing the input text into predefined units according to the specified granularity further includes:
[0017] Use a custom text splitter and specify chunk_size as 200, that is, split by 200 characters; specify overlap as 30, that is, keep the overlapping part as 30 characters, and recursively split the text by character; the specific principle is to define a separator list ["\n\n", "\n", "", ""], first try to split between two blank lines, a blank line, space and tab, that is, recursively apply the separator list to split the text until the text block reaches the specified chunk_size.
[0018] In some embodiments, the core question-and-answer working module supports a working mode based on SaaS platform function calls. In the working mode based on SaaS platform function calls, after the application is successfully created on the platform, a new function definition is added to support JSON format input; after the large language model configured by the application receives user input, it understands the user's intention through context analysis, and infers whether the user input needs to call a pre-defined function based on pre-trained data and self-attention mechanism, and determines the name of the called function and its parameters; if the model infers that a function needs to be called, a formatted output including the function call and required parameters, i.e., a JSON object, is generated; the model output is parsed in JSON, and the specified function is called with the corresponding parameters to obtain the function call result; the function call result and the user input content are used as context information, assembled into prompt words through a prompt word template, and submitted to the large language model configured by the application, and the summary and generated results are returned to the user.
[0019] In some embodiments, the JSON object includes the following information:
[0020] name, indicating the function name;
[0021] description, indicating the function description;
[0022] parameters, indicating the parameter list;
[0023] type, indicating the parameter type;
[0024] required: indicates that the parameter is required.
[0025] In some embodiments, the data storage module uses the domestic relational database DM8 as a storage medium to store user information, application information, document information, configuration information and audit logs.
[0026] The present application also provides a computer-readable storage medium storing one or more programs, which, when executed, can implement the aforementioned intelligent question-and-answer platform for the civil aviation industry under the SaaS model.
[0027] The present application also provides a device, comprising a processor, a communication interface, a computer-readable storage medium, and a communication bus; wherein the processor, the communication interface, and the computer-readable storage medium communicate with each other via the communication bus;
[0028] The processor is configured to execute a program stored in a computer-readable storage medium.
[0029] Compared with the prior art, this application has the following advantages:
[0030] The SaaS platform can efficiently integrate enterprise resources, realize platform support, and provide an end-to-end SaaS solution. Third-party application systems or assistants only need to connect to this platform and use the ApiKey interface call method to enable the internal system of the enterprise to quickly access their respective business data and knowledge, thereby realizing artificial intelligence question and answer. By integrating advanced intelligent technologies, the digital transformation and high-quality development of the civil aviation industry are promoted. This application solves information security issues such as internal information leakage in enterprises. While accessing the enterprise intranet, it also ensures that data security is autonomous and controllable. It also supports offline deployment of enterprises to solve the problem of relying on external public network access. It complies with the data usage specifications of the civil aviation industry. This application also supports the connected application to configure custom functions, perform semantic recognition and inference on user input content, perform function parsing and calling, so as to achieve real-time acquisition of the business data capabilities of the access application, and can perform some specific tasks, such as data processing, information query, function call, etc. This function provides a more intelligent way of interaction, simplifies the workflow, and meets the custom needs of the access application. This application is compatible with the domestic Kirin operating system, domestic Haiguang CPU, domestic DAMO database, etc.
[0031] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures indicated in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 The architecture diagram of the intelligent question-answering platform for the civil aviation industry under the SaaS model is shown;
[0034] Figure 2 It shows the user application, third-party assistant or system access flow chart of the intelligent question-and-answer platform for the civil aviation industry under the SaaS model;
[0035] Figure 3 The document processing workflow diagram of the civil aviation industry intelligent question-and-answer platform under the SaaS model is shown;
[0036] Figure 4 The function call workflow diagram of the civil aviation industry intelligent question-answering platform under the SaaS mode is shown;
[0037] Figure 5 It is a structural schematic diagram of a device according to an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] Combining large model technology to build a civil aviation industry SaaS intelligent question-and-answer platform, through the ultra-large-scale language model technology in the field of artificial intelligence, combined with the SaaS platform for intelligent analysis, to achieve user intelligent question-and-answer. Support the access of various information systems, realize intelligent transformation, improve business efficiency, optimize user experience, reduce costs and promote innovation.
[0040] The civil aviation industry SaaS intelligent question-answering platform of this application consists of an intelligent question-answering assistant module chat-assistant, an AI open platform module chat-openai, a core question-answering work module chat-rag and a data storage module. The module diagram is as follows: Figure 1 shown.
[0041] The chat-assistant module is used to provide a front-end application for users to conduct question-and-answer interactions. The application can analyze civil aviation-related questions raised by users through natural language understanding, and retrieve, enhance, and generate corresponding answers or solutions from pre-set knowledge base documents and return them to users.
[0042] The chat-openai module enables different application systems to access through the open interface provided by the platform, thereby realizing intelligent question and answer for civil aviation business. After the user logs in to the platform, first create an application, specify the application name, and configure the large language model and text embedding model. After the application is successfully created, the system automatically generates an ApiKey according to the preset rules, and provides an open application programming interface (OpenAPI) and corresponding detailed documentation and sample code, so that user applications, third-party assistants or systems can easily integrate and use the two functions provided by the open platform through open interface calls: one is intelligent question and answer based on document content, and the other is intelligent question and answer based on function calls. Figure 2 Access flowcharts for user applications, third-party assistants, or systems.
[0043] The chat-rag module supports the following two working modes: the working mode based on SaaS platform document processing and the working mode based on SaaS platform function call.
[0044] (1) Working mode of document processing based on SaaS platform
[0045] After the application uploads the document on the platform, the chat-rag module first dynamically selects different types of document loaders by identifying the document format and converts the document content into text form. The document loader supports a variety of common document types, such as txt, word, pdf, etc. Then the text data is preprocessed so that the input text can be divided into predefined units according to the specified granularity for subsequent analysis or processing. Use a custom text segmenter, specify chunk_size as 200, that is, segment by 200 characters; specify overlap as 30, that is, keep the overlapping part as 30 characters, and recursively segment the text by character. The specific principle is to define a delimiter list ["\n\n", "\n", "", ""], first try to segment between two blank lines, one blank line, space and tab, that is, recursively apply the delimiter list to segment the text until the text block reaches the specified chunk_size, so as to maintain the semantic relevance of the text as much as possible, for example, keep the entire paragraph, sentence and word together, because these are usually the most semantically related parts of the text.
[0046] After the document is segmented into document fragments, the chat-rag module uses the text embedding model configured by the application, combined with the self-attention mechanism of the model, to learn the semantic information of sentences or text segments in the text, without relying on the position information of the sequence, and can convert the text into a continuous digital vector with a fixed dimension. For example, the text "Baggage check-in slip refers to the part of the ticket that stipulates the carriage of checked baggage, and is also the receipt issued by the carrier for the carriage of checked baggage by passengers." The result of embedding by the text embedding model is [0.11274555325508118, -0.16765069961547852, -1.059014081954956, ...] with a dimension of 1024. After embedding the document fragments to obtain vector data, loop through and construct element objects in the following format and store them in the Chroma vector database:
[0047] {
[0048] "collection_name":"your_collection",
[0049] "content":"The baggage check is the part of the ticket that stipulates the carriage of checked baggage, and is also the receipt issued by the carrier for the carriage of checked baggage by the passenger.",
[0050] "embeddings":[0.11274555325508118, -0.16765069961547852,
[0051] -1.059014081954956, ...],
[0052] "metadata":{
[0053] "_app_id":"your_app_id",
[0054] "_model":"your_embedding_model",
[0055] "_source":"your_document.docx"
[0056] }
[0057] }
[0058] After the user enters the question, the chat-rag module uses the text embedding model to embed the input content into text to obtain vector data, and then uses the cosine similarity algorithm to calculate the distance value between the two vectors with the vector data stored in the vector database. The calculation formula is as follows:
[0059]
[0060] Where A represents the vector value of the user input content, B represents the vector value of the document segment, A·B represents the dot product of vectors A and B, ||A|| and ||B|| represent the modulus (length) of vectors A and B respectively, and the calculation result range is [-1, 1]. The closer the value is to 1, the more semantically similar it is. After the calculation is completed, recall the top_k vector data from the calculation results, where top_k represents the k vector data with the closest semantics to the user input content, k>0. Finally, the text corresponding to these k vector data and the user input content are used as context information, assembled into a prompt word prompt through a prompt word template, and submitted to the large language model configured by the application to generate the answer result. Its workflow is as follows Figure 3 .
[0061] (2) Working mode based on SaaS platform function call
[0062] After the application is successfully created on the platform, use the "Function Definition" function to add a new function definition, which supports JSON format input. Taking the business requirement "query the current status of the corresponding work order according to the work order number" as an example, the function definition in JSON format can be as follows:
[0063]
[0064]
[0065] Among them, name indicates the function name, description indicates the function description, parameters indicates the parameter list. For this example function, an order_no parameter is specified, type indicates the parameter type, description indicates the parameter description, and required indicates that the parameter is required.
[0066] After receiving user input, the large language model configured in the application understands the user's intention through context analysis, infers whether the user's input needs to call a predefined function based on pre-trained data and self-attention mechanism, and determines the name of the called function and its parameters. If the model infers that a function needs to be called, a formatted output containing the function call and the required parameters will be generated, usually a JSON object containing information such as the function name and parameter list. The data format example is as follows:
[0067] {
[0068] "name":"get_current_order_status",
[0069] "arguments":
[0070] {
[0071] "order_no":"HK-KF-2024-00310"
[0072] }
[0073] }
[0074] The chat-rag module parses the model output in JSON, calls the specified function with the corresponding parameters, and obtains the function call result. Finally, the function call result and the user input content are used as context information, assembled into a prompt word prompt through a prompt word template, and submitted to the large language model configured by the application. The summary and generated results are returned to the user. This mechanism enables the model to handle more complex tasks and interact with third-party system services. Its workflow is as follows: Figure 4 shown.
[0075] The data storage module is used for data persistence of the entire SaaS platform, including document data storage for access applications, platform relational data storage, and text vector data storage. All types of data storage use application IDs as tenant fields to logically isolate application data, ensuring that users of different applications can only access data and functions authorized by the application, thereby ensuring the security of tenant data.
[0076] Taking relational data storage as an example, the domestic relational database DM8 is used as the storage medium, which mainly stores user information, application information, document information, configuration information, audit logs, etc. in the system. Adapting the domestic database can ensure the data security and information sovereignty of the system, reduce dependence on foreign database suppliers, and reduce the security risks that may occur due to technical blockades. All application-related information tables use the application ID field as the logical isolation of application data, such as the document information table, whose data structure is shown in Table 1.
[0077]
[0078]
[0079] Table 1
[0080] This application system supports different application systems within the enterprise to access by creating applications, uploading documents or defining functions, and calling open interfaces to achieve AI intelligent question and answer for each application system.
[0081] There are two types of AI intelligent question-and-answer functions that can be obtained after the application is connected to the system. The first is intelligent question-and-answer based on document content, and the second is intelligent question-and-answer based on function calls. The following uses examples of these two methods to illustrate the specific implementation process.
[0082] Example 1: Intelligent question and answer based on document content. Take civil aviation business knowledge question and answer as an example:
[0083] Step 1: Create an application and configure basic information
[0084] 1) The user logs in to the front-end page of the AI open platform;
[0085] 2) Enter the "My Apps" page, click the "New" button to fill in the application information form. The required items include basic information such as application name, application icon, and application description;
[0086] 3) After the application is successfully created, enter the application details page and pull down the "Large Language Model" and "Text Embedding Model" in the application configuration bar. The system presets several model lists for selection. This configuration is used for the subsequent dialogue model and embedding model support of the application.
[0087] Step 2: Upload the document
[0088] 1) In the document list column on the right side of the application details page, click the "Upload Document" button to upload the document. Common document formats such as pdf, doc, docx, txt, and md are supported. A single document should not exceed 20MB or 1 million words.
[0089] 2) Select the "Civil Aviation Business Terminology.docx" document to upload;
[0090] 3) After the document is uploaded successfully, the document status is "Uploaded".
[0091] Step 3: Document segmentation and embedding
[0092] 1) Click the document name to enter the document details page and set the document segmentation strategy: select "Text Document" as the document parsing method and "Recommended Strategy" as the document segmentation strategy. The system will automatically select the optimal strategy for segmentation based on the document type. Click "Preview" to intuitively display the document segmentation effect on the interface, such as characters, sentences, paragraphs, segments, and other information. In this example, using the recommended strategy for document segmentation can effectively segment each civil aviation business term and the corresponding term definition in the document into the same document segment.
[0093] 2) Click "Apply to current file" to apply the configured "text embedding model" to perform vector embedding calculations on document segments, assemble the calculation results and segment metadata into a unified data format and store them in the Chroma vector database. Use the application ID as the name of the vector set to achieve logical isolation of application data. The data format is as follows:
[0094] {
[0095] "collection_name":"your_app_id",
[0096] "content":"The baggage check is the part of the ticket that stipulates the carriage of checked baggage, and is also the receipt issued by the carrier for the carriage of checked baggage by the passenger.",
[0097] "embeddings":[0.11274555325508118, -0.16765069961547852,
[0098] -1.059014081954956, ...],
[0099] "metadata":{
[0100] "_model":"your_embedding_model",
[0101] "_source":"your_document.docx"
[0102] }
[0103] }
[0104] Where collection_name indicates the name of the vector collection, content indicates the original content of the document shard, embeddings indicates the floating-point array after the document shard is embedded, metadata indicates the metadata of the document shard, _model indicates the name of the text embedding model used, and _source indicates the original file name of the document;
[0105] 3) After the document is embedded successfully, the document status is "Embedded".
[0106] Step 4: Get the application API key
[0107] 1) Enter the "My Apps" page and click on a specific app to enter the app details page;
[0108] 2) View and copy the ApiKey in the application configuration bar on the left. It should be noted that the ApiKey automatically generated by the platform can only be viewed once, and users are required to keep it properly and prevent leakage. You can click the "Add ApiKey" or "Delete ApiKey" button to add multiple ApiKeys and delete ApiKeys that are no longer needed.
[0109] Step 5: Use ApiKey to call the open interface to implement intelligent question and answer
[0110] 1) The application uses the HTTP client tool, specifies the request method as POST, the request header as Api-Key:{your_api_key}, the request body example as {"message":"What is a passenger baggage check-in slip?"}, calls the smart question-answering open interface, and specifies the response type to be received as text / event-stream;
[0111] 2) After the open interface is successfully connected, the application can obtain the streaming response results returned by the interface in real time. The AI open platform uses SSE (Server-Sent Events) technology based on the standard HTTP communication protocol to enable the server to push data to the client application in real time in the form of event streams. The response body format is as follows:
[0112] data:{"model":"qwen2:7b","created":1722993727655,
[0113] "message":{"role":"assistant","content":"Hello"},"done":false}
[0114] data:{"model":"qwen2:7b","created":1722993727733,
[0115] "message":{"role":"assistant","content":","},"done":false}
[0116] data:{"model":"qwen2:7b","created":1722993727814,
[0117] "message":{"role":"assistant", "content":"luggage"}, "done":false}
[0118] data:{"model":"qwen2:7b","created":1722993727896,
[0119] "message":{"role":"assistant","content":"Consignment Note"},"done":false}
[0120] data:{"model":"qwen2:7b","created":1722993727978,
[0121] "message":{"role":"assistant", "content":"refers to"}, "done":false} ...
[0123] data:{"model":"qwen2:7b","created":1722993728053,
[0124] "message":{"role":"assistant","content":"."},"done":true}
[0125] Use done = true to mark the output termination. The client application can interrupt the SSE connection and end the event stream output by sensing this field.
[0126] Example 2: Intelligent question and answer based on function call. Take the user querying the service status as an example.
[0127] Step 1: Create an application and configure basic information
[0128] 1) The user logs in to the front-end page of the AI open platform;
[0129] 2) Enter the "My Apps" page, click the "New" button to fill in the application information form. The required items include basic application information such as application name, application icon, and application description;
[0130] 3) After the application is successfully created, enter the application details page and pull down the "Large Language Model" and "Text Embedding Model" in the application configuration bar on the left. The system presets several model lists for selection. This configuration is used for the subsequent dialogue model and embedding model support of the application.
[0131] Step 2: Define the function
[0132] 1) In the function definition column on the left side of the application details page, click the "Function Definition" button to add a new function definition, which supports input in JSON format;
[0133] 2) Fill in the function definition in the following JSON format in the input box:
[0134]
[0135] The sample function defines a simple business function, which is used to query the current information and status of the corresponding work order according to the work order number. The name field indicates the function name, the description field indicates the function description, and the parameters indicates the parameter list. For this sample function, an order_no parameter is specified, type indicates the parameter type, description indicates the parameter description, and required indicates that the parameter is required.
[0136] 3) Click the "Save" button to save the function definition.
[0137] Step 3: Get the application API key
[0138] 1) Enter the "My Apps" page and click on a specific app to enter the app details page;
[0139] 2) View and copy the ApiKey in the application configuration bar on the left. It should be noted that the ApiKey automatically generated by the platform can only be viewed once, and users are required to keep it properly and prevent leakage. You can click the "Add ApiKey" or "Delete ApiKey" button to add multiple ApiKeys and delete ApiKeys that are no longer needed.
[0140] Step 4: Use ApiKey to call the open interface
[0141] 1) The application can use the HTTP client tool, specify the request method as POST, the request header as Api-Key:{your_api_key}, and the request body example as {"message":"
[0142] HK-KF-2024-00310 What is the current progress? "}, call the intelligent question and answer open interface, and specify the response type to be received as text / event-stream.
[0143] Step 5: The AI open platform receives and processes the open interface request
[0144] 1) The AI open platform verifies the availability and permissions of the ApiKey parameter carried in the request header. If the verification fails, an error message is returned. If the verification succeeds, subsequent processing continues.
[0145] 2) After receiving the user input, the large language model configured in the application parses and understands the input content, infers whether the user input needs to call the function defined by the application based on the pre-trained data and algorithm, and determines the name of the called function and its parameters;
[0146] 3) If the model inference determines that a function needs to be called, a structured output containing the function call and required parameters is generated, usually a JSON object containing information such as the function name and parameter list. The data format example is as follows:
[0147] {
[0148] "name":"get_current_order_status",
[0149] "arguments":
[0150] {
[0151] "order_no":"HK-KF-2024-00310"
[0152] }
[0153] }
[0154] 4) The system parses the JSON object output by the model, obtains the name of the calling function as "get_current_order_status", the calling function parameter order_no as "HK-KF-2024-00310", and then calls the function. After the call is successful, the function call result is obtained, which is assumed to be "under approval by the product manager";
[0155] 5) After the function call is completed, the function call result and the user input content are used as context information, assembled into a prompt word prompt through a prompt word template and submitted to the large language model configured by the application. The summary and generated results are returned to the user, such as: "Work order HK-KF-2024-00310 is currently under approval by the product manager. Please wait patiently for the approval to be completed."
[0156] It can be seen that through the solution of this application, the SaaS platform can efficiently integrate enterprise resources, realize platform support, and provide an end-to-end SaaS solution. Third-party application systems or assistants only need to connect to this platform and use the ApiKey interface call method to enable the internal system of the enterprise to quickly access their respective business data and knowledge, thereby realizing artificial intelligence question and answer. By integrating advanced intelligent technologies, the digital transformation and high-quality development of the civil aviation industry are promoted. This application solves information security problems such as internal information leakage in enterprises. While accessing the enterprise intranet, it also ensures that data security is autonomous and controllable. It also supports offline deployment of enterprises to solve the problem of relying on external public network access. It complies with the data usage specifications of the civil aviation industry. This application also supports the connected application to configure custom functions, perform semantic recognition and inference on user input content, perform function parsing and calling, so as to achieve real-time acquisition of the business data capabilities of the access application, and can perform some specific tasks, such as data processing, information query, function call, etc. This function provides a more intelligent way of interaction, simplifies the workflow, and meets the custom requirements of the access application. This application is adapted to the domestic Kirin operating system, domestic Haiguang CPU, domestic Dameng database, etc.
[0157] Based on the same inventive concept, the present application also provides a computer-readable storage medium storing one or more programs. When the one or more programs are executed, the aforementioned intelligent question-and-answer platform for the civil aviation industry under the SaaS model can be implemented.
[0158] like Figure 5 As shown, the embodiment of the present application further provides a device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus.
[0159] The memory is a computer-readable storage medium for storing one or more programs.
[0160] The processor is used to execute the program stored in the computer-readable storage medium.
[0161] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments; or may exist independently without being assembled into the device / apparatus.
[0162] Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that it is still possible to modify the technical solutions described in the aforementioned embodiments, or to make equivalent replacements for some of the technical features therein; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An intelligent question-and-answer platform for the civil aviation industry under the SaaS model, comprising an intelligent question-and-answer assistant module, an AI open platform module, a core question-and-answer work module and a data storage module, characterized in that: The intelligent question-answering assistant module is used to provide a front-end application for users to conduct question-answering interactions. The front-end application analyzes the civil aviation related questions raised by users through natural language understanding, and retrieves, enhances, and generates corresponding answers or solutions from pre-set knowledge base documents, and returns them to users; The AI open platform module accesses different application systems through the open interface provided by the platform. When the user application is successfully created, it automatically generates an ApiKey according to the preset rules, and provides an open application programming interface OpenAPI and corresponding detailed documents and sample codes, so that the user application can call, integrate and use the document content-based intelligent question and answer and function call-based intelligent question and answer provided by the platform through the open interface; The core question-answering module is used to use user input content and document content or function call results as context information, assemble the context information into prompt words through prompt word templates, submit them to the large language model configured by the application, summarize and generate results and return them to the user; The data storage module is used for data persistence of the entire SaaS platform, including document data storage, platform relational data storage and text vector data storage of access applications. All types of data storage use application ID as the tenant field to logically isolate application data so that users of different applications can only access data and functions authorized under this application.
2. The platform according to claim 1, characterized in that When creating the user application, it also includes: the user specifies the application name, and configures a large language model and a text embedding model.
3. The platform according to claim 1, characterized in that: The core question-answering working module supports a working mode based on document processing on a SaaS platform. In the working mode based on document processing on a SaaS platform, after the application uploads a document on the platform, it first dynamically selects different types of document loaders by identifying the document format to convert the document content into text form; then the text data is preprocessed so that the input text can be divided into predefined units according to the specified granularity for subsequent analysis or processing; after the document is segmented into document fragments, the text embedding model configured by the application is used, combined with the self-attention mechanism of the model, to learn the semantic information of sentences or text segments in the text, and the text is converted into a continuous digital vector with a fixed dimension without relying on the position information of the sequence. After the document fragments are respectively embedded to obtain vector data, the element objects in the following format are traversed and constructed in a loop and stored in the vector database; after the user inputs a question, the text embedding model is used to embed the input content into text to obtain vector data, and the distance is calculated with the vector data stored in the vector database respectively. According to the calculation results, the text corresponding to the vector data with the closest distance and the user input content are finally used as context information, and assembled into prompt words through prompt word templates and submitted to the large language model configured by the application to generate an answer result.
4. The platform according to claim 3, characterized in that: The distance calculation specifically adopts the following formula: Where A represents the vector value of the user input content, B represents the vector value of the document segment, A·B represents the dot product of vectors A and B, ||A|| and ||B|| represent the moduli of vectors A and B respectively, and the calculation result range is [-1, 1]. After the calculation is completed, the top_k vector data are recalled from the calculation results, where top_k represents the k vector data with the closest semantics to the user input content, k>0.
5. The platform according to claim 3, characterized in that: The step of dividing the input text into predefined units according to the specified granularity further includes: Use a custom text splitter and specify chunk_size as 200, that is, split by 200 characters; specify overlap as 30, that is, keep the overlapping part as 30 characters, and recursively split the text by character; the specific principle is to define a separator list ["\n\n", "\n", "", ""], first try to split between two blank lines, a blank line, space and tab, that is, recursively apply the separator list to split the text until the text block reaches the specified chunk_size.
6. The platform according to claim 1, characterized in that: The core question-answering working module supports a working mode based on SaaS platform function calls. In the working mode based on SaaS platform function calls, after the application is successfully created on the platform, a new function definition is added, and JSON format input is supported; after the large language model configured by the application receives the user input, it understands the user's intention through context analysis, infers whether the user input needs to call a pre-defined function based on the pre-trained data and self-attention mechanism, and determines the name of the called function and its parameters; If the model inference determines that a function needs to be called, a formatted output containing the function call and required parameters, i.e., a JSON object, is generated; the model output is parsed by JSON, and the specified function is called with the corresponding parameters to obtain the function call result; The function call result and user input content are used as context information, assembled into prompt words through prompt word templates, and submitted to the large language model configured by the application. The summary and generated results are returned to the user.
7. The platform according to claim 6, characterized in that The JSON object includes the following information: name, indicating the function name; description, indicating the function description; parameters, indicating the parameter list; type, indicating the parameter type; required: indicates that the parameter is required.
8. The platform according to claim 1, characterized in that The data storage module uses the domestic relational database DM8 as a storage medium to store user information, application information, document information, configuration information and audit logs.
9. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed, the intelligent question-and-answer platform for the civil aviation industry under the SaaS model described in any one of claims 1 to 8 can be implemented.
10. A device comprising a processor, a communication interface, the computer-readable storage medium of claim 9, and a communication bus; wherein: The processor, the communication interface, and the computer-readable storage medium communicate with each other via a communication bus; It is characterized in that The processor is configured to execute a program stored in a computer-readable storage medium.
Citation Information
Cited By
Large language model streaming response processing method and device, medium, equipment and product
CN121705361A