遞歸推理樹(RR-Tree)系統:構建認知推理的骨架結構

探索基于三維評估的動態推理系統如何實現智能決策與知識演化

引言

在復雜問題求解領域(如戰略決策或科學探索),人類思維的遞歸本質為AI系統設計提供了重要啟發。我設計并實現的遞歸推理樹(Recursive Reasoning Tree, RR-Tree)系統模仿人類思維的層層推進特性,通過結構化認知過程來解決復雜問題。

本文將深入探討RR-Tree的核心機制,包括其數據結構、TQR三維評估模型和操作符引擎,并通過黑暗森林策略制定和數學反例發現兩個案例展示其實際應用。

核心數據結構:知識樹的結構化表達

RRNode:推理樹的基本單位

每個推理節點代表一個知識單元,包含以下核心屬性:

class RRNode:def __init__(self, name, content, parent=None):self.id = uuid.uuid4().hex  # 唯一標識符self.name = nameself.content = content  # 知識內容self.version = 1  # 版本迭代self.status = "hypothesized"  # 節點狀態self.tqr_score = None  # 三維質量評分self.children = []  # 子節點self.parent = parent  # 父節點

節點生命周期經歷五個階段:

  1. hypothesized - 初步假設階段
  2. evaluating - 質量評估階段
  3. resolved - 已解決問題
  4. deprecated - 被淘汰方案
  5. merged - 與其它方案合并

RRTree:推理樹的整體架構

class RRTree:def __init__(self, root_goal):self.root = RRNode("root", root_goal)self.root.status = "active"self.evaluator = TQREvaluator()  # 質量評估器self.operator = OperatorEngine(self)  # 操作引擎self.audit_log = []  # 推理過程記錄self.converged = False  # 收斂狀態

推理樹支持從根節點開始的漸進式推理,通過reasoning_cycle()方法驅動推理循環。

TQR三維評估模型

推理質量通過三個維度進行評估:

class TQREvaluator:def evaluate(self, node, context):alpha = self._calculate_alignment(node, context)  # 邏輯連貫性beta = self._calculate_novelty(node, context)  # 觀點新穎性gamma = self._calculate_complexity(node)  # 認知復雜度# 核心評估公式numerator = alpha * (1 + beta**2)denominator = (1 + gamma)**0.5score = numerator / denominatornode.tqr_score = score

三維度詳細說明

  1. 邏輯連貫性(α):考察節點與上下文的匹配程度
    • 計算基礎分(6.0)+上下文匹配獎勵分(最高4.0)
  2. 觀點新穎性(β):評估獨特見解的價值
    • 基礎分(5.0)+獨特詞匯獎勵(每個0.1分)
  3. 認知復雜度(γ):衡量知識深度
    • 基于內容長度(詞數/20)和節點深度(深度*0.1)

操作符引擎:知識樹的演變機制

核心操作符定義了知識樹的動態演化路徑:

操作符功能描述狀態轉換路徑
EXPAND擴展新分支→ hypothesized
CHOOSE選擇最佳子節點evaluating → resolved
REWRITE重構節點內容resolved → resolved (v++)
MERGE合并相關節點resolved → merged
DEEP_DIVE遞歸深入解決復雜問題evaluating → resolved

DEEP_DIVE操作示例

def _deep_dive(self, node):# 創建子推理樹subtree = RRTree(f"深度探索: {node.content}")# 執行遞歸推理for i in range(2):subtree.reasoning_cycle()if subtree.converged: break# 替換原節點new_node = RRNode(f"resolved_{node.name}", subtree.get_conclusion(),parent=node.parent)new_node.status = "resolved"return new_node

推理循環:認知決策的核心

推理樹通過周期性循環實現知識的漸進式演化:

