当前位置: 首页 > news >正文

在shardingsphere执行存储过程

环境:

springboot:2.5.2

数据库:Kingbase金仓V8R6

依赖:

        <dependency><groupId>org.apache.shardingsphere</groupId><artifactId>sharding-jdbc-spring-boot-starter</artifactId></dependency><dependency><groupId>com.kingbase8</groupId><artifactId>kingbase8</artifactId><version>8.6.0</version></dependency>

思路一:获取Connection执行存储过程

折腾了多种方式(EntityManager、DataSource、JdbcTemplate等),发现在shardingsphere环境下,始终不支持存储过程。

原因未知,没有深究出来。

可能是shardingsphere本身就不支持存储过程分片;

也就可能跟shardingsphere版本有问题;

还有可能是跟jdbc驱动包有关系(由于shardingsphere不适配金仓,jdbc驱动依然用的是org.postgresql.Driver);

... ...

shardingjdbc数据源配置

spring:shardingsphere:datasource:app100:driver-class-name: org.postgresql.Driverjdbc-url: jdbc:postgresql://IP:端口/数据库?serverTimezone=Asia/Shanghai&useSSL=falsepassword: type: com.zaxxer.hikari.HikariDataSourceusername: connection-timeout: 30000minimum-idle: 10maximum-pool-size: 1000idle-timeout: 30000pool-name: hikari-100max-lifetime: 60000connection-test-query: SELECT 1leak-detection-threshold: 50000app101:driver-class-name: org.postgresql.Driverjdbc-url: jdbc:postgresql://IP:端口/数据库?serverTimezone=Asia/Shanghai&useSSL=falsepassword: type: com.zaxxer.hikari.HikariDataSourceusername: connection-timeout: 30000minimum-idle: 10maximum-pool-size: 1000idle-timeout: 30000pool-name: hikari-101max-lifetime: 60000connection-test-query: SELECT 1leak-detection-threshold: 50000app102:driver-class-name: org.postgresql.Driverjdbc-url: jdbc:postgresql://IP:端口/数据库?serverTimezone=Asia/Shanghai&useSSL=falsepassword: type: com.zaxxer.hikari.HikariDataSourceusername: connection-timeout: 30000minimum-idle: 10maximum-pool-size: 1000idle-timeout: 30000pool-name: hikari-102max-lifetime: 60000connection-test-query: SELECT 1leak-detection-threshold: 50000


换种思路:动态数据源

配置

spring:datasource:multiPrimary:pool-name: 100type: com.zaxxer.hikari.HikariDataSourceconnection-timeout: 30000minimum-idle: 50maximum-pool-size: 1000idle-timeout: 30000max-lifetime: 60000connection-test-query: SELECT 1username: password: jdbc-url: jdbc:kingbase8://IP:端口/数据库driver-class-name: com.kingbase8.DrivermultiSecondarys:- secondary-101:pool-name: 101type: com.zaxxer.hikari.HikariDataSourceconnection-timeout: 30000minimum-idle: 50maximum-pool-size: 1000idle-timeout: 30000max-lifetime: 60000connection-test-query: SELECT 1username: password: jdbc-url: jdbc:kingbase8://IP:端口/数据库driver-class-name: com.kingbase8.Driver- secondary-102:pool-name: 102type: com.zaxxer.hikari.HikariDataSourceconnection-timeout: 30000minimum-idle: 50maximum-pool-size: 1000idle-timeout: 30000max-lifetime: 60000connection-test-query: SELECT 1username: password: jdbc-url: jdbc:kingbase8://IP:端口/数据库driver-class-name: com.kingbase8.Driver

相关配置类源码

public class MultDataSourceUtil {private static final ThreadLocal<String> DATASOURCE_KEY = new ThreadLocal<>();public static void setDataSourceRoutingKey(String key) {DATASOURCE_KEY.set(key);}public static String getDataSourceRoutingKey() {return DATASOURCE_KEY.get();}public static void clearDataSourceRoutingKey() {DATASOURCE_KEY.remove();}
}

