A cloud-edge collaborative inference method and device, electronic equipment and storage medium

CN122927552APending Publication Date: 2026-10-16EARDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611213278.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

但是,小模型受限于参数规模和表征能力,在处理复杂、多变的开放域任务时,存在推理深度不足、输出质量不稳定等突出问题

Benefits of technology

[0014] To address the shortcomings of existing technologies, this application provides a cloud-edge collaborative reasoning method. This method offers the following advantages: First, it matches the parent scenario corresponding to the task to be processed. When no available reference cases exist in the local scenario case library, the cloud's powerful computing capabilities generate target reference cases corresponding to the cognitive load level of the task. This fully leverages the comprehensive reasoning and knowledge reserves of the large cloud model, compensating for the shortcomings of the small edge model's representation capabilities. Furthermore, the edge device performs reasoning on the task based on the cognitive load level and the target reference cases. This allows for rapid output of simple tasks, reducing edge computing power and token consumption, and also improves the reasoning accuracy of complex tasks, balancing the reasoning time and accuracy of tasks with varying complexity. This application can fully utilize cloud capabilities to enhance the reasoning accuracy and quality at the edge, even under conditions of limited edge computing power.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927552A_ABST
    Figure CN122927552A_ABST
Patent Text Reader

Abstract

The application discloses a cloud-edge collaborative reasoning method and device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence. The method comprises the following steps: receiving a to-be-processed task, and determining a target parent class scene matched with the to-be-processed task; if a target reference case associated with the target parent class scene cannot be matched from a local scene case library, initiating a case generation request to a cloud service device; receiving a cognitive load level of the to-be-processed task and a target reference case corresponding to the cognitive load level sent by the cloud service device; and reasoning the target reference case and the cognitive load level through a reasoning model to obtain a reasoning result of the to-be-processed task. The technical scheme provided by the application can take into account the reasoning time length and reasoning accuracy of tasks with different complexities, and can also fully utilize the cloud capability to enhance the reasoning accuracy and reasoning quality of the edge side under the condition that the edge computing power is limited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a cloud-edge collaborative reasoning method, device, electronic device, and storage medium. Background Technology

[0002] Artificial intelligence technologies, exemplified by large language models, have made groundbreaking progress, demonstrating powerful semantic understanding, reasoning, and generation capabilities. However, these capabilities are typically accompanied by a massive number of parameters and computational resource requirements, making their deployment heavily reliant on high-performance cloud computing clusters. Meanwhile, edge computing scenarios (such as smart terminals, industrial field equipment, vehicle systems, and IoT gateways) have stringent requirements for real-time performance, data privacy, and network stability. Deploying inference capabilities to edge devices has become a significant trend. Currently, the industry primarily uses model lightweighting techniques (such as quantization, pruning, and knowledge distillation) to simplify large models into smaller models for deployment on edge devices. However, small models, limited by parameter size and representational capabilities, suffer from insufficient inference depth and unstable output quality when handling complex and variable open-domain tasks. Therefore, how to fully utilize cloud computing power to improve the inference accuracy and quality of edge models under conditions of limited edge computing power is a pressing issue in the field of cloud-edge collaborative large model inference. Summary of the Invention

[0003] This application provides a cloud-edge collaborative reasoning method, device, electronic device, and storage medium that can balance the reasoning time and accuracy of tasks with different complexities, and can also make full use of cloud capabilities to enhance the reasoning accuracy and quality on the edge side under the condition of limited edge computing power.

[0004] Firstly, this application provides a cloud-edge collaborative reasoning method applied to edge devices. The method includes: receiving a task to be processed and determining a target parent scenario that matches the task to be processed; if no target reference case associated with the target parent scenario can be matched from a local scenario case library, a case generation request is initiated to a cloud service device, wherein the local scenario case library is used to store the mapping relationship between each parent scenario and each prompt case; receiving the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level sent by the cloud service device; and reasoning about the target reference case and the cognitive load level through a reasoning model to obtain the reasoning result of the task to be processed.

[0005] Furthermore, the step of reasoning about the target reference case and the cognitive load level through an inference model to obtain the inference result of the task to be processed includes: planning a corresponding token quota based on the cognitive load level and reserving decoding space, wherein the reserved decoding space is a preset percentage of the maximum context length supported by the edge device; determining the inference rounds for the target reference case based on the cognitive load level; assembling the target reference case and the task to be processed according to preset rules to obtain a prompt text, wherein the prompt text satisfies the constraints of the token quota; and within the reserved decoding space... Within the scope, the inference model is used to perform autoregressive decoding on the prompt text to generate an inference result. If the inference round is completed, a self-evaluation is performed on the inference result. If the self-evaluation is satisfactory, the inference result is taken as the final inference result. If the inference round is not completed, an inference chain example corresponding to the next inference round is added to the original prompt text to generate a new prompt text. The inference result generated by the previous inference is reused, and the autoregressive decoding step of the prompt text and the self-evaluation step of the inference result are repeated. This continues until the self-evaluation of any inference round is satisfactory, at which point the inference result of the current inference round is taken as the final inference result.

[0006] Furthermore, the method also includes: if the reasoning round is completed but the self-assessment still fails to meet the standard, then generating a case enhancement request based on the attention entropy during the reasoning process and sending the case enhancement request to the cloud service device; receiving the enhanced reference case sent by the cloud service device; adding the enhanced reference case to the original prompt text, and restarting the reasoning operation until the self-assessment of the reasoning result meets the standard or the preset maximum reasoning round is reached.

