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

Jetson Nano驱动机器人的左右两路电机

基于Jetson Nano板子搭建一个无人车,少不了减速电机驱动轮子滚动,那如何驱动呢?

从Jetson.GPIO库文件来说,里面没有支持产生PWM的引脚,也就意味着Jetson nano没有硬件产生PWM的能力,所以我们不得不使用别的方法产生PWM完成驱动控制,而刚好STM8解决了这一问题并且节约了它有限的GPIO资源,我们借助STM8这款MCU作为协处理器,大大增强了Jetson nano的驱动能力,PWM的周期和占空比(在一个脉冲循环内,通电时间相对于总时间所占的比例)都完全可控。

我们来看下它的参数:

我们使用的是上图所示的QFN20封装的STM8,它主要参数特征如下:

1. I2C接口,支持多路PWM输出
2. 内置16MHz晶振,可不连接外部晶振,也可以连接外部晶振
3. 支持2.95V-5.5V电压,最大耐压值5.5V
4. 具有上电复位,以及软件复位等功能

由上图三极管驱动的有源蜂鸣器电路,而三极管控制引脚接在协处理器可知,开启蜂鸣器只需要通过IIC给协处理器对应的指令即可,下面我们看到通讯协议:

在上一篇文章我们演示的蜂鸣器,我们通过IIC向协处理器(地址0x1B)的寄存器0x06发送1即可打开蜂鸣器,发送0即关闭蜂鸣器

bus.write_byte_data(0x1B,0x06,1或0)

同样的给出两路电机的电路图:

我们来实际驱动电机看下,这里电机控制部分用到了Jetbotmini的库:

from jetbotmini import Robot
import time
robot = Robot()
print(dir(robot))
#['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_add_notifiers', '_config_changed', '_cross_validation_lock', '_find_my_config', '_instance', '_load_config', '_log_default', '_notify_trait', '_register_validator', '_remove_notifiers', '_trait_default_generators', '_trait_notifiers', '_trait_validators', '_trait_values', '_walk_mro', 'add_traits', 'backward', 'class_config_rst_doc', 'class_config_section', 'class_get_help', 'class_get_trait_help', 'class_own_trait_events', 'class_own_traits', 'class_print_help', 'class_trait_names', 'class_traits', 'clear_instance', 'config', 'cross_validation_lock', 'forward', 'has_trait', 'hold_trait_notifications', 'i2c_bus', 'initialized', 'instance', 'left', 'left_motor', 'left_motor_alpha', 'left_motor_channel', 'log', 'motor_driver', 'notify_change', 'observe', 'on_trait_change', 'parent', 'right', 'right_motor', 'right_motor_alpha', 'right_motor_channel', 'section_names', 'set_motors', 'set_trait', 'setup_instance', 'stop', 'trait_events', 'trait_metadata', 'trait_names', 'traits', 'unobserve', 'unobserve_all', 'update_config']
print(dir(robot.left_motor))
#['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_add_notifiers', '_config_changed', '_cross_validation_lock', '_driver', '_find_my_config', '_load_config', '_motor', '_notify_trait', '_observe_value', '_register_validator', '_release', '_remove_notifiers', '_trait_default_generators', '_trait_notifiers', '_trait_validators', '_trait_values', '_write_value', 'add_traits', 'alpha', 'beta', 'class_config_rst_doc', 'class_config_section', 'class_get_help', 'class_get_trait_help', 'class_own_trait_events', 'class_own_traits', 'class_print_help', 'class_trait_names', 'class_traits', 'config', 'cross_validation_lock', 'has_trait', 'hold_trait_notifications', 'notify_change', 'observe', 'on_trait_change', 'parent', 'section_names', 'set_trait', 'setup_instance', 'trait_events', 'trait_metadata', 'trait_names', 'traits', 'unobserve', 'unobserve_all', 'update_config', 'value']
#这个转速的范围是[0,1],不过我设置成0.1也没有转,设置成0.2及以上才转,不知道是不是电量不是很足的原因了。
robot.left_motor.value = 0.8
robot.right_motor.value = 0.8
#这样就可以让电机转动了,很简单,然后做停止电机的操作
robot.left_motor.value = 0
robot.right_motor.value = 0
#或者直接将robot停止也可以
#robot.stop()

这段赋值左右马达的意思就是,控制电机速度的值的范围是0~1.0,即代表给出的PWM的占空比为0~100%,所以赋值为0,就是把输出给电机的PWM占空比设置为0,这样就关闭了电机

