<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>IT收藏分享屋</title><link>http://www.jewe.wang/</link><description>PHP、H5、nginx、python、linux、mysql、nodejs、ffmpeg、github、lua</description><item><title>纯音乐库特征提取</title><link>http://www.jewe.wang/?id=24</link><description>&lt;p&gt;&lt;span style=&quot;color: #1F2329; font-family: ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;# 安装musly（Python绑定）
pip install musly-python

# 安装FAISS（CPU版，GPU版需单独编译）
pip install faiss-cpu

# 其他依赖
pip install librosa soundfile numpy pandas tqdm&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #1F2329; font-family: ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #1F2329; font-family: ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;&lt;span style=&quot;color: #1F2329; font-family: ui-sans-serif, system-ui, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;, &amp;quot;Segoe UI Symbol&amp;quot;, &amp;quot;Noto Color Emoji&amp;quot;; font-size: 16px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;import os
import musly
import faiss
import numpy as np
import pandas as pd
from tqdm import tqdm
import librosa

# ===================== 配置参数 =====================
MUSIC_DIR = &amp;quot;./pure_music_library/&amp;quot; &amp;nbsp;# 你的纯音乐目录
INDEX_PATH = &amp;quot;./music_index.faiss&amp;quot; &amp;nbsp; &amp;nbsp;# FAISS索引保存路径
METADATA_PATH = &amp;quot;./music_metadata.csv&amp;quot; # 音乐路径-特征映射表
SIMILAR_TOP_K = 10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # 检索返回最相似的K首

# ===================== 工具函数 =====================
def get_audio_files(dir_path):
 &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;获取目录下所有音频文件（WAV/MP3）&amp;quot;&amp;quot;&amp;quot;
 &amp;nbsp; &amp;nbsp;audio_ext = (&amp;quot;.wav&amp;quot;, &amp;quot;.mp3&amp;quot;, &amp;quot;.flac&amp;quot;, &amp;quot;.ogg&amp;quot;)
 &amp;nbsp; &amp;nbsp;audio_files = []
 &amp;nbsp; &amp;nbsp;for root, _, files in os.walk(dir_path):
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for file in files:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if file.lower().endswith(audio_ext):
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;audio_files.append(os.path.join(root, file))
 &amp;nbsp; &amp;nbsp;return audio_files

def extract_musly_feature(audio_path):
 &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;使用Musly提取音频特征（timbre模式，纯音乐首选）&amp;quot;&amp;quot;&amp;quot;
 &amp;nbsp; &amp;nbsp;try:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# 初始化Musly（timbre模式：适合纯音乐音色/风格匹配）
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;music_analyzer = musly.Analyzer()
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# 加载音频并提取特征（返回定长向量）
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;feature = music_analyzer.analyze(audio_path, musly.MuslyTimbre)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return feature.astype(np.float32) &amp;nbsp;# FAISS要求float32
 &amp;nbsp; &amp;nbsp;except Exception as e:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(f&amp;quot;提取特征失败 {audio_path}: {e}&amp;quot;)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return None

