- 浏览: 155486 次
- 性别:
- 来自: 石家庄
-
文章分类
- 全部博客 (66)
- filnet pe eform (1)
- svn (1)
- ASM (3)
- 算法 k-means (1)
- FileNet unfile query sql (1)
- FileNet fetchRows fetchObjects (1)
- linux chkconfig (1)
- websphere profile linux manageprofiles (1)
- db2 linux install (1)
- IBM Tivoli Directory Server linux (1)
- download jandan.net pic (1)
- jquery picture view (1)
- db2 db2cc (1)
- FileNet (0)
- FileNet redbook (7)
- Test upload (0)
- test 博客2doc (0)
- nginx (1)
- Google-perftools (1)
- openSSL (1)
- pcre (1)
- libunwind (1)
- nginx.conf (1)
- ASM,AOP (0)
- oracle sql (1)
- webservice cxf wsdl2java (1)
- spring3 hibernate4 mutil datasource/database (1)
- java 线程 thread run (1)
- java 64进制 (0)
- java 62进制 (1)
- activemq camel spring jms (2)
- mysql5.5 Master Master Replication (1)
- centos7 hostname httpd port (1)
- centos (1)
- hostname (1)
- change http port (1)
- test (0)
- zookeeper (2)
- 无语面试 (1)
- spring+mybatis+Mysql+proc+分页 (0)
- spring+mybatis+Mysql+proc+分页+paging (2)
最新评论
-
chenchunhuis:
我们最近也在做这个事情,一楼的评论很有道理
spring3+hibernate4+maven+junit 多库/多数据源实现 -
mjs123:
你好,我执行的时候 怎么老是报 No Session foun ...
spring3+hibernate4+maven+junit 多库/多数据源实现 -
chen_bing8:
但是不知道怎么配置默认实例,用JDBC连接后没有默认实例。
linux 下 db2 TCP 服务 配置 -
chen_bing8:
非常好,照着修改成功了
linux 下 db2 TCP 服务 配置 -
yixiandave:
不喜欢写一长串char[]。。。直接写一个String然后调c ...
短ID生成基于62进制
spring3+hibernate4+maven+junit 多库/多数据源实现
1.核心思想:
2.动态指定数据源的方法约定:
3.实现代码
4.这样实现的缺点,暂时还未想到。欢迎网友补充。
5.开始贴代码,附件(hsm.zip)是eclipse下的项目工程包。
6.建库、表sql
7.maven jar包依赖 pom.xml
8.spring配置文件
9.properties 配置文件
10.java 代码 略去 java bean 即spring中的model代码只贴 dao 。
父类dao
注意UsersDao的包路径是 package com.xkorey.db.master.dao;
注意UserinfoDao的包路径是 package com.xkorey.db.slave.dao;
11.junit 测试类
测试类运行结果:
截图:
12.最后贴张工程截图
13.项目环境
jdk7,eclipse Version: Kepler Release.maven:apache-maven-3.0.4
对的,对于读取的,全部从slave中读,插入和更新,都往主库里面操作。
你说的有道理。这样做的话,那分包也就不用了。直接注入就可以了。
思路 写道
通过spring对多数据源的管理,在dao中动态的指定相对应的datasource。
2.动态指定数据源的方法约定:
约定 写道
不同库的dao放到对应的包下例:Master库中的dao的包路径是com.***.db.master.*。slave库的dao包的路径应是com.***.db.slave.***。
判定数据原方法 写道
判定dao类的路径是否包含master或者slave从而加载对应的数据源
3.实现代码
private void fixSession(){ String name=this.getClass().getName(); /** * 如果是master 包下的dao 全部指定为 masterSessionFactory */ if(name.indexOf("com.xkorey.db.master")>-1){ sessionFactory = masterSessionFactory; } /** * 默认的dao是 slaveSessionFactory 下的库 */ else{ sessionFactory = slaveSessionFactory; } }
4.这样实现的缺点,暂时还未想到。欢迎网友补充。
缺陷 写道
未知
5.开始贴代码,附件(hsm.zip)是eclipse下的项目工程包。
6.建库、表sql
--create database -- master database create database master character set `gbk` collate `gbk_chinese_ci`; -- slave database create database slave character set `gbk` collate `gbk_chinese_ci`; -- create tables use master; create table users( id int not null auto_increment, name varchar(20), age int, primary key(id)) ENGINE = INNODB,AUTO_INCREMENT=1000; use slave; create table user_info( id int not null auto_increment, uid int, info varchar(20), primary key(id)) ENGINE = INNODB,AUTO_INCREMENT=1000; --insert data use master; insert into users(name,age) values('xkorey',28); use slave; insert into user_info(uid,info) values(1000,'hello xkorey.');
7.maven jar包依赖 pom.xml
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hsm</groupId> <artifactId>hsm</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>hsm Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>3.1.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>3.2.1.RELEASE</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.7.2</version> </dependency> <!-- hibernate --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.2.2.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version> </dependency> <!-- mysql --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.25</version> </dependency> </dependencies> <build> <finalName>hsm</finalName> </build> </project>
8.spring配置文件
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd "> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:hsm-db-master.properties</value> <value>classpath:hsm-db-slave.properties</value> </list> </property> </bean> <context:annotation-config /> <context:component-scan base-package="com.xkorey.db" /> <import resource="db-master.xml" /> <import resource="db-slave.xml" /> </beans>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd "> <!-- Hibernate Data Source --> <bean id="masterDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"><value>${connection.master.driver_class}</value></property> <property name="url"><value>${connection.master.url}</value></property> <property name="username"><value>${connection.master.username}</value></property> <property name="password"><value>${connection.master.password}</value></property> </bean> <!-- Hibernate Session Factory --> <bean id="masterSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource"><ref local="masterDataSource"/></property> <property name="packagesToScan" value="com.xkorey.db.master" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.master.dialect}</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) HibernateTransactionManager --> <tx:annotation-driven transaction-manager="masterTransactionManager"/> <bean id="masterTransactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory"><ref local="masterSessionFactory"/></property> </bean> </beans>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd "> <!-- Hibernate Data Source --> <bean id="slaveDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"><value>${connection.slave.driver_class}</value></property> <property name="url"><value>${connection.slave.url}</value></property> <property name="username"><value>${connection.slave.username}</value></property> <property name="password"><value>${connection.slave.password}</value></property> </bean> <!-- Hibernate Session Factory --> <bean id="slaveSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource"><ref local="slaveDataSource"/></property> <property name="packagesToScan" value="com.xkorey.db.slave" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.slave.dialect}</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) HibernateTransactionManager --> <tx:annotation-driven transaction-manager="slaveTransactionManager"/> <bean id="slaveTransactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory"><ref local="slaveSessionFactory"/></property> </bean> </beans>
9.properties 配置文件
hibernate.master.dialect=org.hibernate.dialect.MySQLInnoDBDialect connection.master.driver_class=com.mysql.jdbc.Driver connection.master.url=jdbc:mysql://localhost:3306/master?useUnicode=true&characterEncoding=gbk connection.master.username=root connection.master.password=这里是你连库的密码
hibernate.slave.dialect=org.hibernate.dialect.MySQLInnoDBDialect connection.slave.driver_class=com.mysql.jdbc.Driver connection.slave.url=jdbc:mysql://localhost:3306/slave?useUnicode=true&characterEncoding=gbk connection.slave.username=root connection.slave.password=这里是你连库的密码
10.java 代码 略去 java bean 即spring中的model代码只贴 dao 。
父类dao
public class GenericDao<T extends java.io.Serializable> { @Autowired @Qualifier("masterSessionFactory") private SessionFactory masterSessionFactory; @Autowired @Qualifier("slaveSessionFactory") private SessionFactory slaveSessionFactory; private SessionFactory sessionFactory; private void fixSession(){ String name=this.getClass().getName(); /** * 如果是master 包下的dao 全部指定为 masterSessionFactory */ if(name.indexOf("com.xkorey.db.master")>-1){ sessionFactory = masterSessionFactory; } /** * 默认的dao是 slaveSessionFactory 下的库 */ else{ sessionFactory = slaveSessionFactory; } } public Session getSession() { fixSession(); return sessionFactory.getCurrentSession(); }
注意UsersDao的包路径是 package com.xkorey.db.master.dao;
@Repository("UsersDao") public class UsersDao extends GenericDao<Users>{ //根据网友建议其实也可以在dao中直接注入 sessionFactory 像这样 // @Autowired // @Qualifier("masterSessionFactory") // private SessionFactory sessionFactory; }
注意UserinfoDao的包路径是 package com.xkorey.db.slave.dao;
@Repository("UserinfoDao") public class UserinfoDao extends GenericDao<Userinfo>{ // 根据网友建议实也可以在dao中直接注入 sessionFactory 像这样 // @Autowired // @Qualifier("slaveSessionFactory") // private SessionFactory sessionFactory; }
@Service("UsersService") @Transactional(value="masterTransactionManager") public class UsersService { @Autowired @Qualifier("UsersDao") private UsersDao usersDao; public int findUserAgeById(int id){ Users users = (Users) usersDao.getSession().get(Users.class,id); return users.age; } }
@Service("UserinfoService") @Transactional(value="slaveTransactionManager") public class UserinfoService { @Autowired @Qualifier("UserinfoDao") private UserinfoDao userinfoDao; public String findUserInfoById(int id){ Userinfo userinfo = (Userinfo) userinfoDao.getSession().get(Userinfo.class,id); return userinfo.info; } }
11.junit 测试类
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:spring-base.xml"}) public class TestDao { @Autowired @Qualifier("UsersService") private UsersService usersService; @Autowired @Qualifier("UserinfoService") private UserinfoService userinfoService; @Test public void testMutilDataSource(){ int id=1000; System.out.println(usersService.findUserAgeById(id)); System.out.println(userinfoService.findUserInfoById(id)); } }
测试类运行结果:
Hibernate: select users0_.id as id1_0_0_, users0_.age as age2_0_0_, users0_.name as name3_0_0_ from users users0_ where users0_.id=? 28 Hibernate: select userinfo0_.id as id1_0_0_, userinfo0_.info as info2_0_0_, userinfo0_.uid as uid3_0_0_ from user_info userinfo0_ where userinfo0_.id=? hello xkorey.
截图:

12.最后贴张工程截图

13.项目环境
jdk7,eclipse Version: Kepler Release.maven:apache-maven-3.0.4
评论
5 楼
chenchunhuis
2015-06-10
我们最近也在做这个事情,一楼的评论很有道理



4 楼
mjs123
2015-03-11
你好,我执行的时候 怎么老是报 No Session found for current thread 这个错误?
3 楼
youjianbo_han_87
2013-08-05
追求技术 写道
你这是在提前已经知道了该使用哪个数据源的情况下使用多数据源,个人觉得完全没有必要再在代码里面通过class name来区别该使用哪个数据源。比如你把所有使用master数据源的dao都放到master包下面,既然你已经知道了某一dao是使用的master数据源,那么你完全可以在这个代码中直接注入一个master数据源对应的sessionFactory。
对的,对于读取的,全部从slave中读,插入和更新,都往主库里面操作。
2 楼
xkorey
2013-08-05
追求技术 写道
你这是在提前已经知道了该使用哪个数据源的情况下使用多数据源,个人觉得完全没有必要再在代码里面通过class name来区别该使用哪个数据源。比如你把所有使用master数据源的dao都放到master包下面,既然你已经知道了某一dao是使用的master数据源,那么你完全可以在这个代码中直接注入一个master数据源对应的sessionFactory。
你说的有道理。这样做的话,那分包也就不用了。直接注入就可以了。
1 楼
追求技术
2013-08-05
你这是在提前已经知道了该使用哪个数据源的情况下使用多数据源,个人觉得完全没有必要再在代码里面通过class name来区别该使用哪个数据源。比如你把所有使用master数据源的dao都放到master包下面,既然你已经知道了某一dao是使用的master数据源,那么你完全可以在这个代码中直接注入一个master数据源对应的sessionFactory。
相关推荐
"Spring3+Hibernate4+Maven+JUnit 多库多数据源实现"是一个典型的Java Web项目配置,它涉及了多个核心技术来处理复杂的数据管理需求。下面将详细阐述这些技术以及如何协同工作以实现多库多数据源。 首先,Spring...
常用1.SchLib
# 【tokenizers-***.jar***文档.zip】 中包含: ***文档:【tokenizers-***-javadoc-API文档-中文(简体)版.zip】 jar包下载地址:【tokenizers-***.jar下载地址(官方地址+国内镜像地址).txt】 Maven依赖:【tokenizers-***.jar Maven依赖信息(可用于项目pom.xml).txt】 Gradle依赖:【tokenizers-***.jar Gradle依赖信息(可用于项目build.gradle).txt】 源代码下载地址:【tokenizers-***-sources.jar下载地址(官方地址+国内镜像地址).txt】 # 本文件关键字: tokenizers-***.jar***文档.zip,java,tokenizers-***.jar,ai.djl.huggingface,tokenizers,***,ai.djl.engine.rust,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,djl,huggingface,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压 【tokenizers-***.jar***文档.zip】,再解压其中的 【tokenizers-***-javadoc-API文档-中文(简体)版.zip】,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件; # Maven依赖: ``` <dependency> <groupId>ai.djl.huggingface</groupId> <artifactId>tokenizers</artifactId> <version>***</version> </dependency> ``` # Gradle依赖: ``` Gradle: implementation group: 'ai.djl.huggingface', name: 'tokenizers', version: '***' Gradle (Short): implementation 'ai.djl.huggingface:tokenizers:***' Gradle (Kotlin): implementation("ai.djl.huggingface:tokenizers:***") ``` # 含有的 Java package(包): ``` ai.djl.engine.rust ai.djl.engine.rust.zoo ai.djl.huggingface.tokenizers ai.djl.huggingface.tokenizers.jni ai.djl.huggingface.translator ai.djl.huggingface.zoo ``` # 含有的 Java class(类): ``` ai.djl.engine.rust.RsEngine ai.djl.engine.rust.RsEngineProvider ai.djl.engine.rust.RsModel ai.djl.engine.rust.RsNDArray ai.djl.engine.rust.RsNDArrayEx ai.djl.engine.rust.RsNDArrayIndexer ai.djl.engine.rust.RsNDManager ai.djl.engine.rust.RsSymbolBlock ai.djl.engine.rust.RustLibrary ai.djl.engine.rust.zoo.RsModelZoo ai.djl.engine.rust.zoo.RsZooProvider ai.djl.huggingface.tokenizers.Encoding ai.djl.huggingface.tokenizers.HuggingFaceTokenizer ai.djl.huggingface.tokenizers.HuggingFaceTokenizer.Builder ai.djl.hu
内容概要:本文详细探讨了电力系统中PMU(相量测量单元)的优化配置问题,旨在确保系统完全可观测的同时尽量减少PMU的数量。作者介绍了六种不同的算法,包括模拟退火、图论方法、递归安全N算法等,并通过MATLAB实现了这些算法。通过对IEEE标准测试系统的实验,展示了各种算法在不同规模系统中的表现。文中不仅提供了具体的MATLAB代码实现,还分享了许多实用的经验技巧,如邻域解生成、退火速率设置、拓扑排序等。 适合人群:从事电力系统研究的技术人员、研究生以及对组合优化感兴趣的科研工作者。 使用场景及目标:适用于电力系统状态估计、故障诊断等领域,帮助研究人员和工程师找到最优的PMU配置方案,提高系统的可靠性和经济性。 其他说明:文章强调了在实际应用中需要注意的问题,如变压器支路的影响、节点编号不连续等问题,并推荐了几篇相关领域的经典文献供进一步学习。此外,还提到了一些有趣的发现,如某些中间节点装PMU反而能减少总数。
# 压缩文件中包含: 中文文档 jar包下载地址 Maven依赖 Gradle依赖 源代码下载地址 # 本文件关键字: jar中文文档.zip,java,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,中文API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压最外层zip,再解压其中的zip包,双击 【index.html】 文件,即可用浏览器打开、进行查看。 # 特殊说明: ·本文档为人性化翻译,精心制作,请放心使用。 ·只翻译了该翻译的内容,如:注释、说明、描述、用法讲解 等; ·不该翻译的内容保持原样,如:类名、方法名、包名、类型、关键字、代码 等。 # 温馨提示: (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以确保这就是你需要的文件;
内容概要:本文详细介绍了三菱FX1s PLC与台达MS300变频器通过Modbus RTU协议实现通讯的方法。首先,文中列举了所需的硬件设备及其连接方法,确保PLC与变频器能够正常通信。接下来,针对频率设定、频率读取及正反转启停控制三大主要功能进行了详细的编程讲解,提供了具体的梯形图代码示例并解释了每一步的作用。此外,还涉及到了触摸屏(MCGS和威纶通)的配置步骤,使用户可以通过触摸屏方便地操作变频器的各项功能。最后,作者分享了一些实用的小技巧和常见错误避免方法,帮助使用者快速解决问题,提高工作效率。 适合人群:从事自动化控制系统集成的技术人员,尤其是那些需要将三菱PLC与台达变频器进行互联的工程师。 使用场景及目标:适用于工业自动化领域的项目实施过程中,旨在帮助技术人员掌握三菱FX1s与台达MS300变频器之间的高效通信技术,从而更好地完成系统集成任务。 其他说明:文中不仅包含了详细的理论知识和技术要点,还有丰富的实践经验分享,有助于读者全面理解和应用相关技术。同时,提供的完整工程文件可以直接应用于实际项目中,极大地节省了开发时间和成本。
winrar免费版压缩工具
内容概要:本文详细介绍了灰狼算法(GWO)、鲸鱼算法(WOA)和人工蜂群算法(ABC)在CEC21标准测试函数集上的性能对比。通过设定相同的实验条件(种群数量50,迭代次数500次,30维问题空间),分别探讨了各算法的关键参数调整及其对不同类型函数(单峰、多峰、复合)的影响。文中提供了每个算法的核心代码片段,并针对具体函数给出了优化建议。最终结果显示,GWO在单峰函数上有优势,WOA擅长处理旋转和平移问题,而ABC在高维复杂环境中表现出色。 适合人群:从事优化算法研究的科研人员、研究生以及对智能优化算法感兴趣的开发者。 使用场景及目标:适用于需要评估和比较不同优化算法性能的研究项目,特别是那些涉及高维、多峰、旋转平移等问题的实际应用场景。目标是帮助研究人员选择最适合特定任务的优化算法,并提供参数调优的经验。 其他说明:文章不仅提供了理论分析,还分享了许多实践经验,如参数调整技巧、初始化方法等。此外,所有实验均基于Matlab平台完成,附带完整的代码实现,方便读者复现实验结果。
电控开关.SchLib
# 【spring-ai-autoconfigure-model-openai-1.0.0-M7.jar中文-英文对照文档.zip】 中包含: 中文-英文对照文档:【spring-ai-autoconfigure-model-openai-1.0.0-M7-javadoc-API文档-中文(简体)-英语-对照版.zip】 jar包下载地址:【spring-ai-autoconfigure-model-openai-1.0.0-M7.jar下载地址(官方地址+国内镜像地址).txt】 Maven依赖:【spring-ai-autoconfigure-model-openai-1.0.0-M7.jar Maven依赖信息(可用于项目pom.xml).txt】 Gradle依赖:【spring-ai-autoconfigure-model-openai-1.0.0-M7.jar Gradle依赖信息(可用于项目build.gradle).txt】 源代码下载地址:【spring-ai-autoconfigure-model-openai-1.0.0-M7-sources.jar下载地址(官方地址+国内镜像地址).txt】 # 本文件关键字: spring-ai-autoconfigure-model-openai-1.0.0-M7.jar中文-英文对照文档.zip,java,spring-ai-autoconfigure-model-openai-1.0.0-M7.jar,org.springframework.ai,spring-ai-autoconfigure-model-openai,1.0.0-M7,org.springframework.ai.model.openai.autoconfigure,jar包,Maven,第三方jar包,组件,开源组件,第三方
c++复习题.doc
本科毕业设计(论文)中期检查报告
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
weixin248食堂订餐小程序ssm(文档+源码)_kaic
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
e1e90185ca2f1eda312e7f604d38195c_b4125f83523abcb38acd9dc0deebd500
# 【spring-ai-autoconfigure-mcp-client-1.0.0-M7.jar中文-英文对照文档.zip】 中包含: 中文-英文对照文档:【spring-ai-autoconfigure-mcp-client-1.0.0-M7-javadoc-API文档-中文(简体)-英语-对照版.zip】 jar包下载地址:【spring-ai-autoconfigure-mcp-client-1.0.0-M7.jar下载地址(官方地址+国内镜像地址).txt】 Maven依赖:【spring-ai-autoconfigure-mcp-client-1.0.0-M7.jar Maven依赖信息(可用于项目pom.xml).txt】 Gradle依赖:【spring-ai-autoconfigure-mcp-client-1.0.0-M7.jar Gradle依赖信息(可用于项目build.gradle).txt】 源代码下载地址:【spring-ai-autoconfigure-mcp-client-1.0.0-M7-sources.jar下载地址(官方地址+国内镜像地址).txt】 # 本文件关键字: spring-ai-autoconfigure-mcp-client-1.0.0-M7.jar中文-英文对照文档.zip,java,spring-ai-autoconfigure-mcp-client-1.0.0-M7.jar,org.springframework.ai,spring-ai-autoconfigure-mcp-client,1.0.0-M7,org.springframework.ai.mcp.client.autoconfigure,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,springfram
该项目使用 OpenCV 实现图像中红色目标的识别与轮廓框选,适用于图像处理、颜色追踪与形状检测等场景。项目无需深度学习框架,适合图像识别技术入门学习。附带测试图像与运行说明,支持一键运行。
爱威6-8电脑调音软件是专为音响爱好者和专业人士设计的一款强大工具,喜欢的话,直接下载吧
# 【spring-ai-vertex-ai-0.8.0.jar中文-英文对照文档.zip】 中包含: 中文-英文对照文档:【spring-ai-vertex-ai-0.8.0-javadoc-API文档-中文(简体)-英语-对照版.zip】 jar包下载地址:【spring-ai-vertex-ai-0.8.0.jar下载地址(官方地址+国内镜像地址).txt】 Maven依赖:【spring-ai-vertex-ai-0.8.0.jar Maven依赖信息(可用于项目pom.xml).txt】 Gradle依赖:【spring-ai-vertex-ai-0.8.0.jar Gradle依赖信息(可用于项目build.gradle).txt】 源代码下载地址:【spring-ai-vertex-ai-0.8.0-sources.jar下载地址(官方地址+国内镜像地址).txt】 # 本文件关键字: spring-ai-vertex-ai-0.8.0.jar中文-英文对照文档.zip,java,spring-ai-vertex-ai-0.8.0.jar,org.springframework.ai,spring-ai-vertex-ai,0.8.0,org.springframework.ai.vertex,jar包,Maven,第三方jar包,组件,开源组件,第三方组件,Gradle,springframework,spring,ai,vertex,中文-英文对照API文档,手册,开发手册,使用手册,参考手册 # 使用方法: 解压 【spring-ai-vertex-ai-0.8.0.jar中文-英文对照文档.zip】,再解压其中的 【spring-ai-vertex-ai-0.8.0-javadoc-API文档-中文(简体)-英语-对照版.zip】,双