乐于分享
好东西不私藏

OpenClaw龙虾如何编写自己的技能?

OpenClaw龙虾如何编写自己的技能?

OpenClaw龙虾如何编写自己的技能?

核心问题:现有技能满足不了需求怎么办?
详细讲解OpenClaw技能开发全流程,从技能结构解析、开发环境搭建到实际案例实现,涵盖skill.json配置、主逻辑脚本编写、发布流程及安全最佳实践。

系列教程第 17 篇 | 阅读时长:15-20 分钟


从用户到开发者

前面的教程中,我们使用了许多官方和社区开发的技能。但当遇到特殊需求时,现有技能可能无法满足。

这时,你可以:

  1. 1. 向社区提需求
  2. 2. 自己开发技能

本篇教你如何编写自己的 OpenClaw 技能。


一、技能的本质:配置文件 + 脚本

技能结构

一个完整的技能包含以下文件:

my-skill/
├── skill.json        # 技能配置文件
├── main.py           # 主逻辑脚本(或其他语言)
├── requirements.txt  # Python 依赖(如果是 Python)
├── README.md         # 使用说明
└── tests/            # 测试文件(可选)
    └── test_main.py

核心文件:skill.json

这是技能的"身份证",定义了技能的基本信息和能力:

{
  "name"
: "my-skill",
  "version"
: "1.0.0",
  "description"
: "我的自定义技能",
  "author"
: "your-name",
  "license"
: "MIT",

  "entry_point"
: "main.py",
  "language"
: "python",

  "commands"
: [
    {

      "name"
: "hello",
      "description"
: "打招呼",
      "params"
: [
        {

          "name"
: "name",
          "type"
: "string",
          "required"
:true,
          "description"
: "你的名字"
        }

      ]
,
      "returns"
: {
        "type"
: "string",
        "description"
: "问候语"
      }

    }

  ]
,

  "permissions"
: [
    "file_read"
,
    "file_write"

  ]
,

  "dependencies"
: {
    "python"
: ">=3.8",
    "packages"
: ["requests"]
  }

}

主逻辑脚本:main.py

实现具体的业务逻辑:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def
 hello(name: str) -> str:
    """
    打招呼

    Args:
        name: 用户名

    Returns:
        问候语
    """

    return
 f"你好,{name}!欢迎使用 OpenClaw!"

# OpenClaw 会调用这个函数

def
 execute(command: str, params: dict) -> dict:
    """
    技能执行入口

    Args:
        command: 命令名称
        params: 参数字典

    Returns:
        执行结果
    """

    if
 command == "hello":
        name = params.get("name", "朋友")
        result = hello(name)
        return
 {
            "success"
: True,
            "result"
: result
        }
    else
:
        return
 {
            "success"
: False,
            "error"
: f"未知命令: {command}"
        }

if
 __name__ == "__main__":
    # 本地测试

    result = execute("hello", {"name": "张三"})
    print
(result)

二、技能开发环境搭建

1. 创建技能目录

mkdir my-skill
cd
 my-skill

2. 初始化技能

openclaw skill init my-skill

这会自动生成基础文件:

my-skill/
├── skill.json
├── main.py
├── requirements.txt
└── README.md

3. 安装开发依赖

# 创建虚拟环境
python -m venv venv
source
 venv/bin/activate  # Windows: venv\Scripts\activate

# 安装依赖

pip install -r requirements.txt

# 安装 OpenClaw SDK(如果有)

pip install openclaw-sdk

4. 本地测试

# 直接运行脚本测试
python main.py

# 或使用 OpenClaw 命令测试

openclaw skill test . --command hello --params '{"name": "张三"}'

三、从零开发一个简单技能

需求:时间戳转换工具

创建一个技能,实现:

  • • 时间戳 → 日期时间
  • • 日期时间 → 时间戳

步骤 1:创建 skill.json

