【LLM大模型】如何在LlamaIndex中使用RAG?

news2024/9/25 23:14:13

如何在LlamaIndex中使用RAG

img

什么是 Llama-Index

LlamaIndex 是一个数据框架,用于帮助基于 LLM 的应用程序摄取、构建结构和访问私有或特定领域的数据。

如何使用 Llama-Index ?

基本用法是一个五步流程,将我们从原始、非结构化数据导向基于该数据生成内容的LLM。

    1. 加载文档
    1. 解析文档到 LlamaIndex 的 Node 节点中
    1. 构建索引
    1. 解析索引
    1. 解析响应

安装需要的依赖包

yaml

 !pip install llama-index -qU
 !pip install -q openai
 !pip install pypdf
 !pip install doc2txt
 !pip install -qU llama-cpp-python
 !pip install transformers
 !pip install accelerate

导入需要的依赖

python

 import os
 import openai
 from getpass import getpass
 #
 import logging
 import sys
 from pprint import pprint
 #
 logging.basicConfig(stream=sys.stdout, level=logging.INFO)
 logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
 #
 from llama_index import(VectorStoreIndex,
                         SimpleDirectoryReader,
                         load_index_from_storage,
                         StorageContext,
                         ServiceContext,
                         Document)
 ​
 from llama_index.llms import OpenAI,HuggingFaceLLM
 from llama_index.prompts import PromptTemplate
 from llama_index.text_splitter import SentenceSplitter
 from llama_index.embeddings import OpenAIEmbedding,HuggingFaceEmbedding
 from llama_index.schema import MetadataMode
 from llama_index.postprocessor import MetadataReplacementPostProcessor

什么是 Document?

Document是一个容器,用来保存来自各种来源的数据,比如PDFAPI 输出或从数据库中检索到的数据。

scss

 documents = SimpleDirectoryReader('./Data/').load_data()
 print(len(documents))
 pprint(documents)

加载完成后,这个 pdf 被转换为长度为 12 的数组.

sql

 documents[0].get_content()
 ​
 ## Response
 Face Recognition System Using Python
  This article was published as a part of the Data Science Blogathon.
 Introduction
 Face recognition is different from face detection. In face detection, we had only detected the location of
 human faces, and we recognized the identity of faces in the face recognition task.
 In this article, we are going to build a face recognition system using python with the help of face
 recognition library .
 There are many algorithms available in the market for face recognition. This broad computer vision
 challenge is detecting faces from videos and pictures. Many applications can be built on top of recognition
 systems. Many big companies are adopting recognition systems for their security and authentication
 purposes.
 Use Cases of Recognition Systems
 Face recognition systems are widely used in the modern era, and many new innovative systems are built on
 top of recognition systems.
 There are a few used cases :
 Finding Missing Person
 Identifying accounts on social media
 Recognizing Drivers in Cars
 School Attendance System
 Several methods and algorithms implement facial recognition systems depending on the performance and
 accuracy.
 Traditional Face Recognition Algorithm
 Traditional face recognition algorithms don’t meet modern-day’s facial recognition standards. They were
 designed to recognize faces using old conventional algorithms.
 OpenCV provides some traditional facial Recognition Algorithms.
 Eigenfaces
 Scale Invariant Feature Transform (SIFT)
 Fisher faces
 Local Binary Patterns Histograms (LBPH)
 COMPUTER VISION
 IMAGE ANALYSIS
 INTERMEDIATE
 PYTHON
 documents[0].metadata
 ​
 ## 响应
 {'file_path': 'Data/chinahistory.txt',
  'file_name': 'chinahistory.txt',
  'file_type': 'text/plain',
  'file_size': 977274,
  'creation_date': '2023-12-18',
  'last_modified_date': '2023-12-05',
  'last_accessed_date': '2023-12-18'}

设置 llm

ini

 from llama_index.llms import HuggingFaceLLM
 from llama_index.prompts import PromptTemplate
 llm = HuggingFaceLLM(
     model_name="HuggingFaceH4/zephyr-7b-beta",
     tokenizer_name="HuggingFaceH4/zephyr-7b-beta",
     #query_wrapper_prompt=PromptTemplate("<|system|>Please check if the following pieces of context has any mention of the keywords provided in the question.If not ten say that you do not know the answer.Please do not make up your own answer.</s>\n<|user|>\nQuestion:{query_str}</s>\n<|assistant|>\n"),
     # query_wrapper_prompt=PromptTemplate(template),
     context_window=4096,
     max_new_tokens=512,
     model_kwargs={'trust_remote_code':True},
     generate_kwargs={"temperature": 0.0},
     device_map="auto",)