更多的robot实例方法可以自行查阅源码:

Help on Robot in module jetbotmini.robot object:class Robot(traitlets.config.configurable.SingletonConfigurable)|  A configurable that only allows one instance.|  |  This class is for classes that should only have one instance of itself|  or *any* subclass. To create and retrieve such a class use the|  :meth:`SingletonConfigurable.instance` method.|  |  Method resolution order:|      Robot|      traitlets.config.configurable.SingletonConfigurable|      traitlets.config.configurable.LoggingConfigurable|      traitlets.config.configurable.Configurable|      traitlets.traitlets.HasTraits|      traitlets.traitlets.HasDescriptors|      builtins.object|  |  Methods defined here:|  |  __init__(self, *args, **kwargs)|      Create a configurable given a config config.|      |      Parameters|      ----------|      config : Config|          If this is empty, default values are used. If config is a|          :class:`Config` instance, it will be used to configure the|          instance.|      parent : Configurable instance, optional|          The parent Configurable instance of this object.|      |      Notes|      -----|      Subclasses of Configurable must call the :meth:`__init__` method of|      :class:`Configurable` *before* doing anything else and using|      :func:`super`::|      |          class MyConfigurable(Configurable):|              def __init__(self, config=None):|                  super(MyConfigurable, self).__init__(config=config)|                  # Then any other code you need to finish initialization.|      |      This ensures that instances will be configured properly.|  |  backward(self, speed=1.0)|  |  forward(self, speed=1.0, duration=None)|  |  left(self, speed=1.0)|  |  right(self, speed=1.0)|  |  set_motors(self, left_speed, right_speed)|  |  stop(self)|  |  ----------------------------------------------------------------------|  Data descriptors defined here:|  |  i2c_bus|      An int trait.|  |  left_motor|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  left_motor_alpha|      A float trait.|  |  left_motor_channel|      An int trait.|  |  right_motor|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  right_motor_alpha|      A float trait.|  |  right_motor_channel|      An int trait.|  |  ----------------------------------------------------------------------|  Class methods inherited from traitlets.config.configurable.SingletonConfigurable:|  |  clear_instance() from traitlets.traitlets.MetaHasTraits|      unset _instance for this class and singleton parents.|  |  initialized() from traitlets.traitlets.MetaHasTraits|      Has an instance been created?|  |  instance(*args, **kwargs) from traitlets.traitlets.MetaHasTraits|      Returns a global instance of this class.|      |      This method create a new instance if none have previously been created|      and returns a previously created instance is one already exists.|      |      The arguments and keyword arguments passed to this method are passed|      on to the :meth:`__init__` method of the class upon instantiation.|      |      Examples|      --------|      |      Create a singleton class using instance, and retrieve it::|      |          >>> from traitlets.config.configurable import SingletonConfigurable|          >>> class Foo(SingletonConfigurable): pass|          >>> foo = Foo.instance()|          >>> foo == Foo.instance()|          True|      |      Create a subclass that is retrived using the base class instance::|      |          >>> class Bar(SingletonConfigurable): pass|          >>> class Bam(Bar): pass|          >>> bam = Bam.instance()|          >>> bam == Bar.instance()|          True|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.config.configurable.LoggingConfigurable:|  |  log|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  ----------------------------------------------------------------------|  Methods inherited from traitlets.config.configurable.Configurable:|  |  update_config(self, config)|      Update config and load the new values|  |  ----------------------------------------------------------------------|  Class methods inherited from traitlets.config.configurable.Configurable:|  |  class_config_rst_doc() from traitlets.traitlets.MetaHasTraits|      Generate rST documentation for this class' config options.|      |      Excludes traits defined on parent classes.|  |  class_config_section() from traitlets.traitlets.MetaHasTraits|      Get the config class config section|  |  class_get_help(inst=None) from traitlets.traitlets.MetaHasTraits|      Get the help string for this class in ReST format.|      |      If `inst` is given, it's current trait values will be used in place of|      class defaults.|  |  class_get_trait_help(trait, inst=None) from traitlets.traitlets.MetaHasTraits|      Get the help string for a single trait.|      |      If `inst` is given, it's current trait values will be used in place of|      the class default.|  |  class_print_help(inst=None) from traitlets.traitlets.MetaHasTraits|      Get the help string for a single trait and print it.|  |  section_names() from traitlets.traitlets.MetaHasTraits|      return section names as a list|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.config.configurable.Configurable:|  |  config|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  parent|      A trait whose value must be an instance of a specified class.|      |      The value can also be an instance of a subclass of the specified class.|      |      Subclasses can declare default classes by overriding the klass attribute|  |  ----------------------------------------------------------------------|  Methods inherited from traitlets.traitlets.HasTraits:|  |  __getstate__(self)|  |  __setstate__(self, state)|  |  add_traits(self, **traits)|      Dynamically add trait attributes to the HasTraits instance.|  |  has_trait(self, name)|      Returns True if the object has a trait with the specified name.|  |  hold_trait_notifications(self)|      Context manager for bundling trait change notifications and cross|      validation.|      |      Use this when doing multiple trait assignments (init, config), to avoid|      race conditions in trait notifiers requesting other trait values.|      All trait notifications will fire after all values have been assigned.|  |  notify_change(self, change)|  |  observe(self, handler, names=traitlets.All, type='change')|      Setup a handler to be called when a trait changes.|      |      This is used to setup dynamic notifications of trait changes.|      |      Parameters|      ----------|      handler : callable|          A callable that is called when a trait changes. Its|          signature should be ``handler(change)``, where ``change`` is a|          dictionary. The change dictionary at least holds a 'type' key.|          * ``type``: the type of notification.|          Other keys may be passed depending on the value of 'type'. In the|          case where type is 'change', we also have the following keys:|          * ``owner`` : the HasTraits instance|          * ``old`` : the old value of the modified trait attribute|          * ``new`` : the new value of the modified trait attribute|          * ``name`` : the name of the modified trait attribute.|      names : list, str, All|          If names is All, the handler will apply to all traits.  If a list|          of str, handler will apply to all names in the list.  If a|          str, the handler will apply just to that name.|      type : str, All (default: 'change')|          The type of notification to filter by. If equal to All, then all|          notifications are passed to the observe handler.|  |  on_trait_change(self, handler=None, name=None, remove=False)|      DEPRECATED: Setup a handler to be called when a trait changes.|      |      This is used to setup dynamic notifications of trait changes.|      |      Static handlers can be created by creating methods on a HasTraits|      subclass with the naming convention '_[traitname]_changed'.  Thus,|      to create static handler for the trait 'a', create the method|      _a_changed(self, name, old, new) (fewer arguments can be used, see|      below).|      |      If `remove` is True and `handler` is not specified, all change|      handlers for the specified name are uninstalled.|      |      Parameters|      ----------|      handler : callable, None|          A callable that is called when a trait changes.  Its|          signature can be handler(), handler(name), handler(name, new),|          handler(name, old, new), or handler(name, old, new, self).|      name : list, str, None|          If None, the handler will apply to all traits.  If a list|          of str, handler will apply to all names in the list.  If a|          str, the handler will apply just to that name.|      remove : bool|          If False (the default), then install the handler.  If True|          then unintall it.|  |  set_trait(self, name, value)|      Forcibly sets trait attribute, including read-only attributes.|  |  setup_instance(self, *args, **kwargs)|      This is called **before** self.__init__ is called.|  |  trait_metadata(self, traitname, key, default=None)|      Get metadata values for trait by key.|  |  trait_names(self, **metadata)|      Get a list of all the names of this class' traits.|  |  traits(self, **metadata)|      Get a ``dict`` of all the traits of this class.  The dictionary|      is keyed on the name and the values are the TraitType objects.|      |      The TraitTypes returned don't know anything about the values|      that the various HasTrait's instances are holding.|      |      The metadata kwargs allow functions to be passed in which|      filter traits based on metadata values.  The functions should|      take a single value as an argument and return a boolean.  If|      any function returns False, then the trait is not included in|      the output.  If a metadata key doesn't exist, None will be passed|      to the function.|  |  unobserve(self, handler, names=traitlets.All, type='change')|      Remove a trait change handler.|      |      This is used to unregister handlers to trait change notifications.|      |      Parameters|      ----------|      handler : callable|          The callable called when a trait attribute changes.|      names : list, str, All (default: All)|          The names of the traits for which the specified handler should be|          uninstalled. If names is All, the specified handler is uninstalled|          from the list of notifiers corresponding to all changes.|      type : str or All (default: 'change')|          The type of notification to filter by. If All, the specified handler|          is uninstalled from the list of notifiers corresponding to all types.|  |  unobserve_all(self, name=traitlets.All)|      Remove trait change handlers of any type for the specified name.|      If name is not specified, removes all trait notifiers.|  |  ----------------------------------------------------------------------|  Class methods inherited from traitlets.traitlets.HasTraits:|  |  class_own_trait_events(name) from traitlets.traitlets.MetaHasTraits|      Get a dict of all event handlers defined on this class, not a parent.|      |      Works like ``event_handlers``, except for excluding traits from parents.|  |  class_own_traits(**metadata) from traitlets.traitlets.MetaHasTraits|      Get a dict of all the traitlets defined on this class, not a parent.|      |      Works like `class_traits`, except for excluding traits from parents.|  |  class_trait_names(**metadata) from traitlets.traitlets.MetaHasTraits|      Get a list of all the names of this class' traits.|      |      This method is just like the :meth:`trait_names` method,|      but is unbound.|  |  class_traits(**metadata) from traitlets.traitlets.MetaHasTraits|      Get a ``dict`` of all the traits of this class.  The dictionary|      is keyed on the name and the values are the TraitType objects.|      |      This method is just like the :meth:`traits` method, but is unbound.|      |      The TraitTypes returned don't know anything about the values|      that the various HasTrait's instances are holding.|      |      The metadata kwargs allow functions to be passed in which|      filter traits based on metadata values.  The functions should|      take a single value as an argument and return a boolean.  If|      any function returns False, then the trait is not included in|      the output.  If a metadata key doesn't exist, None will be passed|      to the function.|  |  trait_events(name=None) from traitlets.traitlets.MetaHasTraits|      Get a ``dict`` of all the event handlers of this class.|      |      Parameters|      ----------|      name: str (default: None)|          The name of a trait of this class. If name is ``None`` then all|          the event handlers of this class will be returned instead.|      |      Returns|      -------|      The event handlers associated with a trait name, or all event handlers.|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.traitlets.HasTraits:|  |  cross_validation_lock|      A contextmanager for running a block with our cross validation lock set|      to True.|      |      At the end of the block, the lock's value is restored to its value|      prior to entering the block.|  |  ----------------------------------------------------------------------|  Static methods inherited from traitlets.traitlets.HasDescriptors:|  |  __new__(cls, *args, **kwargs)|      Create and return a new object.  See help(type) for accurate signature.|  |  ----------------------------------------------------------------------|  Data descriptors inherited from traitlets.traitlets.HasDescriptors:|  |  __dict__|      dictionary for instance variables (if defined)|  |  __weakref__|      list of weak references to the object (if defined)

