当前位置:首页>python>Python+LangChain/LangGraph框架开发Ai智能体系列��20节 | Agentic RAG 进阶 | 检索评估器 + 自适应检索器的实现

Python+LangChain/LangGraph框架开发Ai智能体系列��20节 | Agentic RAG 进阶 | 检索评估器 + 自适应检索器的实现

  • 2026-06-29 02:49:35
Python+LangChain/LangGraph框架开发Ai智能体系列��20节 | Agentic RAG 进阶 | 检索评估器 + 自适应检索器的实现
01 学习目标

  1. 掌握 LLM-as-Judge 评估模式:用 LLM 对检索结果打分

  2. 掌握查询重写策略:换关键词 / 加限定词 / 换角度

  3. 掌握自适应检索器的封装:检索 → 评估 → 重写 → 重试

  4. 理解 Token 预算控制:重试次数限制,防止无限循环

02 核心概念

掌握自适应检索器的封装:检索 → 评估 → 重写 → 重试

Agentic RAG 的检索评估器

检索评估器负责实时判断召回内容的相关性与充分性

Agentic RAG 的自适应检索器:

自适应检索器则根据评估反馈动态调整查询策略或切换知识源,两者协同让 RAG 从单次被动检索进化为具备反思和自主决策能力的智能体

03 技术架构图解

3.1:🧠 检索评估器

根据用户问题和检索到的上下文,评估检索结果的相关度

3.2:🔀 自适应检索器

重写查询后重新检索,再评估,不够再重写……形成循环。但必须有重试上限(`max_retries`),防止无限循环。

3.3:LangGraph Agentic RAG 状态机流程图

3.4三种查询重写策略

04 代码实现

4.1 数据类:标准化的检索结果

4.2 检索质量评估器

4.3 自适应检索器

4.4 演示 1:检索质量评估器

4.5 演示 2:自适应检索器

05 代码运行演示

注意事项

  • 前置条件:

  •   - 运行过之前文章代码(chroma_db 目录已存在)

      - ollama pull nomic-embed-text

      - ollama 模型 qwen3:4b 可用

5.1 本节所有源代码(复制运行有问题下方扫码入群交流)

