当前位置: 首页 > news >正文

LlamaIndex 组件 - Storing

文章目录

    • 一、储存概览
      • 1、概念
      • 2、使用模式
      • 3、模块
    • 二、Vector Stores
      • 1、简单向量存储
      • 2、矢量存储选项和功能支持
      • 3、Example Notebooks
    • 三、文件存储
      • 1、简单文档存储
      • 2、MongoDB 文档存储
      • 3、Redis 文档存储
      • 4、Firestore 文档存储
    • 四、索引存储
      • 1、简单索引存储
      • 2、MongoDB 索引存储
      • 3、Redis索引存储
    • 五、Chat Stores
      • 1、简单聊天商店
      • 2、Redis聊天商店
    • 六、键值存储
    • 七、保存和加载数据
      • 1、持久化数据
      • 2、加载数据中
      • 3、使用远程后端
    • 八、自定义存储
      • 低级API
      • 矢量存储集成和存储


本文转载改编自: https://docs.llamaindex.ai/en/stable/module_guides/storing/


一、储存概览


1、概念

LlamaIndex 提供了一个用于摄取、索引和查询外部数据的高级接口。

在底层,LlamaIndex 还支持可交换存储组件,允许您自定义:

  • 文档存储Node:存储摄取的文档(即对象)的地方,
  • 索引存储:存储索引元数据的位置,
  • 向量存储:存储嵌入向量的位置。
  • 图存储:存储知识图的位置(即 for KnowledgeGraphIndex)。
  • 聊天存储:存储和组织聊天消息的地方。

文档/索引存储依赖于通用的键值存储抽象,这也在下面详细介绍。


LlamaIndex 支持将数据持久保存到fsspec支持的任何存储后端。我们已确认支持以下存储后端:

  • 本地文件系统
  • AWS S3
  • Cloudflare R2

在这里插入图片描述


2、使用模式

许多向量存储(FAISS 除外)将存储数据和索引(嵌入)。

这意味着您不需要使用单独的文档存储或索引存储。

这也意味着您不需要显式地保留这些数据——这会自动发生。用法如下所示来构建新索引/重新加载现有索引。

## build a new index
from llama_index.core import VectorStoreIndex, StorageContext
from llama_index.vector_stores.deeplake import DeepLakeVectorStore# construct vector store and customize storage context
vector_store = DeepLakeVectorStore(dataset_path="<dataset_path>")
storage_context = StorageContext.from_defaults(vector_store=vector_store)
# Load documents and build index
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context
)***
## reload an existing one
index = VectorStoreIndex.from_vector_store(vector_store=vector_store)

有关更多详细信息,请参阅下面的矢量存储模块指南。

请注意,通常要使用存储抽象,您需要定义一个StorageContext对象:

from llama_index.core.storage.docstore import SimpleDocumentStore
from llama_index.core.storage.index_store import SimpleIndexStore
from llama_index.core.vector_stores import SimpleVectorStore
from llama_index.core import StorageContext# create storage context using default stores
storage_context = StorageContext.from_defaults(docstore=SimpleDocumentStore(),vector_store=SimpleVectorStore(),index_store=SimpleIndexStore(),
)

有关自定义/持久性的更多详细信息可以在下面的指南中找到。

  • 定制化
  • 保存/加载

3、模块

我们提供有关不同存储组件的深入指南。

  • Vector Stores
  • Docstores
  • Index Stores
  • Key-Val Stores
  • Graph Stores
  • ChatStores

二、Vector Stores

向量存储包含所摄取文档块(有时也包含文档块)的嵌入向量。


1、简单向量存储

默认情况下,LlamaIndex 使用简单的内存向量存储,非常适合快速实验。它们可以通过调用vector_store.persist()(分别)保存到磁盘(并从磁盘加载)SimpleVectorStore.from_persist_path(...)


2、矢量存储选项和功能支持

LlamaIndex 支持 20 多种不同的矢量存储选项。我们正在积极添加更多集成并提高每个集成的功能覆盖范围。

Vector StoreTypeMetadata FilteringHybrid SearchDeleteStore DocumentsAsync
Apache Cassandra®self-hosted / cloud
Astra DBcloud
Azure AI Searchcloud
Azure CosmosDB MongoDBcloud
BaiduVectorDBcloud
ChatGPT Retrieval Pluginaggregator
Chromaself-hosted
DashVectorcloud
Databrickscloud
Deeplakeself-hosted / cloud
DocArrayaggregator
DuckDBin-memory / self-hosted
DynamoDBcloud
Elasticsearchself-hosted / cloud
FAISSin-memory
txtaiin-memory
Jaguarself-hosted / cloud
LanceDBcloud
Lanternself-hosted / cloud
Metalcloud
MongoDB Atlasself-hosted / cloud
MyScalecloud
Milvus / Zillizself-hosted / cloud
Neo4jVectorself-hosted / cloud
OpenSearchself-hosted / cloud
Pineconecloud
Postgresself-hosted / cloud
pgvecto.rsself-hosted / cloud
Qdrantself-hosted / cloud
Redisself-hosted / cloud
Simplein-memory
SingleStoreself-hosted / cloud
Supabaseself-hosted / cloud
Taircloud
TiDBcloud
TencentVectorDBcloud
Timescale
Typesenseself-hosted / cloud
Upstashcloud
Weaviateself-hosted / cloud