相关文章:

Jetson Nano驱动机器人的左右两路电机

基于Jetson Nano板子搭建一个无人车,少不了减速电机驱动轮子滚动,那如何驱动呢?从Jetson.GPIO库文件来说,里面没有支持产生PWM的引脚,也就意味着Jetson nano没有硬件产生PWM的能力,所以我们不得不使用别的方…...

如何通过openssl生成公钥和私钥?

1、生成RSA秘钥的方法 生成RSA秘钥的方法: openssl genrsa -des3 -out privkey.pem 2048 注:建议用2048位秘钥,少于此可能会不安全或很快将不安全。 这个命令会生成一个2048位的秘钥,同时有一个des3方法加密的密码&#xff0c…...

Verilog的If语句和Case语句

这篇文章将讨论 verilog 中两个最常用的结构----if语句和case语句。在之前的文章中学习了如何使用过程块(例如always块)来编写按顺序执行的verilog 代码。此外还可以在过程块中使用许多语句----统称为顺序语句,如case 语句和 if 语句。这篇文…...

HJ31 单词倒排

描述 对字符串中的所有单词进行倒排。 说明: 1、构成单词的字符只有26个大写或小写英文字母; 2、非构成单词的字符均视为单词间隔符; 3、要求倒排后的单词间隔符以一个空格表示;如果原字符串中相邻单词间有多个间隔符时&#xf…...