# -*- coding: utf-8 -*-"""Day9 · 检索质量评估 + 动态重试================================任务编号:Day9-02执行顺序:2/3(Agentic RAG 进阶:检索评估器 + 自适应检索器)学习目标:  1. 掌握 LLM-as-Judge 评估模式:用 LLM 对检索结果打分  2. 掌握查询重写策略:换关键词 / 加限定词 / 换角度  3. 掌握自适应检索器的封装:检索 → 评估 → 重写 → 重试  4. 理解 Token 预算控制:重试次数限制,防止无限循环前置条件:  - 完成 Day8-01(chroma_db 目录已存在)  - ollama pull nomic-embed-text  - ollama 模型 qwen3:4b 可用核心模式:  RetrievalResult  → 标准化检索结果(文档 + 评分 + 充分性)  RetrievalEvaluator → LLM 评估 + 查询重写  AdaptiveRetriever → 自适应检索(检索 → 评估 → 重试循环)"""from pathlib import Pathimport sys as _sysfrom dataclasses import dataclass, field_SCRIPT_DIR = Path(__file__).parent_DAY08_DIR = _SCRIPT_DIR.parent / "day08"_sys.path.insert(0str(_SCRIPT_DIR))# ============================================================# 数据类:标准化的检索结果# ============================================================@dataclassclass RetrievalResult:    """    封装一次检索的结果 + 评估信息。    字段说明:      documents:检索到的文档列表(langchain_core.documents.Document)      scores:各文档的相关度评分(0-1),由 LLM 评估      avg_score:平均评分,用于判断整体检索质量      is_sufficient:是否信息充分(avg_score >= threshold)      query_used:本次检索使用的查询(可能被重写)      attempt:第几次尝试(从 1 开始)    为什么需要标准化?      - 传统 RAG 只返回文档列表,没有质量信息      - Agentic RAG 需要评估结果来决定是否重试      - 标准化后可以传递给 LangGraph 的状态(Day9-03)    """    documents: list = field(default_factory=list)  # list[Document]    scores: list = field(default_factory=list)     # list[float]    avg_score: float = 0.0    is_sufficient: bool = False    query_used: str = ""    attempt: int = 1    def summary(self) -> str:        """返回简要摘要,用于日志输出"""        status = "充分" if self.is_sufficient else "不足"        return f"第{self.attempt}轮 | query=\"{self.query_used[:30]}\" | avg={self.avg_score:.2f} | {status}"# ============================================================# 检索质量评估器# ============================================================class RetrievalEvaluator:    """    用 LLM 评估检索结果的质量,并重写查询以提升检索效果。    核心方法:      evaluate():LLM 对检索结果逐条打分,判断整体是否充分      rewrite_query():LLM 重写查询,提升下次检索的召回率    为什么用 LLM 评估而不是规则?      - 规则评估(如 distance 阈值)只能判断语义相似度      - LLM 评估能判断"信息是否充分回答问题"(语义理解能力)      - 生产环境常用模式:LLM-as-Judge    """    def __init__(self, model: str = "qwen3:4b"):        """        初始化评估器。        参数:            model:Ollama 模型名称        """        self.model = model    def evaluate(self, query: str, documents: list, threshold: float = 0.6) -> RetrievalResult:        """        评估检索结果质量:LLM 逐条打分 + 判断整体充分性。        流程:          1. 将文档内容拼接为上下文          2. LLM 评估每个文档的相关度(0-1)          3. 计算平均分,判断是否充分        参数:            query:用户原始查询            documents:检索到的文档列表(list[dict],每个含 content/metadata/distance)            threshold:充分性阈值(avg_score >= threshold 视为充分)        返回:            RetrievalResult 实例        """        from langchain_ollama import ChatOllama        import re        if not documents:            return RetrievalResult(                documents=[], scores=[], avg_score=0.0,                is_sufficient=False, query_used=query,            )        # 拼接文档内容        docs_text = "\n".join(            f"[文档{i+1}{doc.get('content''')[:200]}"            for i, doc in enumerate(documents)        )        eval_prompt = f"""你是一个检索质量评估器。根据用户问题和检索到的文档,评估每个文档的相关度。【用户问题】{query}【检索到的文档】{docs_text}请对每个文档评分(0到1之间),格式如下:文档1: 0.X文档2: 0.X...评分标准:- 0.8-1.0:文档直接回答了问题- 0.6-0.8:文档部分相关- 0.4-0.6:文档有一定关联但缺少关键信息- 0.0-0.4:文档与问题基本无关只输出评分,每行一个,不要其他内容:"""        try:            llm = ChatOllama(model=self.model, temperature=0, num_ctx=4096)            response = llm.invoke(eval_prompt)            score_text = response.content.strip()            # 解析评分            scores = []            for line in score_text.split("\n"):                match = re.search(r'(\d+\.?\d*)', line)                if match:                    s = float(match.group(1))                    scores.append(max(0.0min(1.0, s)))            # 如果评分数量不够,用默认值补齐            while len(scores) < len(documents):                scores.append(0.5)            avg_score = sum(scores) / len(scores) if scores else 0.0        except Exception as e:            print(f"    [评估异常] {e},使用默认评分")            scores = [0.5] * len(documents)            avg_score = 0.5        return RetrievalResult(            documents=documents,            scores=scores,            avg_score=avg_score,            is_sufficient=avg_score >= threshold,            query_used=query,        )    def rewrite_query(self, original_query: str, failed_query: str, eval_score: float) -> str:        """        LLM 重写查询,提升下次检索的召回率。        重写策略(让 LLM 从三个角度思考):          1. 添加更具体的关键词("AI" → "Agentic RAG 自适应检索")          2. 换一种表述方式("怎么让 AI 查资料" → "Agent 检索决策机制")          3. 拆分为更聚焦的子问题        参数:            original_query:用户原始查询            failed_query:上次检索失败的查询(可能已经被重写过)            eval_score:上次评估的评分        返回:            重写后的查询字符串        """        from langchain_ollama import ChatOllama        rewrite_prompt = f"""你是一个查询优化专家。用户提出了一个问题,但当前检索结果不够相关。【原始问题】{original_query}【当前检索查询】{failed_query}【检索结果评分】{eval_score:.2f}(满分 1.0,低于 0.6 表示信息不充分)请从以下三个角度之一重写检索查询:  1. 添加更具体的关键词(如"AI查资料" → "Agentic RAG 自适应检索机制")  2. 换一种表述方式(如"怎么让AI自己决定" → "Agent 检索决策机制")  3. 拆分为更聚焦的子问题只输出重写后的查询,不要其他内容:"""        try:            llm = ChatOllama(model=self.model, temperature=0.7, num_ctx=4096)            response = llm.invoke(rewrite_prompt)            new_query = response.content.strip()            # 去除可能的引号包裹            new_query = new_query.strip('"\'""''')            if len(new_query) < 3:                return failed_query  # 重写太短,保持原查询            return new_query        except Exception as e:            print(f"    [重写异常] {e},保持原查询")            return failed_query# ============================================================# 自适应检索器# ============================================================class AdaptiveRetriever:    """    自适应检索器:检索 → 评估 → 重写 → 重试的完整循环。    这是 Agentic RAG 的核心实现,封装了:      - 底层向量检索(Chroma)      - 检索质量评估(RetrievalEvaluator)      - 查询重写(RetrievalEvaluator.rewrite_query)      - 重试控制(max_retries + Token 预算)    对比 Day8 的传统 RAG:      Day8:检索一次 → 返回结果      Day9:检索 → 评估 → 不够则重写 → 再检索 → 循环    """    def __init__(        self,        collection,        evaluator: RetrievalEvaluator | None = None,        max_retries: int = 3,        score_threshold: float = 0.6,        top_k: int = 3,    ):        """        初始化自适应检索器。        参数:            collection:Chroma Collection 对象            evaluator:检索评估器(默认使用 RetrievalEvaluator)            max_retries:最大重试次数            score_threshold:评分阈值(低于此值触发重试)            top_k:每次检索的文档数量        """        self.collection = collection        self.evaluator = evaluator or RetrievalEvaluator()        self.max_retries = max_retries        self.score_threshold = score_threshold        self.top_k = top_k    def retrieve(self, query: str) -> tuple[RetrievalResult, list[RetrievalResult]]:        """        核心方法:自适应检索,返回最佳结果和全部历史。        流程:          1. 执行向量检索          2. 评估检索质量          3. 质量不足 → 重写查询 → 重新检索(循环)          4. 质量充足或达最大重试次数 → 返回结果        参数:            query:用户查询        返回:            (best_result, all_results)              best_result:评分最高的 RetrievalResult              all_results:所有轮次的 RetrievalResult 列表(用于调试)        """        current_query = query        all_results = []        best_result = None        for attempt in range(1self.max_retries + 1):            # 步骤 1:向量检索            docs = self._do_vector_search(current_query)            # 步骤 2:评估检索质量            result = self.evaluator.evaluate(query, docs, self.score_threshold)            result.query_used = current_query            result.attempt = attempt            all_results.append(result)            print(f"    {result.summary()}")            # 更新最佳结果            if best_result is None or result.avg_score > best_result.avg_score:                best_result = result            # 步骤 3:判断是否需要重试            if result.is_sufficient:                print(f"    [OK] 检索质量充分,无需重试")                break            if attempt >= self.max_retries:                print(f"    [WARN] 已达最大重试次数 {self.max_retries},使用最佳结果")                break            # 步骤 4:重写查询            print(f"    [重写] 评分 {result.avg_score:.2f} < {self.score_threshold},重写查询...")            new_query = self.evaluator.rewrite_query(query, current_query, result.avg_score)            print(f"    [重写] \"{current_query[:40]}\" → \"{new_query[:40]}\"")            current_query = new_query        # 如果所有结果都不充分,返回评分最高的那个        if best_result is None:            best_result = RetrievalResult(query_used=query, attempt=0)        return best_result, all_results    def _do_vector_search(self, query: str) -> list[dict]:        """        底层向量检索:Chroma query。        封装嵌入和查询逻辑,与评估逻辑解耦。        注意:每次检索都重新实例化 OllamaEmbeddings,        因为 OllamaEmbeddings 不是 Pydantic 字段(Day8 踩坑经验)。        参数:            query:查询字符串        返回:            list[dict],每个 dict 含 content / metadata / distance        """        from langchain_ollama import OllamaEmbeddings        embeddings = OllamaEmbeddings(model="nomic-embed-text")        query_vector = embeddings.embed_query(query)        results = self.collection.query(            query_embeddings=[query_vector],            n_results=self.top_k,            include=["documents""metadatas""distances"],        )        docs = []        raw_docs = results.get("documents", [[]])[0]        raw_metas = (results.get("metadatas"or [[]])[0]        raw_dists = (results.get("distances"or [[]])[0]        for i, content in enumerate(raw_docs):            meta = raw_metas[i] if i < len(raw_metas) else {}            distance = raw_dists[i] if i < len(raw_dists) else None            docs.append({                "content": content,                "metadata": meta,                "distance": distance,            })        return docs# ============================================================# 工具函数:加载 Collection# ============================================================def _load_collection(persist_directory: str = None, collection_name: str = "day08_rag"):    """加载 Day8 的 Chroma Collection(同 01_agentic_rag_basics.py)"""    import chromadb    if persist_directory is None:        persist_directory = str(_DAY08_DIR / "chroma_db")    client = chromadb.PersistentClient(path=persist_directory)    collection = client.get_collection(name=collection_name)    print(f"  [OK] Collection '{collection_name}' 加载成功,共 {collection.count()} 条记录")    return collection# ============================================================# 演示 1:检索质量评估器# ============================================================def demo_evaluator():    """    演示 RetrievalEvaluator 的评估能力。    对比两种查询的评估结果:      1. 好查询:"LangGraph 的核心概念是什么?"         → 检索结果应高度相关,avg_score 应较高      2. 差查询:"今天中午吃什么?"         → 检索结果应不相关,avg_score 应较低    """    print("\n" + "=" * 60)    print("Day9-02a · 检索质量评估器演示")    print("=" * 60)    # 加载 Collection    print("\n[初始化] 加载 Collection...")    try:        collection = _load_collection()    except Exception as e:        print(f"[错误] 无法加载 Collection:{e}")        return    evaluator = RetrievalEvaluator()    # 简单向量检索(不用自适应)    from langchain_ollama import OllamaEmbeddings    def simple_search(query: str) -> list[dict]:        embeddings = OllamaEmbeddings(model="nomic-embed-text")        qv = embeddings.embed_query(query)        results = collection.query(            query_embeddings=[qv], n_results=3,            include=["documents""metadatas""distances"],        )        docs = []        raw_docs = results.get("documents", [[]])[0]        raw_metas = (results.get("metadatas"or [[]])[0]        raw_dists = (results.get("distances"or [[]])[0]        for i, content in enumerate(raw_docs):            meta = raw_metas[i] if i < len(raw_metas) else {}            docs.append({"content": content, "metadata": meta, "distance": raw_dists[i] if i < len(raw_dists) else None})        return docs    # 测试    test_queries = [        ("好查询""LangGraph 的核心概念是什么?"),        ("差查询""今天中午吃什么?"),    ]    for label, query in test_queries:        print(f"\n[{label}] \"{query}\"")        docs = simple_search(query)        result = evaluator.evaluate(query, docs)        print(f"  评分详情:")        for i, (doc, score) in enumerate(zip(result.documents, result.scores)):            content = doc.get("content""")[:50]            print(f"    文档{i+1}: score={score:.2f} | {content}...")        print(f"  平均分:{result.avg_score:.2f} | 充分性:{'是'if result.is_sufficient else'否'}")    print("\n" + "=" * 60)    print("评估器演示完成!")    print("=" * 60)# ============================================================# 演示 2:自适应检索器# ============================================================def demo_adaptive_retriever():    """    演示 AdaptiveRetriever 的自适应检索能力。    对比两种查询:      1. 精确查询:直接命中,无需重试      2. 模糊查询:需要重写查询,多轮检索    """    import time    print("\n" + "=" * 60)    print("Day9-02b · 自适应检索器演示")    print("=" * 60)    # 加载 Collection    print("\n[初始化] 加载 Collection...")    try:        collection = _load_collection()    except Exception as e:        print(f"[错误] 无法加载 Collection:{e}")        return    # 创建自适应检索器    retriever = AdaptiveRetriever(        collection=collection,        max_retries=3,        score_threshold=0.6,        top_k=3,    )    # 测试    test_cases = [        {            "query""MCP 协议的作用是什么?",            "desc""精确查询 → 预期一轮通过",        },        {            "query""怎么让 AI 自己决定要不要查资料?",            "desc""模糊查询 → 预期需要重写",        },        {            "query""什么是向量数据库的混合检索?",            "desc""中等查询 → 可能需要 1-2 轮",        },    ]    for i, case in enumerate(test_cases, 1):        print(f"\n{'=' * 60}")        print(f"测试 {i}/{len(test_cases)}{case['desc']}")        print(f"查询:{case['query']}")        print("-" * 40)        start = time.time()        best, all_results = retriever.retrieve(case["query"])        elapsed = time.time() - start        print(f"\n  [结果]")        print(f"  最佳评分:{best.avg_score:.2f}")        print(f"  检索轮次:{len(all_results)}")        print(f"  充分性:{'是'if best.is_sufficient else'否'}")        print(f"  耗时:{elapsed:.2f}s")        # 打印检索历史        if len(all_results) > 1:            print(f"\n  [检索历史]")            for r in all_results:                print(f"    {r.summary()}")    print("\n" + "=" * 60)    print("自适应检索器演示完成!")    print("=" * 60)    print("\n关键收获:")    print("  1. RetrievalResult 标准化了检索结果(文档 + 评分 + 充分性)")    print("  2. RetrievalEvaluator 用 LLM-as-Judge 模式评估检索质量")    print("  3. AdaptiveRetriever 封装了检索 → 评估 → 重写的完整循环")    print("  4. Token 预算控制:max_retries 防止无限循环")if __name__ == "__main__":    demo_evaluator()    demo_adaptive_retriever()

