MCP 協議詳細分析一 initialize ping tools/list tools/call

MCP 協議詳細分析一 (initialize ping tools/list tools/call)

本節基于 實現一個 java 的mcp client 調用的 一個python 的mcp server 的日志,完整展示一次典型的 MCP Java SDK 通信流程、工具調用、通知機制與日志記錄,僅包含 echo-simple 和 echo-with-notifications 兩個工具,內容簡明、無省略。

2. 詳細流程圖

主程序McpAsyncClientCustomLoggingTransportHttpClientSseTransportMCP服務器創建CustomLoggingHttpClientTransport委托HTTP傳輸層構建McpAsyncClient調用initialize()發送initialize請求POST /sse/ (initialize)HTTP POST請求返回初始化響應傳遞響應處理初始化響應初始化完成發送initialized通知POST /sse/ (initialized)HTTP POST請求調用tools/list發送tools/list請求POST /sse/ (tools/list)HTTP POST請求返回工具列表傳遞響應處理工具列表響應工具列表返回調用callTool(echo-with-notifications)發送tools/call請求POST /sse/ (tools/call)HTTP POST請求發送多條notifications/message傳遞通知處理通知觸發loggingConsumer發送tools/call響應傳遞最終響應處理最終響應返回工具調用結果調用closeGracefully()關閉連接關閉HTTP連接關閉SSE連接主程序McpAsyncClientCustomLoggingTransportHttpClientSseTransportMCP服務器

3. 詳細日志記錄(按請求分組)

請求:initialize

