跳到主要内容
极客日志极客日志面向AI+效率的开发者社区
首页博客GitHub 精选镜像AI 生图工具UI配色美学隐私政策关于联系
搜索内容 / 工具 / 仓库 / 镜像...⌘K搜索
注册
博客列表
Javajava

Spring Boot 4.0 与 Spring Cloud Alibaba 2025 整合指南

介绍 Spring Boot 4.0 与 Spring Cloud Alibaba 2025 版本的整合方案。涵盖环境配置、Maven 依赖管理、Nacos 服务注册与配置中心集成、Sentinel 流量控制、OpenFeign 服务调用及 Docker 容器化部署。通过示例代码演示了服务提供者、消费者、动态配置刷新及异常处理等关键步骤,提供了一套完整的微服务开发实践参考。

不羁发布于 2026/3/30更新于 2026/7/2355 浏览
Spring Boot 4.0 与 Spring Cloud Alibaba 2025 整合指南

Spring Boot 4.0 与 Spring Cloud Alibaba 2025 整合完整指南

概述

本文将详细介绍如何在 Spring Boot 4.0 中整合 Spring Cloud Alibaba 2025 最新版本。Spring Cloud Alibaba 为分布式应用开发提供了一站式解决方案,包含服务发现、配置管理、流量控制等核心功能。

环境要求

  • JDK: 21+ (Spring Boot 4.0 要求)
  • Maven: 3.6+ 或 Gradle 7.x+
  • Spring Boot: 4.0.0
  • Spring Cloud: 2025.0.0 (假设版本号)
  • Spring Cloud Alibaba: 2025.0.0 (假设版本号)

项目结构

springboot4-sc-alibaba-demo/
├── src/
│   └── main/
│       ├── java/
│       │   └── com/
│       │       └── example/
│       │           ├── Springboot4ScAlibabaApplication.java
│       │           ├── controller/
│       │           ├── service/
│       │           └── config/
│       └── resources/
│           ├── application.yml
│           └── bootstrap.yml
├── pom.xml
└── README.md

第一步:创建项目并配置依赖

1.1 使用 Spring Initializr 创建项目

访问 https://start.spring.io/ 创建基础项目,选择:

  • Spring Boot: 4.0.0
  • 打包方式:Maven/Gradle
  • Java: 21
1.2 完整 pom.xml 配置
<?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">
    <>4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        4.0.0
        
    
    com.example
    springboot4-sc-alibaba-demo
    1.0.0
    springboot4-sc-alibaba-demo
    Spring Boot 4.0 with Spring Cloud Alibaba 2025
    
        21
        21
        21
        UTF-8
        
        2025.0.0
        
        2025.0.0
    
    
        
            
            
                org.springframework.cloud
                spring-cloud-dependencies
                ${spring-cloud.version}
                pom
                import
            
            
            
                com.alibaba.cloud
                spring-cloud-alibaba-dependencies
                ${spring-cloud-alibaba.version}
                pom
                import
            
        
    
    
        
        
            org.springframework.boot
            spring-boot-starter-web
        
        
        
            org.springframework.boot
            spring-boot-starter-actuator
        
        
        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-nacos-discovery
        
        
        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-nacos-config
        
        
        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-sentinel
        
        
        
            org.springframework.cloud
            spring-cloud-starter-openfeign
        
        
        
            org.springframework.cloud
            spring-cloud-starter-loadbalancer
        
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    
    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    

modelVersion
</modelVersion>
<parent>
<groupId>
</groupId>
<artifactId>
</artifactId>
<version>
</version>
<relativePath/>
</parent>
<groupId>
</groupId>
<artifactId>
</artifactId>
<version>
</version>
<name>
</name>
<description>
</description>
<properties>
<java.version>
</java.version>
<maven.compiler.source>
</maven.compiler.source>
<maven.compiler.target>
</maven.compiler.target>
<project.build.sourceEncoding>
</project.build.sourceEncoding>
<!-- Spring Cloud 版本 -->
<spring-cloud.version>
</spring-cloud.version>
<!-- Spring Cloud Alibaba 版本 -->
<spring-cloud-alibaba.version>
</spring-cloud-alibaba.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring Cloud 依赖管理 -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
<version>
</version>
<type>
</type>
<scope>
</scope>
</dependency>
<!-- Spring Cloud Alibaba 依赖管理 -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
<version>
</version>
<type>
</type>
<scope>
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Spring Boot Starter -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Boot Actuator -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Cloud Alibaba Nacos Discovery -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Cloud Alibaba Nacos Config -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Cloud Alibaba Sentinel -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Cloud OpenFeign -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Cloud LoadBalancer -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
</dependency>
<!-- Spring Boot Test -->
<dependency>
<groupId>
</groupId>
<artifactId>
</artifactId>
<scope>
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
</groupId>
<artifactId>
</artifactId>
</plugin>
</plugins>
</build>
</project>