[0007] Furthermore, the cognitive load level is used to represent the reasoning depth of a single reference case. Each cognitive load level corresponds to a reference case with a certain reasoning depth. The cognitive load level is determined by the number of logical steps in the reasoning chain, the number of independent concepts in the reasoning chain, and the number of conditional branches in the reasoning chain.

[0008] Furthermore, the target reference case includes a comparison block of correct and incorrect reasoning paths; when the cognitive load level reaches a preset level, the target reference case also includes intermediate reasoning steps; the generation method of the comparison block includes the following steps: generating correct reasoning paths based on the thinking chain strategy; generating a preset number of incorrect reasoning paths by simulating the hasty reasoning characteristics of a small model or by using adversarial prompts; performing security verification on the incorrect reasoning paths, and encapsulating the task description, the correct reasoning paths, and the security-verified incorrect reasoning paths into a structured comparison block; wherein each incorrect reasoning path includes at least a description of the reasoning process, defect type, defect location, and correction instructions; the comparison block includes at least a task description, a list of correct reasoning paths, and a list of incorrect reasoning paths.

[0009] Furthermore, after receiving the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level sent by the cloud service device, the method further includes: establishing a mapping relationship between the target reference case and the corresponding target parent scenario; and storing the target reference case and the mapping relationship in the local scenario case library.

[0010] Furthermore, the method also includes: performing a sensitivity assessment on at least one of the text content of the task to be processed, its parent scenario, user privacy configuration, and the proportion of sensitive entities, and determining a corresponding information upload strategy based on the assessment results; when the information upload strategy is a first privacy mode, identifying sensitive entities in the task to be processed, replacing the sensitive entities with preset placeholders to generate a desensitized template, and uploading the desensitized template to the cloud service device; when the information upload strategy is a second privacy mode, uploading the semantic abstract tag of the task to be processed to the cloud service device.

[0011] Secondly, this application provides a cloud-edge collaborative reasoning device integrated into an edge device. The device includes: a scene matching module for receiving a task to be processed and determining a target parent scene that matches the task; a request generation module for initiating a case generation request to a cloud service device if no target reference case associated with the target parent scene can be matched from a local scene case library, wherein the local scene case library stores the mapping relationship between each parent scene and each prompt case; a data receiving module for receiving the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level sent by the cloud service device; and a task processing module for reasoning about the target reference case and the cognitive load level using a reasoning model to obtain the reasoning result of the task to be processed.

[0012] Thirdly, this application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the cloud-edge collaborative inference method described in any embodiment of this application.

[0013] Fourthly, this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the cloud-edge collaborative inference method described in any embodiment of this application.

[0014] To address the shortcomings of existing technologies, this application provides a cloud-edge collaborative reasoning method. This method offers the following advantages: First, it matches the parent scenario corresponding to the task to be processed. When no available reference cases exist in the local scenario case library, the cloud's powerful computing capabilities generate target reference cases corresponding to the cognitive load level of the task. This fully leverages the comprehensive reasoning and knowledge reserves of the large cloud model, compensating for the shortcomings of the small edge model's representation capabilities. Furthermore, the edge device performs reasoning on the task based on the cognitive load level and the target reference cases. This allows for rapid output of simple tasks, reducing edge computing power and token consumption, and also improves the reasoning accuracy of complex tasks, balancing the reasoning time and accuracy of tasks with varying complexity. This application can fully utilize cloud capabilities to enhance the reasoning accuracy and quality at the edge, even under conditions of limited edge computing power.

[0015] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on a computer-readable storage medium. This computer-readable storage medium may be packaged together with the processor of the cloud-edge collaborative inference device, or it may be packaged separately from the processor of the cloud-edge collaborative inference device; this application does not impose any limitations on this.

[0016] The descriptions of the second, third, and fourth aspects in this application can be referenced to the detailed description of the first aspect; and the beneficial effects described in the second, third, and fourth aspects can be referenced to the analysis of the beneficial effects of the first aspect, which will not be repeated here.

[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description.

[0018] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart illustrating a cloud-edge collaborative reasoning method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a cloud-edge collaborative inference device provided in an embodiment of this application; Figure 3 This is a block diagram of an electronic device used to implement a cloud-edge collaborative reasoning method according to an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0022] The terms "first," "second," "target," and "original," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprising," "having," and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] It should be noted that the information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and it does not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.

[0024] Figure 1 This is a flowchart illustrating a cloud-edge collaborative inference method provided in this application embodiment. This embodiment is applicable to scenarios where cloud service devices and edge devices collaborate to perform large model inference. The cloud-edge collaborative inference method provided in this embodiment can be executed by the cloud-edge collaborative inference device provided in this application embodiment. This device can be implemented through software and / or hardware and integrated into the electronic device executing the method. Preferably, the electronic device in this application embodiment can be an edge device, such as an edge small model.

[0025] See Figure 1 The method in this embodiment includes, but is not limited to, the following steps: S110. Receive the task to be processed and determine the target parent scenario that matches the task to be processed.

[0026] In this embodiment, the edge device receives a task to be processed from user input. The task to be processed can be natural language text, multimodal input, or a preprocessed structured request. The task text of the task to be processed can be denoted as x=[x1, x2, ..., x...]. n ], x i Let i represent the i-th word element, where i can be 1 to n.

[0027] The edge device's scene classification module performs preliminary semantic classification of the task to be processed with low computational overhead, mapping it to a parent scene in a predefined scene hierarchy. The scene classification module employs a lightweight text classification model or a cascaded classification strategy that combines a rule engine with a lightweight model, ensuring that the computation time of the classification process is controlled within milliseconds, without significantly impacting the user experience.

