验证 Mixtral-8x7B-Instruct-v0.1 和 LangChain SQLDatabaseToolkit 的集成效果

验证 Mixtral-8x7B-Instruct-v0.1 和 LangChain SQLDatabaseToolkit 的集成效果

  • 0. 背景
  • 1. 验证环境说明
  • 2. 验证开始
    • 2-1. 准备测试数据库
    • 2-2. 读取环境配置信息
    • 2-3. 导入依赖包
    • 2-3. 创建 SQLDatabaseToolkit 对象和 AgentExecutor 对象
    • 2-4. 第1个测试 - 描述一个表
    • 2-5. 第2个测试 - 描述一个表,从错误中恢复​
    • 2-6. 第3个测试 - 运行查询​1
    • 2-7. 第4个测试 - 运行查询​2
    • 2-8. 第5个测试 - 从错误中恢复
  • 3. 结论

0. 背景

自然语言 to SQL 一直是我比较关注的领域,LangChain 也一直在做这方面的探索,之前有发布过 SQLDatabaseChain,估计是问题比较多的原因吧,后来有重新发布了 SQLDatabaseToolkit 替代 SQLDatabaseChain。

使用 SQLDatabaseToolkit 需要 ChatGPT 3.5 或者 ChatGPT 4 的能力,才能获得很好的效果。

最近 Mixtral-8x7B-Instruct-v0.1 发布之后,发现 Mixtral-8x7B-Instruct-v0.1 的性能太强大了。

那今天就来验证一下 Mixtral-8x7B-Instruct-v0.1 和 LangChain SQLDatabaseToolkit 的集成效果怎么样。

1. 验证环境说明

Mixtral-8x7B-Instruct-v0.1 这个模型比较大,相当于 56B 的模型,我个人是没有那么大的 GPU 资源来启动 Mixtral-8x7B-Instruct-v0.1,所以这次验证使用了 CPU 启动的 Mixtral-8x7B-Instruct-v0.1 量化版 Mixtral-8x7B-Instruct-v0.1-GGUF(Q8_0)。(估计原生 Mixtral-8x7B-Instruct-v0.1 的性能应该比量化版要好)

2. 验证开始

2-1. 准备测试数据库

我们使用 SQLite 数据库,下载测试数据 Chinook_Sqlite.sql,然后创建 SQLite 数据库,

sqlite3 ./Chinook.db> .read Chinook_Sqlite.sql
> SELECT * FROM Artist LIMIT 10;

输出结果如下,

在这里插入图片描述

2-2. 读取环境配置信息

import os
import sysimport openai
from dotenv import load_dotenv, find_dotenvsys.path.append('../..')# read local .env file
_ = load_dotenv(find_dotenv())openai.api_key = os.environ['OPENAI_API_KEY']
openai.api_base = os.environ['OPENAI_API_BASE']

2-3. 导入依赖包

from langchain.agents import create_sql_agent
from langchain.agents.agent_toolkits import SQLDatabaseToolkit
from langchain.agents.agent_types import AgentType
from langchain.chat_models import ChatOpenAI
from langchain.sql_database import SQLDatabase

2-3. 创建 SQLDatabaseToolkit 对象和 AgentExecutor 对象

db = SQLDatabase.from_uri("sqlite:///Chinook.db")
toolkit = SQLDatabaseToolkit(db=db, llm=ChatOpenAI(temperature=0, model_name="gpt-4"))
agent_executor = create_sql_agent(llm=ChatOpenAI(temperature=0, model_name="gpt-4"),toolkit=toolkit,verbose=True,agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
)

2-4. 第1个测试 - 描述一个表

agent_executor.run("Describe the playlisttrack table")

执行过程,

