分布式微服務--ZooKeeper的客戶端常用命令 Java API 操作

一、ZooKeeper 客戶端常用命令

1. 啟動與退出

bin/zkCli.sh -server 127.0.0.1:2181  # 連接客戶端
quit                                  # 退出客戶端

2. 節點操作

# 查看子節點
ls /
ls -s /
ls /app# 查看節點詳細信息
ls2 /app
stat /app
# 創建節點
create /node1 "hello"          # 持久節點
create -e /node2 "temp"        # 臨時節點
create -s /node3 "seq"         # 順序節點
create -e -s /node4 "tempSeq"  # 臨時順序節點創建node1下的子節點,不能node1和node1一起創建,必須創建了node1才能執行下面的否則報錯
create /node1/node11 "hello1"  #子節點
# 獲取/修改數據
get /node1
set /node1 "world"
# 刪除節點
delete /node1   # 刪除無子節點的
deleteall /節點path #刪除帶有子節點的節點
rmr /node1      # 遞歸刪除

3. Watch 監聽

get /node1 true   # 監聽數據變化
ls / true         # 監聽子節點變化

?? 監聽是一次性的,觸發后失效。


4. ACL 權限控制

getAcl /node1
setAcl /node1 world:anyone:rw

權限:r=讀,w=寫,c=創建,d=刪除,a=管理。
模式:world(所有人)、authdigest(用戶名密碼)、ip


5. 輔助命令

help        # 查看幫助
history     # 查看歷史命令
redo <id>   # 重做歷史命令

二、ZooKeeper Java API 操作

1. 原生 API(org.apache.zookeeper.ZooKeeper)

需要的依賴

<!-- 原生 ZooKeeper 依賴 -->
<dependency><groupId>org.apache.zookeeper</groupId><artifactId>zookeeper</artifactId><version>3.8.3</version>
</dependency>

代碼實現

