当前位置:首页>python>使用Python进行事件驱动型回测(续2)

使用Python进行事件驱动型回测(续2)

  • 2026-01-31 19:22:09
使用Python进行事件驱动型回测(续2)

在本系列的前两篇文章中,我们讨论了事件驱动型回测系统以及事件对象的类层次结构。在本文中,我们将探讨市场数据在历史回测与实盘交易中的具体应用机制。

构建事件驱动交易系统的核心目标之一是尽量减少回测组件与实盘执行组件之间的代码重复。理想情况下,我们希望将相同的信号生成方法和投资组合管理组件同时应用于历史测试和实盘交易。为了实现这一点,生成信号的策略对象Strategy和基于信号提供订单的投资组合对象Portfolio必须通过统一接口获取历史数据和实时市场数据。

这就引出了基于数据处理器DataHandler对象的类层次结构的概念,它为所有子类提供了一个向系统其它组件提供市场数据的统一接口。通过这种方式,任何子类数据处理器都可以被“替换”,而不会影响策略或投资组合的计算逻辑。

具体的子类示例可能包括 历史CSV数据处理器 HistoricCSVDataHandler、证券主数据处理器QuandlDataHandler、SecuritiesMasterDataHandler等。在本文中,我们仅考虑创建一个历史CSV数据处理器,它将为股票加载包含开盘价-最低价-最高价-收盘价-成交量-持仓量(Open-Low-High-Close-Volume-OpenInterest)的日内CSV数据。然后,这可以在系统的每一次“心跳”中,以逐根K线为基础“滴灌式”地将数据输入到策略Strategy和投资组合类Portfolio中,从而避免前视偏差。

第一个任务是导入必要的库,也就是pandas 库和抽象基类工具。由于数据处理器还需要生成市场事件,我们要导入上一篇教程中描述的event.py文件:

# data.pyimport datetimeimport os, os.pathimport pandas as pdfrom abc import ABCMeta, abstractmethodfrom event import MarketEvent

数据处理器DataHandler是一个抽象基类(ABC),这意味着无法直接实例化该类的对象,只能通过实例化其子类来使用。这样设计的原理在于:,抽象基类为所有后续的数据处理器DataHandler子类提供了必须遵循的统一接口,从而确保与其他交互类别的兼容性。

我们使用__metaclass__属性告知 Python 这是一个抽象基类。此外,我们还使用@abstractmethod装饰系统来标识那些需要在子类中具体实现的方法(这与C++中的纯虚函数概念一致)。

其中两个核心方法是get_latest_barsupdate_bars。前者返回从当前“心跳”时间戳起对应的最近的若干根 K 线数据,这对策略类Strategy中所需要进行的滚动计算非常有用;后者则提供了一种“滴灌式”数据更新机制,将新的 K 线数据逐条送入一个新的数据结构中,严格防止前视偏差的发生。要注意的是,如果尝试直接实例化这个抽象基类,程序将抛出异常:

# data.pyclass DataHandler(object):    """    DataHandler is an abstract base class providing an interface for    all subsequent (inherited) data handlers (both live and historic).    The goal of a (derived) DataHandler object is to output a generated    set of bars (OLHCVI) for each symbol requested.     This will replicate how a live strategy would function as current    market data would be sent "down the pipe". Thus a historic and live    system will be treated identically by the rest of the backtesting suite.    """    __metaclass__ = ABCMeta    @abstractmethod    def get_latest_bars(self, symbol, N=1):        """        Returns the last N bars from the latest_symbol list,        or fewer if less bars are available.        """        raise NotImplementedError("Should implement get_latest_bars()")    @abstractmethod    def update_bars(self):        """        Pushes the latest bar to the latest symbol structure        for all symbols in the symbol list.        """        raise NotImplementedError("Should implement update_bars()")

在定义了数据处理器DataHandler 抽象基类(ABC)之后,下一步就是为历史 CSV 文件创建一个数据处理器。具体来说,HistoricCSVDataHandler将接收多个 CSV 文件(每个交易代码对应一个文件),并将它们转换为为包含pandas数据帧的字典结构

该数据处理器需要几个参数,即一个用于推送市场事件 MarketEvent 信息的事件队列、CSV 文件的绝对路径以及一个代码列表。以下是该类的初始化代码:

# data.pyclass HistoricCSVDataHandler(DataHandler):    """    HistoricCSVDataHandler is designed to read CSV files for    each requested symbol from disk and provide an interface    to obtain the "latest" bar in a manner identical to a live    trading interface.     """    def __init__(self, events, csv_dir, symbol_list):        """        Initialises the historic data handler by requesting        the location of the CSV files and a list of symbols.        It will be assumed that all files are of the form        'symbol.csv', where symbol is a string in the list.        Parameters:        events - The Event Queue.        csv_dir - Absolute directory path to the CSV files.        symbol_list - A list of symbol strings.        """        self.events = events        self.csv_dir = csv_dir        self.symbol_list = symbol_list        self.symbol_data = {}        self.latest_symbol_data = {}        self.continue_backtest = True               self._open_convert_csv_files()

