闲话不说,直接上代码
一、RedisTemplate

/** Copyright 2011-2018 the original author or authors.** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**      http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
package org.springframework.data.redis.core;import java.io.Closeable;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.data.redis.RedisSystemException;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisKeyCommands;
import org.springframework.data.redis.connection.RedisServerCommands;
import org.springframework.data.redis.connection.RedisTxCommands;
import org.springframework.data.redis.connection.RedisZSetCommands.Tuple;
import org.springframework.data.redis.connection.SortParameters;
import org.springframework.data.redis.core.ZSetOperations.TypedTuple;
import org.springframework.data.redis.core.query.QueryUtils;
import org.springframework.data.redis.core.query.SortQuery;
import org.springframework.data.redis.core.script.DefaultScriptExecutor;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.data.redis.core.script.ScriptExecutor;
import org.springframework.data.redis.core.types.RedisClientInfo;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.SerializationUtils;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.lang.Nullable;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;/*** Helper class that simplifies Redis data access code.* <p/>* Performs automatic serialization/deserialization between the given objects and the underlying binary data in the* Redis store. By default, it uses Java serialization for its objects (through {@link JdkSerializationRedisSerializer}* ). For String intensive operations consider the dedicated {@link StringRedisTemplate}.* <p/>* The central method is execute, supporting Redis access code implementing the {@link RedisCallback} interface. It* provides {@link RedisConnection} handling such that neither the {@link RedisCallback} implementation nor the calling* code needs to explicitly care about retrieving/closing Redis connections, or handling Connection lifecycle* exceptions. For typical single step actions, there are various convenience methods.* <p/>* Once configured, this class is thread-safe.* <p/>* Note that while the template is generified, it is up to the serializers/deserializers to properly convert the given* Objects to and from binary data.* <p/>* <b>This is the central class in Redis support</b>.** @author Costin Leau* @author Christoph Strobl* @author Ninad Divadkar* @author Anqing Shao* @author Mark Paluch* @param <K> the Redis key type against which the template works (usually a String)* @param <V> the Redis value type against which the template works* @see StringRedisTemplate*/
public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperations<K, V>, BeanClassLoaderAware {private boolean enableTransactionSupport = false;private boolean exposeConnection = false;private boolean initialized = false;private boolean enableDefaultSerializer = true;private @Nullable RedisSerializer<?> defaultSerializer;private @Nullable ClassLoader classLoader;@SuppressWarnings("rawtypes") private @Nullable RedisSerializer keySerializer = null;@SuppressWarnings("rawtypes") private @Nullable RedisSerializer valueSerializer = null;@SuppressWarnings("rawtypes") private @Nullable RedisSerializer hashKeySerializer = null;@SuppressWarnings("rawtypes") private @Nullable RedisSerializer hashValueSerializer = null;private RedisSerializer<String> stringSerializer = RedisSerializer.string();private @Nullable ScriptExecutor<K> scriptExecutor;// cache singleton objects (where possible)private @Nullable ValueOperations<K, V> valueOps;private @Nullable ListOperations<K, V> listOps;private @Nullable SetOperations<K, V> setOps;private @Nullable ZSetOperations<K, V> zSetOps;private @Nullable GeoOperations<K, V> geoOps;private @Nullable HyperLogLogOperations<K, V> hllOps;/*** Constructs a new <code>RedisTemplate</code> instance.*/public RedisTemplate() {}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisAccessor#afterPropertiesSet()*/@Overridepublic void afterPropertiesSet() {super.afterPropertiesSet();boolean defaultUsed = false;if (defaultSerializer == null) {defaultSerializer = new JdkSerializationRedisSerializer(classLoader != null ? classLoader : this.getClass().getClassLoader());}if (enableDefaultSerializer) {if (keySerializer == null) {keySerializer = defaultSerializer;defaultUsed = true;}if (valueSerializer == null) {valueSerializer = defaultSerializer;defaultUsed = true;}if (hashKeySerializer == null) {hashKeySerializer = defaultSerializer;defaultUsed = true;}if (hashValueSerializer == null) {hashValueSerializer = defaultSerializer;defaultUsed = true;}}if (enableDefaultSerializer && defaultUsed) {Assert.notNull(defaultSerializer, "default serializer null and not all serializers initialized");}if (scriptExecutor == null) {this.scriptExecutor = new DefaultScriptExecutor<>(this);}initialized = true;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#execute(org.springframework.data.redis.core.RedisCallback)*/@Override@Nullablepublic <T> T execute(RedisCallback<T> action) {return execute(action, isExposeConnection());}/*** Executes the given action object within a connection, which can be exposed or not.** @param <T> return type* @param action callback object that specifies the Redis action* @param exposeConnection whether to enforce exposure of the native Redis Connection to callback code* @return object returned by the action*/@Nullablepublic <T> T execute(RedisCallback<T> action, boolean exposeConnection) {return execute(action, exposeConnection, false);}/*** Executes the given action object within a connection that can be exposed or not. Additionally, the connection can* be pipelined. Note the results of the pipeline are discarded (making it suitable for write-only scenarios).** @param <T> return type* @param action callback object to execute* @param exposeConnection whether to enforce exposure of the native Redis Connection to callback code* @param pipeline whether to pipeline or not the connection for the execution* @return object returned by the action*/@Nullablepublic <T> T execute(RedisCallback<T> action, boolean exposeConnection, boolean pipeline) {Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");Assert.notNull(action, "Callback object must not be null");RedisConnectionFactory factory = getRequiredConnectionFactory();RedisConnection conn = null;try {if (enableTransactionSupport) {// only bind resources in case of potential transaction synchronizationconn = RedisConnectionUtils.bindConnection(factory, enableTransactionSupport);} else {conn = RedisConnectionUtils.getConnection(factory);}boolean existingConnection = TransactionSynchronizationManager.hasResource(factory);RedisConnection connToUse = preProcessConnection(conn, existingConnection);boolean pipelineStatus = connToUse.isPipelined();if (pipeline && !pipelineStatus) {connToUse.openPipeline();}RedisConnection connToExpose = (exposeConnection ? connToUse : createRedisConnectionProxy(connToUse));T result = action.doInRedis(connToExpose);// close pipelineif (pipeline && !pipelineStatus) {connToUse.closePipeline();}// TODO: any other connection processing?return postProcessResult(result, connToUse, existingConnection);} finally {RedisConnectionUtils.releaseConnection(conn, factory);}}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#execute(org.springframework.data.redis.core.SessionCallback)*/@Overridepublic <T> T execute(SessionCallback<T> session) {Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");Assert.notNull(session, "Callback object must not be null");RedisConnectionFactory factory = getRequiredConnectionFactory();// bind connectionRedisConnectionUtils.bindConnection(factory, enableTransactionSupport);try {return session.execute(this);} finally {RedisConnectionUtils.unbindConnection(factory);}}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#executePipelined(org.springframework.data.redis.core.SessionCallback)*/@Overridepublic List<Object> executePipelined(SessionCallback<?> session) {return executePipelined(session, valueSerializer);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#executePipelined(org.springframework.data.redis.core.SessionCallback, org.springframework.data.redis.serializer.RedisSerializer)*/@Overridepublic List<Object> executePipelined(SessionCallback<?> session, @Nullable RedisSerializer<?> resultSerializer) {Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");Assert.notNull(session, "Callback object must not be null");RedisConnectionFactory factory = getRequiredConnectionFactory();// bind connectionRedisConnectionUtils.bindConnection(factory, enableTransactionSupport);try {return execute((RedisCallback<List<Object>>) connection -> {connection.openPipeline();boolean pipelinedClosed = false;try {Object result = executeSession(session);if (result != null) {throw new InvalidDataAccessApiUsageException("Callback cannot return a non-null value as it gets overwritten by the pipeline");}List<Object> closePipeline = connection.closePipeline();pipelinedClosed = true;return deserializeMixedResults(closePipeline, resultSerializer, hashKeySerializer, hashValueSerializer);} finally {if (!pipelinedClosed) {connection.closePipeline();}}});} finally {RedisConnectionUtils.unbindConnection(factory);}}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#executePipelined(org.springframework.data.redis.core.RedisCallback)*/@Overridepublic List<Object> executePipelined(RedisCallback<?> action) {return executePipelined(action, valueSerializer);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#executePipelined(org.springframework.data.redis.core.RedisCallback, org.springframework.data.redis.serializer.RedisSerializer)*/@Overridepublic List<Object> executePipelined(RedisCallback<?> action, @Nullable RedisSerializer<?> resultSerializer) {return execute((RedisCallback<List<Object>>) connection -> {connection.openPipeline();boolean pipelinedClosed = false;try {Object result = action.doInRedis(connection);if (result != null) {throw new InvalidDataAccessApiUsageException("Callback cannot return a non-null value as it gets overwritten by the pipeline");}List<Object> closePipeline = connection.closePipeline();pipelinedClosed = true;return deserializeMixedResults(closePipeline, resultSerializer, hashKeySerializer, hashValueSerializer);} finally {if (!pipelinedClosed) {connection.closePipeline();}}});}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#execute(org.springframework.data.redis.core.script.RedisScript, java.util.List, java.lang.Object[])*/@Overridepublic <T> T execute(RedisScript<T> script, List<K> keys, Object... args) {return scriptExecutor.execute(script, keys, args);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#execute(org.springframework.data.redis.core.script.RedisScript, org.springframework.data.redis.serializer.RedisSerializer, org.springframework.data.redis.serializer.RedisSerializer, java.util.List, java.lang.Object[])*/@Overridepublic <T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSerializer<T> resultSerializer,List<K> keys, Object... args) {return scriptExecutor.execute(script, argsSerializer, resultSerializer, keys, args);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#executeWithStickyConnection(org.springframework.data.redis.core.RedisCallback)*/@Overridepublic <T extends Closeable> T executeWithStickyConnection(RedisCallback<T> callback) {Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");Assert.notNull(callback, "Callback object must not be null");RedisConnectionFactory factory = getRequiredConnectionFactory();RedisConnection connection = preProcessConnection(RedisConnectionUtils.doGetConnection(factory, true, false, false),false);return callback.doInRedis(connection);}private Object executeSession(SessionCallback<?> session) {return session.execute(this);}protected RedisConnection createRedisConnectionProxy(RedisConnection pm) {Class<?>[] ifcs = ClassUtils.getAllInterfacesForClass(pm.getClass(), getClass().getClassLoader());return (RedisConnection) Proxy.newProxyInstance(pm.getClass().getClassLoader(), ifcs,new CloseSuppressingInvocationHandler(pm));}/*** Processes the connection (before any settings are executed on it). Default implementation returns the connection as* is.** @param connection redis connection*/protected RedisConnection preProcessConnection(RedisConnection connection, boolean existingConnection) {return connection;}@Nullableprotected <T> T postProcessResult(@Nullable T result, RedisConnection conn, boolean existingConnection) {return result;}/*** Returns whether to expose the native Redis connection to RedisCallback code, or rather a connection proxy (the* default).** @return whether to expose the native Redis connection or not*/public boolean isExposeConnection() {return exposeConnection;}/*** Sets whether to expose the Redis connection to {@link RedisCallback} code. Default is "false": a proxy will be* returned, suppressing <tt>quit</tt> and <tt>disconnect</tt> calls.** @param exposeConnection*/public void setExposeConnection(boolean exposeConnection) {this.exposeConnection = exposeConnection;}/*** @return Whether or not the default serializer should be used. If not, any serializers not explicitly set will*         remain null and values will not be serialized or deserialized.*/public boolean isEnableDefaultSerializer() {return enableDefaultSerializer;}/*** @param enableDefaultSerializer Whether or not the default serializer should be used. If not, any serializers not*          explicitly set will remain null and values will not be serialized or deserialized.*/public void setEnableDefaultSerializer(boolean enableDefaultSerializer) {this.enableDefaultSerializer = enableDefaultSerializer;}/*** Returns the default serializer used by this template.** @return template default serializer*/@Nullablepublic RedisSerializer<?> getDefaultSerializer() {return defaultSerializer;}/*** Sets the default serializer to use for this template. All serializers (expect the* {@link #setStringSerializer(RedisSerializer)}) are initialized to this value unless explicitly set. Defaults to* {@link JdkSerializationRedisSerializer}.** @param serializer default serializer to use*/public void setDefaultSerializer(RedisSerializer<?> serializer) {this.defaultSerializer = serializer;}/*** Sets the key serializer to be used by this template. Defaults to {@link #getDefaultSerializer()}.** @param serializer the key serializer to be used by this template.*/public void setKeySerializer(RedisSerializer<?> serializer) {this.keySerializer = serializer;}/*** Returns the key serializer used by this template.** @return the key serializer used by this template.*/@Overridepublic RedisSerializer<?> getKeySerializer() {return keySerializer;}/*** Sets the value serializer to be used by this template. Defaults to {@link #getDefaultSerializer()}.** @param serializer the value serializer to be used by this template.*/public void setValueSerializer(RedisSerializer<?> serializer) {this.valueSerializer = serializer;}/*** Returns the value serializer used by this template.** @return the value serializer used by this template.*/@Overridepublic RedisSerializer<?> getValueSerializer() {return valueSerializer;}/*** Returns the hashKeySerializer.** @return Returns the hashKeySerializer*/@Overridepublic RedisSerializer<?> getHashKeySerializer() {return hashKeySerializer;}/*** Sets the hash key (or field) serializer to be used by this template. Defaults to {@link #getDefaultSerializer()}.** @param hashKeySerializer The hashKeySerializer to set.*/public void setHashKeySerializer(RedisSerializer<?> hashKeySerializer) {this.hashKeySerializer = hashKeySerializer;}/*** Returns the hashValueSerializer.** @return Returns the hashValueSerializer*/@Overridepublic RedisSerializer<?> getHashValueSerializer() {return hashValueSerializer;}/*** Sets the hash value serializer to be used by this template. Defaults to {@link #getDefaultSerializer()}.** @param hashValueSerializer The hashValueSerializer to set.*/public void setHashValueSerializer(RedisSerializer<?> hashValueSerializer) {this.hashValueSerializer = hashValueSerializer;}/*** Returns the stringSerializer.** @return Returns the stringSerializer*/public RedisSerializer<String> getStringSerializer() {return stringSerializer;}/*** Sets the string value serializer to be used by this template (when the arguments or return types are always* strings). Defaults to {@link StringRedisSerializer}.** @see ValueOperations#get(Object, long, long)* @param stringSerializer The stringValueSerializer to set.*/public void setStringSerializer(RedisSerializer<String> stringSerializer) {this.stringSerializer = stringSerializer;}/*** @param scriptExecutor The {@link ScriptExecutor} to use for executing Redis scripts*/public void setScriptExecutor(ScriptExecutor<K> scriptExecutor) {this.scriptExecutor = scriptExecutor;}@SuppressWarnings("unchecked")private byte[] rawKey(Object key) {Assert.notNull(key, "non null key required");if (keySerializer == null && key instanceof byte[]) {return (byte[]) key;}return keySerializer.serialize(key);}private byte[] rawString(String key) {return stringSerializer.serialize(key);}@SuppressWarnings("unchecked")private byte[] rawValue(Object value) {if (valueSerializer == null && value instanceof byte[]) {return (byte[]) value;}return valueSerializer.serialize(value);}private byte[][] rawKeys(Collection<K> keys) {final byte[][] rawKeys = new byte[keys.size()][];int i = 0;for (K key : keys) {rawKeys[i++] = rawKey(key);}return rawKeys;}@SuppressWarnings("unchecked")private K deserializeKey(byte[] value) {return keySerializer != null ? (K) keySerializer.deserialize(value) : (K) value;}@SuppressWarnings({ "unchecked", "rawtypes" })@Nullableprivate List<Object> deserializeMixedResults(@Nullable List<Object> rawValues,@Nullable RedisSerializer valueSerializer, @Nullable RedisSerializer hashKeySerializer,@Nullable RedisSerializer hashValueSerializer) {if (rawValues == null) {return null;}List<Object> values = new ArrayList<>();for (Object rawValue : rawValues) {if (rawValue instanceof byte[] && valueSerializer != null) {values.add(valueSerializer.deserialize((byte[]) rawValue));} else if (rawValue instanceof List) {// Lists are the only potential Collections of mixed values....values.add(deserializeMixedResults((List) rawValue, valueSerializer, hashKeySerializer, hashValueSerializer));} else if (rawValue instanceof Set && !(((Set) rawValue).isEmpty())) {values.add(deserializeSet((Set) rawValue, valueSerializer));} else if (rawValue instanceof Map && !(((Map) rawValue).isEmpty())&& ((Map) rawValue).values().iterator().next() instanceof byte[]) {values.add(SerializationUtils.deserialize((Map) rawValue, hashKeySerializer, hashValueSerializer));} else {values.add(rawValue);}}return values;}@SuppressWarnings({ "rawtypes", "unchecked" })private Set<?> deserializeSet(Set rawSet, @Nullable RedisSerializer valueSerializer) {if (rawSet.isEmpty()) {return rawSet;}Object setValue = rawSet.iterator().next();if (setValue instanceof byte[] && valueSerializer != null) {return (SerializationUtils.deserialize(rawSet, valueSerializer));} else if (setValue instanceof Tuple) {return convertTupleValues(rawSet, valueSerializer);} else {return rawSet;}}@SuppressWarnings({ "unchecked", "rawtypes" })private Set<TypedTuple<V>> convertTupleValues(Set<Tuple> rawValues, @Nullable RedisSerializer valueSerializer) {Set<TypedTuple<V>> set = new LinkedHashSet<>(rawValues.size());for (Tuple rawValue : rawValues) {Object value = rawValue.getValue();if (valueSerializer != null) {value = valueSerializer.deserialize(rawValue.getValue());}set.add(new DefaultTypedTuple(value, rawValue.getScore()));}return set;}//// RedisOperations///*** Execute a transaction, using the default {@link RedisSerializer}s to deserialize any results that are byte[]s or* Collections or Maps of byte[]s or Tuples. Other result types (Long, Boolean, etc) are left as-is in the converted* results. If conversion of tx results has been disabled in the {@link RedisConnectionFactory}, the results of exec* will be returned without deserialization. This check is mostly for backwards compatibility with 1.0.** @return The (possibly deserialized) results of transaction exec*/@Overridepublic List<Object> exec() {List<Object> results = execRaw();if (getRequiredConnectionFactory().getConvertPipelineAndTxResults()) {return deserializeMixedResults(results, valueSerializer, hashKeySerializer, hashValueSerializer);} else {return results;}}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#exec(org.springframework.data.redis.serializer.RedisSerializer)*/@Overridepublic List<Object> exec(RedisSerializer<?> valueSerializer) {return deserializeMixedResults(execRaw(), valueSerializer, valueSerializer, valueSerializer);}protected List<Object> execRaw() {List<Object> raw = execute(RedisTxCommands::exec);return raw == null ? Collections.emptyList() : raw;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#delete(java.lang.Object)*/@Overridepublic Boolean delete(K key) {byte[] rawKey = rawKey(key);Long result = execute(connection -> connection.del(rawKey), true);return result != null && result.intValue() == 1;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#delete(java.util.Collection)*/@Overridepublic Long delete(Collection<K> keys) {if (CollectionUtils.isEmpty(keys)) {return 0L;}byte[][] rawKeys = rawKeys(keys);return execute(connection -> connection.del(rawKeys), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#unlink(java.lang.Object)*/@Overridepublic Boolean unlink(K key) {byte[] rawKey = rawKey(key);Long result = execute(connection -> connection.unlink(rawKey), true);return result != null && result.intValue() == 1;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#unlink(java.util.Collection)*/@Overridepublic Long unlink(Collection<K> keys) {if (CollectionUtils.isEmpty(keys)) {return 0L;}byte[][] rawKeys = rawKeys(keys);return execute(connection -> connection.unlink(rawKeys), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#hasKey(java.lang.Object)*/@Overridepublic Boolean hasKey(K key) {byte[] rawKey = rawKey(key);return execute(connection -> connection.exists(rawKey), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#countExistingKeys(java.util.Collection)*/@Overridepublic Long countExistingKeys(Collection<K> keys) {Assert.notNull(keys, "Keys must not be null!");byte[][] rawKeys = rawKeys(keys);return execute(connection -> connection.exists(rawKeys), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#expire(java.lang.Object, long, java.util.concurrent.TimeUnit)*/@Overridepublic Boolean expire(K key, final long timeout, final TimeUnit unit) {byte[] rawKey = rawKey(key);long rawTimeout = TimeoutUtils.toMillis(timeout, unit);return execute(connection -> {try {return connection.pExpire(rawKey, rawTimeout);} catch (Exception e) {// Driver may not support pExpire or we may be running on Redis 2.4return connection.expire(rawKey, TimeoutUtils.toSeconds(timeout, unit));}}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#expireAt(java.lang.Object, java.util.Date)*/@Overridepublic Boolean expireAt(K key, final Date date) {byte[] rawKey = rawKey(key);return execute(connection -> {try {return connection.pExpireAt(rawKey, date.getTime());} catch (Exception e) {return connection.expireAt(rawKey, date.getTime() / 1000);}}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#convertAndSend(java.lang.String, java.lang.Object)*/@Overridepublic void convertAndSend(String channel, Object message) {Assert.hasText(channel, "a non-empty channel is required");byte[] rawChannel = rawString(channel);byte[] rawMessage = rawValue(message);execute(connection -> {connection.publish(rawChannel, rawMessage);return null;}, true);}//// Value operations///** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#getExpire(java.lang.Object)*/@Overridepublic Long getExpire(K key) {byte[] rawKey = rawKey(key);return execute(connection -> connection.ttl(rawKey), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#getExpire(java.lang.Object, java.util.concurrent.TimeUnit)*/@Overridepublic Long getExpire(K key, final TimeUnit timeUnit) {byte[] rawKey = rawKey(key);return execute(connection -> {try {return connection.pTtl(rawKey, timeUnit);} catch (Exception e) {// Driver may not support pTtl or we may be running on Redis 2.4return connection.ttl(rawKey, timeUnit);}}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#keys(java.lang.Object)*/@Override@SuppressWarnings("unchecked")public Set<K> keys(K pattern) {byte[] rawKey = rawKey(pattern);Set<byte[]> rawKeys = execute(connection -> connection.keys(rawKey), true);return keySerializer != null ? SerializationUtils.deserialize(rawKeys, keySerializer) : (Set<K>) rawKeys;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#persist(java.lang.Object)*/@Overridepublic Boolean persist(K key) {byte[] rawKey = rawKey(key);return execute(connection -> connection.persist(rawKey), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#move(java.lang.Object, int)*/@Overridepublic Boolean move(K key, final int dbIndex) {byte[] rawKey = rawKey(key);return execute(connection -> connection.move(rawKey, dbIndex), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#randomKey()*/@Overridepublic K randomKey() {byte[] rawKey = execute(RedisKeyCommands::randomKey, true);return deserializeKey(rawKey);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#rename(java.lang.Object, java.lang.Object)*/@Overridepublic void rename(K oldKey, K newKey) {byte[] rawOldKey = rawKey(oldKey);byte[] rawNewKey = rawKey(newKey);execute(connection -> {connection.rename(rawOldKey, rawNewKey);return null;}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#renameIfAbsent(java.lang.Object, java.lang.Object)*/@Overridepublic Boolean renameIfAbsent(K oldKey, K newKey) {byte[] rawOldKey = rawKey(oldKey);byte[] rawNewKey = rawKey(newKey);return execute(connection -> connection.renameNX(rawOldKey, rawNewKey), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#type(java.lang.Object)*/@Overridepublic DataType type(K key) {byte[] rawKey = rawKey(key);return execute(connection -> connection.type(rawKey), true);}/*** Executes the Redis dump command and returns the results. Redis uses a non-standard serialization mechanism and* includes checksum information, thus the raw bytes are returned as opposed to deserializing with valueSerializer.* Use the return value of dump as the value argument to restore** @param key The key to dump* @return results The results of the dump operation*/@Overridepublic byte[] dump(K key) {byte[] rawKey = rawKey(key);return execute(connection -> connection.dump(rawKey), true);}/*** Executes the Redis restore command. The value passed in should be the exact serialized data returned from* {@link #dump(Object)}, since Redis uses a non-standard serialization mechanism.** @param key The key to restore* @param value The value to restore, as returned by {@link #dump(Object)}* @param timeToLive An expiration for the restored key, or 0 for no expiration* @param unit The time unit for timeToLive* @param replace use {@literal true} to replace a potentially existing value instead of erroring.* @throws RedisSystemException if the key you are attempting to restore already exists and {@code replace} is set to*           {@literal false}.*/@Overridepublic void restore(K key, final byte[] value, long timeToLive, TimeUnit unit, boolean replace) {byte[] rawKey = rawKey(key);long rawTimeout = TimeoutUtils.toMillis(timeToLive, unit);execute(connection -> {connection.restore(rawKey, rawTimeout, value, replace);return null;}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#multi()*/@Overridepublic void multi() {execute(connection -> {connection.multi();return null;}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#discard()*/@Overridepublic void discard() {execute(connection -> {connection.discard();return null;}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#watch(java.lang.Object)*/@Overridepublic void watch(K key) {byte[] rawKey = rawKey(key);execute(connection -> {connection.watch(rawKey);return null;}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#watch(java.util.Collection)*/@Overridepublic void watch(Collection<K> keys) {byte[][] rawKeys = rawKeys(keys);execute(connection -> {connection.watch(rawKeys);return null;}, true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#unwatch()*/@Overridepublic void unwatch() {execute(connection -> {connection.unwatch();return null;}, true);}// Sort operations/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#sort(org.springframework.data.redis.core.query.SortQuery)*/@Override@SuppressWarnings("unchecked")public List<V> sort(SortQuery<K> query) {return sort(query, valueSerializer);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#sort(org.springframework.data.redis.core.query.SortQuery, org.springframework.data.redis.serializer.RedisSerializer)*/@Overridepublic <T> List<T> sort(SortQuery<K> query, @Nullable RedisSerializer<T> resultSerializer) {byte[] rawKey = rawKey(query.getKey());SortParameters params = QueryUtils.convertQuery(query, stringSerializer);List<byte[]> vals = execute(connection -> connection.sort(rawKey, params), true);return SerializationUtils.deserialize(vals, resultSerializer);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#sort(org.springframework.data.redis.core.query.SortQuery, org.springframework.data.redis.core.BulkMapper)*/@Override@SuppressWarnings("unchecked")public <T> List<T> sort(SortQuery<K> query, BulkMapper<T, V> bulkMapper) {return sort(query, bulkMapper, valueSerializer);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#sort(org.springframework.data.redis.core.query.SortQuery, org.springframework.data.redis.core.BulkMapper, org.springframework.data.redis.serializer.RedisSerializer)*/@Overridepublic <T, S> List<T> sort(SortQuery<K> query, BulkMapper<T, S> bulkMapper,@Nullable RedisSerializer<S> resultSerializer) {List<S> values = sort(query, resultSerializer);if (values == null || values.isEmpty()) {return Collections.emptyList();}int bulkSize = query.getGetPattern().size();List<T> result = new ArrayList<>(values.size() / bulkSize + 1);List<S> bulk = new ArrayList<>(bulkSize);for (S s : values) {bulk.add(s);if (bulk.size() == bulkSize) {result.add(bulkMapper.mapBulk(Collections.unmodifiableList(bulk)));// create a new list (we could reuse the old one but the client might hang on to it for some reason)bulk = new ArrayList<>(bulkSize);}}return result;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#sort(org.springframework.data.redis.core.query.SortQuery, java.lang.Object)*/@Overridepublic Long sort(SortQuery<K> query, K storeKey) {byte[] rawStoreKey = rawKey(storeKey);byte[] rawKey = rawKey(query.getKey());SortParameters params = QueryUtils.convertQuery(query, stringSerializer);return execute(connection -> connection.sort(rawKey, params, rawStoreKey), true);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#killClient(java.lang.Object)*/@Overridepublic void killClient(final String host, final int port) {execute((RedisCallback<Void>) connection -> {connection.killClient(host, port);return null;});}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#getClientList()*/@Overridepublic List<RedisClientInfo> getClientList() {return execute(RedisServerCommands::getClientList);}/** @see org.springframework.data.redis.core.RedisOperations#slaveOf(java.lang.String, int)*/@Overridepublic void slaveOf(final String host, final int port) {execute((RedisCallback<Void>) connection -> {connection.slaveOf(host, port);return null;});}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#slaveOfNoOne()*/@Overridepublic void slaveOfNoOne() {execute((RedisCallback<Void>) connection -> {connection.slaveOfNoOne();return null;});}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForCluster()*/@Overridepublic ClusterOperations<K, V> opsForCluster() {return new DefaultClusterOperations<>(this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForGeo()*/@Overridepublic GeoOperations<K, V> opsForGeo() {if (geoOps == null) {geoOps = new DefaultGeoOperations<>(this);}return geoOps;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#boundGeoOps(java.lang.Object)*/@Overridepublic BoundGeoOperations<K, V> boundGeoOps(K key) {return new DefaultBoundGeoOperations<>(key, this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#boundHashOps(java.lang.Object)*/@Overridepublic <HK, HV> BoundHashOperations<K, HK, HV> boundHashOps(K key) {return new DefaultBoundHashOperations<>(key, this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForHash()*/@Overridepublic <HK, HV> HashOperations<K, HK, HV> opsForHash() {return new DefaultHashOperations<>(this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForHyperLogLog()*/@Overridepublic HyperLogLogOperations<K, V> opsForHyperLogLog() {if (hllOps == null) {hllOps = new DefaultHyperLogLogOperations<>(this);}return hllOps;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForList()*/@Overridepublic ListOperations<K, V> opsForList() {if (listOps == null) {listOps = new DefaultListOperations<>(this);}return listOps;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#boundListOps(java.lang.Object)*/@Overridepublic BoundListOperations<K, V> boundListOps(K key) {return new DefaultBoundListOperations<>(key, this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#boundSetOps(java.lang.Object)*/@Overridepublic BoundSetOperations<K, V> boundSetOps(K key) {return new DefaultBoundSetOperations<>(key, this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForSet()*/@Overridepublic SetOperations<K, V> opsForSet() {if (setOps == null) {setOps = new DefaultSetOperations<>(this);}return setOps;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#boundValueOps(java.lang.Object)*/@Overridepublic BoundValueOperations<K, V> boundValueOps(K key) {return new DefaultBoundValueOperations<>(key, this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForValue()*/@Overridepublic ValueOperations<K, V> opsForValue() {if (valueOps == null) {valueOps = new DefaultValueOperations<>(this);}return valueOps;}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#boundZSetOps(java.lang.Object)*/@Overridepublic BoundZSetOperations<K, V> boundZSetOps(K key) {return new DefaultBoundZSetOperations<>(key, this);}/** (non-Javadoc)* @see org.springframework.data.redis.core.RedisOperations#opsForZSet()*/@Overridepublic ZSetOperations<K, V> opsForZSet() {if (zSetOps == null) {zSetOps = new DefaultZSetOperations<>(this);}return zSetOps;}/*** If set to {@code true} {@link RedisTemplate} will use {@literal MULTI...EXEC|DISCARD} to keep track of operations.** @param enableTransactionSupport* @since 1.3*/public void setEnableTransactionSupport(boolean enableTransactionSupport) {this.enableTransactionSupport = enableTransactionSupport;}/*** Set the {@link ClassLoader} to be used for the default {@link JdkSerializationRedisSerializer} in case no other* {@link RedisSerializer} is explicitly set as the default one.** @param classLoader can be {@literal null}.* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader* @since 1.8*/@Overridepublic void setBeanClassLoader(ClassLoader classLoader) {this.classLoader = classLoader;}
}