=== MCP DEMO CLIENT WITH NOTIFICATIONS AND SAMPLING ===
Connecting to MCP server at: http://localhost:8080
=========================================================
Custom logging HTTP transport created--- Initializing client ---
22:13:36.494 [main] DEBUG i.m.client.McpAsyncClient - Initialization process started
=== ESTABLISHING MCP CONNECTION ===
Target Server URL: http://localhost:8080
SSE Endpoint: http://localhost:8080/sse/
Setting up SSE connection for MCP communication
Handler configured for bidirectional message processing
=====================================
22:13:36.601 [main] DEBUG i.m.spec.McpClientSession - Sending message for method initialize
=== SENDING MCP MESSAGE ===
Target URL: http://localhost:8080/sse/
HTTP Method: POST
Content-Type: application/json
User-Agent: MCP-Java-SDK-Debug/1.0
Authorization: Bearer abcd1234
Message type: JSONRPCRequest
Message content: {"jsonrpc":"2.0","method":"initialize","id":"5ed91d29-0","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"Spring AI MCP Client","version":"0.3.1"}}}
===========================
=== MESSAGE SENT SUCCESSFULLY ===
HTTP POST to http://localhost:8080/sse/ completed
=================================
22:13:36.665 [HttpClient-1-Worker-1] DEBUG i.m.spec.McpSchema - Received JSON message: {"jsonrpc":"2.0","id":"5ed91d29-0","result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"prompts":{"listChanged":true},"resources":{"subscribe":false,"listChanged":true},"tools":{"listChanged":true}},"serverInfo":{"name":"python mcp server","version":"1.10.1"}}}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCResponse
Message content: {"jsonrpc":"2.0","id":"5ed91d29-0","result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"prompts":{"listChanged":true},"resources":{"subscribe":false,"listChanged":true},"tools":{"listChanged":true}},"serverInfo":{"name":"python mcp server","version":"1.10.1"}}}
============================
22:13:36.715 [HttpClient-1-Worker-1] DEBUG i.m.spec.McpClientSession - Received Response: JSONRPCResponse[jsonrpc=2.0, id=5ed91d29-0, result={protocolVersion=2024-11-05, capabilities={experimental={}, prompts={listChanged=true}, resources={subscribe=false, listChanged=true}, tools={listChanged=true}}, serverInfo={name=python mcp server, version=1.10.1}}, error=null]
22:13:36.739 [HttpClient-1-Worker-1] INFO  i.m.client.McpAsyncClient - Server response with Protocol: 2024-11-05, Capabilities: ServerCapabilities[completions=null, experimental={}, logging=null, prompts=PromptCapabilities[listChanged=true], resources=ResourceCapabilities[subscribe=false, listChanged=true], tools=ToolCapabilities[listChanged=true]], Info: Implementation[name=python mcp server, version=1.10.1] and Instructions null
=== SENDING MCP MESSAGE ===
Target URL: http://localhost:8080/sse/
HTTP Method: POST
Content-Type: application/json
User-Agent: MCP-Java-SDK-Debug/1.0
Authorization: Bearer abcd1234
Message type: JSONRPCNotification
Message content: {"jsonrpc":"2.0","method":"notifications/initialized"}
===========================
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCResponse
=== MESSAGE SENT SUCCESSFULLY ===
HTTP POST to http://localhost:8080/sse/ completed
=================================
Response content: {"jsonrpc":"2.0","id":"5ed91d29-0","result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"prompts":{"listChanged":true},"resources":{"subscribe":false,"listChanged":true},"tools":{"listChanged":true}},"serverInfo":{"name":"python mcp server","version":"1.10.1"}}}
==============================
Client initialized successfully

請求:ping

--- Pinging server ---
22:13:36.765 [main] DEBUG i.m.client.McpAsyncClient - Joining previous initialization
22:13:36.767 [main] DEBUG i.m.spec.McpClientSession - Sending message for method ping
=== SENDING MCP MESSAGE ===
Target URL: http://localhost:8080/sse/
HTTP Method: POST
Content-Type: application/json
User-Agent: MCP-Java-SDK-Debug/1.0
Authorization: Bearer abcd1234
Message type: JSONRPCRequest
Message content: {"jsonrpc":"2.0","method":"ping","id":"5ed91d29-1"}
===========================
=== MESSAGE SENT SUCCESSFULLY ===
HTTP POST to http://localhost:8080/sse/ completed
=================================
22:13:36.773 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"jsonrpc":"2.0","id":"5ed91d29-1","result":{}}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCResponse
Message content: {"jsonrpc":"2.0","id":"5ed91d29-1","result":{}}
============================
22:13:36.775 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpClientSession - Received Response: JSONRPCResponse[jsonrpc=2.0, id=5ed91d29-1, result={}, error=null]
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCResponse
Ping successful. Response:
{ }

請求:tools/list

--- Listing tools ---
22:13:36.776 [main] DEBUG i.m.client.McpAsyncClient - Joining previous initialization
Response content: {"jsonrpc":"2.0","id":"5ed91d29-1","result":{}}
==============================
22:13:36.777 [main] DEBUG i.m.spec.McpClientSession - Sending message for method tools/list
=== SENDING MCP MESSAGE ===
Target URL: http://localhost:8080/sse/
HTTP Method: POST
Content-Type: application/json
User-Agent: MCP-Java-SDK-Debug/1.0
Authorization: Bearer abcd1234
Message type: JSONRPCRequest
Message content: {"jsonrpc":"2.0","method":"tools/list","id":"5ed91d29-2","params":{}}
===========================
=== MESSAGE SENT SUCCESSFULLY ===
HTTP POST to http://localhost:8080/sse/ completed
=================================
22:13:36.787 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"jsonrpc":"2.0","id":"5ed91d29-2","result":{"tools":[{"name":"echo-simple","description":"簡單的Echo工具:直接返回輸入的消息(不包裝JSON格式)\n\nArgs:\n    message: 要回顯的消息\n    \nReturns:\n    相同的輸入消息","inputSchema":{"properties":{"message":{"title":"Message","type":"string"}},"required":["message"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}},{"name":"echo-with-notifications","description":"帶不同級別通知的Echo工具:演示MCP日志通知功能\n\nArgs:\n    message: 要回顯的消息\n    notification_level: 通知級別\n    \nReturns:\n    處理后的消息","inputSchema":{"properties":{"message":{"description":"要回顯的消息","title":"Message","type":"string"},"notification_level":{"default":"info","description":"通知級別 (debug/info/warning/error)","title":"Notification Level","type":"string"}},"required":["message"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}}]}}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCResponse
Message content: {"jsonrpc":"2.0","id":"5ed91d29-2","result":{"tools":[{"name":"echo-simple","description":"簡單的Echo工具:直接返回輸入的消息(不包裝JSON格式)\n\nArgs:\n    message: 要回顯的消息\n    \nReturns:\n    相同的輸入消息","inputSchema":{"properties":{"message":{"title":"Message","type":"string"}},"required":["message"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}},{"name":"echo-with-notifications","description":"帶不同級別通知的Echo工具:演示MCP日志通知功能\n\nArgs:\n    message: 要回顯的消息\n    notification_level: 通知級別\n    \nReturns:\n    處理后的消息","inputSchema":{"properties":{"message":{"description":"要回顯的消息","title":"Message","type":"string"},"notification_level":{"default":"info","description":"通知級別 (debug/info/warning/error)","title":"Notification Level","type":"string"}},"required":["message"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}}]}}
============================
22:13:36.791 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpClientSession - Received Response: JSONRPCResponse[jsonrpc=2.0, id=5ed91d29-2, result={tools=[{name=echo-simple, description=簡單的Echo工具:直接返回輸入的消息(不包裝JSON格式)Args:message: 要回顯的消息Returns:相同的輸入消息, inputSchema={properties={message={title=Message, type=string}}, required=[message], type=object}, outputSchema={properties={result={title=Result, type=string}}, required=[result], title=_WrappedResult, type=object, x-fastmcp-wrap-result=true}}, {name=echo-with-notifications, description=帶不同級別通知的Echo工具:演示MCP日志通知功能Args:message: 要回顯的消息notification_level: 通知級別Returns:處理后的消息, inputSchema={properties={message={description=要回顯的消息, title=Message, type=string}, notification_level={default=info, description=通知級別 (debug/info/warning/error), title=Notification Level, type=string}}, required=[message], type=object}, outputSchema={properties={result={title=Result, type=string}}, required=[result], title=_WrappedResult, type=object, x-fastmcp-wrap-result=true}}]}, error=null]
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCResponse--- Testing Notifications Feature ---
Response content: {"jsonrpc":"2.0","id":"5ed91d29-2","result":{"tools":[{"name":"echo-simple","description":"簡單的Echo工具:直接返回輸入的消息(不包裝JSON格式)\n\nArgs:\n    message: 要回顯的消息\n    \nReturns:\n    相同的輸入消息","inputSchema":{"properties":{"message":{"title":"Message","type":"string"}},"required":["message"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}},{"name":"echo-with-notifications","description":"帶不同級別通知的Echo工具:演示MCP日志通知功能\n\nArgs:\n    message: 要回顯的消息\n    notification_level: 通知級別\n    \nReturns:\n    處理后的消息","inputSchema":{"properties":{"message":{"description":"要回顯的消息","title":"Message","type":"string"},"notification_level":{"default":"info","description":"通知級別 (debug/info/warning/error)","title":"Notification Level","type":"string"}},"required":["message"],"type":"object"},"outputSchema":{"properties":{"result":{"title":"Result","type":"string"}},"required":["result"],"title":"_WrappedResult","type":"object","x-fastmcp-wrap-result":true}}]}}
==============================

請求:tools/call(echo-with-notifications)

Request params:
{"name" : "echo-with-notifications","arguments" : {"notification_level" : "warning","message" : "測試通知功能!"}
}
22:13:36.807 [main] DEBUG i.m.client.McpAsyncClient - Joining previous initialization
22:13:36.808 [main] DEBUG i.m.spec.McpClientSession - Sending message for method tools/call
=== SENDING MCP MESSAGE ===
Target URL: http://localhost:8080/sse/
HTTP Method: POST
Content-Type: application/json
User-Agent: MCP-Java-SDK-Debug/1.0
Authorization: Bearer abcd1234
Message type: JSONRPCRequest
Message content: {"jsonrpc":"2.0","method":"tools/call","id":"5ed91d29-3","params":{"name":"echo-with-notifications","arguments":{"notification_level":"warning","message":"測試通知功能!"}}}
===========================
=== MESSAGE SENT SUCCESSFULLY ===
HTTP POST to http://localhost:8080/sse/ completed
=================================
22:13:36.820 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"method":"notifications/message","params":{"level":"debug","data":"這是一個調試級別的通知"},"jsonrpc":"2.0"}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCNotification
Message content: {"jsonrpc":"2.0","method":"notifications/message","params":{"level":"debug","data":"這是一個調試級別的通知"}}
============================
22:13:36.823 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpClientSession - Received notification: JSONRPCNotification[jsonrpc=2.0, method=notifications/message, params={level=debug, data=這是一個調試級別的通知}]
22:13:36.842 [HttpClient-1-Worker-2] DEBUG i.m.client.McpAsyncClient - Logging: LoggingMessageNotification[level=DEBUG, logger=null, data=這是一個調試級別的通知]=== NOTIFICATION RECEIVED ===
Level: DEBUG
Logger: null
Data: 這是一個調試級別的通知
=============================
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCNotification
Response content: {"jsonrpc":"2.0","method":"notifications/message","params":{"level":"debug","data":"這是一個調試級別的通知"}}
==============================
22:13:36.845 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"method":"notifications/message","params":{"level":"info","data":"這是一個信息級別的通知"},"jsonrpc":"2.0"}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCNotification
Message content: {"jsonrpc":"2.0","method":"notifications/message","params":{"level":"info","data":"這是一個信息級別的通知"}}
============================
22:13:36.847 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpClientSession - Received notification: JSONRPCNotification[jsonrpc=2.0, method=notifications/message, params={level=info, data=這是一個信息級別的通知}]
22:13:36.848 [HttpClient-1-Worker-2] DEBUG i.m.client.McpAsyncClient - Logging: LoggingMessageNotification[level=INFO, logger=null, data=這是一個信息級別的通知]=== NOTIFICATION RECEIVED ===
Level: INFO
Logger: null
Data: 這是一個信息級別的通知
=============================
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCNotification
Response content: {"jsonrpc":"2.0","method":"notifications/message","params":{"level":"info","data":"這是一個信息級別的通知"}}
==============================
22:13:36.850 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"method":"notifications/message","params":{"level":"warning","data":"警告:您選擇了警告級別來處理消息: 測試通知功能!"},"jsonrpc":"2.0"}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCNotification
Message content: {"jsonrpc":"2.0","method":"notifications/message","params":{"level":"warning","data":"警告:您選擇了警告級別來處理消息: 測試通知功能!"}}
============================
22:13:36.851 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpClientSession - Received notification: JSONRPCNotification[jsonrpc=2.0, method=notifications/message, params={level=warning, data=警告:您選擇了警告級別來處理消息: 測試通知功能!}]
22:13:36.852 [HttpClient-1-Worker-2] DEBUG i.m.client.McpAsyncClient - Logging: LoggingMessageNotification[level=WARNING, logger=null, data=警告:您選擇了警告級別來處理消息: 測試通知功能!]=== NOTIFICATION RECEIVED ===
Level: WARNING
Logger: null
Data: 警告:您選擇了警告級別來處理消息: 測試通知功能!
=============================
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCNotification
Response content: {"jsonrpc":"2.0","method":"notifications/message","params":{"level":"warning","data":"警告:您選擇了警告級別來處理消息: 測試通知功能!"}}
==============================
22:13:36.854 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"jsonrpc":"2.0","id":"5ed91d29-3","result":{"content":[{"type":"text","text":"{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"}],"structuredContent":{"result":"{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"},"isError":false}}
=== INCOMING MCP MESSAGE ===
Received from: http://localhost:8080/sse/
Message type: JSONRPCResponse
Message content: {"jsonrpc":"2.0","id":"5ed91d29-3","result":{"content":[{"type":"text","text":"{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"}],"structuredContent":{"result":"{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"},"isError":false}}
============================
22:13:36.856 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpClientSession - Received Response: JSONRPCResponse[jsonrpc=2.0, id=5ed91d29-3, result={content=[{type=text, text={"result": true, "message": "帶warning級別通知的Echo成功", "timestamp": "2025-07-19T22:13:36.819802Z", "tool_name": "echo_with_notifications", "data": {"echo_message": "測試通知功能!", "notification_level": "warning", "notifications_sent": ["debug", "info", "warning"]}}}], structuredContent={result={"result": true, "message": "帶warning級別通知的Echo成功", "timestamp": "2025-07-19T22:13:36.819802Z", "tool_name": "echo_with_notifications", "data": {"echo_message": "測試通知功能!", "notification_level": "warning", "notifications_sent": ["debug", "info", "warning"]}}}, isError=false}, error=null]
=== OUTGOING MCP RESPONSE ===
Sending to: http://localhost:8080/sse/
Response type: JSONRPCResponse
Response content: {"jsonrpc":"2.0","id":"5ed91d29-3","result":{"content":[{"type":"text","text":"{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"}],"structuredContent":{"result":"{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"},"isError":false}}
==============================
Notification tool response:
{"content" : [ {"type" : "text","text" : "{\"result\": true, \"message\": \"帶warning級別通知的Echo成功\", \"timestamp\": \"2025-07-19T22:13:36.819802Z\", \"tool_name\": \"echo_with_notifications\", \"data\": {\"echo_message\": \"測試通知功能!\", \"notification_level\": \"warning\", \"notifications_sent\": [\"debug\", \"info\", \"warning\"]}}"} ],"isError" : false
}--- Waiting for notifications ---
Timeout waiting for notifications, received: 3 out of 5 expected

請求:closeGracefully

--- Closing client ---
=== CLOSING MCP CONNECTION ===
Closing connection to: http://localhost:8080/sse/
Initiating graceful shutdown of transport
Transport closed successfully
==============================
Client closed successfully

4. 工具列表與參數(本次僅包含 echo-simple、echo-with-notifications)

22:13:36.787 [HttpClient-1-Worker-2] DEBUG i.m.spec.McpSchema - Received JSON message: {"jsonrpc":"2.0","id":"5ed91d29-2","result":{"tools":[{"name": "echo-simple","description": "簡單的Echo工具:直接返回輸入的消息(不包裝JSON格式)\n\nArgs:\n    message: 要回顯的消息\n    \nReturns:\n    相同的輸入消息","inputSchema": {"properties": {"message": { "title": "Message", "type": "string" }},"required": ["message"],"type": "object"},"outputSchema": {"properties": {"result": { "title": "Result", "type": "string" }},"required": ["result"],"title": "_WrappedResult","type": "object","x-fastmcp-wrap-result": true}},{"name": "echo-with-notifications","description": "帶不同級別通知的Echo工具:演示MCP日志通知功能\n\nArgs:\n    message: 要回顯的消息\n    notification_level: 通知級別\n    \nReturns:\n    處理后的消息","inputSchema": {"properties": {"message": { "description": "要回顯的消息", "title": "Message", "type": "string" },"notification_level": { "default": "info", "description": "通知級別 (debug/info/warning/error)", "title": "Notification Level", "type": "string" }},"required": ["message"],"type": "object"},"outputSchema": {"properties": {"result": { "title": "Result", "type": "string" }},"required": ["result"],"title": "_WrappedResult","type": "object","x-fastmcp-wrap-result": true}}
]}}

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

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

相關文章

SLAM學習資料記錄

ORB_SLAM2 創建自己的數據集(還未使用) 【SLAM實戰篇】Ubuntu 20.04版本(OpenCV版本4.5.3)對于ORB-SLAM2安裝運行,代碼編譯,自己的數據集構造_ubuntu20.04 安裝運行orb_slam2算法-CSDN博客 卡爾曼濾波數據…

用Phi-3 Mini微調實現英文到尤達語翻譯

用Phi-3 Mini微調實現英文到尤達語翻譯 引言 本文將帶你快速上手大模型微調實踐——以微軟的Phi-3 Mini 4K Instruct模型為例,教你如何將其微調為一個能把英文翻譯成"尤達語"(《星球大戰》中尤達大師的獨特說話風格)的模型。這是一…

AI助力,輕松實現人聲分離伴奏提取

親愛的小伙伴們!前段時間,有一位同事家的可愛小孩參加了一場英語演講比賽。同事找到我,希望我能幫個忙,把講視頻中的人聲去掉,只提取出其中相應的伴奏。今天,我就來和大家分享一下究竟如何實現從 MP4 視頻中…

第1章第2章筆記

OSI參考模型---開放式系統互聯模型---OSI/RM ISO--->國際標準化組織;特點:先有模型,在又協議。 OSI七層參考模型:應用層 --- 提供網絡服務;自然語言-->編碼表示層 --- 對數據的處理;格式化&#xff0…

圖的BFS和DFS

一,圖的遍歷邏輯1.之前我們學了圖的存儲,可以鄰接表存和鄰接矩陣存。現在我們要學習圖的遍歷操作和樹類似可以分為深度遍歷和廣度遍歷,而深度遍歷也是用遞歸實現,廣度遍歷是用隊列實現2.深度遍歷(DFS)a.確定起點b.找到一條邊按順時…

WWDC 25 給自定義 SwiftUI 視圖穿上“玻璃外衣”:最新 Liquid Glass 皮膚詳解

引子 各位 iOS 足球體育健兒們,且聽我一言!想當年在《少林足球》里,阿星一句“做人如果沒夢想,那跟咸魚有什么分別啊?”點燃了多少人的江湖夢。 如今在 SwiftUI 江湖里,Apple 于 WWDC 25 推出的 Liquid Gl…

Day01_C++

01.思維導圖02.方法一&#xff1a;#include <iostream> #include <cstring> #include <iostream> using namespace std; class mystring { private:char* buf;int len;public:mystring(const char* str);void copy(const char* ptr);void copy(mystring ptr)…

C語言學習(days09)

二維數組的定義與特性二維數組的聲明格式為&#xff1a;類型說明符 數組名[表達式1][表達式2];[下標1]表示行索引&#xff0c;[下標2]表示列索引。二維數組可視為由多個一維數組組成&#xff0c;a[0]表示第0行的首地址&#xff08;即一維數組地址&#xff09;a[0][0]表示第0的第…

WIFI路由器長期不重啟,手機連接時提示無IP分配

今天在公司&#xff0c;突然發現手機連不上公司WIFI。每次鏈接&#xff0c;提示無IP分析。我以為是我手機出問題了&#xff0c;想復位一下。后來一想萬一復位還是不靈&#xff0c;怎么辦&#xff1f;同事認為是路由器沒有重啟的原因。于是找到路由器&#xff0c;重啟&#xff0…

【前沿技術動態】【AI總結】RustFS:從 0 到 1 打造下一代分布式對象存儲

目錄1 引言&#xff1a;為什么我們又需要一個新的對象存儲2 RustFS 全景速覽3 技術架構深度拆解3.1 整體拓撲3.2 關鍵數據結構&#xff08;rust 偽代碼&#xff09;3.3 讀寫路徑&#xff08;寫放大 < 1.1&#xff09;4 核心源碼導讀4.1 關鍵函數跟蹤4.2 一段最小可復現示例5…

ImageNet1K數據集的下載解壓與處理

前言 博主因為這個數據集踩了好多坑&#xff0c;浪費了好幾天時間&#xff0c;最近終于找到了高效的辦法&#xff0c;寫此篇文章來記錄具體操作方法&#xff0c;也希望可以幫助到有需要的人。&#xff08;主要是在云服務器是使用&#xff09; 下載數據集 一共下載三個文件&…

OkHttp 與 Room 結合使用:構建高效的 Android 本地緩存策略

前言在現代 Android 應用開發中&#xff0c;網絡請求與本地數據持久化是兩大核心功能。OkHttp 作為強大的網絡請求庫&#xff0c;與 Jetpack Room 持久化庫的結合使用&#xff0c;可以創建高效的數據緩存策略&#xff0c;提升應用性能和用戶體驗。本文將詳細介紹如何將這兩者完…

Nacos中feign.FeignException$BadGateway: [502 Bad Gateway]

Nacos中feign.FeignException$BadGateway: [502 Bad Gateway] 文章目錄Nacos中feign.FeignException$BadGateway: [502 Bad Gateway]背景原因背景 Mac本地運行Nacos微服務項目&#xff0c;調用服務失敗 原因 關閉本地代理clash或者其他&#xff0c;windows沒發現問題&#x…

基于deepseek的LORA微調

LORA微調&#xff1a; 核心是&#xff1a;低秩轉換&#xff0c;減少參數。凍結大部分&#xff0c;調節部分模塊(注意力模塊的Wq&#xff0c;Wk&#xff0c;Wv)。 調整過后得到一個lora.safetensors, 內部記錄了(detail W: 即部分修改的W)。推理使用原權重和lora權重。 具體操…

Linux運維新手的修煉手扎之第22天

Tomcat服務1 java項目部署方式&#xff1a;war包部署、jar包部署、源代碼部署2 Ubuntu環境部署Java - openjdk[熟練]:#安裝軟件rootubuntu24-13:~# apt update; apt list openjdk*rootubuntu24-13:~# apt install openjdk-11-jdk -y#檢測效果rootubuntu24-13:~# whereis javaja…

Python爬蟲實戰:研究Genius庫相關技術

1. 引言 在當今數字化時代,音樂數據的分析與挖掘成為了音樂學、計算機科學等領域的研究熱點。歌詞作為音樂的重要組成部分,蘊含著豐富的情感、文化和社會信息。通過對歌詞數據的分析,可以揭示音樂風格的演變、流行趨勢的變化以及社會情緒的波動等。 Genius 是一個專注于歌詞…

內核協議棧源碼閱讀(一) ---驅動與內核交互

文章目錄 一、硬中斷 1.1 `e100_intr` 1.2 `__netif_rx_schedule` 1.3 補充: 二、軟中斷 2.1 net_rx_action 2.2 e100_poll 2.3 補充 三、非 NAPI 的軟中斷處理 3.1 netif_rx 3.2 backlog_dev->poll 3.3 補充 四、總結 以 e100_intr 為例: 一、硬中斷 1.1 e100_intr 網卡…

Vue3 面試題及詳細答案120道(61-75 )

《前后端面試題》專欄集合了前后端各個知識模塊的面試題&#xff0c;包括html&#xff0c;javascript&#xff0c;css&#xff0c;vue&#xff0c;react&#xff0c;java&#xff0c;Openlayers&#xff0c;leaflet&#xff0c;cesium&#xff0c;mapboxGL&#xff0c;threejs&…

ubuntulinux快捷鍵

1.復制文件使用cp命令。cp是復制的簡寫。語法也很簡單。使用&#xff0c;cp后跟要復制的文件以及要將其移動到的目的地cp ~/Downloads/your-file.txt ~/Documents/2.復制文件夾為了復制文件夾及其內容&#xff0c;您將需要告訴cp命令以遞歸方式復制。使用-r標志就足夠簡單了。c…

將 `knife4j` 和 `springdoc-openapi` 集成到你的 Spring Boot 應用

集成 knife4j 和 springdoc-openapi 可以讓你在 Spring Boot 應用中擁有更美觀和功能豐富的 API 文檔界面。knife4j 是基于 Swagger 的一個 UI 增強包,而 springdoc-openapi 則是用于生成 OpenAPI 3 文檔的庫。下面是如何將兩者集成到你的 Spring Boot 項目中的步驟。 步驟 1…