配置 embedding Model

javascript

 from llama_index.embeddings import resolve_embed_model
 from llama_index.embeddings.huggingface import HuggingFaceEmbedding
 #embed_model = resolve_embed_model("local:BAAI/bge-large-en-v1.5")
 embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5")

在LlamaIndex中 Node 是什么

LlamaIndex 中的 Node 对象表示源文档的“块”或部分。

这可能是一个文本块、一幅图像或其他类型的数据。类似于 DocumentsNodes 也包含与其他节点的元数据和关系信息。

LlamaIndex 中,Nodes 被认为是一等公民。

这意味着可以直接定义 Nodes 及其所有属性。

或者也可以使用 NodeParser 类将源Document解析为Node。默认情况下,从文档派生的每个节点都会继承相同的元数据。例如,文档中的file_name字段会传播到每个节点。

视特定的使用情况和数据结构,选择将整个 Document 对象发送到索引还是在索引之前将 Document 转换为 Node 对象取决于自己。

  1. 将整个Document对象发送至索引:这种方法适用于将整个文档作为单个单位进行维护。当您的文档相对较短或不同部分之间的上下文重要时这可能会更好。
  2. 在索引之前将Document转换为Node对象:当的文档很长且希望在索引之前将其拆分成较小块(或节点)时,这种方法很实用。当想要检索文档特定部分而非整个文档时这可能会更好。

节点解析和索引化(基于句子窗口方法)

SentenceWindowNodeParser 类旨在将文档解析为节点(句子),并为每个节点捕获周围句子的窗口。

这对于上下文感知的文本处理非常有用,通过理解句子周围的背景可以提供有价值的见解。

  • Node:表示文本的单元,这里指一句话。
  • Window:围绕特定句子的若干句组成的范围。例如,如果窗口大小为3,并且当前句是第5句,则该窗口会捕获第2至第8句。
  • Metadata:与节点相关联的额外信息,如周围句子的窗口。

工作机制

当我们使用from_defaults方法创建一个SentenceWindowNodeParser实例时,使用了 custom_sentence_splitter(根据 "\n", "\n-", 或 "\n" 分隔文本)以及指定的参数(window_size=3, include_prev_next_rel=True, include_metadata=True),我们将设置一个解析器来按照以下方式处理文档:

  • 每个文档的文本将使用自定义分隔符分为句子。
  • 对于每个句子,生成一个节点。
  • 该节点将包含捕获其两侧三个句子的元数据。
  • 此外,每个节点还会引用其前后的句子。
  • 使用一个文档列表调用 get_nodes_from_documents 将返回一组这些节点,每个代表一个句子,丰富了指定的元数据和关系。