def reasoning_cycle(self):current = self._select_node_to_expand()  # 選擇最佳節點if current.status in ["hypothesized", "evaluating"]:context = self._get_context(current)  # 獲取上下文self.evaluator.evaluate(current, context)  # 三維評估# 基于狀態選擇操作if self._needs_expansion(current):self.operator.apply("EXPAND", current)elif self._needs_rewrite(current):self.operator.apply("REWRITE", current)elif self._is_complex_node(current):self.operator.apply("DEEP_DIVE", current)self.converged = self._check_convergence()  # 檢查收斂

節點選擇算法

  1. 收集所有"活動中"的邊界節點
  2. 按TQR分數降序排序
  3. 選擇最優節點進行擴展

應用案例

黑暗森林策略推導

構建宇宙文明生存策略的推理過程:

dark_forest_tree = RRTree("制定宇宙文明生存策略")# 添加公理基礎
axioms = [("axiom_1", "生存是文明第一需要"),("axiom_2", "宇宙物質總量不變"),("axiom_3", "存在其他智慧文明"),("axiom_4", "暴露位置招致毀滅風險")
]

推理路徑

(root 制定宇宙文明生存策略)├─ (axiom_1 生存是文明第一需要)├─ (axiom_2 宇宙物質總量不變)├─ (axiom_3 存在其他智慧文明)└─ (axiom_4 暴露位置招致毀滅風險)

經過三次推理循環后,系統推導出核心策略:“保持隱匿和技術優勢以規避風險”。

數學反例發現

尋找a? + b? + c? + d? = e?的反例過程:

math_tree = RRTree("尋找a?+b?+c?+d?=e?的反例")
strategy_node = RRNode("strategy", "邊界值搜索(max=150)")
math_tree.root.add_child(strategy_node)

關鍵演變

  1. 初始:邊界值搜索策略(max=150)
  2. 擴展出多個搜索子策略
  3. 選擇并優化TQR最高的分支
  4. DEEP_DIVE操作生成新解決方案
  5. 結論:27? + 84? + 110? + 133? = 144?

結論與展望

RR-Tree系統通過結構化的遞歸推理實現知識的漸進式演化,其特點包括:

  1. 動態決策機制:基于TQR評分動態選擇擴展路徑
  2. 可解釋推理:完整的S表達式記錄推理過程
  3. 自適應知識演化:通過版本控制實現觀點迭代
  4. 復雜問題化解:深層遞歸分解復雜問題

未來方向

  1. 集成大語言模型提升推理能力
  2. 引入多樹協同推理機制
  3. 開發可視化推理路徑工具
  4. 構建推理知識共享網絡

RR-Tree為復雜決策過程提供了結構化框架,將人類思維的遞歸本質轉化為可執行的算法框架,在戰略規劃、科研探索和復雜決策領域具有廣闊應用前景。