5.1运行结果


热点文章推荐:
🦞10分钟极速搭建OpenClaw龙虾智能体服务(Windows11版)“炒鸡详细”
Python+langchain框架开发Ai智能体系列(一)

扫码入群获取源码,后续分享更多系列教程关注公众号探索更多精彩内容

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 19:15:51 HTTP/2.0 GET : https://f.mffb.com.cn/a/487335.html
  2. 运行时间 : 0.087366s [ 吞吐率:11.45req/s ] 内存消耗:4,969.59kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=3df34d56590396f16b467a3631af372d
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000561s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000781s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000351s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000260s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000481s ]
  6. SELECT * FROM `set` [ RunTime:0.000197s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000640s ]
  8. SELECT * FROM `article` WHERE `id` = 487335 LIMIT 1 [ RunTime:0.002418s ]
  9. UPDATE `article` SET `lasttime` = 1783077351 WHERE `id` = 487335 [ RunTime:0.007762s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000315s ]
  11. SELECT * FROM `article` WHERE `id` < 487335 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000714s ]
  12. SELECT * FROM `article` WHERE `id` > 487335 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000567s ]
  13. SELECT * FROM `article` WHERE `id` < 487335 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000897s ]
  14. SELECT * FROM `article` WHERE `id` < 487335 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002047s ]
  15. SELECT * FROM `article` WHERE `id` < 487335 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001268s ]
0.088969s