幅频特性曲线分析及使用WPF绘制

文章目录

  • 1、一阶惯性环节的幅频特性曲线分析及绘制
  • 2、二阶系统的幅频特性曲线分析及绘制
  • 3、一般的系统
  • 4、上位机代码实现
    • 4.1 一阶惯性系统
    • 4.2 二阶系统
  • 5、稳定裕度
    • 5.1 幅值裕度
    • 5.2 相角裕度
  • 参考

1、一阶惯性环节的幅频特性曲线分析及绘制

在这里插入图片描述
这里的a和b可以根据系统的不同修改,然后在0-50Hz内以1/10000的分辨率取点,可得对数幅频特性曲线(1/0.5s+1):
在这里插入图片描述
MATLAB脚本实现传递函数(1/0.5s+1)的伯德图绘制:

% 0.001 - 10^1.5  10000个点
w = logspace(-3,2,10000);
num = [0 1];
f = [0.5 1];
sys = tf(num,f);
P = bodeoptions;
% 横坐标为Hz
P.FreqUnits = 'Hz';
bode(sys,w,P)

在这里插入图片描述

2、二阶系统的幅频特性曲线分析及绘制

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
MATLAB脚本实现传递函数(2/(0.01s+1)(0.2s+1)的伯德图绘制:

% 0.001 - 10^1.5  10000个点
w = logspace(-3,2,10000);
num = [0 2];
f1 = [0.01 1];
f2 = [0.2 1];
den = conv(f1,f2);
sys = tf(num,den);
P = bodeoptions;
% 横坐标为Hz
P.FreqUnits = 'Hz';
bode(sys,w,P)

在这里插入图片描述

3、一般的系统

在这里插入图片描述

4、上位机代码实现

源码及Oxyplot源码下载地址: WPF实现bode图demo源码

4.1 一阶惯性系统

<Page x:Class="WPF_Demo_V2.View.LogChartPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WPF_Demo_V2.View"xmlns:oxyplot="http://oxyplot.org/wpf"mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"Title="LogChartPage"><Grid><Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width="5*"/><ColumnDefinition/></Grid.ColumnDefinitions><oxyplot:PlotView Model="{Binding MyPlotModelUp}"/><oxyplot:PlotView Grid.Row="1"  Model="{Binding MyPlotModelDown}"/><StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="0.8*"/><ColumnDefinition/></Grid.ColumnDefinitions><Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions><TextBlock Text="a:" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Column="1" Text="{Binding A}" Margin="2"></TextBox><TextBlock Text="b:" Grid.Row="1" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="1" Grid.Column="1" Text="{Binding B}" Margin="2"></TextBox><TextBlock Text="X max:" Grid.Row="2" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="2" Grid.Column="1" Text="{Binding X_max}" Margin="2"></TextBox><TextBlock Text="factor:" Grid.Row="3" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Factor}" Margin="2" ToolTip="X_max/factor 为最小分辨率"></TextBox><TextBlock Text="Y1 min:" Grid.Row="4" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Y1_min}" Margin="2"></TextBox><TextBlock Text="Y1 max:" Grid.Row="5" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="5" Grid.Column="1" Text="{Binding Y1_max}" Margin="2"></TextBox><TextBlock Text="Y2 min:" Grid.Row="6" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="6" Grid.Column="1" Text="{Binding Y2_min}" Margin="2"></TextBox><TextBlock Text="Y2 max:" Grid.Row="7" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="7" Grid.Column="1" Text="{Binding Y2_max}" Margin="2"></TextBox><Button Grid.Row="8" Grid.ColumnSpan="2" Content="确定" Margin="20,2" Command="{Binding sureCommand}"/></Grid><Image Source="../Resource/Image/function.png"/></StackPanel></Grid>
</Page>
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace WPF_Demo_V2.ViewModel
{partial class LogChartViewModel: ObservableObject{#region 全局变量//UInt32 LEN = 50;//UInt32 FACT = 10000;double[] Gain;double[] Phase;FunctionSeries upFunctionSeries=new FunctionSeries();FunctionSeries downFunctionSeries=new FunctionSeries();#endregion#region 构造函数public LogChartViewModel(){upFunctionSeries.Title = "Gain";downFunctionSeries.Title = "Phase";}#endregion#region 属性[ObservableProperty]public PlotModel _MyPlotModelUp;[ObservableProperty]public PlotModel _MyPlotModelDown;[ObservableProperty]public double _A = 0.5;[ObservableProperty]public double _B = 1;[ObservableProperty]public int _X_max = 50;[ObservableProperty]public int _Factor = 10000;[ObservableProperty]public double _Y1_max = 0;[ObservableProperty]public double _Y1_min = -50;[ObservableProperty]public double _Y2_max = 0;[ObservableProperty]public double _Y2_min = -90;#endregion#region 方法public PlotModel PlotModelInit(string xtitle,string ytitle,double ymin,double ymax){var plotModel = new PlotModel();//plotModel.Title = "Log Paper";var logarithmicAxis1 = new LogarithmicAxis();logarithmicAxis1.MajorGridlineColor = OxyColor.FromArgb(40, 0, 0, 139);logarithmicAxis1.MajorGridlineStyle = LineStyle.Solid;logarithmicAxis1.Maximum = X_max;logarithmicAxis1.Minimum = 1/ (double)Factor;logarithmicAxis1.MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139);logarithmicAxis1.MinorGridlineStyle = LineStyle.Solid;logarithmicAxis1.Position = AxisPosition.Bottom;if (!string.IsNullOrEmpty(xtitle)) logarithmicAxis1.Title = xtitle;plotModel.Axes.Add(logarithmicAxis1);var linearAxis1 = new LinearAxis();linearAxis1.MajorGridlineStyle = LineStyle.Solid;linearAxis1.MinorGridlineStyle = LineStyle.Dot;linearAxis1.Maximum = ymax;linearAxis1.Minimum = ymin;linearAxis1.Title = ytitle;plotModel.Axes.Add(linearAxis1);return plotModel;}[RelayCommand]private void sure(){if(upFunctionSeries.Points.Count>0) upFunctionSeries.Points.Clear();if (downFunctionSeries.Points.Count > 0)downFunctionSeries.Points.Clear();if (MyPlotModelUp != null) {if (MyPlotModelUp.Series.Count > 0) MyPlotModelUp.Series.Clear();}if(MyPlotModelDown != null){if (MyPlotModelDown.Series.Count > 0) MyPlotModelDown.Series.Clear();}MyPlotModelUp = PlotModelInit("", "Magnitude[dB]", Y1_min, Y1_max);MyPlotModelDown = PlotModelInit("Frequency[Hz]", "Phase[deg]", Y2_min, Y2_max);Gain = new double[X_max * Factor];Phase = new double[X_max * Factor];for (int i = 0; i < X_max * Factor; i++){double temp_a = 2 * Math.PI * A * (i / (double)Factor);double temp_2 = Math.Pow(temp_a, 2) + Math.Pow(B, 2);double temp_sqrt = 1 / Math.Sqrt(temp_2);double temp = Math.Abs(temp_sqrt);Gain[i] = 20 * Math.Log10(temp);Phase[i] = -Math.Atan(temp_a / (double)B) / Math.PI * 180;upFunctionSeries.Points.Add(new DataPoint(i / (double)Factor, Gain[i]));downFunctionSeries.Points.Add(new DataPoint(i / (double)Factor, Phase[i]));}MyPlotModelUp.Series.Add(upFunctionSeries);MyPlotModelDown.Series.Add(downFunctionSeries);MyPlotModelUp.ResetAllAxes();MyPlotModelUp.InvalidatePlot(true);MyPlotModelDown.ResetAllAxes();MyPlotModelDown.InvalidatePlot(true);}#endregion}
}

4.2 二阶系统

<Page x:Class="WPF_Demo_V2.View.Log3ChartPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WPF_Demo_V2.View"xmlns:oxyplot="http://oxyplot.org/wpf"mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"Title="Log3ChartPage"><Grid><Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition Width="5*"/><ColumnDefinition/></Grid.ColumnDefinitions><oxyplot:PlotView Model="{Binding MyPlotModelUp}"/><oxyplot:PlotView Grid.Row="1"  Model="{Binding MyPlotModelDown}"/><StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical"><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="0.8*"/><ColumnDefinition/></Grid.ColumnDefinitions><Grid.RowDefinitions><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/><RowDefinition/></Grid.RowDefinitions><TextBlock Text="a:" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Column="1" Text="{Binding A}" Margin="2"></TextBox><TextBlock Text="b:" Grid.Row="1" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="1" Grid.Column="1" Text="{Binding B}" Margin="2"></TextBox><TextBlock Text="c:" Grid.Row="2" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="2" Grid.Column="1" Text="{Binding C}" Margin="2"></TextBox><TextBlock Text="X max:" Grid.Row="3" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="3" Grid.Column="1" Text="{Binding X_max}" Margin="2"></TextBox><TextBlock Text="factor:" Grid.Row="4" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Factor}" Margin="2" ToolTip="X_max/factor 为最小分辨率"></TextBox><TextBlock Text="Y1 min:" Grid.Row="5" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="5" Grid.Column="1" Text="{Binding Y1_min}" Margin="2"></TextBox><TextBlock Text="Y1 max:" Grid.Row="6" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="6" Grid.Column="1" Text="{Binding Y1_max}" Margin="2"></TextBox><TextBlock Text="Y2 min:" Grid.Row="7" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="7" Grid.Column="1" Text="{Binding Y2_min}" Margin="2"></TextBox><TextBlock Text="Y2 max:" Grid.Row="8" Foreground="White" HorizontalAlignment="Right"/><TextBox Grid.Row="8" Grid.Column="1" Text="{Binding Y2_max}" Margin="2"></TextBox><Button Grid.Row="9" Grid.ColumnSpan="2" Content="确定" Margin="20,2" Command="{Binding sureCommand}"/></Grid><Image Source="../Resource/Image/function.png"/></StackPanel></Grid>
</Page>
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OxyPlot.Axes;
using OxyPlot.Series;
using OxyPlot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace WPF_Demo_V2.ViewModel
{partial class Log3ChartViewModel: ObservableObject{#region 全局变量//UInt32 LEN = 50;//UInt32 FACT = 10000;double[] Gain;double[] Phase;FunctionSeries upFunctionSeries = new FunctionSeries();FunctionSeries downFunctionSeries = new FunctionSeries();#endregion#region 构造函数public Log3ChartViewModel(){upFunctionSeries.Title = "Gain";downFunctionSeries.Title = "Phase";}#endregion#region 属性[ObservableProperty]public PlotModel _MyPlotModelUp;[ObservableProperty]public PlotModel _MyPlotModelDown;[ObservableProperty]public double _A = 0.5;[ObservableProperty]public double _B = 1;[ObservableProperty]public double _C = 1;[ObservableProperty]public int _X_max = 50;[ObservableProperty]public int _Factor = 10000;[ObservableProperty]public double _Y1_max = 0;[ObservableProperty]public double _Y1_min = -100;[ObservableProperty]public double _Y2_max = 100;[ObservableProperty]public double _Y2_min = -100;#endregion#region 方法public PlotModel PlotModelInit(string xtitle, string ytitle, double ymin, double ymax){var plotModel = new PlotModel();//plotModel.Title = "Log Paper";var logarithmicAxis1 = new LogarithmicAxis();logarithmicAxis1.MajorGridlineColor = OxyColor.FromArgb(40, 0, 0, 139);logarithmicAxis1.MajorGridlineStyle = LineStyle.Solid;logarithmicAxis1.Maximum = X_max;logarithmicAxis1.Minimum = 1 / (double)Factor;logarithmicAxis1.MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139);logarithmicAxis1.MinorGridlineStyle = LineStyle.Solid;logarithmicAxis1.Position = AxisPosition.Bottom;if (!string.IsNullOrEmpty(xtitle)) logarithmicAxis1.Title = xtitle;plotModel.Axes.Add(logarithmicAxis1);var linearAxis1 = new LinearAxis();linearAxis1.MajorGridlineStyle = LineStyle.Solid;linearAxis1.MinorGridlineStyle = LineStyle.Dot;linearAxis1.Maximum = ymax;linearAxis1.Minimum = ymin;linearAxis1.Title = ytitle;plotModel.Axes.Add(linearAxis1);//var logarithmicAxis2 = new LogarithmicAxis();//logarithmicAxis2.MajorGridlineColor = OxyColor.FromArgb(40, 0, 0, 139);//logarithmicAxis2.MajorGridlineStyle = LineStyle.Solid;//logarithmicAxis2.Maximum = 180;//logarithmicAxis2.Minimum = -180;//logarithmicAxis2.MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139);//logarithmicAxis2.MinorGridlineStyle = LineStyle.Solid;//logarithmicAxis2.Title = "Y";//plotModel.Axes.Add(logarithmicAxis2);return plotModel;}[RelayCommand]private void sure(){if (upFunctionSeries.Points.Count > 0) upFunctionSeries.Points.Clear();if (downFunctionSeries.Points.Count > 0) downFunctionSeries.Points.Clear();if (MyPlotModelUp != null){if (MyPlotModelUp.Series.Count > 0) MyPlotModelUp.Series.Clear();}if (MyPlotModelDown != null){if (MyPlotModelDown.Series.Count > 0) MyPlotModelDown.Series.Clear();}MyPlotModelUp = PlotModelInit("", "Magnitude[dB]", Y1_min, Y1_max);MyPlotModelDown = PlotModelInit("Frequency[Hz]", "Phase[deg]", Y2_min, Y2_max);Gain = new double[X_max * Factor];Phase = new double[X_max * Factor];double previousPhase = 0;for (int i = 0; i < X_max * Factor; i++){double w = 2 * Math.PI * (i / (double)Factor);double temp_a = 1 - A*B * Math.Pow(w, 2);double temp_b = (A+B)*w;double temp_2 = Math.Pow(temp_a, 2) + Math.Pow(temp_b, 2);double temp_sqrt = C / Math.Sqrt(temp_2);double temp = Math.Abs(temp_sqrt);Gain[i] = 20 * Math.Log10(temp);double currentPhaseA = Math.Atan(A * w) / Math.PI * 180;double currentPhaseB = Math.Atan(B * w) / Math.PI * 180;Phase[i] = 0-(currentPhaseA + currentPhaseB);upFunctionSeries.Points.Add(new DataPoint(i / (double)Factor, Gain[i]));downFunctionSeries.Points.Add(new DataPoint(i / (double)Factor, Phase[i]));}MyPlotModelUp.Series.Add(upFunctionSeries);MyPlotModelDown.Series.Add(downFunctionSeries);MyPlotModelUp.ResetAllAxes();MyPlotModelUp.InvalidatePlot(true);MyPlotModelDown.ResetAllAxes();MyPlotModelDown.InvalidatePlot(true);}#endregion}
}

5、稳定裕度

在这里插入图片描述

5.1 幅值裕度

在这里插入图片描述

5.2 相角裕度

在这里插入图片描述

参考

【1】第五章 线性系统的频域分析法:
https://buckyi.github.io/Note-Automation/%E7%BB%8F%E5%85%B8%E6%8E%A7%E5%88%B6%E7%90%86%E8%AE%BA/%E7%AC%AC05%E7%AB%A0%20%E7%BA%BF%E6%80%A7%E7%B3%BB%E7%BB%9F%E7%9A%84%E9%A2%91%E5%9F%9F%E5%88%86%E6%9E%90%E6%B3%95.html#33
【2】【自动控制原理】第5章 幅相频率特性曲线(奈氏图)及其绘制:
https://blog.csdn.net/persona5joker/article/details/140055111
【3】相角裕度与幅值裕度:
https://blog.csdn.net/qq_38972634/article/details/119787996
【4】【自动控制原理】第五章 奈奎斯特稳定判据,相角裕度和幅值裕度,对数频率特性及其绘制:
https://blog.csdn.net/persona5joker/article/details/140059710?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-4-140059710-blog-119787996.235v43pc_blog_bottom_relevance_base8&spm=1001.2101.3001.4242.3&utm_relevant_index=7
【5】自控理论 第6章 II 相对稳定性、伯德图和闭环频率响应
https://www.cnblogs.com/harold-lu/p/15740368.html

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

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网络udp及ipc内存共享

大字符串找小字符串 调试 1. 信号处理函数注册&#xff1a;•一旦使用 signal 函数注册了信号处理函数&#xff0c;该函数就会一直有效&#xff0c;直到程序结束或者显式地取消注册。2. 注册多次的影响&#xff1a;•如果多次注册同一信号的处理函数&#xff0c;最后一次注册的…

【记录】基于Windows系统安装rust环境的过程

到官网下载安装包【入门 - Rust 程序设计语言 (rust-lang.org)】 ![[Pasted image 20240703142911.png]] 选择1&#xff0c;快速安装 选择编译配置&#xff0c;1为标准 安装完成 验证是否安装完毕 rustc --versioncargo --version验证成功&#xff01;

UneMeta创始人讲述自己在Web3+IP领域创业的心路历程

昨日&#xff0c;UneMeta创始人&#xff0c;Ann_tyrion在X分享了一篇推文&#xff0c;分享了自己在探索Web3与IP产业结合过程中的心路历程&#xff0c;她并没有像很多项目方那样一味的讲述宏大的叙事&#xff0c;而是字里行间透露出对这个行业的探索和不断给自己充实信念&#…

自动操作一键数据恢复/电子取证

对磁盘模拟扫描修复丢失数据的实验。 先挂载题目磁盘VHD。 Windows系统中打开磁盘管理&#xff0c;-操作&#xff0c;-附加VHD 可以看到已经加载出题目磁盘&#xff0c;接下来打开RStudio数据恢复软件&#xff0c;对其进行扫描。 操作找回丢失/被删除的数据 可以看到已经加载出…

DRF——pagination分页模块

文章目录 分页继承APIView类用法1.PageNumberPagination2.LimitOffsetPagination3.CursorPagination 继承GenericAPIView派生类用法1.PageNumberPagination2.LimitOffsetPagination3.CursorPagination 分页 在查看数据列表的API中&#xff0c;如果 数据量 比较大&#xff0c;肯…

【前端基础篇】JavaScript之DOM介绍

文章目录 WebAPI背景知识什么是WebAPI什么是APIAPI参考文档 DOM基本概念什么是DOMDOM树查找HTML元素方法概览1. document.getElementById(id)2.document.getElementsByTagName(name)3. document.getElementsByClassName(name)4. document.querySelector(CSS选择器)5. document.…

如何免费获取乡镇级边界数据geoJson数据

如何免费获取乡镇级边界数据geoJson数据 我们可以通过 阿里云数据可视化平台 &#xff0c;可以获取到中国各个省份/区级/县级的json数据&#xff0c;但是区级和县级&#xff0c;并没有包含街道和乡镇的数据 获取乡镇级边界数据 1.下载bigemap全能版 安装好后选择你要导出的…

Graphpad Prism for Mac 医学绘图软件教程

Mac分享吧 文章目录 效果一、下载软件二、开始安装1、双击运行软件&#xff0c;将其从左侧拖入右侧文件夹中&#xff0c;等待安装完毕2、应用程序显示软件图标&#xff0c;表示安装成功 三、运行测试安装完成&#xff01;&#xff01;&#xff01; 效果 一、下载软件 下载软件…

关于jupyter notebook 的输出 (outputs )

jupyter notebook 的输出 (outputs )在元素达到一定的个数后&#xff0c;就会按一行一个元素进行展示&#xff0c;百来个还好&#xff0c;一旦过千&#xff0c;那滚轮势必撸冒烟&#xff0c;所以能不能解决呢&#xff1f; 先看个例子&#xff0c; 一个找质数、合数的函数 cal3&…

开发高质量PDF应用的不二选择:PdfiumViewer库详细解析

1. PdfiumViewer库简介 PdfiumViewer是一款基于谷歌开源PDF渲染引擎PDFium的.NET库&#xff0c;主要用于在Windows应用程序中显示和处理PDF文档。PdfiumViewer提供了多种API和控件&#xff0c;使得开发者可以轻松地将PDF文档嵌入到其应用程序中。同时&#xff0c;PdfiumViewer…

unity游戏开发——(细)深入解析 Unity 地形系统:从基础到高级应用

Unity游戏开发 “好读书&#xff0c;不求甚解&#xff1b;每有会意&#xff0c;便欣然忘食。” 本文目录&#xff1a; Unity游戏开发 Unity游戏开发前言深入解析 Unity 地形系统&#xff1a;从基础到高级应用一、初识 Unity 地形系统1. 地形尺寸与分辨率 二、地形编辑工具详解1…

kafka发送消息-自定义消息发送的拦截器

1、自定义拦截器 创建自定义拦截器类&#xff0c;实现ProducerInterceptor接口。对消息进行拦截&#xff0c;可以在拦截中对消息做些处理&#xff0c;记录日志等操作… package com.power.config;import org.apache.kafka.clients.producer.ProducerInterceptor; import org…

【Spring Boot】全局异常处理

目录 背景 前言 设计步骤 1.定义异常信息类&#xff1a; 2.自定义异常&#xff1a; 3.创建全局异常处理类 4.在控制器中抛出异常 5.输出 捕获 Valid 校验异常 背景 去面试的时候被问到SpringBoot项目中&#xff0c;如何处理全局异常的&#xff0c;也就是如何捕获全局异…

vue2 part2

数据代理 通过defineProperty里面传入obj2和x&#xff0c;然后get和set下读取接收下然后再接收set中给对象x用value接收下&#xff0c;这样就能两个数据读取和接收了 <!DOCTYPE html> <html><head><meta charset"UTF-8" /><title>何…

浅谈【数据结构】链表之单链表

目录 1、什么是数据&#xff1f; 2、什么是结构 3、什么是数据结构&#xff1f; 4、线性结构(线性表&#xff09; 4.1线性表的物理结构的实现 5、链表 5.1无头结点的单链表 5.2新内容、老面孔 5.3数组和链表的优缺点 5.4链表的概念 5.5链表的创建步骤 5.5.1创建过程…

芯片后端之 PT 使用 report_timing 产生报告 之 -input_pins 选项

今天,我们再学习一点点 后仿真相关技能。 那就是,了解 report_timing 中的 -include_hierarchical_pins 选项。 如果我们仅仅使用如下命令,执行后会发现: pt_shell> report_timing -from FF1/CK -to FF2/d -delay_type max -include_hierarchical_pins 我们使用命…

【数据库】Mysql 批量变更所有字段类型为varchar的字符集

生成变更语句 SELECT CONCAT(ALTER TABLE , TABLE_NAME, MODIFY , COLUMN_NAME, , COLUMN_TYPE, , CHARACTER SET utf8 COLLATE utf8_general_ci , CASE WHEN IS_NULLABLE YES THEN NULL DEFAULT NULL WHEN IS_NULLABLE NO AND ISNULL(COLUMN_DEFAULT) THEN NOT NULL EL…

什么是持续集成(持续交付、部署)

文章目录 1 持续集成1.1 持续集成的好处1.2 持续集成的目的1.3 没有持续集成的状况 2 持续交付3 持续部署4 持续交付和持续部署的区别 1 持续集成 持续集成&#xff08;Continuous integration&#xff0c;简称CI&#xff09;&#xff0c;简单来说持续集成就是频繁地&#xff…

数字孪生网络 (DTN)关键技术分析

数字孪生网络 (DTN): 概念、架构及关键技术 摘要 随着5G商用规模部署和下一代互联网IPv6的深化应用&#xff0c;新一代网络技术的发展引发了产业界的广泛关注。智能化被认为是新一代网络发展的趋势&#xff0c;为数字化社会的信息传输提供了基础。面向数字化、智能化的新一代网…

【Linux篇】Linux命令基础

目录 1. Linux的目录结构 1.1 Linux的目录结构 1.2 /在Linux系统中的表示 2. linux命令基础 2.1 什么是命令和命令行 2.2 Linux命令的通用格式 2.3 ls命令 2.3.1 ls命令的参数的作用&#xff1a; 2.3.2 ls命令的选项 2.3.3 命令的选项组合使用 2.4 cd切换工作目录 2…