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='123.60.153.169', port=6379, password='Xgf_redis', db=6)
#     redis_client = redis.Redis(host='124.70.129.232', port=6379, password='Xgf_redis', db=6)
#
#     value = read_from_redis(redis_client,"92b44ffb50b6ab2068f5de447c9925")
#     print(value)