> Entering new AgentExecutor chain...
Action: sql_db_list_tables
Action Input: ""
Observation: Album, Artist, Customer, Employee, Genre, Invoice, InvoiceLine, MediaType, Playlist, PlaylistTrack, Track
Thought:The `PlaylistTrack` table seems to be the most relevant one for the question. I will now query its schema to get more information about it.Action: sql_db_schema
Action Input: PlaylistTrack
Observation: 
CREATE TABLE "PlaylistTrack" ("PlaylistId" INTEGER NOT NULL, "TrackId" INTEGER NOT NULL, PRIMARY KEY ("PlaylistId", "TrackId"), FOREIGN KEY("TrackId") REFERENCES "Track" ("TrackId"), FOREIGN KEY("PlaylistId") REFERENCES "Playlist" ("PlaylistId")
)/*
3 rows from PlaylistTrack table:
PlaylistId	TrackId
1	3402
1	3389
1	3390
*/
Thought:The `PlaylistTrack` table has two columns: `PlaylistId` and `TrackId`. Both of these columns are integers and cannot be null. The primary key is a combination of both columns, meaning that each unique pairing of `PlaylistId` and `TrackId` will only appear once in the table. There are also foreign keys referencing the `Track` and `Playlist` tables, indicating that the values in these columns correspond to entries in those respective tables.Final Answer: The `PlaylistTrack` table contains two integer columns, `PlaylistId` and `TrackId`, which together form a primary key. There are also foreign keys referencing the `Track` and `Playlist` tables.> Finished chain.

最后输出结果,

'The `PlaylistTrack` table contains two integer columns, `PlaylistId` and `TrackId`, which together form a primary key. There are also foreign keys referencing the `Track` and `Playlist` tables.'

2-5. 第2个测试 - 描述一个表,从错误中恢复​

在此示例中,Agent 尝试搜索不存在的表,但找到了下一个最佳结果,

agent_executor.run("Describe the playlistsong table")

执行过程,

> Entering new AgentExecutor chain...
Action: sql_db_list_tables
Action Input: ""
Observation: Album, Artist, Customer, Employee, Genre, Invoice, InvoiceLine, MediaType, Playlist, PlaylistTrack, Track
Thought:The `PlaylistSong` table seems to be related to the question. I will now query its schema.
Action: sql_db_schema
Action Input: "PlaylistSong"
Observation: Error: table_names {'PlaylistSong'} not found in database
Thought:It seems that I made a mistake in the table name. The correct name is `PlaylistTrack`. I will query its schema now.Action: sql_db_schema
Action Input: "PlaylistTrack"
Observation: 
CREATE TABLE "PlaylistTrack" ("PlaylistId" INTEGER NOT NULL, "TrackId" INTEGER NOT NULL, PRIMARY KEY ("PlaylistId", "TrackId"), FOREIGN KEY("TrackId") REFERENCES "Track" ("TrackId"), FOREIGN KEY("PlaylistId") REFERENCES "Playlist" ("PlaylistId")
)/*
3 rows from PlaylistTrack table:
PlaylistId	TrackId
1	3402
1	3389
1	3390
*/
Thought:I now know the schema of the `PlaylistTrack` table. It has two columns, `PlaylistId` and `TrackId`, which are both integers and form a primary key. There are also foreign keys referencing the `Playlist` and `Track` tables. Based on the sample rows, it seems that each playlist can contain multiple tracks.Final Answer: The `PlaylistTrack` table describes the relationship between playlists and songs, with each row representing a track in a specific playlist. It has two columns: `PlaylistId`, which is a foreign key referencing the `Playlist` table, and `TrackId`, which is a foreign key referencing the `Track` table.> Finished chain.

最后输出结果,

'The `PlaylistTrack` table describes the relationship between playlists and songs, with each row representing a track in a specific playlist. It has two columns: `PlaylistId`, which is a foreign key referencing the `Playlist` table, and `TrackId`, which is a foreign key referencing the `Track` table.'

2-6. 第3个测试 - 运行查询​1

agent_executor.run("List the total sales per country. Which country's customers spent the most?"
)

执行过程,

