《Redis in Action》——不仅仅是缓存 部分翻译

Redis数据库 :《Redis实战》(Redis in Action)学习笔记 第一章 初识Redis 写在前面:我是一名全栈工程师,在工作中也经常涉及后台架构的设计,但由于业务背景对性能要求一般,并无机会也无需要使用分布式后台及Redis等业内广为流行的技术。这个系列将会按照章节记录并归纳我在书中读到的关键知识,并在每篇文章后面加上自己的理解,力求只将干货保留在博文中。一来巩固知识,二来互相交流。正文:1.1 Redis简介:    Redis是一个速度非常快的非关系型数据库,她可以存储键值的映射... 阅读详情

Voting on articles

First, let’s start with some numbers and limitations on our problem, so we can solve the problem without losing sight of what we’re trying to do. Let’s say that 1,000 articles are submitted each day. Of those 1,000 articles, about 50 of them are interesting enough that we want them to be in the top-100 articles for at least one day. All of those 50 articles will receive at least 200 up votes. We won’t worry about down votes for this version.

首先,让我们着眼于问题的数字与局限,以使我们可以在不忽略我们要做的事情的同时,解决我们的问题。假设每天有1000篇文章被提交,在这1000篇文章里,有50篇足够有趣,而我们会把它们放到推荐里,然后这些文章将收到最少200张赞成票。在这里我们假设没有收到反对票。

When dealing with scores that go down over time, we need to make the posting time, the current time, or both relevant to the overall score. To keep things simple, we’ll say that the score of an item is a function of the time that the article was posted, plus a constant multiplier times the number of votes that the article has received.
The time we’ll use the number of seconds since January 1, 1970, in the UTC time zone, which is commonly referred to as Unix time. We’ll use Unix time because it can be fetched easily in most programming languages and on every platform that we may use Redis on. For our constant, we’ll take the number of seconds in a day (86,400) divided by the number of votes required (200) to last a full day, which gives us 432 “points” added to the score per vote.
To actually build this, we need to start thinking of structures to use in Redis. For starters, we need to store article information like the title, the link to the article, who posted it, the time it was posted, and the number of votes received. We can use a Redis HASH to store this information, and an example article can be seen in figure 1.8.

为了处理时间与得分之间的关系,我们需要生成提交时间、当前时间以及两者与总分间的关系。为了简单说明,我们设定得分的计算函数为提交时间加上这片文章获得的投票数乘以一个参数的值。
我们将使用Unix时间,因为它可以在大多数编程语言以及我们可能在其上使用Redis的每个平台上轻松获取。对于常数,我们用一天86400秒除以一天应得的200张票可以得出,一张票等于432点的分数。
为了实现这个功能,我们需要考虑在redis中使用的数据结构。首先,我们需要存储文章的信息如标题、提交人、提交时间、收到的投票数。我们可以使用redis的hash结构来存储这个信息,如图1.8。
图1.8

USING THE COLON CHARACTER AS A SEPARATOR Throughout this and other chapters, you’ll find that we use the colon character (: ) as a separator between parts of names; for example, in figure 1.8, we used it to separate article from the ID of the article, creating a sort of namespace. The choice of : is subjective, but common among Redis users. Other common choices include a period (.), forward slash (/), and even occasionally the pipe character (|). Regardless of what you choose, be consistent, and note how we use colons to define nested namespaces throughout the examples in the book.

使用冒号作为分隔符 你会发现我们使用冒号(:)连结名字的分隔符。例如在图1.8中,我们通过用它来分隔article和ID,创建了一个命名空间。在redis使用者里把:作为分隔符的情况很常见。其他常见的分隔符还有(.)、(/)和(|)。无论你选择哪个,都要保持一致,并注意我们在示例中是如何使用冒号来定义嵌套命名空间的。

To store a sorted set of articles themselves, we’ll use a ZSET, which keeps items ordered by the item scores. We can use our article ID as the member, with the ZSET score being the article score itself. While we’re at it, we’ll create another ZSET with the score being just the times that the articles were posted, which gives us an option of browsing articles based on article score or time. We can see a small example of time- and scoreordered article ZSETs in figure 1.9.

