AI optimization-based end exchange method and system
By using parallel multi-model calls and building a local knowledge base, the problems of limited functionality, fragmented management, and insufficient scalability in AI assistant systems have been solved. This has enabled efficient decision-making and robust sentence representation, and improved data utilization and paragraph topic prediction performance.
Patent Information
- Application Number
- CN202510461968.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-04-14
AI Technical Summary
Existing AI assistant systems suffer from problems such as limited functionality, fragmented management, poor knowledge base compatibility, and insufficient scalability, leading to performance bottlenecks and natural language model outputs that rely on local information and cannot effectively learn the semantics of sentence topics.
By using multi-model parallel invocation, intelligent expansion assistant market, unified API scheduling, and building a local knowledge base, it achieves asynchronous task scheduling, automatic tagging storage, multi-format parsing, and encrypted backup, and supports multi-API key polling and local data security.
It enables comparison of results from multiple models, improves decision-making efficiency, reduces API costs, supports multiple data sources, enhances the utilization of unstructured data, learns robust sentence representations, and improves paragraph topic prediction performance.
Smart Images

Figure CN120371963B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine learning, in particular to an AI optimization-based end exchange method and system. BACKGROUND
[0002] The AI optimization-based end exchange method introduces machine learning, deep learning, reinforcement learning and other technologies to dynamically optimize data exchange paths, traffic distribution and network load, thereby improving data transmission efficiency, reducing latency and enhancing network adaptability. Existing AI assistant systems generally have the following shortcomings:
[0003] Single function: only supports single model dialogue, and cannot compare the output results of different models horizontally;
[0004] Dispersed management: manual configuration of multiple service provider APIs is required, and there is a lack of unified management mechanism, which is easily affected by rate limits;
[0005] Poor knowledge base compatibility: most systems only support limited file formats, and lack of local data security protection;
[0006] Insufficient scalability: weak customizability, difficult to meet enterprise individual needs.
[0007] At present, the Chinese invention patent with application number CN202410460852.2 discloses a configurable flow switch with virtual channels for shared I / O ports, and the stored configuration data identifies the source input port and virtual input channel ID associated with the virtual output channel of the output port. Arbitration logic allocates bandwidth of a data router based on request signals associated with virtual input channels of input ports and configuration data associated with virtual output channels. However, different AI service providers may have different interfaces and response times in the prior art, which causes performance bottlenecks due to the delay of single requests, and the sentence representation output by the natural language model greatly depends on the local information of the sentence, cannot learn the theme semantics of the original sentence from the chaotic word order, and cannot learn more discriminative representations from sentence and paragraph representations at different granularities. SUMMARY
[0008] The technical problem solved by the present application is that different AI service providers may have different interfaces and response times in the prior art, which causes performance bottlenecks due to the delay of single requests, and the sentence representation output by the natural language model greatly depends on the local information of the sentence, cannot learn the theme semantics of the original sentence from the chaotic word order, and cannot learn more discriminative representations from sentence and paragraph representations at different granularities.
[0009] To solve the above technical problems, the application provides the following technical solutions: an end exchange method based on AI optimization, comprising the following steps:
[0010] Step S1: based on multiple models, asynchronous request multiple AI service provider interfaces are called in parallel, and interface request results are integrated to construct an asynchronous parallel task scheduling framework;
[0011] Step S2: intelligently expand the assistant market, and realize automatic tagging storage of dialogue records through dynamic grouping management;
[0012] Step S3: uniformly schedule service providers, support API key polling and interface compatibility adaptation;
[0013] Step S4: build a local knowledge base, and provide multi-format analysis, mixed retrieval and encrypted backup functions.
[0014] Preferably, the step S1 comprises:
[0015] A distributed task queue based on p-queue is adopted, a user input question is divided into multiple subtasks, the subtasks are called through a priority queue, the number of calls of each subtask is recorded, a uniform interface parameter is automatically generated through an adapter mode, the request parameters and return formats of different natural language model APIs are standardized, different natural language model APIs are compatible and called in parallel;
[0016] The intermediate value of the number of calls is calculated, the subtasks corresponding to the number of calls higher than the intermediate value are backed up and cached, and table format storage is performed by using libsql to obtain a subtask storage table, the subtask storage table comprises detailed task steps, task states and call numbers of the subtasks, and the subtask storage table is preferentially called to answer the user input question.
[0017] Preferably, each natural language model API is assigned a dedicated avatar and metadata code, multiple API requests are sent simultaneously by using a concurrent execution library asyncio, the interface numbers of the API requests are stored in the subtask storage table, when responses of each API interface are returned, the response routes corresponding to each task are stored in the subtask storage table, a communication connection of the natural language model API is performed, a virtual transmission channel is established for a task solving thread, a response subtask is obtained, the response information received in a unit of time is stored in a response queue, the responses are stored in the queue by using an optimal adaptation method, and the queue storing the response information is called for task response by using a genetic algorithm scheduling algorithm, and the task solving thread performs the most needed response operation at present.
[0018] Preferably, the step S2 comprises:
[0019] The user customizes the assistant logic through the prompt, the background automatically generates code and deploys the user input task as a microservice, inputs the microservice as a task execution thread into an industry-specific assistant, optimizes the task scheme of the industry-specific assistant through a lightweight fine-tuning scheme of LoRA, the industry-specific assistant includes an insurance claim settlement assistant, a product manager, and a merchant operation, automatically identifies dialogue key information based on a natural language model, extracts professional task feature labels corresponding to each industry-specific assistant from the professional task features of the dialogue key information, splits the task according to the professional task feature labels, obtains the sub-task category label of the user input question, and the sub-task storage table also includes the sub-task category label corresponding to the sub-task.
[0020] Preferably, the step S3 comprises:
[0021] Real-time monitoring of the key remaining amount and request delay of each natural language model API, dynamic allocation of the amount and request using a weighted round robin algorithm;
[0022] Deploying a timing crawler task, periodically accessing the official document pages of each service provider, parsing the latest model list, and automatically updating to the platform database.
[0023] Preferably, the step S4 comprises:
[0024] Building a multi-modal document parsing engine includes integrating MSOffice, embedjs-loader, and epub for document content extraction, combining OCR technology to parse image text in scanned PDF, and converting complex formats such as charts in PPTX into structured JSON data storage, and the document formats include txt, md, doc, docx, xls, xlsx, epub, and pdf file formats.
[0025] Preferably, building an unsupervised pre-training model, the task of optimizing text segmentation and paragraph theme prediction through AI includes improving the discrimination and prediction performance of the unsupervised pre-training model by comparing representations at different granularities, including sentences and paragraphs, training the model in a self-supervised manner, the text segmentation representation divides a long document into smaller paragraphs, the paragraphs are of different themes, and the paragraph theme prediction representation predicts the theme of the paragraph;
[0026] Building an unsupervised pre-training model based on a neural network model includes:
[0027] The data extracted from the local knowledge base establishes similar sample pairs and non-similar sample pairs. The existing data samples are modified by a data enhancement method to obtain similar samples. Other data samples are non-similar samples. The modification operation includes rotation, flipping, color adjustment, adding Gaussian noise, and vectorization enhancement of text segmentation. The vectorization enhancement logic includes: dividing each text segment into several words according to the meaning of the sentence, and converting each word into a d-dimensional vector after standardization. d is a constant;
[0028] The modification of the d-dimensional vector includes: respectively performing random deletion, all-0 replacement, random selection of b-dimensional corresponding features in the d-dimensional vector to replace 0, random shuffling of the d-dimensional vector order, and random probability p replacement of any feature value in the d-dimensional vector to 0;
[0029] The address of the similar sample stores the corresponding topic of the corresponding text segment. The non-similar sample does not store the corresponding topic.
[0030] Preferably, when the modification operation selects random shuffling of the d-dimensional vector order, the corresponding modified sentence is taken as the negative sample of the text segment, and whether the text segment order is chaotic is predicted. The prediction logic includes: randomly dividing the text segment into a segments, randomly selecting one of the 0 to a segments for comparison and outputting a similarity result. The similarity result includes 1 to a, that is, the text segment corresponds to one of the topic paragraphs from 1 to a;
[0031] The comparison of similarity includes:
[0032] Randomly deleting several words of the text segment, learning the corresponding topic classification of the remaining words through a neural network, randomly deleting several sentences of the text segment, learning the corresponding topic classification of the remaining sentences through a neural network, adding multiple 【0】 symbols at the end to reach the specified length for sentences with insufficient word count, and comparing the coincidence degree of the sentence topic classification and the topic classification label of the text segment in sequence to determine the similarity.
[0033] If the coincidence degree exceeds the preset coincidence percentage threshold, it means that the similar sample pair of the text segment exists in a certain topic paragraph from 1 to a, and the topic paragraph with the highest coincidence degree is output.
[0034] If the coincidence degree does not exceed the preset coincidence percentage threshold, it means that the text segment is a non-similar sample.
[0035] Compare the similarity of each text segment and record the similarity result as an undirected graph representation. According to the node association line of the undirected graph, the relationship between the similar samples and the non-similar samples of the text segment topics is predicted.
[0036] Pre-segmenting the document content semantically using the unsupervised pre-training model, generating a paragraph-level vector index, and storing the paragraph-level vector index in a LibSQL vector database;
[0037] When searching the LibSQL vector database, the user query statement is simultaneously vector feature extracted by a neural network, and high-relevance paragraphs are matched according to a cosine similarity method, and the high-relevance paragraphs are returned to the text segmentation context.
[0038] Preferably, Git-LFS is introduced into the local knowledge base to manage knowledge base versions, supporting incremental updates and historical version backtracking of documents;
[0039] An rsync algorithm is used to realize incremental backup, only transmitting changed data blocks, and an AES-256 encryption-based backup scheme is used to support sharding storage and off-site disaster recovery;
[0040] The local large model is run in a Docker container, and data transmission outside the container is prohibited through network isolation and permission control.
[0041] An AI-optimized end exchange system is used to perform an AI-optimized end exchange method, including an asynchronous parallel task scheduling module, an assistant market module, an API adaptation module, and a local knowledge base module:
[0042] The asynchronous parallel task scheduling module is used to call multiple AI service provider interfaces asynchronously in parallel based on multiple models, integrate interface request results, and construct an asynchronous parallel task scheduling framework;
[0043] The assistant market module is used to intelligently expand the assistant market, and automatically labelize and store dialogue records through dynamic grouping management;
[0044] The API adaptation module is used to uniformly schedule service providers, support API key polling, and adapt interface compatibility;
[0045] The local knowledge base module is used to construct a local knowledge base, provide multi-format analysis, hybrid retrieval, and encrypted backup functions.
[0046] The beneficial effects of the application are: innovative multi-answer, generating replies by parallel calling of multiple models, realizing result comparison and improving decision efficiency; introducing the concept of agent group chat through AI context characteristics, freely combining multiple agents to maximize the role of AI. Support multi-API key polling call to avoid rate limiting, optimize multi-model calling efficiency through load balancing algorithm and cache mechanism, and reduce API cost. Support local files (txt, md, doc, docx, xls, xlsx, epub, pdf), URL, site map and other data sources, provide segmented retrieval and export functions, combine OCR, semantic segmentation and vector retrieval to improve the utilization rate of unstructured data; modifying the existing data samples to obtain similar samples can learn the subject semantics of the original sentence with as little information as possible, so that the sentence representation output by the natural language model is not greatly dependent on the local information of the sentence, and can learn the subject semantics of the original sentence from the chaotic word order, which is more helpful for the model to learn robust representation, and by comparing the sentence and paragraph representation under different granularity, a more discriminative representation is learned, thereby improving the performance of paragraph theme prediction. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 The basic flow diagram of the AI optimization-based end exchange method provided by an embodiment of the application is shown. DETAILED DESCRIPTION
[0048] To make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the specific embodiments of the application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the application, not all embodiments.
[0049] REFERENCE Figure 1 For an embodiment of the application, an AI optimization-based end exchange method is provided, including the following steps:
[0050] Step S1: based on multi-model parallel calling, asynchronously request multiple AI service provider interfaces, and integrate interface request results to construct an asynchronous parallel task scheduling framework;
[0051] Step S2: intelligently expand the assistant market, and realize automatic tagging storage of dialogue records through dynamic grouping management;
[0052] Step S3: uniformly dispatch service providers, support API key polling and interface compatibility adaptation;
[0053] Step S4: build a local knowledge base, provide multi-format parsing, mixed retrieval and encryption backup functions. Step S1 includes:
[0054] The distributed task queue based on p-queue is adopted, the user input question is divided into multiple sub-tasks, the sub-tasks are called through the priority queue, the number of calls of each sub-task is recorded, the uniform interface parameters are automatically generated through the adapter mode, the request parameters and return formats of different natural language model APIs are standardized, different natural language model APIs are compatible and called in parallel, and the natural language model includes a statistical language model, a word vector-based model, a recurrent neural network (RNN) and its variants, an attention mechanism and a Transformer model, a pre-trained language model and a multi-modal model.
[0055] The intermediate value of the number of calls is calculated, the sub-tasks corresponding to the number of calls higher than the intermediate value are backed up and cached, and the libsql is used for table format storage, thereby obtaining a sub-task storage table, the sub-task storage table includes detailed task steps, task status and call number of the sub-task, the user input question is answered by preferentially calling the sub-task storage table, the API calling frequency is reduced and the response speed is improved.
[0056] Each natural language model API is assigned a dedicated avatar and metadata code to improve interaction recognition, and multiple API requests are sent simultaneously using the concurrent execution library asyncio, different AI service providers may have different interfaces and response times, asynchronous requests can avoid performance bottlenecks caused by delays in individual requests, the interface number of the API request is stored in the sub-task storage table, when the response of each API interface is returned, the response route corresponding to each task is stored in the sub-task storage table, the communication connection of the natural language model API is established, the virtual transmission channel is established for the task solving thread, the response information received in a unit of time is stored in the response queue, the response is stored in the queue through the best fitting method, and the queue storing the response information is dispatched through the genetic algorithm scheduling algorithm to call the task response, and the task solving thread performs the most needed response operation.
[0057] Step S2 includes:
[0058] The user defines the assistant logic through the prompt, the background automatically generates code and deploys the user input task as a microservice, the microservice is input as a task execution thread into an industry-specific assistant, the industry-specific assistant is optimized through the LoRA lightweight fine-tuning scheme, the industry-specific assistant includes an insurance claim settlement assistant, a product manager and a merchant operation, the natural language model is used to automatically identify key information of the dialogue, the professional task feature labels corresponding to each industry-specific assistant are obtained by extracting the professional task features of the key information of the dialogue, the task is split according to the professional task feature labels, the sub-task category labels of the user input question are obtained, and the sub-task category labels corresponding to the sub-tasks are also included in the sub-task storage table.
[0059] It supports data transfer between assistants, mainly through group chat @. For example, you can add the required assistants to a group, first @ the "translation assistant" to output the results, and then @ the "writing assistant" to write using the input original text and the "translation assistant's" results, thus realizing multi-assistant collaborative work.
[0060] Step S3 includes:
[0061] Real-time monitoring of the remaining key amount and request latency of each natural language model API, and dynamic allocation of key amount and requests using a weighted round-robin algorithm;
[0062] For example, keys with more remaining quota have higher weight to avoid overloading a single key, while supporting a single-model multi-API key round-robin scheduling algorithm to dynamically allocate requests based on the service provider's rate limit.
[0063] Deploy scheduled crawler tasks to periodically access the official documentation pages of various service providers, parse the latest model lists, and use embedjs-loader-web to extract model names and parameters from HTML and automatically update them to the platform database.
[0064] Step S4 includes:
[0065] The multimodal document parsing engine integrates MSOffice, embedjs-loader, and epub for document content extraction, combines OCR technology to parse images and text in scanned PDFs, and extracts complex formats and converts them into structured JSON data for storage. Complex formats include charts in PPTX, and document formats include txt, md, doc, docx, xls, xlsx, epub, and pdf. It also supports web document crawling.
[0066] The task of building an unsupervised pre-trained model and optimizing text segmentation and paragraph topic prediction through AI includes improving the discriminative and predictive performance of the unsupervised pre-trained model by comparing representations at different granularities, including sentences and paragraphs. The model is trained through self-supervision. Text segmentation representation divides a long document into smaller paragraphs with different topics. Paragraph topic prediction representation predicts the topic of the paragraph.
[0067] Building unsupervised pre-trained models based on neural network models includes:
[0068] The data extracted from the local knowledge base establishes similar sample pairs and non-similar sample pairs. The existing data samples are modified by a data enhancement method to obtain similar samples. Other data samples are non-similar samples. The modification operation includes rotation, flipping, color adjustment, adding Gaussian noise, and vectorization enhancement of text segmentation. The vectorization enhancement logic includes: dividing each text segment into several words according to the meaning of the sentence, and converting each word into a d-dimensional vector after standardization. The d-dimensional constant;
[0069] The modification of the d-dimensional vector includes: respectively performing random deletion, all-0 replacement, random selection of b-dimensional corresponding features in the d-dimensional vector to replace 0, random shuffling of the d-dimensional vector order, and random probability p replacement of any feature value in the d-dimensional vector to 0;
[0070] The address of the similar sample stores the corresponding topic of the corresponding text segment. The non-similar sample does not store the corresponding topic.
[0071] Modifying the existing data samples to obtain similar samples can learn the topic semantics of the original sentence with as little information as possible, so that the sentence representation output by the natural language model is not greatly dependent on the local information of the sentence, and the topic semantics of the original sentence can be learned from the chaotic word order, which is more helpful for the model to learn a robust representation.
[0072] When the modification operation selects random shuffling of the d-dimensional vector order, the corresponding modified sentence is taken as a negative sample of the text segment, and the text segment order is predicted. The prediction logic includes: randomly dividing the text segment into a segments, randomly selecting one of the 0 to a segments for comparison and outputting a similarity result. The similarity result includes 1 to a, that is, the text segment corresponds to one of the topic paragraphs from 1 to a;
[0073] The comparison process includes:
[0074] Randomly deleting several words of the text segment, learning the corresponding topic classification of the remaining words through a neural network, randomly deleting several sentences of the text segment, learning the corresponding topic classification of the remaining sentences through a neural network, promoting the model to infer the paragraph from the remaining part of the sentence, and helping the model to learn more important information from less information. The number of words is less than the set length of the sentence, which is achieved by adding multiple 【0】 symbols at the end to reach the specified length. The similarity is determined by sequentially comparing the sentence topic classification and the corresponding label of the text segment topic classification.
[0075] If the coincidence degree exceeds the preset coincidence percentage threshold, it indicates that the similar sample pair of the text segment exists in a topic paragraph from 1 to a, and the topic paragraph with the highest coincidence degree is output.
[0076] If the degree of coincidence does not exceed the preset coincidence percentage threshold, it indicates that the text segmentation is a non-similar sample;
[0077] The similarity of each text segmentation is compared, and the similarity result is recorded as an undirected graph representation, and the relationship between similar samples and non-similar samples between predicted text segmentation topics is represented according to the node association line of the undirected graph;
[0078] By comparing the sentence and paragraph representations at different granularities, a more discriminative representation is learned, thereby improving the performance of paragraph topic prediction.
[0079] An unsupervised pre-training model is used to perform semantic segmentation on the document content, generate a paragraph-level vector index, and store the paragraph-level vector index in a LibSQL vector database;
[0080] When searching the LibSQL vector database, the user query sentence is simultaneously subjected to vector feature extraction by a neural network, and high-relevance paragraphs are matched according to a cosine similarity method, and the high-relevance paragraphs are returned to the text segmentation context.
[0081] Git-LFS is introduced into the local knowledge base to manage the version of the knowledge base, support incremental updating and historical version backtracking of the document, and ensure the continuity and maintainability of the knowledge base;
[0082] Meanwhile, to ensure security, local backup and recovery options are added.
[0083] The rsync algorithm is used to realize incremental backup, only the changed data blocks are transmitted, the backup scheme based on AES-256 encryption is supported, and sharding storage and off-site disaster recovery are supported, the backup log is recorded locally to ensure the security of the local and cannot be tampered with, and the cloud data is not leaked by using AES-256 encryption backup;
[0084] The local large model is run in a Docker container, and data transmission outside the container is prohibited through network isolation and permission control. The model inference result is returned to the main system only through a secure channel. This function is provided as a value-added service.
[0085] The end exchange system based on AI optimization is used to execute the AI optimization-based end exchange method, including an asynchronous parallel task scheduling module, an assistant market module, an API adaptation module, and a local knowledge base module:
[0086] The asynchronous parallel task scheduling module is used to call multiple AI service provider interfaces based on multi-model parallel calling, integrate interface request results, and construct an asynchronous parallel task scheduling framework;
[0087] The assistant market module is used to intelligently expand the assistant market, and automatically label the storage of dialogue records through dynamic grouping management;
[0088] The API adaptation module is used for unified scheduling of service providers and supports API key polling and interface compatibility adaptation.
[0089] The local knowledge base module is used to build a local knowledge base, providing multi-format parsing, mixed retrieval, and encrypted backup functions.
[0090] This invention features an innovative one-question-multiple-answer approach, generating responses by calling multiple models in parallel, enabling result comparison and improving decision-making efficiency. Leveraging AI contextual characteristics, it introduces the concept of intelligent agent group chat, allowing multiple agents to be freely combined to maximize AI's effectiveness. It supports multi-API key polling calls, avoiding rate limitations, and optimizes multi-model call efficiency and reduces API costs through load balancing algorithms and caching mechanisms. It supports various data sources such as local files (txt, md, doc, docx, xls, xlsx, epub, pdf), URLs, and site maps, providing segmented retrieval and export functions. Combining OCR, semantic segmentation, and vector retrieval improves the utilization of unstructured data. Modifying existing data samples to obtain similar samples allows for learning the original sentence's topic semantics with minimal information, ensuring that the natural language model's output sentence representation is less dependent on local information and can learn the original sentence's topic semantics from disordered word order. This helps the model learn robust representations. By comparing sentence and paragraph representations at different granularities, it learns more discriminative representations, thereby improving paragraph topic prediction performance.
[0091] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (or computer- readable storage media) having computer-usable program code embodied in the medium. The medium can be any available storage media that can be accessed by a computer. By way of example, and not limitation, such computer-usable storage media can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other storage medium(s) that can be used to carry or store desired computer program code in the form of instructions or data structures and that can be accessed by a computer. Also, the present application can be embodied in a computer program product that can be traded as goods or merchandise, through the storage medium described above or any other suitable medium. Accordingly, the computer medium can be any entity or device containing, or Figure 1 the functions specified in the flow or flows and / or blocks Figure 1 the functions specified in the flow or flows and / or blocks
[0092] It should be noted that the above-mentioned embodiments are only used to illustrate but not to limit the technical solutions of the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application, and they should be covered in the scope of the claims of the present application.
Claims
1. An AI optimization based end exchange method, characterized by, Includes the following steps: Step S1: Based on multi-model parallel calls, asynchronously request multiple AI service provider interfaces and integrate the interface request results to build an asynchronous parallel task scheduling framework; Step S2: Intelligently expand the assistant market, realize automatic tagging and storage of dialogue records through dynamic group management, and enable multi-assistant collaborative work; Step S3: Unified scheduling of interface request results returned by multiple AI service provider interfaces. Unified scheduling includes dynamically allocating quotas and requests using a weighted round-robin algorithm, supporting API key round-robin and interface compatibility adaptation. Step S4: Build a local knowledge base, providing multi-format parsing, mixed search, and encrypted backup functions; Step S2 includes: Users customize assistant logic via prompts, and the backend automatically generates code and deploys user-input tasks as microservices. These microservices are then used as task execution threads to input into industry-specific assistants. The task schemes of these industry-specific assistants are optimized using a lightweight LoRA fine-tuning solution. These industry-specific assistants include insurance claims assistants, product managers, and merchant operations assistants. Based on a natural language model, key dialogue information is automatically identified, and professional task features are extracted from the key dialogue information to obtain professional task feature tags corresponding to each industry-specific assistant. Tasks are then split based on these professional task feature tags to obtain sub-task category tags for the user-input questions. The sub-task storage table also includes the sub-task category tags corresponding to the sub-tasks. The task of constructing an unsupervised pre-trained model and optimizing text segmentation and paragraph topic prediction through AI includes improving the discriminative and predictive performance of the unsupervised pre-trained model by comparing representations at different granularities, where the granularity includes sentences and paragraphs. The model is trained in a self-supervised manner. The text segmentation represents dividing a long document into smaller paragraphs, where the paragraphs are on different topics. The paragraph topic prediction represents predicting the topic of the paragraph. Building unsupervised pre-trained models based on neural network models includes: Similar and dissimilar sample pairs are established based on data extracted from the local knowledge base. Similar samples are obtained by modifying existing data samples through data augmentation methods, while other data samples are treated as dissimilar samples. Modification operations include rotation, flipping, color adjustment, adding Gaussian noise, and vectorization enhancement of text segments. The vectorization enhancement logic includes: dividing each text segment into several words according to the meaning of the sentences, standardizing each word and converting it into a d-dimensional vector and a d-dimensional constant. Modifying the d-dimensional vector includes: representing each d-dimensional vector by random deletion, replacing all zeros, randomly selecting the corresponding b-dimensional feature in the d-dimensional vector and replacing it with 0, randomly shuffling the order of the d-dimensional vectors, and replacing any feature value in the d-dimensional vector with 0 with a random probability p; The addresses of similar samples also store the corresponding topics of the corresponding text segments, while dissimilar samples do not store corresponding topics. When the modification operation selects to randomly shuffle the order of the d-dimensional vector, the corresponding modified statement is used as the negative sample of the text segment, and the order of the text segment is predicted to be disordered. The prediction logic includes: randomly dividing the text segment into a segments, randomly selecting one of the segments from 0 to a for comparison and outputting the similarity result. The similarity result includes 1 to a, that is, the text segment corresponds to one of the topic paragraphs of the segments from 1 to a. The process of comparing similarities includes: Randomly delete several words from the text segment, learn the corresponding topic classification of the remaining words through a neural network, randomly delete several sentences from the text segment, learn the corresponding topic classification of the remaining sentences through a neural network, add multiple [0] symbols to the end of sentences with insufficient word count to reach the specified length, and judge the similarity by comparing the overlap between the topic classification of sentences and the topic classification of text segments in sequence. If the overlap exceeds the preset overlap percentage threshold, it means that the similar sample pairs of the text segments exist in a certain topic paragraph in segments 1 to a, and the topic paragraph with the highest overlap is output. If the overlap does not exceed the preset overlap percentage threshold for the topic paragraphs, then the text segmentation is considered a non-similar sample. Compare the similarity of each text segment and record the similarity results as an undirected graph representation. Based on the node association lines of the undirected graph, predict the relationship between similar and dissimilar samples between the topics of the text segments. The unsupervised pre-trained model is used to perform semantic segmentation on the document content, generate paragraph-level vector indexes, and store the paragraph-level vector indexes in the LibSQL vector database. When searching the LibSQL vector database, the user query statement is simultaneously extracted using a neural network, and highly relevant paragraphs are matched according to the cosine similarity method. The highly relevant paragraphs are then returned to the text segmentation context.
2. The AI optimization based end exchange method of claim 1, wherein, Step S1 includes: A p-queue-based distributed task queue is used to break down user input questions into multiple subtasks. These subtasks are then called through a priority queue, and the number of calls for each subtask is recorded. Unified interface parameters are automatically generated using the adapter pattern, and the request parameters and return formats of different natural language model APIs are standardized to ensure compatibility with parallel calls to different natural language model APIs. The number of calls is calculated to be an intermediate value. Subtasks with a number of calls exceeding the intermediate value are backed up and cached, and stored in a table format using libsql to obtain a subtask storage table. The subtask storage table includes detailed task steps, task status, and number of calls for the subtasks. The subtask storage table is used first to answer user input questions. 3.The AI optimization-based end exchange method of claim 2, wherein, Each natural language model API is assigned a unique avatar and metadata encoding. Multiple API requests are sent simultaneously using the concurrent execution library asyncio. The interface number of each API request is stored in the subtask storage table. When the response of each API interface is returned, the response route corresponding to each task is stored in the subtask storage table. Communication connections are established between the natural language model APIs, and a virtual transmission channel is established for the task resolution thread. The subtask that obtains the response stores the response information received per unit time into the response queue. The response is queued using the best fit method, and the queue storing the response information is scheduled using a genetic algorithm to call the task response. The task resolution thread performs the most needed response operation at the moment.
4. The AI optimization based end exchange method of claim 1, wherein, Step S3 includes: Real-time monitoring of the remaining key amount and request latency of each natural language model API, and dynamic allocation of key amount and requests using a weighted round-robin algorithm; Deploy scheduled crawler tasks to periodically access the official documentation pages of various service providers, parse the latest model lists, and automatically update them to the platform database. 5.The AI optimization-based end exchange method of claim 1, wherein, Step S4 includes: The construction of a multimodal document parsing engine includes integrating MSOffice, embedjs-loader, and epub for document content extraction, combining OCR technology to parse image text in scanned PDFs, and extracting complex formats and converting them into structured JSON data for storage. The complex formats include charts in PPTX, and the document formats include txt, md, doc, docx, xls, xlsx, epub, and pdf file formats.
6. The AI-optimized end-to-end switching method as described in claim 1, characterized in that: Git-LFS is introduced into the local knowledge base to manage knowledge base versions, supporting incremental updates of documents and historical version rollback; Incremental backup is achieved using the rsync algorithm, which only transmits changed data blocks. The backup scheme is based on AES-256 encryption and supports fragmented storage and off-site disaster recovery. Run a large local model in a Docker container and prevent data from being transmitted outside the container through network isolation and access control.
7. An AI-optimized end-switching system, wherein the system is used to execute the AI-optimized end-switching method of any one of claims 1-6, characterized in that, It includes an asynchronous parallel task scheduling module, an assistant marketplace module, an API adaptation module, and a local knowledge base module: The asynchronous parallel task scheduling module is used to make asynchronous requests to multiple AI service provider interfaces based on multiple models in parallel, and integrate the interface request results to build an asynchronous parallel task scheduling framework. The assistant marketplace module is used to intelligently expand the assistant marketplace, and realize the automatic tagging and storage of dialogue records through dynamic group management, enabling multi-assistant collaborative work; The API adaptation module is used to uniformly schedule the interface request results returned by multiple AI service provider interfaces. The uniform scheduling includes dynamically allocating quotas and requests using a weighted round-robin algorithm, and supports API key round-robin and interface compatibility adaptation. The local knowledge base module is used to build a local knowledge base and provides multi-format parsing, mixed retrieval and encrypted backup functions; The assistant market module includes: Users customize assistant logic via prompts, and the backend automatically generates code and deploys user-input tasks as microservices. These microservices are then used as task execution threads to input into industry-specific assistants. The task schemes of these industry-specific assistants are optimized using a lightweight LoRA fine-tuning solution. These industry-specific assistants include insurance claims assistants, product managers, and merchant operations assistants. Based on a natural language model, key dialogue information is automatically identified, and professional task features are extracted from the key dialogue information to obtain professional task feature tags corresponding to each industry-specific assistant. Tasks are then split based on these professional task feature tags to obtain sub-task category tags for the user-input questions. The sub-task storage table also includes the sub-task category tags corresponding to the sub-tasks. The task of constructing an unsupervised pre-trained model and optimizing text segmentation and paragraph topic prediction through AI includes improving the discriminative and predictive performance of the unsupervised pre-trained model by comparing representations at different granularities, where the granularity includes sentences and paragraphs. The model is trained in a self-supervised manner. The text segmentation represents dividing a long document into smaller paragraphs, where the paragraphs are on different topics. The paragraph topic prediction represents predicting the topic of the paragraph. Building unsupervised pre-trained models based on neural network models includes: Similar and dissimilar sample pairs are established based on data extracted from the local knowledge base. Similar samples are obtained by modifying existing data samples through data augmentation methods, while other data samples are treated as dissimilar samples. Modification operations include rotation, flipping, color adjustment, adding Gaussian noise, and vectorization enhancement of text segments. The vectorization enhancement logic includes: dividing each text segment into several words according to the meaning of the sentences, standardizing each word and converting it into a d-dimensional vector and a d-dimensional constant. Modifying the d-dimensional vector includes: representing each d-dimensional vector by random deletion, replacing all zeros, randomly selecting the corresponding b-dimensional feature in the d-dimensional vector and replacing it with 0, randomly shuffling the order of the d-dimensional vectors, and replacing any feature value in the d-dimensional vector with 0 with a random probability p; The addresses of similar samples also store the corresponding topics of the corresponding text segments, while dissimilar samples do not store corresponding topics. When the modification operation selects to randomly shuffle the order of the d-dimensional vector, the corresponding modified statement is used as the negative sample of the text segment, and the order of the text segment is predicted to be disordered. The prediction logic includes: randomly dividing the text segment into a segments, randomly selecting one of the segments from 0 to a for comparison and outputting the similarity result. The similarity result includes 1 to a, that is, the text segment corresponds to one of the topic paragraphs of the segments from 1 to a. The process of comparing similarities includes: Randomly delete several words from the text segment, learn the corresponding topic classification of the remaining words through a neural network, randomly delete several sentences from the text segment, learn the corresponding topic classification of the remaining sentences through a neural network, add multiple [0] symbols to the end of sentences with insufficient word count to reach the specified length, and judge the similarity by comparing the overlap between the topic classification of sentences and the topic classification of text segments in sequence. If the overlap exceeds the preset overlap percentage threshold, it means that the similar sample pairs of the text segments exist in a certain topic paragraph in segments 1 to a, and the topic paragraph with the highest overlap is output. If the overlap does not exceed the preset overlap percentage threshold for topic paragraphs, then the text segmentation is considered a non-similar sample. Compare the similarity of each text segment and record the similarity results as an undirected graph representation. Based on the node association lines of the undirected graph, predict the relationship between similar and dissimilar samples between the topics of the text segments. The unsupervised pre-trained model is used to perform semantic segmentation on the document content, generate paragraph-level vector indexes, and store the paragraph-level vector indexes in the LibSQL vector database. When searching the LibSQL vector database, the user query statement is simultaneously extracted using a neural network, and highly relevant paragraphs are matched according to the cosine similarity method. The highly relevant paragraphs are then returned to the text segmentation context.
Citation Information
Patent Citations
Configurable flow switch with virtual channels for sharing I / O ports
CN118827593A
Text retrieval method based on graph convolution topological features and keyword features
CN115329046A
Method and system for performing paragraph matching knowledge questioning and answering on air traffic control industry based on large model
CN119046417A