Redis JSON介绍和命令大全
Redis JSON介绍和命令大全
- Redis JSON
- 先说说`JSON`是什么
- 再说说`JSON Path`
- 先推荐两个网站
- `JSONPath JAVA clents`
- `Redis JSON` 安装
- 内存
- json命令语法
- 命令url
- 命令解释
- `JSON.ARRAPPEND`
- `JSON.ARRINDEX`
- `JSON.ARRINSERT`
- `JSON.ARRLEN`
- `JSON.ARRPOP`
- `JSON.ARRTRIM`
- `JSON.CLEAR`
- `JSON.DEBUG MEMORY`
- `JSON.DEBUG`
- `JSON.DEL`
- `JSON.FORGET`
- `JSON.GET`
- `JSON.MERGE`
- `JSON.MGET`
- `JSON.MSET`
- `JSON.NUMINCRBY`
- `JSON.OBJKEYS`
- `JSON.OBJLEN`
- `JSON.SET`
- `JSON.STRAPPEND`
- `JSON.STRLEN`
- `JSON.TOGGLE`
- `JSON.TYPE`
- 增
- 删
- 改
- 查
- `redis json`的`clients`
- `redis json`的使用场景 https://redis.io/docs/latest/develop/data-types/json/use_cases/
Redis JSON
redis在6.x开始支持json
注意:json可以说是在http接口返回值的网红,之所以说是网红,是因为之前不是json,之后当然也就未可知也。
注意我上面只说了在http接口返回值的场景。实际上在内部的rpc调用,也有用json传输的,不过这比较小众。
更多使用在存储数据场景下,也是泛滥的场景,如mysql、es、mongodb、redis中,json似乎包罗万象了。
⚠️注意!这不是好事,灵活性的提升必定伴随着其他如规范性、稳定性等问题的到来,
如果还没有到来,那肯定是时间还不够长、业务还没有增长。
redis官网介绍 https://redis.io/docs/latest/develop/data-types/json/
先说说JSON
是什么
JSON 指的是 JavaScript 对象表示法(JavaScript Object Notation)
再说说JSON Path
JSONPath是一种用于从JSON文档中提取信息的查询语言,类似于XML的XPath。
先推荐两个网站
JsonPath语法 https://goessner.net/articles/JsonPath/
JsonPath在线 https://jsonpath.com/
JSONPath JAVA clents
<dependency><groupId>com.jayway.jsonpath</groupId><artifactId>json-path</artifactId><version>2.7.0</version> <!-- 请检查是否有更新的版本 -->
</dependency>
Redis JSON
安装
- 使用
redis-stack
docker run -it --name redis-stack -p 6379:6379 redis/redis-stack:latest
- 使用
redis 6.x
及以上,配置loadMoudle
本文使用redis-stack
,如下图,可以看到启动的时候自动加载了json模块,
除此之外还有timeseries、search
等模块
内存
官网内存 https://redis.io/docs/latest/develop/data-types/json/ram/
可以看到json
的内存还是挺恐怖的,哈哈哈,用不上还是用string
吧…
key
和value
都占用内存
json命令语法
json命令大全 https://redis.io/docs/latest/commands/?group=json
命令url
index | command | url |
---|---|---|
0 | JSON.ARRAPPEND | https://redis.io/docs/latest/commands/json.arrappend/ |
1 | JSON.ARRINDEX | https://redis.io/docs/latest/commands/json.arrindex/ |
2 | JSON.ARRINSERT | https://redis.io/docs/latest/commands/json.arrinsert/ |
3 | JSON.ARRLEN | https://redis.io/docs/latest/commands/json.arrlen/ |
4 | JSON.ARRPOP | https://redis.io/docs/latest/commands/json.arrpop/ |
5 | JSON.ARRTRIM | https://redis.io/docs/latest/commands/json.arrtrim/ |
6 | JSON.CLEAR | https://redis.io/docs/latest/commands/json.clear/ |
7 | JSON.DEBUG | https://redis.io/docs/latest/commands/json.debug/ |
8 | JSON.DEBUG MEMORY | https://redis.io/docs/latest/commands/json.debug-memory/ |
9 | JSON.DEL | https://redis.io/docs/latest/commands/json.del/ |
10 | JSON.FORGET | https://redis.io/docs/latest/commands/json.forget/ |
11 | JSON.GET | https://redis.io/docs/latest/commands/json.get/ |
12 | JSON.MERGE | https://redis.io/docs/latest/commands/json.merge/ |
13 | JSON.MGET | https://redis.io/docs/latest/commands/json.mget/ |
14 | JSON.MSET | https://redis.io/docs/latest/commands/json.mset/ |
15 | JSON.NUMINCRBY | https://redis.io/docs/latest/commands/json.numincrby/ |
16 | JSON.NUMMULTBY | https://redis.io/docs/latest/commands/json.nummultby/ |
17 | JSON.OBJKEYS | https://redis.io/docs/latest/commands/json.objkeys/ |
18 | JSON.OBJLEN | https://redis.io/docs/latest/commands/json.objlen/ |
19 | JSON.RESP | https://redis.io/docs/latest/commands/json.resp/ |
20 | JSON.SET | https://redis.io/docs/latest/commands/json.set/ |
21 | JSON.STRAPPEND | https://redis.io/docs/latest/commands/json.strappend/ |
22 | JSON.STRLEN | https://redis.io/docs/latest/commands/json.strlen/ |
23 | JSON.TOGGLE | https://redis.io/docs/latest/commands/json.toggle/ |
24 | JSON.TYPE | https://redis.io/docs/latest/commands/json.type/ |
命令解释
JSON.ARRAPPEND
command | JSON.ARRAPPEND |
---|---|
syntax | JSON.ARRAPPEND key [path] value [value ...] |
description | Append the |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.arrappend/ |
JSON.ARRINDEX
command | JSON.ARRINDEX |
---|---|
syntax | JSON.ARRINDEX key path value [start [stop]] |
description | Search for the first occurrence of a JSON value in an array |
time complexity | O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.arrindex/ |
JSON.ARRINSERT
command | JSON.ARRINSERT |
---|---|
syntax | JSON.ARRINSERT key path index value [value ...] |
description | Insert the |
time complexity | O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.arrinsert/ |
JSON.ARRLEN
command | JSON.ARRLEN |
---|---|
syntax | JSON.ARRLEN key [path] |
description | Report the length of the JSON array at |
time complexity | O(1) where path is evaluated to a single value, O(N) where path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.arrlen/ |
JSON.ARRPOP
command | JSON.ARRPOP |
---|---|
syntax | JSON.ARRPOP key [path [index]] |
description | Remove and return an element from the index in the array |
time complexity | O(N) when path is evaluated to a single value where N is the size of the array and the specified index is not the last element, O(1) when path is evaluated to a single value and the specified index is the last element, or O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.arrpop/ |
JSON.ARRTRIM
command | JSON.ARRTRIM |
---|---|
syntax | JSON.ARRTRIM key path start stop |
description | Trim an array so that it contains only the specified inclusive range of elements |
time complexity | O(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.arrtrim/ |
JSON.CLEAR
command | JSON.CLEAR |
---|---|
syntax | JSON.CLEAR key [path] |
description | Clear container values (arrays/objects) and set numeric values to |
time complexity | O(N) when path is evaluated to a single value where N is the size of the values, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 2.0.0 |
url | https://redis.io/docs/latest/commands/json.clear/ |
JSON.DEBUG MEMORY
command | JSON.DEBUG MEMORY |
---|---|
syntax | JSON.DEBUG MEMORY key [path] |
description | Report a value’s memory usage in bytes |
time complexity | O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.debug-memory/ |
JSON.DEBUG
command | JSON.DEBUG |
---|---|
syntax | JSON.DEBUG |
description | This is a container command for debugging related tasks. |
time complexity | N/A |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.debug/ |
JSON.DEL
command | JSON.DEL |
---|---|
syntax | JSON.DEL key [path] |
description | Delete a value |
time complexity | O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.del/ |
JSON.FORGET
command | JSON.FORGET |
---|---|
syntax | JSON.FORGET key [path] |
description | See |
time complexity | O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.forget/ |
JSON.GET
command | JSON.GET |
---|---|
syntax | JSON.GET key [INDENTÂ indent] [NEWLINEÂ newline] [SPACEÂ space] [path [path ...]] |
description | Return the value at |
time complexity | O(N) when path is evaluated to a single value where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.get/ |
JSON.MERGE
command | JSON.MERGE |
---|---|
syntax | JSON.MERGE key path value |
description | Merge a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children. |
time complexity | O(M+N) when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key |
available in | Redis Stack / JSON 2.6.0 |
url | https://redis.io/docs/latest/commands/json.merge/ |
JSON.MGET
command | JSON.MGET |
---|---|
syntax | JSON.MGET key [key ...] path |
description | Return the values at |
time complexity | O(M*N) when path is evaluated to a single value where M is the number of keys and N is the size of the value, O(N1+N2+…+Nm) when path is evaluated to multiple values where m is the number of keys and Ni is the size of the i-th key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.mget/ |
JSON.MSET
command | JSON.MSET |
---|---|
syntax | JSON.MSET key path value [key path value ...] |
description | Set or update one or more JSON values according to the specified |
time complexity | O(K*(M+N)) where k is the number of keys in the command, when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, or O(K*(M+N)) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key |
available in | Redis Stack / JSON 2.6.0 |
url | https://redis.io/docs/latest/commands/json.mset/ |
JSON.NUMINCRBY
command | JSON.NUMINCRBY |
---|---|
syntax | JSON.NUMINCRBY key path value |
description | Increment the number value stored at |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.numincrby/ |
JSON.OBJKEYS
command | JSON.OBJKEYS |
---|---|
syntax | JSON.OBJKEYS key [path] |
description | Return the keys in the object that’s referenced by |
time complexity | O(N) when path is evaluated to a single value, where N is the number of keys in the object, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.objkeys/ |
JSON.OBJLEN
command | JSON.OBJLEN |
---|---|
syntax | JSON.OBJLEN key [path] |
description | Report the number of keys in the JSON object at |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.objlen/ |
JSON.SET
command | JSON.SET |
---|---|
syntax | JSON.SET key path value [NX | XX] |
description | Set the JSON value at |
time complexity | O(M+N) when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.set/ |
JSON.STRAPPEND
command | JSON.STRAPPEND |
---|---|
syntax | JSON.STRAPPEND key [path] value |
description | Append the |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.strappend/ |
JSON.STRLEN
command | JSON.STRLEN |
---|---|
syntax | JSON.STRLEN key [path] |
description | Report the length of the JSON String at |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.strlen/ |
JSON.TOGGLE
command | JSON.TOGGLE |
---|---|
syntax | JSON.TOGGLE key path |
description | Toggle a Boolean value stored at |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 2.0.0 |
url | https://redis.io/docs/latest/commands/json.toggle/ |
JSON.TYPE
command | JSON.TYPE |
---|---|
syntax | JSON.TYPE key [path] |
description | Report the type of JSON value at |
time complexity | O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key |
available in | Redis Stack / JSON 1.0.0 |
url | https://redis.io/docs/latest/commands/json.type/ |
增
- JSON.ARRAPPEND
127.0.0.1:6379> json.set blog $ '{"user":{"id":222078,"nick":"TOM"},"id":1000,"content":"一起学习redis json吧","delete":false,"like":300,"tags":["redis","json"]}'
127.0.0.1:6379> json.arrappend blog $.tags '"backend"' '"midware"'
4
127.0.0.1:6379> json.get blog INDENT "\t" NEWLINE "\n" SPACE " " $
[{"user": {"id": 222078,"nick": "TOM"},"id": 1000,"content": "一起学习redis json吧","delete": false,"like": 300,"tags": ["redis","json","backend","midware"]}
]
127.0.0.1:6379>
- JSON.ARRINSERT
- JSON.STRAPPEND
删
- JSON.ARRPOP
- JSON.ARRTRIM
- JSON.CLEAR
- JSON.DEL
- JSON.FORGET
改
- JSON.SET
- JSON.MSET
- JSON.NUMINCRBY
- JSON.NUMMULTBY
- JSON.MERGE
- JSON.TOGGLE
查
- JSON.ARRLEN
- JSON.ARRINDEX
127.0.0.1:6379> JSON.SET tom $ '["black","silver"]' OK 127.0.0.1:6379> 127.0.0.1:6379> 127.0.0.1:6379> 127.0.0.1:6379> JSON.ARRINDEX tom $ '"black"' 1) (integer) 0127.0.0.1:6379> JSON.ARRINDEX tom $ '"silver"' 1) (integer) 1
- JSON.DEBUG
- JSON.DEBUG MEMORY
- JSON.GET
- JSON.MGET
- JSON.OBJKEYS
- JSON.OBJLEN
- JSON.RESP (deprecated)
- JSON.STRLEN
- JSON.TYPE
redis json
的clients
https://github.com/RedisJSON/RedisJSON?tab=readme-ov-file
redis json
的使用场景 https://redis.io/docs/latest/develop/data-types/json/use_cases/
- 从json中查询或搜索
- 原子部分更新
相关文章:

Redis JSON介绍和命令大全
Redis JSON介绍和命令大全 Redis JSON先说说JSON是什么再说说JSON Path先推荐两个网站JSONPath JAVA clents Redis JSON 安装内存json命令语法命令url命令解释JSON.ARRAPPENDJSON.ARRINDEXJSON.ARRINSERTJSON.ARRLENJSON.ARRPOPJSON.ARRTRIMJSON.CLEARJSON.DEBUG MEMORYJSON.DE…...

yolo自动化项目实例解析(八)自建UI-键鼠录制回放
项目中关于键鼠的操作,不像我们之前自动化那样一步一步去定义的,而是用C写了一个记录键鼠的操作,通过回放的方法来实现的 一、通讯系统 1、创建websocket服务器 首先通过事件循环asyncio 和websockets,创建一个持久化的服务端进程…...
C++ 面向对象知识汇总(超详细)
学习交流:0voice GitHub 1.什么是类? 在C中,类(Class) 是一种用户定义的数据类型,用来描述具有相同特征和行为的一组对象。类是面向对象编程(OOP)的核心概念,它通过将…...
stm32使用SIM900A模块实现MQTT对接远程服务器
SIM900A模块是一种GSM/GPRS无线通信模块,它可以通过SIM卡连接移动通信网络,并通过串口或USB接口与微控制器或计算机进行通信。 SIM900A驱动代码如下: #include "stm32f10x.h" #include "stdio.h" #include "stdlib.h" #include "sim900a…...