我们将使用ZSET,以得分排序,存储文章集。我们可以使用我们的文章ID作为键名,而ZSET分数就是文章本身的分数。在进行此操作时,我们将创建另一个ZSET,其分数仅为文章发布的时间,这使我们可以根据文章得分或时间排序浏览文章。图1.9就是一个简单的例子。
图1.9

In order to prevent users from voting for the same article more than once, we need to store a unique listing of users who have voted for each article. For this, we’ll use a SET for each article, and store the member IDs of all users who have voted on the given article. An example SET of users who have voted on an article is shown in figure 1.10.

为了防止同一用户多次为同一篇文章投票,我们需要为每一篇文章存储一个唯一的用户列表。为此,我们将为每一篇文章设置一个SET,用于存储投票给这篇文章的用户ID。参考图1.10。
图1.10

For the sake of memory use over time, we’ll say that after a week users can no longer vote on an article and its score is fixed. After that week has passed, we’ll delete the SET of users who have voted on the article.
Before we build this, let’s take a look at what would happen if user 115423 were to vote for article 100408 in figure 1.11.

为了内存的长时间使用,我们设定一周后,用户将不能再对这篇文章进行投票,同时我们将把这篇文章的分数固定下来。该星期过去后,我们将删除用于存储这篇文章投票用户id的SET。
在此之前,让我们看看当user 115423为article 100408投票后会发生什么,如图1.11?
图1.11

Now that you know what we’re going to build, let’s build it! First, let’s handle voting. When someone tries to vote on an article, we first verify that the article was posted within the last week by checking the article’s post time with ZSCORE. If we still have time, we then try to add the user to the article’s voted SET with SADD. Finally, if the user didn’t previously vote on that article, we increment the score of the article by 432 (which we calculated earlier) with ZINCRBY (a command that increments the score of a member), and update the vote count in the HASH with HINCRBY (a command that increments a value in a hash). The voting code is shown in listing 1.6.

现在让我们开始吧!首先,从投票开始。当有人给一篇文章投票,我们首先通过使用ZSCORE检查文章的发布时间,来验证文章是否在近一周内发布。如果是,我们通过SADD把该用户加到该文章的投票SET里。如果这个用户在之前没有给这篇文章投过票,我们将通过ZINCRBY为这篇文章加上432点的分数,并且通过HINCRBY为这篇文章的hash里的投票数加1。投票代码查看listing 1.6。

# Listing 1.6 The article_vote()function

# Prepare our constants.
ONE_WEEK_IN_SECONDS = 7 * 86400	
VOTE_SCORE = 432

def article_vote(conn, user, article):
	cutoff = time.time() - ONE_WEEK_IN_SECONDS	# Calculate the cutoff time for voting.
	if conn.zscore('time:', article) < cutoff:	# Check to see if the article can still be voted on (we could use the article HASH here, but scores are returned as floats so we don`t have to cast it).
		return
	article_id = article.partition(':')[-1]		# Get the id portion from the article:id identifier.
	# If the user hasn`t voted for this article before, increment the article score and vote count.
	if conn.sadd('voted:' + article_id, user):
		conn.zincrby('score:', article, VOTE_SCORE)
		conn.hincrby(article, 'votes', 1)

REDIS TRANSACTIONS In order to be correct, technically our SADD, ZINCRBY, and HINCRBY calls should be in a transaction. But since we don’t cover transactions until chapter 4, we won’t worry about them for now.

redis事务 为了保持一致性,从技术上来讲,上述的sadd、zincrby以及hincrby都应该在一个事务里。但是由于我们在第4章才讲到事务,所以我们现在先不关注它。

Posting and fetching articles

To post an article, we first create an article ID by incrementing a counter with INCR. We then create the voted SET by adding the poster’s ID to the SET with SADD. To ensure that the SET is removed after one week, we’ll give it an expiration time with the EXPIRE command, which lets Redis automatically delete it. We then store the article information with HMSET. Finally, we add the initial score and posting time to the relevant ZSETs with ZADD. We can see the code for posting an article in listing 1.7。

