更新 readme.md
This commit is contained in:
1 parent
7cbaf4b298
commit
a72cac3cf4
1 file changed
+280
-4
@@ -2,11 +2,179 @@
|
|||||||
## 一、 项目背景与定位
|
## 一、 项目背景与定位
|
||||||
本项目定位为一款 全栈大数据+ AI 的实践项目。其核心目的不在于交付某商业场景的端到端产品,而在于覆盖并深度实践当前大数据领域的主流核心技术栈。
|
本项目定位为一款 全栈大数据+ AI 的实践项目。其核心目的不在于交付某商业场景的端到端产品,而在于覆盖并深度实践当前大数据领域的主流核心技术栈。
|
||||||
|
|
||||||
旨在验证自身并展示从底层数据采集、实时流计算、数据治理到上层 AI (LLM) 赋能的工程落地能力。
|
## 二、 系统整体架构图
|
||||||
|
### 2.1 技术逻辑与生态全景图
|
||||||
|
|
||||||
## 二、 系统全链路架构图
|
```mermaid
|
||||||
### 2.1 小红书自动采集与口碑分析
|
flowchart LR
|
||||||
|
%% 隐藏的根节点用于整体布局排版
|
||||||
|
Root[全栈技术生态图谱] --> Lang
|
||||||
|
Root --> Collect
|
||||||
|
Root --> Compute
|
||||||
|
Root --> Storage
|
||||||
|
Root --> AI
|
||||||
|
Root --> Gov
|
||||||
|
Root --> Infra
|
||||||
|
|
||||||
|
style Root fill:none,stroke:none,color:transparent
|
||||||
|
|
||||||
|
subgraph Lang ["1. 开发语言与框架"]
|
||||||
|
direction TB
|
||||||
|
Python("Python<br/>(核心逻辑 / 爬虫 / API 交互)")
|
||||||
|
PySpark("PySpark<br/>(Structured Streaming 微批处理)")
|
||||||
|
Java("Java / Scala<br/>(Flink DataStream / CEP 风控算子)")
|
||||||
|
SQL("SQL<br/>(Flink SQL / Doris OLAP 分析)")
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Collect ["2. 数据采集与接入层"]
|
||||||
|
direction TB
|
||||||
|
RPA("影刀 RPA<br/>(无头浏览器 / 模拟人机交互)")
|
||||||
|
Requests("Python Requests<br/>(API 轮询 / 平台接口调用)")
|
||||||
|
WSS("WebSocket<br/>(加密货币高频交易流接入)")
|
||||||
|
Flask("Flask + SSE<br/>(Webhook 中转与流式打字机输出)")
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Compute ["3. 流批计算与调度编排"]
|
||||||
|
direction TB
|
||||||
|
Flink("Apache Flink<br/>(实时流计算 / 5分钟滑动窗口聚合)")
|
||||||
|
CEP("Flink CEP<br/>(复杂事件处理 / 巨鲸砸盘模式匹配)")
|
||||||
|
Spark("Apache Spark<br/>(分布式 ETL / ODS 贴源层清洗)")
|
||||||
|
Dolphin("Apache DolphinScheduler<br/>(VM 集群分布式高可用调度)")
|
||||||
|
Airflow("Apache Airflow<br/>(DAG 任务编排与定时触发)")
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Storage ["4. 湖仓一体与存储底座"]
|
||||||
|
direction TB
|
||||||
|
Kafka("Apache Kafka + Zookeeper<br/>(超高吞吐消息总线 / 削峰填谷)")
|
||||||
|
Paimon("Apache Paimon<br/>(支持 Append-Only 的流批一体数据湖)")
|
||||||
|
MinIO("MinIO Distributed<br/>(S3兼容的分布式对象存储集群)")
|
||||||
|
Doris("Apache Doris<br/>(毫秒级响应的极速实时数仓)")
|
||||||
|
RDBMS("MySQL / PostgreSQL<br/>(关系型存储与 Airflow/Dify 元数据库)")
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph AI ["5. AI 智能与大模型基建"]
|
||||||
|
direction TB
|
||||||
|
Dify("Dify / OpenWebUI<br/>(LLM Agent 工作流编排与对话前端)")
|
||||||
|
LLM("DeepSeek / Moonshot API<br/>(大语言模型原生推理能力)")
|
||||||
|
LocalAI("Ollama<br/>(本地开源大模型部署底座)")
|
||||||
|
VectorDB("Qdrant / Weaviate<br/>(高维向量存储与 KNN 召回)")
|
||||||
|
Infinity("Infinity (bge-m3)<br/>(本地化高性能文本 Embedding 引擎)")
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Gov ["6. 资产治理与商业智能"]
|
||||||
|
direction TB
|
||||||
|
DataHub("DataHub (Acryl)<br/>(企业级元数据采集与血缘治理平台)")
|
||||||
|
Gitea("Gitea<br/>(代码仓库与 Markdown 智能资产说明书)")
|
||||||
|
DataEase("DataEase / SQLBot<br/>(可视化监控大屏与 Text-to-SQL 问数)")
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Infra ["7. 部署底座与高匿网络"]
|
||||||
|
direction TB
|
||||||
|
Docker("WSL 2 / Docker Compose<br/>(本地高密度算力容器化隔离)")
|
||||||
|
VM("VM 虚拟机集群 (ub1/ub2/ub3)<br/>(物理级高可用容灾节点)")
|
||||||
|
FRP("frp (frps/frpc)<br/>(内网穿透与外网服务暴露)")
|
||||||
|
Proxy("v2ray / mihomo<br/>(跨境专线代理 / 智能分流与海外 IP 池)")
|
||||||
|
end
|
||||||
|
|
||||||
|
%% 样式美化 (无背景填充,适配深浅色模式)
|
||||||
|
style Lang fill:none,stroke:#2196f3,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style Collect fill:none,stroke:#00bcd4,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style Compute fill:none,stroke:#4caf50,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style Storage fill:none,stroke:#ff9800,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style AI fill:none,stroke:#9c27b0,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style Gov fill:none,stroke:#f44336,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style Infra fill:none,stroke:#607d8b,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
```
|
||||||
|
### 2.2 物理部署与集群拓扑图
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
%% ================= 1. WSL 计算集群 =================
|
||||||
|
subgraph WSL_Docker ["1. WSL 2 / Docker 边缘计算集群 "]
|
||||||
|
direction TB
|
||||||
|
subgraph AI_Stack ["AI 大模型与知识库层"]
|
||||||
|
Dify["Dify / OpenWebUI<br/>(大模型编排前端)"]
|
||||||
|
LLM["Ollama / Infinity<br/>(本地大模型与向量 Embedding)"]
|
||||||
|
VectorDB[("Qdrant / Weaviate<br/>(向量数据库)")]
|
||||||
|
Dify <--> LLM & VectorDB
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Data_Fabric ["数据资产治理与 BI 展现层"]
|
||||||
|
DataHub["DataHub<br/>(元数据治理平台)"]
|
||||||
|
DataEase["DataEase / PowerBI / SQLBot<br/>(智能问数与 BI)"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph BigData_Base ["基础数据底座"]
|
||||||
|
Kafka["Kafka + Zookeeper<br/>(消息流总线)"]
|
||||||
|
Spark["Spark 集群<br/>(Master / Worker)"]
|
||||||
|
RDBMS[("MySQL<br/>(关系型数据库群)")]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
%% ================= 2. 虚拟机高可用集群 =================
|
||||||
|
subgraph VirtualMachine_HA_Cluster ["2. VM (虚拟机) 核心算力集群 (ub1, ub2, ub3 分布式高可用)"]
|
||||||
|
direction TB
|
||||||
|
ZK["Zookeeper 集群<br/>(分布式协调与 Leader 选举)"]
|
||||||
|
Flink["Apache Flink 集群<br/>(Standalone 实时流计算)"]
|
||||||
|
MinIO[("MinIO 分布式集群<br/>(数据湖对象存储底座)")]
|
||||||
|
Dolphin["Apache DolphinScheduler<br/>(Master/Worker 任务调度编排)"]
|
||||||
|
|
||||||
|
ZK <--> Flink & Dolphin
|
||||||
|
Dolphin -.->|"任务调度执行"| Flink
|
||||||
|
Flink -.->|"流批数据落盘"| MinIO
|
||||||
|
end
|
||||||
|
|
||||||
|
%% ================= 跨集群交互 =================
|
||||||
|
Dolphin -.->|"跨集群调度"| Spark
|
||||||
|
Flink -.->|"实时消费"| Kafka
|
||||||
|
DataEase -.->|"报表查询"| RDBMS
|
||||||
|
|
||||||
|
%% 样式美化 (去除 fill 填充以自适应 Gitea 深/浅色主题,防文字泛白)
|
||||||
|
style WSL_Docker fill:none,stroke:#9c27b0,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
style VirtualMachine_HA_Cluster fill:none,stroke:#4caf50,stroke-width:2px,stroke-dasharray: 5 5
|
||||||
|
|
||||||
|
style AI_Stack fill:none,stroke:#ff9800,stroke-width:1px
|
||||||
|
style Data_Fabric fill:none,stroke:#00bcd4,stroke-width:1px
|
||||||
|
style BigData_Base fill:none,stroke:#fbc02d,stroke-width:1px
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.3 网络路由与出入站拓扑图
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
%% ================= 1. 公网入站穿透链路 =================
|
||||||
|
subgraph Inbound_Network ["1. 公网入站穿透链路 (Inbound)"]
|
||||||
|
User(("外部访问用户")) --> Domain["自定义域名 (aibi.chat)"]
|
||||||
|
Domain --> In_HK["香港云服务器<br/>(Nginx)"]
|
||||||
|
In_HK -- "FRP 内网穿透隧道" --> Local_FRPC["本地局域网 frpc"]
|
||||||
|
Local_FRPC --> Gateway["本地 API 网关 / Nginx"]
|
||||||
|
end
|
||||||
|
|
||||||
|
%% ================= 2. 专属出海与反爬链路 =================
|
||||||
|
subgraph Outbound_Network ["2. 专属出海与反爬代理链路 (Outbound)"]
|
||||||
|
DevTools(["Claude / Gemini<br/>(AI 开发终端)"]) --> V2Ray["本地 v2ray 客户端 / 网关"]
|
||||||
|
ShadowBot(["影刀 RPA 节点<br/>(社媒无头采集)"]) --> V2Ray
|
||||||
|
Jupyter(["Jupyter / Python 脚本<br/>(API 轮询抓取)"]) --> V2Ray
|
||||||
|
|
||||||
|
V2Ray -->|"透明代理 / 流量加密"| Out_Tencent["阿里云高速中转专线"]
|
||||||
|
Out_Tencent --> Out_HK["香港云服务器"]
|
||||||
|
Out_HK --> Mihomo["mihomo<br/>(核心路由分流)"]
|
||||||
|
Mihomo -->|"动态调度"| IPPool["海外高匿 IP 池 / 住宅代理"]
|
||||||
|
|
||||||
|
IPPool --> AI_APIs(("OpenAI / Anthropic<br/>原生大模型 API"))
|
||||||
|
IPPool --> TargetSites(("海外社媒 / 加密行情源"))
|
||||||
|
end
|
||||||
|
|
||||||
|
Gateway -.->|"流量分发"| Local_Services(("本地私有云集群<br/>(WSL + VM)"))
|
||||||
|
Local_Services -.->|"出站抓取请求"| Outbound_Network
|
||||||
|
|
||||||
|
%% 样式美化
|
||||||
|
style Inbound_Network fill:#e3f2fd,stroke:#2196f3,stroke-width:2px
|
||||||
|
style Outbound_Network fill:#fff8e1,stroke:#ffc107,stroke-width:2px
|
||||||
|
style Gateway fill:#eceff1,stroke:#607d8b,stroke-width:2px
|
||||||
|
```
|
||||||
|
## 三、 核心业务数据流图
|
||||||
|
|
||||||
|
### 3.1 小红书自动采集与口碑分析链路
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart TD
|
flowchart TD
|
||||||
subgraph Client["1. 交互与编排层"]
|
subgraph Client["1. 交互与编排层"]
|
||||||
@@ -46,7 +214,40 @@ flowchart TD
|
|||||||
B --> P[最终呈现在用户界面]
|
B --> P[最终呈现在用户界面]
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
### 2.2 自动化元数据治理
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
%% ================= 1. 公网入站穿透链路 =================
|
||||||
|
subgraph Inbound_Network ["1. 公网入站穿透链路 (Inbound)"]
|
||||||
|
User(("外部访问用户")) --> Domain["自定义域名 (aibi.chat)"]
|
||||||
|
Domain --> In_HK["香港云服务器<br/>(Nginx)"]
|
||||||
|
In_HK -- "FRP 内网穿透隧道" --> Local_FRPC["本地局域网 frpc"]
|
||||||
|
Local_FRPC --> Gateway["本地 API 网关 / Nginx"]
|
||||||
|
end
|
||||||
|
|
||||||
|
%% ================= 2. 专属出海与反爬链路 =================
|
||||||
|
subgraph Outbound_Network ["2. 专属出海与反爬代理链路 (Outbound)"]
|
||||||
|
DevTools(["Claude / Gemini<br/>(AI 开发终端)"]) --> V2Ray["本地 v2ray 客户端 / 网关"]
|
||||||
|
ShadowBot(["影刀 RPA 节点<br/>(社媒无头采集)"]) --> V2Ray
|
||||||
|
Jupyter(["Jupyter / Python 脚本<br/>(API 轮询抓取)"]) --> V2Ray
|
||||||
|
|
||||||
|
V2Ray -->|"透明代理 / 流量加密"| Out_Tencent["阿里云高速中转专线"]
|
||||||
|
Out_Tencent --> Out_HK["香港云服务器"]
|
||||||
|
Out_HK --> Mihomo["mihomo<br/>(核心路由分流)"]
|
||||||
|
Mihomo -->|"动态调度"| IPPool["海外高匿 IP 池 / 住宅代理"]
|
||||||
|
|
||||||
|
IPPool --> AI_APIs(("OpenAI / Anthropic<br/>原生大模型 API"))
|
||||||
|
IPPool --> TargetSites(("海外社媒 / 加密行情源"))
|
||||||
|
end
|
||||||
|
|
||||||
|
Gateway -.->|"流量分发"| Local_Services(("本地私有云集群<br/>(WSL + VM)"))
|
||||||
|
Local_Services -.->|"出站抓取请求"| Outbound_Network
|
||||||
|
|
||||||
|
%% 样式美化
|
||||||
|
style Inbound_Network fill:#e3f2fd,stroke:#2196f3,stroke-width:2px
|
||||||
|
style Outbound_Network fill:#fff8e1,stroke:#ffc107,stroke-width:2px
|
||||||
|
style Gateway fill:#eceff1,stroke:#607d8b,stroke-width:2px
|
||||||
|
```
|
||||||
|
### 3.2 自动化元数据治理与标注链路
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart TD
|
flowchart TD
|
||||||
%% 阶段 1:预处理
|
%% 阶段 1:预处理
|
||||||
@@ -102,4 +303,79 @@ flowchart TD
|
|||||||
style S fill:#f5f5f5,stroke:#9e9e9e,stroke-dasharray: 5 5,color:#757575
|
style S fill:#f5f5f5,stroke:#9e9e9e,stroke-dasharray: 5 5,color:#757575
|
||||||
style T fill:#f5f5f5,stroke:#9e9e9e,stroke-dasharray: 5 5,color:#757575
|
style T fill:#f5f5f5,stroke:#9e9e9e,stroke-dasharray: 5 5,color:#757575
|
||||||
```
|
```
|
||||||
|
### 3.3 加密货币实时监控与湖仓一体链路
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
%% 阶段 1:数据采集层
|
||||||
|
subgraph Ingestion ["1. 数据采集层 (Data Ingestion)"]
|
||||||
|
A["Python 定时爬虫<br/>(CoinGecko API)"] -->|"定时轮询(每60秒)"| B[(Kafka: crypto_market)]
|
||||||
|
C["Binance 交易流接入<br/>(模拟/真实 WebSocket)"] -->|高并发逐笔交易| D[(Kafka: binance_trades)]
|
||||||
|
end
|
||||||
|
|
||||||
|
%% 阶段 2:准实时 ODS 层 (Airflow + Spark)
|
||||||
|
subgraph BatchODS ["2. 准实时 ODS 层 (Spark Structured Streaming)"]
|
||||||
|
Airflow(["Airflow 任务调度<br/>(crypto_realtime_pipeline)"]) -->|触发提交作业| SparkETL["PySpark ETL 作业<br/>(spark-submit)"]
|
||||||
|
B -->|订阅大盘行情流| SparkETL
|
||||||
|
SparkETL -->|"Schema解析映射<br/>追加 etl_time 字段"| SparkJDBC["JDBC foreachBatch<br/>微批写入 (Append)"]
|
||||||
|
SparkJDBC --> MySQL[("MySQL ODS 层<br/>(crypto_db.coin_market_data)")]
|
||||||
|
end
|
||||||
|
|
||||||
|
%% 阶段 3:实时计算与湖仓一体 (Flink + Paimon)
|
||||||
|
subgraph FlinkProcessing ["3. 实时计算与数据湖层 (Stream & Lakehouse)"]
|
||||||
|
D --> E[数据反序列化与 Watermark 分配]
|
||||||
|
|
||||||
|
%% 核心业务 1 & 2:实时数仓链路
|
||||||
|
E -->|按币种 KeyBy| F{Flink CEP 风控引擎}
|
||||||
|
F -->|"规则: 价格大跌 + 巨鲸砸盘"| G["Whale Dump 预警生成"]
|
||||||
|
|
||||||
|
E -->|"5分钟滑动窗口<br/>(步长10秒)"| H["资金净流入 (Net Flow) 聚合计算"]
|
||||||
|
H --> I[定时触发 Process 排序]
|
||||||
|
I --> J["Top N 资产榜单生成"]
|
||||||
|
|
||||||
|
%% 核心业务 3:实时入湖链路
|
||||||
|
D -->|消费高频交易流| FlinkSQL["Flink SQL 作业<br/>(PaimonIngestionJob)"]
|
||||||
|
FlinkSQL -->|"Append-Only 分区写入<br/>(Checkpoint 触发提交)"| Paimon[("Apache Paimon 数据湖<br/>(底层存储: MinIO / S3)")]
|
||||||
|
end
|
||||||
|
|
||||||
|
%% 阶段 4:实时数仓层 (Doris)
|
||||||
|
subgraph DorisDW ["4. 实时数仓层 (Apache Doris)"]
|
||||||
|
G -->|"Flink Doris Sink<br/>(Stream Load)"| K[("Doris: whale_alerts<br/>巨鲸预警表")]
|
||||||
|
J -->|"Flink Doris Sink<br/>(Stream Load)"| L[("Doris: binance_topn_assets<br/>热门资产榜单表")]
|
||||||
|
MySQL -.->|后续规划: 联邦查询/同步| M[("Doris: crypto_market<br/>大盘行情表")]
|
||||||
|
end
|
||||||
|
|
||||||
|
%% 阶段 5:BI 报表层 (待开发)
|
||||||
|
subgraph BI ["5. BI 报表与可视化层"]
|
||||||
|
K -.->|秒级实时告警展示| N(["DataEase 实时监控大屏"])
|
||||||
|
L -.->|热点资产轮播| N
|
||||||
|
|
||||||
|
K -.->|多维历史风控钻取| O(["PowerBI 深度风控分析报表"])
|
||||||
|
L -.->|趋势与相关性分析| O
|
||||||
|
M -.->|宏观市场数据联动| O
|
||||||
|
Paimon -.->|海量交易明细离线探查| O
|
||||||
|
end
|
||||||
|
|
||||||
|
%% 样式美化
|
||||||
|
style A fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px
|
||||||
|
style C fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px
|
||||||
|
style B fill:#fff3e0,stroke:#ff9800,stroke-width:2px
|
||||||
|
style D fill:#fff3e0,stroke:#ff9800,stroke-width:2px
|
||||||
|
|
||||||
|
style Airflow fill:#f3e5f5,stroke:#ce93d8,stroke-width:2px
|
||||||
|
style SparkETL fill:#fff9c4,stroke:#fbc02d,stroke-width:2px
|
||||||
|
style SparkJDBC fill:#fff9c4,stroke:#fbc02d,stroke-width:2px
|
||||||
|
style MySQL fill:#e3f2fd,stroke:#1e88e5,stroke-width:2px
|
||||||
|
|
||||||
|
style F fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
|
||||||
|
style H fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
|
||||||
|
style FlinkSQL fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
|
||||||
|
style Paimon fill:#e0f7fa,stroke:#00bcd4,stroke-width:2px
|
||||||
|
|
||||||
|
style K fill:#ede7f6,stroke:#673ab7,stroke-width:2px
|
||||||
|
style L fill:#ede7f6,stroke:#673ab7,stroke-width:2px
|
||||||
|
|
||||||
|
%% 规划中模块使用灰色虚线
|
||||||
|
style BI stroke-dasharray: 5 5, stroke:#9e9e9e
|
||||||
|
style N fill:#f5f5f5,stroke:#9e9e9e,stroke-dasharray: 5 5,color:#757575
|
||||||
|
style O fill:#f5f5f5,stroke:#9e9e9e,stroke-dasharray: 5 5,color:#757575
|
||||||
|
```
|
||||||
Reference in new issue
Block a user