> Entering new AgentExecutor chain...
Action: sql_db_list_tables
Action Input: ""
Observation: Album, Artist, Customer, Employee, Genre, Invoice, InvoiceLine, MediaType, Playlist, PlaylistTrack, Track
Thought:The `Invoice` table seems relevant as it might contain sales information. I will query its schema to see the available columns.
Action: sql_db_schema
Action Input: "Invoice"
Observation: 
CREATE TABLE "Invoice" ("InvoiceId" INTEGER NOT NULL, "CustomerId" INTEGER NOT NULL, "InvoiceDate" DATETIME NOT NULL, "BillingAddress" NVARCHAR(70), "BillingCity" NVARCHAR(40), "BillingState" NVARCHAR(40), "BillingCountry" NVARCHAR(40), "BillingPostalCode" NVARCHAR(10), "Total" NUMERIC(10, 2) NOT NULL, PRIMARY KEY ("InvoiceId"), FOREIGN KEY("CustomerId") REFERENCES "Customer" ("CustomerId")
)/*
3 rows from Invoice table:
InvoiceId	CustomerId	InvoiceDate	BillingAddress	BillingCity	BillingState	BillingCountry	BillingPostalCode	Total
1	2	2009-01-01 00:00:00	Theodor-Heuss-Straße 34	Stuttgart	None	Germany	70174	1.98
2	4	2009-01-02 00:00:00	Ullevålsveien 14	Oslo	None	Norway	0171	3.96
3	8	2009-01-03 00:00:00	Grétrystraat 63	Brussels	None	Belgium	1000	5.94
*/
Thought:The `Invoice` table has a column named `BillingCountry`, which seems to contain the country information for each sale. I will now write a SQL query to get the total sales per country and order them in descending order of total sales to find out which country's customers spent the most.Query: SELECT BillingCountry, SUM(Total) as TotalSales FROM Invoice GROUP BY BillingCountry ORDER BY TotalSales DESC;
Action: sql_db_query_checker
Action Input: "SELECT BillingCountry, SUM(Total) as TotalSales FROM Invoice GROUP BY BillingCountry ORDER BY TotalSales DESC;"
Observation: SELECT BillingCountry, SUM(Total) as TotalSales FROM Invoice GROUP BY BillingCountry ORDER BY TotalSales DESC;The given SQLite query does not contain any of the common mistakes mentioned. Therefore, I am reproducing the original query below:SELECT BillingCountry, SUM(Total) as TotalSales FROM Invoice GROUP BY BillingCountry ORDER BY TotalSales DESC;
Thought:I now have a syntactically correct SQL query to find out which country's customers spent the most. I will execute this query and return the result.Action: sql_db_query
Action Input: "SELECT BillingCountry, SUM(Total) as TotalSales FROM Invoice GROUP BY BillingCountry ORDER BY TotalSales DESC;"
Observation: [('USA', 523.0600000000003), ('Canada', 303.9599999999999), ('France', 195.09999999999994), ('Brazil', 190.09999999999997), ('Germany', 156.48), ('United Kingdom', 112.85999999999999), ('Czech Republic', 90.24000000000001), ('Portugal', 77.23999999999998), ('India', 75.25999999999999), ('Chile', 46.62), ('Ireland', 45.62), ('Hungary', 45.62), ('Austria', 42.62), ('Finland', 41.620000000000005), ('Netherlands', 40.62), ('Norway', 39.62), ('Sweden', 38.620000000000005), ('Poland', 37.620000000000005), ('Italy', 37.620000000000005), ('Denmark', 37.620000000000005), ('Australia', 37.620000000000005), ('Argentina', 37.620000000000005), ('Spain', 37.62), ('Belgium', 37.62)]
Thought:I now know the final answer
Final Answer: Customers from the USA spent the most with a total of $523.06, followed by customers from Canada who spent $303.96, and customers from France who spent $195.10.> Finished chain.

最后输出结果,

'Customers from the USA spent the most with a total of $523.06, followed by customers from Canada who spent $303.96, and customers from France who spent $195.10.'

2-7. 第4个测试 - 运行查询​2

agent_executor.run("Show the total number of tracks in each playlist. The Playlist name should be included in the result."
)

执行过程,

