spring-ai-alibaba官方 Playground 示例

1、Spring AI Alibaba 官方社區開發了一個包含完整 “前端UI+后端實現” 的智能體 Playground 示例,示例使用 Spring AI Alibaba 開發,可以體驗聊天機器人、多輪對話、圖片生成、多模態、工具調用、MCP集成、RAG知識庫等所有框架核心能力。

2、界面

3、準備工作 jdk17? ,

阿里云百煉api-key 對應環境變量?AI_DASHSCOPE_API_KEY

百度云翻譯 ak 對應環境變量?BAIDU_TRANSLATE_APP_ID

百度云翻譯sk對應環境變量?BAIDU_TRANSLATE_SECRET_KEY

百度云地圖ak對應環境變量??BAIDU_MAP_API_KEY

阿里云信息查詢服務iqs-search?api-key對應環境變量 IQS_SEARCH_API_KEY

4、pom文件內容

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><artifactId>spring-ai-alibaba-playground</artifactId><groupId>com.alibaba.cloud.ai</groupId><version>0.0.1</version><description>Spring AI Alibaba Playground</description><name>Spring AI Alibaba Playground</name><properties><spring-boot.version>3.4.0</spring-boot.version><spring-ai.version>1.0.0</spring-ai.version><spring-ai-alibaba.version>1.0.0.2</spring-ai-alibaba.version><!-- Node and npm --><node.version>v20.12.2</node.version><npm.version>10.9.2</npm.version><!-- For playground frontend resource. dist has been placed in the resource directory,if you have the problem of secondary development or local front-end project failure to start,please set this development to true, and run the "mvn clean package" to repackage the front-end project.If you don't modify this configuration, you can compile the frontend andcopy the frontend resources by executing "mvn clean package -Dnpm.build.skip=false". --><npm.build.skip>true</npm.build.skip><zipkin.version>3.4.3</zipkin.version><micrometr.version>1.5.0-M2</micrometr.version><jackson.version>2.15.0</jackson.version><hibernate.version>6.6.9.Final</hibernate.version><sqlite-jdbc.version>3.49.1.0</sqlite-jdbc.version><knife4j.version>4.6.0</knife4j.version><javacv-platform.version>1.5.9</javacv-platform.version><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target><maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>1.5.18</version></dependency><dependency><groupId>ch.qos.logback</groupId><artifactId>logback-core</artifactId><version>1.5.18</version></dependency><!-- Spring Boot Starter --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><exclusion><artifactId>logback-classic</artifactId><groupId>ch.qos.logback</groupId></exclusion><exclusion><artifactId>logback-core</artifactId><groupId>ch.qos.logback</groupId></exclusion></exclusions></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-webflux</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-validation</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-aop</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency><!-- Spring AI --><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-tika-document-reader</artifactId><version>${spring-ai.version}</version></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-starter-mcp-client</artifactId><version>${spring-ai.version}</version></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-autoconfigure-mcp-client</artifactId><version>${spring-ai.version}</version></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-starter-model-openai</artifactId><version>${spring-ai.version}</version></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-markdown-document-reader</artifactId><version>${spring-ai.version}</version></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-advisors-vector-store</artifactId><version>${spring-ai.version}</version></dependency><!-- Spring AI Alibaba --><dependency><groupId>com.alibaba.cloud.ai</groupId><artifactId>spring-ai-alibaba-starter-dashscope</artifactId><version>${spring-ai-alibaba.version}</version></dependency><dependency><groupId>com.alibaba.cloud.ai</groupId><artifactId>spring-ai-alibaba-starter-memory</artifactId><version>${spring-ai-alibaba.version}</version></dependency><dependency><groupId>com.alibaba.cloud.ai</groupId><artifactId>spring-ai-alibaba-starter-store-analyticdb</artifactId><version>${spring-ai-alibaba.version}</version></dependency><!-- Swagger API Docs --><dependency><groupId>com.github.xingfudeshi</groupId><artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId><version>${knife4j.version}</version></dependency><!--DB --><dependency><groupId>org.xerial</groupId><artifactId>sqlite-jdbc</artifactId><version>${sqlite-jdbc.version}</version></dependency><dependency><groupId>org.hibernate.orm</groupId><artifactId>hibernate-community-dialects</artifactId><version>${hibernate.version}</version></dependency><!-- Observable --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>io.micrometer</groupId><artifactId>micrometer-tracing-bridge-brave</artifactId><version>${micrometr.version}</version><exclusions><exclusion><artifactId>slf4j-api</artifactId><groupId>org.slf4j</groupId></exclusion></exclusions></dependency><dependency><groupId>io.zipkin.reporter2</groupId><artifactId>zipkin-reporter-brave</artifactId><version>${zipkin.version}</version></dependency><!-- Others --><dependency><groupId>com.fasterxml.jackson.dataformat</groupId><artifactId>jackson-dataformat-yaml</artifactId><version>${jackson.version}</version></dependency><dependency><groupId>org.bytedeco</groupId><artifactId>javacv-platform</artifactId><version>${javacv-platform.version}</version></dependency><dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>33.4.0-jre</version></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring-boot.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>com.alibaba.cloud.ai</groupId><artifactId>spring-ai-alibaba-bom</artifactId><version>${spring-ai-alibaba.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-bom</artifactId><version>${spring-ai.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><finalName>app</finalName><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>${spring-boot.version}</version><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-deploy-plugin</artifactId><version>${maven-deploy-plugin.version}</version></plugin><plugin><groupId>com.github.eirslett</groupId><artifactId>frontend-maven-plugin</artifactId><version>1.11.0</version><executions><execution><id>install node and pnpm</id><goals><goal>install-node-and-npm</goal></goals><configuration><skip>${npm.build.skip}</skip><nodeVersion>${node.version}</nodeVersion><npmVersion>${npm.version}</npmVersion><workingDirectory>ui</workingDirectory></configuration></execution><execution><id>install pnpm</id><goals><goal>npm</goal></goals><configuration><skip>${npm.build.skip}</skip><arguments>install -g pnpm</arguments><workingDirectory>ui</workingDirectory></configuration></execution><execution><id>pnpm install</id><goals><goal>npm</goal></goals><configuration><skip>${npm.build.skip}</skip><arguments>exec -- pnpm install</arguments><workingDirectory>ui</workingDirectory></configuration></execution><execution><id>pnpm build</id><goals><goal>npm</goal></goals><phase>generate-resources</phase><configuration><skip>${npm.build.skip}</skip><arguments>exec -- pnpm build</arguments><workingDirectory>ui</workingDirectory></configuration></execution></executions></plugin><plugin><artifactId>maven-resources-plugin</artifactId><version>3.2.0</version><executions><!-- Copy frontend dist resource to static dir --><execution><id>copy-react-build</id><phase>process-resources</phase><goals><goal>copy-resources</goal></goals><configuration><skip>${npm.build.skip}</skip><outputDirectory>${project.build.outputDirectory}/static</outputDirectory><resources><resource><directory>ui/dist</directory><filtering>false</filtering></resource></resources></configuration></execution><!-- Add new execution to copy mcp-lib directory --><execution><id>copy-mcp-lib</id><phase>prepare-package</phase><goals><goal>copy-resources</goal></goals><configuration><outputDirectory>${project.build.directory}/mcp-libs</outputDirectory><resources><resource><directory>${project.basedir}/mcp-libs</directory><filtering>false</filtering></resource></resources></configuration></execution><!-- Add new execution to copy db directory --><execution><id>copy-db</id><phase>prepare-package</phase><goals><goal>copy-resources</goal></goals><configuration><outputDirectory>${project.build.directory}/db</outputDirectory><resources><resource><directory>${project.basedir}/db</directory><filtering>false</filtering></resource></resources></configuration></execution></executions></plugin></plugins></build><repositories><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></repository><repository><id>aliyunmaven</id><name>aliyun</name><url>https://maven.aliyun.com/repository/public</url></repository></repositories></project>

