Matlab|考虑大规模电动汽车接入电网的双层优化调度策略

news2025/1/13 17:28:23

目录

1 主要内容

2 部分代码

3 程序结果

4 下载链接


主要内容

该程序复现文章《A bi-layer optimization based temporal and spatial scheduling for large-scale electric vehicles》,中文文献可对照《考虑大规模电动汽车接入电网的双层优化调度策略》,研究了发电机、电动汽车、风力的协同优化计划问题,提出了一种基于输电和配电系统层面的电动汽车充放电计划双层优化调度策略。在输电网层,以减少发电机组的运行成本、PM2.5 排放量、用户的总充电成本和弃风电量为目标,建立了基于机组最优组合的上层优化调度模型;在配电网层,以降低网损为目标,考虑网络安全约束和电动汽车的空间迁移特性,建立了基于最优潮流的下层优化调度模型。在基于标准 10 机输电网和 IEEE33 节点配电网的电力系统仿真模型上,对所提的基于双层优化的大规模电动汽车充放电调度策略进行了仿真分析,验证了所提双层优化调度策略的有效性和优越性。

由于该程序整体运行时间比较长,为了方便大家学习,采用上下层分别独立运行的方式,有兴趣的同学可以将两部分结合一下,但是运行时间会比较长,占用内存较大,程序采用matlab+cplex求解。为了方便大家学习,我对代码进行了比较详细的注释,希望能帮助到各位。

-------------------------------------------------------------------------------------------------------

这个程序思路不难,上层和参考文献一致未考虑输电网节点,重难点就是线性化处理部分,采用分段线性化的方式,下层主要设置电动汽车充放电数量,电动汽车充放电功率是固定的,然后将电动汽车功率带入到配电网潮流、电压和二阶锥等约束中,计算出电动汽车不同时间段充放电数量,这个程序有个优势,采用不同的配网优化方式,我们之前配网二阶锥优化采用的是下述形式。

简单来说就是,需要定义电压平方、电流平方、有功、无功等变量,该程序采用的变量如下:

    u=sdpvar(32,1);%u=Volta^2;电压平方变量
    R=sdpvar(32,1);%R=Volta(i)*Volta(j)*cos(Theta(i)-Theta(j));
    T=sdpvar(32,1);%T=Volta(i)*Volta(j)*sin(Theta(i)-Theta(j));
    Nd=intvar(32,1);%放电电动汽车数量
    Nc=intvar(32,1);%充电电动汽车数量

该方式直接定义了相连节点电压与cos(或者sin)乘积非线性部分作为一个整体变量,因此约束形式和常规二阶锥优化也会存在差异。

  • 上层目标函数

  • 下层目标函数

网损最小

  • 下层约束条件

部分代码