该处理器会默认地尝试以“SYMBOL.csv”的格式打开文件,其中 symbol 是交易品种代码。文件的格式可以修改以处理其他数据格式。文件的打开由下面的_open_convert_csv_files方法处理。

HistoricCSVDataHandler内部使用 pandas 作为数据存储的一个好处是,所有被跟踪代码符号的索引可以合并在一起。这使得缺失的数据点能够通过前向填充、后向填充或插值等方法进行补全,从而确保不同交易品种的数据能够在逐根K线的层面上进行比较。这对于均值回归策略很有必要。要注意在合并所有交易代码索引时对unionreindex方法的使用:

# data.py    def _open_convert_csv_files(self):        """        Opens the CSV files from the data directory, converting        them into pandas DataFrames within a symbol dictionary.        For this handler it will be assumed that the data is        taken from Yahoo. Thus its format will be respected.        """        comb_index = None        for s in self.symbol_list:            # Load the CSV file with no header information, indexed on date            self.symbol_data[s] = pd.read_csv(                os.path.join(self.csv_dir, '%s.csv' % s),                header=0, index_col=0, parse_dates=True,                names=[                    'datetime''open''high'                    'low''close''adj_close''volume'                ]            )            self.symbol_data[s].sort_index(inplace=True)            # Combine the index to pad forward values            if comb_index is None:                comb_index = self.symbol_data[s].index            else:                comb_index.union(self.symbol_data[s].index)            # Set the latest symbol_data to None            self.latest_symbol_data[s] = []        for s in self.symbol_list:            self.symbol_data[s] = self.symbol_data[s].reindex(                index=comb_index, method='pad'            )            self.symbol_data[s]["returns"] = self.symbol_data[s]["adj_close"].pct_change().dropna()            self.symbol_data[s] = self.symbol_data[s].iterrows()        # Reindex the dataframes        for s in self.symbol_list:            self.symbol_data[s] = self.symbol_data[s].reindex(index=comb_index, method='pad').iterrows()
_get_new_bar 方法创建了一个生成器,用于提供格式化后的K线数据。这意味着对该方法的后续调用将逐根“生成”新的K线,直至该代码对应的数据全部输出完毕:
# data.py    def _get_new_bar(self, symbol):        """        Returns the latest bar from the data feed as a tuple of         (sybmbol, datetime, open, low, high, close, volume).        """        for b in self.symbol_data[symbol]:            yield tuple([symbol, datetime.datetime.strptime(b[0], '%Y-%m-%d %H:%M:%S'),                         b[1][0], b[1][1], b[1][2], b[1][3], b[1][4]])
第一个需要实现的数据处理器抽象方法是get_latest_bars。该方法仅从 latest_symbol_data 结构中提供最近N根 K 线的列表。当设置N=1时,即可获取当前数据柱(以列表形式封装):
# data.py    def get_latest_bars(self, symbol, N=1):        """        Returns the last N bars from the latest_symbol list,        or N-k if less available.        """        try:            bars_list = self.latest_symbol_data[symbol]        except KeyError:            print "That symbol is not available in the historical data set."        else:            return bars_list[-N:]

最后一个方法update_bars是数据处理器中需要实现的第二个抽象方法。该方法在将最新K线数据追加到latest_symbol_data的同时,会生成一个市场事件MarketEvent并将其加入队列:

# data.py    def update_bars(self):        """        Pushes the latest bar to the latest_symbol_data structure        for all symbols in the symbol list.        """        for s in self.symbol_list:            try:                bar = self._get_new_bar(s).next()            except StopIteration:                self.continue_backtest = False            else:                if bar is not None:                    self.latest_symbol_data[s].append(bar)        self.events.put(MarketEvent())

因此,我们得到了一个由DataHandler派生的对象,系统其余组件利用它来跟踪市场数据。策略Strategy、投资组合Portfolio和执行处理ExecutionHandler对象都需要当前的市场数据,因此将其集中管理可以避免存储冗余

在下一篇文章中,我们将探讨策略类Strategy的层次结构,并描述如何设计一个能够处理多个交易代码的策略,从而为投资组合对象生成多个 信号事件SignalEvents

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 05:42:19 HTTP/2.0 GET : https://f.mffb.com.cn/a/470607.html
  2. 运行时间 : 0.209864s [ 吞吐率:4.76req/s ] 内存消耗:4,699.14kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=be42f95d29ec6c61719498c6a2e9ca58
  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.000720s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000820s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.005683s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000270s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000514s ]
  6. SELECT * FROM `set` [ RunTime:0.000178s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000582s ]
  8. SELECT * FROM `article` WHERE `id` = 470607 LIMIT 1 [ RunTime:0.029667s ]
  9. UPDATE `article` SET `lasttime` = 1770500539 WHERE `id` = 470607 [ RunTime:0.009850s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000303s ]
  11. SELECT * FROM `article` WHERE `id` < 470607 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.009269s ]
  12. SELECT * FROM `article` WHERE `id` > 470607 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.003530s ]
  13. SELECT * FROM `article` WHERE `id` < 470607 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.009940s ]
  14. SELECT * FROM `article` WHERE `id` < 470607 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.032515s ]
  15. SELECT * FROM `article` WHERE `id` < 470607 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.032449s ]
0.211546s