import uuid
import random
from collections import deque# ================== 核心數據結構 ==================
class RRNode:"""RR-Tree 節點實現"""def __init__(self, name, content, parent=None):self.id = uuid.uuid4().hexself.name = nameself.content = contentself.version = 1self.status = "hypothesized"  # hypothesized | evaluating | resolved | deprecated | active | mergedself.tqr_score = Noneself.children = []self.parent = parentdef add_child(self, node):"""添加子節點"""node.parent = selfself.children.append(node)return selfdef update_content(self, new_content):"""更新節點內容并增加版本號"""self.content = new_contentself.version += 1return selfdef to_s_expr(self):"""轉換為S-表達式"""children_expr = " ".join([child.to_s_expr() for child in self.children])return (f"({self.name} "f"(meta (id '{self.id}') (version {self.version}) "f"(status '{self.status}') (tqr_score {self.tqr_score or 'None'})) "f"{children_expr})")def find_node(self, node_id):"""遞歸查找節點"""if self.id == node_id:return selffor child in self.children:found = child.find_node(node_id)if found:return foundreturn Noneclass RRTree:"""完整的RR-Tree實現"""def __init__(self, root_goal):self.root = RRNode("root", root_goal)self.root.status = "active"self.evaluator = TQREvaluator()self.operator = OperatorEngine(self)self.audit_log = []self.converged = Falsedef reasoning_cycle(self):"""核心推理循環"""if self.converged:return self.rootcurrent = self._select_node_to_expand()if not current:print("沒有可擴展的節點,推理結束")self.converged = Truereturn self.rootprint(f"當前處理節點: {current.name} ({current.status}) - {current.content}")# 評估節點質量if current.status in ["hypothesized", "evaluating"]:context = self._get_context(current)print(f"評估節點: {current.name}, 上下文: {context}")self.evaluator.evaluate(current, context)print(f"評估完成 - TQR分數: {current.tqr_score:.2f}")# 應用操作符if current.children and all(c.status != "hypothesized" for c in current.children):print(f"節點 {current.name} 有子節點,執行CHOOSE操作")chosen = self.operator.apply("CHOOSE", current)print(f"選擇了節點: {chosen.name} - {chosen.content}")else:if self._needs_expansion(current):print(f"節點 {current.name} 需要擴展,執行EXPAND操作")new_nodes = self.operator.apply("EXPAND", current)print(f"新增了 {len(new_nodes)} 個子節點")elif self._needs_rewrite(current):print(f"節點 {current.name} 需要重寫,執行REWRITE操作")self.operator.apply("REWRITE", current)print(f"重寫完成: {current.content}")elif self._is_complex_node(current):print(f"節點 {current.name} 復雜,執行DEEP_DIVE操作")self.operator.apply("DEEP_DIVE", current)print(f"深度探索完成: {current.content}")# 檢查收斂條件self.converged = self._check_convergence()return self.rootdef _select_node_to_expand(self):"""基于TQR選擇最佳擴展節點"""frontier = self._get_frontier_nodes()if not frontier:# 如果沒有可擴展節點,嘗試激活根節點if self.root.status == "active":print("激活根節點進行擴展")self.root.status = "evaluating"return self.root# 或者選擇第一個子節點for child in self.root.children:if child.status in ["active", "hypothesized"]:print(f"選擇子節點 {child.name} 進行擴展")return childreturn None# 按TQR分數排序并返回最佳節點frontier.sort(key=lambda x: x.tqr_score or 0, reverse=True)best_node = frontier[0]print(f"從候選節點中選擇: {best_node.name} (分數: {best_node.tqr_score or '無'})")return best_nodedef _get_frontier_nodes(self):"""獲取所有處于活躍狀態的節點"""frontier = []queue = deque([self.root])while queue:node = queue.popleft()if node.status in ["hypothesized", "evaluating"]:frontier.append(node)queue.extend(node.children)return frontierdef _get_context(self, node):"""獲取節點上下文信息"""context = []current = nodewhile current:context.append(f"{current.name}: {current.content}")current = current.parentreturn " <- ".join(reversed(context))def _needs_expansion(self, node):"""判斷是否需要擴展"""return len(node.children) < 3 and (node.tqr_score or 0) > 0def _needs_rewrite(self, node):"""判斷是否需要重寫"""if node.status != "resolved":return Falsereturn (node.tqr_score or 0) < 7.0 and node.version < 3def _is_complex_node(self, node):"""判斷是否需要深度遞歸"""return ((node.tqr_score or 0) > 7.0and self.evaluator._calculate_complexity(node) > 5.0)def _check_convergence(self):"""檢查樹是否收斂(所有節點已解決或棄用)"""queue = deque([self.root])while queue:node = queue.popleft()if node.status not in ["resolved", "deprecated", "active", "merged"]:return Falsequeue.extend(node.children)return Truedef find_node(self, node_id):"""在樹中查找節點"""return self.root.find_node(node_id)def to_s_expr(self):"""將整棵樹轉換為S-表達式"""return self.root.to_s_expr()def get_conclusion(self):"""獲取最終結論(根節點的第一個已解決子節點)"""if self.converged:for child in self.root.children:if child.status == "resolved":return child.contentreturn "未達成結論"# ================== TQR評估模型 ==================
class TQREvaluator:"""TQR評估引擎"""def __init__(self, alpha_weight=1.0, beta_weight=1.5, gamma_weight=0.7):self.weights = {'alpha': alpha_weight, 'beta': beta_weight, 'gamma': gamma_weight}def evaluate(self, node, context):"""三維度評估節點質量"""alpha = self._calculate_alignment(node, context)beta = self._calculate_novelty(node, context)gamma = self._calculate_complexity(node)# 核心公式: TQR = (α * (1 + β2)) / (1 + γ)^0.5numerator = self.weights['alpha'] * alpha * (1 + (self.weights['beta'] * beta) ** 2)denominator = (1 + self.weights['gamma'] * gamma) ** 0.5score = numerator / denominator if denominator != 0 else numeratornode.tqr_score = scorereturn scoredef _calculate_alignment(self, node, context):"""邏輯連貫性評估"""# 簡化實現:基于上下文匹配度context_words = set(word for word in context.split() if len(word) > 3)node_words = set(word for word in node.content.split() if len(word) > 3)intersection = context_words & node_words# 基本分數 + 匹配度加分base_score = 6.0  # 中等分數match_bonus = min(len(intersection) * 0.5, 4.0)  # 最高加4分return base_score + match_bonusdef _calculate_novelty(self, node, context):"""新穎性評估"""# 簡化實現:基于獨特詞匯unique_words = set(node.content.split()) - set(context.split())uniqueness = len(unique_words) / 10  # 每個獨特詞匯加0.1分# 基本分數 + 獨特性加分base_score = 5.0return min(base_score + uniqueness, 10.0)def _calculate_complexity(self, node):"""認知復雜度評估"""# 基于內容長度和嵌套深度word_count = len(node.content.split())depth = self._get_node_depth(node)complexity = word_count / 20 + depth * 0.1return min(complexity, 10.0)def _get_node_depth(self, node):"""計算節點在樹中的深度"""depth = 0current = nodewhile current.parent:depth += 1current = current.parentreturn depth# ================== 操作符引擎 ==================
class OperatorEngine:"""操作符執行引擎"""def __init__(self, tree):self.tree = treeself.state_transitions = {"EXPAND": {"from": ["active", "resolved", "evaluating"], "to": "hypothesized"},"CHOOSE": {"from": "evaluating", "to": "resolved"},"REWRITE": {"from": ["resolved", "active"], "to": "resolved"},"MERGE": {"from": "resolved", "to": "merged"},"DEEP_DIVE": {"from": ["evaluating", "active"], "to": "resolved"}}def apply(self, operator, target, params=None):"""應用操作符"""if isinstance(target, str):node = self.tree.find_node(target)else:node = targetif not node:print(f"目標節點未找到: {target}")return None# 檢查狀態轉換是否有效valid_states = self.state_transitions.get(operator, {}).get("from", [])if node.status not in valid_states:print(f"無效狀態轉換: 無法在狀態 {node.status} 下應用 {operator}")return nodeif operator == "EXPAND":return self._expand(node)elif operator == "CHOOSE":return self._choose(node)elif operator == "REWRITE":return self._rewrite(node)elif operator == "MERGE":return self._merge(node, params.get('sibling_nodes', []) if params else [])elif operator == "DEEP_DIVE":return self._deep_dive(node)else:print(f"未知操作符: {operator}")return nodedef _expand(self, node):"""EXPAND操作實現"""# 生成子節點內容expansions = [f"關于'{node.content}'的深入分析",f"對'{node.content}'的補充觀點",f"'{node.content}'的實際應用"]new_nodes = []for i, content in enumerate(expansions):child = RRNode(f"{node.name}_child_{i + 1}", content, parent=node)child.status = "hypothesized"node.add_child(child)new_nodes.append(child)node.status = "evaluating"return new_nodesdef _choose(self, parent_node):"""CHOOSE操作實現"""if not parent_node.children:print(f"節點 {parent_node.name} 沒有子節點可供選擇")return None# 選擇TQR分數最高的子節點best_child = max(parent_node.children, key=lambda x: x.tqr_score or 0)# 更新所有子節點狀態for child in parent_node.children:child.status = "deprecated" if child != best_child else "resolved"parent_node.status = "resolved"return best_childdef _rewrite(self, node):"""REWRITE操作實現"""# 改進節點內容improved_content = f"[v{node.version + 1}] 改進版: {node.content}"node.update_content(improved_content)return nodedef _merge(self, target_node, sibling_nodes):"""MERGE操作實現"""# 收集所有需要合并的節點all_nodes = [target_node] + sibling_nodes# 創建新父節點parent_content = f"合并觀點: {', '.join(n.content for n in all_nodes)}"new_parent = RRNode(f"merged_{target_node.name}", parent_content, parent=target_node.parent)# 重新設置父關系for node in all_nodes:node.parent = new_parentnode.status = "merged"new_parent.children.append(node)# 在樹結構中替換節點if target_node.parent:target_node.parent.children.remove(target_node)target_node.parent.add_child(new_parent)return new_parentdef _deep_dive(self, node):"""DEEP_DIVE遞歸操作"""# 創建子推理樹subtree = RRTree(f"深度探索: {node.content}")# 添加初始節點start_node = RRNode("deep_start", "開始探索", parent=subtree.root)subtree.root.add_child(start_node)# 執行子推理過程for i in range(2):  # 簡化:執行2個推理周期subtree.reasoning_cycle()if subtree.converged:break# 創建新節點替換原節點new_content = subtree.get_conclusion()new_node = RRNode(f"resolved_{node.name}",new_content,parent=node.parent)new_node.status = "resolved"# 在樹結構中替換節點if node.parent:node.parent.children.remove(node)node.parent.add_child(new_node)return new_node# ================== 使用示例 ==================
if __name__ == "__main__":print("===== 黑暗森林策略推理 =====")# 創建推理樹 - 黑暗森林策略dark_forest_tree = RRTree("制定宇宙文明生存策略")# 添加公理節點axioms = [("axiom_1", "生存是文明第一需要"),("axiom_2", "宇宙物質總量不變"),("axiom_3", "存在其他智慧文明"),("axiom_4", "暴露位置招致毀滅風險")]for name, content in axioms:node = RRNode(name, content)node.status = "active"dark_forest_tree.root.add_child(node)print("\n===== 初始狀態 =====")print(dark_forest_tree.to_s_expr())# 執行推理循環for i in range(3):print(f"\n===== 推理周期 {i + 1} =====")dark_forest_tree.reasoning_cycle()print(dark_forest_tree.to_s_expr())# 最終結論print("\n===== 最終結論 =====")print(dark_forest_tree.get_conclusion())print("\n\n===== 數學反例發現 =====")# 數學反例發現math_tree = RRTree("尋找a?+b?+c?+d?=e?的反例")math_tree.evaluator.weights = {'alpha': 1.2, 'beta': 2.0, 'gamma': 0.5}strategy_node = RRNode("strategy", "邊界值搜索(max=150)")strategy_node.status = "active"math_tree.root.add_child(strategy_node)for i in range(3):print(f"\n===== 推理周期 {i + 1} =====")math_tree.reasoning_cycle()print(math_tree.to_s_expr())print("\n===== 數學反例 =====")print(math_tree.get_conclusion())

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/917877.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/917877.shtml
英文地址,請注明出處:http://en.pswp.cn/news/917877.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