[0028] The specific scene classification process can be as follows: The scene classification module first encodes the task text x into a semantic representation vector using a lightweight semantic representation model E(·). d is the semantic embedding vector dimension, for example, the semantic embedding vector dimension is 128 to 384. Then, the center vector of this vector and the preset K parent scene is calculated by the following formula (1). Cosine similarity between them: (1) The scene with the highest similarity is selected as the classification result using the following formula (2): (2) If the maximum similarity is lower than a preset threshold τ (e.g., τ=0.75), the task is marked as an unknown scenario, triggering an exception handling process or default classification. In the formula, v is the semantic representation vector corresponding to the task text. This is the center vector of a parent scene in the scene hierarchy. Let s be the cosine similarity between the semantic representation vector and the center vector, and let s be the classification result of the scene classification, i.e., the target parent scene.

[0029] A parent scenario is an abstract generalization of a class of business problems with similar semantic patterns, reasoning logic, or a unified problem-solving paradigm. For example, "compliance review of equipment inspection reports," "equipment fault diagnosis Q&A," and "production line process parameter optimization" can all be defined as parent scenarios. The design of parent scenarios can adopt a statically pre-configured expert knowledge system, or it can be dynamically discovered and summarized by the edge side in the semantic representation space through unsupervised clustering (such as K-Means or hierarchical clustering) during long-term operation.

[0030] S120. If no target reference case associated with the target parent scenario can be matched from the local scenario case library, a case generation request is sent to the cloud service device.

[0031] In this embodiment, the edge device maintains a local scene case library, which stores the mapping relationship between each parent scene and each prompt case. The target reference case can be a few-shot example. This mapping relationship can be denoted as... , Let N represent the i-th few-shot example, N be the number of examples, M be the target reference case, and s be the target parent scenario.

[0032] For the target parent scenario identified in step S110 above, the edge device first queries the local scenario case library. If the target parent scenario already has a related few-shot example, then the few-shot example is directly extracted as the target reference case. If the target parent scenario has not yet been associated with a few-shot example, or the associated example has expired (exceeding the preset validity period threshold), then the edge device initiates a case generation request to the cloud service device.

[0033] A case generation request can be used to request cloud service devices to generate corresponding target reference cases for a target parent scenario. The case generation request can include at least the identifier of the target parent scenario, and optionally also the task feature vector of the target parent scenario, the edge device capability description (such as model type, context length limit, output format requirements), and user-defined domain constraints.

[0034] S130, Receive the cognitive load level of the pending task and the target reference case corresponding to the cognitive load level sent by the cloud service device.

[0035] In this embodiment, after receiving a case generation request, the cloud service device not only generates corresponding target reference cases for the target parent scenario, but also determines the cognitive load level of the task to be processed. Optionally, the cloud service device may also simultaneously label the corresponding cognitive load level when generating each target reference case for subsequent progressive inference scheduling.

[0036] In some embodiments, the cognitive load level is used to represent the reasoning depth of a single reference case. Each cognitive load level corresponds to a reference case of a certain reasoning depth. The cognitive load level is determined by the number of logical steps in the reasoning chain, the number of independent concepts in the reasoning chain, and the number of conditional branches in the reasoning chain. The number of logical steps in the reasoning chain corresponds to the detail of the few-shot case examples.

[0037] For example, suppose cognitive load is divided into four levels: L1 to L4. The information for each cognitive load level is represented in Table 1 below: Table 1 Information on cognitive load levels For example, the method for determining cognitive load levels can be represented by the following formula (3): (3) Where L is the cognitive load level, and f is the weighted summation function. The logical number of steps in the reasoning chain. The number of independent concepts involved in the reasoning chain. This represents the number of conditional branches in the reasoning chain.

[0038] In some embodiments, the target reference case includes a comparison block of correct and incorrect reasoning paths; when the cognitive load level reaches a preset level (such as L3), the target reference case also includes intermediate reasoning steps.

[0039] In some embodiments, the cloud service device labels the cognitive load level of each reference case and then distributes it to the edge device along with the reference case.

[0040] In some embodiments, after receiving the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level sent by the cloud service device, the method further includes: establishing a mapping relationship between the target reference case and the corresponding target parent scenario; and storing the target reference case and the mapping relationship in a local scenario case library.

[0041] The following are examples of cloud service devices generating high-quality targets. For example, cloud service devices utilize powerful large language models to generate target reference cases (i.e., few-shot examples) based on the following four strategies: Strategy 1: Synthesis Generation Strategy. The cloud service device generates target reference cases based on the scenario definition of the target parent scenario. During the generation process, advanced instruction evolution techniques such as self-instruction generation methods and evolutionary instruction generation methods can be used to ensure that the examples cover typical variations and boundary cases under the target parent scenario.

[0042] Strategy 2: Enhanced Knowledge Base Retrieval Strategy. The cloud service device retrieves a reference material library related to the target parent scenario, and extracts or rewrites the target reference cases from this library. The reference material library may include at least one of the following: a domain knowledge base, historical dialogue records, and an annotated case library.

[0043] Strategy 3: Enhanced Thinking Chain Strategy. For complex parent-class scenarios requiring multi-step reasoning, the target reference cases generated by cloud service devices not only contain the final answer but also the complete intermediate reasoning steps. This has the advantage of guiding edge small models to perform deep reasoning.