%%%%%%配电网潮流优化%%%%%%%%
%%%%%%标幺值SB=100MVA,UB=12.66kV,二阶锥松弛%%%%%%
%%%%%%MISOCP模型,分时段优化,并行计算%%%%%%%%%%%%
clear
clc
%%%%%IEEE33配电网数据%%%%%%%%%%%;
%有功、无功数据
Pload=[0.0004666666667,0.0005,0.0005666666667,0.0006333333333,0.0006666666667,0.0007333333333;
Qload=[0.00028,0.0003,0.00034,0.00038,0.0004,0.00044,0.00046,0.00048,0.00052,0.00056,0.00058,0.0006,0.00056,0.00052,0.00048,0.00042,0.0004,0.00044,0.00048,0.00056,0.00052,0.00044,0.00036,0.00032;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0.0003733333333,0.0004,0.0004533333333,0.0005066666667,0.0005333333333,0.0005866666667,0.0006133333333,0.00064,0.0006933333333,0.0007466666667,0.0007733333333,0.0008,0.0007466666667,0.0006933333333,0.00064,0.00056,0.0005333333333,0.0005866666667,0.00064,0.0007466666667,0.0006933333333,0.0005866666667,0.00048,0.0004266666667;0.00014,0.00015,0.00017,0.00019,0.0002,0.00022,0.00023,0.00024,0.00026,0.00028,0.00029,0.0003,0.00028,0.00026,0.00024,0.00021,0.0002,0.00022,0.00024,0.00028,0.00026,0.00022,0.00018,0.00016;9.333333333e-05,0.0001,0.0001133333333,0.0001266666667,0.0001333333333,0.0001466666667,0.0001533333333,0.00016,0.0001733333333,0.0001866666667,0.0001933333333,0.0002,0.0001866666667,0.0001733333333,0.00016,0.00014,0.0001333333333,0.0001466666667,0.00016,0.0001866666667,0.0001733333333,0.0001466666667,0.00012,0.0001066666667;0.0004666666667,0.0005,0.0005666666667,0.0006333333333,0.0006666666667,0.0007333333333,0.0007666666667,0.0008,0.0008666666667,0.0009333333333,0.0009666666667,0.001,0.0009333333333,0.0008666666667,0.0008,0.0007,0.0006666666667,0.0007333333333,0.0008,0.0009333333333,0.0008666666667,0.0007333333333,0.0006,0.0005333333333;0.0004666666667,0.0005,0.0005666666667,0.0006333333333,0.0006666666667,0.0007333333333,0.0007666666667,0.0008,0.0008666666667,0.0009333333333,0.0009666666667,0.001,0.0009333333333,0.0008666666667,0.0008,0.0007,0.0006666666667,0.0007333333333,0.0008,0.0009333333333,0.0008666666667,0.0007333333333,0.0006,0.0005333333333;9.333333333e-05,0.0001,0.0001133333333,0.0001266666667,0.0001333333333,0.0001466666667,0.0001533333333,0.00016,0.0001733333333,0.0001866666667,0.0001933333333,0.0002,0.0001866666667,0.0001733333333,0.00016,0.00014,0.0001333333333,0.0001466666667,0.00016,0.0001866666667,0.0001733333333,0.0001466666667,0.00012,0.0001066666667;9.333333333e-05,0.0001,0.0001133333333,0.0001266666667,0.0001333333333,0.0001466666667,0.0001533333333,0.00016,0.0001733333333,0.0001866666667,0.0001933333333,0.0002,0.0001866666667,0.0001733333333,0.00016,0.00014,0.0001333333333,0.0001466666667,0.00016,0.0001866666667,0.0001733333333,0.0001466666667,0.00012,0.0001066666667;0.00014,0.00015,0.00017,0.00019,0.0002,0.00022,0.00023,0.00024,0.00026,0.00028,0.00029,0.0003,0.00028,0.00026,0.00024,0.00021,0.0002,0.00022,0.00024,0.00028,0.00026,0.00022,0.00018,0.00016;0.0001633333333,0.000175,0.0001983333333,0.0002216666667,0.0002333333333,0.0002566666667,0.0002683333333,0.00028,0.0003033333333,0.0003266666667,0.0003383333333,0.00035,0.0003266666667,0.0003033333333,0.00028,0.000245,0.0002333333333,0.0002566666667,0.00028,0.0003266666667,0.0003033333333,0.0002566666667,0.00021,0.0001866666667;0.0001633333333,0.000175,0.0001983333333,0.0002216666667,0.0002333333333,0.0002566666667,0.0002683333333,0.00028,0.0003033333333,0.0003266666667,0.0003383333333,0.00035,0.0003266666667,0.0003033333333,0.00028,0.000245,0.0002333333333,0.0002566666667,0.00028,0.0003266666667,0.0003033333333,0.0002566666667,0.00021,0.0001866666667;0.0003733333333,0.0004,0.0004533333333,0.0005066666667,0.0005333333333,0.0005866666667,0.0006133333333,0.00064,0.0006933333333,0.0007466666667,0.0007733333333,0.0008,0.0007466666667,0.0006933333333,0.00064,0.00056,0.0005333333333,0.0005866666667,0.00064,0.0007466666667,0.0006933333333,0.0005866666667,0.00048,0.0004266666667;4.666666667e-05,5.e-05,5.666666667e-05,6.333333333e-05,6.666666667e-05,7.333333333e-05,7.666666667e-05,8.e-05,8.666666667e-05,9.333333333e-05,9.666666667e-05,0.0001,9.333333333e-05,8.666666667e-05,8.e-05,7.e-05,6.666666667e-05,7.333333333e-05,8.e-05,9.333333333e-05,8.666666667e-05,7.333333333e-05,6.e-05,5.333333333e-05;9.333333333e-05,0.0001,0.0001133333333,0.0001266666667,0.0001333333333,0.0001466666667,0.0001533333333,0.00016,0.0001733333333,0.0001866666667,0.0001933333333,0.0002,0.0001866666667,0.0001733333333,0.00016,0.00014,0.0001333333333,0.0001466666667,0.00016,0.0001866666667,0.0001733333333,0.0001466666667,0.00012,0.0001066666667;9.333333333e-05,0.0001,0.0001133333333,0.0001266666667,0.0001333333333,0.0001466666667,0.0001533333333,0.00016,0.0001733333333,0.0001866666667,0.0001933333333,0.0002,0.0001866666667,0.0001733333333,0.00016,0.00014,0.0001333333333,0.0001466666667,0.00016,0.0001866666667,0.0001733333333,0.0001466666667,0.00012,0.0001066666667;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0.0002333333333,0.00025,0.0002833333333,0.0003166666667,0.0003333333333,0.0003666666667,0.0003833333333,0.0004,0.0004333333333,0.0004666666667,0.0004833333333,0.0005,0.0004666666667,0.0004333333333,0.0004,0.00035,0.0003333333333,0.0003666666667,0.0004,0.0004666666667,0.0004333333333,0.0003666666667,0.0003,0.0002666666667;0.0009333333333,0.001,0.001133333333,0.001266666667,0.001333333333,0.001466666667,0.001533333333,0.0016,0.001733333333,0.001866666667,0.001933333333,0.002,0.001866666667,0.001733333333,0.0016,0.0014,0.001333333333,0.001466666667,0.0016,0.001866666667,0.001733333333,0.001466666667,0.0012,0.001066666667;0.0009333333333,0.001,0.001133333333,0.001266666667,0.001333333333,0.001466666667,0.001533333333,0.0016,0.001733333333,0.001866666667,0.001933333333,0.002,0.001866666667,0.001733333333,0.0016,0.0014,0.001333333333,0.001466666667,0.0016,0.001866666667,0.001733333333,0.001466666667,0.0012,0.001066666667;0.0001166666667,0.000125,0.0001416666667,0.0001583333333,0.0001666666667,0.0001833333333,0.0001916666667,0.0002,0.0002166666667,0.0002333333333,0.0002416666667,0.00025,0.0002333333333,0.0002166666667,0.0002,0.000175,0.0001666666667,0.0001833333333,0.0002,0.0002333333333,0.0002166666667,0.0001833333333,0.00015,0.0001333333333;0.0001166666667,0.000125,0.0001416666667,0.0001583333333,0.0001666666667,0.0001833333333,0.0001916666667,0.0002,0.0002166666667,0.0002333333333,0.0002416666667,0.00025,0.0002333333333,0.0002166666667,0.0002,0.000175,0.0001666666667,0.0001833333333,0.0002,0.0002333333333,0.0002166666667,0.0001833333333,0.00015,0.0001333333333;9.333333333e-05,0.0001,0.0001133333333,0.0001266666667,0.0001333333333,0.0001466666667,0.0001533333333,0.00016,0.0001733333333,0.0001866666667,0.0001933333333,0.0002,0.0001866666667,0.0001733333333,0.00016,0.00014,0.0001333333333,0.0001466666667,0.00016,0.0001866666667,0.0001733333333,0.0001466666667,0.00012,0.0001066666667;0.0003266666667,0.00035,0.0003966666667,0.0004433333333,0.0004666666667,0.0005133333333,0.0005366666667,0.00056,0.0006066666667,0.0006533333333,0.0006766666667,0.0007,0.0006533333333,0.0006066666667,0.00056,0.00049,0.0004666666667,0.0005133333333,0.00056,0.0006533333333,0.0006066666667,0.0005133333333,0.00042,0.0003733333333;0.0028,0.003,0.0034,0.0038,0.004,0.0044,0.0046,0.0048,0.0052,0.0056,0.0058,0.006,0.0056,0.0052,0.0048,0.0042,0.004,0.0044,0.0048,0.0056,0.0052,0.0044,0.0036,0.0032;0.0003266666667,0.00035,0.0003966666667,0.0004433333333,0.0004666666667,0.0005133333333,0.0005366666667,0.00056,0.0006066666667,0.0006533333333,0.0006766666667,0.0007,0.0006533333333,0.0006066666667,0.00056,0.00049,0.0004666666667,0.0005133333333,0.00056,0.0006533333333,0.0006066666667,0.0005133333333,0.00042,0.0003733333333;0.0004666666667,0.0005,0.0005666666667,0.0006333333333,0.0006666666667,0.0007333333333,0.0007666666667,0.0008,0.0008666666667,0.0009333333333,0.0009666666667,0.001,0.0009333333333,0.0008666666667,0.0008,0.0007,0.0006666666667,0.0007333333333,0.0008,0.0009333333333,0.0008666666667,0.0007333333333,0.0006,0.0005333333333;0.0001866666667,0.0002,0.0002266666667,0.0002533333333,0.0002666666667,0.0002933333333,0.0003066666667,0.00032,0.0003466666667,0.0003733333333,0.0003866666667,0.0004,0.0003733333333,0.0003466666667,0.00032,0.00028,0.0002666666667,0.0002933333333,0.00032,0.0003733333333,0.0003466666667,0.0002933333333,0.00024,0.0002133333333;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];%节点无功(何立夫数据);
%线路参数
Line=[1,1,2;2,2,3;3,3,4;4,4,5;5,5,6;6,6,7;7,7,8;8,8,9;9,9,10;10,10,11;11,11,12;12,12,13;13,13,14;14,14,15;15,15,16;16,16,17;17,5,25;18,25,26;19,26,27;20,27,28;21,28,29;22,29,30;23,30,31;24,31,32;25,1,18;26,18,19;27,19,20;28,20,21;29,2,22;30,22,23;31,23,24;32,33,1];%支路数据;
Pd=0.000018;%放电功率;
Pc=0.000018;%充电功率;
Ndsum=[0;0;0;0;0;0;0;0;160;160;160;160;160;160;0;0;0;0;0;160;80;0;0;0];%上层调度放电电动汽车数量(何立夫数据);
Ncsum=[380;380;380;360;110;0;0;0;0;0;0;0;0;0;0;0;60;0;0;0;0;0;350;380];%上层调度充电电动汽车数量(何立夫数据);
Nd_resid=zeros(24,1);Nc_resid=zeros(24,1);Nd_comme=zeros(24,1);Nc_comme=zeros(24,1);Nd_indus=zeros(24,1);Nc_indus=zeros(24,1);%区域电动汽车数量;
for t=1:24%不同时间段不同区域电动汽车充、放电数量,下述只是计算数量,也可直接采用数据来表示,不用纠结公式如何来
    if t<=17
        Nd_resid(t)=0.7*6/112*Ndsum(t);Nd_comme(t)=(0.2+0.7*16/112)*Ndsum(t);Nd_indus(t)=(0.1+0.7*90/112)*Ndsum(t);%何立夫数据;
    else
        Nd_resid(t)=0.7*Ndsum(t);Nd_comme(t)=0.2*Ndsum(t);Nd_indus(t)=0.1*Ndsum(t);
    end
    if t>=8&t<=19
        Nc_resid(t)=0.7/21*Ncsum(t);Nc_comme(t)=(0.2+0.7*6/42)*Ncsum(t);Nc_indus(t)=(0.1+0.7*34/42)*Ncsum(t);%何立夫数据;
    else
        Nc_resid(t)=0.7*Ncsum(t);Nc_comme(t)=0.2*Ncsum(t);Nc_indus(t)=0.1*Ncsum(t);
    end
end
%节点导纳、电纳参数
G=[21.4943686300000,-2.58137264300000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-5.11502111900000,0,0];%节点导纳矩阵实部;
B=[-13.2295494500000,1.31477215100000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.88110247000000,0,0,];%节点导纳矩阵虚部;
%节点电压最小、最大值
Vmin=[0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93;0.93];%节点电压最小值;
Vmax=[1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07;1.07];%节点电压最大值;
Plinemax=0.11;%线路功率传输上限;
%%%%%%%%%分时段%%%%%%%%%%
Ploss=zeros(24,1);Nd_data=zeros(33,24);Nc_data=zeros(33,24);Volta=zeros(33,24);Theta=zeros(33,24);
parfor t=1:24
    %%%%%%%%%MISOCP模型求解%%%%%%%%%%
    u=sdpvar(32,1);%u=Volta^2;电压平方变量
    R=sdpvar(32,1);%R=Volta(i)*Volta(j)*cos(Theta(i)-Theta(j));
    T=sdpvar(32,1);%T=Volta(i)*Volta(j)*sin(Theta(i)-Theta(j));
    Nd=intvar(32,1);%放电电动汽车数量
    Nc=intvar(32,1);%充电电动汽车数量
    %%%%%%%%%%%目标函数%%%%%%%%%;
    f=0;%网损
    for i=1:16
        f=f-G(i,i+1)*(u(i)+u(i+1)-2*R(i));
    end
    f=f-G(5,25)*(u(5)+u(25)-2*R(17));
    for i=18:24
        f=f-G(i+7,i+8)*(u(i+7)+u(i+8)-2*R(i));
    end
    f=f-G(1,18)*(u(1)+u(18)-2*R(25));
    for i=26:28
        f=f-G(i-8,i-7)*(u(i-8)+u(i-7)-2*R(i));
    end
    f=f-G(2,22)*(u(2)+u(22)-2*R(29));
    for i=30:31
        f=f-G(i-8,i-7)*(u(i-8)+u(i-7)-2*R(i));
    end
    f=f-G(33,1)*(1.05*1.05+u(1)-2*R(32));
    %%%%%约束条件%%%%%%%%
    C=[R>=0,u>=Vmin.^2,u<=Vmax.^2,Nd>=0,Nc>=0,Nc<=50,Nd<=50];%电压、充放电电动汽车约束
    %%%%%潮流方程%%%%%%%%根据33节点网络进行一一的潮流公式书写,如1节点和2节点相连,就把相连节点的部分作为潮流约束的一部分,不相连的部分不考虑,但是这种方法编程挺麻烦
    C=[C,Pload(1,t)+Nc(1)*Pc-Nd(1)*Pd==G(1,33)*u(1)-G(1,33)*R(32)+B(1,33)*T(32)+G(1,2)*u(1)-G(1,2)*R(1)-B(1,2)*T(1)+G(1,18)*u(1)-G(1,18)*R(25)-B(1,18)*T(25)];
    C=[C,Qload(1,t)==-B(1,33)*u(1)+B(1,33)*R(32)+G(1,33)*T(32)-B(1,2)*u(1)+B(1,2)*R(1)-G(1,2)*T(1)-B(1,18)*u(1)+B(1,18)*R(25)-G(1,18)*T(25)];
​

程序结果

4 下载链接

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1968481.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【C++】学习笔记——智能指针

文章目录 二十一、智能指针1. 内存泄漏2. 智能指针的使用及原理RAII智能指针的原理auto_ptrunique_ptrshared_ptrshared_ptr的循环引用weak_ptr删除器 未完待续 二十一、智能指针 1. 内存泄漏 在上一章的异常中&#xff0c;我们了解到如果出现了异常&#xff0c;会中断执行流…

4.5、作业管理

几乎不太会考 作业的状态 作业&#xff1a;系统为完成一个用户的计算任务&#xff08;或一次事务处理&#xff09;所做的工作总和。例如&#xff0c;对用户编写的源程序&#xff0c;需要经过编译、连接、装入以及执行等步骤得到结果&#xff0c;这其中的每一个步骤称为作业步…

【附安装包】CentOS7(Linux)详细安装教程(手把手图文详解版)

目前流行的虚拟机软件有VMware、Virtual Box和Virtual PC等等&#xff0c;其中最常用的就是VMware。 而centos是Linux使用最广泛的版本之一。 教程开始教程有许多不完备之处&#xff0c;大佬请忽略。。。 1.安装VMware 首先需要准备VMware的安装包以及Ubuntu的ISO镜像&#…

Shell编程——基础语法(2)和 Shell流程控制

文章目录 基础语法&#xff08;2&#xff09;echo命令read命令printf命令test命令 Shell流程控制if-else语句for 循环while 语句until 循环case ... esac跳出循环 基础语法&#xff08;2&#xff09; echo命令 Shell 的 echo 指令与 PHP 的 echo 指令类似&#xff0c;都是用于…

文档管理系统哪个好?优质8款系统深度比较

本文将分享8款文档管理系统&#xff1a;PingCode、Worktile、金山文档、腾讯文档、飞书文档、石墨文档、Confluence、Google Drive。 在寻找合适的文档管理系统时&#xff0c;你是否感到困惑和不安&#xff1f;市场上众多选项让人难以抉择&#xff0c;尤其是当你希望找到既能提…

springCloud组件专题(五) --- seata

一.Seata介绍 1. seata是什么 是一款开源的分布式事务解决方案&#xff0c;供了 AT、TCC、SAGA 和 XA 事务模式。 2.分布式事务中的概念 2.1. 二阶段提交 二阶段提交的含义就是将事务的提交分成两个步骤&#xff0c;分别为&#xff1a; 准备阶段&#xff1a;事务协调者询问所…

Django分页组件封装

目录 1. 前言 2. 代码 3. 使用 3.1 view.py 3.2 list.html 1. 前言 在日常开发中&#xff0c;我们也许会遇到一页内容太多不够展示的问题&#xff0c;过于冗余。 此时&#xff0c;我们就需要进行分页&#xff0c;分页的方式有两种&#xff1a;1. ajax异步分页 2. 普通选…

记一些零碎的只是点和一些安全工具的使用(这里建议将漏洞原理搞清楚,然后可以尝试手动和使用工具)

目录 信息收集 扫描端口 工具 nmap TxPortMap tideFinger fscan 漏洞扫描 目录扫描 利群使用 不同系统、不同框架的漏洞 OA weblogic Struts2 thinkphp漏洞 shiro 蚁剑使用 更高级的连接工具 免杀类型 主机端的免杀 流量层的免杀 安全设备 主机端安全设备…

Docker容器数据库启动,如何用别名JAR jdbc:postgresql://别名:5432/postgres

如果想了解为啥这样做得同学&#xff0c;请去看这个文章 Docker容器网络&#xff08;七&#xff09;_host.docker.internal-CSDN博客 因为docker0网络&#xff0c;需要用别名的话&#xff0c;还得在host文件加 dockerIp(172.0.0.2) 别名 怎么查&#xff0c; docker network …

每日一题 ~ LCR 015. 找到字符串中所有字母异位词

. - 力扣&#xff08;LeetCode&#xff09; 题目解析 题目要求找出字符串中所有的字母异位词。所谓字母异位词指的是两个字符串中字符出现的次数相同&#xff0c;但顺序可以不同的情况。 思路分析 固定窗口&#xff1a;使用滑动窗口技巧&#xff0c;窗口大小固定为待匹配字…

Latex基本数学公式

LaTeX数学公式入门 LaTeX作为一种广泛使用的排版系统&#xff0c;尤其在学术界和科技领域&#xff0c;以其强大的排版能力和灵活性著称。而它的公式编辑能力更是让人叹为观止&#xff0c;经常与Markdown结合使用&#xff0c;以简化文档编写和公式展示的过程。 LaTeX 公式 L…

数字的位操作——326、504、263、190、191、476、461、477、693

326. 3 的幂&#xff08;简单&#xff09; 给定一个整数&#xff0c;写一个函数来判断它是否是 3 的幂次方。如果是&#xff0c;返回 true &#xff1b;否则&#xff0c;返回 false 。 整数 n 是 3 的幂次方需满足&#xff1a;存在整数 x 使得 n 3x 示例 1&#xff1a; 输入&a…

本地部署持续集成工具Jenkins并配置公网地址实现远程自动化构建

文章目录 前言1. 安装Jenkins2. 局域网访问Jenkins3. 安装 cpolar内网穿透软件4. 配置Jenkins公网访问地址5. 公网远程访问Jenkins6. 固定公网地址 前言 本文主要介绍如何在Linux CentOS 7中安装Jenkins并结合cpolar内网穿透工具实现远程访问管理本地部署的Jenkins服务. Jenk…

DDR等长,到底长度差多少叫等长?

DDR4看这一篇就够了 - 知乎 (zhihu.com) 【全网首发】DDR4 PCB设计规范&设计要点PCB资源PCB联盟网 - Powered by Discuz! (pcbbar.com) 终于看到较为权威的DDR4等长要求了: !!!! 依据这个要求&#xff0c;H616项目的等长线不合格&#xff1a;

JazzEE(2)

JazzEE&#xff08;2&#xff09; 8、异常引入try-catchcatch中如何处理异常try-catch-finally多重catch异常的分类throw和throws区别小案例 重载和重写的异常处理自定义异常 9、常用类包装类引入Integer String类String字符串内存 StringBuilder类可变和不可变常见方法StringB…

SpringBoot整合Juint,ssm框架

目录 SpringBoot整合Juint 1.导入相关的依赖 2.创建测试类&#xff0c;使用注解SpringBootTest SpringBoot整合ssm框架 1.使用脚手架创建Spring项目 2.修改pom.xml 我先修改了SpringBoot的版本&#xff0c;修改为2.3.10.RELEASE&#xff0c;因为SpringBoot版本太高会出现…

数据集——鸢尾花介绍和使用

文章目录 一、鸢尾花数据集内容二、使用中常转换DataFrame 一、鸢尾花数据集内容 from sklearn import svm, datasets # 鸢尾花数据 iris datasets.load_iris() print(iris.data) X iris.data[:, :2] # 为便于绘图仅选择2个特征 y iris.target它包含了150个样本&#xff0c…

3.8.语义分割

语义分割 ​ 语义分割将图片中的每个像素分类到对应的类别(有监督学习) 1.图像分割和实例分割 图像分割将图像划分为若干组成区域&#xff0c;这类问题的方法通常利用图像中像素之间的相关性。它在训练时不需要有关图像像素的标签信息&#xff0c;在预测时也无法保证分割出的区…

单细胞数据整合-去除批次效应harmony和CCA (学习)

目录 单细胞批次效应学习 定义 理解 常用的去批次方法-基于Seurat 1&#xff09; Seurat-integration&#xff08;CCA&#xff09; 2&#xff09; Seurat-harmony 去批次代码 ①Seurat-integration&#xff08;CCA&#xff09; ②Seurat-harmony 单细胞批次效应学习 …

【C++进阶学习】第十一弹——C++11(上)——右值引用和移动语义

前言&#xff1a; 前面我们已经将C的重点语法讲的大差不差了&#xff0c;但是在C11版本之后&#xff0c;又出来了很多新的语法&#xff0c;其中有一些作用还是非常大的&#xff0c;今天我们就先来学习其中一个很重要的点——右值引用以及它所扩展的移动定义 目录 一、左值引用和…