有关更多详细信息,请参阅矢量存储集成。


3、Example Notebooks

  • Astra DB
  • Async Index Creation
  • Azure AI Search
  • Azure Cosmos DB
  • Baidu
  • Caasandra
  • Chromadb
  • Dash
  • Databricks
  • Deeplake
  • DocArray HNSW
  • DocArray in-Memory
  • DuckDB
  • Espilla
  • Jaguar
  • LanceDB
  • Lantern
  • Metal
  • Milvus
  • MyScale
  • ElsaticSearch
  • FAISS
  • MongoDB Atlas
  • Neo4j
  • OpenSearch
  • Pinecone
  • Pinecone Hybrid Search
  • PGvectoRS
  • Postgres
  • Redis
  • Qdrant
  • Qdrant Hybrid Search
  • Rockset
  • Simple
  • Supabase
  • Tair
  • TiDB
  • Tencent
  • Timesacle
  • Upstash
  • Weaviate
  • Weaviate Hybrid Search
  • Zep

三、文件存储

文档存储包含摄取的文档块,我们将其称为Node对象。

有关更多详细信息,请参阅API 参考。


1、简单文档存储

默认情况下,将对象SimpleDocumentStore存储Node在内存中。它们可以通过调用docstore.persist()(分别)保存到磁盘(并从磁盘加载)SimpleDocumentStore.from_persist_path(...)

可以在这里找到更完整的示例


2、MongoDB 文档存储

我们支持 MongoDB 作为替代文档存储后端,在Node摄取对象时保留数据。

from llama_index.storage.docstore.mongodb import MongoDocumentStore
from llama_index.core.node_parser import SentenceSplitter# create parser and parse document into nodes
parser = SentenceSplitter()
nodes = parser.get_nodes_from_documents(documents)# create (or load) docstore and add nodes
docstore = MongoDocumentStore.from_uri(uri="<mongodb+srv://...>")
docstore.add_documents(nodes)# create storage context
storage_context = StorageContext.from_defaults(docstore=docstore)# build index
index = VectorStoreIndex(nodes, storage_context=storage_context)

在后台,MongoDocumentStore连接到固定的 MongoDB 数据库并为节点初始化新集合(或加载现有集合)。

注意:您可以在实例化时配置db_name和,否则它们默认为和。namespace``MongoDocumentStore``db_name="db_docstore"``namespace="docstore"

请注意,使用 an 时无需调用storage_context.persist()(或) ,因为默认情况下数据是持久保存的。docstore.persist()``MongoDocumentStore

MongoDocumentStore您可以轻松地重新连接到 MongoDB 集合并通过使用现有的db_name和重新初始化 来重新加载索引collection_name

可以在这里找到更完整的示例


3、Redis 文档存储

我们支持 Redis 作为替代文档存储后端,在Node摄取对象时保留数据。

from llama_index.storage.docstore.redis import RedisDocumentStore
from llama_index.core.node_parser import SentenceSplitter# create parser and parse document into nodes
parser = SentenceSplitter()
nodes = parser.get_nodes_from_documents(documents)# create (or load) docstore and add nodes
docstore = RedisDocumentStore.from_host_and_port(host="127.0.0.1", port="6379", namespace="llama_index"
)
docstore.add_documents(nodes)# create storage context
storage_context = StorageContext.from_defaults(docstore=docstore)# build index
index = VectorStoreIndex(nodes, storage_context=storage_context)

在后台,RedisDocumentStore连接到 redis 数据库并将节点添加到存储在{namespace}/docs.

namespace注意:实例化时可以配置RedisDocumentStore,否则默认namespace="docstore"

RedisDocumentStore您可以轻松地重新连接到 Redis 客户端并通过使用现有的hostport和重新初始化 来重新加载索引namespace

可以在这里找到更完整的示例


4、Firestore 文档存储

我们支持 Firestore 作为替代文档存储后端,在Node摄取对象时保留数据。