{
  "name"
: "timestamp-converter",
  "version"
: "1.0.0",
  "description"
: "时间戳转换工具",
  "author"
: "your-name",
  "license"
: "MIT",

  "entry_point"
: "main.py",
  "language"
: "python",

  "commands"
: [
    {

      "name"
: "to-datetime",
      "description"
: "时间戳转日期时间",
      "params"
: [
        {

          "name"
: "timestamp",
          "type"
: "integer",
          "required"
:true,
          "description"
: "Unix 时间戳"
        }

      ]
,
      "returns"
: {
        "type"
: "string",
        "description"
: "日期时间字符串"
      }

    }
,
    {

      "name"
: "to-timestamp",
      "description"
: "日期时间转时间戳",
      "params"
: [
        {

          "name"
: "datetime_str",
          "type"
: "string",
          "required"
:true,
          "description"
: "日期时间字符串(格式:YYYY-MM-DD HH:MM:SS)"
        }

      ]
,
      "returns"
: {
        "type"
: "integer",
        "description"
: "Unix 时间戳"
      }

    }

  ]
,

  "dependencies"
: {
    "python"
: ">=3.8"
  }

}

步骤 2:编写 main.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


from
 datetime import datetime

def
 timestamp_to_datetime(timestamp: int) -> str:
    """
    时间戳转日期时间

    Args:
        timestamp: Unix 时间戳

    Returns:
        日期时间字符串
    """

    dt = datetime.fromtimestamp(timestamp)
    return
 dt.strftime("%Y-%m-%d %H:%M:%S")

def
 datetime_to_timestamp(datetime_str: str) -> int:
    """
    日期时间转时间戳

    Args:
        datetime_str: 日期时间字符串

    Returns:
        Unix 时间戳
    """

    dt = datetime.strptime(datetime_str, "%Y-%m-%d %H:%M:%S")
    return
 int(dt.timestamp())

def
 execute(command: str, params: dict) -> dict:
    """
    技能执行入口
    """

    try
:
        if
 command == "to-datetime":
            timestamp = params.get("timestamp")
            if
 timestamp is None:
                return
 {"success": False, "error": "缺少参数: timestamp"}

            result = timestamp_to_datetime(timestamp)
            return
 {"success": True, "result": result}

        elif
 command == "to-timestamp":
            datetime_str = params.get("datetime_str")
            if
 datetime_str is None:
                return
 {"success": False, "error": "缺少参数: datetime_str"}

            result = datetime_to_timestamp(datetime_str)
            return
 {"success": True, "result": result}

        else
:
            return
 {"success": False, "error": f"未知命令: {command}"}

    except
 Exception as e:
        return
 {"success": False, "error": str(e)}

if
 __name__ == "__main__":
    # 测试

    print
("测试 to-datetime:")
    print
(execute("to-datetime", {"timestamp": 1709251200}))

    print
("\n测试 to-timestamp:")
    print
(execute("to-timestamp", {"datetime_str": "2024-03-01 00:00:00"}))

步骤 3:编写 README.md

# timestamp-converter

时间戳转换工具

## 功能


-
 时间戳 → 日期时间
-
 日期时间 → 时间戳

## 安装


```bash
openclaw skill install timestamp-converter

使用

时间戳转日期时间

openclaw run timestamp-converter to-datetime --timestamp 1709251200

输出: 2024-03-01 00:00:00

日期时间转时间戳

openclaw run timestamp-converter to-timestamp --datetime-str "2024-03-01 00:00:00"

输出: 1709251200

参数说明

to-datetime

参数
类型
必填
说明
timestamp
integer
Unix 时间戳

to-timestamp

参数
类型
必填
说明
datetime_str
string
日期时间(格式:YYYY-MM-DD HH:MM:SS)

示例

# 在工作流中使用
{
  "skill"
: "timestamp-converter",
  "command"
: "to-datetime",
  "params"
: {
    "timestamp"
: 1709251200
  }
}

作者

your-name

许可证

MIT


---

### 步骤 4:本地测试

```bash
python main.py

输出:

测试 to-datetime:
{'success': True, 'result': '2024-03-01 00:00:00'}

测试 to-timestamp:
{'success': True, 'result': 1709251200}

步骤 5:打包安装

# 本地安装
openclaw skill install .

# 或指定路径

openclaw skill install /path/to/timestamp-converter

四、技能发布流程

1. 准备发布

确保技能完整:

  • • ✅ skill.json 配置正确
  • • ✅ main.py 实现完整
  • • ✅ README.md 说明清晰
  • • ✅ 测试通过

2. 发布到 skills.sh

方式一:通过 CLI 发布

openclaw skill publish

需要先登录:

openclaw login

