前期文章中关于RedisOperateUtil工具类使用时需要强制类型转换,针对List等操作不方便,为此特意更新RedisOperateUtil工具类,前文链接:https://blog.csdn.net/liwenyang1992/article/details/111771097?spm=1001.2014.3001.5501

通过Docker搭建Redis环境并启动,命令如下:

#docker启动redis服务
docker run -itd --name redis -p 6379:6379 redis
#使用redis-cli连接redis
docker exec -it redis redis-cli

application.properties配置如下:

server.port=8080
server.servlet.context-path=/redis############################################################
# REDIS 配置
############################################################
spring.redis.database=0
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=
spring.redis.lettuce.pool.max-active=18
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=2
spring.redis.lettuce.shutdown-timeout=100ms
spring.redis.timeout=100
spring.cache.cache-names=myCache
#是否启用连接池,如果依赖中有common-pools2依赖自动会启用
spring.redis.lettuce.pool.enabled=true

pom.xml内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.6.2</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.lwy.it</groupId><artifactId>spring-redis</artifactId><version>0.0.1-SNAPSHOT</version><name>spring-redis</name><description>Demo project for Spring Boot Redis</description><properties><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- RedisTemplate底层使用commons-pool2来作为连接池--><dependency><groupId>org.apache.commons</groupId><artifactId>commons-pool2</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><excludes><exclude><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></exclude></excludes></configuration></plugin></plugins></build>
</project>

由于SpringBoot 2.0版本之后spring-boot-starter-data-redis的底层默认使用了Lettuce来操作redis,早期的版本使用的是Jedis,使用Lettuce获取连接都是通过LettuceConnectionFactory这个工厂类来获取的,默认情况下Lettuce使用的是一个线程安全的共享的本地连接来操作Redis,如果你不希望使用本地连接可以设置shareNativeConnection这个参数为false。备注:RedisTemplate底层使用commons-pool2来作为连接池。

备注:默认情况下RedisTemplate是不使用连接池的,并且性能还是不错的。

RedisConfiguration配置如下:

package com.lwy.it.configuration;import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;/*** 使用Jackson2JsonRedisSerializer序列化和反序列化*/
@Configuration
public class RedisConfiguration extends CachingConfigurerSupport {@Bean("redisTemplate")public RedisTemplate redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {RedisTemplate redisTemplate = new RedisTemplate();// 启用连接共享lettuceConnectionFactory.setShareNativeConnection(true);// 配置连接工厂redisTemplate.setConnectionFactory(lettuceConnectionFactory);// 使用Jackson2JsonRedisSerializer来序列化和反序列化Redis的value值Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);ObjectMapper objectMapper = new ObjectMapper();// 指定药序列化的域,field,get和set,以及修饰符范围// ANY任何级别的字段都可以自动识别objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会抛出异常objectMapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);jackson2JsonRedisSerializer.setObjectMapper(objectMapper);// value采用Json序列化redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);// 使用StringRedisSerializer来序列化和反序列化Redis的keyredisTemplate.setKeySerializer(new StringRedisSerializer());// 使用StringRedisSerializer来序列化和反序列化Redis的Hash keyredisTemplate.setHashKeySerializer(new StringRedisSerializer());// Hash value采用Json序列化redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);return redisTemplate;}@Overridepublic CacheErrorHandler errorHandler() {return new RedisCacheErrorHandler();}}

核心Redis操作工具类RedisOperateUtil如下,主要包括Redis键(Key)、字符串(String)、哈希(Hash)、列表(List)、集合(Set)等常用的操作。

package com.lwy.it.util;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.QueryTimeoutException;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;@Component
public final class RedisOperateUtil {private static Logger LOGGER = LoggerFactory.getLogger(RedisOperateUtil.class);// 默认最长时效时间(秒)private static long EXPIRED_TIME = 604800L;private void setDefaultExpiredTime(final String key) {Long ttl = this.ttl(key, TimeUnit.SECONDS);if (!Objects.isNull(ttl) && ttl.equals(-1L)) {this.expire(key, EXPIRED_TIME, TimeUnit.SECONDS);}}@Autowiredprivate RedisOperations redisTemplate;/*** DEL key** @param key Redis Key* @return 是否删除成功*/public Boolean del(final String key) {Boolean result = null;try {result = redisTemplate.delete(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** DEL key key** @param keys Redis Keys* @return 删除的数量*/public Long del(final Set<String> keys) {Long result = null;try {result = redisTemplate.delete(keys);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** EXISTS key** @param key Redis Key* @return 是否存在key*/public Boolean exists(final String key) {Boolean result = null;try {result = redisTemplate.hasKey(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** EXISTS key1 key2** @param keys Redis Keys* @return 指定为参数的键中存在的键数,多次提及和存在的键被多次计算。*/public Long exists(final Set<String> keys) {Long result = null;try {result = redisTemplate.countExistingKeys(keys);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** EXPIRE key seconds** @param key     Redis Key* @param timeout 超时时间* @param unit    时间粒度单位* @return 在管道/事务中使用时为 null*/public Boolean expire(final String key, final long timeout, TimeUnit unit) {Boolean result = null;try {result = redisTemplate.expire(key, timeout, unit);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** TTL key** @param key      Redis Key* @param timeUnit 时间粒度单位* @return 按照给定时间粒度单位,返回过期时间,时间粒度单位为空时默认为秒*/public Long ttl(final String key, TimeUnit timeUnit) {if (Objects.isNull(timeUnit)) {timeUnit = TimeUnit.SECONDS;}Long result = null;try {result = redisTemplate.getExpire(key, timeUnit);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** TTL key** @param key Redis Key* @return 按照给定时间粒度单位,返回过期时间,时间粒度单位为空时默认为秒*/public Long ttl(final String key) {return this.ttl(key, TimeUnit.SECONDS);}/*** SET key value** @param key   Redis Key* @param value 存储的value* @param <V>   value泛型类型*/public <V> void set(final String key, final V value) {this.setex(key, value, EXPIRED_TIME, TimeUnit.SECONDS);}/*** GET key** @param key Redis Key* @param <V> value泛型类型* @return 返回存储的value*/public <V> V get(final String key) {ValueOperations<String, V> operations = redisTemplate.opsForValue();V result = null;try {result = operations.get(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** GETSET key value** @param key   Redis Key* @param value 存储的value* @param <V>   value泛型类型* @return 指定key的值,并返回key的旧值*/public <V> V getset(final String key, final V value) {ValueOperations<String, V> operations = redisTemplate.opsForValue();V result = null;try {result = operations.getAndSet(key, value);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** MSET key value [key value ...]* 缺少过期时间,不建议使用** @param map 不能为空* @param <V> value泛型类型*/@Deprecatedpublic <V> void mset(final Map<String, V> map) {if (!CollectionUtils.isEmpty(map)) {ValueOperations<String, V> operations = redisTemplate.opsForValue();try {operations.multiSet(map);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}} else {LOGGER.warn("Parameters map is null or empty");}}/*** MGET key [key ...]* 建议使用LinkedHashSet** @param keys 不重复Redis Key集合,不能为空* @param <V>  value泛型类型* @return 结果List集合*/public <V> List<V> mget(final Set<String> keys) {List<V> result = Collections.emptyList();if (!CollectionUtils.isEmpty(keys)) {ValueOperations<String, V> operations = redisTemplate.opsForValue();try {result = operations.multiGet(keys);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}}return result;}/*** SETEX key seconds value** @param key     Redis Key* @param value   Redis Value* @param timeout 超时时间* @param unit    单位* @param <V>     value泛型类型*/public <V> void setex(final String key, final V value, final long timeout, TimeUnit unit) {if (Objects.isNull(unit)) {unit = TimeUnit.SECONDS;}ValueOperations<String, V> operations = redisTemplate.opsForValue();try {operations.set(key, value, timeout, unit);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}}/*** SETNX key value** @param key     Redis Key* @param value   Redis Value* @param timeout 超时时间* @param unit    单位* @param <V>     value泛型类型* @return 设置成功,返回true。设置失败,返回false。*/public <V> Boolean setnx(final String key, final V value, final long timeout, TimeUnit unit) {if (Objects.isNull(unit)) {unit = TimeUnit.SECONDS;}ValueOperations<String, V> operations = redisTemplate.opsForValue();Boolean result = null;try {result = operations.setIfAbsent(key, value, timeout, unit);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** INCR key* 如果key不存在,那么key的值会先被初始化为0,然后再执行INCR操作。* 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。** @param key Redis Key* @return 加上1之后,key的值。*/public Long incr(final String key) {return this.incrby(key, 1L);}/*** INCRBY key increment** @param key   Redis Key* @param delta 指定的增量值* @return 加上指定的增量值之后,key的值。*/public Long incrby(final String key, final long delta) {Long result = null;ValueOperations<String, Long> operations = redisTemplate.opsForValue();try {result = operations.increment(key, delta);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** DECRBY key** @param key Redis Key* @return 减去1之后,key的值。*/public Long decr(final String key) {return this.decrby(key, 1L);}/*** Redis Decrby命令将key所储存的值减去指定的减量值。* 如果key不存在,那么key的值会先被初始化为0,然后再执行DECRBY操作。* 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。** @param key   Redis Key* @param delta 指定减量值* @return 减去指定减量值之后,key的值。*/public Long decrby(final String key, final long delta) {ValueOperations<String, Long> operations = redisTemplate.opsForValue();Long result = null;try {result = operations.decrement(key, delta);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HDEL key field [field ...]** @param key      Redis Key* @param hashKeys Hash Keys* @return 被成功删除字段的数量,不包括被忽略的字段。*/public Long hdel(final String key, final String... hashKeys) {Long result = null;try {result = redisTemplate.opsForHash().delete(key, hashKeys);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HEXISTS key field** @param key     Redis Key* @param hashKey Hash Key* @return 如果哈希表含有给定字段,返回teue。如果哈希表不含有给定字段,或key不存在,返回false。*/public Boolean hexists(final String key, final String hashKey) {Boolean result = null;try {result = redisTemplate.opsForHash().hasKey(key, hashKey);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HGET key field** @param key     Redis Key* @param hashKey Hash Key* @param <V>     value泛型类型* @return 返回给定字段的值。如果给定的字段或key不存在时,返回null。*/public <V> V hget(final String key, final String hashKey) {HashOperations<String, String, V> operations = redisTemplate.opsForHash();V result = null;try {result = operations.get(key, hashKey);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HGETALL key** @param key Redis Key* @param <V> value泛型类型* @return 以列表形式返回哈希表的字段及字段值。若key不存在,返回空列表。*/public <V> Map<String, V> hgetall(final String key) {HashOperations<String, String, V> operations = redisTemplate.opsForHash();Map<String, V> result = null;try {result = operations.entries(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HKEYS key** @param key Redis Key* @return 包含哈希表中所有域(field)列表。当key不存在时,返回一个空列表。*/public Set<String> hkeys(final String key) {Set<String> result = null;try {result = redisTemplate.opsForHash().keys(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HLEN key** @param key Redis Key* @return 获取哈希表中字段的数量*/public Long hlen(final String key) {Long result = null;try {result = redisTemplate.opsForHash().size(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HMGET key field [field ...]* 建议使用LinkedHashSet** @param key      Redis Key* @param hashKeys Hash Key* @param <V>      value泛型类型* @return 一个包含多个给定字段关联值的表,表值的排列顺序和指定字段的请求顺序一样。*/public <V> List<V> hmget(final String key, final Set<String> hashKeys) {HashOperations<String, String, V> operations = redisTemplate.opsForHash();List<V> result = null;try {result = operations.multiGet(key, hashKeys);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HSET key field value** @param key     Redis Key* @param hashKey Hash Key* @param value   存储的值* @param <V>     value泛型类型*/public <V> void hset(final String key, final String hashKey, final V value) {try {redisTemplate.opsForHash().put(key, hashKey, value);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}}/*** HMSET key field value [field value ...]** @param key Redis Key* @param map Redis Key Value* @param <V> value泛型类型*/public <V> void hmset(final String key, final Map<String, V> map) {if (!CollectionUtils.isEmpty(map)) {try {redisTemplate.opsForHash().putAll(key, map);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}}}/*** HSETNX key field value* 只有在字段 field 不存在时,设置哈希表字段的值。** @param key     Redis Key* @param hashKey Hash Key* @param value   存储的值* @param <V>     value泛型类型* @return 设置成功,返回true。如果给定字段已经存在且没有操作被执行,返回false。*/public <V> Boolean hsetnx(final String key, final String hashKey, final V value) {Boolean result = null;try {result = redisTemplate.opsForHash().putIfAbsent(key, hashKey, value);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** HVALS key** @param key Redis Key* @param <V> value泛型类型* @return 一个包含哈希表中所有值的列表。当key不存在时,返回一个空表。*/public <V> List<V> hvals(String key) {List<V> result = null;try {result = redisTemplate.opsForHash().values(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** BLPOP key timeout** @param key     Redis Key* @param timeout 超时时间* @param unit    单位* @param <V>     value泛型类型* @return 被弹出元素的值*/public <V> V blpop(final String key, final long timeout, TimeUnit unit) {if (Objects.isNull(unit)) {unit = TimeUnit.SECONDS;}ListOperations<String, V> operations = redisTemplate.opsForList();V result = null;try {result = operations.leftPop(key, timeout, unit);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** BRPOP key timeout** @param key     Redis Key* @param timeout 超时时间* @param unit    单位* @param <V>     value泛型类型* @return 被弹出元素的值*/public <V> V brpop(final String key, final long timeout, TimeUnit unit) {if (Objects.isNull(unit)) {unit = TimeUnit.SECONDS;}ListOperations<String, V> operations = redisTemplate.opsForList();V result = null;try {result = operations.rightPop(key, timeout, unit);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LINDEX key index** @param key   Redis Key* @param index 索引* @param <V>   value泛型类型* @return 通过索引获取列表中的元素*/public <V> V lindex(final String key, final long index) {ListOperations<String, V> operations = redisTemplate.opsForList();V result = null;try {result = operations.index(key, index);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LLEN key** @param key Redis Key* @return 列表长度*/public Long llen(final String key) {Long result = null;try {result = redisTemplate.opsForList().size(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LPOP key** @param key Redis Key* @param <V> value泛型类型* @return 移出并获取列表的第一个元素*/public <V> V lpop(final String key) {ListOperations<String, V> operations = redisTemplate.opsForList();V result = null;try {result = operations.leftPop(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LPUSH key value** @param key   Redis Key* @param value 存储的值* @param <V>   value泛型类型* @return 执行LPUSH命令后,列表的长度*/public <V> Long lpush(final String key, final V value) {ListOperations<String, V> operations = redisTemplate.opsForList();Long result = null;try {result = operations.leftPush(key, value);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LPUSH key value [value ...]** @param key    Redis Key* @param values 存储的列表值* @param <V>    value泛型类型* @return 执行LPUSH命令后,列表的长度*/public <V> Long lpush(final String key, final Collection<V> values) {ListOperations<String, V> operations = redisTemplate.opsForList();Long result = null;try {result = operations.leftPushAll(key, values);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LRANGE key start stop** @param key   Redis Key* @param start 开始索引* @param end   结束索引* @param <V>   value泛型类型* @return 列表指定范围内的元素*/public <V> List<V> lrange(final String key, final long start, final long end) {ListOperations<String, V> operations = redisTemplate.opsForList();List<V> result = null;try {result = operations.range(key, start, end);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** LSET key index value** @param key   Redis Key* @param index 索引* @param value 存储的值* @param <V>   value泛型类型*/public <V> void lset(final String key, final long index, final V value) {ListOperations<String, V> operations = redisTemplate.opsForList();try {operations.set(key, index, value);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}}/*** RPOP key** @param key Redis Key* @param <V> value泛型类型* @return 被移除的元素*/public <V> V rpop(final String key) {ListOperations<String, V> operations = redisTemplate.opsForList();V result = null;try {result = operations.rightPop(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** RPUSH key value** @param key   Redis Key* @param value 存储的值* @param <V>   value泛型类型* @return 执行RPUSH操作后,列表的长度*/public <V> Long rpush(final String key, final V value) {ListOperations<String, V> operations = redisTemplate.opsForList();Long result = null;try {result = operations.rightPush(key, value);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** RPUSH key value [value ...]** @param key    Redis Key* @param values 存储的列表值* @param <V>    value泛型类型* @return 执行RPUSH操作后,列表的长度*/public <V> Long rpush(final String key, Collection<V> values) {ListOperations<String, V> operations = redisTemplate.opsForList();Long result = null;try {result = operations.rightPushAll(key, values);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** SADD key member [member ...]** @param key    Redis Key* @param values 存储的列表值* @param <V>    value泛型类型* @return 被添加到集合中的新元素的数量,不包括被忽略的元素。*/public <V> Long sadd(final String key, final V... values) {SetOperations<String, V> operations = redisTemplate.opsForSet();Long result = null;try {result = operations.add(key, values);this.setDefaultExpiredTime(key);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** SCARD key** @param key Redis Key* @param <V> value泛型类型* @return 集合的数量。当集合key不存在时,返回0。*/public <V> Long scard(final String key) {Long result = null;try {result = redisTemplate.opsForSet().size(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** SISMEMBER key member** @param key    Redis Key* @param object 成员元素* @return 如果成员元素是集合的成员,返回true。如果成员元素不是集合的成员,或key不存在,返回false。*/public Boolean sismember(final String key, final Object object) {Boolean result = null;try {result = redisTemplate.opsForSet().isMember(key, object);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** SMEMBERS key** @param key Redis Key* @param <V> value泛型类型* @return 集合中的所有成员。*/public <V> Set<V> smembers(final String key) {SetOperations<String, V> operations = redisTemplate.opsForSet();Set<V> result = null;try {result = operations.members(key);} catch (RedisConnectionFailureException exception) {LOGGER.error(exception.getMessage(), exception);} catch (QueryTimeoutException exception) {LOGGER.error(exception.getMessage(), exception);}return result;}/*** SREM key member [member ...]** @param key    Redis Key* @param values 删除的值* @return 被成功移除的元素的数量,不包括被忽略的元素。*/public Long srem(final String key, final Object... values) {Long result = null;try {result = redisTemplate.opsForSet().remove(key, values);} catch (Exception exception) {LOGGER.error(exception.getMessage(), exception);}return result;}
}
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Vue知识点串讲

