YOLO v5 Series -Redis


Secret

c 复制代码
D:\msys64\home\unix2linux\lua2\redis>echo %DATE%T%TIME%
2024-12-31T 8:55:47.94
D:\msys64\home\unix2linux\lua2\redis>printf "%DATE%%TIME%" | openssl dgst -md5
MD5(stdin)= b40c65cc4796709fea4fb6e370ab355b

D:\msys64\home\unix2linux\lua2\redis>uuidgen
e9ce2966-8cf6-4e80-862e-1914261ee784
D:\msys64\home\unix2linux\lua2\redis>uuidgen | openssl dgst -md5
MD5(stdin)= 64763802aba6d3b6e67505659a36b4fd

D:\msys64\home\unix2linux\lua2\redis>linux_date +"%s%N"
1735606709895182500
D:\msys64\home\unix2linux\lua2\redis>linux_date +"%s%N" | openssl dgst -md5
MD5(stdin)= e88ac702f6da42dd731179501d5e7aec


Auth

c 复制代码
D:\msys64\home\unix2linux\lua2\redis>redis-cli -a e88ac702f6da42dd731179501d5e7aec
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) "e88ac702f6da42dd731179501d5e7aec"
127.0.0.1:6379>

Configure

c 复制代码
###############################################################################
requirepass 'e88ac702f6da42dd731179501d5e7aec' 
###############################################################################
dbfilename "dump.rdb"

save 900 1
save 300 10
save 60 10000
###############################################################################

Keys

c 复制代码
D:\msys64\home\unix2linux\lua2\redis>red
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> config get dir
1) "dir"
2) "D:\\msys64\\home\\unix2linux\\lua2\\redis"
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> save
OK
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> ping
PONG

Flush

c 复制代码
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> flushall
OK
127.0.0.1:6379>

Data Dictionary : Run Mode

c 复制代码
[
    {
        "ID": 0, 
        "Key": "ON", 
        "Value": "running", 
        "Data": "", 
        "Description": ""
    }, 
    {
        "ID": 1, 
        "Key": "OFF", 
        "Value": "freezing", 
        "Data": "", 
        "Description": ""
    }
]

Data Dictionary : Predict Mode

c 复制代码
[
    {
        "ID": 0, 
        "Key": "YOLO V5", 
        "Value": "yolov5s.pt", 
        "Data": "", 
        "Description": ""
    }, 
    {
        "ID": 1, 
        "Key": "Fireworks V1", 
        "Value": "fireworksv1.pt", 
        "Data": "", 
        "Description": ""
    }
]
c 复制代码
127.0.0.1:6379> set data-dictionary:run-mode "[{'ID':0,'Key':'ON','Value':'running','Data':'','Description':''},{'ID':1,'Key':'OFF','Value':'freezing','Data':'','Description':''}]"
OK
127.0.0.1:6379> set data-dictionary:predict-mode "[{'ID':0,'Key':'YOLO V5','Value':'yolov5s.pt','Data':'','Description':''},{'ID':1,'Key':'Fireworks V1','Value':'fireworksv1.pt','Data':'','Description':''}]"
OK
127.0.0.1:6379> save
OK
127.0.0.1:6379> keys *
1) "data-dictionary:predict-mode"
2) "data-dictionary:run-mode"
127.0.0.1:6379> get data-dictionary:run-mode
"[{'ID':0,'Key':'ON','Value':'running','Data':'','Description':''},{'ID':1,'Key':'OFF','Value':'freezing','Data':'','Description':''}]"
127.0.0.1:6379> get data-dictionary:predict-mode
"[{'ID':0,'Key':'YOLO V5','Value':'yolov5s.pt','Data':'','Description':''},{'ID':1,'Key':'Fireworks V1','Value':'fireworksv1.pt','Data':'','Description':''}]"

Data Dictionary List

c 复制代码
D:\msys64\home\unix2linux\lua2\redis>curl "http://localhost:9999/api/redis/dictionary/list?master=run-mode&slave=0"
{
  "code": 0,
  "msg": "success",
  "data": {
    "master": "run-mode",
    "slave": "0",
    "token": [
      {
        "ID": 0,
        "Key": "ON",
        "Value": "running",
        "Data": "",
        "Description": ""
      }
    ]
  }
}
D:\msys64\home\unix2linux\lua2\redis>curl "http://localhost:9999/api/redis/dictionary/list?master=predict-mode"
{
  "code": 0,
  "msg": "success",
  "data": {
    "master": "predict-mode",
    "slave": "",
    "token": [
      [
        {
          "Data": "",
          "Description": "",
          "ID": 0,
          "Key": "YOLO V5",
          "Value": "yolov5s.pt"
        },
        {
          "Data": "",
          "Description": "",
          "ID": 1,
          "Key": "Fireworks V1",
          "Value": "fireworksv1.pt"
        }
      ]
    ]
  }
}

Data Dictionary Save

c 复制代码
D:\msys64\home\unix2linux\lua2\redis>curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{\"ID\":0,\"Name\":\"redis\"}" "http://localhost:9999/api/redis/dictionary/save?master=view-mode"
{
  "code": 0,
  "msg": "success",
  "data": {
    "master": "view-mode",
    "slave": "",
    "body": {
      "ID": 0,
      "Name": "redis"
    }
  }
}
相关推荐
BUG研究员_10 分钟前
微服务のGeteWay
java·数据库·微服务
ice___Cpu25 分钟前
Redis - 8 ( 10000 字 Redis 入门级教程 )
数据库·redis·缓存
Rk..30 分钟前
数据库索引相关总结
java·数据库·sql
菠菠萝宝36 分钟前
【Go学习】-01-4-项目管理及协程
数据库·学习·golang·操作系统·软件工程·协程·os
数据的世界011 小时前
SQL使用视图
数据库·sql
T.O.P111 小时前
InnoDB存储引擎对MVCC的实现
数据库·oracle
SelectDB技术团队2 小时前
计算效率提升 10 倍,存储成本降低 60%,灵犀科技基于 Apache Doris 建设统一数据服务平台
大数据·数据库·数据仓库·数据分析·doris
追风赶月、3 小时前
【MySQL】表的基本查询
数据库·mysql
高思宇3 小时前
Oracle删除归档日志
数据库·windows·oracle
Ultipa4 小时前
图数据库 | 17、高可用分布式设计(上)
数据库·分布式