第二步:配置文件

2.1 bootstrap.yml (应用启动配置)
spring:
  application:
    name: demo-service
  profiles:
    active: dev
  cloud:
    nacos:
      config:
        server-addr: localhost:8848
        file-extension: yaml
        namespace: dev-namespace
        group: DEFAULT_GROUP
        extension-configs:
          - data-id: shared-config.yaml
            group: SHARED_GROUP
            refresh: true
      discovery:
        server-addr: localhost:8848
        namespace: dev-namespace
        group: DEFAULT_GROUP
        metadata:
          version: 1.0
    sentinel:
      transport:
        dashboard: localhost:8080
      eager: true
      datasource:
        ds1:
            nacos:
              server-addr: localhost:8848
              data-id: ${spring.application.name}-sentinel
              group-id: DEFAULT_GROUP
              data-type: json
              rule-type: flow
2.2 application.yml (应用配置)
server:
  port: 8081
  servlet:
    context-path: /demo
spring:
  main:
    allow-bean-definition-overriding: true
  mvc:
    throw-exception-if-no-handler-found: true
  web:
    resources:
      add-mappings: false
  management:
    endpoints:
      web:
        exposure:
          include: health,info,metrics
    endpoint:
      health:
        show-details: always
  feign:
    sentinel:
      enabled: true
    client:
      config:
        default:
          connect-timeout: 5000
          read-timeout: 5000
          logger-level: basic
logging:
  level:
    com.example: debug
    com.alibaba.nacos: warn

第三步:主应用类

package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableDiscoveryClient // 启用服务发现
@EnableFeignClients(basePackages = "com.example.service") // 启用 Feign 客户端
public class Springboot4ScAlibabaApplication {
    public static void main(String[] args) {
        SpringApplication.run(Springboot4ScAlibabaApplication.class, args);
    }
}

第四步:Nacos 服务注册与发现

4.1 服务提供者示例
package com.example.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class DemoController {
    @Value("${server.port}")
    private String port;

    @GetMapping("/hello")
    public String hello(@RequestParam String name) {
        return String.format("Hello %s, from port: %s", name, port);
    }

    @GetMapping("/health")
    public String health() {
        return "Service is healthy";
    }
}
4.2 服务消费者示例(使用 OpenFeign)
4.2.1 创建 Feign 客户端接口
package com.example.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "demo-service", path = "/demo/api")
public interface DemoServiceClient {
    @GetMapping("/hello")
    String sayHello(@RequestParam String name);

    @GetMapping("/health")
    String healthCheck();
}
4.2.2 创建 Fallback 类
package com.example.service;

import org.springframework.stereotype.Component;

@Component
public class DemoServiceFallback implements DemoServiceClient {
    @Override
    public String sayHello(String name) {
        return "Fallback: Hello " + name;
    }

    @Override
    public String healthCheck() {
        return "Fallback: Service unavailable";
    }
}
4.2.3 更新 Feign 客户端配置 Fallback
@FeignClient(
    name = "demo-service",
    path = "/demo/api",
    fallback = DemoServiceFallback.class
)
public interface DemoServiceClient {
    // 接口方法保持不变
}
4.2.4 消费者控制器
package com.example.controller;

import com.example.service.DemoServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {
    @Autowired
    private DemoServiceClient demoServiceClient;

    @GetMapping("/call-hello")
    public String callHello(@RequestParam String name) {
        return demoServiceClient.sayHello(name);
    }
}

第五步:Nacos 配置管理

5.1 动态配置示例
package com.example.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
@RefreshScope // 支持配置动态刷新
public class ConfigController {
    @Value("${app.config.demo:defaultValue}")
    private String demoConfig;