MATLAB Simulink (一)直接序列扩频通信系统
MATLAB & Simulink (一)直接序列扩频通信系统 写在前面1 系统原理1.1 扩频通信系统理论基础1.1.1 基本原理1.1.2 扩频通信系统处理增益和干扰容限1.1.3 各种干扰模式下抗干扰性能 1.2 直接序列扩频通信系统理论基础1.2.1 基本原理1.2.2 物理模型 2 方…...

标准数字隔离器主要特性和应用---腾恩科技
在现代电子系统中,不同电路部分之间需要可靠的隔离,尤其是在高压环境或必须保持敏感信号完整性的情况下。一种这样的解决方案是使用标准数字隔离器。这些组件在电路的不同部分之间提供电气隔离,确保安全、降噪和可靠的信号传输。本文深入探讨…...

Spring事务的七种传播行为
Spring事务的七种传播行为 1.事务的传播行为是什么?2.具体传播行为2.1 REQUIRED ,默认,存在事务则加入该事务,不存在则新建一个事务2.2 REQUIRES_NEW,每次新开启事务,新老事务相互独立2.3 NESTED࿰…...

win10怎么卸载软件干净?电脑彻底删除软件的方法介绍,一键清理卸载残留!
电脑上经常会下载各种各样的软件来协助我们办公,不同的软件能够满足不同的需求。 但是不少软件可能使用频率没有那么高,甚至完全不使用。这个时候就需要将这些不常用的电脑软件卸载掉了,卸载软件能够释放一定的存储空间,提高电脑…...