要发布一篇文章,我们首先通过INCR计数器来创建一个文章ID。然后我们通过sadd添加作者id的方式创建一个投票集。为了确保这个投票集在一周后被移除,我们将通过EXPIRE命令给它设置一个过期时间,以使redis自动删除它。再然后,我们用HMSET来存储文章的信息。最后,我们使用ZADD将初始得分和发布时间添加到相关的ZSET。例子查看listing 1.7。

# Listing 1.7 The post_article() function
def post article(conn, user, title, link):
	article_id = str(conn.incr('article:'))			# Generate a new article id.
	
	voted = 'voted:' + article_id
	# Start with the posting user having voted for the article, and set the article voting information to automatically expire in a week (we descuss expiration in chapter 3).
	conn.sadd(voted, user)
	conn.expire(voted, ONE_WEEK_IN_SECONDS)

	now = time.time()
	article = 'article:' + article_id
	# Create the article hash.
	conn.hmset(article, {
		'title': title,
		'link': link,
		'poster': user,
		'time': now,
		'votes': 1
	})
	# Add the article to the time and score ordered ZSETs.
	conn.zadd('score:', article, now + VOTE_SCORE)
	conn.zadd('time:', article, now)

	return article_id

Okay, so we can vote, and we can post articles. But what about fetching the current top-scoring or most recent articles? For that, we can use ZRANGE to fetch the article IDs, and then we can make calls to HGETALL to fetch information about each article. The only tricky part is that we must remember that ZSETs are sorted in ascending order by their score. But we can fetch items based on the reverse order with ZREVRANGEBYSCORE. The function to fetch a page of articles is shown in listing 1.8.

好了,现在我们实现了投票和发帖。那我们该怎么获取最新或是最热门的文章呢?为此,我们可以使用ZRANGE来获取文章id,然后我们可以调用HGETALL来获取关于每一篇文章的信息。我们唯一需要注意并记住的是,ZSET是以升序排序的。但我们可通过使用SREVRANGEBYSCORE来倒序获取。获取文章的代码参考listing 1.8。

# Listing 1.8 The get_articles() function
ARTICLES_PER_PAGE = 25

def get_articles(conn, page, order='score:'):
	# Set up the start and end indexes for fetching the articles.
	start = (page-1) * ARTICLES_PER_PAGE
	end = start + ARTICLES_PER_PAGE - 1

	ids = conn.zrevrange(order, start, end)	# Fetch the article ids.
	articles=[]
	# Get the article information from the list of article ids.
	for id in ids:
		article_data = conn.hgetall(id)
		article_data['id'] = id
		articles.append(article_data)
	
	return articles

DEFAULT ARGUMENTS AND KEYWORD ARGUMENTS Inside listing 1.8, we used an argument named order, and we gave it a default value of score:. Some of the details of default arguments and passing arguments as names (instead of by position) can be strange to newcomers to the Python language. If you’re having difficulty understanding what’s going on with function definition or argument passing, the Python language tutorial offers a good introduction to what’s going on, and you can jump right to the particular section by visiting this shortened URL: http://mng.bz/KM5x.

默认参数和关键字参数 在listing 1.8里,我们给一个参数命名为order,并且我们给它设置了默认值“score:”。对于Python语言的新手来说,默认参数和将参数作为名称传递(而不是按位置传递)的一些细节可能会让他们感到奇怪。如果您在理解函数定义或参数传递方面有困难,Python语言教程提供了一个很好的介绍,您可以访问这个URL: http://mng.bz/KM5x

We can now get the top-scoring articles across the entire site. But many of these article voting sites have groups that only deal with articles of a particular topic like cute animals, politics, programming in Java, and even the use of Redis. How could we add or alter our code to offer these topical groups?

现在我们可以在整个网站里找到得分最高的文章了。但是很多这样的文章投票网站都有专门的分类来处理一些特定主题的文章,比如可爱的动物,政治,Java编程,甚至是Redis的使用。我们如何添加或修改我们的代码来提供分类的功能?