python

 #create senetence window node parser with default settings
 from llama_index.node_parser import SentenceWindowNodeParser,SimpleNodeParser
 sentence_node_parser = SentenceWindowNodeParser.from_defaults(
     window_size=3,
     window_metadata_key="window",
     original_text_metadata_key="original_text")
 #base_node_parser = SentenceSplitter(llm=llm)
 base_node_parser = SimpleNodeParser()
 #
 nodes = sentence_node_parser.get_nodes_from_documents(documents)
 base_nodes = base_node_parser.get_nodes_from_documents(documents)
 #
 print(f"SENTENCE NODES :\n {nodes[10]}")
 print(f"BASE NODES :\n {base_nodes[10]}")
 SENTENCE NODES :
  Node ID: 8418b939-dc08-42a6-8ee1-821e46f7a2a1
 Text: Traditional Face Recognition Algorithm Traditional face
 recognition algorithms don’t meet modern-day’s facial recognition
 standards.
 BASE NODES :
  Node ID: 7a94495b-2f49-4cc4-8fd4-87f5fb0f645e
 Text: Now let’s test the model prediction using text in different
 languages. def predict(text): x = cv.transform([text]).toarray() #
 converting text to bag of words model (Vector) lang = model.predict(x)
 # predicting the language lang = le.inverse_transform(lang) # finding
 the language corresponding the the predicted value print("The langauge
 is in",l...
 dict(nodes[10]) # 由于没有执行索引操作,因此embedding为 None。
 ​
 #### 
 {'id_': '8418b939-dc08-42a6-8ee1-821e46f7a2a1',
  'embedding': None,
  'metadata': {'window': 'Many big companies are adopting recognition systems for their security and authentication\npurposes.\n Use Cases of Recognition Systems\nFace recognition systems are widely used in the modern era, and many new innovative systems are built on\ntop of recognition systems.\n There are a few used cases :\nFinding Missing Person\nIdentifying accounts on social media\nRecognizing Drivers in Cars\nSchool Attendance System\nSeveral methods and algorithms implement facial recognition systems depending on the performance and\naccuracy.\n Traditional Face Recognition Algorithm\nTraditional face recognition algorithms don’t meet modern-day’s facial recognition standards.  They were\ndesigned to recognize faces using old conventional algorithms.\n OpenCV provides some traditional facial Recognition Algorithms.\n',
   'original_text': 'Traditional Face Recognition Algorithm\nTraditional face recognition algorithms don’t meet modern-day’s facial recognition standards. ',
   'page_label': '1',
   'file_name': 'face-recognition-system-using-python.pdf',
   'file_path': 'Data/face-recognition-system-using-python.pdf',
   'file_type': 'application/pdf',
   'file_size': 465666,
   'creation_date': '2023-12-21',
   'last_modified_date': '2023-12-21',
   'last_accessed_date': '2023-12-21'},
  'excluded_embed_metadata_keys': ['file_name',
   'file_type',
   'file_size',
   'creation_date',
   'last_modified_date',
   'last_accessed_date',
   'window',
   'original_text'],
  'excluded_llm_metadata_keys': ['file_name',
   'file_type',
   'file_size',
   'creation_date',
   'last_modified_date',
   'last_accessed_date',
   'window',
   '.......'
   }

LlamaIndex 中的 IndexNode 是什么?

IndexNode 是在 LlamaIndex 中使用的节点对象。

它代表了存储在索引中的原始文档块。索引是一种数据结构,允许快速检索与用户查询相关的上下文,这对于“检索增强生成”(RAG)用例至关重要。

从根本上讲,“IndexNode”继承自“TextNode”的属性,意味着它主要代表文本内容。

IndexNode 的区别特征在于其 index_id 属性。这个 index_id 充当一个唯一标识符或对另一个对象的引用,使得节点能够指向系统内的其他实体。

这种引用功能在文本内容之上增加了一层连接性和关联信息。

例如,在递归检索和节点引用的背景下,较小的块(表示为IndexNode对象)可以指向更大的父块。在查询时会检索较小的块,但会跟踪对更大块的引用。 这样可以提供更多合成的背景信息。

LlamaIndex 中的 ServiceContext 是什么?

ServiceContext 是在 LlamaIndex 管道/应用程序的索引和查询阶段中经常使用的资源包。

ini

 ctx_sentence = ServiceContext.from_defaults(
     llm=llm,
     embed_model=embed_model,
     node_parser=nodes)
 # 以上内容已经包含了SentenceWindowNodeParser
 #
 ctx_base = ServiceContext.from_defaults(
     llm=llm,
     embed_model=embed_model,
     node_parser=base_nodes)

LlamaIndex 中的 VectorStoreIndex 是什么?

在 LlamaIndex 中,VectorStoreIndex 是一种索引类型,它使用文本的向量表示以实现有效检索相关上下文。

它构建在 VectorStore 之上,后者是一种存储向量并允许快速最近邻搜索的数据结构。

VectorStoreIndex 接收 IndexNode 对象,这些对象代表了原始文档的块。

它使用一个嵌入模型(在ServiceContext中指定)将这些节点的文本内容转换成向量表示。然后这些向量被存储在VectorStore中。

在查询时,VectorStoreIndex 可以快速检索出针对特定查询最相关的节点。 它通过使用相同的嵌入模型将查询转换为向量,然后在 VectorStore 中执行最近邻搜索来实现这一点。

ini

 sentence_index = VectorStoreIndex(
     nodes,
     service_context=ctx_sentence)
 base_index = VectorStoreIndex(
     base_nodes,
     service_context=ctx_base)

LlamaIndex中,RetrieverQueryEngine是什么?

LlamaIndex 中的 RetrieverQueryEngine 是一种查询引擎,它使用一个检索器从索引中获取相关的上下文,给定用户查询。

它主要用于和检索器一起工作,比如从 VectorStoreIndex 创建的 VectorStoreRetriever

RetrieverQueryEngine 接受一个检索器和一个响应合成器作为输入。 检索器负责从索引中获取相关的 IndexNode 对象,而响应合成器则根据检索到的节点和用户查询生成自然语言响应。

LlamaIndex中的 MetadataReplacementPostProcessor是什么?

MetadataReplacementPostProcessor 用于将节点内容替换为节点元数据中的字段。如果元数据中不存在该字段,则节点文本保持不变。与 SentenceWindowNodeParser 结合使用时效果最佳。

ini

 from llama_index.indices.postprocessor import MetadataReplacementPostProcessor
 sentence_query_engine = sentence_index.as_query_engine(
     similarity_top_k=5,
     verbose=True,
     node_postprocessor=[
         MetadataReplacementPostProcessor("window")
         ],
     )
 ​
 #
 base_query_engine = base_index.as_query_engine(
     similarity_top_k=5,
     verbose=True,
     node_postprocessor=[
         MetadataReplacementPostProcessor("window")
         ],
     )

运行查询以获取句子窗口解析器查询引擎

arduino

 query ="使用Python检测图像中的人脸的示例代码。"
 response = sentence_query_engine.query(query)
 from IPython.display import display,Markdown
 display(Markdown(f"<b>{response}</b>"))

生成的响应

这里是一个使用Python和OpenCV库来检测图像中人脸的示例代码:

ini

 import cv2
 import numpy as np
 # Load the pre-trained face detection model
 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')# Load the image
 img = cv2.imread('image.jpg')# Convert the image to grayscale
 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)# Detect faces in the grayscale image
 faces = face_cascade.detectMultiScale(gray, 1.2, 5)# Draw a rectangle around each face
 for (x, y, w, h) in faces:
     cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)# Display the image with the detected faces
 cv2.imshow('Face Detection', img)
 cv2.waitKey(0)
 cv2.destroyAllWindows()