《動手學深度學習》讀書筆記—9.5機器翻譯與數據集

本文記錄了自己在閱讀《動手學深度學習》時的一些思考&#xff0c;僅用來作為作者本人的學習筆記&#xff0c;不存在商業用途。 語言模型是自然語言處理的關鍵&#xff0c; 而機器翻譯是語言模型最成功的基準測試。 因為機器翻譯正是將輸入序列轉換成輸出序列的 序列轉換模型&a…

Mysql進行操作時鎖的具體行為

場景一&#xff1a;單個事務更新一條存在的數據 假設有表 user (id PK, name, age)&#xff0c;數據&#xff1a;[id1, nameAlice, age25] 你的 SQL&#xff1a; UPDATE user SET age 26 WHERE id 1; 底層動作&#xff1a; 事務 A (主動方) 發起更新請求。Lock Manager 介入&…

人工智能領域、圖歐科技、IMYAI智能助手2025年7月更新月報

IMYAI 平臺 2025 年 7 月重要功能更新與優化匯總 2025年07月31日更新 細節優化&#xff1a; 修復了移動端提交后自動彈出側邊欄的BUG。優化對話高級配置界面&#xff0c;增加滾動條并固定高度&#xff0c;避免內容超出屏幕。音樂生成界面的人聲選擇新增“合唱”選項&#xff…

