Vehicle HAL(2)--Vehicle HAL 的启动
目录
1. VehicleService-main 函数分析
2. 构建EmulatedVehicleHal
2.1 EmulatedVehicleHal::EmulatedVehicleHal(xxx)
2.2 EmulatedVehicleHal::initStaticConfig()
2.3 EmulatedVehicleHal::onPropertyValue()
3. 构建VehicleEmulator
4. 构建VehicleHalManager
(1)初始化成员变量SubscriptionManager mSubscriptionManager
(2)调用VehicleHalManager::init()
a. 调用VehicleHal::init()
b. mHal->listProperties() 获取支持的属性
5. 构建WatchdogClient对象,并初始化
6. vhal主线程开启while(true)循环
1. VehicleService-main 函数分析
vhal在VehicleService-main中启动。具体代码如下:
hardware/interfaces/automotive/vehicle/2.0/default/VehicleService.cpp
17 #define LOG_TAG "automotive.vehicle@2.0-service"
18 #include <android/log.h>
19 #include <hidl/HidlTransportSupport.h>
20
21 #include <iostream>
22
23 #include <android/binder_process.h>
24 #include <utils/Looper.h>
25 #include <vhal_v2_0/EmulatedVehicleConnector.h>
26 #include <vhal_v2_0/EmulatedVehicleHal.h>
27 #include <vhal_v2_0/VehicleHalManager.h>
28 #include <vhal_v2_0/WatchdogClient.h>
29
30 using namespace android;
31 using namespace android::hardware;
32 using namespace android::hardware::automotive::vehicle::V2_0;
33
34 int main(int /* argc */, char* /* argv */ []) {
35 auto store = std::make_unique<VehiclePropertyStore>();//新建对象,采用默认构造函数VehiclePropertyStore
36 auto connector = std::make_unique<impl::EmulatedVehicleConnector>();//同上,构建EmulatedVehicleConnector
37 auto hal = std::make_unique<impl::EmulatedVehicleHal>(store.get(), connector.get());//第2章,获取对象的指针,来新建EmulatedVehicleHal
38 auto emulator = std::make_unique<impl::VehicleEmulator>(hal.get());//第3章,新建VehicleEmulator
39 auto service = std::make_unique<VehicleHalManager>(hal.get());//第4章,构建VehicleHalManager,传入hal指针,VehicleHalManager是实现hidl服务的主体
40 connector->setValuePool(hal->getValuePool());//属性池的指针设置给connector
41
42 configureRpcThreadpool(4, false /* callerWillJoin */);
43
44 ALOGI("Registering as service...");
45 status_t status = service->registerAsService();//hidl服务注册
46
47 if (status != OK) {
48 ALOGE("Unable to register vehicle service (%d)", status);
49 return 1;
50 }
51
52 // Setup a binder thread pool to be a car watchdog client.
53 ABinderProcess_setThreadPoolMaxThreadCount(1);
54 ABinderProcess_startThreadPool();
55 sp<Looper> looper(Looper::prepare(0 /* opts */));
56 std::shared_ptr<WatchdogClient> watchdogClient =
57 ndk::SharedRefBase::make<WatchdogClient>(looper, service.get());//第5章,构建WatchdogClient对象,并初始化
58 // The current health check is done in the main thread, so it falls short of capturing the real
59 // situation. Checking through HAL binder thread should be considered.
60 if (!watchdogClient->initialize()) {//初始化
61 ALOGE("Failed to initialize car watchdog client");
62 return 1;
63 }
64 ALOGI("Ready");
65 while (true) {
66 looper->pollAll(-1 /* timeoutMillis */);//第6章,开启while(true)循环
67 }
68
69 return 1;
70 }
71
2. 构建EmulatedVehicleHal
EmulatedVehicleHal实现了vhal中的VehicleHal抽象类。
从下图可以看出继承关系。
android11/hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h
android11/hardware/interfaces/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleHal.h
获取对象的指针,来新建EmulatedVehicleHal
EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client,EmulatedUserHal* emulatedUserHal = nullptr); |
EmulatedVehicleHal本身存放了很多静态配置的属性值,构建的时候会传入mPropStore。
2.1 EmulatedVehicleHal::EmulatedVehicleHal(xxx)
EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client,EmulatedUserHal* emulatedUserHal): mPropStore(propStore),//缓存,属性storemHvacPowerProps(std::begin(kHvacPowerProperties), std::end(kHvacPowerProperties)),mRecurrentTimer(std::bind(&EmulatedVehicleHal::onContinuousPropertyTimer, this,std::placeholders::_1)),mVehicleClient(client),//VehicleHalClient* mVehicleClient; 缓存,多重继承的EmulatedVehicleConnectormEmulatedUserHal(emulatedUserHal) {//初始化为nullinitStaticConfig();//初始化静态配置,里面会调用mPropStore->registerProperty(),有mPropStore的进一步操作for (size_t i = 0; i < arraysize(kVehicleProperties); i++) {mPropStore->registerProperty(kVehicleProperties[i].config);//继续初始化mPropStore,注册一些属性}mVehicleClient->registerPropertyValueCallback(std::bind(&EmulatedVehicleHal::onPropertyValue,//会从mVehicleClient触发回调回来this, std::placeholders::_1,std::placeholders::_2));//关键调用,属性变化之后的回调
}
2.2 EmulatedVehicleHal::initStaticConfig()
EmulatedVehicleHal() > EmulatedVehicleHal::initStaticConfig() > mPropStore->registerProperty()
kVehicleProperties是静态配置好了的。
195 const ConfigDeclaration kVehicleProperties[]
android11/hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
360 void EmulatedVehicleHal::initStaticConfig() {
361 for (auto&& it = std::begin(kVehicleProperties); it != std::end(kVehicleProperties); ++it) {
362 const auto& cfg = it->config;
363 VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
364
365 switch (cfg.prop) {
366 case OBD2_FREEZE_FRAME: {
367 tokenFunction = [](const VehiclePropValue& propValue) {
368 return propValue.timestamp;
369 };
370 break;
371 }
372 default:
373 break;
374 }
375
376 mPropStore->registerProperty(cfg, tokenFunction);//关键代码
377 }
378 }
38 void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config,
39 VehiclePropertyStore::TokenFunction tokenFunc) {
40 MuxGuard g(mLock);
41 mConfigs.insert({ config.prop, RecordConfig { config, tokenFunc } });//向std::unordered_map中插入
42 }
hardware/interfaces/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h 93 std::unordered_map<int32_t /* VehicleProperty */, RecordConfig> mConfigs;
2.3 EmulatedVehicleHal::onPropertyValue()
此为传递属性改变的关键函数
351 void EmulatedVehicleHal::onPropertyValue(const VehiclePropValue& value, bool updateStatus) {
352 VehiclePropValuePtr updatedPropValue = getValuePool()->obtain(value);
353
354 if (mPropStore->writeValue(*updatedPropValue, updateStatus)) {//更新属性
355 getEmulatorOrDie()->doSetValueFromClient(*updatedPropValue);//关键调用,Emulator,client,获取时通过socket走到can的另外一端
356 doHalEvent(std::move(updatedPropValue));//关键调用,返回变化到carservice
357 }
358 }
3. 构建VehicleEmulator
模拟车,做一些通信接口相关的初始化。把消息发给可能存在的ecu。在原生上是通过can给ecu发消息。见上一节EmulatedVehicleHal的onPropertyValue消息处理中有getEmulatorOrDie()->doSetValueFromClient(xxx)。
class VehicleEmulator : public MessageProcessor
用刚才构建的EmulatedVehicleHal来构建VehicleEmulator。VehicleEmulator模拟的vehicle,或者说模拟的car。
/**
* Emulates vehicle by providing controlling interface from host side either through ADB or Pipe.
*/
VehicleEmulator(EmulatedVehicleHalIface* hal);
VehicleEmulator::VehicleEmulator(EmulatedVehicleHalIface* hal) : mHal{hal} {mHal->registerEmulator(this);//把自己注册到EmulatedVehicleHal中,VehicleEmulator和mHal产生关系。mHal可以调用到VehicleEmulator。ALOGI("Starting SocketComm");mSocketComm = std::make_unique<SocketComm>(this);//新建socket通信相关对象mSocketComm->start();if (android::base::GetBoolProperty("ro.kernel.qemu", false)) {ALOGI("Starting PipeComm");mPipeComm = std::make_unique<PipeComm>(this);//pipe相关的mPipeComm->start();}if (android::base::GetBoolProperty("persist.vendor.cansocket", false)) {//enable siengine CanSocketCommALOGI("Starting CanSocketComm");mCanSocketComm = std::make_unique<CanSocketComm>(this);//CanSocketCommmCanSocketComm->start();}
}
4. 构建VehicleHalManager
构建VehicleHalManager的关键过程为有3步。VehicleHalManager实现了IVehiclel接口,hal服务的主体。
VehicleHalManager(VehicleHal* vehicleHal): mHal(vehicleHal),//初始化mHalmSubscriptionManager(std::bind(&VehicleHalManager::onAllClientsUnsubscribed,this, std::placeholders::_1)) {//初始化mSubscriptionManagerinit();//调用自己的init()函数}
(1)初始化成员变量SubscriptionManager mSubscriptionManager
SubscriptionManager 的构造函数
/*** Constructs SubscriptionManager** @param onPropertyUnsubscribed - called when no more clients are subscribed to the property.*/SubscriptionManager(const OnPropertyUnsubscribed& onPropertyUnsubscribed): mOnPropertyUnsubscribed(onPropertyUnsubscribed),//初始化给mOnPropertyUnsubscribedmCallbackDeathRecipient(new DeathRecipient(std::bind(&SubscriptionManager::onCallbackDead, this, std::placeholders::_1))){}
(2)调用VehicleHalManager::init()
hardware/interfaces/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
431 void VehicleHalManager::init() {
432 ALOGI("VehicleHalManager::init");
433
434 mHidlVecOfVehiclePropValuePool.resize(kMaxHidlVecOfVehiclPropValuePoolSize);
435
436
437 mBatchingConsumer.run(&mEventQueue,
438 kHalEventBatchingTimeWindow,
439 std::bind(&VehicleHalManager::onBatchHalEvent,
440 this, _1));//启动mBatchingConsumer
441
442 mHal->init(&mValueObjectPool,
443 std::bind(&VehicleHalManager::onHalEvent, this, _1),
444 std::bind(&VehicleHalManager::onHalPropertySetError, this,
445 _1, _2, _3));//a.调用hal的init函数
446
447 // Initialize index with vehicle configurations received from VehicleHal.
448 auto supportedPropConfigs = mHal->listProperties();//b.获取支持的属性
449 mConfigIndex.reset(new VehiclePropConfigIndex(supportedPropConfigs));//放入mConfigIndex
450
451 std::vector<int32_t> supportedProperties(
452 supportedPropConfigs.size());
453 for (const auto& config : supportedPropConfigs) {
454 supportedProperties.push_back(config.prop);
455 }
456 }
a. 调用VehicleHal::init()
调用hal的init函数:VehicleHal的init函数
93 void init(
94 VehiclePropValuePool* valueObjectPool,
95 const HalEventFunction& onHalEvent,
96 const HalErrorFunction& onHalError) {
97 mValuePool = valueObjectPool;
98 mOnHalEvent = onHalEvent;
99 mOnHalPropertySetError = onHalError;
100
101 onCreate();
102 }
b. mHal->listProperties() 获取支持的属性
hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
290 std::vector<VehiclePropConfig> EmulatedVehicleHal::listProperties() {
291 return mPropStore->getAllConfigs();
292 }
mHal中mPropStore的来源
hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
90 EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore, VehicleHalClient* client,
91 EmulatedUserHal* emulatedUserHal)
92 : mPropStore(propStore),//mPropStore的来源
93 mHvacPowerProps(std::begin(kHvacPowerProperties), std::end(kHvacPowerProperties)),
94 mRecurrentTimer(std::bind(&EmulatedVehicleHal::onContinuousPropertyTimer, this,
95 std::placeholders::_1)),
96 mVehicleClient(client),
97 mEmulatedUserHal(emulatedUserHal) {
98 initStaticConfig();
99 for (size_t i = 0; i < arraysize(kVehicleProperties); i++) {
100 mPropStore->registerProperty(kVehicleProperties[i].config);
101 }
102 mVehicleClient->registerPropertyValueCallback(std::bind(&EmulatedVehicleHal::onPropertyValue,
103 this, std::placeholders::_1,
104 std::placeholders::_2));
105 }
106
mPropStore->getAllConfigs()的实现:
hardware/interfaces/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
124 std::vector<VehiclePropConfig> VehiclePropertyStore::getAllConfigs() const {
125 MuxGuard g(mLock);
126 std::vector<VehiclePropConfig> configs;
127 configs.reserve(mConfigs.size());//从mConfigs来
128 for (auto&& recordConfigIt: mConfigs) {//遍历mConfigs
129 configs.push_back(recordConfigIt.second.propConfig);
130 }
131 return configs;
132 }
5. 构建WatchdogClient对象,并初始化
explicit WatchdogClient(const ::android::sp<::android::Looper>& handlerLooper,
VehicleHalManager* vhalManager);
将自己加入car watchdog的监控。
WatchdogClient::WatchdogClient(const sp<Looper>& handlerLooper, VehicleHalManager* vhalManager): mHandlerLooper(handlerLooper), mVhalManager(vhalManager), mCurrentSessionId(-1) {mMessageHandler = new MessageHandlerImpl(this);//新建内部的handler
}
bool WatchdogClient::initialize() {ndk::SpAIBinder binder(AServiceManager_getService("android.automotive.watchdog.ICarWatchdog/default"));//获取服务if (binder.get() == nullptr) {ALOGE("Failed to get carwatchdog daemon");return false;}std::shared_ptr<ICarWatchdog> server = ICarWatchdog::fromBinder(binder);if (server == nullptr) {ALOGE("Failed to connect to carwatchdog daemon");return false;}mWatchdogServer = server;//保存serverbinder = this->asBinder();if (binder.get() == nullptr) {ALOGE("Failed to get car watchdog client binder object");return false;}std::shared_ptr<ICarWatchdogClient> client = ICarWatchdogClient::fromBinder(binder);if (client == nullptr) {ALOGE("Failed to get ICarWatchdogClient from binder");return false;}mTestClient = client;mWatchdogServer->registerClient(client, TimeoutLength::TIMEOUT_NORMAL);//把自己注册到sever端,类型为TIMEOUT_NORMAL型的checkALOGI("Successfully registered the client to car watchdog server");return true;
}
接收来自sever(carwatchdogd)的回调
ndk::ScopedAStatus WatchdogClient::prepareProcessTermination() {return ndk::ScopedAStatus::ok();
}
6. vhal主线程开启while(true)循环
64 ALOGI("Ready");
65 while (true) {
66 looper->pollAll(-1 /* timeoutMillis */);//开启while(true)循环,主线程一直睡在这里
67 }
相关文章:

Vehicle HAL(2)--Vehicle HAL 的启动
目录 1. VehicleService-main 函数分析 2. 构建EmulatedVehicleHal 2.1 EmulatedVehicleHal::EmulatedVehicleHal(xxx) 2.2 EmulatedVehicleHal::initStaticConfig() 2.3 EmulatedVehicleHal::onPropertyValue() 3. 构建VehicleEmulator 4. 构建VehicleHalManager (1)初…...
JS中的函数防抖和节流:提升性能的关键技术
在JavaScript开发中,函数防抖和节流是两种常用的优化技术,用于处理那些可能会被频繁触发的事件,如resize、scroll、mousemove等。本文将详细介绍函数防抖和节流的概念、实现方法以及它们之间的区别。 一、什么是函数防抖和节流? …...
Android Compose开发架构选择指南:单Activity vs 多Activity
简介 掌握Jetpack Compose的Activity架构选择,是构建高性能、易维护Android应用的关键一步。在2025年的Android开发领域,随着Jetpack Compose的成熟和Android系统对多窗口模式的支持,开发者面临架构选择时需要更加全面地考虑各种因素。本文将深入探讨单Activity架构和多Act…...
【Netty系列】Reactor 模式 1
目录 一、Reactor 模式的核心思想 二、Netty 中的 Reactor 模式实现 1. 服务端代码示例 2. 处理请求的 Handler 三、运行流程解析(结合 Reactor 模式) 四、关键点说明 五、与传统模型的对比 六、总结 Reactor 模式是 Netty 高性能的核心设计思想…...
vue3 el-input type=“textarea“ 字体样式 及高度设置
在Vue 3中,如果你使用的是Element Plus库中的<el-input>组件作为文本域(type"textarea"),你可以通过几种方式来设置字体样式和高度。 1. 直接在<el-input>组件上使用style属性 你可以直接在<el-input&…...
并发解析hea,转为pdf格式
由于每次解析一个heap需要时间有点久,就写了一个自动解析程pdf的一个脚本。 down_lib.sh是需要自己写的哦,主要是用于下载自己所需程序的库,用于解析heap。 #!/bin/bash# 优化版通用解析脚本(并发加速):批…...