方式二:提交到 GitHub

  1. 1. 创建 GitHub 仓库
  2. 2. 推送代码
  3. 3. 在 skills.sh 提交技能信息

3. 技能审核

提交后,官方会审核:

  • • 代码质量
  • • 安全性
  • • 功能完整性

审核通过后,技能会出现在技能市场。


4. 版本更新

更新版本时:

  1. 1. 修改 skill.json 中的 version
  2. 2. 更新代码
  3. 3. 重新发布
openclaw skill publish

五、最佳实践与注意事项

代码规范

1. 函数文档

每个函数都应该有清晰的文档:

def process_file(file_path: str, output_dir: str) -> dict:
    """
    处理文件

    Args:
        file_path: 输入文件路径
        output_dir: 输出目录

    Returns:
        处理结果字典,包含:
        - success: 是否成功
        - output_file: 输出文件路径
        - stats: 处理统计

    Raises:
        FileNotFoundError: 文件不存在
        PermissionError: 权限不足
    """

    pass

2. 错误处理

捕获并返回清晰的错误信息:

try:
    # 业务逻辑

    pass

except
 FileNotFoundError as e:
    return
 {
        "success"
: False,
        "error"
: f"文件不存在: {e.filename}"
    }
except
 Exception as e:
    return
 {
        "success"
: False,
        "error"
: f"处理失败: {str(e)}"
    }

3. 参数验证

验证输入参数:

def execute(command: str, params: dict) -> dict:
    # 验证必需参数

    required_params = ["input", "output"]
    for
 param in required_params:
        if
 param not in params:
            return
 {
                "success"
: False,
                "error"
: f"缺少必需参数: {param}"
            }

    # 验证参数类型

    if
 not isinstance(params["input"], str):
        return
 {
            "success"
: False,
            "error"
: "参数 input 必须是字符串"
        }

    # 继续处理...

安全注意事项

1. 权限最小化

只申请必要的权限:

{
  "permissions"
: [
    "file_read"
  // 只申请需要的权限
  ]

}

2. 路径验证

验证文件路径,防止路径遍历攻击:

import os

def
 safe_path(base_dir: str, user_path: str) -> str:
    """
    安全地拼接路径
    """

    full_path = os.path.join(base_dir, user_path)
    real_path = os.path.realpath(full_path)

    # 确保路径在允许的目录内

    if
 not real_path.startswith(os.path.realpath(base_dir)):
        raise
 ValueError("非法路径访问")

    return
 real_path

3. 敏感信息保护

不要在代码中硬编码敏感信息:

# ❌ 错误
api_key = "sk-xxxxx"

# ✅ 正确

import
 os
api_key = os.environ.get("API_KEY")

性能优化

1. 大文件处理

使用流式处理大文件:

def process_large_file(file_path: str):
    """流式处理大文件"""

    with
 open(file_path, 'r') as f:
        for
 line in f:
            # 逐行处理

            process_line(line)

2. 并发处理

利用并发提高效率:

from concurrent.futures import ThreadPoolExecutor

def
 batch_process(files: list, max_workers: int = 5):
    """批量并发处理"""

    with
 ThreadPoolExecutor(max_workers=max_workers) as executor:
        results = executor.map(process_file, files)
    return
 list(results)

测试

编写单元测试:

# tests/test_main.py

import
 pytest
from
 main import execute

def
 test_to_datetime():
    result = execute("to-datetime", {"timestamp": 1709251200})
    assert
 result["success"] == True
    assert
 result["result"] == "2024-03-01 00:00:00"

def
 test_to_timestamp():
    result = execute("to-timestamp", {"datetime_str": "2024-03-01 00:00:00"})
    assert
 result["success"] == True
    assert
 result["result"] == 1709251200

def
 test_invalid_command():
    result = execute("invalid", {})
    assert
 result["success"] == False

运行测试:

pytest tests/

小结

这一篇,你学会了:

  1. 1. ✅ 技能的本质:配置文件 + 脚本
  2. 2. ✅ 搭建开发环境
  3. 3. ✅ 从零开发一个简单技能
  4. 4. ✅ 技能发布流程
  5. 5. ✅ 最佳实践与注意事项

编写技能让你能够扩展 OpenClaw 的能力边界,满足个性化需求。


下篇预告

下一篇,我们学习 OpenClaw 的进阶配置:性能优化与安全加固。