HTTP 與 HTTPS 的區別深度解析:從原理到實踐

HTTP 和 HTTPS 是現代 Web 開發中不可或缺的協議&#xff0c;它們決定了瀏覽器與服務器之間數據傳輸的方式。HTTPS 作為 HTTP 的安全版本&#xff0c;在安全性、性能和用戶體驗上都有顯著提升。本文將通過萬字篇幅&#xff0c;結合圖表和代碼示例&#xff0c;詳細剖析 HTTP 與 …

STM32F407VET6學習筆記11:smallmodbus_(多從機)創建新的slave從機

今日記錄一些smallmodbus 創建新的slave 從機 的過程&#xff0c;以及使用的關鍵點. 目錄 創建新的從機對應操作函數與buffer 創建新的從機線程與操作代碼&#xff1a; slave使用的要點&#xff1a; 完整的slave代碼&#xff1a; 能正常通信&#xff1a; 創建新的從機對應操作函…

【論文閱讀】Transformer Feed-Forward Layers Are Key-Value Memories

Transformer Feed-Forward Layers Are Key-Value Memories 原文摘要 研究背景與問題&#xff1a; 前饋層占Transformer模型參數總量的2/3&#xff0c;但其功能機制尚未得到充分研究 核心發現&#xff1a;提出前饋層實質上是鍵值存儲系統 鍵&#xff1a;這里的鍵與訓練數據中出…