[0044] Strategy 4: Adversarial cognitive contrast strategy. Cloud service devices generate structured contrast blocks containing correct reasoning paths and typical incorrect reasoning paths. The advantage of this is that it can guide small edge models to develop error avoidance capabilities.

[0045] In some embodiments, the generation of the comparison block includes the following steps: (1) The cloud service device generates the correct reasoning path based on the thinking chain strategy. The correct reasoning path may include a complete chain of reasoning steps and the final answer.

[0046] (2) The cloud service device generates a preset number of erroneous reasoning paths by simulating the hasty reasoning characteristics of the small model or by guiding it with adversarial prompts. Example 1: After outputting the correct path, by limiting the number of reasoning steps (e.g., to within 3 steps) or using high temperature parameter sampling (τ>1.5), the hasty reasoning characteristics of the small model are simulated, generating erroneous reasoning paths due to the short reasoning chain. Example 2: Design adversarial prompts to guide the cloud model to generate erroneous reasoning paths that "seem reasonable but contain omissions of key facts, logical jumps, causal inversions, or overgeneralizations." For example, the format of the adversarial prompt could be: Assume you are a small model with limited reasoning ability, only possessing partial facts and omitting key constraints. Based on the following task, output a reasoning process and conclusion that "seems reasonable but is actually incomplete or incorrect," and clearly point out where the problem lies.

[0047] (3) The cloud service equipment performs security verification on the erroneous inference path to ensure that the erroneous path does not introduce dangerous instructions, encode discriminatory content, or violate security guidelines. Each erroneous inference path shall include at least a description of the inference process, the defect type, the defect location, and a correction description.

[0048] (4) The cloud service device encapsulates the task description, the correct inference path, and the incorrect inference path that has passed security verification into a structured comparison block. The comparison block includes at least the task description, the correct inference path, and the list of incorrect inference paths.

[0049] Optionally, this could also include attaching a contrastive header when injecting the contrast block into the prompt. This can guide the edge model to develop error avoidance awareness. For example, the contrastive header could be: "The following is a structured comparison of correct and incorrect reasoning paths in similar tasks. Note: The reasoning in the incorrect path may seem reasonable at first glance, but it hides critical flaws. Carefully distinguish between correct and incorrect reasoning patterns to avoid falling into similar reasoning traps."

[0050] In some embodiments, after the target reference cases are generated, the cloud service device may optionally perform a quality assessment on the case set. In a preferred embodiment, a self-consistent voting mechanism may be employed: the same set of candidate examples is sampled several times independently, and the result with the highest consistency rate is retained.

[0051] S140. Reason about the target reference case and cognitive load level through the reasoning model to obtain the reasoning result of the task to be processed.

[0052] In the embodiments of this application, simple tasks can be reasoned and output in advance with only a few basic cases. Complex tasks, on the other hand, gradually increase the number of cases injected (i.e., progressive reasoning), achieving a dynamic optimal balance between accuracy and efficiency.

[0053] In some embodiments, inference is performed on the target reference case and cognitive load level using an inference model to obtain the inference result of the task to be processed, including: planning the corresponding token quota based on the cognitive load level and reserving decoding space, the reserved decoding space being a preset percentage of the maximum context length supported by the edge device; determining the inference round for the target reference case based on the cognitive load level; assembling the target reference case and the task to be processed according to preset rules to obtain a prompt text, the prompt text satisfying the token quota constraint; within the reserved decoding space, performing autoregressive decoding on the prompt text using the inference model to generate an inference result; if the inference round is completed, performing a self-evaluation on the inference result; if the self-evaluation is satisfactory, using the inference result as the final inference result; if the inference round is not completed, adding an inference chain example corresponding to the next inference round to the original prompt text to generate a new prompt text, reusing the inference result generated by the previous inference, and repeatedly executing the autoregressive decoding step of the prompt text and the self-evaluation step of the inference result; until the self-evaluation of any inference round is satisfactory, using the inference result of the current inference round as the final inference result.

[0054] In one application example, the edge device performs global token budget planning before initiating progressive inference. Assume the maximum context length supported by the edge model is... Reserve decoding space (For example, take) (15% to 25% of the total). Token quotas are pre-allocated based on cognitive load level.

[0055] In one application example, suppose the cognitive load is divided into four levels: L1 to L4. L1's token quota is approximately 30% of the total token budget, loading only system instructions, L1-level cases, and task inputs. L2's token quota is approximately 55% of the total token budget, adding L2-level cases based on the previous inference result. L3's token quota is approximately 75% of the total token budget, adding L3-level cases based on the previous inference result. L4's token quota is approximately 90% of the total token budget, adding L4-level adversarial cases based on the previous inference result.

[0056] In one application example, the cognitive load level is L1, requiring only the first round of inference. Edge devices only load L1-level cases. Placeholders in the L1-level few-shot examples sent from the cloud service device are either replaced in reverse according to the local entity mapping table (as described in Strategy 1 above) or a general template is directly used (as described in Strategy 2 above). This is then assembled with the user's actual task input into an inference prompt, denoted as P1 (the prompt text). The structure of the assembled prompt text P1 satisfies the L1 token quota constraint.

[0057] The edge device invokes a locally deployed lightweight large language model to perform autoregressive decoding on the prompt text P1, generating the inference result for the first round, denoted as y1. The key-value cache generated in this round of inference is retained in memory, and subsequent rounds of inference can reuse the cached attention key-value pairs, performing forward computation only on newly injected case parts to avoid redundant computation.

[0058] After the first round of inference is completed, a first round of self-evaluation is also required. Specifically, the edge device performs a self-evaluation on the inference result y1 output from the first round and calculates a self-evaluation score. .