    @Value("${app.feature.enabled:false}")
    private boolean featureEnabled;

    @GetMapping("/demo")
    public String getDemoConfig() {
        return "Current config: " + demoConfig + ", Feature enabled: " + featureEnabled;
    }
}
5.2 在 Nacos 中创建配置

在 Nacos 控制台创建 Data ID: demo-service-dev.yaml,配置内容:

app:
  config:
    demo: "This is dynamic config from Nacos"
  feature:
    enabled: true
server:
  port: 8081
logging:
  level:
    com.example: info

第六步:Sentinel 流量控制

6.1 Sentinel 配置类
package com.example.config;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.authority.AuthorityException;
import com.alibaba.csp.sentinel.slots.block.degrade.DegradeException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowException;
import com.alibaba.csp.sentinel.slots.system.SystemBlockException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

@Configuration
public class SentinelConfig {
    @Bean
    public BlockExceptionHandler sentinelBlockExceptionHandler() {
        return new CustomBlockExceptionHandler();
    }

    static class CustomBlockExceptionHandler implements BlockExceptionHandler {
        @Override
        public void handle(HttpServletRequest request, HttpServletResponse response, BlockException e) throws Exception {
            Map<String, Object> result = new HashMap<>();
            if (e instanceof FlowException) {
                result.put("code", 1001);
                result.put("message", "接口限流");
            } else if (e instanceof DegradeException) {
                result.put("code", 1002);
                result.put("message", "服务降级");
            } else if (e instanceof ParamFlowException) {
                result.put("code", 1003);
                result.put("message", "热点参数限流");
            } else if (e instanceof SystemBlockException) {
                result.put("code", 1004);
                result.put("message", "系统规则限制");
            } else if (e instanceof AuthorityException) {
                result.put("code", 1005);
                result.put("message", "授权规则不通过");
            } else {
                result.put("code", 1000);
                result.put("message", "未知限流");
            }
            response.setStatus(HttpStatus.TOO_MANY_REQUESTS.value());
            response.setCharacterEncoding("UTF-8");
            response.setContentType(MediaType.APPLICATION_JSON_VALUE);
            new ObjectMapper().writeValue(response.getWriter(), result);
        }
    }
}
6.2 使用 Sentinel 注解进行资源保护
package com.example.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sentinel")
public class SentinelController {
    @GetMapping("/resource")
    @SentinelResource(
        value = "protectedResource",
        blockHandler = "handleBlock",
        fallback = "handleFallback"
    )
    public String protectedResource() {
        return "This is a protected resource";
    }

    // 限流处理
    public String handleBlock(BlockException ex) {
        return "请求过于频繁,请稍后重试";
    }

    // 降级处理
    public String handleFallback(Throwable ex) {
        return "服务暂时不可用,请稍后重试";
    }
}

第七步:高级配置

7.1 自定义 Ribbon 配置(负载均衡)
package com.example.config;

import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Flux;

import java.util.Arrays;
import java.util.List;

@Configuration
public class LoadBalancerConfig {
    @Bean
    public ServiceInstanceListSupplier serviceInstanceListSupplier() {
        return new DemoServiceInstanceListSupplier("demo-service");
    }

    static class DemoServiceInstanceListSupplier implements ServiceInstanceListSupplier {
        private final String serviceId;

        public DemoServiceInstanceListSupplier(String serviceId) {
            this.serviceId = serviceId;
        }

        @Override
        public String getServiceId() {
            return serviceId;
        }

        @Override
        public Flux<List<ServiceInstance>> get() {
            // 这里可以自定义服务实例发现逻辑
            return Flux.just(Arrays.asList());
        }
    }
}
7.2 全局异常处理
package com.example.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Map<String, Object> handleException(Exception e) {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 500);
        result.put("message", "系统异常:" + e.getMessage());
        return result;
    }
}

第八步:部署和测试

8.1 启动 Nacos 和 Sentinel Dashboard
# 启动 Nacos (需要提前下载)
sh nacos/bin/startup.sh -m standalone

# 启动 Sentinel Dashboard (需要提前下载)
java -Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080 -jar sentinel-dashboard.jar
8.2 应用启动类增强
package com.example;

import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.core.env.Environment;