> Entering new AgentExecutor chain...
Action: sql_db_list_tables
Action Input: ""
Observation: Album, Artist, Customer, Employee, Genre, Invoice, InvoiceLine, MediaType, Playlist, PlaylistTrack, Track
Thought:The `Playlist` and `PlaylistTrack` tables seem relevant. I should query their schema to see what columns they have.
Action: sql_db_schema
Action Input: Playlist, PlaylistTrack
Observation: 
CREATE TABLE "Playlist" ("PlaylistId" INTEGER NOT NULL, "Name" NVARCHAR(120), PRIMARY KEY ("PlaylistId")
)/*
3 rows from Playlist table:
PlaylistId	Name
1	Music
2	Movies
3	TV Shows
*/CREATE TABLE "PlaylistTrack" ("PlaylistId" INTEGER NOT NULL, "TrackId" INTEGER NOT NULL, PRIMARY KEY ("PlaylistId", "TrackId"), FOREIGN KEY("TrackId") REFERENCES "Track" ("TrackId"), FOREIGN KEY("PlaylistId") REFERENCES "Playlist" ("PlaylistId")
)/*
3 rows from PlaylistTrack table:
PlaylistId	TrackId
1	3402
1	3389
1	3390
*/
Thought:I can construct a SQL query to join the `Playlist` and `PlaylistTrack` tables on their common column `PlaylistId`, then group by the `Name` column in the `Playlist` table to get the total number of tracks in each playlist. I should double check this query before executing it.
Action: sql_db_query_checker
Action Input: SELECT Playlist.Name, COUNT(PlaylistTrack.TrackId) FROM Playlist INNER JOIN PlaylistTrack ON Playlist.PlaylistId = PlaylistTrack.PlaylistId GROUP BY Playlist.Name
Observation: SELECT Playlist.Name, COUNT(PlaylistTrack.TrackId) FROM Playlist 
INNER JOIN PlaylistTrack ON Playlist.PlaylistId = PlaylistTrack.PlaylistId 
GROUP BY Playlist.NameThe SQL query above does not contain any of the common mistakes listed. Therefore, I will reproduce the original query as the final SQL query:SELECT Playlist.Name, COUNT(PlaylistTrack.TrackId) FROM Playlist 
INNER JOIN PlaylistTrack ON Playlist.PlaylistId = PlaylistTrack.PlaylistId 
GROUP BY Playlist.Name
Thought:I can now execute the final SQL query to get the answer.
Action: sql_db_query
Action Input: SELECT Playlist.Name, COUNT(PlaylistTrack.TrackId) FROM Playlist INNER JOIN PlaylistTrack ON Playlist.PlaylistId = PlaylistTrack.PlaylistId GROUP BY Playlist.Name
Observation: [('90’s Music', 1477), ('Brazilian Music', 39), ('Classical', 75), ('Classical 101 - Deep Cuts', 25), ('Classical 101 - Next Steps', 25), ('Classical 101 - The Basics', 25), ('Grunge', 15), ('Heavy Metal Classic', 26), ('Music', 6580), ('Music Videos', 1), ('On-The-Go 1', 1), ('TV Shows', 426)]
Thought:I now know the final answer.
Final Answer: Here are the total number of tracks in each playlist with their respective names: [('90’s Music', 1477), ('Brazilian Music', 39), ('Classical', 75), ('Classical 101 - Deep Cuts', 25), ('Classical 101 - Next Steps', 25), ('Classical 101 - The Basics', 25), ('Grunge', 15), ('Heavy Metal Classic', 26), ('Music', 6580), ('Music Videos', 1), ('On-The-Go 1', 1), ('TV Shows', 426)]> Finished chain.

最后输出结果,

"Here are the total number of tracks in each playlist with their respective names: [('90’s Music', 1477), ('Brazilian Music', 39), ('Classical', 75), ('Classical 101 - Deep Cuts', 25), ('Classical 101 - Next Steps', 25), ('Classical 101 - The Basics', 25), ('Grunge', 15), ('Heavy Metal Classic', 26), ('Music', 6580), ('Music Videos', 1), ('On-The-Go 1', 1), ('TV Shows', 426)]"

2-8. 第5个测试 - 从错误中恢复

agent_executor.run("Who are the top 3 best selling artists?")

执行过程,