在这段代码中,我们首先使用OpenCV的**CascadeClassifier函数加载预训练的人脸检测模型。然后加载图像,将其转换为灰度,并将其传递给人脸检测模型的detectMultiScale函数以检测人脸。然后使用OpenCV的rectangle函数在每张人脸周围绘制矩形。最后,我们使用OpenCV的imshow**函数显示带有检测到的人脸的图像。

请确保将haarcascade_frontalface_default.xml替换为您预训练的人脸检测模型的路径。

为基节点分析器运行查询查询引擎

css

 response = base_query_engine.query(query)
 #
 display(Markdown(f"<b>{response}</b>"))

回复

ini

 import cv2
 import numpy as np
 ​
 img = cv2.imread('image.jpg')
 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
 face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
 faces = face_cascade.detectMultiScale(gray, 1.2, 5)
 ​
 for (x, y, w, h) in faces:
     cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)
 ​
 cv2.imshow('img', img)
 cv2.waitKey(0)
 cv2.destroyAllWindows()

此代码使用Haar级联算法在图像中检测面部。haarcascade_frontalface_default.xml文件包含用于面部检测的训练分类器。detectMultiScale()函数用于以一定比例因子和最小邻域尺寸检测图像中的多个面部。然后,使用rectangle()函数在原始图像上将检测到的面部画成矩形。imshow()函数用于显示图像,而waitKey()函数则用于等待按键后关闭窗口。destroyAllWindows()函数可销毁程序执行期间创建的所有窗口。

保存和重新加载 VectorStore

javascript

 from google.colab import drive
 drive.mount('/content/drive')

保存至持久存储

ini

 sentence_index.storage_context.persist(persist_dir="location in Gdrive")
 base_index.storage_context.persist(persist_dir="location in Gdrive")

从存储中检索

ini

 # 重建存储
 SC_retrieved_sentence = StorageContext.from_defaults(persist_dir="location in Gdrive")
 SC_retrieved_base = StorageContext.from_defaults(persist_dir="location in Gdrive")

加载索引

ini

 retrieved_sentence_index = load_index_from_storage(
     SC_retrieved_sentence,
     service_context=ctx_sentence)
 retrieved_base_index = load_index_from_storage(
     SC_retrieved_base,
     service_context=ctx_base)

重建查询引擎