from llama_index.storage.docstore.firestore import FirestoreDocumentStore
from llama_index.core.node_parser import SentenceSplitter# create parser and parse document into nodes
parser = SentenceSplitter()
nodes = parser.get_nodes_from_documents(documents)# create (or load) docstore and add nodes
docstore = FirestoreDocumentStore.from_database(project="project-id",database="(default)",
)
docstore.add_documents(nodes)# create storage context
storage_context = StorageContext.from_defaults(docstore=docstore)# build index
index = VectorStoreIndex(nodes, storage_context=storage_context)

在后台,FirestoreDocumentStore连接到 Google Cloud 中的 firestore 数据库,并将您的节点添加到存储在{namespace}/docs.

namespace注意:实例化时可以配置FirestoreDocumentStore,否则默认namespace="docstore"

FirestoreDocumentStore您可以轻松地重新连接到 Firestore 数据库并通过使用现有的projectdatabase和重新初始化 来重新加载索引namespace

可以在这里找到更完整的示例


四、索引存储

索引存储包含轻量级索引元数据(即构建索引时创建的附加状态信息)。

有关更多详细信息,请参阅API 参考。


1、简单索引存储

默认情况下,LlamaIndex 使用由内存中键值存储支持的简单索引存储。它们可以通过调用index_store.persist()(分别)保存到磁盘(并从磁盘加载)SimpleIndexStore.from_persist_path(...)


2、MongoDB 索引存储

与文档存储类似,我们也可以将其用作MongoDB索引存储的存储后端。

from llama_index.storage.index_store.mongodb import MongoIndexStore
from llama_index.core import VectorStoreIndex# create (or load) index store
index_store = MongoIndexStore.from_uri(uri="<mongodb+srv://...>")# create storage context
storage_context = StorageContext.from_defaults(index_store=index_store)# build index
index = VectorStoreIndex(nodes, storage_context=storage_context)# or alternatively, load index
from llama_index.core import load_index_from_storageindex = load_index_from_storage(storage_context)

在后台,MongoIndexStore连接到固定的 MongoDB 数据库并为索引元数据初始化新集合(或加载现有集合)。

注意:您可以在实例化时配置db_name和,否则它们默认为和。namespace``MongoIndexStore``db_name="db_docstore"``namespace="docstore"

请注意,使用 an 时无需调用storage_context.persist()(或) ,因为默认情况下数据是持久保存的。index_store.persist()``MongoIndexStore

MongoIndexStore您可以轻松地重新连接到 MongoDB 集合并通过使用现有的db_name和重新初始化 来重新加载索引collection_name

可以在这里找到更完整的示例


3、Redis索引存储

我们支持 Redis 作为替代文档存储后端,在Node摄取对象时保留数据。

from llama_index.storage.index_store.redis import RedisIndexStore
from llama_index.core import VectorStoreIndex# create (or load) docstore and add nodes
index_store = RedisIndexStore.from_host_and_port(host="127.0.0.1", port="6379", namespace="llama_index"
)# create storage context
storage_context = StorageContext.from_defaults(index_store=index_store)# build index
index = VectorStoreIndex(nodes, storage_context=storage_context)# or alternatively, load index
from llama_index.core import load_index_from_storageindex = load_index_from_storage(storage_context)

在后台,RedisIndexStore连接到 redis 数据库并将节点添加到存储在{namespace}/index.

namespace注意:实例化时可以配置RedisIndexStore,否则默认namespace="index_store"

RedisIndexStore您可以轻松地重新连接到 Redis 客户端并通过使用现有的hostport和重新初始化 来重新加载索引namespace

可以在这里找到更完整的示例


五、Chat Stores

聊天存储充当存储您的聊天历史记录的集中式界面。与其他存储格式相比,聊天历史记录是独一无二的,因为消息的顺序对于维持整体对话非常重要。

user_ids聊天存储可以通过键(如或其他唯一可识别字符串)组织聊天消息序列,并处理deleteinsert、 和get操作。


1、简单聊天商店

最基本的聊天存储是SimpleChatStore,它将消息存储在内存中,并且可以保存到磁盘或从磁盘保存,也可以序列化并存储在其他地方。

通常,您将实例化一个聊天存储并将其提供给内存模块。SimpleChatStore如果未提供,则使用聊天存储的内存模块将默认使用。

from llama_index.core.storage.chat_store import SimpleChatStore
from llama_index.core.memory import ChatMemoryBufferchat_store = SimpleChatStore()chat_memory = ChatMemoryBuffer.from_defaults(token_limit=3000,chat_store=chat_store,chat_store_key="user1",
)

创建内存后,您可以将其包含在代理或聊天引擎中:

agent = OpenAIAgent.from_tools(tools, memory=memory)
# OR
chat_engine = index.as_chat_engine(memory=memory)

要保存聊天存储供以后使用,您可以从磁盘保存/加载

chat_store.persist(persist_path="chat_store.json")
loaded_chat_store = SimpleChatStore.from_persist_path(persist_path="chat_store.json"
)