下一篇:OpenClaw 进阶配置:性能优化与安全加固


OpenClaw龙虾如何编写自己的技能?

核心问题:现有技能满足不了需求怎么办?
详细讲解OpenClaw技能开发全流程,从技能结构解析、开发环境搭建到实际案例实现,涵盖skill.json配置、主逻辑脚本编写、发布流程及安全最佳实践。

系列教程第 17 篇 | 阅读时长:15-20 分钟


从用户到开发者

前面的教程中,我们使用了许多官方和社区开发的技能。但当遇到特殊需求时,现有技能可能无法满足。

这时,你可以:

  1. 1. 向社区提需求
  2. 2. 自己开发技能

本篇教你如何编写自己的 OpenClaw 技能。


一、技能的本质:配置文件 + 脚本

技能结构

一个完整的技能包含以下文件:

my-skill/
├── skill.json        # 技能配置文件
├── main.py           # 主逻辑脚本(或其他语言)
├── requirements.txt  # Python 依赖(如果是 Python)
├── README.md         # 使用说明
└── tests/            # 测试文件(可选)
    └── test_main.py

核心文件:skill.json

这是技能的"身份证",定义了技能的基本信息和能力:

{
  "name"
: "my-skill",
  "version"
: "1.0.0",
  "description"
: "我的自定义技能",
  "author"
: "your-name",
  "license"
: "MIT",

  "entry_point"
: "main.py",
  "language"
: "python",

  "commands"
: [
    {

      "name"
: "hello",
      "description"
: "打招呼",
      "params"
: [
        {

          "name"
: "name",
          "type"
: "string",
          "required"
:true,
          "description"
: "你的名字"
        }

      ]
,
      "returns"
: {
        "type"
: "string",
        "description"
: "问候语"
      }

    }

  ]
,

  "permissions"
: [
    "file_read"
,
    "file_write"

  ]
,

  "dependencies"
: {
    "python"
: ">=3.8",
    "packages"
: ["requests"]
  }

}

主逻辑脚本:main.py

实现具体的业务逻辑:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def
 hello(name: str) -> str:
    """
    打招呼

    Args:
        name: 用户名

    Returns:
        问候语
    """

    return
 f"你好,{name}!欢迎使用 OpenClaw!"

# OpenClaw 会调用这个函数

def
 execute(command: str, params: dict) -> dict:
    """
    技能执行入口

    Args:
        command: 命令名称
        params: 参数字典

    Returns:
        执行结果
    """

    if
 command == "hello":
        name = params.get("name", "朋友")
        result = hello(name)
        return
 {
            "success"
: True,
            "result"
: result
        }
    else
:
        return
 {
            "success"
: False,
            "error"
: f"未知命令: {command}"
        }

if
 __name__ == "__main__":
    # 本地测试

    result = execute("hello", {"name": "张三"})
    print
(result)

二、技能开发环境搭建

1. 创建技能目录

mkdir my-skill
cd
 my-skill

2. 初始化技能

openclaw skill init my-skill

这会自动生成基础文件:

my-skill/
├── skill.json
├── main.py
├── requirements.txt
└── README.md

3. 安装开发依赖

# 创建虚拟环境
python -m venv venv
source
 venv/bin/activate  # Windows: venv\Scripts\activate

# 安装依赖

pip install -r requirements.txt

# 安装 OpenClaw SDK(如果有)

pip install openclaw-sdk

4. 本地测试

# 直接运行脚本测试
python main.py

# 或使用 OpenClaw 命令测试

openclaw skill test . --command hello --params '{"name": "张三"}'

三、从零开发一个简单技能

需求:时间戳转换工具

创建一个技能,实现:

  • • 时间戳 → 日期时间
  • • 日期时间 → 时间戳

步骤 1:创建 skill.json

