End-side RAG implementation method and system based on fusion architecture
By implementing edge-side RAG based on a converged architecture, and utilizing browser-side initialization and local computation, the high cost and privacy risks of centralized AI platforms are resolved, enabling an efficient, secure, and flexible AI workflow that supports edge-cloud hybrid computing.
Patent Information
- Application Number
- CN202511555268.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-10-29
AI Technical Summary
In existing technologies, centralized AI platforms suffer from high vector database licensing fees, exponentially increasing GPU server cluster operation and maintenance costs, performance bottlenecks caused by limited user concurrency, and data privacy compliance risks. Traditional edge-side solutions suffer from insufficient computing performance, lack of hardware acceleration support, and difficulty in deploying complex AI models.
The approach adopts a front-end RAG implementation method based on a fusion architecture. It initializes the vectorization engine through the user's browser, performs vectorization processing of the local text knowledge base, and combines WebGPU or WebGL technology for retrieval and querying. It also dynamically calculates, unloads, and encrypts the storage, thus realizing an AI workflow with a pure front-end computing architecture.
It enables the operation of AI workflows with zero server-side costs, solves the problems of high computing power, high latency, and poor privacy of centralized platforms, improves performance, supports computing power in high-concurrency scenarios, meets data privacy compliance requirements, and supports the operation of intelligent agents in offline environments.
Smart Images