ini

 from llama_index.postprocessor import MetadataReplacementPostProcessor
 #
 sentence_query_engine = retrieved_sentence_index.as_query_engine(
   similarity_top_k=5,
   verbose=True,
   node_postprocessor=[MetadataReplacementPostProcessor("window")],
 )
 base_query_engine = retrieved_base_index.as_query_engine(
   similarity_top_k=5,
   verbose=True,
 )

提问问题并得到回应

css

 base_response = base_query_engine.query(query)
 #
 display(Markdown(f"<b>{base_response}</b>"))

如何系统的去学习AI大模型LLM ?

作为一名热心肠的互联网老兵,我意识到有很多经验和知识值得分享给大家,也可以通过我们的能力和经验解答大家在人工智能学习中的很多困惑,所以在工作繁忙的情况下还是坚持各种整理和分享。

但苦于知识传播途径有限,很多互联网行业朋友无法获得正确的资料得到学习提升,故此将并将重要的 AI大模型资料 包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来

😝有需要的小伙伴,可以V扫描下方二维码免费领取🆓

在这里插入图片描述

一、全套AGI大模型学习路线

AI大模型时代的学习之旅:从基础到前沿,掌握人工智能的核心技能!

img

二、640套AI大模型报告合集

这套包含640份报告的合集,涵盖了AI大模型的理论研究、技术实现、行业应用等多个方面。无论您是科研人员、工程师,还是对AI大模型感兴趣的爱好者,这套报告合集都将为您提供宝贵的信息和启示。

img

三、AI大模型经典PDF籍

随着人工智能技术的飞速发展,AI大模型已经成为了当今科技领域的一大热点。这些大型预训练模型,如GPT-3、BERT、XLNet等,以其强大的语言理解和生成能力,正在改变我们对人工智能的认识。 那以下这些PDF籍就是非常不错的学习资源。

img

在这里插入图片描述

四、AI大模型商业化落地方案

img

阶段1:AI大模型时代的基础理解

  • 目标:了解AI大模型的基本概念、发展历程和核心原理。
  • 内容
    • L1.1 人工智能简述与大模型起源
    • L1.2 大模型与通用人工智能
    • L1.3 GPT模型的发展历程
    • L1.4 模型工程
      - L1.4.1 知识大模型
      - L1.4.2 生产大模型
      - L1.4.3 模型工程方法论
      - L1.4.4 模型工程实践
    • L1.5 GPT应用案例

阶段2:AI大模型API应用开发工程

  • 目标:掌握AI大模型API的使用和开发,以及相关的编程技能。
  • 内容
    • L2.1 API接口
      - L2.1.1 OpenAI API接口
      - L2.1.2 Python接口接入
      - L2.1.3 BOT工具类框架
      - L2.1.4 代码示例
    • L2.2 Prompt框架
      - L2.2.1 什么是Prompt
      - L2.2.2 Prompt框架应用现状
      - L2.2.3 基于GPTAS的Prompt框架
      - L2.2.4 Prompt框架与Thought
      - L2.2.5 Prompt框架与提示词
    • L2.3 流水线工程
      - L2.3.1 流水线工程的概念
      - L2.3.2 流水线工程的优点
      - L2.3.3 流水线工程的应用
    • L2.4 总结与展望

阶段3:AI大模型应用架构实践

  • 目标:深入理解AI大模型的应用架构,并能够进行私有化部署。
  • 内容
    • L3.1 Agent模型框架
      - L3.1.1 Agent模型框架的设计理念
      - L3.1.2 Agent模型框架的核心组件
      - L3.1.3 Agent模型框架的实现细节
    • L3.2 MetaGPT
      - L3.2.1 MetaGPT的基本概念
      - L3.2.2 MetaGPT的工作原理
      - L3.2.3 MetaGPT的应用场景
    • L3.3 ChatGLM
      - L3.3.1 ChatGLM的特点
      - L3.3.2 ChatGLM的开发环境
      - L3.3.3 ChatGLM的使用示例
    • L3.4 LLAMA
      - L3.4.1 LLAMA的特点
      - L3.4.2 LLAMA的开发环境
      - L3.4.3 LLAMA的使用示例
    • L3.5 其他大模型介绍

阶段4:AI大模型私有化部署

  • 目标:掌握多种AI大模型的私有化部署,包括多模态和特定领域模型。
  • 内容
    • L4.1 模型私有化部署概述
    • L4.2 模型私有化部署的关键技术
    • L4.3 模型私有化部署的实施步骤
    • L4.4 模型私有化部署的应用场景