    一、Vue知识点串讲 复习一下Vue中的核心知识点。 复习完基本的知识点以后&#xff0c;后面再来看一下其它的面试内容 1、基本使用 下面&#xff0c;先来看一段最简单的代码&#xff0c;如下所示&#xff1a; <!DOCTYPE html> <html lang"en"><he…...

    2024/4/28 14:36:52
  2. 1-数据库 初识数据库1

    课程安排 数据库基础 前端基础 django基础 bbs小作业 路飞学城 django drf linux go k8s docker 爬虫 cmdb 代码发布 每日测验 今日暂无 数据库 存储数据的演变过程 随意的存到一个文件中、数据格式也是千差万别的完全取决于我们自己 """ # 小李…...

    2024/4/19 19:18:50
  3. 一些采坑的教训

    当pytorch运行报错时&#xff0c;就来看看我吧&#xff01; AssertionError: The NVIDIA driver on your system is too old (found version 9000). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Downlo…...

    2024/4/20 12:11:41
  4. 科大星云诗社动态20210129

    【每日一诗】 来自{uin:3330267063,nick:Sparks} 夜•海晞 小可爱的原创投稿[em]e176[/em] 【每日一诗】 饮中八仙歌 杜甫 知章骑马似乘船&#xff0c; 眼花落井水底眠。 汝阳三斗始朝天&#xff0c; 道逢麹车口流涎&#xff0c; 恨不移封向酒泉。 左相日兴费万钱&#xff0c;…...

    2024/4/14 14:13:35
  5. 科大星云诗社动态20210130

    【每日一诗】 来自{uin:3330267063,nic【诗背后的故事•咏鹅少年骆宾王的悲剧】 那一年&#xff0c;二十岁的骆宾王&#xff0c;没有回老家做生意。他雄心万丈&#xff0c;准备干一番大事业。经朋友引荐&#xff0c;他进了道王李元庆的幕府&#xff0c;但道王没看出骆宾王的才…...

    2024/4/28 9:05:06
  6. 018. 想利用自己的技能去做副业,但是无从下手怎么办?

    “生财有术”创始人–亦仁曾分享: 做副业的第一步,就是要有一个开放的头脑。 绝大多数人,脑袋里面跳出来几个赚钱的点子就以为是全部了。而实际情况是,没什么成功赚钱经验的人,脑袋里面跳出来的前几个点子,都可以抛弃掉,因为随随便便都想得到的,一定不赚钱。 正确的做法…...

    2024/4/28 14:40:48
  7. 基于Django框架在线教育平台的开发与设计源码+毕业论文+答辩ppt+开题报告+任务书

    https://download.csdn.net/download/AAshou/76531770 项目介绍: 基于Django框架在线教育平台的开发与设计源码毕业论文答辩ppt开题报告任务书 系统说明: 本系统的目标是利用基于python的开源Web框架Django&#xff0c;采用MTV (Model-View-Template) 的框架模式实现在线教…...

    2024/4/28 6:55:35
  8. 赵小楼《天道》深度解析(75)客观是对现有事实的认可,嘴上认可可不行,得心里认,否则就是自欺

    本文是《天道》解读系列按《遥远的救世主》小说情节深度解析的第75集&#xff0c;解读完后会按《天道》电视剧不同于小说部分的情节再补充解读&#xff0c;然后会出专题解读系列&#xff0c;整体共约160集以上。 关注赵小楼&#xff0c;与10000人一起重读天道&#xff0c;学习…...

    2024/4/25 8:02:42
  9. 102.BufferedOutputStream字节缓冲输出流

    BufferedOutputStream字节缓冲输出流 【构造方法】 BufferedOutputStream(OutputStream out); 这里的参数是字节输出流 【成员方法】 <1>void write(int b); <2>void write(byte[] buf); <3>void write(byte[] buf,int off,int len); 上面的方法都是由Outpu…...

    2024/4/28 1:16:44
  10. 筛法(埃筛、线性筛)学习笔记

    一、问题引入 求 111 ~ nnn 闭区间内的所有质数。 二、问题分析 1. 朴素的素数筛法 很自然的一种想法就是对 111 到 nnn 之间的所有数进行一次素数检验&#xff0c;不过显然这种方式很低效&#xff0c;大致复杂度为 O(nn)O(n\sqrt{n})O(nn​)。 2. Eratosthenes筛法 埃拉…...

    2024/4/18 18:48:19
  11. 04 MyBatis数据操作

    1 初识MyBatis 1.1 MyBatis框架简介 MyBatis框架可以简化数据库编程&#xff01;MyBatis底层封装的是JDBC&#xff0c;使用起来比JDBC大大简化。 在使用MyBatis实现数据库编程时&#xff0c;只需要定义每个数据操作功能的抽象方法&#xff0c;并配置这个抽象方法对应的SQL语…...

    2024/4/28 0:27:19
  12. 002SpringIOC001IOC概述和入门案例

    1 简介 1.1 IOC简介 IOC&#xff08;Inverse of Controll&#xff09;&#xff0c;即反转控制。 在应用程序中的组件需要获取资源时&#xff0c;传统的方式是组件主动的从容器中获取所需要的资源。在这样的模式下开发人员往往需要知道在具体容器中特定资源的获取方式&#x…...

    2024/4/28 11:33:59
  13. 项目管理的整体进度的中间阶段

    项目的中盘时段&#xff0c;就是项目整体进度的中间阶段。 当你发现有些事情正在进行&#xff0c;有些事情并未进行&#xff0c;有些问题已经发现并解决&#xff0c;有些问题还没有找出来&#xff0c;这时&#xff0c;你就明白已经进入中盘阶段。中盘阶段很有挑战性&#xff0…...

    2024/4/27 22:13:37
  14. 浅谈-----虚函数、纯虚函数、基类析构虚函数

    虚函数 //C的多态性通过虚函数来体现&#xff0c;体现为类与类直接的继承关系--》子类完成对基类的重写。 //定义基类&#xff08;具有一定包容性&#xff09;部分成员函数写为虚函数。 //定义子类、集成基类、并且重写 虚函数。&#xff08;对比基类的包容性、子类有具体性&a…...

    2024/4/14 14:47:30
  15. 时间序列 工具库学习(10) Darts模块-Transformer模型

    1.导库 # fix python path if working locally from utils import fix_pythonpath_if_working_locallyfix_pythonpath_if_working_locally()%load_ext autoreload %autoreload 2 %matplotlib inlineimport torch import torch.nn as nn import torch.optim as optim import nu…...

    2024/4/18 8:29:07
  16. 时间序列 工具库学习(9) Darts模块-TCN时间卷积网络

    1.导库 # fix python path if working locally from utils import fix_pythonpath_if_working_locallyfix_pythonpath_if_working_locally()import numpy as np import pandas as pd import matplotlib.pyplot as pltfrom darts import TimeSeries from darts.models import T…...

    2024/4/19 12:41:05
  17. 流密码立方攻击(基于图算法)

    流密码常见概念 流密码(Stream cipher)是对称加密的一种。流密码将明文(Plaintex)看成二进制数据流&#xff0c;通过初始密钥生成加密密钥流ziz_izi​与明文流pip_ipi​做异或操作获得密文流cic_ici​&#xff0c;即cipi⊕zic_ip_i\oplus{z_i}ci​pi​⊕zi​。由于异或操作是可…...

    2024/4/14 14:14:01
  18. 《MySQL技术》学习笔记——数据类型

    MySQL技术内幕——数据类型数据值类别数值字符串值时态&#xff08;日期/时间&#xff09;值空间值布尔值NULL值MySQL数据类型数据类型概述表定义里的特殊列类型指定列的默认值数字数据类型字符串数据类型时态&#xff08;日期/时间&#xff09;数据类型MySQL如何处理无效数据值…...

    2024/4/5 5:03:39
  19. 在Unity C#中创建2D自上而下射击游戏

    在Unity中创建2D自上而下射击游戏 你会学到什么 打造2D游戏 让NPC跟随玩家或与玩家并肩作战 用C#编程 制作库存 MP4 |视频:h264&#xff0c;1280720 |音频:AAC&#xff0c;44.1 KHz&#xff0c;2 Ch 语言&#xff1a;英语中英文字幕&#xff08;根据原英文字幕机译更准确&…...

    2024/4/18 1:38:49
  20. 04 MyBati数据操作

    1 初识MyBatis 1.1 MyBatis框架简介 MyBatis框架可以简化数据库编程&#xff01;MyBatis底层封装的是JDBC&#xff0c;使用起来比JDBC大大简化。 在使用MyBatis实现数据库编程时&#xff0c;只需要定义每个数据操作功能的抽象方法&#xff0c;并配置这个抽象方法对应的SQL语…...

    2024/4/14 14:14:06

最新文章

  1. 【vue2+antvx6】节点大小不一致,点击按钮流程图自动布局

    需求: 1、点击优化布局的按钮,自动布局(从左到右),按钮变成撤销布局按钮 2、点击撤销布局的按钮,返回之前的布局 3、在点击优化布局的按钮后,如果移动了节点,则自动将撤销布局的按钮变成优化布局的按钮 第一步:安装插件 npm i @antv/layout 第二步:写方法 // 优…...

    2024/4/28 16:07:53
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 【C++】类和对象①(什么是面向对象 | 类的定义 | 类的访问限定符及封装 | 类的作用域和实例化 | 类对象的存储方式 | this指针)

    目录 前言 什么是面向对象&#xff1f; 类的定义 类的访问限定符及封装 访问限定符 封装 类的作用域 类的实例化 类对象的存储方式 this指针 结语 前言 最早的C版本&#xff08;C with classes&#xff09;中&#xff0c;最先加上的就是类的机制&#xff0c;它构成…...

    2024/4/28 12:13:12
  4. 爱自然生命力粤东中心家风家教高端研讨会在广东汕头盛大开启

    2024年3月30日&#xff0c;爱自然生命力粤东中心家风家教高端研讨会在广东汕头金海湾大酒店隆重召开。 &#xff08;图为活动现场&#xff09; 本次由爱自然生命力体系粤东中心主办的粤东家风家教高端研讨会&#xff0c;主题为“携手校家社&#xff0c;共筑新格局”&#xff0…...

    2024/4/27 1:44:56
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/28 13:52:11
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/28 3:28:32
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/26 23:05:52
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/28 13:51:37
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/27 17:58:04
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/27 14:22:49
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/28 1:28:33
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/28 15:57:13
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/27 17:59:30
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/25 18:39:16
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/28 1:34:08
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/26 19:03:37
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/28 1:22:35
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/25 18:39:14
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/26 23:04:58
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/27 23:24:42
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/28 5:48:52
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/26 19:46:12
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/27 11:43:08
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/27 8:32:30
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57