excel中,将时间戳(ms或s)转换成yyyy-MM-dd hh:mm.ss或毫秒格式
问题 在一些输出为时间戳的文本中,按照某种格式显示更便于查看。 如下,第一列为时间戳(s),第二列是转换后的格式。 解决方案: 在公式输入框中输入:yyyy/mm/dd hh:mm:ss TEXT((A18*3600)/8640070*36519, "yyy…...

机房巡检机器人有哪些功能和作用
随着数据量的爆炸式增长和业务的不断拓展,数据中心面临诸多挑战。一方面,设备数量庞大且复杂,数据中心内服务器、存储设备、网络设备等遍布,这些设备需时刻保持良好运行状态,因为任何一个环节出现问题都可能带来严重后…...

Redis Search系列 - 第一讲 创建索引
目录 一、引言二、全文检索基本概念三、创建索引 一、引言 Redis Search 是 Redis 的一个模块,用于提供全文搜索和二级索引功能。它允许在 Redis 数据库中执行复杂的搜索查询,并支持多种数据类型和查询操作。以下是 Redis Search 的一些关键特性&#x…...

bat 重置 Navicat 试用
bat 脚本文件 echo off set dnInfo set dn2ShellFolder set rpHKEY_CURRENT_USER\Software\Classes\CLSID :: reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Registration14XCS /f %针对<strong><font color"#FF0000">navicat<…...

【真题笔记】09-12年系统架构设计师要点总结
【真题笔记】09-12年系统架构设计师要点总结 41 视图DSSA(特定领域架构)集成系统数据库管理设计模式操作符运算符综合布线备份数据库集成工作流技术软件质量保证需求管理需求开发结构化方法企业战略数据模型事务数据库主题数据库系统设计原型开发静态分析…...

Node + HTML搭建自己的ChatGPT [基础版]
文章目录 明明外面的ChatGPT产品那么多了,为什么要在本地搭建自己的ChatGPT呢?整体架构流程1. 获取APIKey1.1 常见的AI模型1.2 为什么选DeepSeek1.3 怎么获取DeepSeek的APIKey1.3.1 注册并登录DeepSeek开放平台1.3.2 选择API keys1.3.3 创建API key1.3.4…...

关于小程序审核需要提交订单列表页面path的修改办法
小程序又又又又又搞事情啦~~~ 从12月31号起,所有有订单生成逻辑的小程序在审核过程中,必须要填写订单列表页面的path才可以进行审核 在代码层面上会有一些小的改动,下面就告诉大家怎么去修改吧。 第一步…...
使用 Nginx 在同一端口部署两个前端项目并配置子路径
在现代 Web 开发中,我们经常需要在同一台服务器上部署多个前端项目。这不仅可以节省资源,还可以简化管理。本文将指导你如何使用Nginx在同一端口上部署两个前端项目,并通过配置子路径来区分它们。 环境准备 首先,我们需要准备两…...
怎么选择独立站SEO效果好的wordpress模板
选择独立站SEO效果好的WordPress模板需要考虑多个因素,包括模板的代码质量、加载速度、SEO友好性以及与SEO插件的兼容性。以下是一些具体的建议: 1. 代码简洁:选择代码简洁的WordPress主题,因为干净的代码不仅使网站更加安全可靠…...
深度学习速通系列:超长法律文件隐私过滤(基于预训练模型Bert)
法律文件隐私过滤 网上使用bert的中文模型进行命名识别教程少的可怜,摸索了一周的时间,硬是把法律文书的人名全部识别出来了,目前可以达到98.9999%(开玩笑的,不过准确率保守估计是有90%以上).注意:这个法律文书目前只是针对裁决书,其他还没测试过,可支持超长文本识别 github仓…...

【数据结构与算法】之队列详解
队列(Queue)是一种重要的线性数据结构,遵循先进先出、后进后出的原则。本文将更详细地介绍队列的概念、特点、Java 实现以及应用场景。 模运算小复习: a % b 的值总是小于b 5 % 4 1 5 % 2 1 1 % 5 1 4 % 5 4 1. 队列…...

python最新h5st4.9.1调用源码(2025-10-25)
废话不多说,直接上源码,需要技术支持的私。 一、调用js方法: # -*- coding: utf-8 -*- """ -------------------------------------------------Author: byc6352File: jdh5st.pyTime: 2024/10/25 08:03Technical Support:by…...

XCTF-web-easyupload
试了试php,php7,pht,phtml等,都没有用 尝试.user.ini 抓包修改将.user.ini修改为jpg图片 在上传一个123.jpg 用蚁剑连接,得到flag...

Prompt Tuning、P-Tuning、Prefix Tuning的区别
一、Prompt Tuning、P-Tuning、Prefix Tuning的区别 1. Prompt Tuning(提示调优) 核心思想:固定预训练模型参数,仅学习额外的连续提示向量(通常是嵌入层的一部分)。实现方式:在输入文本前添加可训练的连续向量(软提示),模型只更新这些提示参数。优势:参数量少(仅提…...

【快手拥抱开源】通过快手团队开源的 KwaiCoder-AutoThink-preview 解锁大语言模型的潜力
引言: 在人工智能快速发展的浪潮中,快手Kwaipilot团队推出的 KwaiCoder-AutoThink-preview 具有里程碑意义——这是首个公开的AutoThink大语言模型(LLM)。该模型代表着该领域的重大突破,通过独特方式融合思考与非思考…...

【OSG学习笔记】Day 16: 骨骼动画与蒙皮(osgAnimation)
骨骼动画基础 骨骼动画是 3D 计算机图形中常用的技术,它通过以下两个主要组件实现角色动画。 骨骼系统 (Skeleton):由层级结构的骨头组成,类似于人体骨骼蒙皮 (Mesh Skinning):将模型网格顶点绑定到骨骼上,使骨骼移动…...
腾讯云V3签名
想要接入腾讯云的Api,必然先按其文档计算出所要求的签名。 之前也调用过腾讯云的接口,但总是卡在签名这一步,最后放弃选择SDK,这次终于自己代码实现。 可能腾讯云翻新了接口文档,现在阅读起来,清晰了很多&…...
深入理解Optional:处理空指针异常
1. 使用Optional处理可能为空的集合 在Java开发中,集合判空是一个常见但容易出错的场景。传统方式虽然可行,但存在一些潜在问题: // 传统判空方式 if (!CollectionUtils.isEmpty(userInfoList)) {for (UserInfo userInfo : userInfoList) {…...
DiscuzX3.5发帖json api
参考文章:PHP实现独立Discuz站外发帖(直连操作数据库)_discuz 发帖api-CSDN博客 简单改造了一下,适配我自己的需求 有一个站点存在多个采集站,我想通过主站拿标题,采集站拿内容 使用到的sql如下 CREATE TABLE pre_forum_post_…...

react-pdf(pdfjs-dist)如何兼容老浏览器(chrome 49)
之前都是使用react-pdf来渲染pdf文件,这次有个需求是要兼容xp环境,xp上chrome最高支持到49,虽然说iframe或者embed都可以实现预览pdf,但为了后续的定制化需求,还是需要使用js库来渲染。 chrome 49测试环境 能用的测试…...

多模态学习路线(2)——DL基础系列
目录 前言 一、归一化 1. Layer Normalization (LN) 2. Batch Normalization (BN) 3. Instance Normalization (IN) 4. Group Normalization (GN) 5. Root Mean Square Normalization(RMSNorm) 二、激活函数 1. Sigmoid激活函数(二分类&…...

Git 使用大全:从入门到精通
Git 是目前最流行的分布式版本控制系统,被广泛应用于软件开发中。本文将全面介绍 Git 的各种功能和使用方法,包含大量代码示例和实践建议。 文章目录 Git 基础概念版本控制系统Git 的特点Git 的三个区域Git 文件状态 Git 安装与配置安装 GitLinuxmacOSWi…...