leetcode——203.移除链表元素

文章目录🐨1.题目🪅2.解法1-头节点迭代🌿2.1 思路🌿2.2 代码实现🦆3. 解法2-创建新链表🎏3.1 思路🎏3.2 代码实现🐐4. 题目链接🐨1.题目 给你一个链表的头节点head和一个…...

GPT-4来袭:开启人工智能新时代

文章目录介绍GPT4 模型演示示例示例 1示例 2示例 3示例 4示例 5最后Reference介绍 2023年3月15日,OpenAI公司正式发布了先进的自然语言处理模型GPT-4,前不久发布的GPT-3.5模型只能理解文字的语言模型,而新发布的GPT4则是多模态模型&#xff…...

芯微电子IPO终止:业绩开始大幅下滑,王日新、王苟新兄弟不同命

近日,深圳证券交易所披露的信息显示,黄山芯微电子股份有限公司(下称“芯微电子”)申请撤回发行上市申请文件。因此,深圳证券交易所决定终止对其首次公开发行股票并在创业板上市的审核。 据贝多财经了解,芯…...

【C++】用手搓的红黑树手搓set和map

目录 一、set/map的底层结构 1、set/map的源码 2、利用模板区分set/map 3、利用仿函数控制比较大小 二、set/map的迭代器(红黑树的迭代器) 1、红黑树的begin、end迭代器 2、红黑树迭代器的operator 3、红黑树迭代器的operator-- 三、set的const…...

