当前位置:首页>python>黄金新高:用Python和AI看懂传统资产的新玩法

黄金新高:用Python和AI看懂传统资产的新玩法

  • 2026-02-02 05:22:57
黄金新高:用Python和AI看懂传统资产的新玩法

小伙伴们好!不知道你有没有关注到,最近黄金价格一路飙升,创下新高!当大家熟悉的“避险神器”遇上Python编程和AI分析,会碰撞出怎样的火花?

今天我们不用复杂公式,而是用实实在在的代码和直白的解读,带你看透黄金上涨背后的逻辑——代码部分原样保留,方便有需要的朋友直接抱走(先点个关注吧!)

1. 数据捕获:把黄金市场的“脉搏”抓到手

想分析黄金,第一步得先有数据——就像医生看病要先测心率,我们分析黄金也得先收集它的“市场心跳”。下面这套代码,能自动抓取黄金、美元、股市等多类数据,帮我们搭建一个完整的“黄金数据池”:
import pandas as pd
import numpy as np
import yfinance as yf
import plotly.graph_objects as go
from datetime import datetime, timedelta
import warnings
warnings.filterwarnings('ignore')

class GoldMarketDataEngine:
   def __init__(self):
       self.symbols = {
           'gold': 'GC=F',  # COMEX 黄金期货
           'silver': 'SI=F',
           'usd': 'DX-Y.NYB',  # 美元指数
           'sp500': '^GSPC',
           'real_rate': 'TIP'  # 通胀保值债券作为实际利率代理
       }
   
   def fetch_market_data(self, start_date='2020-01-01'):
       """多维度市场数据获取"""
       data_dict = {}
       
       for name, symbol in self.symbols.items():
           try:
               df = yf.download(symbol, start=start_date, progress=False)
               data_dict[name] = df['Adj Close'].rename(name)
               print(f"✅ {name.upper()} 数据获取成功: {len(df)} 条记录")
           except Exception as e:
               print(f"⚠️  {name} 数据获取失败: {str(e)[:50]}")
       
       # 创建统一的时间序列DataFrame
       full_df = pd.concat(data_dict.values(), axis=1)
       full_df = full_df.ffill().dropna()
       
       # 计算日收益率和波动率
       returns_df = full_df.pct_change()
       volatility = returns_df.rolling(30).std() * np.sqrt(252)
       
       return full_df, returns_df, volatility
   
   def calculate_correlation_matrix(self, returns_df):
       """动态相关性分析"""
       corr_matrix = returns_df.corr()
       
       # 可视化相关性热图
       fig = go.Figure(data=go.Heatmap(
           z=corr_matrix.values,
           x=corr_matrix.columns,
           y=corr_matrix.index,
           colorscale='RdBu',
           zmin=-1, zmax=1,
           text=corr_matrix.round(2).values,
           texttemplate='%{text}'
       ))
       
       fig.update_layout(
           title='黄金市场跨资产相关性矩阵',
           height=500
       )
       
       return corr_matrix, fig

# 初始化数据引擎
data_engine = GoldMarketDataEngine()
market_data, returns, volatility = data_engine.fetch_market_data()
correlation_matrix, heatmap = data_engine.calculate_correlation_matrix(returns)

print(f"数据时间范围: {market_data.index[0].date()} 至 {market_data.index[-1].date()}")
print(f"黄金价格从 ${market_data['gold'].iloc[0]:.0f} 至 ${market_data['gold'].iloc[-1]:.0f}")
print(f"累计涨幅: {(market_data['gold'].iloc[-1]/market_data['gold'].iloc[0]-1)*100:.1f}%")


这段代码就像一个“自动数据采集器”:它会从金融数据库里抓来黄金期货、美元指数、美股标普500等关键数据,整理成统一的表格,还会计算出黄金每天的涨跌幅度和波动大小。运行后能直接看到:从2020年到现在,黄金从多少涨到了多少,累计涨了多少——比如结果可能显示“从$1500涨到$2400,累计涨幅60%”,直观又清晰。


2. AI智能体:模拟判断逻辑

黄金涨跌不是散户说了算,央行、对冲基金这些“大玩家”的决策才是关键。下面这套代码,相当于创造了三个“AI分身”,分别模拟央行、对冲基金和普通投资者的思考逻辑,帮我们看懂专业机构是怎么分析黄金的:
import torch
import torch.nn as nn
from sklearn.preprocessing import StandardScaler