import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;import java.util.HashMap;
import java.util.Map;@Slf4j
@ConfigurationProperties("spring.datasource")
@Configuration
public class DataSourceConfig {private HikariDataSource multiPrimary;private Map<String, HikariDataSource> multiSecondarys = new HashMap<>();@Bean@Primarypublic DynamicDataSource falsDynamicDataSource() {Map<Object, Object> targetDataSources = new HashMap<>();multiSecondarys.forEach((key, secondary) -> {targetDataSources.put(secondary.getPoolName(), secondary);});targetDataSources.put(multiPrimary.getPoolName(), multiPrimary);DynamicDataSource dynamicDataSource = new DynamicDataSource(multiPrimary, targetDataSources);dynamicDataSource.afterPropertiesSet();return dynamicDataSource;}public HikariDataSource getMultiPrimary() {return multiPrimary;}public void setMultiPrimary(HikariDataSource multiPrimary) {this.multiPrimary = multiPrimary;}public Map<String, HikariDataSource> getMultiSecondarys() {return multiSecondarys;}public void setMultiSecondarys(Map<String, HikariDataSource> multiSecondarys) {this.multiSecondarys = multiSecondarys;}
}

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;import javax.sql.DataSource;
import java.util.Map;public class DynamicDataSource extends AbstractRoutingDataSource {public DynamicDataSource() {super();}public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) {super.setDefaultTargetDataSource(defaultTargetDataSource);super.setTargetDataSources(targetDataSources);super.afterPropertiesSet();}@Overrideprotected Object determineCurrentLookupKey() {return MultDataSourceUtil.getDataSourceRoutingKey();}
}

业务类代码