昇思+昇騰開發板:DeepSeek-R1-Distill-Qwen-1.5B 模型推理部署與 JIT 優化實踐

目錄 引言 模型推理部署 環境準備 安裝 MindSpore 查看當前 mindspore 版本 安裝 MindNLP 模型與分詞器加載 導入必要的庫 加載分詞器 加載模型 對話功能實現 設置系統提示詞 構建對話歷史輸入 推理函數實現 交互界面實現 推理JIT優化 基礎環境安裝 JIT 優化配置…

用phpstudy安裝php8.2后報錯:意思是找不到php_redis.dll拓展時

1.地址&#xff1a;https://pecl.php.net/package/redis/6.2.0/windows 2.下載3.解壓后復制php_redis.dll到phpstudy_pro\Extensions\php\php8.2.9nts\ext目錄 4.打開php.ini&#xff0c;加上 extension_dir “D:\software\phpstudy_pro\Extensions\php\php8.2.9nts\ext”

開源列式分布式數據庫clickhouse

這里寫自定義目錄標題開源列式OLAP數據庫clickhouseclickhouse使用 ClickHouse 的場景如何理解行式存儲和列式存儲clickhouse-go開源列式OLAP數據庫clickhouse OLAP (分析型)&#xff1a;專為快速掃描、聚合、分析海量數據設計。OLTP (事務型)&#xff1a;專為處理大量短事務&…

Java Stream API 詳解(Java 8+)

1. Stream 操作分類Stream 操作分為兩類&#xff1a;中間操作&#xff08;Intermediate Operations&#xff09;返回新的 Stream&#xff0c;可以鏈式調用&#xff08;如 filter, map, sorted, distinct&#xff09;。惰性求值&#xff1a;只有遇到終止操作時才會執行。終止操作…

「源力覺醒 創作者計劃」_文心大模型4.5系列開源模型, 從一行代碼到一個生態:聊聊開源戰略那些事兒,順便扯扯文心大模型 4.5 的使用心得