{
  "name"
: "timestamp-converter",
  "version"
: "1.0.0",
  "description"
: "时间戳转换工具",
  "author"
: "your-name",
  "license"
: "MIT",

  "entry_point"
: "main.py",
  "language"
: "python",

  "commands"
: [
    {

      "name"
: "to-datetime",
      "description"
: "时间戳转日期时间",
      "params"
: [
        {

          "name"
: "timestamp",
          "type"
: "integer",
          "required"
:true,
          "description"
: "Unix 时间戳"
        }

      ]
,
      "returns"
: {
        "type"
: "string",
        "description"
: "日期时间字符串"
      }

    }
,
    {

      "name"
: "to-timestamp",
      "description"
: "日期时间转时间戳",
      "params"
: [
        {

          "name"
: "datetime_str",
          "type"
: "string",
          "required"
:true,
          "description"
: "日期时间字符串(格式:YYYY-MM-DD HH:MM:SS)"
        }

      ]
,
      "returns"
: {
        "type"
: "integer",
        "description"
: "Unix 时间戳"
      }

    }

  ]
,

  "dependencies"
: {
    "python"
: ">=3.8"
  }

}

步骤 2:编写 main.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


from
 datetime import datetime

def
 timestamp_to_datetime(timestamp: int) -> str:
    """
    时间戳转日期时间

    Args:
        timestamp: Unix 时间戳

    Returns:
        日期时间字符串
    """

    dt = datetime.fromtimestamp(timestamp)
    return
 dt.strftime("%Y-%m-%d %H:%M:%S")

def
 datetime_to_timestamp(datetime_str: str) -> int:
    """
    日期时间转时间戳

    Args:
        datetime_str: 日期时间字符串

    Returns:
        Unix 时间戳
    """

    dt = datetime.strptime(datetime_str, "%Y-%m-%d %H:%M:%S")
    return
 int(dt.timestamp())

def
 execute(command: str, params: dict) -> dict:
    """
    技能执行入口
    """

    try
:
        if
 command == "to-datetime":
            timestamp = params.get("timestamp")
            if
 timestamp is None:
                return
 {"success": False, "error": "缺少参数: timestamp"}

            result = timestamp_to_datetime(timestamp)
            return
 {"success": True, "result": result}

        elif
 command == "to-timestamp":
            datetime_str = params.get("datetime_str")
            if
 datetime_str is None:
                return
 {"success": False, "error": "缺少参数: datetime_str"}

            result = datetime_to_timestamp(datetime_str)
            return
 {"success": True, "result": result}

        else
:
            return
 {"success": False, "error": f"未知命令: {command}"}

    except
 Exception as e:
        return
 {"success": False, "error": str(e)}

if
 __name__ == "__main__":
    # 测试

    print
("测试 to-datetime:")
    print
(execute("to-datetime", {"timestamp": 1709251200}))

    print
("\n测试 to-timestamp:")
    print
(execute("to-timestamp", {"datetime_str": "2024-03-01 00:00:00"}))

步骤 3:编写 README.md

# timestamp-converter

时间戳转换工具

## 功能


-
 时间戳 → 日期时间
-
 日期时间 → 时间戳

## 安装


```bash
openclaw skill install timestamp-converter

使用

时间戳转日期时间

openclaw run timestamp-converter to-datetime --timestamp 1709251200

输出: 2024-03-01 00:00:00

日期时间转时间戳

openclaw run timestamp-converter to-timestamp --datetime-str "2024-03-01 00:00:00"

输出: 1709251200

参数说明

to-datetime

参数
类型
必填
说明
timestamp
integer
Unix 时间戳

to-timestamp

参数
类型
必填
说明
datetime_str
string
日期时间(格式:YYYY-MM-DD HH:MM:SS)

示例

# 在工作流中使用
{
  "skill"
: "timestamp-converter",
  "command"
: "to-datetime",
  "params"
: {
    "timestamp"
: 1709251200
  }
}

作者

your-name

许可证

MIT


---

### 步骤 4:本地测试

```bash
python main.py

输出:

测试 to-datetime:
{'success': True, 'result': '2024-03-01 00:00:00'}

测试 to-timestamp:
{'success': True, 'result': 1709251200}

步骤 5:打包安装

# 本地安装
openclaw skill install .

# 或指定路径

openclaw skill install /path/to/timestamp-converter

四、技能发布流程

1. 准备发布

确保技能完整:

  • • ✅ skill.json 配置正确
  • • ✅ main.py 实现完整
  • • ✅ README.md 说明清晰
  • • ✅ 测试通过

2. 发布到 skills.sh

方式一:通过 CLI 发布

openclaw skill publish

需要先登录:

openclaw login

方式二:提交到 GitHub

  1. 1. 创建 GitHub 仓库
  2. 2. 推送代码
  3. 3. 在 skills.sh 提交技能信息