import com.alibaba.fastjson.JSONObject;
import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.sql.DataSource;
import java.sql.*;
import java.util.Date;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;@Slf4j
@Service
public class 业务ServiceImpl implements 业务Service {@Resourceprivate DataSource dataSource;@PersistenceContextprivate EntityManager em;@Overridepublic Map<String, String> zjjhpld(String paramStr) {Map<String, String> result = new HashMap<>();String msg = "";try {String orgId = "00320000000000000000";// regionQuery query = em.createNativeQuery(" SELECT 字段 FROM 表 where 字段=:orgId AND tenantId=:tenantId ");query.setParameter("orgId", orgId);query.setParameter("tenantId", tenantId);String treeinfoPath = (String) query.getSingleResult();System.out.println(treeinfoPath);// endregionMap<Object, DataSource> dataSourceMap = ((DynamicDataSource) dataSource).getResolvedDataSources();for (Map.Entry<Object, DataSource> entry : dataSourceMap.entrySet()) {String k = (String) entry.getKey();if ("100".equals(k)) {continue;}DataSource v = entry.getValue();HikariDataSource hikariDataSource = (HikariDataSource) v;Connection conn = hikariDataSource.getConnection();CallableStatement callableStatement = conn.prepareCall("{ call 存储过程(?, ?) }");callableStatement.setString(1, orgId);callableStatement.registerOutParameter(2, Types.REF_CURSOR);callableStatement.execute();ResultSet resultSet = (ResultSet) callableStatement.getObject(2);while (resultSet.next()) {System.out.println();}conn.close();}} catch (Exception e) {log.error("出现异常:", e);}return result;}
}

注意:

存储过程可以正常执行了,但是有个问题,第一个查询sql不走shardingjdbc的分库了。

发现获取的数据源已经变成了动态数据源,而不是shardingjdbc的数据源,这样不符合我们的需求。


再换个思路,去掉动态,只留下组装好的数据源

配置类代码:

import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;@Slf4j
@ConfigurationProperties("spring.datasource")
@Configuration
public class DataSourceConfig {private HikariDataSource multiPrimary;private Map<String, HikariDataSource> multiSecondarys = new HashMap<>();public HikariDataSource getMultiPrimary() {return multiPrimary;}public void setMultiPrimary(HikariDataSource multiPrimary) {this.multiPrimary = multiPrimary;}public Map<String, HikariDataSource> getMultiSecondarys() {return multiSecondarys;}public void setMultiSecondarys(Map<String, HikariDataSource> multiSecondarys) {this.multiSecondarys = multiSecondarys;}
}

业务代码:

import com.alibaba.fastjson.JSONObject;
import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.stereotype.Service;import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.sql.DataSource;
import java.sql.*;
import java.util.Date;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;@Slf4j
@Service
public class 业务ServiceImpl implements 业务Service {@Resourceprivate DefaultListableBeanFactory beanFactory;@Resourceprivate DataSourceConfig dataSourceConfig;@Resourceprivate DataSource dataSource;@PersistenceContextprivate EntityManager em;@Overridepublic Map<String, String> 业务(String paramStr) {Map<String, String> result = new HashMap<>();String msg = "";try {String orgId = "";String jhqj = "";HikariDataSource multiPrimary = dataSourceConfig.getMultiPrimary();Map<String, HikariDataSource> multiSecondarys = dataSourceConfig.getMultiSecondarys();/*HikariDataSource dataSource = new HikariDataSource();dataSource.setDriverClassName("com.mysql.jdbc.Driver");dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/db3?characterEncoding=utf8");dataSource.setUsername("root");dataSource.setPassword("123456");dataSource.getConnection();System.out.println("db3 创建完成!");beanFactory.registerSingleton("db3", dataSource);*/// regionQuery query = em.createNativeQuery(" SELECT 字段 FROM 表 where 条件=:orgId AND tenantId=:tenantId ");query.setParameter("orgId", orgId);query.setParameter("tenantId", tenantId);String val = (String) query.getSingleResult();// endregionfor (Map.Entry<String, HikariDataSource> entry : multiSecondarys.entrySet()) {String k = entry.getKey();if ("100".equals(k)) {continue;}DataSource v = entry.getValue();HikariDataSource hikariDataSource = (HikariDataSource) v;Connection conn = hikariDataSource.getConnection();CallableStatement callableStatement = conn.prepareCall("{ call 存储过程(?, ?) }");callableStatement.setString(1, orgId);callableStatement.registerOutParameter(2, Types.REF_CURSOR);callableStatement.execute();ResultSet resultSet = (ResultSet) callableStatement.getObject(2);while (resultSet.next()) {System.out.println();}conn.close();}} catch (Exception e) {log.error("出现异常:", e);}return result;}
}

第一个查询依然走shardingjdbc,存储过程可以可以正常执行。

但是执行起来特别慢,暂时无解。


其他分享

动态数据源:集成JPA + MP,具体参考《动态数据源》

JPA配置类

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.SharedEntityManagerCreator;
import org.springframework.transaction.PlatformTransactionManager;import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import java.util.Map;@Configuration
@EnableConfigurationProperties(JpaProperties.class)
@EntityScan("com.**.entity")
@EnableJpaRepositories("com.**.repository")
public class JpaExtConfiguration {@Resourceprivate JpaProperties jpaProperties;@Resourceprivate DynamicDataSource dynamicDataSource;@Beanpublic LocalContainerEntityManagerFactoryBean entityManagerFactoryBean(EntityManagerFactoryBuilder builder) {Map<String, String> properties = jpaProperties.getProperties();properties.put("hibernate.physical_naming_strategy", "org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy");return builder.dataSource(dynamicDataSource).properties(properties).packages("com.**.entity").build();}@Primary@Beanpublic EntityManagerFactory entityManagerFactory(LocalContainerEntityManagerFactoryBean entityManagerFactoryBean) {return entityManagerFactoryBean.getObject();}@Primary@Beanpublic PlatformTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) {return new JpaTransactionManager(entityManagerFactory);}@Primary@Beanpublic EntityManager entityManager(EntityManagerFactory entityManagerFactory) {return SharedEntityManagerCreator.createSharedEntityManager(entityManagerFactory);}
}

MP配置类

import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;import javax.sql.DataSource;@MapperScan(sqlSessionFactoryRef = "dynamicDataSourceSqlSessionFactory")
@Configuration
@Slf4j
public class MpExtConfiguration {@Bean@ConfigurationProperties(prefix = "mybatis-plus.global-config")public GlobalConfig globalConfig() {return new GlobalConfig();}@Bean@ConfigurationProperties(prefix = "mybatis-plus.configuration")public MybatisConfiguration mybatisConfiguration() {return new MybatisConfiguration();}@Beanpublic SqlSessionFactory dynamicDataSourceSqlSessionFactory(@Qualifier("dynamicDataSource") DataSource dynamicDataSource, GlobalConfig globalConfig, MybatisConfiguration mybatisConfiguration) throws Exception {MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();sqlSessionFactoryBean.setDataSource(dynamicDataSource);sqlSessionFactoryBean.setGlobalConfig(globalConfig);sqlSessionFactoryBean.setConfiguration(mybatisConfiguration);return (SqlSessionFactory) sqlSessionFactoryBean.getObject();}
}

MP配置

mybatis-plus:global-config:enable-sql-runner: trueconfiguration:log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

相关文章:

在shardingsphere执行存储过程

环境&#xff1a; springboot&#xff1a;2.5.2 数据库&#xff1a;Kingbase金仓V8R6 依赖&#xff1a; <dependency><groupId>org.apache.shardingsphere</groupId><artifactId>sharding-jdbc-spring-boot-starter</artifactId></depende…...

1.文件目录操作

目录 &#x1f34c; ls - 列出目录内容 &#x1f349;cp - 复制文件或目录 &#x1f347;mv - 移动或重命名文件 &#x1f353; cd - 切换目录 &#x1f348; pwd - 打印工作目录 &#x1f352;mkdir - 创建目录 &#x1f351; rmdir - 删除空目录 &#x1f96d; touc…...

Vue单页面应用和多页面应用

在 Vue.js 中&#xff0c;“单页面”&#xff08;SPA&#xff0c;Single Page Application&#xff09;和"多页面"&#xff08;MPA&#xff0c;Multi Page Application&#xff09;是两种不同的应用结构&#xff0c;它们的差异主要体现在页面的加载方式、路由的使用、…...

Lombok :简化 Java 编程的得力工具

在 Java 开发过程中&#xff0c;常常需要编写大量的样板代码&#xff0c;例如构造函数、Getter 和 Setter 方法、equals 和 hashCode 方法等。这些代码虽然逻辑相对固定&#xff0c;但编写起来却较为繁琐且容易出错&#xff0c;并且会使代码显得冗长。Lombok 应运而生&#xff…...

AIGC引领金融大模型革命:未来已来

文章目录 金融大模型的应用场景1. **金融风险管理**2. **量化交易**3. **个性化投资建议**4. **金融欺诈检测和预防**5. **智能客户服务** 金融大模型开发面临的挑战应对策略《金融大模型开发基础与实践》亮点内容简介作者简介获取方式 在AIGC&#xff08;Artificial Intellige…...

DBA面试题-1

面临失业&#xff0c;整理一下面试题&#xff0c;找下家继续搬砖 主要参考&#xff1a;https://www.csdn.net/?spm1001.2101.3001.4476 略有修改 一、mysql有哪些数据类型 1&#xff0c; 整形 tinyint,smallint,medumint,int,bigint&#xff1b;分别占用1字节、2字节、3字节…...

用go语言写一个小服务

文章目录 简介重新想到go 小服务main.go部署测试 结束语 简介 golang的优势 响应速度&#xff1a; Go > Java > Python 内存占用&#xff1a; Go < Java < Python 从java转go&#xff0c;然后go又转java&#xff0c;感觉就是go虽然在编译、内存占用都强于java&am…...

亚马逊开发视频人工智能模型,The Information 报道

根据《The Information》周三的报道&#xff0c;电子商务巨头亚马逊&#xff08;AMZN&#xff09;已开发出一种新的生成式人工智能&#xff08;AI&#xff09;&#xff0c;不仅能处理文本&#xff0c;还能处理图片和视频&#xff0c;从而减少对人工智能初创公司Anthropic的依赖…...

WordCloud参数的用法:

-------------词云图集合------------- 用WordcloudPyQt5写个词云图生成器1.0 WordCloud去掉停用词&#xff08;fit_wordsgenerate&#xff09;的2种用法 通过词频来绘制词云图&#xff08;jiebaWordCloud&#xff09; Python教程95&#xff1a;去掉停用词词频统计jieba.toke…...

qml调用c++类内函数的三种方法

一.方法一&#xff1a;使用 Q_INVOKABLE 宏声明成员函数 1.第一步&#xff1a;依然需要新建一个类NetworkHandler: #include <QObject> class NetworkHandler : public QObject { Q_OBJECT public: explicit NetworkHandler(QObject *parent nullptr); Q_INVOKAB…...

NLP任务四大范式的进阶历程:从传统TF-IDF到Prompt-Tuning(提示词微调)

引言&#xff1a;从TF-IDF到Prompt-Tuning&#xff08;提示词微调&#xff09;&#xff0c;NLP的四次变革 自然语言处理&#xff08;NLP&#xff09;技术从最早的手工特征设计到如今的Prompt-Tuning&#xff0c;经历了四个重要阶段。随着技术的不断发展&#xff0c;我们的目标…...

GAMES101:现代计算机图形学入门-笔记-09

久违的101图形学回归咯 今天的话题应该是比较轻松的&#xff1a;聊一聊在渲染中比较先进的topics Advanced Light Transport 首先是介绍一系列比较先进的光线传播方法&#xff0c;有无偏的如BDPT&#xff08;双向路径追踪&#xff09;&#xff0c;MLT&#xff08;梅特罗波利斯…...

【Db First】.NET开源 ORM 框架 SqlSugar 系列

.NET开源 ORM 框架 SqlSugar 系列 【开篇】.NET开源 ORM 框架 SqlSugar 系列【入门必看】.NET开源 ORM 框架 SqlSugar 系列【实体配置】.NET开源 ORM 框架 SqlSugar 系列【Db First】.NET开源 ORM 框架 SqlSugar 系列【Code First】.NET开源 ORM 框架 SqlSugar 系列 &#x1f…...

MySQL聚合查询分组查询联合查询

#对应代码练习 -- 创建考试成绩表 DROP TABLE IF EXISTS exam; CREATE TABLE exam ( id bigint, name VARCHAR(20), chinese DECIMAL(3,1), math DECIMAL(3,1), english DECIMAL(3,1) ); -- 插入测试数据 INSERT INTO exam (id,name, chinese, math, engli…...

告别照相馆!使用AI证件照工具HivisionIDPhotos打造在线证件照制作软件

文章目录 前言1. 安装Docker2. 本地部署HivisionIDPhotos3. 简单使用介绍4. 公网远程访问制作照片4.1 内网穿透工具安装4.2 创建远程连接公网地址 5. 配置固定公网地址 前言 本文主要介绍如何在Linux系统使用Docker快速部署一个AI证件照工具HivisionIDPhotos&#xff0c;并结合…...

通信原理第三次实验

实验目的与内容 实验操作与结果 5.1 刚开始先不加入白噪声&#xff0c;系统设计如下&#xff1a; 正弦波参数设置如下&#xff1a; FM设计如下&#xff1a; 延迟设计如下&#xff1a; 两个滤波器设计参数如下&#xff1a; 输出信号频谱为&#xff08;未加入噪声&#xff09;&a…...

【halcon】Metrology工具系列之 get_metrology_object_result_contour

get_metrology_object_result_contour (操作员) 名称 get_metrology_object_result_contour — 查询测量对象的结果轮廓。 签名 get_metrology_object_result_contour( : Contour : MetrologyHandle, Index, Instance, Resolution : ) 描述 get_metrology_object_result_…...

A052-基于SpringBoot的酒店管理系统

&#x1f64a;作者简介&#xff1a;在校研究生&#xff0c;拥有计算机专业的研究生开发团队&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的网站项目。 代码可以查看文章末尾⬇️联系方式获取&#xff0c;记得注明来意哦~&#x1f339; 赠送计算机毕业设计600…...

NLP信息抽取大总结:三大任务(带Prompt模板)

信息抽取大总结 1.NLP的信息抽取的本质&#xff1f;2.信息抽取三大任务&#xff1f;3.开放域VS限定域4.信息抽取三大范式&#xff1f;范式一&#xff1a;基于自定义规则抽取&#xff08;2018年前&#xff09;范式二&#xff1a;基于Bert下游任务建模抽取&#xff08;2018年后&a…...

python常见问题-pycharm无法导入三方库

1.运行环境 python版本&#xff1a;Python 3.9.6 需导入的greenlet版本&#xff1a;greenlet 3.1.1 2.当前的问题 由于需要使用到greenlet三方库&#xff0c;所以进行了导入&#xff0c;以下是我个人导入时的全过程 ①首先尝试了第1种导入方式&#xff1a;使用pycharm进行…...

Unity3D中Gfx.WaitForPresent优化方案

前言 在Unity中&#xff0c;Gfx.WaitForPresent占用CPU过高通常表示主线程在等待GPU完成渲染&#xff08;即CPU被阻塞&#xff09;&#xff0c;这表明存在GPU瓶颈或垂直同步/帧率设置问题。以下是系统的优化方案&#xff1a; 对惹&#xff0c;这里有一个游戏开发交流小组&…...

Vue3 + Element Plus + TypeScript中el-transfer穿梭框组件使用详解及示例

使用详解 Element Plus 的 el-transfer 组件是一个强大的穿梭框组件&#xff0c;常用于在两个集合之间进行数据转移&#xff0c;如权限分配、数据选择等场景。下面我将详细介绍其用法并提供一个完整示例。 核心特性与用法 基本属性 v-model&#xff1a;绑定右侧列表的值&…...

论文解读:交大港大上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(一)

宇树机器人多姿态起立控制强化学习框架论文解析 论文解读&#xff1a;交大&港大&上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架&#xff08;一&#xff09; 论文解读&#xff1a;交大&港大&上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化…...

12.找到字符串中所有字母异位词

&#x1f9e0; 题目解析 题目描述&#xff1a; 给定两个字符串 s 和 p&#xff0c;找出 s 中所有 p 的字母异位词的起始索引。 返回的答案以数组形式表示。 字母异位词定义&#xff1a; 若两个字符串包含的字符种类和出现次数完全相同&#xff0c;顺序无所谓&#xff0c;则互为…...

【JavaSE】绘图与事件入门学习笔记

-Java绘图坐标体系 坐标体系-介绍 坐标原点位于左上角&#xff0c;以像素为单位。 在Java坐标系中,第一个是x坐标,表示当前位置为水平方向&#xff0c;距离坐标原点x个像素;第二个是y坐标&#xff0c;表示当前位置为垂直方向&#xff0c;距离坐标原点y个像素。 坐标体系-像素 …...

大学生职业发展与就业创业指导教学评价

这里是引用 作为软工2203/2204班的学生&#xff0c;我们非常感谢您在《大学生职业发展与就业创业指导》课程中的悉心教导。这门课程对我们即将面临实习和就业的工科学生来说至关重要&#xff0c;而您认真负责的教学态度&#xff0c;让课程的每一部分都充满了实用价值。 尤其让我…...

Web 架构之 CDN 加速原理与落地实践

文章目录 一、思维导图二、正文内容&#xff08;一&#xff09;CDN 基础概念1. 定义2. 组成部分 &#xff08;二&#xff09;CDN 加速原理1. 请求路由2. 内容缓存3. 内容更新 &#xff08;三&#xff09;CDN 落地实践1. 选择 CDN 服务商2. 配置 CDN3. 集成到 Web 架构 &#xf…...

【Redis】笔记|第8节|大厂高并发缓存架构实战与优化

缓存架构 代码结构 代码详情 功能点&#xff1a; 多级缓存&#xff0c;先查本地缓存&#xff0c;再查Redis&#xff0c;最后才查数据库热点数据重建逻辑使用分布式锁&#xff0c;二次查询更新缓存采用读写锁提升性能采用Redis的发布订阅机制通知所有实例更新本地缓存适用读多…...

Proxmox Mail Gateway安装指南:从零开始配置高效邮件过滤系统

&#x1f49d;&#x1f49d;&#x1f49d;欢迎莅临我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里可以感受到一份轻松愉快的氛围&#xff0c;不仅可以获得有趣的内容和知识&#xff0c;也可以畅所欲言、分享您的想法和见解。 推荐&#xff1a;「storms…...

QT开发技术【ffmpeg + QAudioOutput】音乐播放器

一、 介绍 使用ffmpeg 4.2.2 在数字化浪潮席卷全球的当下&#xff0c;音视频内容犹如璀璨繁星&#xff0c;点亮了人们的生活与工作。从短视频平台上令人捧腹的搞笑视频&#xff0c;到在线课堂中知识渊博的专家授课&#xff0c;再到影视平台上扣人心弦的高清大片&#xff0c;音…...