feat(cache): 优化设备模板缓存策略并添加分布式缓存清理功能

- 引入Caffeine本地缓存替代Redis缓存提高性能
- 添加Redis Pub/Sub机制实现多节点缓存同步清理
- 在CsDeviceServiceImpl中注释掉原有的Redis缓存清理逻辑
- 在CsDevModelServiceImpl中添加缓存清理消息发送功能
- 新增ModelCacheClearListener监听器处理缓存清理通知
- 实现IStatService接口的clearModelCache方法
- 添加getModelData方法实现本地缓存优先的数据获取策略
- 配置最大50000条缓存数据,60分钟过期时间
This commit is contained in:
xy
2026-06-15 10:09:29 +08:00
parent e4f42ba047
commit 8b95b1902c
6 changed files with 106 additions and 20 deletions

View File

@@ -25,6 +25,11 @@
<groupId>com.github.tocrhz</groupId>
<artifactId>mqtt-spring-boot-starter</artifactId>
</dependency>
<!-- caffeine 本地缓存 -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-web</artifactId>