3. 技能审核

提交后,官方会审核:

  • • 代码质量
  • • 安全性
  • • 功能完整性

审核通过后,技能会出现在技能市场。


4. 版本更新

更新版本时:

  1. 1. 修改 skill.json 中的 version
  2. 2. 更新代码
  3. 3. 重新发布
openclaw skill publish

五、最佳实践与注意事项

代码规范

1. 函数文档

每个函数都应该有清晰的文档:

def process_file(file_path: str, output_dir: str) -> dict:
    """
    处理文件

    Args:
        file_path: 输入文件路径
        output_dir: 输出目录

    Returns:
        处理结果字典,包含:
        - success: 是否成功
        - output_file: 输出文件路径
        - stats: 处理统计

    Raises:
        FileNotFoundError: 文件不存在
        PermissionError: 权限不足
    """

    pass

2. 错误处理

捕获并返回清晰的错误信息:

try:
    # 业务逻辑

    pass

except
 FileNotFoundError as e:
    return
 {
        "success"
: False,
        "error"
: f"文件不存在: {e.filename}"
    }
except
 Exception as e:
    return
 {
        "success"
: False,
        "error"
: f"处理失败: {str(e)}"
    }

3. 参数验证

验证输入参数:

def execute(command: str, params: dict) -> dict:
    # 验证必需参数

    required_params = ["input", "output"]
    for
 param in required_params:
        if
 param not in params:
            return
 {
                "success"
: False,
                "error"
: f"缺少必需参数: {param}"
            }

    # 验证参数类型

    if
 not isinstance(params["input"], str):
        return
 {
            "success"
: False,
            "error"
: "参数 input 必须是字符串"
        }

    # 继续处理...

安全注意事项

1. 权限最小化

只申请必要的权限:

{
  "permissions"
: [
    "file_read"
  // 只申请需要的权限
  ]

}

2. 路径验证

验证文件路径,防止路径遍历攻击:

import os

def
 safe_path(base_dir: str, user_path: str) -> str:
    """
    安全地拼接路径
    """

    full_path = os.path.join(base_dir, user_path)
    real_path = os.path.realpath(full_path)

    # 确保路径在允许的目录内

    if
 not real_path.startswith(os.path.realpath(base_dir)):
        raise
 ValueError("非法路径访问")

    return
 real_path

3. 敏感信息保护

不要在代码中硬编码敏感信息:

# ❌ 错误
api_key = "sk-xxxxx"

# ✅ 正确

import
 os
api_key = os.environ.get("API_KEY")

性能优化

1. 大文件处理

使用流式处理大文件:

def process_large_file(file_path: str):
    """流式处理大文件"""

    with
 open(file_path, 'r') as f:
        for
 line in f:
            # 逐行处理

            process_line(line)

2. 并发处理

利用并发提高效率:

from concurrent.futures import ThreadPoolExecutor

def
 batch_process(files: list, max_workers: int = 5):
    """批量并发处理"""

    with
 ThreadPoolExecutor(max_workers=max_workers) as executor:
        results = executor.map(process_file, files)
    return
 list(results)

测试

编写单元测试:

# tests/test_main.py

import
 pytest
from
 main import execute

def
 test_to_datetime():
    result = execute("to-datetime", {"timestamp": 1709251200})
    assert
 result["success"] == True
    assert
 result["result"] == "2024-03-01 00:00:00"

def
 test_to_timestamp():
    result = execute("to-timestamp", {"datetime_str": "2024-03-01 00:00:00"})
    assert
 result["success"] == True
    assert
 result["result"] == 1709251200

def
 test_invalid_command():
    result = execute("invalid", {})
    assert
 result["success"] == False

运行测试:

pytest tests/

小结

这一篇,你学会了:

  1. 1. ✅ 技能的本质:配置文件 + 脚本
  2. 2. ✅ 搭建开发环境
  3. 3. ✅ 从零开发一个简单技能
  4. 4. ✅ 技能发布流程
  5. 5. ✅ 最佳实践与注意事项

编写技能让你能够扩展 OpenClaw 的能力边界,满足个性化需求。


下篇预告

下一篇,我们学习 OpenClaw 的进阶配置:性能优化与安全加固。

下一篇:OpenClaw 进阶配置:性能优化与安全加固


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