或者您可以与字符串进行转换,同时将字符串保存在其他位置

chat_store_string = chat_store.json()
loaded_chat_store = SimpleChatStore.parse_raw(chat_store_string)

2、Redis聊天商店

使用RedisChatStore,您可以远程存储聊天记录,而不必担心手动保存和加载聊天记录。

from llama_index.storage.chat_store.redis import RedisChatStore
from llama_index.core.memory import ChatMemoryBufferchat_store = RedisChatStore(redis_url="redis://localhost:6379", ttl=300)chat_memory = ChatMemoryBuffer.from_defaults(token_limit=3000,chat_store=chat_store,chat_store_key="user1",
)

六、键值存储

键值存储是为我们的文档存储和索引存储提供支持的底层存储抽象。

我们提供以下键值存储:

  • 简单键值存储:内存中的 KV 存储。用户可以选择调用persist这个kv存储来将数据保存到磁盘。
  • MongoDB 键值存储:MongoDB KV 存储。

有关更多详细信息,请参阅API 参考。

注意:目前,这些存储抽象不面向外部。


七、保存和加载数据

1、持久化数据

默认情况下,LlamaIndex 将数据存储在内存中,如果需要,可以显式保留该数据:

storage_context.persist(persist_dir="<persist_dir>")

这将根据指定persist_dir(或./storage默认)将数据保存到磁盘。

假设您跟踪要加载的索引 ID,则可以保留多个索引并从同一目录加载多个索引。

用户还可以配置MongoDB默认保存数据的替代存储后端(例如)。在这种情况下,调用storage_context.persist()将不会执行任何操作。


2、加载数据中

要加载数据,用户只需使用相同的配置重新创建存储上下文(例如传入相同的persist_dir或向量存储客户端)。

storage_context = StorageContext.from_defaults(docstore=SimpleDocumentStore.from_persist_dir(persist_dir="<persist_dir>"),vector_store=SimpleVectorStore.from_persist_dir(persist_dir="<persist_dir>"),index_store=SimpleIndexStore.from_persist_dir(persist_dir="<persist_dir>"),
)

StorageContext然后我们可以通过下面的一些便利函数加载特定的索引。

from llama_index.core import (load_index_from_storage,load_indices_from_storage,load_graph_from_storage,
)# load a single index
# need to specify index_id if multiple indexes are persisted to the same directory
index = load_index_from_storage(storage_context, index_id="<index_id>")# don't need to specify index_id if there's only one index in storage context
index = load_index_from_storage(storage_context)# load multiple indices
indices = load_indices_from_storage(storage_context)  # loads all indices
indices = load_indices_from_storage(storage_context, index_ids=[index_id1, ...]
)  # loads specific indices# load composable graph
graph = load_graph_from_storage(storage_context, root_id="<root_id>"
)  # loads graph with the specified root_id

3、使用远程后端

默认情况下,LlamaIndex 使用本地文件系统来加载和保存文件。但是,您可以通过传递对象来覆盖它fsspec.AbstractFileSystem

这是一个简单的例子,实例化一个向量存储:

import dotenv
import s3fs
import osdotenv.load_dotenv("../../../.env")# load documents
documents = SimpleDirectoryReader("../../../examples/paul_graham_essay/data/"
).load_data()
print(len(documents))
index = VectorStoreIndex.from_documents(documents)

至此,一切都已经是一样了。现在 - 让我们实例化一个 S3 文件系统并从那里保存/加载。

# set up s3fs
AWS_KEY = os.environ["AWS_ACCESS_KEY_ID"]
AWS_SECRET = os.environ["AWS_SECRET_ACCESS_KEY"]
R2_ACCOUNT_ID = os.environ["R2_ACCOUNT_ID"]assert AWS_KEY is not None and AWS_KEY != ""s3 = s3fs.S3FileSystem(key=AWS_KEY,secret=AWS_SECRET,endpoint_url=f"https://{R2_ACCOUNT_ID}.r2.cloudflarestorage.com",s3_additional_kwargs={"ACL": "public-read"},
)# If you're using 2+ indexes with the same StorageContext,
# run this to save the index to remote blob storage
index.set_index_id("vector_index")# persist index to s3
s3_bucket_name = "llama-index/storage_demo"  # {bucket_name}/{index_name}
index.storage_context.persist(persist_dir=s3_bucket_name, fs=s3)# load index from s3
index_from_s3 = load_index_from_storage(StorageContext.from_defaults(persist_dir=s3_bucket_name, fs=s3),index_id="vector_index",
)

默认情况下,如果您不传递文件系统,我们将假定本地文件系统。


八、自定义存储

默认情况下,LlamaIndex 隐藏了复杂性,让您可以用不到 5 行代码查询数据:

from llama_index.core import VectorStoreIndex, SimpleDirectoryReaderdocuments = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("Summarize the documents.")

在底层,LlamaIndex 还支持可交换的存储层,允许您自定义提取的文档(即Node对象)、嵌入向量和索引元数据的存储位置。

在这里插入图片描述


低级API

为此,无需使用高级 API,

index = VectorStoreIndex.from_documents(documents)

我们使用较低级别的 API 来提供更精细的控制:

from llama_index.core.storage.docstore import SimpleDocumentStore
from llama_index.core.storage.index_store import SimpleIndexStore
from llama_index.core.vector_stores import SimpleVectorStore
from llama_index.core.node_parser import SentenceSplitter# create parser and parse document into nodes
parser = SentenceSplitter()
nodes = parser.get_nodes_from_documents(documents)# create storage context using default stores
storage_context = StorageContext.from_defaults(docstore=SimpleDocumentStore(),vector_store=SimpleVectorStore(),index_store=SimpleIndexStore(),
)# create (or load) docstore and add nodes
storage_context.docstore.add_documents(nodes)# build index
index = VectorStoreIndex(nodes, storage_context=storage_context)# save index
index.storage_context.persist(persist_dir="<persist_dir>")# can also set index_id to save multiple indexes to the same folder
index.set_index_id("<index_id>")
index.storage_context.persist(persist_dir="<persist_dir>")# to load index later, make sure you setup the storage context
# this will loaded the persisted stores from persist_dir
storage_context = StorageContext.from_defaults(persist_dir="<persist_dir>")# then load the index object
from llama_index.core import load_index_from_storageloaded_index = load_index_from_storage(storage_context)# if loading an index from a persist_dir containing multiple indexes
loaded_index = load_index_from_storage(storage_context, index_id="<index_id>")# if loading multiple indexes from a persist dir
loaded_indicies = load_index_from_storage(storage_context, index_ids=["<index_id>", ...]
)

您可以通过一行更改来自定义底层存储,以实例化不同的文档存储、索引存储和向量存储。有关更多详细信息,请参阅文档存储、向量存储、索引存储指南。


矢量存储集成和存储

我们的大多数矢量存储集成将整个索引(矢量+文本)存储在矢量存储本身中。这样做的主要好处是不必显式地持久化索引,如上所示,因为矢量存储已经托管并将数据持久化在我们的索引中。

支持这种做法的矢量存储是:

  • AzureAISearchVectorStore
  • ChatGPTRetrievalPluginClient
  • CassandraVectorStore
  • ChromaVectorStore
  • EpsillaVectorStore
  • DocArrayHnswVectorStore
  • DocArrayInMemoryVectorStore
  • JaguarVectorStore
  • LanceDBVectorStore
  • MetalVectorStore
  • MilvusVectorStore
  • MyScaleVectorStore
  • OpensearchVectorStore
  • PineconeVectorStore
  • QdrantVectorStore
  • RedisVectorStore
  • UpstashVectorStore
  • WeaviateVectorStore

下面是一个使用 Pinecone 的小例子:

import pinecone
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llama_index.vector_stores.pinecone import PineconeVectorStore# Creating a Pinecone index
api_key = "api_key"
pinecone.init(api_key=api_key, environment="us-west1-gcp")
pinecone.create_index("quickstart", dimension=1536, metric="euclidean", pod_type="p1"
)
index = pinecone.Index("quickstart")# construct vector store
vector_store = PineconeVectorStore(pinecone_index=index)# create storage context
storage_context = StorageContext.from_defaults(vector_store=vector_store)# load documents
documents = SimpleDirectoryReader("./data").load_data()# create index, which will insert documents/vectors to pinecone
index = VectorStoreIndex.from_documents(documents, storage_context=storage_context
)

如果您有一个已加载数据的现有矢量存储,您可以连接到它并直接创建一个VectorStoreIndex,如下所示:

index = pinecone.Index("quickstart")
vector_store = PineconeVectorStore(pinecone_index=index)
loaded_index = VectorStoreIndex.from_vector_store(vector_store=vector_store)

2014-04-15(一)

相关文章:

LlamaIndex 组件 - Storing

文章目录 一、储存概览1、概念2、使用模式3、模块 二、Vector Stores1、简单向量存储2、矢量存储选项和功能支持3、Example Notebooks 三、文件存储1、简单文档存储2、MongoDB 文档存储3、Redis 文档存储4、Firestore 文档存储 四、索引存储1、简单索引存储2、MongoDB 索引存储…...

在Linux系统中设定延迟任务