import java.util.Objects;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.example.service")
public class Springboot4ScAlibabaApplication {
    public static void main(String[] args) {
        new SpringApplicationBuilder(Springboot4ScAlibabaApplication.class).bannerMode(Banner.Mode.CONSOLE).run(args);
    }

    public void printInfo(Environment env) {
        String port = env.getProperty("server.port");
        String contextPath = Objects.requireNonNullElse(env.getProperty("server.servlet.context-path"), "");
        System.out.println("\n----------------------------------------------------------");
        System.out.println("Application is running! Access URLs:");
        System.out.println("Local: \t\thttp://localhost:" + port + contextPath);
        System.out.println("External: \thttp://" + getHostAddress() + ":" + port + contextPath);
        System.out.println("Profile(s): \t" + String.join(",", env.getActiveProfiles()));
        System.out.println("----------------------------------------------------------\n");
    }

    private String getHostAddress() {
        try {
            return java.net.InetAddress.getLocalHost().getHostAddress();
        } catch (Exception e) {
            return "127.0.0.1";
        }
    }
}
8.3 测试端点
package com.example.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/actuator")
public class ActuatorController {
    @Autowired
    private DiscoveryClient discoveryClient;

    @GetMapping("/services")
    public List<String> getServices() {
        return discoveryClient.getServices().stream()
                .map(service -> service + ": " + discoveryClient.getInstances(service))
                .collect(Collectors.toList());
    }

    @GetMapping("/info")
    public String info() {
        return "Spring Boot 4.0 with Spring Cloud Alibaba 2025";
    }
}

第九步:Docker 部署配置

9.1 Dockerfile
FROM openjdk:21-jdk-slim

# 设置工作目录
WORKDIR /app

# 复制 JAR 文件
COPY target/springboot4-sc-alibaba-demo-1.0.0.jar app.jar

# 暴露端口
EXPOSE 8080

# 设置 JVM 参数
ENV JAVA_OPTS="-Xmx512m -Xms256m -Djava.security.egd=file:/dev/./urandom"

# 启动应用
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
9.2 docker-compose.yml
version: '3.8'
services:
  nacos:
    image: nacos/nacos-server:latest
    container_name: nacos-server
    environment:
      - MODE=standalone
    ports:
      - "8848:8848"
    networks:
      - sc-alibaba-net

  sentinel:
    image: bladex/sentinel-dashboard:latest
    container_name: sentinel-dashboard
    ports:
      - "8080:8080"
    networks:
      - sc-alibaba-net

  demo-app:
    build: .
    container_name: demo-service
    ports:
      - "8081:8081"
    environment:
      - SPRING_PROFILES_ACTIVE=docker
      - SPRING_CLOUD_NACOS_CONFIG_SERVER-ADDR=nacos:8848
      - SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=nacos:8848
      - SPRING_CLOUD_SENTINEL_TRANSPORT_DASHBOARD=sentinel:8080
    depends_on:
      - nacos
      - sentinel
    networks:
      - sc-alibaba-net

networks:
  sc-alibaba-net:
    driver: bridge

总结

本文详细介绍了 Spring Boot 4.0 与 Spring Cloud Alibaba 2025 最新版本的完整整合方案,包括:

  1. 项目搭建和依赖配置
  2. Nacos 服务注册与发现
  3. Nacos 配置中心集成
  4. Sentinel 流量控制与熔断降级
  5. OpenFeign 声明式服务调用
  6. 高级配置和最佳实践
  7. Docker 容器化部署

通过这套完整的微服务解决方案,您可以快速构建高可用、可扩展的分布式应用系统。记得根据实际生产环境需求调整配置参数和安全设置。