> Entering new AgentExecutor chain...
Action: sql_db_list_tables
Action Input: ""
Observation: Album, Artist, Customer, Employee, Genre, Invoice, InvoiceLine, MediaType, Playlist, PlaylistTrack, Track
Thought:The 'Artist' and 'Invoice' tables seem relevant. I should query their schema to see what columns they have.
Action: sql_db_schema
Action Input: Artist, Invoice
Observation: 
CREATE TABLE "Artist" ("ArtistId" INTEGER NOT NULL, "Name" NVARCHAR(120), PRIMARY KEY ("ArtistId")
)/*
3 rows from Artist table:
ArtistId	Name
1	AC/DC
2	Accept
3	Aerosmith
*/CREATE TABLE "Invoice" ("InvoiceId" INTEGER NOT NULL, "CustomerId" INTEGER NOT NULL, "InvoiceDate" DATETIME NOT NULL, "BillingAddress" NVARCHAR(70), "BillingCity" NVARCHAR(40), "BillingState" NVARCHAR(40), "BillingCountry" NVARCHAR(40), "BillingPostalCode" NVARCHAR(10), "Total" NUMERIC(10, 2) NOT NULL, PRIMARY KEY ("InvoiceId"), FOREIGN KEY("CustomerId") REFERENCES "Customer" ("CustomerId")
)/*
3 rows from Invoice table:
InvoiceId	CustomerId	InvoiceDate	BillingAddress	BillingCity	BillingState	BillingCountry	BillingPostalCode	Total
1	2	2009-01-01 00:00:00	Theodor-Heuss-Straße 34	Stuttgart	None	Germany	70174	1.98
2	4	2009-01-02 00:00:00	Ullevålsveien 14	Oslo	None	Norway	0171	3.96
3	8	2009-01-03 00:00:00	Grétrystraat 63	Brussels	None	Belgium	1000	5.94
*/
Thought:The 'Artist' table has an 'ArtistId' and a 'Name' column, but it doesn't seem to have any information about sales. The 'Invoice' table has an 'InvoiceId', 'CustomerId', 'InvoiceDate', 'BillingAddress', 'BillingCity', 'BillingState', 'BillingCountry', 'BillingPostalCode', and 'Total' column, but it also doesn't seem to have any information about artists. I need to find a table that links artists to invoices or sales.Action: sql_db_schema
Action Input: InvoiceLine
Observation: 
CREATE TABLE "InvoiceLine" ("InvoiceLineId" INTEGER NOT NULL, "InvoiceId" INTEGER NOT NULL, "TrackId" INTEGER NOT NULL, "UnitPrice" NUMERIC(10, 2) NOT NULL, "Quantity" INTEGER NOT NULL, PRIMARY KEY ("InvoiceLineId"), FOREIGN KEY("TrackId") REFERENCES "Track" ("TrackId"), FOREIGN KEY("InvoiceId") REFERENCES "Invoice" ("InvoiceId")
)/*
3 rows from InvoiceLine table:
InvoiceLineId	InvoiceId	TrackId	UnitPrice	Quantity
1	1	2	0.99	1
2	1	4	0.99	1
3	2	6	0.99	1
*/
Thought:The 'InvoiceLine' table seems to link invoices to tracks, and the 'Track' table might have information about artists. I should query the schema of the 'Track' table to see what columns it has.Action: sql_db_schema
Action Input: Track
Observation: 
CREATE TABLE "Track" ("TrackId" INTEGER NOT NULL, "Name" NVARCHAR(200) NOT NULL, "AlbumId" INTEGER, "MediaTypeId" INTEGER NOT NULL, "GenreId" INTEGER, "Composer" NVARCHAR(220), "Milliseconds" INTEGER NOT NULL, "Bytes" INTEGER, "UnitPrice" NUMERIC(10, 2) NOT NULL, PRIMARY KEY ("TrackId"), FOREIGN KEY("MediaTypeId") REFERENCES "MediaType" ("MediaTypeId"), FOREIGN KEY("GenreId") REFERENCES "Genre" ("GenreId"), FOREIGN KEY("AlbumId") REFERENCES "Album" ("AlbumId")
)/*
3 rows from Track table:
TrackId	Name	AlbumId	MediaTypeId	GenreId	Composer	Milliseconds	Bytes	UnitPrice
1	For Those About To Rock (We Salute You)	1	1	1	Angus Young, Malcolm Young, Brian Johnson	343719	11170334	0.99
2	Balls to the Wall	2	2	1	None	342562	5510424	0.99
3	Fast As a Shark	3	2	1	F. Baltes, S. Kaufman, U. Dirkscneider & W. Hoffman	230619	3990994	0.99
*/
Thought:The 'Track' table has a 'TrackId', 'Name', 'AlbumId', 'MediaTypeId', 'GenreId', 'Composer', 'Milliseconds', 'Bytes', and 'UnitPrice' column, but it doesn't seem to have any information about artists. However, the 'ArtistId' from the 'Artist' table is not present in any of the tables I have queried so far. It seems like there might not be a direct link between the artists and their sales.In this case, I can provide the top 3 best-selling tracks instead of artists, as it is the closest information I can extract from the schema provided.Question: Who are the top 3 best selling artists?
Thought: It seems like there isn't a direct link between the artists and their sales in the database schema. I will provide the top 3 best-selling tracks instead.
Final Answer: Here are the top 3 best-selling tracks:> Finished chain.