一、在系统中设定延迟任务要求如下&#xff1a; 要求&#xff1a; 在系统中建立easylee用户&#xff0c;设定其密码为easylee 延迟任务由root用户建立 要求在5小时后备份系统中的用户信息文件到/backup中 确保延迟任务是使用非交互模式建立 确保系统中只有root用户和easylee用户…...

JVM之方法区的详细解析

方法区 方法区&#xff1a;是各个线程共享的内存区域&#xff0c;用于存储已被虚拟机加载的类信息、常量、即时编译器编译后的代码等数据&#xff0c;虽然 Java 虚拟机规范把方法区描述为堆的一个逻辑部分&#xff0c;但是也叫 Non-Heap&#xff08;非堆&#xff09; 设置方法…...

Go 使用ObjectID

ObjectID介绍 MongoDB中的ObjectId是一种特殊的12字节 BSON 类型数据&#xff0c;用于为主文档提供唯一的标识符&#xff0c;默认情况下作为 _id 字段的默认值出现在每一个MongoDB集合中的文档中。以下是ObjectId的具体组成&#xff1a; 1. 时间戳&#xff08;Timestamp&…...

基于SpringBoot+Vue的疾病防控系统设计与实现(源码+文档+包运行)

一.系统概述 在如今社会上&#xff0c;关于信息上面的处理&#xff0c;没有任何一个企业或者个人会忽视&#xff0c;如何让信息急速传递&#xff0c;并且归档储存查询&#xff0c;采用之前的纸张记录模式已经不符合当前使用要求了。所以&#xff0c;对疾病防控信息管理的提升&a…...

2024年阿里云4核8G配置云服务器价格低性能高!

阿里云4核8G服务器租用优惠价格700元1年&#xff0c;配置为ECS通用算力型u1实例&#xff08;ecs.u1-c1m2.xlarge&#xff09;4核8G配置、1M到3M带宽可选、ESSD Entry系统盘20G到40G可选&#xff0c;CPU采用Intel(R) Xeon(R) Platinum处理器&#xff0c;阿里云优惠 aliyunfuwuqi…...

关于ContentProvider这一遍就够了

ContentProvider是什么&#xff1f; ContentProvider是Android四大组件之一&#xff0c;主要用于不同应用程序之间或者同一个应用程序的不同部分之间共享数据。它是Android系统中用于存储和检索数据的抽象层&#xff0c;允许不同的应用程序通过统一的接口访问数据&#xff0c;…...

《1w实盘and大盘基金预测 day23》

这几天预测错麻了&#xff0c;哈哈哈&#xff0c;完全和技术没关系&#xff0c;全是消息面。 昨日预测&#xff1a; 2958-2984-3010 证券继续下跌&#xff0c;昨天诱多把我诱惑进去了&#xff08;看2-3天的反弹也没了&#xff09;&#xff0c;今天直接出掉昨天买的。 整体操作…...

向量数据库与图数据库:理解它们的区别

作者&#xff1a;Elastic Platform Team 大数据管理不仅仅是尽可能存储更多的数据。它关乎能够识别有意义的见解、发现隐藏的模式&#xff0c;并做出明智的决策。这种对高级分析的追求一直是数据建模和存储解决方案创新的驱动力&#xff0c;远远超出了传统关系数据库。 这些创…...

WIN7用上最新版Chrome

1.下载WIN10最新版Chrome的离线安装包 谷歌浏览器 Chrome 最新版离线安装包下载地址 v123.0.6312.123 - 每日自动更新 | 异次元软件 文件名称&#xff1a;123.0.6312.123_chrome_installer.exe。 123.0.6312.123_chrome_installer.exe 文件右键解压缩得到 chrome.7z&#x…...

node.jd版本降级/升级

第一步.先清空本地安装的node.js版本 按健winR弹出窗口&#xff0c;键盘输入cmd,然后敲回车&#xff08;或者鼠标直接点击电脑桌面最左下角的win窗口图标弹出&#xff0c;输入cmd再点击回车键&#xff09; 进入命令控制行窗口&#xff0c;输入where node&#xff0c;查看本地…...

python+playwright 学习-88 禁止加载图片等资源

前言 对于爬虫的小伙伴来说,有时候只需抓取页面的文本,不用加载图片,可以加快操作页面速度,那么我们可以设置禁止加载图片等资源。 禁止图片加载 根据url地址的后缀,图片资源后缀一般是png,jpg,jpeg,gif等格式。 from playwright.sync_api import sync_playwrightwith…...

Linux:Redis7.2.4的简单在线部署(1)

注意&#xff1a;我写的这个文章是以最快速的办法去搭建一个redis的基础环境&#xff0c;作用是为了做实验简单的练习&#xff0c;如果你想搭建一个相对稳定的redis去使用&#xff0c;可以看我下面这个文章 Linux&#xff1a;Redis7.2.4的源码包部署&#xff08;2&#xff09;-…...