二、RedisUtils

public class RedisUtils {private RedisTemplate<Object, Object> redisTemplate;@Value("${jwt.online-key}")private String onlineKey;public RedisUtils(RedisTemplate<Object, Object> redisTemplate) {this.redisTemplate = redisTemplate;}// =============================common============================/*** 指定缓存失效时间* @param key  键* @param time 时间(秒)*/public boolean expire(String key, long time) {try {if (time > 0) {redisTemplate.expire(key, time, TimeUnit.SECONDS);}} catch (Exception e) {e.printStackTrace();return false;}return true;}/*** 根据 key 获取过期时间* @param key 键 不能为null* @return 时间(秒) 返回0代表为永久有效*/public long getExpire(Object key) {return redisTemplate.getExpire(key, TimeUnit.SECONDS);}/*** 查找匹配key* @param pattern key* @return /*/public List<String> scan(String pattern) {ScanOptions options = ScanOptions.scanOptions().match(pattern).build();RedisConnectionFactory factory = redisTemplate.getConnectionFactory();RedisConnection rc = Objects.requireNonNull(factory).getConnection();Cursor<byte[]> cursor = rc.scan(options);List<String> result = new ArrayList<>();while (cursor.hasNext()) {result.add(new String(cursor.next()));}try {RedisConnectionUtils.releaseConnection(rc, factory);} catch (Exception e) {e.printStackTrace();}return result;}/*** 分页查询 key* @param patternKey key* @param page 页码* @param size 每页数目* @return /*/public List<String> findKeysForPage(String patternKey, int page, int size) {ScanOptions options = ScanOptions.scanOptions().match(patternKey).build();RedisConnectionFactory factory = redisTemplate.getConnectionFactory();RedisConnection rc = Objects.requireNonNull(factory).getConnection();Cursor<byte[]> cursor = rc.scan(options);List<String> result = new ArrayList<>(size);int tmpIndex = 0;int fromIndex = page * size;int toIndex = page * size + size;while (cursor.hasNext()) {if (tmpIndex >= fromIndex && tmpIndex < toIndex) {result.add(new String(cursor.next()));tmpIndex++;continue;}// 获取到满足条件的数据后,就可以退出了if(tmpIndex >=toIndex) {break;}tmpIndex++;cursor.next();}try {RedisConnectionUtils.releaseConnection(rc, factory);} catch (Exception e) {e.printStackTrace();}return result;}/*** 判断key是否存在* @param key 键* @return true 存在 false不存在*/public boolean hasKey(String key) {try {return redisTemplate.hasKey(key);} catch (Exception e) {e.printStackTrace();return false;}}/*** 删除缓存* @param key 可以传一个值 或多个*/public void del(String... key) {if (key != null && key.length > 0) {if (key.length == 1) {redisTemplate.delete(key[0]);} else {redisTemplate.delete(CollectionUtils.arrayToList(key));}}}// ============================String=============================/*** 普通缓存获取* @param key 键* @return 值*/public Object get(String key) {return key == null ? null : redisTemplate.opsForValue().get(key);}/*** 批量获取* @param keys* @return*/public List<Object> multiGet(List<String> keys) {Object obj = redisTemplate.opsForValue().multiGet(Collections.singleton(keys));return null;}/*** 普通缓存放入* @param key   键* @param value 值* @return true成功 false失败*/public boolean set(String key, Object value) {try {redisTemplate.opsForValue().set(key, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 普通缓存放入并设置时间* @param key   键* @param value 值* @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期* @return true成功 false 失败*/public boolean set(String key, Object value, long time) {try {if (time > 0) {redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);} else {set(key, value);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 普通缓存放入并设置时间* @param key   键* @param value 值* @param time  时间* @param timeUnit 类型* @return true成功 false 失败*/public boolean set(String key, Object value, long time, TimeUnit timeUnit) {try {if (time > 0) {redisTemplate.opsForValue().set(key, value, time, timeUnit);} else {set(key, value);}return true;} catch (Exception e) {e.printStackTrace();return false;}}// ================================Map=================================/*** HashGet* @param key  键 不能为null* @param item 项 不能为null* @return 值*/public Object hget(String key, String item) {return redisTemplate.opsForHash().get(key, item);}/*** 获取hashKey对应的所有键值* @param key 键* @return 对应的多个键值*/public Map<Object, Object> hmget(String key) {return redisTemplate.opsForHash().entries(key);}/*** HashSet* @param key 键* @param map 对应多个键值* @return true 成功 false 失败*/public boolean hmset(String key, Map<String, Object> map) {try {redisTemplate.opsForHash().putAll(key, map);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** HashSet 并设置时间* @param key  键* @param map  对应多个键值* @param time 时间(秒)* @return true成功 false失败*/public boolean hmset(String key, Map<String, Object> map, long time) {try {redisTemplate.opsForHash().putAll(key, map);if (time > 0) {expire(key, time);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 向一张hash表中放入数据,如果不存在将创建** @param key   键* @param item  项* @param value 值* @return true 成功 false失败*/public boolean hset(String key, String item, Object value) {try {redisTemplate.opsForHash().put(key, item, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 向一张hash表中放入数据,如果不存在将创建** @param key   键* @param item  项* @param value 值* @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间* @return true 成功 false失败*/public boolean hset(String key, String item, Object value, long time) {try {redisTemplate.opsForHash().put(key, item, value);if (time > 0) {expire(key, time);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 删除hash表中的值** @param key  键 不能为null* @param item 项 可以使多个 不能为null*/public void hdel(String key, Object... item) {redisTemplate.opsForHash().delete(key, item);}/*** 判断hash表中是否有该项的值** @param key  键 不能为null* @param item 项 不能为null* @return true 存在 false不存在*/public boolean hHasKey(String key, String item) {return redisTemplate.opsForHash().hasKey(key, item);}/*** hash递增 如果不存在,就会创建一个 并把新增后的值返回** @param key  键* @param item 项* @param by   要增加几(大于0)* @return*/public double hincr(String key, String item, double by) {return redisTemplate.opsForHash().increment(key, item, by);}/*** hash递减** @param key  键* @param item 项* @param by   要减少记(小于0)* @return*/public double hdecr(String key, String item, double by) {return redisTemplate.opsForHash().increment(key, item, -by);}// ============================set=============================/*** 根据key获取Set中的所有值** @param key 键* @return*/public Set<Object> sGet(String key) {try {return redisTemplate.opsForSet().members(key);} catch (Exception e) {e.printStackTrace();return null;}}/*** 根据value从一个set中查询,是否存在** @param key   键* @param value 值* @return true 存在 false不存在*/public boolean sHasKey(String key, Object value) {try {return redisTemplate.opsForSet().isMember(key, value);} catch (Exception e) {e.printStackTrace();return false;}}/*** 将数据放入set缓存** @param key    键* @param values 值 可以是多个* @return 成功个数*/public long sSet(String key, Object... values) {try {return redisTemplate.opsForSet().add(key, values);} catch (Exception e) {e.printStackTrace();return 0;}}/*** 将set数据放入缓存* @param key    键* @param time   时间(秒)* @param values 值 可以是多个* @return 成功个数*/public long sSetAndTime(String key, long time, Object... values) {try {Long count = redisTemplate.opsForSet().add(key, values);if (time > 0) {expire(key, time);}return count;} catch (Exception e) {e.printStackTrace();return 0;}}/*** 获取set缓存的长度* @param key 键* @return*/public long sGetSetSize(String key) {try {return redisTemplate.opsForSet().size(key);} catch (Exception e) {e.printStackTrace();return 0;}}/*** 移除值为value的* @param key    键* @param values 值 可以是多个* @return 移除的个数*/public long setRemove(String key, Object... values) {try {Long count = redisTemplate.opsForSet().remove(key, values);return count;} catch (Exception e) {e.printStackTrace();return 0;}}// ===============================list=================================/*** 获取list缓存的内容* @param key   键* @param start 开始* @param end   结束 0 到 -1代表所有值* @return*/public List<Object> lGet(String key, long start, long end) {try {return redisTemplate.opsForList().range(key, start, end);} catch (Exception e) {e.printStackTrace();return null;}}/*** 获取list缓存的长度* @param key 键* @return*/public long lGetListSize(String key) {try {return redisTemplate.opsForList().size(key);} catch (Exception e) {e.printStackTrace();return 0;}}/*** 通过索引 获取list中的值* @param key   键* @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推* @return*/public Object lGetIndex(String key, long index) {try {return redisTemplate.opsForList().index(key, index);} catch (Exception e) {e.printStackTrace();return null;}}/*** 将list放入缓存* @param key   键* @param value 值* @return*/public boolean lSet(String key, Object value) {try {redisTemplate.opsForList().rightPush(key, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 将list放入缓存* @param key   键* @param value 值* @param time  时间(秒)* @return*/public boolean lSet(String key, Object value, long time) {try {redisTemplate.opsForList().rightPush(key, value);if (time > 0) {expire(key, time);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 将list放入缓存* @param key   键* @param value 值* @return*/public boolean lSet(String key, List<Object> value) {try {redisTemplate.opsForList().rightPushAll(key, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 将list放入缓存* @param key   键* @param value 值* @param time  时间(秒)* @return*/public boolean lSet(String key, List<Object> value, long time) {try {redisTemplate.opsForList().rightPushAll(key, value);if (time > 0) {expire(key, time);}return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 根据索引修改list中的某条数据* @param key   键* @param index 索引* @param value 值* @return /*/public boolean lUpdateIndex(String key, long index, Object value) {try {redisTemplate.opsForList().set(key, index, value);return true;} catch (Exception e) {e.printStackTrace();return false;}}/*** 移除N个值为value* @param key   键* @param count 移除多少个* @param value 值* @return 移除的个数*/public long lRemove(String key, long count, Object value) {try {return redisTemplate.opsForList().remove(key, count, value);} catch (Exception e) {e.printStackTrace();return 0;}}
}
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. stm32的八种gpio配置模式

    stm32的八种gpio配置模式 gpio端口的每个位可以由软件分别配置成多种模式 八种模式: 1、输入浮空 2、输入上拉 3、输入下拉 4、模拟输入# 5、开漏输出 6、推挽输出 7、推挽式复用功能 8、开漏复用功能 每个GPIO端口有 两个32位配置寄存器 GPIOx_CRL_CRH。 两个32位 数据寄存器…...

    2024/4/16 6:03:20
  2. IDM下载器最新版本6.36.5

    本期分享主角依旧是熟悉的下载神器—IDM v6.36 build5,往期有关IDM的分享已经很多了,每次分享都会更新为最新版本(含激活方法)。其实用过IDM的都知道,新旧版本直接其实相差不大,很多版本的更新可能只是修复了一下旧版本bug,至于增添了哪些功能,似乎新增的功能,我到现在都…...

    2024/4/20 10:50:13
  3. 人工智能:模拟退火算法概述

    模拟退火算法概述 模拟退火算法(Simulated Annealing,SA)的思想最早由Metropolis等人于1953年提出;Kirkpatrick于1983年第一次使用模拟退火算法求解组合最优化问题。模拟退火算法是一种基于Monte Carlo迭代求解策略的随机寻优算法,其出发点是基于物理中固体物质的退火过程…...

    2024/4/16 0:39:10
  4. 使用padding(内边距)来做出高度

    使用padding(内边距)来做出高度 由于内边距的特性,会增大原盒子的大小,也产生了诸多的特性应用场景:...

    2024/4/21 12:05:54
  5. css基本属性以及常用布局总结

    一,css基本概念 1,什么是css?css:cascading style sheet 层叠样式表 是一组样式设置的规则,用于网页布局,美化网页2,为什么学习css?使用css可以更好的控制页面布局,在没有学习css之前一直用的是的是table用来控制布局,可以发现其非常繁琐 实现内容与样式的分离,便于团…...

    2024/4/16 0:39:05
  6. LeetCode C++刷题 5-8题题解

    5、最长回文子串题目:给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。示例 1:输入: "babad" 输出: "bab" 注意: "aba" 也是一个有效答案。示例 2:输入: "cbbd" 输出: "bb"题解:动态规划代…...

    2024/4/18 13:38:00
  7. mysql学习使用笔记1

    MySQL基础1: 数据库:存储和管理数据的仓库 关系数据库(关系其实就是表):代表的数据库服务器:MySQL,SQL Server,Oracle等。 后关系数据库: 关系数据库存在数据模型,性能,拓展伸缩性的缺点,出现了:ORDBMS:面型对象数据库技术。 两种数据库相互补充,不存在替代问题…...

    2024/4/16 0:39:15
  8. 前端工具类

    一、集合类 /*** 判断是否是数组* @param {Array}} arr 数组*/ export const arrJudge = arr => {if (Array.isArray(arr)) {return true} }/*** 数组去重* @param {Array} arr 数组*/ export const arrRemoveRepeat = arr => {return Array.from(new Set(arr)) }/*** 数…...

    2024/4/16 0:38:50
  9. Matlab: cvpartition()函数实现交叉验证

    下面的代码是将一组数据进行10折交叉划分,并将划分好的训练集合测试集存放在一个文件夹下面:% Note: this code should be run from orca/src/code-examples clear param; if (exist (OCTAVE_VERSION, builtin) > 0)pkg load statistics end% Load data ERAData = csvread…...

    2024/4/20 1:12:04
  10. Python版-LeetCode 学习:111. 二叉树的最小深度

    给定一个二叉树,找出其最小深度。最小深度是从根节点到最近叶子节点的最短路径上的节点数量。说明: 叶子节点是指没有子节点的节点。示例:给定二叉树 [3,9,20,null,null,15,7],3/ \9 20/ \15 7 返回它的最小深度 2.来源:力扣(LeetCode) 链接:https://leetcode-cn.com…...

    2024/4/16 0:38:55
  11. vscode搭建openVINO(2020.03)开发环境(cmake工程),Ubuntu18.04

    1 openVINO下有个demos,里面是一个总工程,如果对单个demo研究势必要从总工程拿出来,否则不好调试。这里以human_pose_estimation_demo为例,看看如何从零开始搭建openVINO工程 2 工程是Cmake的,幸运的是,vscode里面有Cmake插件,这就很方便了。 3 重要的位置已经加粗,红色…...

    2024/4/20 0:35:16
  12. VMware和Linux的安装、磁盘分区

    一、虚拟机的使用(VMware)1、安装WMware(删除可以找VMware_Install_CLeaner)2、新建虚拟机(1)选择的标准安装(2)选择以后安装(3)这里是linux系统,centos版本,这个是32位的(4)虚拟机的名称和位置(5)给虚拟机分配磁盘空间(6)点击完成(7)双击可修改配置(8)处…...

    2024/4/16 0:39:10
  13. 【经典面试题】浏览器地址栏输入URL以后……

    这个问题恐怕好多人在面试过程中都被问到过,但回答的都不算很好,所以我想写一篇笔记对这个问题进行一个系统的总结;就像这样输入一个网址,然后的然后一、先进行DNS域名解析 我们都知道通过IP可以找到一台主机,我们输入网址的目的是获得我们想要的资源,那就需要知道去哪儿…...

    2024/4/16 0:39:00
  14. 基于多边形网络的设计---BGP的控制层面和数据层面分离

    设计要求 1、某公司的要求是:必须有一个总公司,分公司至少有2个,若是以后公司发展较好,必须可以做到扩大升级等 公司主要有两大业务流量1和2 公司内必须有个安全策略中心; 公司内可以访问互联网 所有的数据业务必须经过安全策略中心 总公司去往分公司实现互备,总公司去往…...

    2024/4/16 0:39:05
  15. 【无人机组装与调试】 第五章 无人机遥控器

    一、遥控器的概念遥控器是一种无线发射装置,通过现代的数字编码技术,将按键信息进行编码,通过红外线二极管发射光波,光波经接收机的红外线接收器将收到的红外信号转变成电信号,进处理器进行解码,解调出相应的指令来达到控制设备完成所需的操作要求。遥控器——是一种用来…...

    2024/4/20 4:18:09
  16. 一站式了解CISP

    一、CISP是什么?注册信息安全专业人员(英文名称Certified Information Security Professional,简称“CISP"),是由中国信息安全测评中心于2002年推出的、业内公认的国内信息安全领域最权威的国家级认证,自推出以来累计为国家培养了近2万名持证人员。二、CISP培训涵盖…...

    2024/4/16 0:40:11
  17. 基于Robei:环境光传感器实验设计(及L298N模块控制LED灯板)

    摘要:最近在做FPGA视觉机器人,考虑到晚上机器人视线不好,萌发了给机器人做一个小型灯补光的想法。咱是机器人肯定要整点智能的对不对,思来想去觉得环境光传感器是个不错的选择。 嘿嘿,行动派往往都是说做就做,从不拖拉。 首先查阅资料: AP3216C是一个能够测量环境光强度…...

    2024/4/16 0:39:15
  18. 回归

    主要内容: 线性回归: 高斯分布 最大似然估计MLE 最小二乘法的本质 Logisitic回归 分类问题的首选算法 技术点: 梯度下降法 最大似然估计 特征选择线性回归 ***、多个变量的情形:使用极大似然估计解释最小二乘:中心极限定理的意义: 实际问题中,很多随机现象可以看作众多因…...

    2024/4/16 0:39:20
  19. 人工智能:遗传算法概述

    遗传算法 遗传算法(Genetic Algorithm,GA)是模拟生物在自然环境中的遗传和进化的过程而形成的自适应全局优化搜索算法。它借用了生物遗传学的观点,通过自然选择、遗传和变异等作用机制,实现各个个体适应性的提高。遗传算法最早由美国的J. H. Holland教授提出,起源于20世纪…...

    2024/4/16 0:40:06
  20. Sklearn之聚类分析

    Sklearn之聚类分析 数据科学家需要了解的5种聚类算法...

    2024/4/16 0:39:56

最新文章

  1. MariaDB简介

    MariaDB是一个关系数据库管理系统&#xff08;RDBMS&#xff09;&#xff0c;是MySQL的一个分支&#xff0c;主要由开源社区维护和开发。 一&#xff0c; MariaDB的来历 1. **起源**&#xff1a;MariaDB的诞生与MySQL的所有权变更有关。MySQL最初由MySQL AB公司开发&#xff…...

    2024/4/23 16:00:52
  2. 梯度消失和梯度爆炸的一些处理方法

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

    2024/3/20 10:50:27
  3. SpringMVC初始化工程

    SpringMVC初始化工程 本文采用maven作为构建工具,SpringMVC作为主框架。 创建一个maven的web工程,并配置pom文件<!-- pom.xml --> <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0&qu…...

    2024/4/19 0:08:43
  4. C#,简单,精巧,实用的文件夹时间整理工具FolderTime

    点击下载本文软件&#xff08;5积分&#xff09;&#xff1a; https://download.csdn.net/download/beijinghorn/89071073https://download.csdn.net/download/beijinghorn/89071073 百度网盘&#xff08;不需积分&#xff09;&#xff1a; https://pan.baidu.com/s/1FwCsSz…...

    2024/4/22 1:33:05
  5. 02 OSI和TCP/IP参考模型

    OSI参考模型优点&#xff1a; 1. 分层结构&#xff1a;OSI参考模型将网络通信划分为七个不同的层次&#xff0c;每个层次都有特定的功能和责任。这样的分层结构使得网络通信变得模块化&#xff0c;易于理解、设计和维护。 2. 标准化&#xff1a;OSI参考模型的制定依据了通信领…...

    2024/4/22 4:01:15
  6. 【外汇早评】美通胀数据走低,美元调整

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

    2024/4/22 17:02:52
  7. 【原油贵金属周评】原油多头拥挤,价格调整

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

    2024/4/23 13:30:22
  8. 【外汇周评】靓丽非农不及疲软通胀影响

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

    2024/4/23 13:28:06
  9. 【原油贵金属早评】库存继续增加,油价收跌

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

    2024/4/20 23:26:47
  10. 【外汇早评】日本央行会议纪要不改日元强势

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

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

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

    2024/4/19 11:57:53
  12. 【外汇早评】美欲与伊朗重谈协议

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

    2024/4/23 13:29:53
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

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

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

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

    2024/4/23 13:28:42
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

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

    2024/4/21 20:01:37
  16. 【外汇早评】美伊僵持,风险情绪继续升温

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

    2024/4/23 13:29:23
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

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

    2024/4/23 13:27:46
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

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

    2024/4/23 13:47:22
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

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

    2024/4/19 11:59:23
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

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

    2024/4/19 11:59:44
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

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

    2024/4/23 13:28:08
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

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

    2024/4/23 13:29:47
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

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

    2024/4/23 13:28:14
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

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

    2024/4/23 13:27:51
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

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

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

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

    2022/11/19 21:17:18
  27. 错误使用 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
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

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

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

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

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

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

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

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

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

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

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

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

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,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
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    2022/11/19 21:16:58
  45. 如何在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