[0059] In a preferred embodiment, the self-check employs two modes: structured task self-check and open task self-check. The structured task self-check primarily examines the completeness of the output format (e.g., whether all required fields in a JSON file are filled), the reasonableness of the numerical range, and whether the output meets predefined schema constraints. The open task self-check primarily examines the logical consistency of the output, i.e., whether there are any contradictory statements. Lightweight semantic similarity detection can be used to segment the output by paragraphs or sentences and calculate the semantic conflict index between paragraphs. Finally, the self-check results of the structured task self-check and the open task self-check are weighted and summed to obtain the final self-check score.

[0060] If the self-test score is compared with a preset threshold, that is... , such as a preset threshold If the value equals 0.85, the early exit mechanism is triggered, preventing further token consumption for subsequent rounds of reasoning and directly outputting y1 as the final reasoning result. The advantage of this setup is that the early exit mechanism allows most simple, structured tasks to complete reasoning in the first round, significantly saving token consumption and reasoning latency. Then proceed to the second round of reasoning.

[0061] In one application example, the cognitive load level is L2, requiring a second round of inference. The edge device, based on the prompt text P1 from the first round of inference, injects L2-level cases (such as in the 2-4 step inference chain example) to form a new prompt, denoted as P2 (the new prompt text). The inference process reuses the key-value cache from the first round of inference, calculating new attention key-value pairs only for the newly injected L2 cases. Autoregressive decoding generates the inference result for the second round, denoted as y2, and performs a self-evaluation. If successful, y2 is directly output as the final inference result; otherwise, the third round of inference begins.

[0062] In one application example, the cognitive load level is L3, requiring a third round of inference. The edge device, based on the second-round inference prompt text P2, adds L3-level cases (such as multi-step inference + cross-domain knowledge integration) to form a new prompt, denoted as P3 (the new prompt text). The key-value caches from the first two rounds are reused, and autoregressive decoding generates the third-round output inference result, denoted as y3, which is then self-evaluated. If successful, y3 is directly output as the final inference result; otherwise, the fourth round of inference begins.

[0063] In one application example, the cognitive load level is L4, requiring a fourth round of inference. The edge device, based on the prompt text P3 from the third round of inference, injects additional L4-level cases (such as a case set containing adversarial cognitive contrast blocks). This round of inference is the last line of defense for the edge model to acquire error avoidance capabilities. The key-value caches from the first three rounds are reused, and autoregressive decoding generates the inference result for the fourth round, denoted as y4, which is then subjected to self-evaluation. If the fourth round of self-evaluation still fails (…), the process continues. If this occurs, the case enhancement mechanism will be triggered.

[0064] In some embodiments, the case enhancement mechanism of the method of this application may include: if the reasoning rounds are completed but the self-check evaluation still fails (i.e., the self-check still fails after four rounds of progressive reasoning), this application does not directly discard the reasoning result or downgrade it. Instead, the edge device generates a case enhancement request based on the attention entropy during the reasoning process and sends the case enhancement request to the cloud service device; the edge device receives the enhanced reference case sent by the cloud service device; the enhanced reference case is added on the basis of the original prompt text, and the edge device restarts the reasoning operation until the self-check evaluation of the reasoning result meets the standard or the preset maximum number of reasoning rounds is reached.

[0065] In one application example, the process of generating a case enhancement request can be as follows: the edge device records the self-attention matrix of each layer during the inference process. For the l-th layer, the attention entropy is calculated using the following formula (4): (4) in, It is the attention weight of the i-th token to the j-th token in the l-th layer self-attention matrix. It is the attention entropy of the l-th layer.

[0066] The overall perplexity (denoted as C) is calculated using the following formula (5): (5) in, The weights are layer weights. Shallow layers (closer to the input layer) have lower weights, while deep layers (closer to the output layer) have higher weights because deep attention patterns better reflect the model's reasoning confidence.

[0067] like This indicates that the model lacks confidence in its output. The edge device extracts a preset number of token positions (e.g., 3 to 8) with the highest attention entropy during inference and packages the context fragments corresponding to these positions into a "Confusion Snapshot." The Confusion Snapshot can contain three types of information: token position index (integer sequence), local attention distribution vector (floating-point sequence), and parent scene identifier. The Confusion Snapshot does not contain the original text content, the semantic representation vector corresponding to the task text, or model parameters or gradient information. Based on the content of the Confusion Snapshot, a case enhancement request is generated.

[0068] In one application example, the process of generating enhanced reference cases by the cloud service device can be as follows: The edge device sends a case enhancement request to the cloud service device. The cloud-based big data model analyzes the case enhancement request and, based on the pattern characteristics of attention distribution, determines the cognitive blind spot type of the edge device. The cognitive blind spot type can include at least one of the following: insufficient analogical reasoning, broken logical chains, knowledge gaps, and insufficient ambiguity resolution. Based on the diagnosed cognitive blind spot type, the cloud service device generates 2 to 4 enhanced reference cases, marks the corresponding cognitive blind spot type, and distributes them to the edge device.

[0069] Unlike conventional few-shot examples, enhanced reference cases target specific cognitive deficiencies, and their generation strategy is highly precise. For example: for insufficient analogical reasoning, they generate bridge analogical cases by tracing the analogical reasoning path from the known domain to the unknown domain. For broken logical chains, they insert additional explanatory steps before and after the break point in the reasoning chain, generating chain-complementing step-by-step cases. For knowledge gaps, they provide necessary background knowledge definitions before reasoning, generating pre-knowledge card cases. For insufficient ambiguity resolution, they compare multiple interpretations of ambiguous words and their reasoning consequences, generating positive and negative analysis cases.