Grouping articles

To offer groups requires two steps. The first step is to add information about which articles are in which groups, and the second is to actually fetch articles from a group. We’ll use a SET for each group, which stores the article IDs of all articles in that group. In listing 1.9, we see a function that allows us to add and remove articles from groups.

实现分类只需两步。第一步把文章添加到分类里,第二步获取这个分组里的所有文章。我们将为每个分类设置一个SET,用于存储文章的ID。listing 1.9 展示了如何添加或移除分类。

# Listing 1.9 The add_remove_groups() function
def add_remove_groups(conn, article_id, to_add=[], to_remove=[]):
	article = 'article:' + article_id			# Construct the article information like we did in post_article.
	for group in to_add:
		conn.sadd('group:' + group, article)	# Add the article to groups that it should be a part of.
	for group in to_remove:
		conn.srem('group:' + group, article)	# Remove the article from groups that it should be removed from.

At first glance, these SETs with article information may not seem that useful. So far, you’ve only seen the ability to check whether a SET has an item. But Redis has the capability to perform operations involving multiple SETs, and in some cases, Redis can perform operations between SETs and ZSETs.
When we’re browsing a specific group, we want to be able to see the scores of all of the articles in that group. Or, really, we want them to be in a ZSET so that we can have the scores already sorted and ready for paging over. Redis has a command called ZINTERSTORE, which, when provided with SETs and ZSETs, will find those entries that are in all of the SETs and ZSETs, combining their scores in a few different ways (items in SETs are considered to have scores equal to 1). In our case, we want the maximum score from each item (which will be either the article score or when the article was posted, depending on the sorting option chosen).

乍一看,这些包含文章信息的集合似乎不是很有用。到目前为止,您只看到了检查集合是否含有某个元素的功能。但是Redis有能力执行涉及多个集合的操作,并且在某些情况下,Redis可以在集合和zset之间执行操作。
当我们浏览一个特定的分类时,我们希望能够看到该分类中所有文章的得分。或者,实际上,我们希望它们在一个ZSET中,这样我们就可以对分数进行排序,并为分页做好准备。Redis有一个叫ZINTERSTORE的命令,可以比较SET和ZSET里的所有键名比提取出它们的交集(SET可以看作是分数均为1的ZSET)。在我们的例子里,我们希望获得每个条目的最大得分(即文章得分或文章发布的时间,取决于所选择的排序选项)。
图1.12

To visualize what is going on, let’s look at figure 1.12. This figure shows an example ZINTERSTORE operation on a small group of articles stored as a SET with the much larger (but not completely shown) ZSET of scored articles. Notice how only those articles that are in both the SET and the ZSET make it into the result ZSET?
To calculate the scores of all of the items in a group, we only need to make a ZINTERSTORE call with the group and the scored or recent ZSETs. Because a group may be large, it may take some time to calculate, so we’ll keep the ZSET around for 60 seconds to reduce the amount of work that Redis is doing. If we’re careful (and we are), we can even use our existing get_articles() function to handle pagination and article data fetching so we don’t need to rewrite it. We can see the function for fetching a page of articles from a group in listing 1.10.
为了可视化我们要实现的功能,让我们看看图1.12。该图展示了一个基于分类SET和文章分数ZSET的ZINTERSTORE操作,是如何只把两者中均存在的文章放入结果ZSET中的。
要计算分类中所有元素的分数,我们只需要对分类SET和分数、时间ZSET进行ZINTERSTORE。因为一个分类包含的数据可能很大以至于计算需要的时间较长,所以我们将ZSET保持在60秒左右,以减少Redis的工作量。如果我们足够细心,我们甚至可以使用我们已有的get_articles()方法来进行分页和读取数据,而无需重写新的方法。查看listing1.10。