【C++】空指针弃NULL用nullptr

空指针(null pointer)不指向任何对象,在试图使用一个指针之前代码可以首先检查它是否为空。声明空指针的3种方法: int* p1 NULL; int* p2 nullptr; int* p3 0; 在C语言中常用NULL生成空指针,NULL是一个宏&#xf…...

【selenium学习】数据驱动测试

数据驱动在 unittest 中,使用读取数据文件来实现参数化可以吗?当然可以。这里以读取 CSV文件为例。创建一个 baidu_data.csv 文件,如图所示:文件第一列为测试用例名称,第二例为搜索的关键字。接下来创建 test_baidu_da…...

嵌入式硬件电路设计的基本技巧

目录 1 分模块 2 标注关键参数 3 电阻/电容/电感/磁珠的注释 4 可维修性 5 BOM表归一化 6 电源和地的符号 7 测试点 8 网络标号 9 容错性/兼容性 10 NC、NF 11 版本变更 12 悬空引脚 13 可扩展性 14 防呆 15 信号的流向 16 PCB走线建议 17 不使用\表示取反 不…...

Spring MVC 图片的上传和下载

✅作者简介:2022年博客新星 第八。热爱国学的Java后端开发者,修心和技术同步精进。 🍎个人主页:Java Fans的博客 🍊个人信条:不迁怒,不贰过。小知识,大智慧。 💞当前专栏…...

远程工具神器之MobaXterm (小白必看)

目录 1、介绍 2、ssh连接详解过程 3、特点 1、介绍 带有 X11 服务器、选项卡式 SSH 客户端、网络工具等的 Windows 增强型终端。 MobaXterm 是您远程计算的终极工具箱。在单个Windows应用程序中,它提供了大量功能,这些功能是为程序员,网站管…...

VRIK+Unity XR Interaction Toolkit 实现VR上半身的追踪(附带VRM模型导入Unity方法和手腕扭曲的解决方法)

文章目录📕第一步:配置 OpenXR XR Interaction Toolkit 的开发环境📕第二步:导入人物模型⭐VRM 模型导入 Unity 的方法📕第三步:配置 VRIK⭐给模型加上 VRIK 组件⭐将模型的头部和手部的位置作为 VR 追踪目…...

【C++进阶】map的介绍和使用

文章目录map的介绍map的模板参数介绍map的容器介绍map重要容器接口的介绍及使用构造函数增删查改迭代器的使用map的介绍 map是关联容器,它按照特定的次序(按照key来比较)存储由键值key和值value组合而成的元素。在map中,键值key通常用于排序和惟一地标识…...

第十四届蓝桥杯三月真题刷题训练——第 15 天

目录 第 1 题:斐波那契与7 问题描述 答案提交 运行限制 代码: 第 2 题:小蓝做实验 问题描述 答案提交 运行限制 代码: 第 1 题:斐波那契与7 问题描述 斐波那契数列的递推公式为: FnFn−1Fn−2​, 其中 F1F21…...

HTML5是什么?怎么学习HTML5?

HTML5 是什么?HTML5是什么?相信这个问题并不容易回答,大多数人对于HTML5的概念仅仅是听说过而已,非要让他说出个所以然来,结果只能让你失望。相比普及了近十四年的HTML4来说,HTML5带来的震撼其实丝毫不亚于…...

个人算法题精简导航整理(精炼汇总,含知识点、模板题、题单)