最后输出结果(实际没有输出正确的结果),

'Here are the top 3 best-selling tracks:'

3. 结论

从执行过程可知,SQLDatabaseToolkit 有下面 4 个预置 Agent,根据我们发送的消息,调用相应的 Agent,查看数据库中有什么表,将要使用的表有什么字段,然后根据自然语言的消息,生成 SQL 语句,并且进行生成的 SQL。

sql_db_query, sql_db_schema, sql_db_list_tables, sql_db_query_checker

从执行过程可知,在我们发送的信息还比较 “靠谱” 的情况,大概率是能够得到正确的结果的。如果我们发送的信息 “不靠谱” 的情况,大语言模型就不一定给我们反馈什么结果了。

完结!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/823636.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

【动态规划精选题目】3、简单多状态模型

此动态规划系列主要讲解大约10个系列【后续持续更新】 本篇讲解简单多状态模型中的9道经典题,会在讲解题目同时给出AC代码 目录 1、按摩师 2、力扣198:打家劫舍1 3、打家劫舍II 4、删除并获得点数 5、 粉刷房子 6、力扣309:买卖股票的最佳时机含冷冻期 7、 买…

Spring-4-代理

前面提到过,在Spring中有两种类型的代理:使用JDK Proxy类创建的JDK代理以及使用CGLIB Enhancer类创建的基于CGLIB的代理。 你可能想知道这两种代理之间有什么区别,以及为什么 Spring需要两种代理类型。 在本节中,将详细研究代理…

基于策略模式和简单工厂模式实现zip、tar、rar、7z四种压缩文件格式的解压

推荐语 这篇技术文章深入探讨了基于策略模式和简单工厂模式实现四种常见压缩文件格式的解压方法。通过阅读该文章,你将了解到如何利用这两种设计模式来实现灵活、可扩展的解压功能,同时适应不同的压缩文件格式。如果你对设计模式和文件处理感兴趣或刚好…

【JavaEE进阶】 @RequestMapping注解

文章目录 🎄什么是RequestMapping 注解🌳RequestMapping 使⽤🌲RequestMapping 是GET还是POST请求?🚩使用Postman构造POST请求 ⭕总结 🎄什么是RequestMapping 注解 在Spring MVC 中使⽤ RequestMapping 来…

基于Mapify的在线艺术地图设计

地图是传递空间信息的有效载体,更加美观、生动的地图产品也是我们追求目标。 那么,我们如何才能制出如下图所示这样一幅艺术性较高的地图呢?今天我们来一探究竟吧! 按照惯例,现将网址给出: https://www.m…

PathWave Device Modeling (IC-CAP) 建模系统——IC-CAP概述

建模系统 PathWave Device Modeling(IC-CAP)建模系统用于测量半导体器件并分析器件的电路建模特性以及分析所得数据。 要使用PathWave Device Modeling(IC-CAP),您需要以下设置: 一台工作站执行直流、电…

【rosbag】rosbag命令--查看提取bag中的内容

1.查看消息 rosbag info --.bag topics是其中的话题内容,/imu中只写了包含imu的数据,但是imu是9轴的,到底磁力计信息是否包含在其中呢? 2.将bag中的某个话题转为txt 将file_name.bag文件中topic_name话题的消息转换到Txt_name.…

java中的缓冲类HeapByteBuffer和DirectByteBuffer的区别

使用之前写的文章里的例子 https://blog.csdn.net/zlpzlpzyd/article/details/135292683 HeapByteBuffer import java.io.File; import java.io.FileInputStream; import java.io.Serializable; import java.nio.ByteBuffer; import java.nio.channels.FileChannel;public clas…