?5、rag向量庫代碼解析

/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements.  See the NOTICE file distributed with* this work for additional information regarding copyright ownership.* The ASF licenses this file to You under the Apache License, Version 2.0* (the "License"); you may not use this file except in compliance with* the License.  You may obtain a copy of the License at**     http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
package com.alibaba.cloud.ai.application.config.rag;import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.vectorstore.SimpleVectorStore;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
public class SimpleVectorStoreConfiguration {@BeanCommandLineRunner ingestTermOfServiceToVectorStore(VectorStoreDelegate vectorStoreDelegate) {//return args -> {String type = System.getenv("VECTOR_STORE_TYPE");//通過環境變量 VECTOR_STORE_TYPE 判斷使用analyticdb向量庫還是使用基于內存的向量庫VectorStoreInitializer initializer = new VectorStoreInitializer();//初始化數據到向量庫initializer.init(vectorStoreDelegate.getVectorStore(type));};}/*** 提供基于內存的向量存儲(SimpleVectorStore)* <p>* 依賴 EmbeddingModel(自動注入,Alibaba 的嵌入模型)* @param embeddingModel* @return*/@Beanpublic VectorStore simpleVectorStore(EmbeddingModel embeddingModel) {// 向量存儲的簡單實現,非常適合用于教育目的return SimpleVectorStore.builder(embeddingModel).build();}@Beanpublic VectorStoreDelegate vectorStoreDelegate(@Qualifier("simpleVectorStore") VectorStore simpleVectorStore,@Qualifier("analyticdbVectorStore") @Autowired(required = false) VectorStore analyticdbVectorStore) {//注入基于內存的向量庫和 analyticdbreturn new VectorStoreDelegate(simpleVectorStore, analyticdbVectorStore);}}

/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements.  See the NOTICE file distributed with* this work for additional information regarding copyright ownership.* The ASF licenses this file to You under the Apache License, Version 2.0* (the "License"); you may not use this file except in compliance with* the License.  You may obtain a copy of the License at**     http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
package com.alibaba.cloud.ai.application.config.rag;import java.util.Objects;import org.springframework.ai.vectorstore.VectorStore;public class VectorStoreDelegate {private VectorStore simpleVectorStore;private VectorStore analyticdbVectorStore;public VectorStoreDelegate(VectorStore simpleVectorStore, VectorStore analyticdbVectorStore) {this.simpleVectorStore = simpleVectorStore;this.analyticdbVectorStore = analyticdbVectorStore;}public VectorStore getVectorStore(String vectorStoreType) {if (Objects.equals(vectorStoreType, "analyticdb") && analyticdbVectorStore != null) {return analyticdbVectorStore;}return simpleVectorStore;}
}

/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements.  See the NOTICE file distributed with* this work for additional information regarding copyright ownership.* The ASF licenses this file to You under the Apache License, Version 2.0* (the "License"); you may not use this file except in compliance with* the License.  You may obtain a copy of the License at**     http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/package com.alibaba.cloud.ai.application.config.rag;import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;import org.springframework.ai.document.Document;
import org.springframework.ai.reader.markdown.MarkdownDocumentReader;
import org.springframework.ai.transformer.splitter.TokenTextSplitter;
import org.springframework.ai.vectorstore.VectorStore;/*** @author yuluo* @author <a href="mailto:yuluo08290126@gmail.com">yuluo</a>*/
public class VectorStoreInitializer {private final Logger logger = LoggerFactory.getLogger(VectorStoreInitializer.class);public void init(VectorStore vectorStore) throws Exception {//初始化數據至向量庫//讀取markdown文件List<MarkdownDocumentReader> markdownDocumentReaderList = loadMarkdownDocuments();int size = 0;if (markdownDocumentReaderList.isEmpty()) {logger.warn("No markdown documents found in the directory.");return;}logger.debug("Start to load markdown documents into vector store......");for (MarkdownDocumentReader markdownDocumentReader : markdownDocumentReaderList) {
//			TokenTextSplitter是TextSplitter它使用 CL100K_BASE 編碼根據Tokens計數將文本拆分為塊
//
//			defaultChunkSize:每個文本塊的目標大小(以 tokens 為單位)(默認值:800)。
//
//			minChunkSizeChars:每個文本塊的最小大小(以字符為單位)(默認值:350)。
//
//			minChunkLengthToEmbed:要包含的 chunk 的最小長度(默認值:5)。
//
//			maxNumChunks:從文本生成的最大塊數(默認值:10000)。
//
//			keepSeparator:是否在塊中保留分隔符(如換行符)(默認:true)。List<Document> documents = new TokenTextSplitter(2000, 1024, 10, 10000, true).transform(markdownDocumentReader.get());size += documents.size();// 拆分 documents 列表為最大 20 個元素的子列表  也就是每次最多向向量庫中添加20條數據for (int i = 0; i < documents.size(); i += 20) {int end = Math.min(i + 20, documents.size());List<Document> subList = documents.subList(i, end);vectorStore.add(subList);}}logger.debug("Load markdown documents into vector store successfully. Load {} documents.", size);}private List<MarkdownDocumentReader> loadMarkdownDocuments() throws IOException, URISyntaxException {List<MarkdownDocumentReader> readers;// 首先檢查jar包當前運行目錄是否存在markdown文件Path currentDirPath = Paths.get(System.getProperty("user.dir"), "rag", "markdown");if (Files.exists(currentDirPath) && Files.isDirectory(currentDirPath)) {logger.debug("Found markdown directory in current running directory: {}", currentDirPath);try (Stream<Path> paths = Files.walk(currentDirPath)) {List<Path> markdownFiles = paths.filter(Files::isRegularFile).filter(path -> path.toString().endsWith(".md")).collect(Collectors.toList());if (!markdownFiles.isEmpty()) {logger.debug("Loading {} markdown files from current directory", markdownFiles.size());readers = markdownFiles.stream().map(path -> {String filePath = path.toAbsolutePath().toString();return new MarkdownDocumentReader("file:" + filePath);}).collect(Collectors.toList());return readers;} else {logger.debug("No markdown files found in current directory, falling back to resources");}}} else {logger.debug("Markdown directory not found in current directory, falling back to resources");}// 如果當前運行目錄沒有找到,則從resources目錄加載Path markdownDir = Paths.get(getClass().getClassLoader().getResource("rag/markdown").toURI());logger.debug("Loading markdown files from resources directory: {}", markdownDir);try (Stream<Path> paths = Files.walk(markdownDir)) {readers = paths.filter(Files::isRegularFile).filter(path -> path.toString().endsWith(".md")).map(path -> {String fileName = path.getFileName().toString();String classpathPath = "classpath:rag/markdown/" + fileName;return new MarkdownDocumentReader(classpathPath);}).collect(Collectors.toList());}return readers;}}

6、源代碼地址

https://github.com/springaialibaba/spring-ai-alibaba-examples

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

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

相關文章

k8s pod深度理解

一、理論 pod等同于邏輯主機&#xff0c;在它上面運行各種程序&#xff08;容器&#xff09; pod的pause容器作用&#xff0c;pod網絡、存儲 所有容器的父容器&#xff0c;負責回收僵尸容器&#xff0c;同時它為pod中的容器提供了統一的網絡及統一的共享存儲。 pod的endpoint…

Android Auto即將帶來變革

在2025年谷歌I/O開發者大會上&#xff0c;Android Auto迎來重磅升級。除了集成Gemini智能助手外&#xff0c;本次更新還突破性地為車載信息娛樂系統新增了瀏覽器和視頻應用支持。值得注意的是&#xff0c;Spotify應用也將獲得一系列創新功能&#xff0c;進一步豐富用戶的駕駛體…

Jenkins 與 GitLab CI/CD 的核心對比

Jenkins 與 GitLab CI/CD 的核心對比及中小企業選型建議如下&#xff1a; &#x1f504; ?核心功能對比? ?維度??Jenkins??GitLab CI/CD??集成性?需手動配置插件對接代碼倉庫&#xff08;如 GitLab&#xff09;原生深度集成 GitLab 倉庫&#xff0c;實現代碼-CI/CD …

每日問題總結

fairy GUI適配相關問題 為什么自己適配好了但是打包發布到unity沒有UI顯示呢&#xff1f; 原因可能是你發布的組件和圖片不在同一個包下面&#xff0c;因為fairyGUI的分包限制問題&#xff0c;每一個包限制在2048M大小。不能超過這個大小&#xff0c;所以說&#xff0c;有可能…

embbding you should know

embedding&#xff1a;就是將詞向量或者圖向量 采用權重升維度&#xff0c;更好的去表達這個特征&#xff1b;nn.Embedding 是 PyTorch 中的 查表式嵌入層&#xff08;lookup‐table&#xff09;&#xff0c;用于將離散的整數索引&#xff08;如詞 ID、實體 ID、離散特征類別等…

【JS-6.2-模板字符串】ES6 模板字符串:現代JavaScript的字符串處理利器

在ES6(ECMAScript 2015)引入的所有新特性中&#xff0c;模板字符串(Template Literals)可能是最直觀、最容易被開發者接受并廣泛使用的特性之一。它徹底改變了我們在JavaScript中處理字符串的方式&#xff0c;提供了更強大、更靈活的字符串操作能力。本文將深入探討模板字符串的…

百度捂緊“錢袋子”

何俊杰依然是李彥宏手里最能用、也最信得過的人之一。 作者|景行 編輯|文昌龍 李彥宏的OKR又兌現了一條。年初他在組織建設的OKR里放話“組織負責人進一步年輕化&#xff0c;提倡賽馬”&#xff0c;如今“賽馬”跑來了百度新CFO。 7月1日&#xff0c;李彥宏發全員郵件&#…

刷卡登入數據獲取

1.WPF刷卡登入數據獲取&#xff0c;防止用戶手動輸入 //WPF輸入框信息及觸發命令<StackPanel Orientation"Vertical" VerticalAlignment"Center" Margin"0 30" Visibility"{Binding LoginMode,Converter{StaticResource loginModeWit…

DPO訓練中的logit scale 與 reward shift 偏置問題以及可能的解決方案

Logit Scale Bias&#xff08;Logit 放縮偏置&#xff09; 定義&#xff1a; Logit scale 偏置指的是&#xff0c;不同模型&#xff08;如 Actor 與 Reference&#xff09;之間輸出的 logit 的數量級&#xff08;scale&#xff09;不一致&#xff0c;導致 log-prob 或 log-rati…

再見 RAG?Gemini 2.0 Flash 剛剛 “殺死” 了它!

最近谷歌發布了 Gemini 2.0 Flash&#xff0c;說實話&#xff0c;它可能是目前市面上性價比最高的 AI 模型了。 許多人寫過關于 RAG 可能不再需要的文章&#xff0c;也可以看到人們在討論它。有些人理解&#xff0c;有些人不理解&#xff0c;還有些人非常擔心。 所以讓我們解…

PDF的圖片文字識別工具

PDF的圖片文字識別工具是一款完全免費的PDF OCR識別軟件&#xff0c;軟件支持“單文件選擇、多文件批量選擇、文字預處理、結果后處理、Word導出”等功能。 選擇你想要識別的PDF&#xff0c;軟件就自動的開始識別PDF內容&#xff0c;識別后的文字在軟件的下方有內容預覽。 注意…

SQLite不夠用?視頻匯聚系統EasyCVR切換MySQL數據庫的關鍵參數怎么調?

一、為什么需要將EasyCVR從SQLite切換到MySQL&#xff1f; EasyCVR默認使用的SQLite數據庫屬于輕量級嵌入式數據庫&#xff0c;適合小型項目或設備量較少的場景&#xff08;通常建議設備通道數≤200&#xff09;。當設備通道數超過200或需要支持高并發訪問、海量數據存儲時&am…

【AI成長會】ubuntu 安裝運行rust

在Ubuntu上用Rust編寫第一個程序 從你的輸出可以看出&#xff0c;Rust已經成功安裝在你的Ubuntu系統上了。現在我們來編寫并運行第一個Rust程序&#xff0c;整個過程需要幾個簡單的步驟&#xff1a; 一、配置Shell環境&#xff08;如果需要&#xff09; 雖然安裝提示可能需要…

兩個手機都用同個wifi,IP地址會一樣嗎?如何更改ip地址

會的。兩個手機連接同一個 WiFi 路由器&#xff0c;它們的 IP 地址通常一樣的。 一、原因如下&#xff1a; 你看到的 IP 地址有兩種&#xff1a; 內網 IP 地址&#xff08;局域網 IP&#xff09;&#xff1a; 這是路由器分配給你手機在家庭或辦公室內部網絡使用的地址。通常格…

十六、windows系統安全-----賬號克隆和隱藏

環境 windows server 2012 步驟 1.查看當前用戶賬號cmd 命令net user&#xff0c;或在計算機管理界面查看 2.查看具體用戶信息 net user 用戶名 3.新建隱藏用戶 net user shiyan$ qwe123 /add **4.添加用戶組 net localgroup administrators shiyan$ /add**將剛才創建的隱藏…

【安全有效新方案】WSL 默認路徑遷移實戰:通過 PowerShell 符號鏈接實現自動重定向

WSL 默認路徑遷移實戰&#xff1a;通過 PowerShell 符號鏈接實現自動重定向 在使用 WSL&#xff08;Windows Subsystem for Linux&#xff09;的過程中&#xff0c;許多用戶會遇到 C 盤空間被 WSL 發行版不斷占用的問題。這是因為 WSL 默認將發行版存儲在C:\Users\<用戶名&…

使用DDR4控制器實現多通道數據讀寫(十八)

一、 概述 在之前已經使用interconnect IP 實現了DDR4的多通道讀寫功能&#xff0c;接下來為了更能接近實用性和更直觀的展現多通道讀寫的功能&#xff0c;使用DDS IP 核生成兩組正弦波信號&#xff0c;將兩組正弦波信號通過其中兩個通道存儲到DDR4中&#xff0c;再使用另外兩個…

基于Vue.js + Node.js + MySQL實現的圖書銷售管理系統

圖書銷售管理系統 項目概述 圖書銷售管理系統是一個基于Vue.js Node.js MySQL的全棧Web應用程序&#xff0c;專為數據庫課程設計而開發。該系統實現了完整的圖書銷售業務流程管理&#xff0c;包括圖書信息管理、庫存管理、采購管理、銷售管理和統計分析等功能模塊。 項目背…

工業路由器賦能智慧電力儲能柜實時通訊,構建電力智能化新生態

在電力行業邁向智能化的進程中&#xff0c;智慧電力儲能柜作為實現電力靈活調配與高效存儲的關鍵設施&#xff0c;其重要性日益凸顯。然而復雜多變的應用環境、多樣的設備接入需求、嚴苛的數據傳輸要求以及嚴峻的網絡安全威脅&#xff0c;給儲能柜的實時通訊帶來諸多挑戰。工業…

命令模式 - Flutter中的操作封裝大師,把“動作“變成可管理的對象!

痛點場景&#xff1a;繪圖應用的操作管理 假設你在開發一個繪圖App&#xff0c;需要支持&#xff1a; 添加/刪除圖形修改圖形屬性撤銷/重做操作批量執行命令 傳統實現方式&#xff1a; void _handleAddShape(ShapeType type) {final shape _createShape(type);setState(()…