# ===================== 构建索引 =====================
def build_music_index():
 &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;提取特征并构建FAISS索引&amp;quot;&amp;quot;&amp;quot;
 &amp;nbsp; &amp;nbsp;# 1. 获取所有音频文件
 &amp;nbsp; &amp;nbsp;audio_files = get_audio_files(MUSIC_DIR)
 &amp;nbsp; &amp;nbsp;if not audio_files:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(&amp;quot;未找到音频文件！&amp;quot;)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 2. 批量提取Musly特征
 &amp;nbsp; &amp;nbsp;features = []
 &amp;nbsp; &amp;nbsp;valid_files = []
 &amp;nbsp; &amp;nbsp;for file in tqdm(audio_files, desc=&amp;quot;提取Musly特征&amp;quot;):
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;feat = extract_musly_feature(file)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if feat is not None:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;features.append(feat)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;valid_files.append(file)
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 3. 保存元数据（文件路径-索引映射）
 &amp;nbsp; &amp;nbsp;metadata = pd.DataFrame({&amp;quot;file_path&amp;quot;: valid_files})
 &amp;nbsp; &amp;nbsp;metadata.to_csv(METADATA_PATH, index=False, encoding=&amp;quot;utf-8&amp;quot;)
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 4. 构建FAISS索引（L2距离：适配Musly特征分布）
 &amp;nbsp; &amp;nbsp;feature_matrix = np.vstack(features)
 &amp;nbsp; &amp;nbsp;dim = feature_matrix.shape[1] &amp;nbsp;# Musly特征维度（默认~200维）
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 选择索引类型：IVF_FLAT适合百万级数据，速度快
 &amp;nbsp; &amp;nbsp;index = faiss.IndexIVFFlat(
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;faiss.IndexFlatL2(dim), &amp;nbsp;# 基础索引（L2距离）
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dim, 
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;min(100, len(valid_files)//10), &amp;nbsp;# 聚类数（经验值）
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;faiss.METRIC_L2
 &amp;nbsp; &amp;nbsp;)
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 训练+添加数据
 &amp;nbsp; &amp;nbsp;index.train(feature_matrix)
 &amp;nbsp; &amp;nbsp;index.add(feature_matrix)
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 5. 保存索引
 &amp;nbsp; &amp;nbsp;faiss.write_index(index, INDEX_PATH)
 &amp;nbsp; &amp;nbsp;print(f&amp;quot;索引构建完成！共处理 {len(valid_files)} 首音乐，索引保存至 {INDEX_PATH}&amp;quot;)

# ===================== 相似检索 =====================
def search_similar_music(query_audio_path):
 &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;检索与查询音频最相似的音乐&amp;quot;&amp;quot;&amp;quot;
 &amp;nbsp; &amp;nbsp;# 1. 加载索引和元数据
 &amp;nbsp; &amp;nbsp;if not os.path.exists(INDEX_PATH) or not os.path.exists(METADATA_PATH):
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(&amp;quot;索引/元数据不存在，先构建索引！&amp;quot;)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;build_music_index()
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;index = faiss.read_index(INDEX_PATH)
 &amp;nbsp; &amp;nbsp;metadata = pd.read_csv(METADATA_PATH, encoding=&amp;quot;utf-8&amp;quot;)
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 2. 提取查询音频特征
 &amp;nbsp; &amp;nbsp;query_feat = extract_musly_feature(query_audio_path)
 &amp;nbsp; &amp;nbsp;if query_feat is None:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(&amp;quot;查询音频特征提取失败！&amp;quot;)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return []
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 3. FAISS检索（返回距离和索引）
 &amp;nbsp; &amp;nbsp;query_feat = query_feat.reshape(1, -1) &amp;nbsp;# 转为2D数组
 &amp;nbsp; &amp;nbsp;distances, indices = index.search(query_feat, SIMILAR_TOP_K)
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 4. 解析结果（距离越小越相似）
 &amp;nbsp; &amp;nbsp;similar_results = []
 &amp;nbsp; &amp;nbsp;for i, idx in enumerate(indices[0]):
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;file_path = metadata.iloc[idx][&amp;quot;file_path&amp;quot;]
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;similar_results.append({
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;rank&amp;quot;: i+1,
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;file_path&amp;quot;: file_path,
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;distance&amp;quot;: distances[0][i] &amp;nbsp;# 距离越小，相似度越高
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;})
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;return similar_results

# ===================== 主函数 =====================
if __name__ == &amp;quot;__main__&amp;quot;:
 &amp;nbsp; &amp;nbsp;# 第一步：构建索引（首次运行执行）
 &amp;nbsp; &amp;nbsp;build_music_index()
 &amp;nbsp; &amp;nbsp;
 &amp;nbsp; &amp;nbsp;# 第二步：示例：检索相似音乐
 &amp;nbsp; &amp;nbsp;query_audio = &amp;quot;./test_piano.mp3&amp;quot; &amp;nbsp;# 你的查询纯音乐文件
 &amp;nbsp; &amp;nbsp;if os.path.exists(query_audio):
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;similar_music = search_similar_music(query_audio)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(f&amp;quot;\n与 {query_audio} 最相似的{SIMILAR_TOP_K}首音乐：&amp;quot;)
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for res in similar_music:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(f&amp;quot;排名{res[&amp;#39;rank&amp;#39;]} | 距离{res[&amp;#39;distance&amp;#39;]:.4f} | 路径：{res[&amp;#39;file_path&amp;#39;]}&amp;quot;)
 &amp;nbsp; &amp;nbsp;else:
 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(f&amp;quot;查询文件 {query_audio} 不存在！&amp;quot;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description><pubDate>Sun, 22 Mar 2026 23:46:11 +0800</pubDate></item><item><title>ByteCover算法核心复现代码</title><link>http://www.jewe.wang/?id=23</link><description>&lt;div data-page-id=&quot;NWgpd94cMo0zoDxiX9wcWeg7nBb&quot; data-lark-html-role=&quot;root&quot; data-docx-has-block-data=&quot;false&quot;&gt;&lt;pre class=&quot;ace-line ace-line old-record-id-EfEvfoozwdhBAfcGaTScj5N0n3f&quot;&gt;#&amp;nbsp;安装依赖：pip&amp;nbsp;install&amp;nbsp;librosa&amp;nbsp;numpy&amp;nbsp;scipy
import&amp;nbsp;librosa
import&amp;nbsp;numpy&amp;nbsp;as&amp;nbsp;np
from&amp;nbsp;sklearn.decomposition&amp;nbsp;import&amp;nbsp;PCA
from&amp;nbsp;scipy.spatial.distance&amp;nbsp;import&amp;nbsp;cosine

def&amp;nbsp;bytecover_feature_extract(audio_path,&amp;nbsp;n_mfcc=20,&amp;nbsp;pca_components=16):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteCover核心特征提取函数
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.&amp;nbsp;加载音频，提取MFCC+色度特征（对应旋律核心特征）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2.&amp;nbsp;PCA降维压缩（对应原文PCA-FC模块，提速8倍）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.&amp;nbsp;输出标准化ByteCover特征向量
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;1.&amp;nbsp;音频加载与预处理（固定采样率，适配抖音识曲标准）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y,&amp;nbsp;sr&amp;nbsp;=&amp;nbsp;librosa.load(audio_path,&amp;nbsp;sr=22050,&amp;nbsp;mono=True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;去除静音片段，过滤噪音
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y_trimmed,&amp;nbsp;_&amp;nbsp;=&amp;nbsp;librosa.effects.trim(y,&amp;nbsp;top_db=20)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;2.&amp;nbsp;提取核心声学特征（ByteCover核心：保留旋律，忽略变速变调干扰）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;MFCC特征（音色+旋律）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mfcc&amp;nbsp;=&amp;nbsp;librosa.feature.mfcc(y=y_trimmed,&amp;nbsp;sr=sr,&amp;nbsp;n_mfcc=n_mfcc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mfcc_mean&amp;nbsp;=&amp;nbsp;np.mean(mfcc,&amp;nbsp;axis=1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;色度特征（音高/旋律核心，翻唱变调不变）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;chroma&amp;nbsp;=&amp;nbsp;librosa.feature.chroma_stft(y=y_trimmed,&amp;nbsp;sr=sr)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;chroma_mean&amp;nbsp;=&amp;nbsp;np.mean(chroma,&amp;nbsp;axis=1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;拼接特征
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feature&amp;nbsp;=&amp;nbsp;np.concatenate([mfcc_mean,&amp;nbsp;chroma_mean])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;3.&amp;nbsp;PCA降维（ByteCover核心提速模块，压缩特征维度）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pca&amp;nbsp;=&amp;nbsp;PCA(n_components=pca_components)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;适配单样本维度
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feature_pca&amp;nbsp;=&amp;nbsp;pca.fit_transform(feature.reshape(1,&amp;nbsp;-1))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;标准化
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feature_norm&amp;nbsp;=&amp;nbsp;feature_pca&amp;nbsp;/&amp;nbsp;np.linalg.norm(feature_pca)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;feature_norm.flatten()

def&amp;nbsp;bytecover_match(feature1,&amp;nbsp;feature2,&amp;nbsp;threshold=0.15):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ByteCover特征匹配函数
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;计算余弦相似度，阈值判断是否为同一首歌（翻唱/原版）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;threshold：相似度阈值，越小匹配越严格
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;返回：匹配结果+相似度分数
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;similarity&amp;nbsp;=&amp;nbsp;1&amp;nbsp;-&amp;nbsp;cosine(feature1,&amp;nbsp;feature2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;is_match&amp;nbsp;=&amp;nbsp;similarity&amp;nbsp;&amp;gt;&amp;nbsp;threshold
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;is_match,&amp;nbsp;round(similarity,&amp;nbsp;4)

#&amp;nbsp;-------------------&amp;nbsp;运行示例&amp;nbsp;-------------------
if&amp;nbsp;__name__&amp;nbsp;==&amp;nbsp;&amp;quot;__main__&amp;quot;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;替换为你的音频文件路径（支持wav/mp3，mp3需安装ffmpeg）
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;original_audio&amp;nbsp;=&amp;nbsp;&amp;quot;原版歌曲.wav&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cover_audio&amp;nbsp;=&amp;nbsp;&amp;quot;翻唱/改编版本.wav&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;提取ByteCover特征
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feat_original&amp;nbsp;=&amp;nbsp;bytecover_feature_extract(original_audio)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feat_cover&amp;nbsp;=&amp;nbsp;bytecover_feature_extract(cover_audio)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#&amp;nbsp;匹配比对
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;match_result,&amp;nbsp;score&amp;nbsp;=&amp;nbsp;bytecover_match(feat_original,&amp;nbsp;feat_cover)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(f&amp;quot;匹配结果：{&amp;#39;同一首歌（翻唱/改编）&amp;#39;&amp;nbsp;if&amp;nbsp;match_result&amp;nbsp;else&amp;nbsp;&amp;#39;不同歌曲&amp;#39;}&amp;quot;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(f&amp;quot;相似度分数：{score}&amp;quot;)&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;span data-lark-record-data=&quot;{&amp;quot;rootId&amp;quot;:&amp;quot;NWgpd94cMo0zoDxiX9wcWeg7nBb&amp;quot;,&amp;quot;text&amp;quot;:{&amp;quot;initialAttributedTexts&amp;quot;:{&amp;quot;text&amp;quot;:{&amp;quot;0&amp;quot;:&amp;quot;# 安装依赖：pip install librosa numpy scipy\nimport librosa\nimport numpy as np\nfrom sklearn.decomposition import PCA\nfrom scipy.spatial.distance import cosine\n\ndef bytecover_feature_extract(audio_path, n_mfcc=20, pca_components=16):\n    \&amp;quot;\&amp;quot;\&amp;quot;\n    ByteCover核心特征提取函数\n    1. 加载音频，提取MFCC+色度特征（对应旋律核心特征）\n    2. PCA降维压缩（对应原文PCA-FC模块，提速8倍）\n    3. 输出标准化ByteCover特征向量\n    \&amp;quot;\&amp;quot;\&amp;quot;\n    # 1. 音频加载与预处理（固定采样率，适配抖音识曲标准）\n    y, sr = librosa.load(audio_path, sr=22050, mono=True)\n    # 去除静音片段，过滤噪音\n    y_trimmed, _ = librosa.effects.trim(y, top_db=20)\n    \n    # 2. 提取核心声学特征（ByteCover核心：保留旋律，忽略变速变调干扰）\n    # MFCC特征（音色+旋律）\n    mfcc = librosa.feature.mfcc(y=y_trimmed, sr=sr, n_mfcc=n_mfcc)\n    mfcc_mean = np.mean(mfcc, axis=1)\n    # 色度特征（音高/旋律核心，翻唱变调不变）\n    chroma = librosa.feature.chroma_stft(y=y_trimmed, sr=sr)\n    chroma_mean = np.mean(chroma, axis=1)\n    # 拼接特征\n    feature = np.concatenate([mfcc_mean, chroma_mean])\n    \n    # 3. PCA降维（ByteCover核心提速模块，压缩特征维度）\n    pca = PCA(n_components=pca_components)\n    # 适配单样本维度\n    feature_pca = pca.fit_transform(feature.reshape(1, -1))\n    # 标准化\n    feature_norm = feature_pca / np.linalg.norm(feature_pca)\n    \n    return feature_norm.flatten()\n\ndef bytecover_match(feature1, feature2, threshold=0.15):\n    \&amp;quot;\&amp;quot;\&amp;quot;\n    ByteCover特征匹配函数\n    计算余弦相似度，阈值判断是否为同一首歌（翻唱/原版）\n    threshold：相似度阈值，越小匹配越严格\n    返回：匹配结果+相似度分数\n    \&amp;quot;\&amp;quot;\&amp;quot;\n    similarity = 1 - cosine(feature1, feature2)\n    is_match = similarity &amp;gt; threshold\n    return is_match, round(similarity, 4)\n\n# ------------------- 运行示例 -------------------\nif __name__ == \&amp;quot;__main__\&amp;quot;:\n    # 替换为你的音频文件路径（支持wav/mp3，mp3需安装ffmpeg）\n    original_audio = \&amp;quot;原版歌曲.wav\&amp;quot;\n    cover_audio = \&amp;quot;翻唱/改编版本.wav\&amp;quot;\n    \n    # 提取ByteCover特征\n    feat_original = bytecover_feature_extract(original_audio)\n    feat_cover = bytecover_feature_extract(cover_audio)\n    \n    # 匹配比对\n    match_result, score = bytecover_match(feat_original, feat_cover)\n    print(f\&amp;quot;匹配结果：{&amp;#39;同一首歌（翻唱/改编）&amp;#39; if match_result else &amp;#39;不同歌曲&amp;#39;}\&amp;quot;)\n    print(f\&amp;quot;相似度分数：{score}\&amp;quot;)\n&amp;quot;},&amp;quot;attribs&amp;quot;:{&amp;quot;0&amp;quot;:&amp;quot;*1*0|1q+1ik&amp;quot;}},&amp;quot;apool&amp;quot;:{&amp;quot;numToAttrib&amp;quot;:{&amp;quot;0&amp;quot;:[&amp;quot;author&amp;quot;,&amp;quot;7596565347868625849&amp;quot;],&amp;quot;1&amp;quot;:[&amp;quot;ai-extra&amp;quot;,&amp;quot;{\&amp;quot;is_ai_gen\&amp;quot;:true,\&amp;quot;rewrite_command\&amp;quot;:1}&amp;quot;]},&amp;quot;nextNum&amp;quot;:2}},&amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&amp;quot;referenceRecordMap&amp;quot;:{},&amp;quot;extra&amp;quot;:{&amp;quot;channel&amp;quot;:&amp;quot;saas&amp;quot;,&amp;quot;isEqualBlockSelection&amp;quot;:true,&amp;quot;pasteRandomId&amp;quot;:&amp;quot;120c6b66-f918-4de1-93e4-01b9715af5b7&amp;quot;,&amp;quot;mention_page_title&amp;quot;:{},&amp;quot;external_mention_url&amp;quot;:{}},&amp;quot;isKeepQuoteContainer&amp;quot;:false,&amp;quot;isFromCode&amp;quot;:true,&amp;quot;selection&amp;quot;:[{&amp;quot;id&amp;quot;:24,&amp;quot;type&amp;quot;:&amp;quot;text&amp;quot;,&amp;quot;selection&amp;quot;:{&amp;quot;start&amp;quot;:0,&amp;quot;end&amp;quot;:1964},&amp;quot;recordId&amp;quot;:&amp;quot;EfEvfoozwdhBAfcGaTScj5N0n3f&amp;quot;}],&amp;quot;payloadMap&amp;quot;:{},&amp;quot;isCut&amp;quot;:false}&quot; data-lark-record-format=&quot;docx/text&quot; class=&quot;lark-record-clipboard&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sun, 22 Mar 2026 23:27:26 +0800</pubDate></item><item><title>lua  ngx.time() 和 os.time() 性能对比</title><link>http://www.jewe.wang/?id=22</link><description>&lt;div class=&quot;paragraph&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px 0px 16px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space: pre-wrap; word-break: break-word; text-shadow: none;  &quot;&gt;在 OpenResty 里，&lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx.time()&lt;/code&gt; 是纯 C 实现、无系统调用、无锁、无 GC 的 &lt;span class=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; font-size: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;毫秒级缓存值&lt;/span&gt;；&lt;br style=&quot;font-family: inherit; scrollbar-color: transparent transparent;&quot;/&gt;&lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;os.time()&lt;/code&gt; 要走 libc → kernel → 返回，还涉及 Lua 栈转换和 GC 装箱。&lt;br style=&quot;font-family: inherit; scrollbar-color: transparent transparent;&quot;/&gt;实测差距 &lt;span class=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; font-size: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;10–30 倍&lt;/span&gt; 甚至更高，且随着 QPS 上涨线性放大。&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin-bottom: 16px; padding: 0px 0px 0px 24px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none;&quot;&gt;实现差异&lt;br style=&quot;font-family: inherit; scrollbar-color: transparent transparent;&quot;/&gt;| 函数 | 来源 | 实现路径 | 精度 | 系统调用 | Lua GC 对象 |
|---|---|---|---|---|---|
| &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx.time()&lt;/code&gt; | ngx_http_lua_module | 直接读 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx_time_t *tp-&amp;gt;sec&lt;/code&gt;（更新频率 1 ms） | 秒 | ❌ | ❌ |
| &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;os.time()&lt;/code&gt; | PUC-Rio Lua | &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;luaB_time&lt;/code&gt; → &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;time(2)&lt;/code&gt; → &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;gettimeofday&lt;/code&gt;/&lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;clock_gettime&lt;/code&gt; | 秒 | ✅ | ✅（返回 number） |&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ol start=&quot;2&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin-bottom: 16px; padding: 0px 0px 0px 24px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none;&quot;&gt;基准数据&lt;br style=&quot;font-family: inherit; scrollbar-color: transparent transparent;&quot;/&gt;在一台 2.6 GHz Xeon 上，单 worker、空循环 1 000 万次：&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code markdown-code&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px 0px 16px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; position: relative; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot;&gt;&lt;header data-v-7caec4f8=&quot;&quot; class=&quot;segment-code-header&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; z-index: 1; position: sticky; left: 0px; top: 0px;&quot;&gt;&lt;div data-v-7caec4f8=&quot;&quot; class=&quot;segment-code-header-content&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 8px 8px 8px 16px; border-top: 0.666667px solid rgba(255, 255, 255, 0.12); border-right: 0.666667px solid rgba(255, 255, 255, 0.12); border-bottom: none; border-left: 0.666667px solid rgba(255, 255, 255, 0.12); border-image: none 100% / 1 / 0 stretch; vertical-align: baseline; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(31, 31, 31); border-top-left-radius: 8px; border-top-right-radius: 8px; box-sizing: border-box; display: flex; align-items: center; justify-content: flex-start; gap: 4px;&quot;&gt;&lt;span data-v-7caec4f8=&quot;&quot; class=&quot;segment-code-lang&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; flex: 1 1 0%;&quot;&gt;lua&lt;/span&gt;&lt;div data-v-182d5fe2=&quot;&quot; data-v-92afdd37=&quot;&quot; data-v-7caec4f8=&quot;&quot; class=&quot;simple-button size-medium&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 4px; border: 0px; vertical-align: baseline; color: rgba(255, 255, 255, 0.56); border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;&quot;&gt;&lt;svg data-v-182d5fe2=&quot;&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; role=&quot;img&quot; width=&quot;16&quot; height=&quot;16&quot; viewbox=&quot;0 0 1024 1024&quot; name=&quot;Copy&quot; class=&quot;iconify simple-button-icon&quot;&gt;&lt;path d=&quot;M725.333333 302.933333a166.4 166.4 0 0 1 166.4 166.4v256a166.4 166.4 0 0 1-166.4 166.4h-256A166.4 166.4 0 0 1 302.933333 725.333333v-256A166.4 166.4 0 0 1 469.333333 302.933333h256z m-256 76.8A89.6 89.6 0 0 0 379.733333 469.333333v256c0 49.493333 40.106667 89.6 89.6 89.6h256a89.6 89.6 0 0 0 89.6-89.6v-256A89.6 89.6 0 0 0 725.333333 379.733333h-256z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M554.666667 132.266667a166.4 166.4 0 0 1 144.128 83.2 38.4 38.4 0 0 1-66.517334 38.4A89.514667 89.514667 0 0 0 554.666667 209.066667H298.666667A89.6 89.6 0 0 0 209.066667 298.666667v256c0 33.109333 17.92 62.08 44.8 77.653333a38.4 38.4 0 0 1-38.4 66.474667A166.4 166.4 0 0 1 132.266667 554.666667V298.666667A166.4 166.4 0 0 1 298.666667 132.266667h256z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;span data-v-182d5fe2=&quot;&quot; class=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px 2px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 20px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/header&gt;&lt;div data-v-efb858b9=&quot;&quot; data-v-7caec4f8=&quot;&quot; class=&quot;syntax-highlighter dark segment-code-content&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-top: none; border-right: 0.666667px solid rgba(255, 255, 255, 0.12); border-bottom: 0.666667px solid rgba(255, 255, 255, 0.12); border-left: 0.666667px solid rgba(255, 255, 255, 0.12); border-image: none 100% / 1 / 0 stretch; vertical-align: baseline; overflow: auto; border-bottom-right-radius: inherit; border-bottom-left-radius: inherit;&quot;&gt;&lt;pre data-v-efb858b9=&quot;&quot; class=&quot;language-lua&quot; style=&quot;font-family: &amp;quot;Fira Code&amp;quot;, &amp;quot;Fira Mono&amp;quot;, Menlo, Consolas, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; scrollbar-color: transparent transparent; padding: 16px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: 1.5; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; color: rgb(230, 230, 230); text-shadow: none; direction: ltr; word-spacing: normal; word-break: normal; tab-size: 2; hyphens: none; overflow: auto; border-radius: 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(41, 41, 41);&quot;&gt;local&amp;nbsp;ngx_now&amp;nbsp;=&amp;nbsp;ngx.timelocal&amp;nbsp;t0&amp;nbsp;=&amp;nbsp;ngx.now()for&amp;nbsp;i&amp;nbsp;=&amp;nbsp;1,1e7&amp;nbsp;do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;_&amp;nbsp;=&amp;nbsp;ngx_now()endprint(&amp;quot;ngx.time()&amp;quot;,&amp;nbsp;ngx.now()-t0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--&amp;nbsp;≈&amp;nbsp;0.08&amp;nbsp;st0&amp;nbsp;=&amp;nbsp;ngx.now()for&amp;nbsp;i&amp;nbsp;=&amp;nbsp;1,1e7&amp;nbsp;do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local&amp;nbsp;_&amp;nbsp;=&amp;nbsp;os.time()endprint(&amp;quot;os.time()&amp;quot;,&amp;nbsp;ngx.now()-t0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--&amp;nbsp;≈&amp;nbsp;1.1&amp;nbsp;s&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div data-v-9e97debc=&quot;&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot;&gt;&lt;/div&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px 0px 16px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space: pre-wrap; word-break: break-word; text-shadow: none;  &quot;&gt;→ &lt;span class=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; font-size: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;13 倍差距&lt;/span&gt;；若把循环换成 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;resty.core&lt;/code&gt; 的 FFI 版本，差距可拉到 &lt;span style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; font-size: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;30 倍&lt;/span&gt;。&lt;/div&gt;&lt;ol start=&quot;3&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin-bottom: 16px; padding: 0px 0px 0px 24px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none;&quot;&gt;业务真实场景&lt;br style=&quot;font-family: inherit; scrollbar-color: transparent transparent;&quot;/&gt;在 20 k RPS 的接口里，每次取 10 次时间戳（日志、缓存 key、超时计算）：&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div data-v-1afa3a17=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;table markdown-table&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px 0px 16px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 100%; width: max-content; position: relative;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot;&gt;&lt;header data-v-1afa3a17=&quot;&quot; class=&quot;table-actions&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 5px 16px; border-width: 0.666667px 0.666667px 0px; border-top-style: solid; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: rgba(255, 255, 255, 0.12); border-bottom-color: initial; border-left-color: rgba(255, 255, 255, 0.12); border-image: none 100% / 1 / 0 stretch; vertical-align: baseline; display: flex; border-top-left-radius: 8px; border-top-right-radius: 8px;  align-items: center; justify-content: center; z-index: 1; position: sticky; left: 0px; top: 0px;&quot;&gt;&lt;span data-v-1afa3a17=&quot;&quot; class=&quot;table-title&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; flex: 1 1 0%; margin: 0px 10px 0px 0px !important;&quot;&gt;表格&lt;/span&gt;&lt;div data-v-182d5fe2=&quot;&quot; data-v-92afdd37=&quot;&quot; data-v-1afa3a17=&quot;&quot; class=&quot;simple-button size-medium&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 4px; border: 0px; vertical-align: baseline; color: rgba(255, 255, 255, 0.56); border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;&quot;&gt;&lt;svg data-v-182d5fe2=&quot;&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; role=&quot;img&quot; width=&quot;16&quot; height=&quot;16&quot; viewbox=&quot;0 0 1024 1024&quot; name=&quot;Copy&quot; class=&quot;iconify simple-button-icon&quot;&gt;&lt;path d=&quot;M725.333333 302.933333a166.4 166.4 0 0 1 166.4 166.4v256a166.4 166.4 0 0 1-166.4 166.4h-256A166.4 166.4 0 0 1 302.933333 725.333333v-256A166.4 166.4 0 0 1 469.333333 302.933333h256z m-256 76.8A89.6 89.6 0 0 0 379.733333 469.333333v256c0 49.493333 40.106667 89.6 89.6 89.6h256a89.6 89.6 0 0 0 89.6-89.6v-256A89.6 89.6 0 0 0 725.333333 379.733333h-256z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M554.666667 132.266667a166.4 166.4 0 0 1 144.128 83.2 38.4 38.4 0 0 1-66.517334 38.4A89.514667 89.514667 0 0 0 554.666667 209.066667H298.666667A89.6 89.6 0 0 0 209.066667 298.666667v256c0 33.109333 17.92 62.08 44.8 77.653333a38.4 38.4 0 0 1-38.4 66.474667A166.4 166.4 0 0 1 132.266667 554.666667V298.666667A166.4 166.4 0 0 1 298.666667 132.266667h256z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;span data-v-182d5fe2=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px 2px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 20px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/header&gt;&lt;div data-v-1afa3a17=&quot;&quot; class=&quot;table-container&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-top: none; border-right: 0.666667px solid rgba(255, 255, 255, 0.12); border-bottom: 0.666667px solid rgba(255, 255, 255, 0.12); border-left: 0.666667px solid rgba(255, 255, 255, 0.12); border-image: none 100% / 1 / 0 stretch; vertical-align: baseline; width: fit-content; max-width: 100%; overflow: auto; box-sizing: border-box; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;&quot;&gt;&lt;table data-v-1afa3a17=&quot;&quot; width=&quot;NaN&quot;&gt;&lt;thead data-v-1afa3a17=&quot;&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; border-image: initial; vertical-align: baseline;&quot;&gt;&lt;tr data-v-1afa3a17=&quot;&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; border-image: initial; vertical-align: baseline;&quot; class=&quot;firstRow&quot;&gt;&lt;th data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px; border-right-style: initial; border-bottom-style: initial; border-left-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: initial; font-style: inherit; font-variant: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; text-align: left; max-width: 480px;&quot;&gt;方案&lt;/th&gt;&lt;th data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px 0.666667px; border-right-style: initial; border-bottom-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: rgba(255, 255, 255, 0.12); font-style: inherit; font-variant: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; text-align: left; max-width: 480px;&quot;&gt;CPU 占比&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody data-v-1afa3a17=&quot;&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; border-image: initial; vertical-align: baseline;&quot;&gt;&lt;tr data-v-1afa3a17=&quot;&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; border-image: initial; vertical-align: baseline;&quot;&gt;&lt;td data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px; border-right-style: initial; border-bottom-style: initial; border-left-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 480px;&quot;&gt;&lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;os.time()&lt;/code&gt;&lt;/td&gt;&lt;td data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px 0.666667px; border-right-style: initial; border-bottom-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: rgba(255, 255, 255, 0.12); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 480px;&quot;&gt;5.8 %&lt;/td&gt;&lt;/tr&gt;&lt;tr data-v-1afa3a17=&quot;&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; border-image: initial; vertical-align: baseline;&quot;&gt;&lt;td data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px; border-right-style: initial; border-bottom-style: initial; border-left-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 480px;&quot;&gt;&lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx.time()&lt;/code&gt;&lt;/td&gt;&lt;td data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px 0.666667px; border-right-style: initial; border-bottom-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: rgba(255, 255, 255, 0.12); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 480px;&quot;&gt;0.18 %&lt;/td&gt;&lt;/tr&gt;&lt;tr data-v-1afa3a17=&quot;&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-width: 0px; border-style: initial; border-image: initial; vertical-align: baseline;&quot;&gt;&lt;td data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px; border-right-style: initial; border-bottom-style: initial; border-left-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 480px;&quot;&gt;→ 直接省出 5.6 % 的单核 CPU，等价于每 18 个核省 1 个核。&lt;/td&gt;&lt;td data-v-1afa3a17=&quot;&quot; align=&quot;left&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding-top: 10px; padding-bottom: 10px; border-width: 0.666667px 0px 0px; border-right-style: initial; border-bottom-style: initial; border-left-style: initial; border-top-color: rgba(255, 255, 255, 0.12); border-right-color: initial; border-bottom-color: initial; border-left-color: initial; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 22px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; max-width: 480px;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol start=&quot;4&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin-bottom: 16px; padding: 0px 0px 0px 24px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none;&quot;&gt;何时仍用 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;os.time()&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul start=&quot;1&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin-bottom: 16px; padding: 0px 0px 0px 24px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none;&quot;&gt;代码需要在 &lt;span class=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; font-size: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;纯 Lua 环境&lt;/span&gt;（非 OpenResty）里也能跑；&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space-collapse: preserve; word-break: break-word; text-shadow: none;&quot;&gt;需要 &lt;span style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; font-size: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;亚秒精度&lt;/span&gt; 且愿意承担 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;gettimeofday&lt;/code&gt; 调用——这时应直接用 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx.now()&lt;/code&gt;（浮点毫秒）或 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx.time()&lt;/code&gt; + &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;ngx.update_time()&lt;/code&gt; 组合。&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px 0px 16px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space: pre-wrap; word-break: break-word; text-shadow: none;  &quot;&gt;一句话&lt;br style=&quot;font-family: inherit; scrollbar-color: transparent transparent;&quot;/&gt;在 OpenResty 内部永远优先&lt;/div&gt;&lt;div data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code markdown-code&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px 0px 16px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; position: relative; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot;&gt;&lt;header data-v-7caec4f8=&quot;&quot; class=&quot;segment-code-header&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; z-index: 1; position: sticky; left: 0px; top: 0px;&quot;&gt;&lt;div data-v-7caec4f8=&quot;&quot; class=&quot;segment-code-header-content&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 8px 8px 8px 16px; border-top: 0.666667px solid rgba(255, 255, 255, 0.12); border-right: 0.666667px solid rgba(255, 255, 255, 0.12); border-bottom: none; border-left: 0.666667px solid rgba(255, 255, 255, 0.12); border-image: none 100% / 1 / 0 stretch; vertical-align: baseline; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(31, 31, 31); border-top-left-radius: 8px; border-top-right-radius: 8px; box-sizing: border-box; display: flex; align-items: center; justify-content: flex-start; gap: 4px;&quot;&gt;&lt;span data-v-7caec4f8=&quot;&quot; class=&quot;segment-code-lang&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: 600; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; flex: 1 1 0%;&quot;&gt;lua&lt;/span&gt;&lt;div data-v-182d5fe2=&quot;&quot; data-v-92afdd37=&quot;&quot; data-v-7caec4f8=&quot;&quot; class=&quot;simple-button size-medium&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 4px; border: 0px; vertical-align: baseline; color: rgba(255, 255, 255, 0.56); border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;&quot;&gt;&lt;svg data-v-182d5fe2=&quot;&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; role=&quot;img&quot; width=&quot;16&quot; height=&quot;16&quot; viewbox=&quot;0 0 1024 1024&quot; name=&quot;Copy&quot; class=&quot;iconify simple-button-icon&quot;&gt;&lt;path d=&quot;M725.333333 302.933333a166.4 166.4 0 0 1 166.4 166.4v256a166.4 166.4 0 0 1-166.4 166.4h-256A166.4 166.4 0 0 1 302.933333 725.333333v-256A166.4 166.4 0 0 1 469.333333 302.933333h256z m-256 76.8A89.6 89.6 0 0 0 379.733333 469.333333v256c0 49.493333 40.106667 89.6 89.6 89.6h256a89.6 89.6 0 0 0 89.6-89.6v-256A89.6 89.6 0 0 0 725.333333 379.733333h-256z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M554.666667 132.266667a166.4 166.4 0 0 1 144.128 83.2 38.4 38.4 0 0 1-66.517334 38.4A89.514667 89.514667 0 0 0 554.666667 209.066667H298.666667A89.6 89.6 0 0 0 209.066667 298.666667v256c0 33.109333 17.92 62.08 44.8 77.653333a38.4 38.4 0 0 1-38.4 66.474667A166.4 166.4 0 0 1 132.266667 554.666667V298.666667A166.4 166.4 0 0 1 298.666667 132.266667h256z&quot; fill=&quot;currentColor&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;span data-v-182d5fe2=&quot;&quot; style=&quot;font-family: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px 2px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: 20px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;&quot;&gt;复制&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/header&gt;&lt;div data-v-efb858b9=&quot;&quot; data-v-7caec4f8=&quot;&quot; class=&quot;syntax-highlighter dark segment-code-content&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border-top: none; border-right: 0.666667px solid rgba(255, 255, 255, 0.12); border-bottom: 0.666667px solid rgba(255, 255, 255, 0.12); border-left: 0.666667px solid rgba(255, 255, 255, 0.12); border-image: none 100% / 1 / 0 stretch; vertical-align: baseline; overflow: auto; border-bottom-right-radius: inherit; border-bottom-left-radius: inherit;&quot;&gt;&lt;pre data-v-efb858b9=&quot;&quot; class=&quot;language-lua&quot; style=&quot;font-family: &amp;quot;Fira Code&amp;quot;, &amp;quot;Fira Mono&amp;quot;, Menlo, Consolas, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace; scrollbar-color: transparent transparent; padding: 16px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: 1.5; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; color: rgb(230, 230, 230); text-shadow: none; direction: ltr; word-spacing: normal; word-break: normal; tab-size: 2; hyphens: none; overflow: auto; border-radius: 0px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(41, 41, 41);&quot;&gt;local&amp;nbsp;now&amp;nbsp;=&amp;nbsp;ngx.time()&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div data-v-9e97debc=&quot;&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline;  letter-spacing: 0.5px; text-wrap-mode: wrap; &quot;&gt;&lt;/div&gt;&lt;div class=&quot;paragraph&quot; style=&quot;font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, Cantarell, &amp;quot;Noto Sans&amp;quot;, sans-serif, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Microsoft YaHei UI&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, sans-serif; scrollbar-color: transparent transparent; margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alternates: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; font-size: 16px; line-height: 26px; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; vertical-align: baseline; letter-spacing: 0px; max-width: 100%; white-space: pre-wrap; word-break: break-word; text-shadow: none;  &quot;&gt;比 &lt;code data-v-7caec4f8=&quot;&quot; data-v-a0d09da1=&quot;&quot; class=&quot;segment-code-inline&quot; style=&quot;font: inherit; scrollbar-color: transparent transparent; margin: 0px 4px; padding: 2px 6px; border: 0px; vertical-align: baseline;  border-radius: 4px; max-width: 100%; word-break: break-word; text-shadow: none; overflow: auto;&quot;&gt;os.time()&lt;/code&gt; 快一个数量级，无系统调用、无 GC 压力，精度同样到秒。&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 17 Dec 2025 15:47:31 +0800</pubDate></item><item><title>Linux socket个数查询</title><link>http://www.jewe.wang/?id=21</link><description>&lt;p&gt;&lt;span style=&quot;color: #A0A1A7; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-style: italic; white-space-collapse: preserve; background-color: #FAFAFA;&quot;&gt;cat /proc/net/sockstat&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #A0A1A7; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-style: italic; white-space-collapse: preserve; background-color: #FAFAFA;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-style: italic; white-space-collapse: preserve; background-color: #FAFAFA;&quot;&gt;ss -s&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #A0A1A7; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-style: italic; white-space-collapse: preserve; background-color: #FAFAFA;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #A0A1A7; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-style: italic; white-space-collapse: preserve; background-color: #FAFAFA;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Total: 1669 (kernel 0)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;TCP:&amp;nbsp; &amp;nbsp;1437 (estab 101, closed 1318, orphaned 0, synrecv 0, timewait 10/0), ports 0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;Transport Total&amp;nbsp; &amp;nbsp; &amp;nbsp;IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IPv6&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;*&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;RAW&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;UDP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;TCP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;119&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;119&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;INET&amp;nbsp; &amp;nbsp; &amp;nbsp; 132&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;130&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;FRAG&amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #A0A1A7; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; font-style: italic; white-space-collapse: preserve; background-color: #FAFAFA;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sun, 18 Feb 2024 10:57:53 +0800</pubDate></item><item><title>Golang 的 “omitempty” 关键字略解</title><link>http://www.jewe.wang/?id=20</link><description>&lt;div&gt;&lt;div&gt;&lt;h2&gt;json和struct转换简单介绍&lt;/h2&gt;&lt;p&gt;熟悉 Golang 的朋友对于 json 和 struct 之间的转换一定不陌生，为了将代码中的结构体与 json 数据解耦，通常我们会在结构体的 field 类型后加上解释说明,注意:&lt;strong&gt;结构体的属性首字母必须大写，否则json解析会不生效&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;type&amp;nbsp;Person&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name&amp;nbsp;string&amp;nbsp;`json:&amp;quot;json_key_name&amp;quot;`
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;&amp;nbsp;int&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;`json:&amp;quot;json_key_age&amp;quot;`}func&amp;nbsp;main()&amp;nbsp;{

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Per&amp;nbsp;:=&amp;nbsp;Person{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name:&amp;nbsp;&amp;quot;小饭&amp;quot;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age:&amp;nbsp;&amp;nbsp;18,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(Per)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return}&amp;nbsp;&amp;nbsp;//输出结果{&amp;quot;json_key_name&amp;quot;:&amp;quot;小饭&amp;quot;,&amp;quot;json_key_age&amp;quot;:18}&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;结构体只初始化部分变量&lt;/h2&gt;&lt;p&gt;接下来我们看另外一种情况&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p&amp;nbsp;:=&amp;nbsp;Person{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name:&amp;nbsp;&amp;quot;小饭&amp;quot;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(p)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;如果我们在结构体初始化的时候只初始化了其中一个字段Name，那么理论上来说返回的json应该是&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-json&quot;&gt;{&amp;quot;Name&amp;quot;:&amp;quot;小饭&amp;quot;}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;但是我们实际运行一下返回的结果却是&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-json&quot;&gt;{&amp;quot;Name&amp;quot;:&amp;quot;小饭&amp;quot;,&amp;quot;Age&amp;quot;:0}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;这明显是不符合我们的预期的，因为Age字段是我们不需要的。&lt;/p&gt;&lt;h2&gt;如何解决&lt;/h2&gt;&lt;p&gt;接下来就轮到咱们今天的主角登场了，解决方式很简单，在后面加上&lt;strong&gt;omitempty&lt;/strong&gt;即可&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;type&amp;nbsp;Person&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name&amp;nbsp;string
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;&amp;nbsp;int&amp;nbsp;`json:&amp;quot;,omitempty&amp;quot;`}func&amp;nbsp;main()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p&amp;nbsp;:=&amp;nbsp;Person{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name:&amp;nbsp;&amp;quot;小饭&amp;quot;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(p)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))}//输出结果{&amp;quot;Name&amp;quot;:&amp;quot;小饭&amp;quot;}&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;结构体的特殊情况&lt;/h2&gt;&lt;p&gt;我们再来看下面的这个例子&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;type&amp;nbsp;Person&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name&amp;nbsp;string
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;&amp;nbsp;int}type&amp;nbsp;Student&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Person&amp;nbsp;Person&amp;nbsp;`json:&amp;quot;,omitempty&amp;quot;`&amp;nbsp;&amp;nbsp;//对结构体person使用了omitempty}func&amp;nbsp;main()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Stu&amp;nbsp;:=&amp;nbsp;Student{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Num:&amp;nbsp;5,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(Stu)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;我们对结构体&lt;strong&gt;Person定义了omitempty&lt;/strong&gt;,按理说我们在初始化的时候并&lt;strong&gt;没有初始化结构体的任何属性&lt;/strong&gt;，所以转换成json之后的打印结果应该是只有{&amp;quot;Num&amp;quot;:5}的，但是我们实际运行之后发现打印的结果却是&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-json&quot;&gt;{&amp;quot;Num&amp;quot;:5,&amp;quot;Person&amp;quot;:{&amp;quot;Name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;Age&amp;quot;:0}}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;为什么&lt;strong&gt;omitempty对于结构体类型不生效&lt;/strong&gt;了呢？&lt;strong&gt;这是因为结构体（上面例子的Person）不知道空值是什么，GO只知道简单结构体例如int,string,pointer 这种类型的空值&lt;/strong&gt;，为了不显示我们没有提供值的自定义结构体，我们可以使用&lt;strong&gt;结构体指针&lt;/strong&gt;。&lt;/p&gt;&lt;p&gt;为什么用指针类型就可以解决这个问题？因为&lt;strong&gt;指针是基本类型，Golang知道他的空值是啥&lt;/strong&gt;，所以就直接赋值为nil(指针类型的空值)。&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;type&amp;nbsp;Person&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Name&amp;nbsp;string
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;&amp;nbsp;int}type&amp;nbsp;Student&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Num&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Person&amp;nbsp;*Person&amp;nbsp;`json:&amp;quot;,omitempty&amp;quot;`&amp;nbsp;&amp;nbsp;//如果想要omitempty生效，必须是指针类型}func&amp;nbsp;main()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Stu&amp;nbsp;:=&amp;nbsp;Student{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Num:&amp;nbsp;5,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(Stu)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))}&amp;nbsp;&amp;nbsp;//输出结果{&amp;quot;Num&amp;quot;:5}&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;omitempty的一个大坑&lt;/h2&gt;&lt;p&gt;我们接下来还是看例子&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;type&amp;nbsp;Person&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;int&amp;nbsp;`json:&amp;quot;,omitempty&amp;quot;`}func&amp;nbsp;main()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Per&amp;nbsp;:=&amp;nbsp;Person{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age:&amp;nbsp;0,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(Per)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;按照咱们的预期，应该给输出&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-json&quot;&gt;{&amp;quot;Age&amp;quot;:0}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;对不对，但是咱们实际运行以后输出的却是&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-css&quot;&gt;{}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;这明显有问题啊，咱们需要的是输出的json字段，是必须有age，而且值是0，现在什么都没输出明显是有问题的。&lt;strong&gt;因为Golang把0当成了零值，所以跟没有赋值是一样的&lt;/strong&gt;&lt;br/&gt;如果想解决这种问题一种方法是&lt;strong&gt;使用int指针&lt;/strong&gt;，因为int指针的空值为nil,当我想输出0的时候，我传进去地址，地址肯定不是空值nil，这样肯定会显示出来0&lt;/p&gt;&lt;div class=&quot;_2Uzcx_&quot;&gt;&lt;button class=&quot;VJbwyy&quot; type=&quot;button&quot; aria-label=&quot;复制代码&quot;&gt;&lt;em aria-label=&quot;icon: copy&quot; class=&quot;anticon anticon-copy&quot;&gt;&lt;svg viewbox=&quot;64 64 896 896&quot; focusable=&quot;false&quot; class=&quot;&quot; data-icon=&quot;copy&quot; width=&quot;1em&quot; height=&quot;1em&quot; fill=&quot;currentColor&quot; aria-hidden=&quot;true&quot;&gt;&lt;path d=&quot;M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/em&gt;&lt;/button&gt;&lt;pre class=&quot;line-numbers  language-go&quot;&gt;type&amp;nbsp;Person&amp;nbsp;struct&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age&amp;nbsp;*int&amp;nbsp;`json:&amp;quot;,omitempty&amp;quot;`}func&amp;nbsp;main()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;age&amp;nbsp;:=&amp;nbsp;0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Per&amp;nbsp;:=&amp;nbsp;Person{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Age:&amp;nbsp;&amp;amp;age,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;res,&amp;nbsp;_&amp;nbsp;:=&amp;nbsp;json.Marshal(Per)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fmt.Println(string(res))}&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;总结&lt;/h2&gt;&lt;ul class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;omitempty只是在把结构体转换成json的过程中，&lt;strong&gt;只会影响json转换后的结果，并不是影响结构体本身&lt;/strong&gt;，所以结构体的任何属性设置了omitempty之后，都不影响其正常使用&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;omitempty的作用简单来说就是在&lt;strong&gt;结构体转换json的过程中&lt;/strong&gt;，&lt;strong&gt;把没有赋值的结构体属性不在json中输出而已&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;omitempty只支持&lt;strong&gt;简单的数据类型&lt;/strong&gt;，对&lt;strong&gt;结构体的数据类型是不生效&lt;/strong&gt;的，如果需要生效，只能用&lt;strong&gt;结构体指针&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;omitempty分不清楚&lt;strong&gt;0值，&amp;quot;&amp;quot;值和未赋值&lt;/strong&gt;，&lt;strong&gt;如果给某个属性赋值0或者&amp;quot;&amp;quot;，并且想输出，只能用指针类型&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;作者：程序员小饭&lt;br/&gt;链接：https://www.jianshu.com/p/b826e7f297ea&lt;br/&gt;来源：简书&lt;br/&gt;著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。&lt;/div&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 06 Feb 2024 16:31:42 +0800</pubDate></item><item><title>Golang 多平台交叉编译，不用设置只需要用命令行</title><link>http://www.jewe.wang/?id=19</link><description>&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Mac 下编译 Linux 可执行程序&lt;/p&gt;&lt;pre data-index=&quot;0&quot; class=&quot;set-code-show prettyprint&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; position: relative; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; overflow: auto hidden; border: none; line-height: 22px; max-height: unset; overflow-wrap: break-word; background-color: rgb(40, 44, 52); font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: #FFFFFF;&quot;&gt;CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go1&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Mac 下编译 Windows 64位可执行程序&lt;/p&gt;&lt;pre data-index=&quot;1&quot; class=&quot;set-code-show prettyprint&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; position: relative; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; overflow: auto hidden; border: none; line-height: 22px; max-height: unset; overflow-wrap: break-word; background-color: rgb(40, 44, 52); font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: #FFFFFF;&quot;&gt;CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go1&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Linux 下编译 Mac 可执行程序&lt;/p&gt;&lt;pre data-index=&quot;2&quot; class=&quot;set-code-show prettyprint&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; position: relative; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; overflow: auto hidden; border: none; line-height: 22px; max-height: unset; overflow-wrap: break-word; background-color: rgb(40, 44, 52); font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: #FFFFFF;&quot;&gt;CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go1&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Linux 下编译 Windows 64位可执行程序&lt;/p&gt;&lt;pre data-index=&quot;3&quot; class=&quot;set-code-show prettyprint&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; position: relative; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; overflow: auto hidden; border: none; line-height: 22px; max-height: unset; overflow-wrap: break-word; background-color: rgb(40, 44, 52); font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: #FFFFFF;&quot;&gt;CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go1&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Windows 下编译 Mac 64位可执行程序&lt;/p&gt;&lt;pre data-index=&quot;4&quot; class=&quot;set-code-show prettyprint&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; position: relative; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; overflow: auto hidden; border: none; line-height: 22px; max-height: unset; overflow-wrap: break-word; background-color: rgb(40, 44, 52); font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: #FFFFFF;&quot;&gt;SET CGO_ENABLED=0SET GOOS=darwin&lt;br/&gt;SET GOARCH=amd64&lt;br/&gt;go build main.go1234&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;Windows 下编译 Linux 64位可执行程序&lt;/p&gt;&lt;pre data-index=&quot;5&quot; class=&quot;set-code-show prettyprint&quot; style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; position: relative; font-family: &amp;quot;Source Code Pro&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Anonymous Pro&amp;quot;, &amp;quot;Droid Sans Mono&amp;quot;, Menlo, Monaco, Consolas, Inconsolata, Courier, monospace, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, sans-serif; overflow: auto hidden; border: none; line-height: 22px; max-height: unset; overflow-wrap: break-word; background-color: rgb(40, 44, 52); font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: #FFFFFF;&quot;&gt;SET CGO_ENABLED=0SET GOOS=linux&lt;br/&gt;SET GOARCH=amd64&lt;br/&gt;go build main.go1234&lt;/span&gt;&lt;br/&gt;&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; outline: 0px; font-weight: 700; overflow-wrap: break-word;&quot;&gt;GOOS：目标平台的操作系统&lt;/span&gt;（darwin、freebsd、linux、windows）&lt;br style=&quot;box-sizing: border-box; outline: 0px; overflow-wrap: break-word;&quot;/&gt;&lt;span style=&quot;box-sizing: border-box; outline: 0px; font-weight: 700; overflow-wrap: break-word;&quot;&gt;GOARCH：目标平台的体系架构&lt;/span&gt;（386、amd64、arm）&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; outline: 0px; margin-top: 0px; margin-bottom: 16px; padding: 0px; font-size: 16px; color: rgb(77, 77, 77); line-height: 26px; overflow: auto hidden; overflow-wrap: break-word; font-family: -apple-system, &amp;quot;SF UI Text&amp;quot;, Arial, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-variant-ligatures: no-common-ligatures; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;a href=&quot;https://so.csdn.net/so/search?q=%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91&amp;spm=1001.2101.3001.7020&quot; target=&quot;_blank&quot; class=&quot;hl hl-1&quot; data-report-click=&quot;{&amp;quot;spm&amp;quot;:&amp;quot;1001.2101.3001.7020&amp;quot;,&amp;quot;dest&amp;quot;:&amp;quot;https://so.csdn.net/so/search?q=%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91&amp;amp;spm=1001.2101.3001.7020&amp;quot;,&amp;quot;extra&amp;quot;:&amp;quot;{\&amp;quot;searchword\&amp;quot;:\&amp;quot;交叉编译\&amp;quot;}&amp;quot;}&quot; data-tit=&quot;交叉编译&quot; data-pretit=&quot;交叉编译&quot; style=&quot;box-sizing: border-box; outline: none; margin: 0px 3px 0px 0px; padding: 0px 14px 0px 3px; text-decoration-line: none; cursor: pointer; background: url(&amp;quot;../img/iconHighlight.svg&amp;quot;) right top / 12px 14px no-repeat transparent; color: rgb(252, 85, 49); overflow-wrap: break-word; border-radius: 3px; box-shadow: none;&quot;&gt;交叉编译&lt;/a&gt;不支持 CGO 所以要禁用它&lt;br style=&quot;box-sizing: border-box; outline: 0px; overflow-wrap: break-word;&quot;/&gt;上面的命令编译 64 位可执行程序，你当然应该也会使用 386 编译 32 位可执行程序&lt;br style=&quot;box-sizing: border-box; outline: 0px; overflow-wrap: break-word;&quot;/&gt;很多博客都提到要先增加对其它平台的支持，但是我跳过那一步，上面所列的命令也都能成功，且得到我想要的结果，可见那一步应该是非必须的，或是我所使用的 Go 版本已默认支持所有平台。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 05 Feb 2024 19:45:50 +0800</pubDate></item><item><title>实用在线工具</title><link>http://www.jewe.wang/?id=18</link><description>&lt;p&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://alurk.com/&quot; add_date=&quot;1473672225&quot;&gt;px 转 rem 在线工具&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://www.speedtest.cn/&quot;&gt;测速网 - 在线网速测试,网络测速 - SpeedTest.cn&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://www.bejson.com/&quot;&gt;在线JSON校验格式化工具（Be JSON）&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://pdftoword.55.la/&quot;&gt;PDF转换成WORD在线免费转换器 - 我拉网&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://tool.lu/js/&quot;&gt;Javascript在线解压缩&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://getcomposer.org/download/&quot;&gt;Composer&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://js.clicki.cn/&quot; add_date=&quot;1401022321&quot;&gt;Javascript在线美化、优化、加密、解密、压缩、解压 | js代码美化 | js代码美化 | js代码优化 | js代码压缩 | js代码解压 | js代码加密 | js代码解密 - Clicki&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.processon.com/&quot;&gt;ProcessOn - 免费在线作图，实时协作&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://tool.oschina.net/regex/&quot;&gt;在线正则表达式测试&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://www.phpjm.cc/&quot; add_date=&quot;1529636076&quot;&gt;phpjm|PHP解密在线|魔方破解解密|混淆还原|ZEND修复|ionCube9解密|phpjm.cc&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://guanjia.qq.com/online_server/complain_url.html&quot;&gt;网站拦截申诉_广告屏蔽解除-腾讯电脑管家官网&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://ossrs.net/players/srs_player.html#&quot;&gt;SRS&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://blog.sina.com.cn/s/blog_69daffb70102wnn2.html&quot;&gt;经典数据运营方法系列四&amp;nbsp;|&amp;nbsp;教你统计日留存、周留存、月留存率更准确_友盟_新浪博客&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://www.dooccn.com/java1.7/&quot; add_date=&quot;1557828937&quot;&gt;java1.7在线编程,java1.7在线编译器,在线写代码网站&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://life.chacuo.net/convertsimilar&quot; add_date=&quot;1570587266&quot;&gt;在线文档相似度计算、在线计算文章相似度、计算网页相似度！--查错网&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://wpk.ucweb.com/product/web&quot;&gt;iTrace-产品概述-WEB高可用&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://convertcsv.com/csv-to-sql.htm&quot;&gt;convertcsv.com/csv-to-sql.htm&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://sg.bt58.vip/#/&quot;&gt;贝塔 PHP SG11在线加密&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://kcr.opd.kugou.net/w/open/standard/eflow/mysql%E6%93%8D%E4%BD%9C%E8%A7%84%E8%8C%83/&quot;&gt;⚡ Mysql操作规范&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.gaituya.com/ps/&quot;&gt;在线PS软件-在线PS精简版图片处理工具photopea-改图鸭&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.photopea.com/&quot;&gt;Photopea | Online Photo Editor&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://c.runoob.com/compile/66/&quot;&gt;Lua 在线工具 | 菜鸟工具&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://1024tools.com/hmac&quot;&gt;HMAC计算、HMAC-MD5、HMAC-SHA1、HMAC-SHA256、HMAC-SHA512在线计算 - 1024Tools&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.sojson.com/&quot;&gt;JSON在线 | JSON解析格式化—SO JSON在线工具&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.boce.com/http/ffradar.kugou.com&quot;&gt;在线网速测试-网站测速工具-测网速-网站访问速度测试-拨测|免费的域名检测工具网-站长工具-ffradar.k**ou.com&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.antdv.com/components/radio-cn&quot;&gt;单选框 Radio - Ant Design Vue&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://gpt.91chat-ai.cn/chat/64e59e277cfe90ac94928f34&quot;&gt;ChatGPT&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.xuhuhu.com/converter/csv-to-sql-converter.html&quot;&gt;csv 转 sql ，csv 到 mysql 转换器，csv 到 sql 在线转换器，免费的 csv 到 sql 转换器&lt;/a&gt;&lt;br/&gt;&lt;br/&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;https://www.lddgo.net/encrypt/rsa&quot;&gt;在线RSA加密解密&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 02 Feb 2024 09:45:57 +0800</pubDate></item><item><title>Python中flask框架跨域问题的解决方法</title><link>http://www.jewe.wang/?id=17</link><description>&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;下面我将详细讲解如何解决Python中flask框架跨域问题。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-weight: 500; line-height: 1.4; margin: 32px 0px 16px; font-size: 20px; overflow: hidden; border-bottom: 1px solid var(--theme-line-color); padding-bottom: 12px; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;什么是跨域问题&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;在web开发中，跨域是指从一个域名的网页去请求另一个域名的资源，例如通过ajax请求api的时候，如果请求url与源不同，那么就出现了跨域。由于同源策略的限制，跨域请求是被禁止的。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-weight: 500; line-height: 1.4; margin: 32px 0px 16px; font-size: 20px; overflow: hidden; border-bottom: 1px solid var(--theme-line-color); padding-bottom: 12px; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;解决方案&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;要解决跨域问题，我们可以使用flask的CORS扩展，在后端代码中进行配置。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;CORS（Cross-Origin Resource Sharing）是一种跨域资源共享的机制。通过在后端设置Access-Control-Allow-Origin响应头，服务端就可以允许前端跨域请求了。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;在flask中，我们可以通过安装flask_cors库来简单地实现跨域请求。安装flask_cors可以通过pip来进行安装：&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; background-color: rgb(43, 48, 59); border: 0px; border-radius: 3px; color: rgb(238, 238, 238); line-height: 1.45; overflow-x: scroll; padding: 20px;&quot;&gt;pip&amp;nbsp;install&amp;nbsp;flask_cors&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;只需要在要请求的视图函数或蓝图上加上@cross_origin装饰器即可。&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; background-color: rgb(43, 48, 59); border: 0px; border-radius: 3px; color: rgb(238, 238, 238); line-height: 1.45; overflow-x: scroll; padding: 20px;&quot;&gt;from&amp;nbsp;flask&amp;nbsp;import&amp;nbsp;Flask,&amp;nbsp;jsonify
from&amp;nbsp;flask_cors&amp;nbsp;import&amp;nbsp;cross_origin

app&amp;nbsp;=&amp;nbsp;Flask(__name__)

@app.route(&amp;#39;/api&amp;#39;)
@cross_origin()
def&amp;nbsp;api():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;data&amp;nbsp;=&amp;nbsp;{&amp;#39;name&amp;#39;:&amp;#39;Alice&amp;#39;,&amp;nbsp;&amp;#39;age&amp;#39;:&amp;nbsp;&amp;#39;23&amp;#39;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;jsonify(data)

if&amp;nbsp;__name__&amp;nbsp;==&amp;#39;__main__&amp;#39;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;app.run()&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;我们来分析一下上述代码。首先，我们在跨域请求的视图函数上面加上了@cross_origin()装饰器，表示该视图函数允许跨域请求。在请求该接口时，前端就可以通过ajax请求方式去访问/api端点，获取返回的json数据。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-weight: 500; line-height: 1.4; margin: 32px 0px 16px; font-size: 20px; overflow: hidden; border-bottom: 1px solid var(--theme-line-color); padding-bottom: 12px; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;示例&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;下面提供两个详细的示例说明。&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-weight: 500; line-height: 1.46; margin: 32px 0px 16px; font-size: 18px; border: 0px; padding-left: 18px; position: relative; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;示例一：访问外部API&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;假设有这样一个需求：从前端的电影列表页面中请求豆瓣电影API，获取电影列表。我们通过flask框架来实现这个功能，具体步骤如下：&lt;/p&gt;&lt;ol style=&quot;box-sizing: border-box; margin-bottom: 20px; list-style-position: outside; padding-left: 2em; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;安装flask_cors库&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; font-size: 0.9em; background: var(--theme-line-color); border-radius: 2px; margin: 0px 1px; padding: 2px 4px;&quot;&gt;python&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;pip install flask_cors&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;创建一个flask应用。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;```python&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;from flask import Flask, jsonify&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;from flask_cors import cross_origin&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;app = Flask(&lt;span style=&quot;box-sizing: border-box; font-weight: bolder;&quot;&gt;name&lt;/span&gt;)&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;```&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在视图函数中请求外部API。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;```python&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;@app.route(&amp;#39;/movies&amp;#39;)&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;@cross_origin()&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;def get_movies():&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;import requests&lt;/p&gt;&lt;pre style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; font-size: 14px; background-color: rgb(43, 48, 59); border: 0px; border-radius: 3px; color: rgb(238, 238, 238); line-height: 1.45; overflow-x: scroll; padding: 20px;&quot;&gt;url&amp;nbsp;=&amp;nbsp;&amp;#39;https://api.douban.com/v2/movie/top250&amp;#39;
headers&amp;nbsp;=&amp;nbsp;{&amp;#39;user-agent&amp;#39;:&amp;nbsp;&amp;#39;Mozilla/5.0&amp;nbsp;(Windows&amp;nbsp;NT&amp;nbsp;10.0;&amp;nbsp;Win64;&amp;nbsp;x64)&amp;nbsp;AppleWebKit/537.36&amp;nbsp;(KHTML,&amp;nbsp;like&amp;nbsp;Gecko)&amp;nbsp;Chrome/58.0.3029.110&amp;nbsp;Safari/537.3&amp;#39;}
res&amp;nbsp;=&amp;nbsp;requests.get(url,&amp;nbsp;headers=headers)

return&amp;nbsp;jsonify(res.json())&lt;/pre&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;```&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在get_movies视图函数中，我们使用requests库去请求豆瓣电影API，然后以json格式返回请求的数据。由于涉及到跨域请求，我们需要在该视图函数上加上@cross_origin装饰器。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;启动flask应用&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; font-size: 0.9em; background: var(--theme-line-color); border-radius: 2px; margin: 0px 1px; padding: 2px 4px;&quot;&gt;python&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;if __name__ ==&amp;#39;__main__&amp;#39;:&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;app.run()&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;现在我们可以在前端页面通过ajax请求该接口，获取豆瓣电影的数据了。&lt;/p&gt;&lt;h3 style=&quot;box-sizing: border-box; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-weight: 500; line-height: 1.46; margin: 32px 0px 16px; font-size: 18px; border: 0px; padding-left: 18px; position: relative; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;示例二：在flask中使用vuejs&lt;/h3&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;假如vuejs的应用和flask的应用都在同一服务器上，我们可以通过flask来为vuejs提供后端支持。下面是具体实现步骤：&lt;/p&gt;&lt;ol style=&quot;box-sizing: border-box; margin-bottom: 20px; list-style-position: outside; padding-left: 2em; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在vuejs项目的src目录下，新建一个config文件夹，然后在config文件夹中新建一个proxy.js文件。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在proxy.js中，我们需要根据flask应用的url，设置代理服务器地址。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; font-size: 0.9em; background: var(--theme-line-color); border-radius: 2px; margin: 0px 1px; padding: 2px 4px;&quot;&gt;javascript&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;module.exports = {&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;devServer: {&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;proxy: {&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;&amp;#39;/api&amp;#39;: {&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;target: &amp;#39;http://localhost:5000&amp;#39;&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;}&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;}&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;}&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;}&lt;/code&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;上述代码中，target表示我们flask应用的地址和端口号。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在vuejs的main.js文件中，添加axios的相关配置。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;```javascript&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;import axios from &amp;#39;axios&amp;#39;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;axios.defaults.headers.post[&amp;#39;Content-Type&amp;#39;] = &amp;#39;application/x-www-form-urlencoded&amp;#39;;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;Vue.prototype.$http = axios&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;```&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在vuejs的组件中，请求flask应用的api接口。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: SFMono-Regular, &amp;quot;Liberation Mono&amp;quot;, Consolas, Menlo, monospace, &amp;quot;Microsoft Yahei&amp;quot;; font-size: 0.9em; background: var(--theme-line-color); border-radius: 2px; margin: 0px 1px; padding: 2px 4px;&quot;&gt;javascript&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;this.$http.get(&amp;#39;/api&amp;#39;).then(response =&amp;gt; {&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;console.log(response)&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;})&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;在flask应用中，添加路由。&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;```python&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;from flask import Flask, jsonify&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;from flask_cors import cross_origin&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;app = Flask(&lt;span style=&quot;box-sizing: border-box; font-weight: bolder;&quot;&gt;name&lt;/span&gt;)&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;@app.route(&amp;#39;/api&amp;#39;)&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;@cross_origin()&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;def api():&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;data = {&amp;#39;name&amp;#39;: &amp;#39;Alice&amp;#39;, &amp;#39;age&amp;#39;: &amp;#39;23&amp;#39;}&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;return jsonify(data)&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;if&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: bolder;&quot;&gt;name&lt;/span&gt;&amp;nbsp;==&amp;#39;&lt;span style=&quot;box-sizing: border-box; font-weight: bolder;&quot;&gt;main&lt;/span&gt;&amp;#39;:&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;app.run()&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;```&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word;&quot;&gt;上述代码中，我们为flask应用添加了/api路由，当vuejs组件通过axios请求/api接口时，就会返回一个含有name和age的json数据。&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;现在，我们查看vuejs组件的控制台，就能看到从flask应用中返回的json数据了。&lt;/p&gt;&lt;h2 style=&quot;box-sizing: border-box; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-weight: 500; line-height: 1.4; margin: 32px 0px 16px; font-size: 20px; overflow: hidden; border-bottom: 1px solid var(--theme-line-color); padding-bottom: 12px; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;总结&lt;/h2&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; line-height: 1.8; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(26, 26, 26); font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Helvetica Neue&amp;quot;, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, &amp;quot;Source Han Sans SC&amp;quot;, &amp;quot;Noto Sans CJK SC&amp;quot;, &amp;quot;WenQuanYi Micro Hei&amp;quot;, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);&quot;&gt;通过使用flask_cors库，我们可以简单地解决Python中flask框架跨域问题。在视图函数上加上@cross_origin装饰器即可允许跨域请求。同时，我们提供了两个示例，分别说明了如何在flask中请求外部API和如何在flask中使用vuejs。&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 02 Feb 2024 09:37:01 +0800</pubDate></item><item><title>下一代听歌识曲技术——从信号处理到深度学习</title><link>http://www.jewe.wang/?id=16</link><description>&lt;div class=&quot;mod-content__markdown&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; color: rgb(24, 24, 24); font-family: &amp;quot;Pingfang SC&amp;quot;, &amp;quot;helvetica neuepingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;div style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px;&quot;&gt;&lt;div class=&quot;rno-markdown new-version rno-&quot; style=&quot;overflow-wrap: break-word; margin: 0px; padding: 0px; box-sizing: border-box; line-height: 24px; color: rgb(51, 51, 51); text-size-adjust: none; -webkit-font-smoothing: antialiased; white-space-collapse: preserve; font-family: &amp;quot;pingfang SC&amp;quot;, &amp;quot;helvetica neue&amp;quot;, arial, &amp;quot;hiragino sans gb&amp;quot;, &amp;quot;microsoft yahei ui&amp;quot;, &amp;quot;microsoft yahei&amp;quot;, simsun, sans-serif;&quot;&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/541b73a4a99a3bb74dfdf86f3ad2f29a.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;下午好，我是来自腾讯音乐的孔令城 ，很荣幸能够借助LiveVideoStack平台、代表天琴实验室，与在座的各位专家、大佬分享我们天琴实验室在多媒体、AI 领域所做的工作。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/cbfef4917d52d6ab6111898a9472ab6e.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;我会通过以下四个方面来介绍我们天琴实验室在听歌识曲方面所做的工作。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;-01-&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;经典听歌识曲系统&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/45d1b74f002317c7683c47a6a024d972.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;当特别想听某一首歌的时候我们会采取什么措施？熟悉的歌曲可以直接在音乐APP上搜索歌名。如果忘记歌名，搜索歌词也是可以的。如果在外面偶然听到一首歌，完全不知道歌名以及歌词，手速快的可以瞬间拿出手机使用听歌识曲，如果慢一点记住了旋律也可以用哼唱识别。歌名搜索、歌词搜索是基于文本搜索，而哼唱识别和听歌识曲是基于音频内容检索。基于音频内容检索，需要对音频内容进行分析。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/ca7e1c40a2c03155eeee0b2f1d3abc43.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;怎么衡量一款听歌识曲效果的好坏?什么样的听歌识曲才是好的系统?QQ音乐的听歌识曲到底效果怎样呢?来看看用户的反馈。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/e521b50a5abada1d625a9a4b2d8d9db3.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;用户的期望可以总结为&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;曲库全、识别准、速度快、灵敏度高以及旋律识别的模糊性&lt;/strong&gt;。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/3c06badf8b79bee02c5c96a3bc690f4c.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;经典听歌识曲系统，主要技术是音频指纹技术。图片横轴可以看作精准性，纵轴看作时间颗粒度。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;音频指纹技术就是要在很短的时间内确定一首歌在音频层面是否一致&lt;/strong&gt;。音频指纹非常适合听歌识曲。可以在一个很小的片段内精确地匹配到对应的歌曲。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/bf043f4f09c4521a1e7c5a102e77183f.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;最基本的音频指纹提取流程如图所示。一段音频先进行预处理，然后进行分帧信号转变，随后提取特征，例如最经典的&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;peak特征&lt;/strong&gt;。随后将其Hash化再通过Hash表查询。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/d3ea2d7c8161f4524472bac3011609f0.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;以上图为例：(a)是Document的频谱图与peak点，(b)是Query的频谱图与peak点，(c)中仅保留(a)中的peak点，(d)中仅保留(b)中的peak点，(e)是使用(d)中Query的peak点逐帧滑动匹配(c)中Document的peak点，滑动到10s的位置刚好重叠的点数最多并且超过某个阈值，那么我们认为Query的音频片段来自于Document的第10s。峰值点特征的优点很明显，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;对于普通的平稳噪声、突发的短时噪声、以及失真等都有较强的鲁棒性，同时极具辨识性，另外特征稀疏数据量少，便于后续检索。&lt;/strong&gt;然而，对于庞大的曲库，采用目前(e)图表示的匹配策略是行不通的，因为Query要暴力与每一首歌曲进行滑动匹配。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/e6bbcb23d0c94f5712d226d38cdd2409.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;可不可以基于peak点直接建立hash表呢？实际上，每个peak点是有时间和频率两个维度构成的；但是因为同样的音频片段，在Query和Document上时间的绝对值是不一致的；如上页例子，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;Query的时间为0s的peak，在document中是10s，因此时间维度不能直接使用。&lt;/strong&gt;而单独使用频率信息也不足以表达点的特征。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/bf5f7181d95ce15b6e30d45b11639077.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;前人想到了一个非常巧妙的方法——&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;不存时间的绝对值，只存时间的相对值。&lt;/strong&gt;这样就可以得到Hash值。该值可以作为Key储存。有了Hash表检索效率就会加大加快。检索库并行扩展也得以实现。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/d934f67dfffb68f402e81788c9d8f924.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;当歌曲入库时就对歌曲进行热度分级，非常热门的歌曲会立刻加入到服务当中。相对冷门的歌曲依然会加入服务当中，但优先级不会那么高。背靠TME海量曲库，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;QQ音乐可以做到最快一秒识别，新歌入库识别零延迟。&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/90af419a6751a6e20ae84f03a9cb356c.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;以 3 6 9 12 15秒，不同时长为片段进行测试。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;音频维度，其精确率均为100%。&lt;/strong&gt;音频维度是指Query和命中的歌曲，音频是一模一样的。但是现实中存在盗歌的现象，虽然音频维度一样，但是版本维度不同。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/81f65c3a9e3e0d3409e85df221f84b59.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;即便是更短的片段时长，QQ音乐识别的精准率仍然保持在100%，尽管在更短的情况召回率降低，但在一定程度上也能提升用户体验。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/abc2de10d312a93b1b414a8a52e820cc.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;使用经典听歌识曲系统，无结果中的样本中，翻唱歌曲占60%甚至更多。可以看到对一些检索库中不存在的翻奏例子或者翻唱的例子，经典听歌识曲系统无法识别。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/64bdd2db450267355432f05db3229a66.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;从19年开始翻唱、改编歌曲呈爆发性增长。其中的原因我们也不言而喻。因此我们迫切需要进行技术更新。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;-02-&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;下一代听歌识曲系统&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;想要解决上述的问题，就需要下一代听歌识曲系统。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/0f297689d62226aaa445732a9763085d.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;什么是翻唱？以画作为例，同样是蒙娜丽莎，不同艺术家可以创作出不同的版本。版本不同，但看起来都会令人想到是蒙娜丽莎。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/538b5ce58a8a626e2fc973577365d7ff.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;图片可以直观感受，歌曲维度也有相应的定义。只要主旋律不改变，其他音乐要素（比如音色、速度，节奏等）任一改变就可以视为翻唱。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/32b5388fde136e76bf923f19edfc95fe.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;对于翻唱识别，业内同行已经有了很多较为成熟的方案，即全曲翻唱识别。但之前提到过，QQ音乐听歌识曲场景的识别是短片段，同行的解决办法不太适用于这样的场景。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;所以QQ音乐创新的提出了片段翻唱识别。&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/ccafa87e040f5dd624415cef20819cce.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;QQ音乐采用度量学习提取Embedding。&lt;/strong&gt;为了应对短片段的识别，输入进行了切片。HPCP特征也是传统翻唱识别中的经典特征。有了&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;Embedding&lt;/strong&gt;之后，就可以按上述提到的音频指纹检索系统进行检索。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/ea546bc15847f678f7720221bc545aac.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;输入Query之后，提取出其Embedding序列进行检索。检索结果中的SongID和Offset信息进行时间差值，针对每一个歌曲构建一个直方图。在同一个时间差之内，直方图出现峰值则认为匹配成功。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/840ba2302ec0e368fb0f3c824a802531.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;翻唱识别检索系统精确率高，Embedding序列之间可以交叉验证。&lt;/strong&gt;召回率也高，Query抗干扰高。但缺点也很明显，序列的严格对齐，变速后无法满足时序要求，所以不支持变速；单个Query和Doc都要提取数百Embedding，索引检索开销大。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/e62efaa03664041e02dbaf8db9022f72.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;目前QQ音乐增加了&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;歌声ASR检索模块&lt;/strong&gt;。在&lt;a href=&quot;https://cloud.tencent.com/product/css?from_column=20065&amp;from=20065&quot; target=&quot;_blank&quot; class=&quot;rno-markdown__textlink-new&quot; track-click=&quot;{&amp;quot;areaId&amp;quot;:0,&amp;quot;objectId&amp;quot;:862,&amp;quot;positionId&amp;quot;:862,&amp;quot;objectName&amp;quot;:&amp;quot;直播&amp;quot;,&amp;quot;objectType&amp;quot;:&amp;quot;link&amp;quot;}&quot; track-exposure=&quot;{&amp;quot;areaId&amp;quot;:0,&amp;quot;objectId&amp;quot;:862,&amp;quot;positionId&amp;quot;:862,&amp;quot;objectName&amp;quot;:&amp;quot;直播&amp;quot;,&amp;quot;objectType&amp;quot;:&amp;quot;link&amp;quot;}&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; padding: 0px 10px 0px 0px; margin: 0px 4px; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217); cursor: pointer; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9Im5vbmUiPjxwYXRoIGQ9Ik00LjMwMyA1LjAxbC0uNzA3LjcwN2ExLjUgMS41IDAgMDEtMi4xMjEtMi4xMjFsLjcwNy0uNzA3LS43MDctLjcwNy0uNzA3LjcwN2EyLjUgMi41IDAgMTAzLjUzNSAzLjUzNWwuNzA4LS43MDctLjcwOC0uNzA3ek01LjAxIDQuMzAzbC43MDguNzA3LjcwNy0uNzA3QTIuNSAyLjUgMCAwMDIuODg5Ljc2N2wtLjcwNy43MDcuNzA3LjcwOC43MDctLjcwOGExLjUgMS41IDAgMDEyLjEyMiAyLjEyMmwtLjcwNy43MDd6IiBmaWxsPSIjMDA1MkQ5Ii8+PHBhdGggZD0iTTQuMzAzIDIuMTgybC43MDguNzA3LTIuMTIyIDIuMTItLjcwNy0uNzA2IDIuMTIxLTIuMTIxeiIgZmlsbD0iIzAwNTJEOSIvPjwvc3ZnPg==&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none;&quot;&gt;直播&lt;/a&gt;场景或者LIVE环境下，人耳可以将歌词听的很准，可以直接搜索歌词。这个时候使用歌声ASR检索更为方便。随着深度神经网络的发展，ASR发展也十分迅速。天琴实验室训练了一个针对歌声的&lt;a href=&quot;https://cloud.tencent.com/product/asr?from_column=20065&amp;from=20065&quot; target=&quot;_blank&quot; class=&quot;rno-markdown__textlink-new&quot; track-click=&quot;{&amp;quot;areaId&amp;quot;:0,&amp;quot;objectId&amp;quot;:45,&amp;quot;positionId&amp;quot;:45,&amp;quot;objectName&amp;quot;:&amp;quot;语音识别&amp;quot;,&amp;quot;objectType&amp;quot;:&amp;quot;link&amp;quot;}&quot; track-exposure=&quot;{&amp;quot;areaId&amp;quot;:0,&amp;quot;objectId&amp;quot;:45,&amp;quot;positionId&amp;quot;:45,&amp;quot;objectName&amp;quot;:&amp;quot;语音识别&amp;quot;,&amp;quot;objectType&amp;quot;:&amp;quot;link&amp;quot;}&quot; style=&quot;overflow-wrap: break-word; text-decoration-line: none; padding: 0px 10px 0px 0px; margin: 0px 4px; box-sizing: border-box; list-style: inherit; color: rgb(0, 82, 217); cursor: pointer; background-image: url(&amp;quot;data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIGZpbGw9Im5vbmUiPjxwYXRoIGQ9Ik00LjMwMyA1LjAxbC0uNzA3LjcwN2ExLjUgMS41IDAgMDEtMi4xMjEtMi4xMjFsLjcwNy0uNzA3LS43MDctLjcwNy0uNzA3LjcwN2EyLjUgMi41IDAgMTAzLjUzNSAzLjUzNWwuNzA4LS43MDctLjcwOC0uNzA3ek01LjAxIDQuMzAzbC43MDguNzA3LjcwNy0uNzA3QTIuNSAyLjUgMCAwMDIuODg5Ljc2N2wtLjcwNy43MDcuNzA3LjcwOC43MDctLjcwOGExLjUgMS41IDAgMDEyLjEyMiAyLjEyMmwtLjcwNy43MDd6IiBmaWxsPSIjMDA1MkQ5Ii8+PHBhdGggZD0iTTQuMzAzIDIuMTgybC43MDguNzA3LTIuMTIyIDIuMTItLjcwNy0uNzA2IDIuMTIxLTIuMTIxeiIgZmlsbD0iIzAwNTJEOSIvPjwvc3ZnPg==&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none;&quot;&gt;语音识别&lt;/a&gt;系统，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;使用数万小时的歌声数据进行训练，实时率在0.3以内，字错误率15%左右。与业内通用ASR相比在歌词识别方面提升近40%。&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/a4408c885c5d0a271df778570d014b2a.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;将ASR嵌入到Embedding检索，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;结果融合后精确率将近90%&lt;/strong&gt;，是一个不错的成绩。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/c4c8c17b8e6d3e78b33ff973ac8d0e51.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;当听歌识曲没有结果时，该系统就会启用。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/762bbbe1240781397a72852493bb9de5.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;图中的是一些听歌识曲的入口，有&lt;span class=&quot;mod-overview__keyword&quot; style=&quot;overflow-wrap: break-word; margin: 0px 4px; cursor: pointer; color: #0052D9; padding-right: 10px; background-image: url(&amp;quot;images/icon-keyword_32a.svg&amp;quot;); background-position: right 2px; background-repeat: no-repeat; background-size: 8px 8px; box-shadow: none; box-sizing: border-box; list-style: inherit;&quot;&gt;Android&lt;/span&gt;桌面控件、鸿蒙hap、长按快捷方式和跨应用识别等。相信很多大家已经非常熟悉了。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;-03-&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;听歌识曲技术应用举例&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;除了线上的场景可以使用到听歌识曲，还有哪些场景也可以使用到该技术呢？&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/8f28f6d71f63412362a7f7455e24a7e8.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;在庞大曲库管理中，该技术也得以大展身手。曲库大有大的好处，也有大的难处。《孤勇者》非常非常火，有很多歌手想蹭热度，例如长音频、串烧、DJ版等。《孤勇者》类似的歌曲在曲库中多达上千首。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/59f1bfd48c65985c60f460f6e3f19fd3.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;对于最不能容忍的盗歌，&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;QQ音乐做了三大类六小类的分类。&lt;/strong&gt;一级盗歌分为直接盗用、截取盗用；二级盗歌分为拼接盗用、改编盗用和节目素材；三级盗歌则为词曲盗用。无论哪一种，都不利于音乐行业的正向长久发展。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/f6be2c7b8c7a4b672995f74a0ca9d6fe.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;QQ音乐首先会经过音频指纹技术进行曲库范围内的聚类，根据歌曲信息做盗歌的自动化打标。根据打标结果，对可以歌手进行重点挖掘，进行盗版歌手打击。并且打击结果及时反馈给业务端，针对作弊多的歌手，再次进行打击。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;这样的惩罚措施实施下来，盗歌曝光量下降了近80%。&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/f4ea30c169146d3159d53c3b21faa3fb.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;翻唱和盗歌存在些许区别。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;我们对翻唱进行了五档同歌组体系划分，意在更好的在平台分发。&lt;/strong&gt;不同档之间有着严格的从属关系。最严格的为绝对同歌组，具有相同的音轨。其次为严格同歌组，具有相同的录音。之后为同演唱同歌组，有相同的表演者。再往后为同词曲同歌组，其作品相同。最后为同曲同歌组，只有作曲相同。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/ef17e617bc8ea5010fbe9fc598bba532.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;目前QQ音乐对其所有曲库都进行了这样的分组。使用的技术也是之前上文提到的那些。输出不同同歌组以更好的服务不同业务。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/ffab25ae36d4175976be087a96cfd7d7.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;该技术不仅仅可以应用在音乐行业，在直播中对于真假唱辨别也十分高效。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/f085ec6d1a4b9d2850987a2d366e2641.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;还有很多其他的应用，这里不一一介绍。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;-04-&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;听歌识曲技术展望&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/dd64af5caf0eba98464c93c2a9ec4ca8.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;QQ音乐希望未来的听歌识曲可以有更多的个性化。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;用户维度&lt;/strong&gt;，不同人喜好不同，有人喜欢原唱，有人喜欢翻唱；&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;歌曲维度&lt;/strong&gt;，同一个人对不同歌曲的版本有偏爱；&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;场景维度，&lt;/strong&gt;同一个人在不同场景下可能也有不同的选择。&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;img src=&quot;https://developer.qcloudimg.com/http-save/yehe-5720403/f70588fcbd18da8ae09fb1080e183c52.png&quot; style=&quot;overflow-wrap: break-word; border: 0px; box-sizing: border-box; list-style: inherit; margin: 0px auto; cursor: zoom-in; width: 996px; height: auto; display: block; max-width: 100%; max-height: 100%; border-radius: 3px;&quot;/&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;我们也希望能和行业内的同行共享我们的技术，做大规模。&lt;strong style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit;&quot;&gt;QQ音乐进行了开源数据集发布，&lt;/strong&gt;大家可以加入我们，一起将识别技术做大做强，在多媒体领域同频共振。谢谢大家。&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;参考文献：&lt;/p&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;[1] M. Muller, “Music synchronization,” in ¨ Fundamentals of Music Processing: Audio, Analysis, Algorithms, Applications, pp.355–385. Springer, Berlin, Heidelberg, 2015.&lt;/p&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;hr style=&quot;overflow-wrap: break-word; margin: 20px 0px; padding: 0px; box-sizing: border-box; list-style: inherit; width: 996px; height: 1px; background-color: rgb(153, 153, 153); opacity: 0.24; border: 0px none;&quot;/&gt;&lt;/figure&gt;&lt;figure class=&quot;&quot; style=&quot;overflow-wrap: break-word; box-sizing: border-box; list-style: inherit; margin: 16px 0px;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url&quot; style=&quot;overflow-wrap: break-word; margin: 16px 0px; padding: 0px; box-sizing: border-box; text-align: center; list-style: inherit;&quot;&gt;&lt;div class=&quot;rno-markdown-img-url-inner&quot; style=&quot;overflow-wrap: break-word; margin: 0px auto; padding: 0px; box-sizing: border-box; position: relative; display: inline-block; list-style: inherit; width: auto; white-space-collapse: collapse !important;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;p style=&quot;overflow-wrap: break-word; margin-top: 0px; margin-bottom: 8px; padding: 0px; box-sizing: border-box; list-style: inherit; min-height: 24px;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description><pubDate>Fri, 02 Feb 2024 09:34:41 +0800</pubDate></item><item><title>珍藏壁纸</title><link>http://www.jewe.wang/?id=15</link><description>&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597646481076.jpeg&quot; style=&quot;&quot; title=&quot;2.jpeg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597646666684.jpg&quot; style=&quot;&quot; title=&quot;1.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597646191202.jpg&quot; style=&quot;&quot; title=&quot;0.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597646776700.jpg&quot; style=&quot;&quot; title=&quot;4.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597646274554.jpg&quot; style=&quot;&quot; title=&quot;5.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597646716346.jpeg&quot; style=&quot;&quot; title=&quot;6.jpeg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597647629737.jpeg&quot; style=&quot;&quot; title=&quot;7.jpeg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597649379325.jpg&quot; style=&quot;&quot; title=&quot;21.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597650145284.jpg&quot; style=&quot;&quot; title=&quot;19.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597650894043.jpeg&quot; style=&quot;&quot; title=&quot;25.jpeg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597650959671.jpg&quot; style=&quot;&quot; title=&quot;26.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597651280815.jpg&quot; style=&quot;&quot; title=&quot;27.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597651282421.jpeg&quot; style=&quot;&quot; title=&quot;28.jpeg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597651581716.jpg&quot; style=&quot;&quot; title=&quot;29d28c85-bb34-4abf-8521-8251d9fb8516.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597652800494.jpg&quot; style=&quot;&quot; title=&quot;32.jpg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;img class=&quot;ue-image&quot; src=&quot;http://www.jewe.wang/zb_users/upload/2024/01/202401301706597653695126.jpeg&quot; style=&quot;&quot; title=&quot;604e87a510664c86aaed30694fb40255.jpeg&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 30 Jan 2024 14:53:42 +0800</pubDate></item></channel></rss>