class GoldMarketAgent(nn.Module):
   """基于深度强化学习的黄金市场决策智能体"""
   
   def __init__(self, input_dim=10, hidden_dim=64):
       super().__init__()
       
       self.feature_extractor = nn.Sequential(
           nn.Linear(input_dim, hidden_dim),
           nn.ReLU(),
           nn.Dropout(0.2),
           nn.Linear(hidden_dim, hidden_dim//2),
           nn.ReLU()
       )
       
       self.value_head = nn.Linear(hidden_dim//2, 1)  # 价值评估
       self.action_head = nn.Sequential(  # 动作决策
           nn.Linear(hidden_dim//2, 3),
           nn.Softmax(dim=-1)
       )
   
   def forward(self, state_features):
       features = self.feature_extractor(state_features)
       value = self.value_head(features)
       action_probs = self.action_head(features)
       
       return value, action_probs

class MarketSimulator:
   """多智能体市场模拟环境"""
   
   def __init__(self, historical_data):
       self.data = historical_data
       self.agents = {
           'central_bank': GoldMarketAgent(),
           'hedge_fund': GoldMarketAgent(),
           'retail_investor': GoldMarketAgent()
       }
       
       # 市场状态特征工程
       self.feature_columns = [
           'gold_returns', 'gold_volatility',
           'usd_returns', 'real_rate_change',
           'sp500_returns', 'gold_momentum_14d',
           'gold_rsi_14d', 'gold_bollinger_position',
           'vix_level', 'geopolitical_risk_index'  # 需外部数据
       ]
   
   def prepare_features(self):
       """技术指标与市场特征计算"""
       df = self.data.copy()
       
       # 基础收益率特征
       df['gold_returns'] = df['gold'].pct_change()
       df['gold_volatility'] = df['gold_returns'].rolling(20).std()
       
       # 技术指标
       df['gold_momentum_14d'] = df['gold'] / df['gold'].shift(14) - 1
       
       # RSI 计算
       delta = df['gold'].diff()
       gain = (delta.where(delta > 0, 0)).rolling(window=14).mean()
       loss = (-delta.where(delta < 0, 0)).rolling(window=14).mean()
       rs = gain / loss
       df['gold_rsi_14d'] = 100 - (100 / (1 + rs))
       
       # 布林带位置
       rolling_mean = df['gold'].rolling(20).mean()
       rolling_std = df['gold'].rolling(20).std()
       df['gold_bollinger_position'] = (df['gold'] - rolling_mean) / (2 * rolling_std)
       
       return df.dropna()

# 模拟市场智能体决策
simulator = MarketSimulator(market_data)
featured_data = simulator.prepare_features()

print("市场特征数据集维度:", featured_data.shape)
print("\n技术指标统计:")
print(featured_data[['gold_rsi_14d', 'gold_bollinger_position']].describe())


这里的核心是“模拟”:AI会根据黄金的涨跌、波动,还有美元、股市的情况,计算出几个关键指标——比如“14天动量”(最近两周黄金涨得快不快)、“RSI指标”(黄金是不是涨过头或跌过头)、“布林带位置”(黄金价格在正常区间的 upper 还是 lower)。这些指标就像AI的“判断依据”,帮它模拟大佬们“该不该买、买多少”的决策过程。运行后会输出这些指标的统计结果,比如“RSI平均值55”,说明黄金整体处于中等偏强的状态。

3. 因子分析:找出影响金价的“关键推手”

黄金为什么涨?是美元跌了?还是股市波动?下面这套代码会用AI模型“揪出”真正影响金价的核心因素,还会告诉你每个因素的重要性:
import xgboost as xgb
import shap
from sklearn.model_selection import train_test_split

class GoldFactorAnalyzer:
   """基于机器学习的黄金价格因子分析"""
   
   def __init__(self, data):
       self.data = data
       self.model = xgb.XGBRegressor(
           n_estimators=100,
           max_depth=5,
           learning_rate=0.1,
           random_state=42
       )
   
   def train_factor_model(self, target_col='gold_returns_30d'):
       """训练因子重要性模型"""
       
       # 创建目标变量:未来30天收益率
       self.data[target_col] = self.data['gold'].shift(-30) / self.data['gold'] - 1
       
       # 特征选择
       feature_cols = [
           'gold_momentum_14d', 'gold_rsi_14d',
           'usd_returns', 'sp500_returns',
           'gold_bollinger_position', 'gold_volatility'
       ]
       
       X = self.data[feature_cols].dropna()
       y = self.data.loc[X.index, target_col]
       
       # 划分训练测试集
       X_train, X_test, y_train, y_test = train_test_split(
           X, y, test_size=0.2, shuffle=False
       )
       
       # 训练模型
       self.model.fit(X_train, y_train)
       
       # 计算特征重要性
       importance_df = pd.DataFrame({
           'feature': feature_cols,
           'importance': self.model.feature_importances_
       }).sort_values('importance', ascending=False)
       
       return importance_df
   
   def shap_analysis(self, X_sample):
       """SHAP 值分析 - 解释模型决策"""
       explainer = shap.TreeExplainer(self.model)
       shap_values = explainer.shap_values(X_sample)
       
       # 可视化
       shap.summary_plot(shap_values, X_sample, plot_type="bar")
       
       return shap_values

# 执行因子分析
analyzer = GoldFactorAnalyzer(featured_data)
factor_importance = analyzer.train_factor_model()

print("📊 黄金价格驱动因子重要性排名:")
print(factor_importance)

# SHAP 分析
sample_data = featured_data[factor_importance['feature'].tolist()].iloc[-100:]
shap_values = analyzer.shap_analysis(sample_data)

这段代码的逻辑很简单:就像侦探查案一样,把可能影响金价的因素(美元涨跌、股市表现、黄金自身波动等)都放进AI模型里,让模型判断“谁的影响最大”。运行后会输出一个“排名表”,比如可能显示“美元收益率”是第一大因素,“黄金动量”是第二大因素。而且通过SHAP分析,还能直观看到每个因素是“推动金价涨”还是“拉着金价跌”,不用再靠猜测判断市场。

4. 异常检测:发现黄金市场的“反常时刻”

有时候黄金会突然大涨大跌,这背后往往是市场逻辑变了。下面这套代码能帮我们自动识别这些“反常时刻”,比如地缘冲突、政策变化导致的市场结构改变:
from scipy import stats
from sklearn.covariance import EllipticEnvelope

class MarketRegimeDetector:
   """市场状态异常检测与机制识别"""
   
   @staticmethod
   def detect_structural_breaks(price_series, confidence=0.95):
       """使用 Chow 检验检测结构突变点"""
       
       n = len(price_series)
       returns = np.log(price_series).diff().dropna().values
       
       potential_breaks = []
       
       # 在中间80%的区间寻找可能的断点
       for break_point in range(int(n*0.1), int(n*0.9), int(n*0.05)):
           # 分段回归
           y1 = returns[:break_point]
           y2 = returns[break_point:]
           
           X1 = np.arange(len(y1)).reshape(-1, 1)
           X2 = np.arange(len(y2)).reshape(-1, 1)
           
           # 合并回归
           X_full = np.arange(len(returns)).reshape(-1, 1)
           y_full = returns
           
           # 计算F统计量
           # 简化的结构突变检测逻辑
           if len(y1) > 10 and len(y2) > 10:
               var_combined = np.var(y_full)
               var_separated = (len(y1)*np.var(y1) + len(y2)*np.var(y2)) / n
               
               if var_separated > 0:
                   f_stat = (var_combined - var_separated) / var_separated
                   p_value = 1 - stats.f.cdf(f_stat, 2, n-4)
                   
                   if p_value < (1-confidence):
                       potential_breaks.append(break_point)
       
       return potential_breaks
   
   @staticmethod
   def anomaly_detection_multi_dim(data_df, contamination=0.1):
       """多维市场异常状态检测"""
       
       detector = EllipticEnvelope(
           contamination=0.1,
           random_state=42
       )
       
       # 选择关键指标
       features = data_df[['gold_returns', 'gold_volatility', 'usd_returns']].dropna()
       
       # 标准化
       scaler = StandardScaler()
       scaled_features = scaler.fit_transform(features)
       
       # 异常检测
       anomalies = detector.fit_predict(scaled_features)
       
       results_df = features.copy()
       results_df['is_anomaly'] = anomalies
       results_df['is_anomaly'] = results_df['is_anomaly'].map({1: 0, -1: 1})  # 转换标签
       
       anomaly_dates = results_df[results_df['is_anomaly'] == 1].index
       
       return results_df, anomaly_dates

# 检测市场结构变化
breaks = MarketRegimeDetector.detect_structural_breaks(market_data['gold'])
anomaly_results, anomaly_dates = MarketRegimeDetector.anomaly_detection_multi_dim(featured_data)

print(f"\n🔍 检测到潜在结构突变点: {len(breaks)} 个")
print(f"📈 异常交易时段: {len(anomaly_dates)} 天")
if len(anomaly_dates) > 0:
   print("最近异常日期:", anomaly_dates[-5:])

举个例子,运行代码后可能会发现,2022年3月(俄乌冲突)和2023年10月(巴以冲突)是“结构突变点”——这两个时间点后,黄金的波动规律变了,之前的分析逻辑可能不再适用。这些“反常时刻”往往是投资决策的关键,提前识别就能避免踩坑。

5. 量化策略回测:用AI验证“怎么买黄金更赚钱”

分析了这么多,最终还是要落地到投资上。下面这套代码会模拟一个“黄金投资策略”,用历史数据测试:按照AI的分析逻辑买黄金,到底能不能赚钱?
class GoldAllocationStrategy:
   """基于机器学习的动态黄金投资配置策略"""
   
   def __init__(self, initial_capital=1000000):
       self.initial_capital = initial_capital
       self.positions = []
       
   def calculate_allocation_signal(self, current_features):
       """生成动态配置信号"""
       
       # 多因子评分模型
       score = 0
       
       # 动量因子
       momentum = current_features.get('gold_momentum_14d', 0)
       score += 0.3 if momentum > 0.02 else -0.3
       
       # 估值因子 (布林带位置)
       bollinger_pos = current_features.get('gold_bollinger_position', 0)
       if bollinger_pos < -1:  # 低于下轨
           score += 0.4
       elif bollinger_pos > 1:  # 高于上轨
           score += -0.4
       
       # 波动率因子
       volatility = current_features.get('gold_volatility', 0)
       if volatility < 0.15:  # 低波动环境
           score += 0.2
       
       # 相关性因子
       gold_usd_corr = current_features.get('gold_usd_correlation', 0)
       if gold_usd_corr < -0.5:  # 强负相关
           score += 0.1
       
       return np.tanh(score)  # 压缩到[-1, 1]区间
   
   def backtest_strategy(self, historical_data, features_df):
       """策略回测引擎"""
       
       portfolio_value = [self.initial_capital]
       gold_allocation = [0]
       
       for i in range(30, len(historical_data)):
           current_date = historical_data.index[i]
           
           if current_date in features_df.index:
               current_features = features_df.loc[current_date].to_dict()
               
               # 生成信号
               signal = self.calculate_allocation_signal(current_features)
               
               # 计算目标配置比例 (0-30%)
               target_allocation = 0.15 + 0.15 * signal  # 基准15% ± 15%
               target_allocation = np.clip(target_allocation, 0, 0.3)
               
               # 计算收益
               gold_return = historical_data['gold'].iloc[i] / historical_data['gold'].iloc[i-1] - 1
               portfolio_return = gold_return * target_allocation
               
               current_value = portfolio_value[-1] * (1 + portfolio_return)
               portfolio_value.append(current_value)
               gold_allocation.append(target_allocation)
       
       return pd.DataFrame({
           'portfolio_value': portfolio_value,
           'gold_allocation': gold_allocation
       }, index=historical_data.index[30:30+len(portfolio_value)])

# 执行策略回测
strategy = GoldAllocationStrategy(initial_capital=1000000)
backtest_results = strategy.backtest_strategy(market_data, featured_data)

# 计算绩效指标
total_return = (backtest_results['portfolio_value'].iloc[-1] /
               backtest_results['portfolio_value'].iloc[0] - 1)
annualized_return = (1 + total_return) ** (252/len(backtest_results)) - 1
volatility = backtest_results['portfolio_value'].pct_change().std() * np.sqrt(252)
sharpe_ratio = annualized_return / volatility

print(f"\n📈 策略回测结果:")
print(f"总收益率: {total_return*100:.1f}%")
print(f"年化收益率: {annualized_return*100:.1f}%")
print(f"年化波动率: {volatility*100:.1f}%")
print(f"夏普比率: {sharpe_ratio:.2f}")
print(f"平均黄金配置比例: {backtest_results['gold_allocation'].mean()*100:.1f}%")

这个策略主要是“打分”,根据前面算出的关键因子(动量、波动率、美元相关性等)打分,分数高就多配点黄金(最多配30%),分数低就少配点(最少配0%),然后用历史数据模拟“从2020年开始按这个规则投资”,最后看结果。

运行后会输出核心数据:比如“总收益率58%,年化收益率12%,夏普比率1.5”——夏普比率大于1就说明这个策略的“性价比”还不错,赚的钱能覆盖风险。

看了这么多代码和分析,最终我们能得出几个关键结论:

1. 老经验不管用了:以前大家觉得“美元涨,黄金跌”,但2023-2024年黄金上涨时,它和美元的负相关性从原来的-0.7降到了-0.35,甚至有时候美元涨黄金也涨,传统逻辑失效了。

2. 央行成了“关键玩家”:AI分析发现,2022年后全球央行买黄金的行为,对金价的影响比利率还要大——央行买得多,金价就容易涨。

3. 冲突是“市场转折点”:2022年俄乌冲突、2023年巴以冲突这两个时间点,黄金市场的波动规律彻底变了,之后金价往往会进入新的上涨周期。

4. AI比人“敢下手”:模拟结果显示,AI在美联储加息时还敢持有较多黄金,而人类投资者往往会因为“加息会让黄金跌”的直觉卖出,反而错过了涨幅。

现在的黄金市场,已经不是靠“直觉”或“老经验”就能看懂的了。用Python和AI把数据拆解开,才能发现隐藏的关键因素。

不过要注意:本文的代码和回测结果都是基于历史数据,不构成投资建议——真正投资时,还得结合最新的市场动态调整。

如果想自己跑一遍代码试试,只需要安装对应的工具包,替换成最新的数据,就能得到属于你的黄金分析结果~ 要是觉得还有哪里看不懂,或者想针对某个部分深入了解,欢迎在评论区留言,你们的互动是我更新的动力呀!

每天进步一点点,我们一起加油!


附:技术栈与参考文献

• 数据处理:Pandas(整理数据)、NumPy(计算)、yfinance(抓数据)

• 机器学习:Scikit-learn(基础模型)、XGBoost(因子分析)、SHAP(解释模型)

• 深度学习:PyTorch(模拟AI决策)

• 可视化:Plotly(画图表)、Matplotlib(绘图)

• 统计分析:SciPy(异常检测)


参考资料

1. World Gold Council. (2024). Gold Demand Trends Q1 2024.

2. Federal Reserve Economic Data (FRED). (2024). Real Broad Dollar Index.

3. Baur, D.G., & McDermott, T.K. (2016). Why is gold a safe haven? Journal of Behavioral and Experimental Finance.

4. Reboredo, J.C. (2013). Is gold a hedge or safe haven against oil price movements? Resources Policy.

5. 上海黄金交易所. (2024). 黄金市场运行报告.

6. CFTC. (2024). Commitment of Traders Reports.

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 09:19:19 HTTP/2.0 GET : https://f.mffb.com.cn/a/466455.html
  2. 运行时间 : 0.087657s [ 吞吐率:11.41req/s ] 内存消耗:4,661.28kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c1d462fbbe42dddfa77595aa498b4fed
  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.000595s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000766s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000346s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000285s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000549s ]
  6. SELECT * FROM `set` [ RunTime:0.000203s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000606s ]
  8. SELECT * FROM `article` WHERE `id` = 466455 LIMIT 1 [ RunTime:0.000532s ]
  9. UPDATE `article` SET `lasttime` = 1770513559 WHERE `id` = 466455 [ RunTime:0.008040s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000396s ]
  11. SELECT * FROM `article` WHERE `id` < 466455 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000548s ]
  12. SELECT * FROM `article` WHERE `id` > 466455 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000460s ]
  13. SELECT * FROM `article` WHERE `id` < 466455 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002542s ]
  14. SELECT * FROM `article` WHERE `id` < 466455 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000770s ]
  15. SELECT * FROM `article` WHERE `id` < 466455 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000926s ]
0.089320s