学习计划:

  • 阶段1:1-2个月,建立AI大模型的基础知识体系。
  • 阶段2:2-3个月,专注于API应用开发能力的提升。
  • 阶段3:3-4个月,深入实践AI大模型的应用架构和私有化部署。
  • 阶段4:4-5个月,专注于高级模型的应用和部署。
这份完整版的大模型 LLM 学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

😝有需要的小伙伴,可以Vx扫描下方二维码免费领取🆓

在这里插入图片描述

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

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

相关文章

本地部署 SenseVoice - 阿里开源语音大模型

本地部署 SenseVoice - 阿里开源语音大模型 1. 创建虚拟环境2. 克隆代码3. 安装依赖模块4. 启动 WebUI5. 访问 WebUI 1. 创建虚拟环境 conda create -n sensevoice python3.11 -y conda activate sensevoice 2. 克隆代码 git clone https://github.com/FunAudioLLM/SenseVoic…

【Linux进阶】文件系统2——MBR和GPT

1.磁盘的分区 因为如果你的磁盘被划分成两个分区&#xff0c;那么每个分区的设备文件名是什么&#xff1f; 在了解这个问题之前&#xff0c;我们先来复习一下磁盘的组成&#xff0c;因为现今磁盘的划分与它物理的组成很有关系。 我们谈过磁盘主要由碟片、机械手臂、磁头与主轴马…

C++Windows环境搭建(CLion)

文章目录 CLion下载安装CLion下载CLion安装新建项目 CLion下载安装 CLion下载 打开网址&#xff1a;https://www.jetbrains.com/clion/download/ 点击Download进行下载。 CLion安装 双击下载好的安装包&#xff1a; 进入到安装页面&#xff0c;点击下一步&#xff1a; 选…

【粉丝福利 | 第8期】值得收藏!推荐10个好用的数据血缘工具

⛳️ 写在前面参与规则&#xff01;&#xff01;&#xff01; ✅参与方式&#xff1a;关注博主、点赞、收藏、评论&#xff0c;任意评论&#xff08;每人最多评论三次&#xff09; ⛳️本次送书1~4本【取决于阅读量&#xff0c;阅读量越多&#xff0c;送的越多】 目前市面上绝…

无人直播系统源码开发:功能~优势~开发方法

自动直播通常是指通过自动化技术来实现实时内容分发的过程&#xff0c;它结合了流媒体技术和人工智能&#xff08;如机器学习&#xff09;。以下是自动直播实现的基本步骤&#xff1a; 内容采集&#xff1a;通过摄像头、手机等设备捕捉实时画面&#xff0c;并通过编码将其转换成…

如何理解http与https协议,他们有什么区别?

写在前面的话&#xff0c;关于 HTTP 和 HTTPS 的问题&#xff0c;常常会被很多学习者忽略&#xff0c;HTTP、HTTPS 不就是网址的开头吗&#xff0c;有啥好了解的&#xff0c;浏览器的引擎实现了这个协议&#xff0c;在开发关系不大&#xff0c;但想要深入一些理解数据传输原理&…

NPDP有什么价值?究竟值不值得去考?

NPDP其实就是产品经理国际资格认证&#xff0c;是美国产品开发管理协会发起的&#xff0c;集理论、方法和实践一体&#xff0c;在新产品开发方面有一个很全面的知识体系。是国际公认的新产品开发专业认证&#xff0c;具有权威性。 NPDP能够很好地帮你在做新产品的道路上少走弯…

SpringSecurity中文文档(Servlet Method Security)

Method Security 除了在请求级别进行建模授权之外&#xff0c;Spring Security 还支持在方法级别进行建模。 您可以在应用程序中激活它&#xff0c;方法是使用EnableMethodSecurity 注释任何Configuration 类&#xff0c;或者将 < method-security > 添加到任何 XML 配…

RK3588开发笔记(四):基于定制的RK3588一体主板升级镜像

若该文为原创文章&#xff0c;转载请注明原文出处 本文章博客地址&#xff1a;https://hpzwl.blog.csdn.net/article/details/140288662 长沙红胖子Qt&#xff08;长沙创微智科&#xff09;博文大全&#xff1a;开发技术集合&#xff08;包含Qt实用技术、树莓派、三维、OpenCV…

多次执行相同的push问题(如何解决)