[0070] In one application example, after receiving an enhanced reference case, the edge device appends it as an additional case to the original prompt text (at this point, the total token usage may exceed the progressive inference budget, so a dynamic context window expansion strategy is adopted), and re-executes the inference. This process can be iterated until the self-check evaluation of the inference result meets the standard or the preset maximum inference rounds are reached.

[0071] The technical solution provided in this embodiment receives a task to be processed and determines a target parent scenario that matches the task. If no target reference case associated with the target parent scenario can be matched from the local scenario case library, a case generation request is initiated to the cloud service device. The solution receives the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level from the cloud service device. The reasoning model then performs reasoning on the target reference case and the cognitive load level to obtain the reasoning result of the task to be processed. This solution first matches the parent scenario corresponding to the task to be processed. When there is no available reference case in the local scenario case library, the cloud's powerful computing power generates a target reference case corresponding to the cognitive load level of the task to be processed. This fully leverages the advantages of the cloud's large model in terms of complete reasoning and knowledge reserves, compensating for the shortcomings of the edge's small model in terms of representation capabilities. In addition, the edge device performs reasoning on the task to be processed based on the cognitive load level and the target reference case. This allows for rapid output of simple tasks, reducing edge computing power and token consumption, and also improves the reasoning accuracy of complex tasks. It can balance the reasoning time and accuracy of tasks with different complexities. This application can fully utilize cloud capabilities to enhance the reasoning accuracy and quality of the edge side under the condition of limited edge computing power.

[0072] In some embodiments, the method of this application further includes: performing a sensitivity assessment on at least one of the text content of the task to be processed, its parent scenario, user privacy configuration, and the proportion of sensitive entities, and determining a corresponding information upload strategy based on the assessment results; when the information upload strategy is a first privacy mode, identifying sensitive entities in the task to be processed, replacing the sensitive entities with preset placeholders to generate a desensitized template, and uploading the desensitized template to the cloud service device; when the information upload strategy is a second privacy mode, uploading a semantic abstract label of the task to be processed to the cloud service device. The semantic abstract label consists of a scenario identifier, intent type, semantic feature vector, statistics, and output format requirements.

[0073] In one application example, after completing scene classification, the edge device performs a sensitivity assessment of the task and automatically selects an information upload strategy based on the assessment results. The sensitivity assessment is based on one or more of the following dimensions: rule matching (detecting sensitive keywords and regular expressions in the text content), scene-level default strategy (certain parent scenes are marked as high privacy scenes), user privacy configuration, and the proportion of sensitive entities.

[0074] In one application example, when the information upload strategy is the first privacy mode (standard privacy mode), the edge device runs a lightweight named entity recognition model to identify sensitive entities (such as people, organizations, amounts, dates, ID numbers, device identifiers, etc.) in the task text, replaces the sensitive entities with placeholders, generates a de-identified template, maintains an entity mapping table locally, and uploads the de-identified template to the cloud service device.

[0075] In one application example, when the information upload strategy is in the second privacy mode (high privacy mode), the edge device does not upload any original text fragments, but only extracts semantic abstract tags (including scene identifiers, intent types, semantic feature vectors, statistics and output format requirements) and uploads the semantic abstract tags to the cloud service device.

[0076] The following section introduces case lifecycle management and scene drift adaptive detection. In some embodiments, the edge device performs enhanced lifecycle management of few-shot examples in the local scene case library, including existing functions (timeliness management, capacity management, quality feedback management) and a new scene drift detection mechanism.

[0077] Specifically: For timeliness management: Set an expiration date for each case set, automatically marking it as invalid after expiration. For capacity management: When local storage capacity reaches its limit, use a least recently used or least frequently used strategy to eliminate low-frequency access scenario cases. Preferably, a weighted comprehensive elimination strategy can be used. For quality feedback management: Edge devices record user satisfaction or automatic evaluation indicators based on inference from a set of few-shot examples. Use an exponentially weighted moving average to update the quality score of scenario cases. After accumulating sufficient historical user interaction data on edge devices, local computing power can be used to fine-tune or optimize the sorting of few-shot examples to better suit the expression habits and business preferences of specific users.

[0078] In some embodiments, scene drift adaptive detection is used to address the problem that static scene systems cannot adapt to the evolution of real-world task distribution. Scene drift adaptive detection may include the following steps: (1) Task distribution sliding window maintenance. The edge device maintains a task distribution sliding window for each parent scene s. , It is the semantic representation vector of the m most recent tasks belonging to this parent scenario (already calculated in step S110). The window size m is configurable, for example, it can be 100-500.

[0079] (2) Distribution drift detection. Periodically (or when the window capacity is reached), the distribution drift index within the window is calculated using the following formula (6): (6) in, As a distribution drift index, This represents the mean of the task vectors within the current window. This is the mean (baseline) of the task vectors when the parent class scene is first created.

[0080] (3) Concept drift detection. The keyword distribution of tasks within the window is tested using the following formula (7) (denoted as...). ): (7) in, This represents the frequency of occurrence of a specific keyword category in the current window. This represents the expected frequency in the baseline. If a newly emerging keyword category does not exist in the baseline and its proportion continues to rise (e.g., for three consecutive window periods), it is considered a concept drift.

