`
yangzb
  • 浏览: 3513558 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Pathway from ACEGI to Spring Security 2.0

阅读更多

Formerly called ACEGI Security for Spring, the re-branded Spring Security 2.0 has delivered on its promises of making it simpler to use and improving developer productivity. Already considered as the Java platform's most widely used enterprise security framework with over 250,000 downloads from SourceForge, Spring Security 2.0 provides a host of new features.

This article outlines how to convert your existing ACEGI based Spring application to use Spring Security 2.0.

What is Spring Security 2.0

Spring Security 2.0 has recently been released as a replacement to ACEGI and it provides a host of new security features:

  • Substantially simplified configuration.
  • OpenID integration, single sign on standard.
  • Windows NTLM support, single sign on against Windows corporate networks.
  • Support for JSR 250 ("EJB 3") security annotations.
  • AspectJ pointcut expression language support.
  • Comprehensive support for RESTful web request authorization.
  • Long-requested support for groups, hierarchical roles and a user management API.
  • An improved, database-backed "remember me" implementation.
  • New support for web state and flow transition authorization through the Spring Web Flow 2.0 release.
  • Enhanced WSS (formerly WS-Security) support through the Spring Web Services 1.5 release.
  • A whole lot more...

Goal

Currently I work on a Spring web application that uses ACEGI to control access to the secure resources. Users are stored in a database and as such we have configured ACEGI to use a JDBC based UserDetails Service. Likewise, all of our web resources are stored in the database and ACEGI is configure to use a custom AbstractFilterInvocationDefinitionSource to check authorization details for each request.
With the release of Spring Security 2.0 I would like to see if I can replace ACEGI and keep the current ability to use the database as our source of authentication and authorization instead of the XML configuration files (as most examples demonstrate).

Here are the steps that I took...

Steps

  1. The first (and trickiest) step was to download the new Spring Security 2.0 Framework and make sure that the jar files are deployed to the correct location. (/WEB-INF/lib/ )
    There are 22 jar files that come with the Spring Security 2.0 download. I did not need to use all of them (especially not the *sources packages). For this exercise I only had to include:
    • spring-security-acl-2.0.0.jar
    • spring-security-core-2.0.0.jar
    • spring-security-core-tiger-2.0.0.jar
    • spring-security-taglibs-2.0.0.jar
  2. Configure a DelegatingFilterProxy in the web.xml file.
    <filter>
    	<filter-name>springSecurityFilterChain</filter-name>
    	<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
    	<filter-name>springSecurityFilterChain</filter-name>
    	<url-pattern>/*</url-pattern>
    </filter-mapping>
  3. Configuration of Spring Security 2.0 is far more concise than ACEGI, so instead of changing my current ACEGI based configuration file, I found it easier to start from a empty file. If you do want to change your existing configuration file, I am sure that you will be deleting more lines than adding.

    The first part of the configuration is to specifiy the details for the secure resource filter, this is to allow secure resources to be read from the database and not from the actual configuration file. This is an example of what you will see in most of the examples:
    <http auto-config="true" access-denied-page="/403.jsp">
    	<intercept-url pattern="/index.jsp" access="ROLE_ADMINISTRATOR,ROLE_USER"/>
    	<intercept-url pattern="/securePage.jsp" access="ROLE_ADMINISTRATOR"/>
    	<intercept-url pattern="/**" access="ROLE_ANONYMOUS" />
    </http>
    Replace this with:
    <authentication-manager alias="authenticationManager"/>
    	
    <beans:bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased">
    	<beans:property name="allowIfAllAbstainDecisions" value="false"/>
    	<beans:property name="decisionVoters">
    		<beans:list>
    			<beans:bean class="org.springframework.security.vote.RoleVoter"/>
    			<beans:bean class="org.springframework.security.vote.AuthenticatedVoter"/>
    		</beans:list>
     	</beans:property>
    </beans:bean>
    
    <beans:bean id="filterInvocationInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
    <beans:property name="authenticationManager" ref="authenticationManager"/>
    	<beans:property name="accessDecisionManager" ref="accessDecisionManager"/>
    	<beans:property name="objectDefinitionSource" ref="secureResourceFilter" />
    </beans:bean>
    	
    <beans:bean id="secureResourceFilter" class="org.security.SecureFilter.MySecureResourceFilter" />
    
    <http auto-config="true" access-denied-page="/403.jsp">
    	<concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true" />
    	<form-login login-page="/login.jsp" authentication-failure-url="/login.jsp" default-target-url="/index.jsp" />
    	<logout logout-success-url="/login.jsp"/>
     </http>

    The main part of this piece of configuration is the secureResourceFilter , this is a class that implements FilterInvocationDefinitionSource and is called when Spring Security needs to check the Authorities for a requested page.
    Here is the code for MySecureResourceFilter :
    package org.security.SecureFilter;
    
    import java.util.Collection;
    import java.util.List;
    
    import org.springframework.security.ConfigAttributeDefinition;
    import org.springframework.security.ConfigAttributeEditor;
    import org.springframework.security.intercept.web.FilterInvocation;
    import org.springframework.security.intercept.web.FilterInvocationDefinitionSource;
    
    
    public class MySecureResourceFilter implements FilterInvocationDefinitionSource {
    
    	public ConfigAttributeDefinition getAttributes(Object filter) throws IllegalArgumentException {
    		
    		FilterInvocation filterInvocation = (FilterInvocation) filter;
    		
    		String url = filterInvocation.getRequestUrl();
    		
    		// create a resource object that represents this Url object
    		Resource resource = new Resource(url);
    		
    		if (resource == null) return null;
    		else{
    		    ConfigAttributeEditor configAttrEditor = new ConfigAttributeEditor();
    			// get the Roles that can access this Url
    			List<Role> roles = resource.getRoles();
    			StringBuffer rolesList = new StringBuffer();
    			for (Role role : roles){
    				rolesList.append(role.getName());
    				rolesList.append(",");
    			}
    			// don't want to end with a "," so remove the last ","
    			if (rolesList.length() > 0)
    				rolesList.replace(rolesList.length()-1, rolesList.length()+1, "");
    			configAttrEditor.setAsText(rolesList.toString());
    			return (ConfigAttributeDefinition) configAttrEditor.getValue();
    		}		
    	}
    
    	public Collection getConfigAttributeDefinitions() {
    		return null;
    	}
    
    	public boolean supports(Class arg0) {
    		return true;
    	}
    
    }
    This getAttributes() method above essentially returns the name of Authorities (which I call Roles) that are allowed access to the current Url.
  4. OK, so now we have setup the database based resources and now the next step is to get Spring Security to read the user details from the database. The examples that come with Spring Security 2.0 shows you how to keep a list of users and authorities in the configuration file like this:
    <authentication-provider>
    	<user-service>
    	<user name="rod" password="password" authorities="ROLE_SUPERVISOR, ROLE_USER" />
    	<user name="dianne" password="password" authorities="ROLE_USER,ROLE_TELLER" />
    	<user name="scott" password="password" authorities="ROLE_USER" />
    	<user name="peter" password="password" authorities="ROLE_USER" />
    	</user-service>
    </authentication-provider>
    You could replace these examples with this configuration so that you can read the user details straight from the database like this:
    <authentication-provider>
    	<jdbc-user-service data-source-ref="dataSource" />
    </authentication-provider>
    While this is a very fast and easy way to configure database based security it does mean that you have to conform to a default databases schema. By default, the <jdbc-user-service> requires the following tables: user, authorities, groups, group_members and group_authorities.
    In my case this was not going to work as my security schema it not the same as what the <jdbc-user-service> requires, so I was forced to change the <authentication-provider> :
    <authentication-provider>
    	<jdbc-user-service data-source-ref="dataSource"
    	users-by-username-query="SELECT U.username, U.password, U.accountEnabled AS 'enabled' FROM User U where U.username=?"
    	authorities-by-username-query="SELECT U.username, R.name as 'authority' FROM User U JOIN Authority A ON u.id = A.userId JOIN Role R ON R.id = A.roleId WHERE U.username=?"/>
    </authentication-provider>
    By adding the users-by-username-query and authorities-by-username-query properties you are able to override the default SQL statements with your own. As in ACEGI security you must make sure that the columns that your SQL statement returns is the same as what Spring Security expects. There is a another property group-authorities-by-username-query which I am not using and have therefore left it out of this example, but it works in exactly the same manner as the other two SQL statements.

    This feature of the <jdbc-user-service> has only been included in the past month or so and was not available in the pre-release versions of Spring Security. Luckily it has been added as it does make life a lot easier. You can read about this here and here .

    The dataSource bean instructs which database to connect to, it is not included in my configuration file as it's not specific to security. Here is an example of a dataSource bean for those who are not sure:
    	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
    		<property name="url" value="jdbc:mysql://localhost/db_name?useUnicode=true&characterEncoding=utf-8"/>
    		<property name="username" value="root"/>
    		<property name="password" value="pwd"/>
    	</bean>
  5. And that is all for the configuration of Spring Security. My last task was to change my current logon screen. In ACEGI you could create your own logon <form> by making sure that you POSTED the correctly named HTML input elements to the correct URL. While you can still do this in Spring Security 2.0, some of the names have changed.
    You can still call your username field j_username and your password field j_password as before.
    <input type="text" name="j_username" id="j_username"/>
    <input type="password" name="j_password" id="j_password"/>
    However you must set the action property of your <form> to point to j_spring_security_check and not j_acegi_security_check .
    <form method="post" id="loginForm" action="<c:url value='j_spring_security_check'/>"
    There are a few places in our application where the user can logout, this is a link that redirects the logout request to the security framework so that it can be handled accordingly. This needs to be changed from j_acegi_logout to j_spring_security_logout .
    <a href='<c:url value="j_spring_security_logout"/>'>Logout</a>

Conclusion

This short guide on how to configure Spring Security 2.0 with access to resources stored in a database does not come close to illustrating the host of new features that are available in Spring Security 2.0, however I think that it does show some of the most commonly used abilities of the framework and I hope that you will find it useful.

One of the benefits of Spring Security 2.0 over ACEGI is the ability to write more consice configuration files, this is clearly shown when I compare my old ACEGI configration (172 lines) file to my new one (42 lines).
Here is my complete securityContext.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" 
xmlns:beans="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.springframework.org/schema/beans,http://www.springframework.org/schema/beans/spring-beans-2.0.xsd,http://www.springframework.org/schema/security,http://www.springframework.org/schema/security/spring-security-2.0.xsd"> <authentication-manager alias="authenticationManager"/>  <beans:bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased"> <beans:property name="allowIfAllAbstainDecisions" value="false"/> <beans:property name="decisionVoters"> <beans:list> <beans:bean class="org.springframework.security.vote.RoleVoter"/> <beans:bean class="org.springframework.security.vote.AuthenticatedVoter"/> </beans:list> </beans:property> </beans:bean> <beans:bean id="filterInvocationInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor"> <beans:property name="authenticationManager" ref="authenticationManager"/> <beans:property name="accessDecisionManager" ref="accessDecisionManager"/> <beans:property name="objectDefinitionSource" ref="secureResourceFilter" /> </beans:bean>  <beans:bean id="secureResourceFilter" class="org.security.SecureFilter.MySecureResourceFilter" /> <http auto-config="true" access-denied-page="/403.jsp">  <concurrent-session-control max-sessions="1" exception-if-maximum-exceeded="true" /> <form-login login-page="/login.jsp" authentication-failure-url="/login.jsp" default-target-url="/index.jsp" /> <logout logout-success-url="/login.jsp"/> </http>  <beans:bean id="loggerListener" class="org.springframework.security.event.authentication.LoggerListener"/>  <authentication-provider> <jdbc-user-service data-source-ref="dataSource" users-by-username-query="SELECT U.username, U.password, U.accountEnabled AS 'enabled' FROM User U where U.username=?" authorities-by-username-query="SELECT U.username, R.name as 'authority' FROM User U JOIN Authority A ON u.id = A.userId JOIN Role R ON R.id = A.roleId WHERE U.username=?" /> </authentication-provider> </beans:beans>

As I said in step 1, downloading Spring Security was the trickiest step of all. From there on it was plain sailing...

分享到:
评论

相关推荐

    含热电联供的智能楼宇群协同能量管理策略:基于多主体协同与需求响应的热电混合运行策略研究,“基于Stackelberg博弈与需求响应的智能楼宇群热电协同能量管理策略”,MATLAB代码:含热电联供的智能

    含热电联供的智能楼宇群协同能量管理策略:基于多主体协同与需求响应的热电混合运行策略研究,“基于Stackelberg博弈与需求响应的智能楼宇群热电协同能量管理策略”,MATLAB代码:含热电联供的智能楼宇群协同能量管理 关键词:楼宇能量管理系统;热电联供系统;Stackelberg博弈;需求响应 参考文档:《含热电联供的智能楼宇群协同能量管理》华北电力硕士lunwen 仿真平台:MATLAB 主要内容:本文提出了一种计及热电耦合需求响应的智能楼宇群的多主体协同能量管理策略。 传统热电联供系统采取单一的“以电定热”或“以热定电”运行策略,在实际运用中将无可避免地造成能源的浪费。 针对这一现状,本文采取“热电混合运行”策略对联供系统进行调控,在该运行策略下,运营商可以结合不同时段的价格信息、负荷水平等因素灵活采取使自身收益最大化的运行策略。 在热电协同能量管理层面,以楼宇群运营商的收益以及用户的效益最大化为目标,提出了智能楼宇群内部的优化定价策略,运营商在系统中负责向用户供电与供热,并自主制定电与热价格引导用户进行需求响应;其次,用户具有可平移电负荷以及可削减热负荷,可根据当前的价格信息自

    随机规划下的虚拟电厂与微网双不确定性优化调度模型研究:基于MATLAB与CPLEX的仿真平台实现,计及双重不确定性的虚拟电厂微网日前随机优化调度策略-基于MATLAB与CPLEX平台的研究,MATL

    随机规划下的虚拟电厂与微网双不确定性优化调度模型研究:基于MATLAB与CPLEX的仿真平台实现,计及双重不确定性的虚拟电厂微网日前随机优化调度策略——基于MATLAB与CPLEX平台的研究,MATLAB代码:计及源-荷双重不确定性的电厂 微网日前随机优化调度 关键词:电厂 微网 随机优化 随机调度 源-荷双重不确定性 电厂调度 参考文档:《Virtual power plant mid-term dispatch optimization》参考其燃气轮机、以及储能部分模型,另外随机优化算法也是和该文档一致; 仿真平台:MATLAB+CPLEX 主要内容:代码主要做的是一个电厂或者微网单元的日前优化调度模型,考虑了光伏出力和负荷功率的双重不确定性,采用随机规划法处理不确定性变量,构建了电厂随机优化调度模型。 具体来看,首先是基于蒙特卡洛算法,对预测的光伏以及负荷曲线进行场景生成,然后基于快概率距离快速消除法进行削减,直至削减至5个场景,然后采用随机调度的方法,对多场景下的电厂调度策略进行优化,程序实现效果良好,纯程序为本人亲自所写,一行一注释, ,关键词:虚拟电厂; 微网; 随

    rsyslog-mmaudit-8.24.0-57.el7-9.3.x64-86.rpm.tar.gz

    1、文件内容:rsyslog-mmaudit-8.24.0-57.el7_9.3.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/rsyslog-mmaudit-8.24.0-57.el7_9.3.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊

    基于Web的增材制造预处理平台的设计与实现.zip(毕设&课设&实训&大作业&竞赛&项目)

    项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用,资源为网络商品(电子资料类)基于网络商品和电子资料商品的性质和特征不支持退款,质量优质,放心下载使用

    博客系统完整开发流程(上)

    前端博客系统代码

    18考试真题最近的t67.txt

    18考试真题最近的t67.txt

    Javaweb期中作业会议管理系统,SSM+JSP.zip(课设&实训&大作业&项目)

    项目工程资源经过严格测试运行并且功能上ok,可实现复现复刻,拿到资料包后可实现复现出一样的项目,本人系统开发经验充足(全栈全领域),有任何使用问题欢迎随时与我联系,我会抽时间努力为您解惑,提供帮助 【资源内容】:包含源码+工程文件+说明等。答辩评审平均分达到96分,放心下载使用!可实现复现;设计报告也可借鉴此项目;该资源内项目代码都经过测试运行,功能ok 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 【提供帮助】:有任何使用上的问题欢迎随时与我联系,抽时间努力解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 下载后请首先打开说明文件(如有);整理时不同项目所包含资源内容不同;项目工程可实现复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用,资源为网络商品(电子资料类)基于网络商品和电子资料商品的性质和特征不支持退款,质量优质,放心下载使用

    基于Plecs的模块化多电平换流器设计:PMW调制下的小输出电压纹波半桥子模块实现,基于Plecs实现的模块化多电平半桥换流器,采用PWM调制方式实现低电压纹波输出,用plecs实现的模块化多电平流器

    基于Plecs的模块化多电平换流器设计:PMW调制下的小输出电压纹波半桥子模块实现,基于Plecs实现的模块化多电平半桥换流器,采用PWM调制方式实现低电压纹波输出,用plecs实现的模块化多电平流器,调制方式是PMW,输出电压纹波小,子模块是半桥 ,关键词提取结果:plecs;模块化多电平换流器;PWM调制;输出电压纹波小;半桥子模块;,《Plecs模拟模块化半桥式PWM多电平换流器》——输出低纹波电压的研究与应用

    最新更新!!!上市公司-股票流动性指标(2000-2023年)

    ## 01、数据简介 股票流动性是指股票在市场上被买卖的容易程度和速度,即投资者能够在不造成显著价格变动的情况下迅速买卖股票的能力。 Amihud指标结果这是一个衡量股票流动性的指标,为股票在一段时间的收益率与交易额的比值的负对数值。如果股票交易量的变动会带来股价的剧烈波动(暴涨暴跌),则Amihud指标越大,股票流动性越差;反之,如果交易量的变化对股价变化的影响越小,则说明股票的流动性较好。由于这是一个计算结果,因此需要根据实际的股票交易数据来计算。 数据名称:上市公司-股票流动性指标 数据年份:2000-2023年 ## 02、相关数据 stkcd、年份、证券代码、Amihud指标结果、交易天数。

    Simulink在DSP2833x开发板上的电机控制与通讯模型自动生成代码教程,Simulink在DSP2833x开发板上的电机控制与通讯模型自动生成代码教程,模型开发域控制Simulik自动生成代码

    Simulink在DSP2833x开发板上的电机控制与通讯模型自动生成代码教程,Simulink在DSP2833x开发板上的电机控制与通讯模型自动生成代码教程,模型开发域控制Simulik自动生成代码 DSP2833x基于模型的电机控制设计 MATLAb Simulik自动生成代码 基于dsp2833x 底层驱动库的自动代码生成 MATLAB Simulink仿真及代码生成技术入门教程 内容为Simulink在嵌入式领域的应用,具体是Simulink在DSP28335这块开发版上的应用模型:包括直流电机、PMSM、步进电机控制模型,还有常见的LED、串口、CAN等通讯相关Simulink模型,模型都有相关解释文件。 ,核心关键词: Simulink应用; DSP2833x开发版; 电机控制模型; 直流电机模型; PMSM模型; 步进电机模型; LED模型; 串口模型; CAN通讯模型; 自动代码生成; 底层驱动库。,MATLAB Simulink在DSP2833x上的嵌入式开发:自动生成代码的模型应用与实践教程

    19考试真题最近的t24.txt

    19考试真题最近的t24.txt

    C51/STM32仿真软件,主要通过三极管、电阻、电容、单片机等等元器件进行搭载电路,软件程序调试的过程,完成项目功能

    protues8.17安装包,无须积分,即可下载

    计及电动汽车灵活性的微网三阶段多时间尺度协调调度模型:优化经济调度、实时调整与减少功率波动策略,计及电动汽车灵活性的微网多时间尺度经济协调调度模型,计及电动汽车灵活性的微网多时间尺度协调调度模型 摘要

    计及电动汽车灵活性的微网三阶段多时间尺度协调调度模型:优化经济调度、实时调整与减少功率波动策略,计及电动汽车灵活性的微网多时间尺度经济协调调度模型,计及电动汽车灵活性的微网多时间尺度协调调度模型 摘要:构建了含有电动汽车参与的微网 电厂多时间尺度协调优化模型,其中包括日前-日内-实时三阶段,日前阶段由于风光出力具有不确定性,结合风光预测值作初步经济调度;日内阶段,风光出力观测的更加准确,通过调节储能、需求响应等单元对调度方案作进一步调整,避免遭受高额的不平衡惩罚;实时阶段,风光出力的预测结果更准确,为了进一步降低微网与上级电网并网功率的波动性,充分利用电动汽车的灵活性,调度电动汽车的充放电以减少功率波动,兼顾调度的安全性与经济性。 ,微网协调调度模型; 电动汽车灵活性; 多时间尺度; 风光出力; 储能需求响应; 实时调整; 经济性,电动汽车灵活性的微网多尺度协调调度模型研究

    基于MPC的电动汽车分布式协同自适应巡航控制:上下分层控制与仿真结果展示,基于MPC的电动汽车协同自适应巡航控制:上下分层控制与仿真结果展示,基于MPC的分布式电动汽车协同自适应巡航控制,采用上下分层

    基于MPC的电动汽车分布式协同自适应巡航控制:上下分层控制与仿真结果展示,基于MPC的电动汽车协同自适应巡航控制:上下分层控制与仿真结果展示,基于MPC的分布式电动汽车协同自适应巡航控制,采用上下分层控制方式,上层控制器采用模型预测控制mpc方式,产生期望的加速度,下层根据期望的加速度分配扭矩;仿真结果良好,能够实现前车在加减速情况下,规划期望的跟车距离,产生期望的加速度进行自适应巡航控制。 ,关键词:MPC(模型预测控制); 分布式电动汽车; 协同自适应巡航控制; 上下分层控制方式; 期望加速度; 扭矩分配; 仿真结果良好; 前车加减速; 跟车距离。,基于MPC的分层控制电动汽车自适应巡航系统,仿真实现前车加减速跟车距离自适应

    MATLAB代码实现电-气-热综合能源系统耦合优化调度模型:精细注释与实用模块子程序,MATLAB实现电-气-热综合能源系统优化调度的精细化建模与求解策略利用电网、热网与气网耦合交互的复杂系统特性进行

    MATLAB代码实现电-气-热综合能源系统耦合优化调度模型:精细注释与实用模块子程序,MATLAB实现电-气-热综合能源系统优化调度的精细化建模与求解策略利用电网、热网与气网耦合交互的复杂系统特性进行深度调度分析,MATLAB代码:电-气-热综合能源系统耦合优化调度 关键词:综合能源系统 优化调度 电气热耦合 参考文档:自编文档,非常细致详细,可联系我查阅 仿真平台:MATLAB YALMIP+cplex gurobi 主要内容:代码主要做的是一个考虑电网、热网以及气网耦合调度的综合能源系统优化调度模型,考虑了电网与气网,电网与热网的耦合,算例系统中,电网部分为10机39节点的综合能源系统,气网部分为比利时20节点的配气网络,潮流部分电网是用了直流潮流,气网部分也进行了线性化的操作处理,代码质量非常高,保姆级的注释以及人性化的模块子程序,所有数据均有可靠来源 ,关键词:综合能源系统; 优化调度; 电气热耦合; 10机39节点; 比利时20节点; 直流潮流; 线性化处理; MATLAB YALMIP; cplex gurobi。,MATLAB代码:电-气-热综合能源系统耦合优化调度

    元器件基础知识文档(适合初学者学习)

    报告电子元器件手册目录,常见电子元器件的参考资料以及70种电子元器件封装等等,非常适合初学者进行学习和掌握。希望大家都能够在电子领域进行深耕。

    19考试真题最近的t63.txt

    19考试真题最近的t63.txt

    基于MATLAB Simulink开发的FCU与PEMFC燃料电池系统模型开发:空压机、电堆等模块仿真与控制策略开发,基于MATLAB Simulink开发的PEMFC燃料电池系统模型及控制策略仿真开

    基于MATLAB Simulink开发的FCU与PEMFC燃料电池系统模型开发:空压机、电堆等模块仿真与控制策略开发,基于MATLAB Simulink开发的PEMFC燃料电池系统模型及控制策略仿真开发资料,fcu,燃料电池控制器,质子交膜燃料电池系统模型(PEMFC),基于MATLAB simulink开发,主要部分有空压机模型,供气系统模型(阴极和阳极),背压阀模型,电堆模型等。 可进行控制策略等仿真开发工作。 提供相关文档学习建模资料等 ,fcu; 燃料电池控制器; PEMFC; MATLAB simulink; 空压机模型; 供气系统模型; 背压阀模型; 电堆模型; 控制策略仿真; 文档学习建模资料,基于MATLAB Simulink的PEMFC燃料电池控制器开发:模型构建与控制策略仿真

    上门预约服务小程序v4.10.9+前端.zip

    上门预约服务小程序v4.10.9+前端 文章列表单图时,图标统一左侧对齐 文章内增加视频位置,显示在文章顶部 文章内底部导航增加首页、分享、自定义按钮,可跳转内部页面、其他小程序、业务域名内的H5页面,方便宣传使用

    19考试真题最近的t41.txt

    19考试真题最近的t41.txt

Global site tag (gtag.js) - Google Analytics