import org.apache.zookeeper.*;public class ZkDemo {public static void main(String[] args) throws Exception {// 1. 連接 ZooKeeperZooKeeper zk = new ZooKeeper("127.0.0.1:2181", 30000, event -> {System.out.println("收到事件:" + event);});// 2. 創建節點zk.create("/node1", "hello".getBytes(),ZooDefs.Ids.OPEN_ACL_UNSAFE,CreateMode.PERSISTENT);// 3. 獲取節點數據byte[] data = zk.getData("/node1", false, null);System.out.println("節點數據:" + new String(data));// 4. 修改節點數據zk.setData("/node1", "world".getBytes(), -1);// 5. 獲取子節點System.out.println("子節點:" + zk.getChildren("/", false));// 6. 刪除節點zk.delete("/node1", -1);// 7. 關閉連接zk.close();}
}

2. Curator 客戶端(推薦,簡化 API

需要的依賴

 <!--curator-->
<!-- Curator(如果你要用 Curator 封裝的API) -->
<dependency><groupId>org.apache.curator</groupId><artifactId>curator-framework</artifactId><version>4.0.0</version>
</dependency><dependency><groupId>org.apache.curator</groupId><artifactId>curator-recipes</artifactId><version>4.0.0</version>
</dependency>

?? curator-frameworkcurator-recipes 內部會依賴 zookeeper,所以一般不用單獨引入 zookeeper 依賴,除非你要控制 zk 版本。

2.1 使用Curator實現增刪改查的api

Curator 方法ZooKeeper CLI 類似命令
create().forPath("/node")create /node
getData().forPath("/node")get /node
getChildren().forPath("/")ls /
getData().storingStatIn(stat)ls -s /node
setData().forPath("/node", data)set /node data
delete().forPath("/node")delete /node
delete().deletingChildrenIfNeeded()rmr /node

代碼實現:

public class CuratorTest {private CuratorFramework client; // Curator 客戶端對象/*** 建立連接*/@Beforepublic void testConnect() {/*** @param connectString       連接字符串。zk server 地址和端口 "127.0.0.1:2181,127.0.0.1:2181"* @param sessionTimeoutMs    會話超時時間 單位ms* @param connectionTimeoutMs 連接超時時間 單位ms* @param retryPolicy         重試策略*//* //重試策略RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000,10);//1.第一種方式CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.149.135:2181",60 * 1000, 15 * 1000, retryPolicy);*///重試策略:初始等待3秒,重試10次RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000, 10);//2.第二種方式:通過builder方式構建客戶端//CuratorFrameworkFactory.builder();client = CuratorFrameworkFactory.builder().connectString("127.0.0.1:2181") // 設置ZK地址.sessionTimeoutMs(60 * 1000)           // 會話超時時間.connectionTimeoutMs(15 * 1000)        // 連接超時時間.retryPolicy(retryPolicy)              // 設置重試策略// namespace("czq")// 設置命名空間,將 "czq" 作為客戶端操作的根路徑// 這樣之后創建節點時無需每次都寫 /czq 前綴// 例如:client.create().forPath("/node11", "hello1".getBytes())// 實際會在 ZooKeeper 中創建 /czq/node11 節點.namespace("czq")   .build();//開啟連接client.start();}//==============================create=============================================================================/*** 創建節點:create 持久 臨時 順序 數據* 1. 基本創建 :create().forPath("")* 2. 創建節點 帶有數據:create().forPath("",data)* 3. 設置節點的類型:create().withMode().forPath("",data)* 4. 創建多級節點  /app1/p1 :create().creatingParentsIfNeeded().forPath("",data)*/@Testpublic void testCreate() throws Exception {//2. 創建節點 帶有數據//如果創建節點,沒有指定數據,則默認將當前客戶端的ip作為數據存儲String path = client.create().forPath("/app2", "hehe".getBytes());System.out.println(path);}@Testpublic void testCreate2() throws Exception {//1. 基本創建//如果創建節點,沒有指定數據,則默認將當前客戶端的ip作為數據存儲String path = client.create().forPath("/app1");System.out.println(path);}@Testpublic void testCreate3() throws Exception {//3. 設置節點的類型//默認類型:持久化String path = client.create().withMode(CreateMode.EPHEMERAL).forPath("/app3");System.out.println(path);}@Testpublic void testCreate4() throws Exception {//4. 創建多級節點  /app1/p1//creatingParentsIfNeeded():如果父節點不存在,則創建父節點String path = client.create().creatingParentsIfNeeded().forPath("/app4/p1");System.out.println(path);}//===========================get================================================================================/*** 查詢節點:* 1. 查詢數據:get: getData().forPath()* 2. 查詢子節點: ls /: getChildren().forPath()* 3. 查詢節點狀態信息:ls -s /:getData().storingStatIn(狀態對象).forPath()*/@Testpublic void testGet1() throws Exception {//1. 查詢數據:getbyte[] data = client.getData().forPath("/app1");System.out.println(new String(data));}@Testpublic void testGet2() throws Exception {// 2. 查詢子節點: ls /List<String> path = client.getChildren().forPath("/");System.out.println(path);}@Testpublic void testGet3() throws Exception {Stat status = new Stat(); // 狀態對象,用來存儲節點元信息System.out.println(status);//3. 查詢節點狀態信息:ls -s ///.storingStatIn(status)代表存儲狀態信息到status對象中client.getData().storingStatIn(status).forPath("/app1");System.out.println(status);}//===========================set================================================================================/*** 修改數據* 1. 基本修改數據:setData().forPath()* 2. 根據版本修改: setData().withVersion().forPath()* * version 是通過查詢出來的。目的就是為了讓其他客戶端或者線程不干擾我。** @throws Exception*/@Testpublic void testSet() throws Exception {// 基本修改節點數據client.setData().forPath("/app1", "itcast".getBytes());}@Testpublic void testSetForVersion() throws Exception {Stat status = new Stat();//3. 查詢節點狀態信息:ls -s//.storingStatIn(status)代表存儲狀態信息到status對象中client.getData().storingStatIn(status).forPath("/app1");int version = status.getVersion();//查詢出來的節點版本System.out.println(version);// 根據版本修改節點數據,保證并發安全client.setData().withVersion(version).forPath("/app1", "hehe".getBytes());}//===========================delete================================================================================/*** 刪除節點: delete deleteall* 1. 刪除單個節點:delete().forPath("/app1");* 2. 刪除帶有子節點的節點:delete().deletingChildrenIfNeeded().forPath("/app1");* 3. 必須成功的刪除:為了防止網絡抖動。本質就是重試。  client.delete().guaranteed().forPath("/app2");* 4. 回調:inBackground* @throws Exception*/@Testpublic void testDelete() throws Exception {// 1. 刪除單個節點client.delete().forPath("/app1");}@Testpublic void testDelete2() throws Exception {//2. 刪除帶有子節點的節點client.delete().deletingChildrenIfNeeded().forPath("/app4");}@Testpublic void testDelete3() throws Exception {//3. 必須成功的刪除(自動重試保證刪除成功)client.delete().guaranteed().forPath("/app2");}@Testpublic void testDelete4() throws Exception {//4. 回調異步刪除client.delete().guaranteed().inBackground(new BackgroundCallback(){@Overridepublic void processResult(CuratorFramework client, CuratorEvent event) throws Exception {System.out.println("我被刪除了~");System.out.println(event);}}).forPath("/app1");}@Afterpublic void close() {// 關閉客戶端連接if (client != null) {client.close();}}}
2.2 使用Curator實現Watch事件監聽的api
(1)Curator 2.x/4.x 常見的寫法
  • 使用者三個類(NodeCachePathChildrenCacheTreeCache

    • NodeCache(監聽一個節點自己)

    • PathChildrenCache(監聽某個節點的直接子節點)

    • TreeCache(監聽某個節點和所有子節點)

????????Curator 5.x 開始,這三個類(NodeCachePathChildrenCacheTreeCache)已經被 統一棄用,官方推薦用 CuratorCache 來代替。

監聽器監聽范圍典型應用場景
NodeCache單個節點的數據變化監聽配置節點變化
PathChildrenCache子節點的增刪改,不監聽本節點監聽服務節點上下線
TreeCache節點及其所有子節點全量配置或服務樹監控

代碼實現? ??

public class CuratorWatcherTest {private CuratorFramework client; // Curator 客戶端對象/*** 建立連接*/@Beforepublic void testConnect() {/*** @param connectString       連接字符串。zk server 地址和端口 "127.0.0.1:2181,127.0.0.1:2181"* @param sessionTimeoutMs    會話超時時間 單位ms* @param connectionTimeoutMs 連接超時時間 單位ms* @param retryPolicy         重試策略*//* //重試策略RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000,10);//1.第一種方式CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.149.135:2181",60 * 1000, 15 * 1000, retryPolicy);*///重試策略:初始等待3秒,重試10次RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000, 10);//2.第二種方式:通過builder方式構建客戶端//CuratorFrameworkFactory.builder();client = CuratorFrameworkFactory.builder().connectString("127.0.0.1:2181") // 設置ZK地址.sessionTimeoutMs(60 * 1000)           // 會話超時時間.connectionTimeoutMs(15 * 1000)        // 連接超時時間.retryPolicy(retryPolicy)              // 設置重試策略// namespace("czq")// 設置命名空間,將 "czq" 作為客戶端操作的根路徑// 這樣之后創建節點時無需每次都寫 /czq 前綴// 例如:client.create().forPath("/node11", "hello1".getBytes())// 實際會在 ZooKeeper 中創建 /czq/node11 節點.namespace("czq")   .build();//開啟連接client.start();}@Afterpublic void close() {if (client != null) {client.close(); // 關閉客戶端連接}}/*** 演示 NodeCache:給指定一個節點注冊監聽器* NodeCache 只能監聽某個具體節點的數據變化(新增/修改/刪除)*/@Testpublic void testNodeCache() throws Exception {// 1. 創建 NodeCache 對象,監聽 /app1 節點final NodeCache nodeCache = new NodeCache(client,"/app1");// 2. 注冊監聽器nodeCache.getListenable().addListener(new NodeCacheListener() {@Overridepublic void nodeChanged() throws Exception {System.out.println("節點變化了~");// 獲取修改后的節點數據(如果節點被刪除,這里可能會是 null)byte[] data = nodeCache.getCurrentData().getData();System.out.println(new String(data));}});// 3. 開啟監聽// 參數 true 表示在啟動監聽時,立即加載一次緩存數據nodeCache.start(true);// 阻塞住主線程,保證監聽器一直生效while (true){}}/*** 演示 PathChildrenCache:監聽某個節點的所有子節點* 只能監聽子節點的變化(新增/修改/刪除),不能監聽當前節點本身*/@Testpublic void testPathChildrenCache() throws Exception {// 1. 創建 PathChildrenCache 監聽對象// 參數 true 表示對子節點數據進行緩存PathChildrenCache pathChildrenCache = new PathChildrenCache(client,"/app2",true);// 2. 綁定監聽器pathChildrenCache.getListenable().addListener(new PathChildrenCacheListener() {@Overridepublic void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception {System.out.println("子節點變化了~");System.out.println(event);// 監聽子節點數據變更PathChildrenCacheEvent.Type type = event.getType();if(type.equals(PathChildrenCacheEvent.Type.CHILD_UPDATED)){System.out.println("數據變了!!!");byte[] data = event.getData().getData();System.out.println(new String(data));}}});// 3. 開啟監聽pathChildrenCache.start();// 阻塞主線程,保證監聽器一直生效while (true){}}/*** 演示 TreeCache:監聽某個節點自己和它的所有子節點* 相當于 NodeCache + PathChildrenCache 的結合體*/@Testpublic void testTreeCache() throws Exception {// 1. 創建 TreeCache 監聽對象TreeCache treeCache = new TreeCache(client,"/app2");// 2. 注冊監聽器treeCache.getListenable().addListener(new TreeCacheListener() {@Overridepublic void childEvent(CuratorFramework client, TreeCacheEvent event) throws Exception {System.out.println("節點變化了");System.out.println(event);}});// 3. 開啟監聽treeCache.start();// 阻塞主線程,保證監聽器一直生效while (true){}}
}

(2)Curator 5.x以上常見的寫法

?Curator 5.x 開始,這三個類(NodeCachePathChildrenCacheTreeCache)已經被 統一棄用,官方推薦用 CuratorCache 來代替。(新版本)

方法名對應舊API監聽范圍應用場景
testCuratorCacheNodeNodeCache單節點數據變化單個配置項
testCuratorCacheChildrenPathChildrenCache子節點(不含父節點)服務注冊/發現
testCuratorCacheTreeTreeCache節點 + 全部子節點配置中心、全量監控

代碼實現?

public class CuratorWatcherTest {// Curator 客戶端對象,用于操作 ZooKeeperprivate CuratorFramework client;/*** 建立連接*/@Beforepublic void testConnect() {/*** @param connectString       連接字符串。zk server 地址和端口 "127.0.0.1:2181,127.0.0.1:2181"* @param sessionTimeoutMs    會話超時時間 單位ms* @param connectionTimeoutMs 連接超時時間 單位ms* @param retryPolicy         重試策略*//* //重試策略RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000,10);//1.第一種方式CuratorFramework client = CuratorFrameworkFactory.newClient("192.168.149.135:2181",60 * 1000, 15 * 1000, retryPolicy);*///重試策略:初始等待3秒,重試10次RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000, 10);//2.第二種方式:通過builder方式構建客戶端//CuratorFrameworkFactory.builder();client = CuratorFrameworkFactory.builder().connectString("127.0.0.1:2181") // 設置ZK地址.sessionTimeoutMs(60 * 1000)           // 會話超時時間.connectionTimeoutMs(15 * 1000)        // 連接超時時間.retryPolicy(retryPolicy)              // 設置重試策略// namespace("czq")// 設置命名空間,將 "czq" 作為客戶端操作的根路徑// 這樣之后創建節點時無需每次都寫 /czq 前綴// 例如:client.create().forPath("/node11", "hello1".getBytes())// 實際會在 ZooKeeper 中創建 /czq/node11 節點.namespace("czq")   .build();//開啟連接client.start();}@Afterpublic void close() {// 測試完成后關閉客戶端,釋放資源if (client != null) {client.close();}}// ==============================替代 NodeCache=============================================================================/*** 1. 監聽單個節點(替代 NodeCache)* 使用 CuratorCache + CuratorCacheListener 來代替舊的 NodeCache*/@Testpublic void testCuratorCacheNode() throws Exception {// 創建 CuratorCache,監聽 /app1 節點CuratorCache cache = CuratorCache.build(client, "/app1");// 定義監聽器,使用 forNodeCache 模式,只監聽該節點數據變化CuratorCacheListener listener = CuratorCacheListener.builder().forNodeCache(new Runnable() {@Overridepublic void run() {System.out.println("節點變化了~");try {// 獲取節點最新數據并打印byte[] data = client.getData().forPath("/app1");System.out.println("最新數據:" + new String(data));} catch (Exception e) {e.printStackTrace();}}}).build();// 將監聽器綁定到緩存cache.listenable().addListener(listener);// 開啟緩存(監聽)cache.start();// 阻塞主線程,保證監聽器一直運行Thread.sleep(Long.MAX_VALUE);}// ==============================替代 PathChildrenCache=============================================================================/*** 2. 監聽子節點變化(替代 PathChildrenCache)* 使用 CuratorCache + PathChildrenCacheListener 監聽某節點的所有子節點*/@Testpublic void testCuratorCacheChildren() throws Exception {// 創建 CuratorCache,監聽 /app2 節點的子節點CuratorCache cache = CuratorCache.build(client, "/app2");// 定義監聽器,forPathChildrenCache 表示只監聽子節點的變化CuratorCacheListener listener = CuratorCacheListener.builder().forPathChildrenCache("/app2", client, new PathChildrenCacheListener() {@Overridepublic void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception {System.out.println("子節點變化了~");System.out.println("類型:" + event.getType());if (event.getData() != null) {// 打印節點路徑和數據System.out.println("節點:" + event.getData().getPath());System.out.println("數據:" + new String(event.getData().getData()));}}}).build();// 將監聽器綁定到緩存cache.listenable().addListener(listener);// 開啟緩存cache.start();// 阻塞主線程,保證監聽器一直運行Thread.sleep(Long.MAX_VALUE);}// ==============================替代 TreeCache=============================================================================/*** 3. 監聽節點及其所有子節點(替代 TreeCache)* 使用 CuratorCache + TreeCacheListener 監聽整個節點樹*/@Testpublic void testCuratorCacheTree() throws Exception {// 創建 CuratorCache,監聽 /app2 節點及其子節點CuratorCache cache = CuratorCache.build(client, "/app2");// 定義監聽器,forTreeCache 表示節點本身和子節點都監聽CuratorCacheListener listener = CuratorCacheListener.builder().forTreeCache(client, new TreeCacheListener() {@Overridepublic void childEvent(CuratorFramework client, TreeCacheEvent event) throws Exception {System.out.println("樹節點變化了~");System.out.println("類型:" + event.getType());if (event.getData() != null) {// 打印節點路徑和數據System.out.println("節點:" + event.getData().getPath());System.out.println("數據:" + new String(event.getData().getData()));}}}).build();// 將監聽器綁定到緩存cache.listenable().addListener(listener);// 開啟緩存cache.start();// 阻塞主線程,保證監聽器一直運行Thread.sleep(Long.MAX_VALUE);}}

2.3 實現分布式鎖

?這里不做過多講解詳細去看我的另一篇博客:分布式微服務--ZooKeeper作為分布式鎖-CSDN博客

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

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

相關文章

PID控制技術深度剖析:從基礎原理到高級應用(六)

PID 控制技術深度剖析&#xff1a;從基礎原理到高級應用 最近在項目中有要開始進行PID的控制了&#xff0c;隔了很久沒有做PID控制的東西了&#xff0c;所以想正好借這個機會&#xff0c;溫習一下和PID有關的內容。 系列文章目錄 PID控制技術深度剖析&#xff1a;從基礎原理到…

PCL關鍵點提取

1. 核心概念:什么是關鍵點?為什么需要關鍵點? 關鍵詞:信息冗余、計算效率、突出特征 “想象一下,我們有一片密集的點云,包含幾十萬個點。如果我們直接在每個點上都計算像FPFH這樣的局部特征,計算量會非常大,極其耗時,而且很多點所處的區域(比如平坦的墻面)特征非常…

vcruntime140_1.dll缺失怎么辦?暗黑破壞神游戲vcruntime140_1.dll缺失的4個解決方法

你是否遇到過這樣的情況&#xff1a; 玩《暗黑破壞神》《英雄聯盟》《GTA5》的時候&#xff0c;游戲忽然閃退&#xff0c;彈窗提示&#xff1a; “無法啟動&#xff0c;因為計算機中丟失 vcruntime140_1.dll” 這不是某一個游戲的問題&#xff0c;而是 Windows 系統運行庫缺失…

遷移學習-ResNet

好的&#xff0c;我將為你撰寫一篇關于ResNet遷移學習的技術博客。以下是博客的主要內容&#xff1a;ResNet遷移學習&#xff1a;原理、實踐與效果深度解析1. 深度學習中遷移學習的重要性與ResNet的獨特價值遷移學習&#xff08;Transfer Learning&#xff09;是機器學習中一種…

極大似然估計與概率圖模型:統計建模的黃金組合

在數據驅動的時代&#xff0c;如何從海量信息中提取有價值的規律&#xff1f;統計建模提供了兩大核心工具&#xff1a;極大似然估計&#xff08;MLE&#xff09;幫助我們根據數據推斷模型參數&#xff0c;而概率圖模型&#xff08;PGM&#xff09;則通過圖形化語言描述變量間的…

解析豆科系統發育沖突原因

生命之樹是進化生物學的核心&#xff0c;但由于 不完全譜系排序&#xff08;ILS&#xff09;、雜交 和 多倍化 等復雜過程&#xff0c;解析深層且難解的系統發育關系仍然是一個挑戰。**豆科&#xff08;Leguminosae&#xff09;**這一物種豐富且生態多樣化家族的理解&#xff0…

從Java全棧到前端框架:一次真實的面試對話與技術解析

從Java全棧到前端框架&#xff1a;一次真實的面試對話與技術解析 在一次真實的面試中&#xff0c;一位擁有多年經驗的Java全棧開發工程師&#xff0c;被問及了多個涉及前后端技術棧的問題。他的回答既專業又自然&#xff0c;展現了扎實的技術功底和豐富的實戰經驗。 面試官&…

阿瓦隆 A1566HA 2U 480T礦機參數解析:性能與能效深入分析

在礦機行業&#xff0c;AvaLON是一個備受關注的品牌&#xff0c;尤其在比特幣&#xff08;BTC&#xff09;和比特幣現金&#xff08;BCH&#xff09;挖礦領域&#xff0c;憑借其強勁的算力和高效能效&#xff0c;在市場中占據了一席之地。本文將針對阿瓦隆 A1566HA 2U 480T礦機…

小迪安全v2023學習筆記(七十八講)—— 數據庫安全RedisCouchDBH2database未授權CVE

文章目錄前記服務攻防——第七十八天數據庫安全&Redis&CouchDB&H2database&未授權訪問&CVE漏洞前置知識復現環境服務判斷對象類別利用方法數據庫應用 - Redis-未授權訪問&CVE漏洞前置知識案例演示沙箱繞過RCE - CVE-2022-0543未授權訪問 - CNVD-2019-2…

HTML + CSS 創建圖片倒影的 5 種方法

HTML CSS 創建圖片倒影的 5 種方法 目標&#xff1a;掌握多種生成“圖片倒影 / Reflection”效果的實現思路&#xff0c;理解兼容性、性能差異與最佳實踐&#xff0c;方便在真實業務&#xff08;商品展示、相冊、登陸頁面視覺強化&#xff09;中安全使用。 總覽對比 方法核心…

一個文件被打開io流和不打卡 inode

1. 磁盤 最小基本單位 扇區 機器磁盤的io效率 &#xff08;讀和取&#xff09;2. 文件系統 對磁盤分區 &#xff0c;最小的文件單位塊組&#xff0c;快組內部已經劃分好區域&#xff0c;巴拉巴拉&#xff0c;總之&#xff0c;每次使用數據&#xff0c;以操作系統的處理都是塊級…

ThermoSeek:熱穩定蛋白數據庫

這篇論文提出了ThermoSeek&#xff0c;一個綜合性的網絡資源&#xff0c;用于分析來自嗜熱和嗜冷物種的蛋白質序列和結構。具體來說&#xff0c;數據收集&#xff1a;從美國國家生物技術信息中心&#xff08;NCBI&#xff09;的基因組數據庫中收集了物種的分類ID&#xff0c;并…

leetcode算法刷題的第二十七天

1.leetcode 56.合并區間 題目鏈接 class Solution { public:static bool cmp(const vector<int>& a,const vector<int>& b){return a[0]<b[0];}vector<vector<int>> merge(vector<vector<int>>& intervals) {vector<v…

解決 Apache/WAF SSL 證書鏈不完整導致的 PKIX path building failed 問題

文章目錄解決 Apache/WAF SSL 證書鏈不完整導致的 PKIX path building failed 問題為什么會出現證書鏈錯誤&#xff1f;常見場景直連服務器正常&#xff0c;但經過 WAF 出錯Windows/Linux 下證書文件說明引入 WAF 或其他中間層&#xff1a;解決方法方法一&#xff1a;單獨配置 …

十一、標準化和軟件知識產權基礎知識

1 標準化基礎知識 1.1 基本概念 1.1.1 標準的分類 1.1.1.1 按使用范圍分類 國際標準&#xff1a;由國際組織如 ISO、IEC 制定的標準。國家標準&#xff1a;由國家標準化機構制定的標準&#xff0c;如中國的 GB&#xff0c;美國 ANSI。行業標準&#xff1a;由行業主管部門制定的…

計算機畢設選題:基于Python數據挖掘的高考志愿推薦系統

精彩專欄推薦訂閱&#xff1a;在 下方專欄&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb; &#x1f496;&#x1f525;作者主頁&#xff1a;計算機畢設木哥&#x1f525; &#x1f496; 文章目錄 一、項目介紹二…

什么是PCB工藝邊?獵板給您分享設計要點

什么是PCB工藝邊&#xff1f;獵板給您分享設計要點在PCB設計和制造領域&#xff0c;工藝邊是一個看似簡單卻至關重要的概念&#xff0c;它直接關系到生產流程的順暢性與最終產品的質量。本文將為您詳細解析PCB工藝邊的定義、作用、設計要點&#xff0c;并分享獵板PCB在高精度制…

Rustdesk搭建與客戶端修改與編譯

Rustdesk是一個開源的遠程桌面工具&#xff0c;客戶端可以自己定制修改編譯 這里主要記錄一下搭建的過程 服務端搭建 主要是參考了這篇文章&#xff0c;感覺作者分享~ 在 Linux VPS 上創建 RustDesk 服務器 - 知乎 https://zhuanlan.zhihu.com/p/1922729751656765374 這里主要…

數字人系統源碼搭建與定制化開發:從技術架構到落地實踐

隨著元宇宙、直播電商、智能客服等領域的爆發&#xff0c;數字人從概念走向商業化落地&#xff0c;其定制化需求也從 “單一形象展示” 升級為 “多場景交互能力”。本文將從技術底層出發&#xff0c;拆解數字人系統的源碼搭建邏輯&#xff0c;結合定制化開發中的核心痛點&…

2025國賽C題創新論文+代碼可視化 NIPT 的時點選擇與胎兒的異常判定

2025國賽C題創新論文代碼可視化 NIPT 的時點選擇與胎兒的異常判定基于多通道LED光譜優化的人體節律調節與睡眠質量評估模型摘要無創產前檢測&#xff08;NIPT&#xff09;通過分析孕婦血漿中胎兒游離DNA來篩查染色體異常&#xff0c;其準確性很大程度上依賴于胎兒Y染色體濃度的…