文章目录前言导航注意事项技巧类自定义Pair排序N维数组转一维位运算状态压缩算法基础枚举 √指数型枚举排列型枚举组合型枚举模拟 √日期天数问题:平年闰年情况递归&分治 √贪心 √货仓选址-模板题排序 √归并排序前缀和&差分 √前缀和差分(一维…...

Mac 和 Win,到底用哪个系统学编程?

今天来聊一个老生常谈的问题,学编程时到底选择什么操作系统?Mac、Windows,还是别的什么。。 作为一个每种操作系统都用过很多年的程序员,我会结合我自己的经历来给大家一些参考和建议。 接下来先分别聊聊每种操作系统的优点和不…...

文心一言---中国版的“ChatGPT”狂飙的机会或许要出现了

⭐️我叫忆_恒心,一名喜欢书写博客的在读研究生👨‍🎓。 如果觉得本文能帮到您,麻烦点个赞👍呗! 近期会不断在专栏里进行更新讲解博客~~~ 有什么问题的小伙伴 欢迎留言提问欧,喜欢的小伙伴给个三…...

【WiFi帧结构】

文章目录 帧结构MAC头部管理帧 帧结构 Wi-Fi的帧分为三部分组成:MAC头部frame bodyFCS,其中MAC是固定格式的,frame body是可变长度。 MAC头部有frame control,duration,address1,address2,addre…...

练习(含atoi的模拟实现,自定义类型等练习)

一、结构体大小的计算及位段 (结构体大小计算及位段 详解请看:自定义类型:结构体进阶-CSDN博客) 1.在32位系统环境,编译选项为4字节对齐,那么sizeof(A)和sizeof(B)是多少? #pragma pack(4)st…...

多场景 OkHttpClient 管理器 - Android 网络通信解决方案

下面是一个完整的 Android 实现&#xff0c;展示如何创建和管理多个 OkHttpClient 实例&#xff0c;分别用于长连接、普通 HTTP 请求和文件下载场景。 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas…...

【SpringBoot】100、SpringBoot中使用自定义注解+AOP实现参数自动解密

在实际项目中,用户注册、登录、修改密码等操作,都涉及到参数传输安全问题。所以我们需要在前端对账户、密码等敏感信息加密传输,在后端接收到数据后能自动解密。 1、引入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId...

select、poll、epoll 与 Reactor 模式

在高并发网络编程领域&#xff0c;高效处理大量连接和 I/O 事件是系统性能的关键。select、poll、epoll 作为 I/O 多路复用技术的代表&#xff0c;以及基于它们实现的 Reactor 模式&#xff0c;为开发者提供了强大的工具。本文将深入探讨这些技术的底层原理、优缺点。​ 一、I…...

优选算法第十二讲:队列 + 宽搜 优先级队列

优选算法第十二讲&#xff1a;队列 宽搜 && 优先级队列 1.N叉树的层序遍历2.二叉树的锯齿型层序遍历3.二叉树最大宽度4.在每个树行中找最大值5.优先级队列 -- 最后一块石头的重量6.数据流中的第K大元素7.前K个高频单词8.数据流的中位数 1.N叉树的层序遍历 2.二叉树的锯…...

dify打造数据可视化图表

一、概述 在日常工作和学习中&#xff0c;我们经常需要和数据打交道。无论是分析报告、项目展示&#xff0c;还是简单的数据洞察&#xff0c;一个清晰直观的图表&#xff0c;往往能胜过千言万语。 一款能让数据可视化变得超级简单的 MCP Server&#xff0c;由蚂蚁集团 AntV 团队…...

云原生玩法三问:构建自定义开发环境

云原生玩法三问&#xff1a;构建自定义开发环境 引言 临时运维一个古董项目&#xff0c;无文档&#xff0c;无环境&#xff0c;无交接人&#xff0c;俗称三无。 运行设备的环境老&#xff0c;本地环境版本高&#xff0c;ssh不过去。正好最近对 腾讯出品的云原生 cnb 感兴趣&…...

NXP S32K146 T-Box 携手 SD NAND(贴片式TF卡):驱动汽车智能革新的黄金组合

在汽车智能化的汹涌浪潮中&#xff0c;车辆不再仅仅是传统的交通工具&#xff0c;而是逐步演变为高度智能的移动终端。这一转变的核心支撑&#xff0c;来自于车内关键技术的深度融合与协同创新。车载远程信息处理盒&#xff08;T-Box&#xff09;方案&#xff1a;NXP S32K146 与…...

JavaScript基础-API 和 Web API

在学习JavaScript的过程中&#xff0c;理解API&#xff08;应用程序接口&#xff09;和Web API的概念及其应用是非常重要的。这些工具极大地扩展了JavaScript的功能&#xff0c;使得开发者能够创建出功能丰富、交互性强的Web应用程序。本文将深入探讨JavaScript中的API与Web AP…...