Linux升级指南:保持系统安全和高效运行

Linux系统的升级是确保系统稳定和安全性的重要步骤。本文将介绍Linux系统升级的基本概念,以及具体的操作步骤和注意事项,以帮助用户顺利升级他们的Linux系统。 Linux操作系统以其稳定性和可定制性而闻名,它经常通过升级来提供新的功能、修复漏…

【论文笔记】Radar Fields: An Extension of Radiance Fields to SAR

原文链接:https://arxiv.org/abs/2312.12961 1. 引言 本文针对合成孔径雷达(SAR)的3D重建,提出雷达场,基于多个SAR对场景的测量学习体积模型。 3. 辐射场的介绍 NeRF将静态场景表达为连续的体积函数 F \mathcal{F}…

服装店收银系统 助力完善线上线下方案

一个服装店收银系统可以助力完善线上线下方案,提供以下功能和优势: 1. 销售管理:收银系统可以记录每笔销售订单的详细信息,包括商品名称、价格、数量等,方便店主进行销售统计和分析。 2. 库存管理:收银系统…

Android 理解Context

文章目录 Android 理解ContextContext是什么Activity能直接new吗? Context结构和源码一个程序有几个ContextContext的作用Context作用域获取ContextgetApplication()和getApplicationContext()区别Context引起的内存泄露错误的单例模式View持有Activity应用正确使用…

【C语言】数据结构——带头双链表实例探究

💗个人主页💗 ⭐个人专栏——数据结构学习⭐ 💫点击关注🤩一起学习C语言💯💫 目录 导读:1. 双链表结构特征2. 实现双向循环链表2.1 定义结构体2.2 创造节点2.3 双向链表初始化2.4 双向链表打印2…

【数据库系统概论】第7章-数据库设计

文章目录 7.1 数据库设计概述7.2 需求分析7.2.1 需求分析的任务7.2.2 需求分析的难点7.2.2 需求分析的方法7.2.3 数据字典 7.3 概念结构设计7.3.1 概念模型7.3.2 E-R模型7.3.3 概念结构设计 7.4 逻辑结构设计7.4.1 E-R图向关系模型的转换7.4.2 数据模型的优化7.4.3 设计用户子模…

PowerShell Instal 一键部署gitea

gitea 前言 Gitea 是一个轻量级的 DevOps 平台软件。从开发计划到产品成型的整个软件生命周期,他都能够高效而轻松的帮助团队和开发者。包括 Git 托管、代码审查、团队协作、软件包注册和 CI/CD。它与 GitHub、Bitbucket 和 GitLab 等比较类似。 Gitea 最初是从 Gogs 分支而来…

QT上位机开发(倒计时软件)

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing 163.com】 倒计时软件是生活中经常遇到的一种场景。比如运动跑步,比如学校考试,比如论文答辩等等,只要有时间限制规定的地…

21 UVM printer

uvm_printer 类提供了以不同格式打印 uvm_objects 的灵活性。我们已经讨论了使用 uvm_field_* 宏的 print() 方法,或者如果不使用 utils_begin/ end 宏,则编写 do_print() 方法。 UVM printer提供四种内置printer。 uvm_printeruvm_table_printeruvm_t…

Git:远程仓库的使用

查看当前的远程库 要查看当前配置有哪些远程仓库,可以用git remote 命令,它会列出每个远程库的简短名字。在克隆完某个项目后,至少可以看到一个名为origin 的远程库,Git 默认使用这个名字来标识你所克隆的原始仓库: 也…

DM达梦数据库表占用空间大小

问题描述: 项目涉及用户量大且数据量大,为提高查询性能采用分表方式处理数据;根据业务要求总共4张业务表,每张业务表扩展成100张表,系统中总共400张表。部署至测试环境发现测试环境占用的磁盘空间是开发环境的8倍。 问…

从程序员到项目经理

前言 看到这个话题,博主不禁有感而发。那么就简单讲讲,从程序员到项目经理,需要具备哪些必备能力或基本的素养。 一、必备 1、技术能力 程序员首先必须成为一个名合格的coder,有思想有见解有态度。 无论身处什么开发岗位&…