HackMyVM-Connection

目录 信息收集 arp nmap WEB web信息收集 dirsearch smbclient put shell 提权 系统信息收集 suid gdb提权 信息收集 arp ┌─[rootparrot]─[~/HackMyVM] └──╼ #arp-scan -l Interface: enp0s3, type: EN10MB, MAC: 08:00:27:16:3d:f8, IPv4: 192.168.9.115 S…...

Prometheus接入AlterManager配置邮件告警(基于K8S环境部署)

目录 一.配置Alertmanager告警发送至邮箱二.Prometheus接入AlertManager三.部署PrometheusAlterManager(放到一个Pod中)四. 测试告警 基于 此环境做实验 一.配置Alertmanager告警发送至邮箱 1.创建AlertManager ConfigMap资源清单 vim alertmanager-cm.yaml --- kind: Confi…...

find方法

find() 方法用于在数组中查找符合条件的第一个元素&#xff0c;并返回该元素。如果找到匹配的元素&#xff0c;则返回该元素的值&#xff1b;如果未找到匹配的元素&#xff0c;则返回 undefined。 例如: const firstWithdrawal movements.find(mov > mov < 0); consol…...

TLS v1.3 导致JetBrains IDE jdk.internal.net.http.common CPU占用高

开发环境 GoLand版本&#xff1a;2022.3.4 问题原因 JDK 中的 TLS v1.3 实现引起 解决办法 使用 SOCKS 代理代替HTTP代理 禁用 Space 和 Code With Me 插件 禁用 TLS v1.3&#xff0c;参考&#xff1a;https://stackoverflow.com/questions/54485755/java-11-httpclient-…...

计算机网络 2.2数据传输方式

第二节 数据传输方式 一、数据通信系统模型 添加图片注释&#xff0c;不超过 140 字&#xff08;可选&#xff09; 1.数据终端设备&#xff08;DTE&#xff09; 作用&#xff1a;用于处理用户数据的设备&#xff0c;是数据通信系统的信源和信宿。 设备&#xff1a;便携计算机…...

陇剑杯 流量分析 webshell CTF writeup

陇剑杯 流量分析 链接&#xff1a;https://pan.baidu.com/s/1KSSXOVNPC5hu_Mf60uKM2A?pwdhaek 提取码&#xff1a;haek目录结构 LearnCTF ├───LogAnalize │ ├───linux简单日志分析 │ │ linux-log_2.zip │ │ │ ├───misc日志分析 │ │ …...

【测试开发学习历程】python常用的模块(下)

目录 8、MySQL数据库的操作-pymysql 8.1 连接并操作数据库 9、ini文件的操作-configparser 9.1 模块-configparser 9.2 读取ini文件中的内容 9.3 获取指定建的值 10 json文件操作-json 10.1 json文件的格式或者json数据的格式 10.2 json.load/json.loads 10.3 json.du…...

GCDAsynSocket之TCP简析

GCDAsynSocket是一个开源的基于GCD的异步的socket库。它支持IPV4和IPV6地址&#xff0c;TLS/SSL协议。同时它支持iOS端和Mac端。本篇主要介绍一下GCDAsynSocket中的TCP用法和实现。 首先通过下面这个方法初始化一个GCDAsynSocket对象。 - (id)initWithDelegate:(id<GCDAsyn…...

大型网站系统架构演化实例_1.单体架构和垂直架构

大型网站的技术挑战主要来自于庞大的用户&#xff0c;高并发的访问和海量的数据&#xff0c;任何简单的业务一旦需要处理数以P计的数据和面对数以亿计的用户&#xff0c;问题就会变得很棘手。通常大型网站架构主要解决这类问题。 1.第一阶段&#xff1a;单体架构 大型网站都是…...

2024蓝桥杯——宝石问题

先展示题目 声明 以下代码仅是我的个人看法&#xff0c;在自己考试过程中的优化版&#xff0c;本人考试就踩了很多坑&#xff0c;我会—一列举出来。代码可能很多&#xff0c;但是总体时间复杂度不高只有0(N) 函数里面的动态数组我没有写开辟判断和free&#xff0c;这里我忽略…...

three.js加载模型报错,Error: THREE.GLTFLoader: No DRACOLoader instance provided.

three.js加载模型报错&#xff0c;Error: THREE.GLTFLoader: No DRACOLoader instance provided. 原因&#xff1a;该模型是压缩过的&#xff0c;需要 DRACOLoader 我们先找到该文件夹 node_modules three examples jsm libs draco 将draco拷贝到public下 import { GLTFLoad…...

Spring VS Spring Boot