前言&#xff1a;哈嘍&#xff0c;大家好&#xff0c;今天給大家分享一篇文章&#xff01;并提供具體代碼幫助大家深入理解&#xff0c;徹底掌握&#xff01;創作不易&#xff0c;如果能幫助到大家或者給大家一些靈感和啟發&#xff0c;歡迎收藏關注哦 &#x1f495; 目錄從一行…

算法專題(二)回文鏈表

1、源代碼class Solution {public boolean isPalindrome(ListNode head) {ListNode fasthead,slowhead; //快慢指針都在頭結點//快指針走2步&#xff0c;慢指針走一步。//雙數快指針最后是null&#xff0c;單數快指針下一位是nullwhile(fast!null && fast.next!null){f…

2025《艾諾提亞失落之歌》逆向工程解包嘗試

前言 想開發一下光明之魂&#xff0c;看能不能解包《艾諾提亞失落之歌》的模型。 之前寫了&#xff08;https://blog.csdn.net/weixin_42875245/article/details/148616547?spm1001.2014.3001.5501&#xff09; 沿用這個思路進行逆向工程解包。 文章目錄請添加圖片描述前言…

JVM 03 類加載機制

JVM 將字節碼二進制流加載到內存稱為類加載。 什么時候加載類 new 實例化對象。而對象所屬類還沒被加載。讀取/設置類的靜態非常量字段&#xff0c;常量字段在常量池。調用類的靜態方法。類初始化&#xff0c;優先初始化父類。虛擬機啟動時&#xff0c;先加載用戶指定的主類。 …

STM32H7+FreeRTOS+LwIP移植EtherCAT開源主站SOEM

代碼下載什么的就不多說了&#xff0c;直接看需要移植修改的代碼。 1、osal.c修改 /******************************************************************************* * *** **** *** *** …

VijosOJ:中文信息學競賽的二十年開源之路

VijosOJ&#xff1a;中文信息學競賽領域的老牌開源在線判題系統 在中文編程教育與信息學競賽的發展歷程中&#xff0c;在線判題系統&#xff08;OJ&#xff09;扮演了至關重要的角色。它們不僅是選手訓練的 “戰場”&#xff0c;更是知識傳遞與社區交流的樞紐。VijosOJ&#x…

QPainter::CompositionMode解析

基本概念目標(Destination)&#xff1a;已經存在的像素。源(Source)&#xff1a;要繪制的新像素。組合模式&#xff1a;決定源和目標如何混合。總結SourceOver&#xff1a;源繪制在目標之上。DestinationOver&#xff1a;目標繪制在源之上。Clear&#xff1a;二者重疊區域被清空…

對接釘釘審批過程記錄(C#版本)

釘釘開放平臺&#xff1a;API總覽 - 釘釘開放平臺 按照開放平臺操作指引&#xff0c;進入到釘釘開發者后臺&#xff1a;開發者后臺統一登錄 - 釘釘統一身份認證&#xff0c;進行應用創建。 按照開放平臺指引下載釘釘SDK&#xff08;新版&#xff09;。 在vs引入釘釘dll文件。 獲…

AFSIM入門教程03.03:更新所有依賴庫版本

系列索引&#xff1a;AFSIM入門教程索引 上一篇中更新了tiff庫版本&#xff0c;本文將更新所有使用到的依賴庫版本。 失敗了 依賴庫 首先獲取哪些庫被使用了。打開源碼目錄&#xff0c;搜索# Configure the 3rd_party&#xff0c;可以看到調用第三方庫的代碼。 官方提供的…

完美解決hive external表中csv字段內容含“,“逗號的問題

為解決hive表中csv字段內容含","逗號的問題&#xff0c;網上幾乎都是說要用org.apache.hadoop.hive.serde2.OpenCSVSerde。 使用方法為&#xff1a; 1、mysql導出時&#xff0c;加一個ENCLOSED BY ‘"’&#xff0c; 示例&#xff1a; mysql -h 10.16.0.10 -P …