import redis
# 从 MySQL 表中读取数据并写入 Redis
def read_from_file_and_write_to_redis(redis_client,ori_measure_id,measure_vector):
    # Redis 连接配置    
    redis_client.hset('measure_config',ori_measure_id, measure_vector)

# 从 Redis 中读取数据
def read_from_redis(redis_client,ori_measure_id):
    # 获取所有键
    return redis_client.hget('measure_config',ori_measure_id).decode()
    
if __name__ == "__main__":
    redis_client = redis.Redis(host='192.168.0.175', port=6379, password='Xgf_redis', db=6)

    value = read_from_redis(redis_client,"bb3cf43f3dba147373c706c6567b5a")
    print(value)
