• java key锁 实现对某个key(字符串)加同步锁 带详细注释


    相信大家都用过Redis分布式锁吧 Redis分布式锁是对某个字符串来进行上锁的 用起来嘎嘎爽
    于是我就想能不能自己实现一个根据key来同步的锁?下面为该锁的实现过程

    若有线程安全问题或者是讲解不到位的地方,欢迎各位大佬指正。

    话不多说直接开搞

    首先先写一个锁

    static final class Lock extends ReentrantLock {
    
            /**
             * 正在使用或者是准备使用该锁的数量
             */
            int using;
    
            /**
             * 锁的有参构造函数
             *
             * @param fair 是否公平
             */
            Lock(boolean fair) {
                super(fair);
            }
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    这个类比较简单 继承自java.util.concurrent.locks.ReentrantLock
    然后给他一个using属性

    KeyLock
    package cn.liziguo.util.concurrent;
    
    import java.util.concurrent.ConcurrentHashMap;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.atomic.AtomicBoolean;
    import java.util.concurrent.locks.ReentrantLock;
    
    /**
     * @author Liziguo
     * @date 2022/8/12 11:15
     */
    public class KeyLock<K> {
    
        final ConcurrentHashMap<K, Lock> map = new ConcurrentHashMap<>();
    
        /**
         * 是否公平锁
         */
        final boolean fair;
    
        /**
         * 无参构造函数 默认使用非公平锁
         */
        public KeyLock() {
            fair = false;
        }
    
        /**
         * 有参构造函数指定是否使用公平锁
         *
         * @param fair 是否公平
         */
        public KeyLock(boolean fair) {
            this.fair = fair;
        }
    
        /**
         * 从map里获取锁 如果存在则返回 不存在则创建
         * 并使其using++
         *
         * @param key key
         * @return lock
         */
        Lock getLock(K key) {
            return map.compute(key, (k, lock) -> {
                if (lock == null) {
                    lock = new Lock(fair);
                }
                lock.using++;
                return lock;
            });
        }
    
        /**
         * 获取锁 会阻塞
         *
         * @param key key
         */
        public void lock(K key) {
            getLock(key).lock();
        }
    
        /**
         * 尝试获取锁 不阻塞
         *
         * @param key key
         * @return 获取成功返回true
         */
        public boolean tryLock(K key) {
            AtomicBoolean b = new AtomicBoolean();
            map.compute(key, (k, lock) -> {
                if (lock == null) {
                    lock = new Lock(fair);
                }
                // 由于tryLock是非阻塞的 我们可以直接在map里进行调用
                if (lock.tryLock()) {
                    // 只有申请成功了才使using++
                    lock.using++;
                    // 把结果传递到外部
                    b.set(true);
                }
                return lock;
            });
            return b.get();
        }
    
        /**
         * 尝试获取锁 并指定时间
         *
         * @param key     key
         * @param timeout 过期时间
         * @param unit    时间单位
         * @return 获取成功返回true
         */
        public boolean tryLock(K key, long timeout, TimeUnit unit) {
            Lock lock = getLock(key);
            boolean b;
            try {
                b = lock.tryLock(timeout, unit);
            } catch (InterruptedException e) {
                b = false;
            }
            if (!b) {
                // 如果锁获取失败 则判断该锁是否被其他进程使用
                map.computeIfPresent(key, (k, oldLock) -> {
                    // 看看别的地方有没有用着这个锁
                    if (--oldLock.using == 0) {
                        // 如果没有 就释放内存
                        return null;
                    } else {
                        // 否则不管
                        return oldLock;
                    }
                });
            }
            return b;
        }
    
        /**
         * 释放锁 必须由申请锁的线程进行调用
         *
         * @param key key
         */
        public void unlock(K key) {
            map.computeIfPresent(key, (k, lock) -> {
                // 释放锁
                lock.unlock();
                // 看看别的地方有没有用着这个锁
                if (--lock.using == 0) {
                    // 如果没有 就释放内存
                    return null;
                } else {
                    // 否则不管
                    return lock;
                }
            });
        }
    
        static final class Lock extends ReentrantLock {
    
            /**
             * 正在使用或者是准备使用该锁的数量
             */
            int using;
    
            /**
             * 锁的有参构造函数
             *
             * @param fair 是否公平
             */
            Lock(boolean fair) {
                super(fair);
            }
        }
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157

    主要是借助java.util.concurrent.ConcurrentHashMap处理线程安全问题

    用法

    现在这个类的基本功能已经实现并且可以使用了
    用法也很简单:

        public static void main(String[] args) {
            KeyLock<String> keyLock = new KeyLock<>();
    
            final String key = "lock:user_id:" + 10001;
    
            keyLock.lock(key);
            try {
                System.out.println("哈哈哈");
            } finally {
                keyLock.unlock(key);
            }
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    扩展api

    在此基础上提供几个api提高易用性

        public void lockExecute(K key, Runnable runnable) {
            lock(key);
            try {
                runnable.run();
            } finally {
                unlock(key);
            }
        }
    
        public <T> T lockExecute(K key, Supplier<T> supplier) {
            lock(key);
            try {
                return supplier.get();
            } finally {
                unlock(key);
            }
        }
    
        public boolean tryLockExecute(K key, Runnable runnable) {
            if (tryLock(key)) {
                try {
                    runnable.run();
                    return true;
                } finally {
                    unlock(key);
                }
            }
            return false;
        }
    
        public <T> T tryLockExecute(K key, T failResult, Supplier<T> supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40

    用法:

        public static void main(String[] args) {
            KeyLock<String> keyLock = new KeyLock<>();
    
            final String key = "lock:user_id:" + 10001;
    
            keyLock.lockExecute(key, () -> System.out.println("哈哈哈"));
        }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    完整代码
    package cn.liziguo.util.concurrent;
    
    import java.util.concurrent.ConcurrentHashMap;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.atomic.AtomicBoolean;
    import java.util.concurrent.locks.ReentrantLock;
    import java.util.function.*;
    
    /**
     * @author Liziguo
     * @date 2022/8/12 11:15
     */
    public class KeyLock<K> {
    
        final ConcurrentHashMap<K, Lock> map = new ConcurrentHashMap<>();
    
        /**
         * 是否公平锁
         */
        final boolean fair;
    
        /**
         * 无参构造函数 默认使用非公平锁
         */
        public KeyLock() {
            fair = false;
        }
    
        /**
         * 有参构造函数指定是否使用公平锁
         *
         * @param fair 是否公平
         */
        public KeyLock(boolean fair) {
            this.fair = fair;
        }
    
        /**
         * 从map里获取锁 如果存在则返回 不存在则创建
         * 并使其using++
         *
         * @param key key
         * @return lock
         */
        Lock getLock(K key) {
            return map.compute(key, (k, lock) -> {
                if (lock == null) {
                    lock = new Lock(fair);
                }
                lock.using++;
                return lock;
            });
        }
    
        /**
         * 获取锁 会阻塞
         *
         * @param key key
         */
        public void lock(K key) {
            getLock(key).lock();
        }
    
        /**
         * 尝试获取锁 不阻塞
         *
         * @param key key
         * @return 获取成功返回true
         */
        public boolean tryLock(K key) {
            AtomicBoolean b = new AtomicBoolean();
            map.compute(key, (k, lock) -> {
                if (lock == null) {
                    lock = new Lock(fair);
                }
                // 由于tryLock是非阻塞的 我们可以直接在map里进行调用
                if (lock.tryLock()) {
                    // 只有申请成功了才使using++
                    lock.using++;
                    // 把结果传递到外部
                    b.set(true);
                }
                return lock;
            });
            return b.get();
        }
    
        /**
         * 尝试获取锁 并指定时间
         *
         * @param key     key
         * @param timeout 过期时间
         * @param unit    时间单位
         * @return 获取成功返回true
         */
        public boolean tryLock(K key, long timeout, TimeUnit unit) {
            Lock lock = getLock(key);
            boolean b;
            try {
                b = lock.tryLock(timeout, unit);
            } catch (InterruptedException e) {
                b = false;
            }
            if (!b) {
                // 如果锁获取失败 则判断该锁是否被其他进程使用
                map.computeIfPresent(key, (k, oldLock) -> {
                    // 看看别的地方有没有用着这个锁
                    if (--oldLock.using == 0) {
                        // 如果没有 就释放内存
                        return null;
                    } else {
                        // 否则不管
                        return oldLock;
                    }
                });
            }
            return b;
        }
    
        /**
         * 释放锁 必须由申请锁的线程进行调用
         *
         * @param key key
         */
        public void unlock(K key) {
            map.computeIfPresent(key, (k, lock) -> {
                // 释放锁
                lock.unlock();
                // 看看别的地方有没有用着这个锁
                if (--lock.using == 0) {
                    // 如果没有 就释放内存
                    return null;
                } else {
                    // 否则不管
                    return lock;
                }
            });
        }
    
        public void lockExecute(K key, Runnable runnable) {
            lock(key);
            try {
                runnable.run();
            } finally {
                unlock(key);
            }
        }
    
        public boolean lockExecute(K key, BooleanSupplier supplier) {
            lock(key);
            try {
                return supplier.getAsBoolean();
            } finally {
                unlock(key);
            }
        }
    
        public int lockExecute(K key, IntSupplier supplier) {
            lock(key);
            try {
                return supplier.getAsInt();
            } finally {
                unlock(key);
            }
        }
    
        public long lockExecute(K key, LongSupplier supplier) {
            lock(key);
            try {
                return supplier.getAsLong();
            } finally {
                unlock(key);
            }
        }
    
        public double lockExecute(K key, DoubleSupplier supplier) {
            lock(key);
            try {
                return supplier.getAsDouble();
            } finally {
                unlock(key);
            }
        }
    
        public <T> T lockExecute(K key, Supplier<T> supplier) {
            lock(key);
            try {
                return supplier.get();
            } finally {
                unlock(key);
            }
        }
    
        public boolean tryLockExecute(K key, Runnable runnable) {
            if (tryLock(key)) {
                try {
                    runnable.run();
                    return true;
                } finally {
                    unlock(key);
                }
            }
            return false;
        }
    
        public boolean tryLockExecute(K key, boolean failResult, BooleanSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsBoolean();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public int tryLockExecute(K key, int failResult, IntSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsInt();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public long tryLockExecute(K key, long failResult, LongSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsLong();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public double tryLockExecute(K key, double failResult, DoubleSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsDouble();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public <T> T tryLockExecute(K key, T failResult, Supplier<T> supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public boolean tryLockExecute(K key, BooleanSupplier failSupplier, BooleanSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsBoolean();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsBoolean();
        }
    
        public int tryLockExecute(K key, IntSupplier failSupplier, IntSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsInt();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsInt();
        }
    
        public long tryLockExecute(K key, LongSupplier failSupplier, LongSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsLong();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsLong();
        }
    
        public double tryLockExecute(K key, DoubleSupplier failSupplier, DoubleSupplier supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.getAsDouble();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsDouble();
        }
    
        public <T> T tryLockExecute(K key, Supplier<T> failSupplier, Supplier<T> supplier) {
            if (tryLock(key)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.get();
        }
    
        public boolean tryLockExecute(K key, long timeout, Runnable runnable) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    runnable.run();
                    return true;
                } finally {
                    unlock(key);
                }
            }
            return false;
        }
    
        public boolean tryLockExecute(K key, long timeout, boolean failResult, BooleanSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsBoolean();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public int tryLockExecute(K key, long timeout, int failResult, IntSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsInt();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public long tryLockExecute(K key, long timeout, long failResult, LongSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsLong();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public double tryLockExecute(K key, long timeout, double failResult, DoubleSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsDouble();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public <T> T tryLockExecute(K key, long timeout, T failResult, Supplier<T> supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public boolean tryLockExecute(K key, long timeout, BooleanSupplier failSupplier, BooleanSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsBoolean();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsBoolean();
        }
    
        public int tryLockExecute(K key, long timeout, IntSupplier failSupplier, IntSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsInt();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsInt();
        }
    
        public long tryLockExecute(K key, long timeout, LongSupplier failSupplier, LongSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsLong();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsLong();
        }
    
        public double tryLockExecute(K key, long timeout, DoubleSupplier failSupplier, DoubleSupplier supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.getAsDouble();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsDouble();
        }
    
        public <T> T tryLockExecute(K key, long timeout, Supplier<T> failSupplier, Supplier<T> supplier) {
            if (tryLock(key, timeout, TimeUnit.MILLISECONDS)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.get();
        }
    
        public boolean tryLockExecute(K key, long timeout, TimeUnit unit, Runnable runnable) {
            if (tryLock(key, timeout, unit)) {
                try {
                    runnable.run();
                    return true;
                } finally {
                    unlock(key);
                }
            }
            return false;
        }
    
        public boolean tryLockExecute(K key, long timeout, TimeUnit unit, boolean failResult, BooleanSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsBoolean();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public int tryLockExecute(K key, long timeout, TimeUnit unit, int failResult, IntSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsInt();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public long tryLockExecute(K key, long timeout, TimeUnit unit, long failResult, LongSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsLong();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public double tryLockExecute(K key, long timeout, TimeUnit unit, double failResult, DoubleSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsDouble();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public <T> T tryLockExecute(K key, long timeout, TimeUnit unit, T failResult, Supplier<T> supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failResult;
        }
    
        public boolean tryLockExecute(K key, long timeout, TimeUnit unit, BooleanSupplier failSupplier, BooleanSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsBoolean();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsBoolean();
        }
    
        public int tryLockExecute(K key, long timeout, TimeUnit unit, IntSupplier failSupplier, IntSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsInt();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsInt();
        }
    
        public long tryLockExecute(K key, long timeout, TimeUnit unit, LongSupplier failSupplier, LongSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsLong();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsLong();
        }
    
        public double tryLockExecute(K key, long timeout, TimeUnit unit, DoubleSupplier failSupplier, DoubleSupplier supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.getAsDouble();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.getAsDouble();
        }
    
        public <T> T tryLockExecute(K key, long timeout, TimeUnit unit, Supplier<T> failSupplier, Supplier<T> supplier) {
            if (tryLock(key, timeout, unit)) {
                try {
                    return supplier.get();
                } finally {
                    unlock(key);
                }
            }
            return failSupplier.get();
        }
    
        static final class Lock extends ReentrantLock {
    
            /**
             * 正在使用或者是准备使用该锁的数量
             */
            int using;
    
            /**
             * 锁的有参构造函数
             *
             * @param fair 是否公平
             */
            Lock(boolean fair) {
                super(fair);
            }
        }
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404
    • 405
    • 406
    • 407
    • 408
    • 409
    • 410
    • 411
    • 412
    • 413
    • 414
    • 415
    • 416
    • 417
    • 418
    • 419
    • 420
    • 421
    • 422
    • 423
    • 424
    • 425
    • 426
    • 427
    • 428
    • 429
    • 430
    • 431
    • 432
    • 433
    • 434
    • 435
    • 436
    • 437
    • 438
    • 439
    • 440
    • 441
    • 442
    • 443
    • 444
    • 445
    • 446
    • 447
    • 448
    • 449
    • 450
    • 451
    • 452
    • 453
    • 454
    • 455
    • 456
    • 457
    • 458
    • 459
    • 460
    • 461
    • 462
    • 463
    • 464
    • 465
    • 466
    • 467
    • 468
    • 469
    • 470
    • 471
    • 472
    • 473
    • 474
    • 475
    • 476
    • 477
    • 478
    • 479
    • 480
    • 481
    • 482
    • 483
    • 484
    • 485
    • 486
    • 487
    • 488
    • 489
    • 490
    • 491
    • 492
    • 493
    • 494
    • 495
    • 496
    • 497
    • 498
    • 499
    • 500
    • 501
    • 502
    • 503
    • 504
    • 505
    • 506
    • 507
    • 508
    • 509
    • 510
    • 511
    • 512
    • 513
    • 514
    • 515
    • 516
    • 517
    • 518
    • 519
    • 520
    • 521
    • 522
    • 523
    • 524
    • 525
    • 526
    • 527
    • 528
    • 529
    • 530
    • 531
    • 532
    • 533
    • 534
    • 535
    • 536
    • 537
    • 538
    • 539
    • 540
    • 541
    • 542
    • 543
    • 544
    • 545
    • 546
    • 547
    • 548
    • 549
    • 550
    • 551
    • 552
    • 553
    • 554
    • 555
    • 556
    • 557
    • 558
    • 559
    • 560
    • 561
    • 562
    • 563
    • 564
    • 565
    • 566
    • 567
    • 568
    • 569
    • 570
    • 571
    • 572
    • 573
    • 574
    • 575
    • 576
    • 577
    • 578

    都看到这了 点赞+关注一波咯

  • 相关阅读:
    Java--Spring之IoC控制反转;基于XML配置文件的DI
    关于HTTP/1.1,HTTP/2和HTTP/3的区别与联系
    ubuntu 客服端同步ntp服务器时间
    uniapp-vue3 抖音小程序开发(上线项目开源)
    Linux命令200例:Yum强大的包管理工具使用(常用)
    算法设计与分析 SCAU11078 不能移动的石子合并(优先做)
    大模型RLHF算法更新换代,DeepMind提出自训练离线强化学习框架ReST
    Swappin.gifts 在 Ambire dApp 中推出独家促销活动
    AVS感知无损压缩标准概述——视觉无损质量等级视频浅压缩
    Flink提交jar出现错误RestHandlerException: No jobs included in application.
  • 原文地址:https://blog.csdn.net/u010756046/article/details/126321364