目录 定义 Spring Spring Boot 区别 优劣对比 Spring Spring的优势 Spring的劣势 Spring Boot Spring Boot的优势 Spring Boot的劣势 适用场景 Spring的适用场景 Spring Boot的适用场景 初学者如何选择学习 定义 Spring Spring是一个轻量级的、开源的Java开发…...

Linux入门(Linux介绍,安装,常用命令,防火墙的设置,注意事项)

目录 一、Linux介绍 1. Linux简介 1 什么是Linux 2 Linux的应用 3 为什么要学习Linux 2. Linux分类 1 按照市场需求分 2 按照原生程度分 3.小结 二、Linux安装 1. vmware介绍 2. 安装VMWare 3. 安装CentOS 4. 登录查看ip 5. 远程连接工具 1 使用FinalShell连接L…...

vue2创建项目的两种方式,配置路由vue-router,引入element-ui

提示&#xff1a;vue2依赖node版本8.0以上 文章目录 前言一、创建项目基于vue-cli二、创建项目基于vue/cli三、对吧两种创建方式四、安装Element ui并引入五、配置路由跳转四、效果五、参考文档总结 前言 使用vue/cli脚手架vue create创建 使用vue-cli脚手架vue init webpack创…...

MySql 表中的id突然变很大,如何给id重新排序

目录 一、场景 二、解决方法 一、场景 我们在开发过程中&#xff0c;难免遇到id突然增大的情况。 由于id突然增大很多&#xff0c;我们重新增加数据时候id会默认加1 那么如何让id 重新从1按顺序排序呢 二、解决方法 点击编辑表&#xff0c;然后新建一个字段id2&#xff0c;将…...

leetcode练习——哈希表

目录 3. 无重复字符的最长子串 题目描述 解题思路 代码实现 349. 两个数组的交集 题目描述 解题思路 代码实现 ​​​​454. 四数相加 II 题目描述 解题思路 代码实现 242. 有效的字母异位词 题目描述 解题思路 代码实现 438. 找到字符串中所有字母异位词 题目…...

配置交换机 SSH 管理和端口安全

实验1:配置交换机基本安全和 SSH管理 1、实验目的 通过本实验可以掌握&#xff1a; 交换机基本安全配置。SSH 的工作原理和 SSH服务端和客户端的配置。 2、实验拓扑 交换机基本安全和 SSH管理实验拓扑如图所示。 3、实验步骤 &#xff08;1&#xff09;配置交换机S1 Swit…...

建设网站需要什么/沈阳专业seo关键词优化

目录 1 引言 1 1.1 选题背景及论文意义 1 1.2 系统现状与发展分析 2 1.3 论文主要内容及组织结构 4 2 关键技术介绍 5 2.1 系统基础技术介绍 5 2.1.1 mysql简介 5 2.1.2 spring mvc简介 5 2.1.3 mybatis介绍 6 2.2 SpringBoot框架介绍 7 2.2.1 SpringBoot简介 7 2.2.2 框架应用…...

长沙网站制作哪家好/关键词指数查询

表白网站搭建 手把手的教大家如何搭建一个自己的表白网站&#xff0c;想想将这个网页展现在大屏幕上面&#xff0c;是不是很拉风哈 如果要用云服务器的话&#xff0c;建议大家看看我的那个阿里云实战的文章&#xff0c;里面有具体的购买云服务器的方法&#xff0c;用上云服务器…...

上海做网站hlanggroup/搜索引擎bing

欢迎加入QQ群技术交流&#xff1a;466355109&#xff0c;技术不全没关系&#xff0c;只要有交流的心就尽管来吧&#xff01;&#xff01;&#xff01; 一&#xff1a;Git是什么&#xff1f; Git是目前世界上最先进的分布式版本控制系统。 二&#xff1a;SVN与Git的最主要的区别…...

如何制作游戏?/东莞市网站seo内容优化

1. 取得列表中的Item的数量&#xff1a; Int count SPContext.Current.List.Items.Count; 这句是取得Item的数目&#xff0c;不得不取得列表中的所有的Item的metadata,这样我们程序运行的速度就会相对慢一些&#xff0c;如果列表中的数据量不大&#xff0c;那不会有…...

什么网站可以做拍a发布会/关键词优化系统

环境MacPython3.6.4Atom背景Atom 执行Python Code 使用Script Package&#xff0c;执行快捷键cmd i。但是默认是执行Mac 系统的2.7 版本的Python。配置cmd &#xff0c;(cmd 逗号) 快捷键 打开Settings&#xff0c;或者点击Atom→Preferences 打开Settings点击Open Config F…...

做网站需要雇什么人/职业技能培训

首先写一个config类 在类上加入注解 标注为一个spring配置类 Configuration public class SpringConfig {} 在里面注册bean Bean相当于bean标签 别忘了自动注入 package config;import org.springframework.context.annotation.Bean; import org.springframework.context.a…...