【C语言】详解 指针
前言: 在学习指针前,通过比喻的方法,让大家知道指针的作用。 想象一下,你在一栋巨大的图书馆里找一本书。如果没有书架编号和目录,这几乎是不可能完成的任务。 在 C 语言中,指针就像是图书馆的索引系统&…...

RabbitMQ仲裁队列高可用架构解析
#作者:闫乾苓 文章目录 概述工作原理1.节点之间的交互2.消息复制3.共识机制4.选举领导者5.消息持久化6.自动故障转移 集群环境节点管理仲裁队列增加集群节点重新平衡仲裁队列leader所在节点仲裁队列减少集群节点 副本管理add_member 在给定节点上添加仲裁队列成员&…...
刚出炉热乎的。UniApp X 封装 uni.request
HBuilder X v4.66 当前最新版本 由于 uniapp x 使用的是自己包装的 ts 语言 uts。目前语言还没有稳定下来,各种不支持 ts 各种报错各种不兼容问题。我一个个问题调通的,代码如下: 封装方法 // my-app/utils/request.uts const UNI_APP_BASE…...

Apache Kafka 实现原理深度解析:生产、存储与消费全流程
Apache Kafka 实现原理深度解析:生产、存储与消费全流程 引言 Apache Kafka 作为分布式流处理平台的核心,其高吞吐、低延迟、持久化存储的设计使其成为现代数据管道的事实标准。本文将从消息生产、持久化存储、消息消费三个阶段拆解 Kafka 的核心实现原…...