# Listing 1.10 The get_group_articles() function
def get_group_articles(conn, group, page, order='score:'):
	key = order + group						# Create a key for each group and each sort order.
	if not conn.exists(key):				# If we haven`t sorted these articles recently, we should sort them.
		# Actually sort the articles in the group based on score or recency.
		conn.zinterstore(
			key,
			['group:' + group, order],
			aggregate='max'
		)
		conn.expire(key, 60)				# Tell Redis to automatically expire the ZSET in 60 seconds.
	return get_articles(conn, page, key)	# Call our earlier get_articles() function to handle pagination and article data fetching.

On some sites, articles are typically only in one or two groups at most (“all articles” and whatever group best matches the article). In that situation, it would make more sense to keep the group that the article is in as part of the article’s HASH, and add one more ZINCRBY call to the end of our article_vote() function. But in our case, we chose to allow articles to be a part of multiple groups at the same time (maybe a picture can be both cute and funny), so to update scores for articles in multiple groups, we’d need to increment all of those groups at the same time. For an article in many groups, that could be expensive, so we instead occasionally perform an intersection. How we choose to offer flexibility or limitations can change how we store and update our data in any database, and Redis is no exception.

在一些网站上,一篇文章通常最多只属于一到两个类别(“所有文章”和最适合文章)。在这种情况下,更合理的做法是将文章所在的分类保留为文章hash的一部分,并在article_vote()函数的末尾再添加一个ZINCRBY调用。但是在我们的例子中,我们允许文章同时存在于多个分类中(也许一张图片可以既可爱又有趣),所以要更新该文章的分数,我们需要同时增加所有这些分类中的分数,这将会是一笔高昂的消费,因此我们偶尔会用交集来实现。在任何数据库中,灵活与限制的取舍将影响我们存储和更新数据的方式,在redis中也不例外。

LLM能力缺口、智能体架构与语义缓存实战指南 大语言模型(LLM)作为概率生成系统,天然存在行为不确定性,其与企业级确定性系统的根本矛盾,催生了三大核心工程挑战:LLM能力缺口(如语义漂移、格式漂移)、Agent架构脆弱性(缺乏事务管理与状态回滚),以及传统哈希缓存失效问题。解决路径在于从‘调参思维’转向‘架构治理’——通过漂移检测+干预机制提升LLM鲁棒性,以动作契约、状态快照和韧性路由重构Agent为可审计决策实体,并用语义归一化、模糊匹配与模板适配实现Smarter Semantic Caching。这些方法已在金融客服、工单处理等日均万次调用场 阅读详情

相关推荐

Whisper API实战指南:多语言语音转文字与端到端翻译

语音转文字(ASR)是人机交互的基础能力,其核心在于声学建模、语言识别与上下文理解的协同。随着深度学习演进,端到端模型逐步取代传统GMM-HMM+WFST流水线,显著降低工程门槛。Whisper API作为工业级语音理解基础设施,依托统一Transformer架构实现98种语言零样本识别,并原生支持语音直译(如西班牙语→中文),避免分步转录+翻译的误差叠加。其技术价值体现在开箱即用的高准确率、免运维的弹性扩展,以及对真实场景(口音、噪音、混杂语种、专业术语)的强鲁棒性。典型应用场景包括跨国会议纪要、跨境电商

weixin_34252090的博客 337

redis in action中文版_使用Redis实现UA池

最近忙于业务开发、交接和游戏,加上碰上了不定时出现的犹豫期和困惑期,荒废学业了一段时间。天冷了,要重新拾起开始下阶段的学习了。之前接触到的一些数据搜索项目,涉及到请求模拟,基于反爬需要使用随机的 User Agent ,于是使用 Redis 实现了一个十分简易的 UA 池。背景最近的一个需求,有模拟请求的逻辑,要求每次请求的请求头中的 User Agent 要满足下面几点:每次获取的 User A...

weixin_39875941的博客 326

MuleSoft驱动的企业级AI编排:语义翻译、安全治理与可审计落地