目录

  1. Spring Boot 4.0 与 Spring Cloud Alibaba 2025 整合完整指南
  2. 概述
  3. 环境要求
  4. 项目结构
  5. 第一步:创建项目并配置依赖
  6. 1.1 使用 Spring Initializr 创建项目
  7. 1.2 完整 pom.xml 配置
  8. 第二步:配置文件
  9. 2.1 bootstrap.yml (应用启动配置)
  10. 2.2 application.yml (应用配置)
  11. 第三步:主应用类
  12. 第四步:Nacos 服务注册与发现
  13. 4.1 服务提供者示例
  14. 4.2 服务消费者示例(使用 OpenFeign)
  15. 4.2.1 创建 Feign 客户端接口
  16. 4.2.2 创建 Fallback 类
  17. 4.2.3 更新 Feign 客户端配置 Fallback
  18. 4.2.4 消费者控制器
  19. 第五步:Nacos 配置管理
  20. 5.1 动态配置示例
  21. 5.2 在 Nacos 中创建配置
  22. 第六步:Sentinel 流量控制
  23. 6.1 Sentinel 配置类
  24. 6.2 使用 Sentinel 注解进行资源保护
  25. 第七步:高级配置
  26. 7.1 自定义 Ribbon 配置(负载均衡)
  27. 7.2 全局异常处理
  28. 第八步:部署和测试
  29. 8.1 启动 Nacos 和 Sentinel Dashboard
  30. 启动 Nacos (需要提前下载)
  31. 启动 Sentinel Dashboard (需要提前下载)
  32. 8.2 应用启动类增强
  33. 8.3 测试端点
  34. 第九步:Docker 部署配置
  35. 9.1 Dockerfile
  36. 设置工作目录
  37. 复制 JAR 文件
  38. 暴露端口
  39. 设置 JVM 参数
  40. 启动应用
  41. 9.2 docker-compose.yml
  42. 总结
  • 免费图片AI生成工具免费生成了解详情
  • Magick API 一键接入全球大模型注册送1000万token查看
  • 免费图片视频在线生成30秒,将你的创意变成现实开始设计
  • X/Twitter免费视频下载器免登陆无限额度免费视频解析下载了解详情
  • 100+免费在线小游戏爽一把
极客日志微信公众号二维码

微信扫一扫,关注极客日志

微信公众号「极客日志V2」,在微信中扫描左侧二维码关注。展示文案:极客日志V2 zeeklog

更多推荐文章

查看全部
  • 马斯克xAI开源Grok-1:3140亿参数模型架构详解
  • 融合选择性卷积与残差结构的 SKResNet 架构详解
  • 大模型面试题精选与详细答案解析
  • Java 设计模式:静态工厂方法详解
  • Python 基础语法完全指南:变量数据类型运算符与字符串
  • 188+26 家国产大模型清单及特点分析
  • 国内用户如何付费升级 GitHub Copilot 专业版
  • 2026 届学位论文 AIGC 检测率要求汇总及应对策略
  • Google GenAI Toolbox:企业级 AI 数据库中间件与 LLM-SQL 安全互联实践
  • Java 面向对象多态:向上转型与向下转型
  • GLM-4.7 技术解析:开源模型在编码与推理上的新突破
  • 基于 OpenClaw 快速搭建企业微信 AI 客服
  • Z 字形变换与外观数列算法解析
  • C++ STL 容器详解:双向链表 list 核心用法与注意事项
  • 基于 Prefect 框架的 Python 可视化爬虫项目实战
  • 在 GPU 云上完成 LLaMA 微调:LoRA 实践记录
  • 大模型面试核心知识点总结与参考答案
  • Python 结合 Neo4j 构建知识图谱实战指南
  • 大语言模型:基础架构与前沿技术演进
  • 大模型微调需要多少 Token?基于 Llama-Factory 的计算分析

相关免费在线工具

  • Keycode 信息

    查找任何按下的键的javascript键代码、代码、位置和修饰符。 在线工具,Keycode 信息在线工具,online

  • Escape 与 Native 编解码

    JavaScript 字符串转义/反转义;Java 风格 \uXXXX(Native2Ascii)编码与解码。 在线工具,Escape 与 Native 编解码在线工具,online

  • JavaScript / HTML 格式化

    使用 Prettier 在浏览器内格式化 JavaScript 或 HTML 片段。 在线工具,JavaScript / HTML 格式化在线工具,online

  • JavaScript 压缩与混淆

    Terser 压缩、变量名混淆,或 javascript-obfuscator 高强度混淆(体积会增大)。 在线工具,JavaScript 压缩与混淆在线工具,online

  • Base64 字符串编码/解码

    将字符串编码和解码为其 Base64 格式表示形式即可。 在线工具,Base64 字符串编码/解码在线工具,online

  • Base64 文件转换器

    将字符串、文件或图像转换为其 Base64 表示形式。 在线工具,Base64 文件转换器在线工具,online