[0081] (4) Tiered response strategy. When hour( A preset drift threshold (e.g., 0.2) is used to trigger a graded response based on the degree of drift. The degree of drift can include at least mild drift, moderate drift, and severe drift.

[0082] (5) Device Group Broadcast Warning. After receiving the drift signal, the cloud, in addition to performing the above-mentioned tiered response actions, also broadcasts a drift warning to other edge devices in the same device group (Deployment Group). A device group is defined as a collection of edge devices of the same model deployed in the same or similar business scenarios (such as a vehicle terminal group of a certain model, or a quality inspection terminal group of a certain production line). After receiving the warning, similar devices can prepare case updates in advance to reduce the service interruption window.

[0083] Figure 2 This is a schematic diagram of the structure of a cloud-edge collaborative inference device provided in an embodiment of this application, as shown below. Figure 2 As shown, the device 200 is integrated into an edge device and may include: Scene matching module 210 is used to receive the task to be processed and determine the target parent scene that matches the task to be processed; The request generation module 220 is used to send a case generation request to the cloud service device if no target reference case associated with the target parent scenario can be matched from the local scenario case library. The local scenario case library is used to store the mapping relationship between each parent scenario and each prompt case. Data receiving module 230 is used to receive the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level sent by the cloud service device; The task processing module 240 is used to reason about the target reference case and the cognitive load level through a reasoning model to obtain the reasoning result of the task to be processed.

[0084] In one embodiment, the task processing module 240 can be specifically used for: planning a corresponding token quota based on the cognitive load level and reserving decoding space, wherein the reserved decoding space is a preset percentage of the maximum context length supported by the edge device; determining the inference round for the target reference case based on the cognitive load level; assembling the target reference case and the task to be processed according to preset rules to obtain a prompt text, wherein the prompt text satisfies the token quota constraint; performing autoregressive decoding on the prompt text through the inference model within the reserved decoding space to generate an inference result; if the inference round is completed, performing a self-check evaluation on the inference result; if the self-check evaluation is satisfactory, using the inference result as the final inference result; if the inference round is not completed, adding an inference chain example corresponding to the next inference round to the original prompt text to generate a new prompt text, reusing the inference result generated by the previous inference, and repeatedly executing the autoregressive decoding step of the prompt text and the self-check evaluation step of the inference result; until the self-check evaluation of any inference round is satisfactory, using the inference result of the current inference round as the final inference result.

[0085] In one embodiment, the task processing module 240 can also be specifically used for: if the reasoning round is completed but the self-assessment still fails to meet the standard, generating a case enhancement request based on the attention entropy during the reasoning process and sending the case enhancement request to the cloud service device; receiving the enhanced reference case sent by the cloud service device; adding the enhanced reference case to the original prompt text, and restarting the reasoning operation until the self-assessment of the reasoning result meets the standard or the preset maximum reasoning round is reached.

[0086] In one embodiment, the cognitive load level is used to represent the reasoning depth of a single reference case. Each cognitive load level corresponds to a reference case with a certain reasoning depth. The cognitive load level is determined by the number of logical steps in the reasoning chain, the number of independent concepts in the reasoning chain, and the number of conditional branches in the reasoning chain.

[0087] In one embodiment, the target reference case includes a comparison block of correct and incorrect reasoning paths; when the cognitive load level reaches a preset level, the target reference case also includes intermediate reasoning steps. The generation method of the comparison block includes the following steps: generating a correct reasoning path based on the thought chain strategy; generating a preset number of incorrect reasoning paths by simulating the hasty reasoning characteristics of a small model or by using adversarial prompts; performing security verification on the incorrect reasoning paths; and encapsulating the task description, the correct reasoning path, and the incorrect reasoning paths that have passed the security verification into a structured comparison block; wherein each incorrect reasoning path includes at least a description of the reasoning process, a defect type, a defect location, and a correction description; and the comparison block includes at least a task description, a list of correct reasoning paths, and a list of incorrect reasoning paths.

[0088] In one embodiment, the cloud-edge collaborative reasoning device described above may further include: a case storage module; The case storage module is used to, after receiving the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level sent by the cloud service device, establish a mapping relationship between the target reference case and the corresponding target parent scenario; and store the target reference case and the mapping relationship in the local scenario case library.

[0089] In one embodiment, the cloud-edge collaborative inference device described above may further include: an information uploading module; The information upload module is used to perform sensitivity assessment on at least one of the following: text content of the task to be processed, its parent scenario, user privacy configuration, and proportion of sensitive entities, and determine the corresponding information upload strategy based on the assessment result; when the information upload strategy is a first privacy mode, it identifies sensitive entities in the task to be processed, replaces the sensitive entities with preset placeholders to generate a desensitized template, and uploads the desensitized template to the cloud service device; when the information upload strategy is a second privacy mode, it uploads the semantic abstract tag of the task to be processed to the cloud service device.

[0090] The cloud-edge collaborative reasoning device provided in this embodiment can be applied to the cloud-edge collaborative reasoning method provided in any of the above embodiments, and has the corresponding functions and beneficial effects.

[0091] Figure 3 This is a block diagram of an electronic device used to implement a cloud-edge collaborative reasoning method according to embodiments of this application. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0092] like Figure 3 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0093] Multiple components in electronic device 10 are connected to input / output (I / O) interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0094] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as cloud-edge collaborative inference methods.

[0095] In some embodiments, the cloud-edge collaborative inference method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via read-only memory (ROM) 12 and / or communication unit 19. When the computer program is loaded into random access memory (RAM) 13 and executed by processor 11, one or more steps of the cloud-edge collaborative inference method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the cloud-edge collaborative inference method by any other suitable means (e.g., by means of firmware).