下面这个问题如何解决 1.为什么会出现这个问题 原因&#xff1a;push是一个promise&#xff0c;promise需要传递成功和失败两个参数&#xff0c;我们的push中没有传递。 goSearch() {//路由传参//第一种&#xff1a;字符串形式// this.$router.push(/search/this.keyword&quo…

【Linux进阶】文件系统3——目录树,挂载

前言 在Windows 系统重新安装之前&#xff0c;你可能会事先考虑&#xff0c;到底系统盘C盘要有多大容量&#xff1f;而数据盘D盘又要给多大容量等&#xff0c;然后实际安装的时候&#xff0c;你会发现其实C盘之前会有个100MB的分区被独立出来&#xff0c;所以实际上你就会有三个…

ATA-5420前置微小信号放大器如何进行半导体测试

半导体测试是电子行业中至关重要的环节&#xff0c;它对于保证产品质量、提高生产效率起着至关重要的作用。在半导体测试过程中&#xff0c;我们需要采用一系列的方法和原理来确保芯片的可靠性和性能稳定性&#xff0c;而前置微小信号放大器在半导体测试中起着至关重要的作用。…

C++ Qt 自制开源科学计算器

C Qt 自制开源科学计算器 项目地址 软件下载地址 目录 0. 效果预览1. 数据库准备2. 按键&快捷键说明3. 颜色切换功能(初版)4. 未来开发展望5. 联系邮箱 0. 效果预览 普通计算模式效果如下&#xff1a; 科学计算模式效果如下&#xff1a; 更具体的功能演示视频见如下链接…

Python酷库之旅-第三方库Pandas(012)

目录 一、用法精讲 28、pandas.HDFStore.keys函数 28-1、语法 28-2、参数 28-3、功能 28-4、返回值 28-5、说明 28-6、用法 28-6-1、数据准备 28-6-2、代码示例 28-6-3、结果输出 29、pandas.HDFStore.groups函数 29-1、语法 29-2、参数 29-3、功能 29-4、返回…

9.2 栅格图层符号化单波段灰度渲染

文章目录 前言单波段灰度QGis设置为单波段灰度二次开发代码实现单波段灰度 总结 前言 介绍栅格图层数据渲染之单波段灰度显示说明&#xff1a;文章中的示例代码均来自开源项目qgis_cpp_api_apps 单波段灰度 以“3420C_2010_327_RGB_LATLNG.tif”数据为例&#xff0c;在QGis中…

论坛系统--测试报告(部分)

前言 逆水行舟&#xff0c;不进则退&#xff01;&#xff01;&#xff01; 目录 项目背景 接口测试 性能测试 压力测试 UI测试 项目背景 项目名称&#xff1a; 论坛系统 项目概述&#xff1a; 论坛系统是一个基于Spring Boot和MySQL的Web应用程序…

Nginx理论篇与相关网络协议

Nginx是什么&#xff1f; Nginx是一款由C语言编写的高性能、轻量级的web服务器&#xff0c;一个线程能处理多个请求&#xff0c;支持万级并发。 优势&#xff1a;I/O多路复用。 I/O是什么&#xff1f; I指的是输入&#xff08;Input&#xff09;,O是指输出&#xff08;Outp…

poi-tl、aspose实现word中表在每页携带表头表尾

实现word中表在每页携带表头表尾&#xff08;第一版&#xff09; word中的表格如果只有一页时表头表尾都很好处理&#xff0c;当中间内容足够多时&#xff0c;表尾只会出现在最后一页&#xff0c;表头也只会出现在第一页&#xff0c;之前想过用word自带的页眉页尾来处理但是&a…

【中项第三版】系统集成项目管理工程师 | 第 4 章 信息系统架构③ | 4.6

前言 第4章对应的内容选择题和案例分析都会进行考查&#xff0c;这一章节属于技术相关的内容&#xff0c;学习要以教材为准。本章分值预计在4-5分。 目录 4.6 网络架构 4.6.1 基本原则 4.6.2 局域网架构 4.6.3 广域网架构 4.6.4 移动通信网架构 4.6.5 软件定义网络 4.6…

云动态摘要 2024-07-09

给您带来云厂商的最新动态&#xff0c;最新产品资讯和最新优惠更新。 最新优惠与活动 数据库上云优选 阿里云 2024-07-04 RDS、PolarDB、Redis、MongoDB 全系产品新用户低至首年6折起&#xff01; [免费体验]智能助手ChatBI上线 腾讯云 2024-07-02 基于混元大模型打造&…