AI编排(AI Orchestration)是企业将大语言模型深度融入核心业务系统的关键范式,其本质在于弥合自然语言意图与结构化系统操作之间的语义断层。它不仅涉及LLM调用,更强调多系统协同、权限收敛、流程韧性与全链路可观测性。相比RAG或微调等模型层优化,AI编排聚焦于Actionable(可触发真实业务动作)、Integrated(与ERP/CRM/MES深度集成)、Orchestrated(跨协议、跨步骤、跨模态任务调度)与Resilient(可回滚、可审计、可治理)四大技术价值。典型应用场景包括智能

weixin_33675507的博客 424

knowledge-catalog 中的 GA4 Highly Active Users 指标:用 BigQuery 构建“近 M 天活跃超 N 分钟”的高活跃用户受众

本文围绕 knowledge-catalog 仓库中 OKF 知识库 GA4 示例所收录的 **Highly Active Users Metric 参考文档**([toolbox/mdcode/demo/okf/catalog/references/metrics/highly_active_users.md](https://link.gitcode.com/i/c0d6625fc2ca87a

gitblog_00507的博客 574

.NET反射性能优化:委托缓存与动态代码生成实战指南

反射是.NET中实现动态行为的基础机制,但其元数据查找、类型检查和解释执行等固有开销,常在高频场景(如ORM映射、JSON序列化、插件加载)引发显著性能瓶颈。理解反射慢的本质,关键在于区分‘调用开销’与‘编译开销’——前者可通过强类型委托缓存近乎消除,后者则需借助Expression Tree或IL Emit实现运行时动态编译,将解释执行升格为原生方法调用。这类技术不仅提升吞吐与延迟,更支撑高并发API网关、金融风控引擎等对P99延迟敏感的生产系统。本文聚焦委托缓存、动态编译两大经生产验证路径,结合反射密集

天下无双 401

Cat in dotNET:面向.NET微服务的原生可观测性追踪工具

分布式追踪是现代微服务架构中实现系统可观测性的核心技术,其本质是通过上下文传播(Context Propagation)在异步调用链中串联 Span,形成可下钻的调用拓扑。.NET 平台因 AsyncLocal 机制与 Activity 原生类型,具备独特追踪优势,但通用方案(如 OpenTelemetry)常面临上下文断链、性能开销高、诊断深度不足等问题。Cat in dotNET 以‘in dotNET’为设计哲学,深度融合 .NET 运行时特性,提供毫秒级链路追踪、错误驱动采样、EF Core/Htt

336

基于AI与FFmpeg的视频字幕自动化处理:从语音识别到翻译合成

视频字幕处理是多媒体内容本地化与可访问性的关键技术环节,其核心在于将音频或文本信息与视频时间轴精准对齐。传统方法依赖人工听译与时间轴校对,效率低下且成本高昂。随着人工智能技术的发展,语音识别(ASR)与大型语言模型(LLM)为自动化字幕生成与翻译带来了革命性突破。通过结合开源工具如Whisper进行高精度语音转写,并利用LLM API(如DeepSeek)进行上下文感知的优质翻译,开发者能够构建高效、可编程的字幕处理流水线。该技术方案极大地提升了影视剧、教学视频、纪录片等内容的生产效率与翻译质量,实现了从原

weixin_30634661的博客 333

Redis in action 中文版

优化 redis 性能及高级特性需求时,查相关资料找到的,觉得内容不错

第40章:【高级篇综合实战】从零设计企业级 Redis 平台

本文摘要: 一家大型企业集团内部存在严重的Redis管理混乱问题,全集团分散着327个不同版本的Redis实例,存在重大安全隐患。近年来发生了三次重大事故:双十一期间主库OOM导致支付链路雪崩、春节红包期间Cluster集群Gossip风暴引发服务延迟、Module升级不当导致全量数据丢失。根因分析显示,问题核心在于缺乏统一的实例生命周期管理、标准化高可用方案、安全基线和容量治理。

davidwang456的专栏 1240

《Redis实战》 高清扫描完整中文版带书签PDF

本书是国外经典教材《Redis in Action》一书的中文版,由黄健宏翻译。

Redis实战电子书 高清带书签 中文完整版.pdf(《红丸出品》)

Redis 是一个 Key-Value 存储系统。和 Memcached 类似,它支持存储的 value 类型相对更多, 包括 string(字符串)、 list(链表)、 set(集合)和 zset(有序集合)。这些数据类型都支持 push/pop、 add/remove 及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的。在此基础 上, Redis 支持各种不同方式的排序。与 memcached 一样,为了保证效率,数据都是缓存在 内存中。区别的是 Redis 会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录 文件,并且在此基础上实现了 master-slave(主从)同步。

大模型推理降本实战:从Prompt优化到智能路由

大模型推理成本已成为企业AI落地的核心瓶颈,其本质是计算资源消耗与业务效果之间的平衡问题。理解Token计费机制、模型能力差异及请求特征分布,是实现高效降本的前提;通过Prompt精炼压缩输入长度、按任务复杂度分级选型(如GPT-3.5 Turbo替代GPT-4 Turbo)、构建Redis+FAISS双层缓存、设计规则驱动的智能路由层,可系统性降低单位有效输出成本。该方法已在客服对话、长文本摘要、代码生成等典型场景验证,平均API费用下降57%,同时保障P95延迟与业务指标稳定。本文聚焦‘GPT太贵了’这

409

Redis实战PDF

《Redis实战》是《Redis in Action》一书的中文翻译版, 该书深入浅出地介绍了 Redis 的字符串、列表、散列、集合、有序集合等五种结构, 并通过文章聚合网站、cookie、购物车、网页缓存、日志、计数器、IP 所属地址查询程序、自动补全、分布式锁、计数信号量、任务队列、消息队列、搜索程序、广告定向程序、社交网站等一系列实用示例展示了 Redis 的用法。

双智能体框架:自然语言协议到机器人实验室代码的自动化翻译与验证

自然语言处理(NLP)与机器人流程自动化(RPA)的结合,正推动实验室自动化向智能化演进。其核心原理在于利用大型语言模型(LLM)理解人类指令,并通过领域知识库和规则引擎将其转化为精确、可执行的机器指令。这项技术的核心价值在于显著降低自动化编程门槛,提升实验的可重复性和效率,尤其适用于高通量筛选、生物化学实验等复杂、重复的实验室场景。本文聚焦的【双智能体框架】和【跨模型验证】机制,正是实现这一目标的关键创新。该框架通过两个专业化智能体的分工协作——一个负责解析与结构化协议,另一个负责代码生成与平台适配——并

weixin_34198762的博客 421

《Redis实战》高清pdf (中英双版)

《Redis实战》是《Redis in Action》一书的中文版,由黄健宏翻译。 包含中英两种pdf,解压就行了。 java经典书籍,高清版。

《Redis实战》中文版PDF

《Redis实战》是《Redis in Action》一书的中文版,由黄健宏翻译。此为高清扫描版PDF

Delta lake第一稿个人翻译和注释(第四章)

亚马逊S3等云对象存储是全球规模最大、最具成本效益的存储系统之一,因此成为存储大型数据仓库和数据湖的理想之选。遗憾的是,它们作为键值存储的实现使得实现ACID事务和高性能变得困难:元数据操作(如列出对象)成本高昂**(解释:对象存储在云上面list操作费用是get操作的10倍,并且抽取类似元数据次数多了,费用很贵;所以整体思想是减少list操作,有个元数据管理文件,然后从文件抽取必要文件然后采取 get操作),一致性保证也有限。

knowcai126的博客 291

想发故障诊断论文?手把手教你用CWRU数据集复现第一个Baseline模型

本文提供了一份基于CWRU轴承数据集的故障诊断Baseline模型实战指南,手把手教你从数据准备到模型构建的全流程。通过详细的Python代码示例和学术级实验设计,帮助初学者快速复现第一个故障诊断模型,为发表高质量论文奠定基础。

weixin_28681255的博客 428
上一篇: python中使用qrcode库生成二维码时,填充logo变成黑白色的解决方法。
下一篇: 数据结构的扩展库——collections
调皮博士
博客等级 码龄10年 14粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值