Python 训练营打卡 Day 41
简单CNN 一、数据预处理 在图像数据预处理环节,为提升数据多样性,可采用数据增强(数据增广)策略。该策略通常不改变单次训练的样本总数,而是通过对现有图像进行多样化变换,使每次训练输入的样本呈现更丰富…...

leetcode付费题 353. 贪吃蛇游戏解题思路
贪吃蛇游戏试玩:https://patorjk.com/games/snake/ 问题描述 设计一个贪吃蛇游戏,要求实现以下功能: 初始化游戏:给定网格宽度、高度和食物位置序列移动操作:根据指令(上、下、左、右)移动蛇头规则: 蛇头碰到边界或自身身体时游戏结束(返回-1)吃到食物时蛇身长度增加…...

CCPC dongbei 2025 I
题目链接:https://codeforces.com/gym/105924 题目背景: 给定一个二分图,左图编号 1 ~ n,右图 n 1 ~ 2n,左图的每个城市都会与右图的某个城市犯冲(每个城市都只与一个城市犯冲),除…...

系统性学习C语言-第十三讲-深入理解指针(3)
系统性学习C语言-第十三讲-深入理解指针(3) 1. 数组名的理解2. 使用指针访问数组3. ⼀维数组传参的本质4. 冒泡排序5. ⼆级指针 6. 指针数组7. 指针数组模拟二维数组 1. 数组名的理解 在上⼀个章节我们在使用指针访问数组的内容时,有这样的代…...
代理模式核心概念
代理模式核心概念 代理模式是一种结构型设计模式,通过创建一个代理对象来控制对原始对象的访问。主要分为两类: 一、静态代理 (Static Proxy) 定义:在编译期确定代理关系的模式,代理类和目标类都需要实现相同的接口。 核心特点…...
uni-app学习笔记十五-vue3页面生命周期(二)
onShow:用于监听页面显示,页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面; onHide:监听页面隐藏,当离开当前页面时触发。 示例代码: <template><view>姓名:{{nam…...

贪心算法实战篇2
文章目录 前言序列问题摆动序列单调递增的数字 贪心解决股票问题买卖股票的最佳时机II 两个维度权衡问题分发糖果根据身高重建队列 前言 今天继续带大家进行贪心算法的实战篇2,本章注意来解答一些运用贪心算法的中等的问题,大家好好体会,怎么…...

Java 大视界 -- Java 大数据机器学习模型在元宇宙虚拟场景智能交互中的关键技术(239)
💖亲爱的朋友们,热烈欢迎来到 青云交的博客!能与诸位在此相逢,我倍感荣幸。在这飞速更迭的时代,我们都渴望一方心灵净土,而 我的博客 正是这样温暖的所在。这里为你呈上趣味与实用兼具的知识,也…...
Flask中关于app.url_map属性的用法
目录 一、app.url_map 是什么? 二、可以查看哪些信息? 三、示例:打印所有路由 四、结合 url_for() 使用 五、常见用途场景 六、结合 Flask CLI 使用 总结 app.url_map 是 Flask 中非常重要的一个属性,用于查看或操作整个应用的 URL 路由映射表(routing map)。它展…...

高速串行接口
1.网口设计方案 上图中给出了两种网口设计方案,最上面是传统设计方式,下面是利用GT作为PHY层的设计,然后FPGA中设计协议层和MAC层。 2.SRIO SRIO的本地操作和远程操作 3.其他高速接口 srio rapid io aurora8b10b aurora64b66b pcie s…...

学习STC51单片机23(芯片为STC89C52RCRC)
每日一言 成功的路上从不拥挤,因为坚持的人不多,你要做那个例外。 通过单片机发指令给ESP8266进行通信 通信原理(也是接线原理) 代码如下 代码解释一下,因为我们的指令是字符数组(c语言没有字符串的概念),…...

一个完整的日志收集方案:Elasticsearch + Logstash + Kibana+Filebeat (一)
整体链路 [应用服务器] --> [Filebeat] --> [Logstash] --> [Elasticsearch] --> [Kibana] 组件职责 Kibana: 可视化和分析日志数据Elasticsearch: 存储和索引日志数据Logstash: 解析、转换和丰富日志数据Filebeat:…...

网络系统中安全漏洞扫描为何重要?扫描啥?咋扫描?
在网络系统中,安全漏洞扫描占据着极其重要的位置,这一环节有助于我们发现并消除潜在的安全隐患,进而提高网络安全防护的等级。下面,我将对此进行详尽的说明。 基本概念 漏洞扫描技术可以揭示并评估网站存在的安全风险࿰…...
HiveSQL语法全解析与实战指南
Hive SQL完整语法体系与特性解析 一、数据定义语言(DDL) 库操作 CREATE DATABASE [IF NOT EXISTS] dbname[COMMENT 描述][LOCATION hdfs_path][WITH DBPROPERTIES (keyvalue)];ALTER DATABASE dbname SET DBPROPERTIES (keyvalue); DROP DATABASE [IF…...
【conda报错】InvalidArchiveError
InvalidArchiveError - conda - Conda Community Forum 还是pip安装吧...

Socket 编程 TCP
目录 1. TCP socket API 详解 1.1 socket 1.2 bind 1.3 listen 1.4 accept 1.5 read&&write 1.6 connect 1.7 recv 1.8 send 1.9 popen 1.10 fgets 2. EchoServer 3. 多线程远程命令执行 4. 引入线程池版本翻译 5. 验证TCP - windows作为client访问Linu…...
Redis-6.2.9 Sentinel 哨兵配置
目录 1 操作系统信息和redis软件版本 2 集群架构图 3 部署redis主从 4 sentinel 配置文件 5 运维管理 6 go编写应用业务测试 哨兵核心功能:能够后台监控redis主机是否故障,如果故障了根据投票自动将从库转换为主库 1 操作系统信息和redis软件版本 rootu24-re…...

基于TMC5160堵转检测技术的夹紧力控制系统设计与实现
点击下面图片带您领略全新的嵌入式学习路线 🔥爆款热榜 90万阅读 1.6万收藏 一、技术背景与系统原理 在工业自动化领域,夹紧力控制是精密装配、机床夹具等场景的核心需求。传统方案多采用压力传感器伺服电机的闭环控制方式,但存在系统复杂…...
从零开始搞个简易分布式部署环境
从零开始,意味着连个服务器都没有,所以第一步,随便上哪个顺眼的云厂家去租个便宜大碗的服务器(不要window系统的就行),说大碗也不太对,主要是这碗能在手里用得久,这个就自己扒拉去了…...

XCTF-web-fileclude
解析如下 <?php include("flag.php"); // 包含敏感文件(通常包含CTF挑战的flag) highlight_file(__FILE__); // 高亮显示当前PHP文件源代码(方便查看代码逻辑)if(isset($_GET["file1"]…...