Figure CN121029322A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of artificial intelligence application architecture, specifically relating to an edge-side RAG implementation method and system based on a fusion architecture. Background Technology
[0002] For existing technologies, mainstream AI workflow platforms (such as Dify / Coze) adopt a centralized architecture, which has the following drawbacks: 1. High licensing fees for vector databases (such as Pinecone, etc.); 2. The operational costs of GPU server clusters are increasing exponentially; 3. Performance bottlenecks caused by limited user concurrency; 4. Compliance risks related to data privacy protection; Traditional end-side solutions have the following drawbacks: 1. Insufficient JavaScript computing performance; 2. Lack of hardware acceleration support; 3. Complex AI models are difficult to deploy; In summary, existing technologies lack intelligent agent workflow systems that do not rely on a central server, and cannot guarantee AI task processing performance while fundamentally optimizing the server-side cost structure. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention provides an edge-side RAG implementation method and system based on a converged architecture, which solves the technical problems in the prior art.
[0004] On one hand, the present invention provides the following technical solution: an edge-side RAG implementation method based on a converged architecture, comprising: Obtain the user's browser and initialize the vectorization engine through the user's browser to obtain the initialized vector model; Obtain the user's local text knowledge base, and vectorize the local text knowledge base based on the initialization vector model to obtain a vector knowledge base; Obtain the query text sent by the user, perform a search based on the query text and the vector knowledge base, and output the search results; Identify the full-cycle workload and make intelligent decisions based on the current network environment to achieve dynamic computational offloading. The full-cycle workload includes initialization work, vectorization work, and retrieval and query work. Identify full-cycle data, encrypt, store, and verify the full-cycle data to complete the implementation of edge-side RAG. The full-cycle data includes data from the local text knowledge base, data from the vector knowledge base, and data from the search results.
[0005] Compared to existing technologies, the beneficial effects of this invention are as follows: This invention replaces the traditional cloud-based vector computing architecture, achieving zero-server-cost operation of AI workflows through a pure front-end computing architecture, solving the three major pain points of centralized AI platforms: high computing power, high latency, and poor privacy; it addresses cost structure issues by eliminating dependence on expensive vector databases, saving over 70% of centralized server expenses, and avoiding uncontrollable costs arising from pay-as-you-go billing for GPU cloud services; it addresses performance bottlenecks by overcoming the HTTP request latency of traditional B / S architectures (reducing RTT time by an average of 300-500ms), and resolving the problem of a sudden drop in QPS due to insufficient server-side computing power in high-concurrency scenarios; it addresses privacy compliance issues by achieving an end-to-end closed loop of user data "from generation to consumption," avoiding the uploading of sensitive data to the cloud, and complying with the "data localization" requirements of data sovereignty regulations such as GDPR; and it addresses architectural flexibility issues by supporting the operation of intelligent agents in offline environments, achieving true edge-cloud hybrid computing elastic deployment.
[0006] Preferably, the step of initializing the vectorization engine through the user's browser to obtain the initialized vector model includes: Call the target interface to detect whether the user's browser supports the WebGPU API; If the user's browser supports the WebGPU API, then the adapter and device are requested. The limit computing capability parameters of the device are obtained through the limiting parameters in the adapter. Based on the limit computing capability parameters, capability negotiation is performed and the WebGPU-optimized and quantized WASM model is loaded to obtain the target vector engine. In the target vector engine, frequently used computing shaders are pre-compiled to obtain the initial vector model. If the user's browser does not support the WebGPU API, a degradation strategy will be implemented, which will backtrack to using WebGL and TensorFlow.js to load and run the model to obtain the initial vector model.
[0007] Preferably, the step of vectorizing the local text knowledge base based on the initialization vector model to obtain a vector knowledge base includes: The long text data in the local text knowledge base is divided into blocks according to a preset length to obtain several text blocks; The text blocks are input into the initialization vector model, and each text block is processed in parallel by a GPU computing unit to generate a high-dimensional vector representation. The dimension of the high-dimensional vector representation is dynamically selected based on the limit computing capability parameter. To obtain the generated vector: ; In the formula, For user equipment value, for Threshold; The generated vector is compressed into an integer vector using the preset instruction set provided by the WASM model; The integer vectors are stored in linear memory within the WASM model, and an efficient nearest neighbor search index is constructed using a hierarchical navigation small world graph to obtain the vector knowledge base.
[0008] Preferably, the step of performing a retrieval query based on the query text and the vector knowledge base to output retrieval results includes: The query text is sent to a Web Worker thread, where the query text is vectorized by initializing a vector model to obtain a query text vector. Based on the hierarchical navigation small-world graph, the candidate vector most similar to the query text vector is searched in the vector knowledge base; Calculate the candidate vector With the query text vector similarity between : ; In the formula, Representing candidate vectors respectively Query text vector The first in Word vectors, The number of word vectors. To prevent zero values; The top few candidate vectors with the highest similarity are selected as the search results, and the original text position pointers are attached to the search results.
[0009] Preferably, the step of making intelligent decisions on the full-cycle workload based on the current network environment to achieve dynamic computational offloading includes: Measure the current available bandwidth of the network used by the user. Based on the currently available bandwidth Calculate the unload value : ; In the formula, The computational workload for the entire lifecycle. Calculate the time threshold locally; If the uninstallation value is If so, then all workloads in the entire lifecycle workload will be forced to be completed locally; If the uninstallation value is The most intensive tasks in the entire workload are offloaded to the cloud, while the remaining tasks are completed locally, thus achieving dynamic computational offloading.
[0010] Preferably, the steps of identifying full-cycle data, encrypting, storing, and verifying the full-cycle data to complete the implementation of edge-side RAG include: The full-cycle data is encrypted using the WebCrypto API built into the user's browser and a preset encryption algorithm to obtain encrypted data. The encrypted data is stored in the user's browser's IndexedDB. An encryption key is generated from the user's password using a key derivation function, and the encryption key is sent to the user. Identify sensitive user actions and validate them using the WASM model to complete the implementation of the client-side RAG: ; In the formula, To verify the function, These are the common parameters, input data, and proof, respectively.
[0011] Secondly, the present invention provides the following technical solution: an edge-side RAG implementation system based on a converged architecture, the system comprising: An initialization module is used to obtain the user's browser and initialize the vectorization engine through the user's browser to obtain an initialization vector model. The vectorization module is used to obtain the user's local text knowledge base and perform vectorization processing on the local text knowledge base based on the initialization vector model to obtain a vector knowledge base; The query module is used to obtain the query text sent by the user, perform a search based on the query text and the vector knowledge base, and output the search results. The unloading module is used to identify the full-cycle workload and make intelligent decisions on the full-cycle workload based on the current network environment to achieve dynamic calculation unloading. The full-cycle workload includes initialization work, vectorization work, and retrieval query work. The verification module is used to identify full-cycle data, encrypt, store and verify the full-cycle data to complete the implementation of edge-side RAG. The full-cycle data includes data in the local text knowledge base, data in the vector knowledge base and data in the search results.
[0012] Thirdly, the present invention provides the following technical solution: a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the edge RAG implementation method based on the fusion architecture as described above.
[0013] Fourthly, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described edge RAG implementation method based on a converged architecture. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating the edge-side RAG implementation method based on a fusion architecture provided in Embodiment 1 of the present invention; Figure 2 This is a structural block diagram of the edge-side RAG implementation system based on a fusion architecture provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the hardware structure of a computer provided for another embodiment of the present invention.
[0016] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Detailed Implementation
[0017] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain embodiments of the present invention, and should not be construed as limiting the present invention.
[0018] Example 1 In Embodiment 1 of the present invention, as Figure 1 As shown, an edge-side RAG implementation method based on a converged architecture includes: S1. Obtain the user's browser and initialize the vectorization engine through the user's browser to obtain the initialized vector model; Specifically, the user browser here refers to the browser on the user's end. This step is specifically used to establish a high-performance heterogeneous computing environment in the user's browser to prepare for subsequent vectorized computation.
[0019] Step S1 includes: S11. Call the target interface to detect whether the user's browser supports the WebGPU API; Specifically, the target interface here is the navigator.gpu interface. By detecting whether the WebGPU API is supported, this is a prerequisite for enabling high-performance GPU accelerated computing.
[0020] S12. If the user's browser supports the WebGPU API, then request the adapter and the device, obtain the device's limit computing capability parameters through the limiting parameters in the adapter, negotiate the capability based on the limit computing capability parameters, and load the WebGPU-optimized and quantized WASM model to obtain the target vector engine. In the target vector engine, precompile frequently used computing shaders to obtain the initial vector model. Specifically, the limiting parameter here is adapter.limits, which is a set of parameters used to check the actual limitations of the physical GPU. The limit computing power parameters here include the maximum number of computing units, buffer size, etc. At the same time, after obtaining the WebGPU-optimized and quantized WASM model, its output model file is an FP16 precision model file to achieve faster loading and higher computing efficiency. Meanwhile, frequently used computation shaders are pre-compiled in the target vector engine. These computation shaders can be kernel functions for matrix multiplication (MMUL), and this process is a warm-up optimization process, avoiding the delays introduced by real-time compilation when critical calculations are performed for the first time.
[0021] S13. If the user's browser does not support the WebGPU API, a degradation strategy will be executed, and the model will be backloaded and run using WebGL and TensorFlow.js based on the degradation strategy to obtain the initial vector model. Specifically, if not supported, an automatic degradation strategy is implemented to ensure system compatibility and basic functional availability. WebGL (Web Graphics Library) is an API for rendering 3D graphics in web browsers. It allows developers to create complex graphics and animations using JavaScript and a subset of OpenGL ES 2.0. A major advantage of WebGL is that it allows direct rendering of 3D graphics in the browser without installing any plugins. TensorFlow.js is a JavaScript-based machine learning library developed by Google that allows developers to run machine learning models in the browser. TensorFlow.js supports running TensorFlow models in the browser and can leverage WebGL for GPU acceleration. Furthermore, TensorFlow.js provides many high-level APIs, making it easier for developers to create and train machine learning models.
[0022] S2. Obtain the user's local text knowledge base, and perform vectorization processing on the local text knowledge base based on the initialization vector model to obtain a vector knowledge base; Specifically, this step involves transforming the user's local text knowledge base into an efficient, fast-searchable vector index, all done on the browser side.
[0023] Step S2 includes: S21. Divide the long text data in the local text knowledge base into blocks according to a preset length to obtain several text blocks; Specifically, the preset length here is 64 characters. This is to adapt to the parallel computing architecture of GPUs, breaking down large tasks into numerous small task units that can be processed in parallel.
[0024] S22. The text blocks are input into the initialization vector model. Each text block is processed in parallel by a GPU computing unit to generate a high-dimensional vector representation. The dimension of the high-dimensional vector representation is dynamically selected according to the limit computing capability parameter. To obtain the generated vector: ; In the formula, For user equipment value, for Threshold; Among them, here The value is a unit for measuring computer performance, representing the number of floating-point operations per second.
[0025] S23. Compress the generated vector into an integer vector using the preset instruction set provided by the WASM model; Specifically, the generated vector (FP32 / FP16) can be compressed into an integer vector (INT8) through compression, and the default instruction set here is the SIMD (Single Instruction Multiple Data) instruction set.
[0026] S24. Store the integer vector in the linear memory of the WASM model, and use the hierarchical navigation small world graph to construct an efficient nearest neighbor search index to obtain the vector knowledge base; Specifically, the hierarchical navigation small-world graph is an index structure that significantly reduces the time complexity of retrieval from O(n) to O(log n), laying the foundation for real-time retrieval.
[0027] S3. Obtain the query text sent by the user, perform a search based on the query text and the vector knowledge base, and output the search results; Specifically, the purpose of this step is to quickly find the most relevant information in the local knowledge base in response to real-time user queries.
[0028] Step S3 includes: S31. The query text is sent to the Web Worker thread, and the query text is vectorized by initializing the vector model in the Web Worker thread to obtain the query text vector. Specifically, Web Worker threads can prevent blocking the user interface.
[0029] S32. Based on the hierarchical navigation small-world graph, search the vector knowledge base for the candidate vector that is most similar to the query text vector.
[0030] S33. Calculate the candidate vector. With the query text vector similarity between : ; In the formula, Representing candidate vectors respectively Query text vector The first in Word vectors, The number of word vectors. To prevent zero values; Specifically, the zero-prevention value here is The purpose is to prevent division by zero errors caused by zero vectors. The numerator uses SIMD parallel computation of the dot product, which is 6-8 times faster than JavaScript in WASM. Practice shows that this improvement improves the retrieval quality of low-dimensional vectors (384 dimensions) by 12%.
[0031] S34. Select the top few candidate vectors with the highest similarity as the search results, and attach the original text position pointer to the search results; Specifically, in this application, the top 3 results are selected as the final search results. Finally, the Web Worker returns the top 3 search results with the highest similarity and their position information in the original knowledge base to the main thread, which then obtains and displays the corresponding original text fragments.
[0032] S4. Identify the full-cycle workload and make intelligent decisions on the full-cycle workload based on the current network environment to achieve dynamic computational offloading. The full-cycle workload includes initialization work, vectorization work, and retrieval and query work. Specifically, the purpose of this step is to enable the system to have the elasticity of edge-cloud collaboration and to intelligently allocate computing tasks based on the current network and device status.
[0033] Step S4 includes: S41. Measure the current available bandwidth of the network used by the user. Based on the currently available bandwidth Calculate the unload value : ; In the formula, The computational workload for the entire lifecycle. Calculate the time threshold locally; S42, if the unloading value is If so, then all workloads in the entire lifecycle workload will be forced to be completed locally; S43, if the uninstallation value is The most intensive tasks in the entire workload are offloaded to the cloud, while the remaining tasks in the entire workload are completed locally, so as to achieve dynamic computational offloading. Specifically, in this application, the most computationally intensive task is the comparison of the similarity of high-dimensional vectors. That is, the above process is a cloud-based collaborative mode, but it does not upload all the data. Instead, it only offloads the most computationally intensive task (such as the comparison of the similarity of high-dimensional vectors) to the cloud, while the rest of the work is still completed locally, thereby reducing the amount of data transmission and balancing the load.
[0034] S5. Identify the full-cycle data, encrypt, store, and verify the full-cycle data to complete the implementation of the edge-side RAG. The full-cycle data includes data in the local text knowledge base, data in the vector knowledge base, and data in the search results. Specifically, this step spans the entire data processing lifecycle to ensure the confidentiality and privacy of user data.
[0035] Step S5 includes: S51. Use the WebCrypto API built into the user's browser and a preset encryption algorithm to encrypt the full-cycle data to obtain encrypted data; Specifically, the default encryption algorithm here is the AES-GCM algorithm.
[0036] S52. Store the encrypted data in the user's browser's IndexedDB, generate an encryption key from the user's password using a key derivation function, and send the encryption key to the user; Specifically, IndexedDB is a persistent storage service where the encryption key is generated from the user's password using a key derivation function (such as PBKDF2), achieving "key never leaves the end, data is stored in encrypted form".
[0037] S53. Identify sensitive user operations and verify them using the WASM model to complete the implementation of the client-side RAG: ; In the formula, To verify the function, These are the common parameters, input data, and proof, respectively. Specifically, the sensitive operation here can be to prove that the knowledge base has been searched but its content has not been leaked. This can be verified using zero-knowledge proofs (such as zk-SNARKs). The verification logic is implemented by the efficient WASM. The verifier does not need to access any original data to verify the authenticity of the calculation process, thus fundamentally eliminating the risk of data leakage.
[0038] The above steps are interconnected and together constitute a complete, efficient, secure, and extremely low-cost edge-side intelligent agent RAG solution.
[0039] The edge-side RAG implementation method based on a fusion architecture provided in Embodiment 1 of this invention replaces the traditional cloud-based vector computing architecture. It achieves zero-server-side cost operation of AI workflows through a pure front-end computing architecture, addressing the three major pain points of centralized AI platforms: high computing power, high latency, and poor privacy. It also solves cost structure issues by eliminating dependence on expensive vector databases, saving over 70% of centralized server expenses, and avoiding uncontrollable costs associated with pay-as-you-go GPU cloud services. Furthermore, it addresses performance bottlenecks by overcoming the HTTP request latency of traditional B / S architectures (reducing RTT time by an average of 300-500ms) and resolving the QPS drop caused by insufficient server-side computing power in high-concurrency scenarios. Finally, it addresses privacy compliance by achieving an end-to-end closed loop for user data "from generation to consumption," avoiding the uploading of sensitive data to the cloud and complying with the "data localization" requirements of data sovereignty regulations such as GDPR. Finally, it addresses architectural flexibility by supporting intelligent agent operation in offline environments, achieving true edge-cloud hybrid computing elastic deployment.
[0040] Example 2 like Figure 2 As shown, in Embodiment 2 of the present invention, an edge-side RAG implementation system based on a converged architecture is provided, the system comprising: Initialization module 1 is used to obtain the user's browser and initialize the vectorization engine through the user's browser to obtain the initialization vector model; Vectorization module 2 is used to obtain the user's local text knowledge base and perform vectorization processing on the local text knowledge base based on the initialization vector model to obtain a vector knowledge base; The query module 3 is used to obtain the query text sent by the user, perform a search based on the query text and the vector knowledge base, and output the search results. The unloading module 4 is used to identify the full-cycle workload and make intelligent decisions on the full-cycle workload based on the current network environment to achieve dynamic calculation unloading. The full-cycle workload includes initialization work, vectorization work, and retrieval query work. Verification module 5 is used to identify full-cycle data, encrypt, store and verify the full-cycle data to complete the implementation of edge RAG. The full-cycle data includes data in the local text knowledge base, data in the vector knowledge base and data in the search results. The initialization module 1 includes: The submodule is invoked to call the target interface to detect whether the user's browser supports the WebGPU API; The first initialization submodule is used to request the adapter and device if the user's browser supports the WebGPU API, obtain the device's limit computing capability parameters through the limit parameters in the adapter, negotiate the capability based on the limit computing capability parameters, and load the WebGPU-optimized and quantized WASM model to obtain the target vector engine. In the target vector engine, frequently used computing shaders are pre-compiled to obtain the initialization vector model. The second initialization submodule is used to execute a degradation strategy if the user's browser does not support the WebGPU API. Based on the degradation strategy, it backtracks to using WebGL and TensorFlow.js to load and run the model to obtain the initialization vector model.
[0041] The vectorization module includes: The segmentation submodule is used to segment long text data in the local text knowledge base into blocks of a preset length to obtain several text blocks. The generation submodule is used to input the text blocks into the initialization vector model. Each text block is processed in parallel by a GPU computing unit to generate a high-dimensional vector representation, and the dimension of the high-dimensional vector representation is dynamically selected according to the limit computing capability parameter. To obtain the generated vector: ; In the formula, For user equipment value, for Threshold; The compression submodule is used to compress the generated vector into an integer vector using a preset instruction set provided by the WASM model. The indexing submodule is used to store the integer vectors in linear memory within the WASM model and to construct an efficient nearest-neighbor search index using a hierarchical navigation small-world graph to obtain a vector knowledge base.
[0042] The query module 3 includes: The vectorization submodule is used to send the query text to the Web Worker thread, and to perform vectorization processing on the query text by initializing the vector model in the Web Worker thread to obtain the query text vector. The search submodule is used to search the vector knowledge base for the candidate vector that is most similar to the query text vector based on the hierarchical navigation small-world graph. The computation submodule is used to compute the candidate vector. With the query text vector similarity between : ; In the formula, Representing candidate vectors respectively Query text vector The first in Word vectors, The number of word vectors. To prevent zero values; The retrieval output submodule is used to select the top few candidate vectors with the highest similarity as the retrieval results, and to attach the original text position pointers to the retrieval results.
[0043] The unloading module 4 includes: The unload value submodule is used to measure the current available bandwidth of the user's network. Based on the currently available bandwidth Calculate the unload value : ; In the formula, The computational workload for the entire lifecycle. Calculate the time threshold locally; A local submodule, used if the uninstall value is... If so, then all workloads in the entire lifecycle workload will be forced to be completed locally; The collaborative submodule is used if the unload value is... The most intensive tasks in the entire workload are offloaded to the cloud, while the remaining tasks are completed locally, thus achieving dynamic computational offloading.
[0044] The verification module 5 includes: The encryption submodule is used to encrypt the full-cycle data using the WebCrypto API built into the user's browser and a preset encryption algorithm to obtain encrypted data. The storage submodule is used to store the encrypted data in the user's browser's IndexedDB, generate an encryption key from the user's password using a key derivation function, and send the encryption key to the user. The verification submodule is used to identify sensitive user actions and verify these actions using the WASM model to complete the implementation of the client-side RAG. ; In the formula, To verify the function, These are the common parameters, input data, and proof, respectively.
[0045] In other embodiments of the present invention, the present invention provides the following technical solution: a computer, including a memory 102, a processor 101, and a computer program stored on the memory 102 and executable on the processor 101, wherein the processor 101 executes the computer program to implement the edge RAG implementation method based on the converged architecture as described above.
[0046] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.
[0047] The memory 102 may include a large-capacity memory for data or instructions. For example, and not limitingly, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include removable or non-removable (or fixed) media. Where appropriate, the memory 102 may be internal or external to a data processing device. In a particular embodiment, the memory 102 is non-volatile memory. In a particular embodiment, the memory 102 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0048] The memory 102 can be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101.
[0049] The processor 101 implements the above-described edge RAG implementation method based on the fusion architecture by reading and executing computer program instructions stored in the memory 102.
[0050] In some embodiments, the computer may further include a communication interface 103 and a bus 100. For example, Figure 3 As shown, the processor 101, memory 102, and communication interface 103 are connected through bus 100 and complete communication with each other.
[0051] The communication interface 103 is used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of the present invention. The communication interface 103 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0052] Bus 100 includes hardware, software, or both, that couples components of a computer device together. Bus 100 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although specific buses are described and illustrated in the embodiments of the present invention, the present invention is contemplated by any suitable bus or interconnect.
[0053] The computer can execute the converged architecture-based edge RAG implementation method of the present invention based on the acquired converged architecture-based edge RAG implementation system, thereby realizing the converged architecture-based edge RAG implementation.
[0054] In some further embodiments of the present invention, in conjunction with the above-described edge RAG implementation method based on converged architecture, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described edge RAG implementation method based on converged architecture.
[0055] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0056] More specific examples of readable media (a non-exhaustive list) include: electrical connections (electronic devices) with one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0057] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0058] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0059] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for implementing edge-side RAG based on a converged architecture, characterized in that, include: Obtain the user's browser and initialize the vectorization engine through the user's browser to obtain the initialized vector model; Obtain the user's local text knowledge base, and vectorize the local text knowledge base based on the initialization vector model to obtain a vector knowledge base; Obtain the query text sent by the user, perform a search based on the query text and the vector knowledge base, and output the search results; Identify the full-cycle workload and make intelligent decisions based on the current network environment to achieve dynamic computational offloading. The full-cycle workload includes initialization work, vectorization work, and retrieval and query work. The system identifies full-cycle data, encrypts, stores, and verifies the full-cycle data to complete the implementation of edge-side RAG. The full-cycle data includes data from the local text knowledge base, data from the vector knowledge base, and data from the search results.
2. The edge-side RAG implementation method based on a converged architecture according to claim 1, characterized in that, The step of initializing the vectorization engine through the user's browser to obtain the initialized vector model includes: Call the target interface to detect whether the user's browser supports the WebGPU API; If the user's browser supports the WebGPU API, then the adapter and device are requested. The limit computing capability parameters of the device are obtained through the limiting parameters in the adapter. Based on the limit computing capability parameters, capability negotiation is performed and the WebGPU-optimized and quantized WASM model is loaded to obtain the target vector engine. In the target vector engine, frequently used computing shaders are pre-compiled to obtain the initial vector model. If the user's browser does not support the WebGPU API, a degradation strategy will be implemented, which will backtrack to using WebGL and TensorFlow.js to load and run the model to obtain the initial vector model.
3. The edge-side RAG implementation method based on a converged architecture according to claim 1, characterized in that, The step of vectorizing the local text knowledge base based on the initialization vector model to obtain a vector knowledge base includes: The long text data in the local text knowledge base is divided into blocks according to a preset length to obtain several text blocks; The text blocks are input into the initialization vector model, and each text block is processed in parallel by a GPU computing unit to generate a high-dimensional vector representation. The dimension of the high-dimensional vector representation is dynamically selected based on the limit computing capability parameter. To obtain the generated vector: ; In the formula, For user equipment value, for Threshold; The generated vector is compressed into an integer vector using the preset instruction set provided by the WASM model; The integer vectors are stored in linear memory within the WASM model, and an efficient nearest neighbor search index is constructed using a hierarchical navigation small world graph to obtain the vector knowledge base.
4. The edge-side RAG implementation method based on a converged architecture according to claim 1, characterized in that, The step of performing a retrieval query based on the query text and the vector knowledge base to output retrieval results includes: The query text is sent to a Web Worker thread, where the query text is vectorized by initializing a vector model to obtain a query text vector. Based on the hierarchical navigation small-world graph, the candidate vector most similar to the query text vector is searched in the vector knowledge base; Calculate the candidate vector With the query text vector similarity between : ; In the formula, Representing candidate vectors respectively Query text vector The first in Word vectors, The number of word vectors. To prevent zero values; The top few candidate vectors with the highest similarity are selected as the search results, and the original text position pointers are attached to the search results.
5. The edge-side RAG implementation method based on a converged architecture according to claim 1, characterized in that, The steps of making intelligent decisions on the full-cycle workload based on the current network environment to achieve dynamic computational offloading include: Measure the current available bandwidth of the network used by the user. Based on the currently available bandwidth Calculate the unload value : ; In the formula, The computational workload for the entire lifecycle. Calculate the time threshold locally; If the uninstallation value is If so, then all workloads in the entire lifecycle workload will be forced to be completed locally; If the uninstallation value is The most intensive tasks in the entire workload are offloaded to the cloud, while the remaining tasks are completed locally, thus achieving dynamic computational offloading.
6. The edge-side RAG implementation method based on a converged architecture according to claim 1, characterized in that, The steps of identifying full-cycle data, encrypting, storing, and verifying the full-cycle data to complete the implementation of edge-side RAG include: The full-cycle data is encrypted using the WebCrypto API built into the user's browser and a preset encryption algorithm to obtain encrypted data. The encrypted data is stored in the user's browser's IndexedDB. An encryption key is generated from the user's password using a key derivation function, and the encryption key is sent to the user. Identify sensitive user actions and validate them using the WASM model to complete the implementation of the client-side RAG: ; In the formula, To verify the function, These are the common parameters, input data, and proof, respectively.
7. An edge-side RAG implementation system based on a converged architecture, characterized in that, The system includes: An initialization module is used to obtain the user's browser and initialize the vectorization engine through the user's browser to obtain an initialization vector model. The vectorization module is used to obtain the user's local text knowledge base and perform vectorization processing on the local text knowledge base based on the initialization vector model to obtain a vector knowledge base; The query module is used to obtain the query text sent by the user, perform a search based on the query text and the vector knowledge base, and output the search results. The unloading module is used to identify the full-cycle workload and make intelligent decisions on the full-cycle workload based on the current network environment to achieve dynamic calculation unloading. The full-cycle workload includes initialization work, vectorization work, and retrieval query work. The verification module is used to identify full-cycle data, encrypt, store and verify the full-cycle data to complete the implementation of edge-side RAG. The full-cycle data includes data in the local text knowledge base, data in the vector knowledge base and data in the search results.
8. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the edge-side RAG implementation method based on a converged architecture as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the edge-side RAG implementation method based on a converged architecture as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Clinical research institution-oriented intelligent customer service processing method and device
CN119003723A
Government affair information intelligent retrieval and generation system applying RAG technology
CN119807261A
Retrieval report generation method and device based on local language model, equipment and medium
CN120407935A
Fused vector store for efficient retrieval-augmented ai processing
US20250292209A1