[0096] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0097] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0098] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disc-read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0099] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0100] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0101] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to address the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.

[0102] Note that the above are merely preferred embodiments and technical principles applied in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. For example, those skilled in the art can use the various forms of processes shown above to reorder, add, or delete steps; the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution of this application can be achieved, and no limitations are imposed herein.

[0103] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A cloud-edge collaborative reasoning method, characterized in that, Applied to edge devices, the method includes: Receive the task to be processed and determine the target parent scenario that matches the task to be processed; If no target reference case associated with the target parent scenario can be matched from the local scenario case library, a case generation request is sent to the cloud service device. The local scenario case library is used to store the mapping relationship between each parent scenario and each prompt case. Receive the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level from the cloud service device; The reasoning model is used to infer the target reference case and the cognitive load level to obtain the reasoning result of the task to be processed.

2. The cloud-edge collaborative reasoning method according to claim 1, characterized in that, The step of reasoning about the target reference case and the cognitive load level using a reasoning model to obtain the reasoning result for the task to be processed includes: Based on the cognitive load level, a corresponding token quota is planned, and decoding space is reserved. The reserved decoding space is a preset percentage of the maximum context length supported by the edge device. The reasoning rounds for the target reference case are determined based on the cognitive load level. The target reference case and the task to be processed are assembled according to preset rules to obtain prompt text, which satisfies the constraints of the token quota. Within the reserved decoding space, the prompt text is autoregressively decoded using the inference model to generate an inference result; If the aforementioned reasoning rounds are completed, a self-check evaluation is performed on the reasoning results; If the self-assessment meets the standards, the reasoning result will be taken as the final reasoning result; If the inference round is not completed, add an example of the inference chain corresponding to the next inference round to the original prompt text, generate a new prompt text, reuse the inference result generated by the previous inference, and repeat the autoregressive decoding step of the prompt text and the self-checking evaluation step of the inference result. The reasoning results of the current reasoning round are taken as the final reasoning result once the self-assessment of any reasoning round meets the standard.

3. The cloud-edge collaborative reasoning method according to claim 2, characterized in that, The method further includes: If the reasoning round is completed but the self-assessment still fails to meet the standard, a case enhancement request is generated based on the attention entropy during the reasoning process, and the case enhancement request is sent to the cloud service device. Receive the enhanced reference case sent by the cloud service device; Add the enhanced reference cases to the original prompt text, and repeat the reasoning operation until the self-assessment of the reasoning results meets the standard or the preset maximum number of reasoning rounds is reached.

4. The cloud-edge collaborative reasoning method according to claim 1, characterized in that, The cognitive load level is used to represent the reasoning depth of a single reference case. Each cognitive load level corresponds to a reference case with a certain reasoning depth. The cognitive load level is determined by the number of logical steps in the reasoning chain, the number of independent concepts in the reasoning chain, and the number of conditional branches in the reasoning chain.

5. The cloud-edge collaborative reasoning method according to claim 1, characterized in that, The target reference case includes a comparison block of correct and incorrect reasoning paths; when the cognitive load level reaches a preset level, the target reference case also includes intermediate reasoning steps. The method for generating the comparison block includes the following steps: Generate correct reasoning paths based on the thinking chain strategy; By simulating the hasty reasoning characteristics of a small model or by using adversarial prompts, a preset number of erroneous reasoning paths are generated. The erroneous inference path is subjected to security verification, and the task description, the correct inference path, and the erroneous inference path that has passed the security verification are encapsulated into a structured comparison block; Each of the aforementioned erroneous reasoning paths includes at least a description of the reasoning process, the defect type, the defect location, and a correction description; the comparison block includes at least a task description, a correct reasoning path, and a list of erroneous reasoning paths.

6. The cloud-edge collaborative reasoning method according to claim 1, characterized in that, After receiving the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level from the cloud service device, the method further includes: Establish a mapping relationship between the target reference case and the corresponding target parent class scenario; The target reference case and the mapping relationship are stored in the local scene case library.

7. The cloud-edge collaborative reasoning method according to claim 1, characterized in that, The method further includes: A sensitivity assessment is performed on at least one of the following factors for the task to be processed: text content, parent scenario, user privacy configuration, and proportion of sensitive entities. Based on the assessment results, a corresponding information upload strategy is determined. When the information upload strategy is the first privacy mode, the sensitive entities in the task to be processed are identified, the sensitive entities are replaced with preset placeholders to generate a desensitized template, and the desensitized template is uploaded to the cloud service device. When the information upload strategy is in the second privacy mode, the semantic abstract tag of the task to be processed is uploaded to the cloud service device.

8. A cloud-edge collaborative reasoning device, characterized in that, Integrated into an edge device, the device includes: The scene matching module is used to receive the task to be processed and determine the target parent scene that matches the task to be processed. The request generation module is used to send a case generation request to the cloud service device if no target reference case associated with the target parent scenario can be matched from the local scenario case library. The local scenario case library is used to store the mapping relationship between each parent scenario and each prompt case. The data receiving module is used to receive the cognitive load level of the task to be processed and the target reference case corresponding to the cognitive load level from the cloud service device. The task processing module is used to reason about the target reference case and the cognitive load level through a reasoning model to obtain the reasoning result of the task to be processed.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that is executed by the at least one processor, which enables the at least one processor to execute the cloud-edge collaborative reasoning method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the cloud-edge collaborative inference method according to any one of claims 1 to 7.