【STM32 开发】| INA219采集电压、电流值

news2024/12/23 5:19:38

目录

  • 前言
  • 1 原理图
  • 2 IIC地址说明
  • 3 寄存器地址说明
  • 4 开始工作前配置
  • 5 程序代码
    • 1)驱动程序
    • 2)头文件
    • 3) 测试代码

前言

INA219 是一款具备 I2C 或 SMBUS 兼容接口的分流器和功率监测计。该器件监测分流器电压降和总线电源电压,转换次数和滤波选项可通过编程设定。可编程校准值与内部乘法器相结合,支持直接读取电流值(单位:安培)。通过附加乘法寄存器可计算功率(单位:瓦)。I2C 或 SMBUS 兼容接口 具有 16 个可编程地址。

INA219 可在 0V 至 26V 范围内感测总线中的分压。该器件由 3V 至 5.5V 单电源供电,电源的最大流耗为1mA。INA219 的工作温度范围为 -40°C 至 125°C。

1 原理图

在这里插入图片描述

2 IIC地址说明

在这里插入图片描述
此测试时A0、A1都下拉接地,所以INA219的IIC通信地址为1000000B

3 寄存器地址说明

在这里插入图片描述

  • 0x00 配置寄存器,用来配置工作模式、采集范围以及其他参数
  • 0x01 分流电阻两端的电压
  • 0x02 总线电压(IN-到GND的电压差)
  • 0x03 功率
  • 0x04 经过分流电阻两端的电流
  • 0x05 校准寄存器,用于对测量结果进行校准

4 开始工作前配置

  • 0x00 寄存器Bit 13:设置检测最大检测电压 0 = 16V,1 = 32V (此处项目需要测3V到5V的电压,故设置Bit 13 为 0
  • 0x00 寄存器Bit 11-12:设置总线分流电阻最大的电压(此处项目需要测0A到5A的电流,故设置Bit 11-12 为 01,即量程±80mV,可测电流±8A
  • 0x00 寄存器Bit 0-2:设置工作模式(默认)
  • 0x05 寄存器:设置基准值(根据需要测的电压、电流范围再套入公式得出结果

由以下公式可得出0x05的配置值。
C a l = t r u n c ( 0.04096 C u r r e n t L S B × R s h u n t ) Cal = trunc\left ( \frac{0.04096}{CurrentLSB\times Rshunt} \right ) Cal=trunc(CurrentLSB×Rshunt0.04096)
C u r r e n t L S B = M a x i m u m E x p e c t e d C u r r e n t 2 15 CurrentLSB = \frac{Maximum Expected Current}{2^{15}} CurrentLSB=215MaximumExpectedCurrent

数据手册说明文档
在这里插入图片描述

5 程序代码

1)驱动程序

#include "main.h"
#include "ina219aidcnr_helper.h"

uint16_t ina219_calibrationValue;
uint16_t ina219_currentDivider_mA;
float ina219_powerMultiplier_mW;

/**
 * @brief  The IIC reads 16bit data from the specified register address.
 * @param  ina219 Slave configuration structure of the IIC.
 * @param  registerAddress Internal memory address.
 * @return 16 bit register data.
 */
uint16_t INA219_ReadDataForRegister_16Bits(INA219_t *ina219, uint8_t registerAddress)
{
  uint8_t Value[2];

  HAL_I2C_Mem_Read(ina219->ina219_i2c, (INA219_ADDRESS<<1), registerAddress, 1, Value, 2, 1000);

  return ((Value[0] << 8) | Value[1]);
}

/**
 * @brief  Writes 16 bits of data to the register.
 * @param  ina219 Slave configuration structure of the IIC.
 * @param  registerAddress Internal memory address.
 * @param  Value 16 bits of data to be written.
 */
void INA219_WriteDataToRegister_16Bits(INA219_t *ina219, uint8_t registerAddress, uint16_t Value)
{
  uint8_t regAddr[2];
  /* High Byte */
  regAddr[0] = (Value >> 8) & 0xff;
  /* Low Byte */
  regAddr[1] = (Value >> 0) & 0xff;
  HAL_I2C_Mem_Write(ina219->ina219_i2c, (INA219_ADDRESS<<1), registerAddress, 1, (uint8_t*)regAddr, 2, 1000);
}

/**
 * @brief  Read bus voltage.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Read voltage value, unit mV.
 */
uint16_t INA219_ReadBusVoltage(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_BUS_VOLTAGE);

  /* return mV */
  return ((result >> 3  ) * 4);
}

/**
 * @brief  Read current register value.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Current register value.
 */
uint16_t INA219_ReadCurrentRaw(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_CURRENT);

  return (result);
}

/**
 * @brief  Read current register value, unit mA.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Current value.
 */
uint16_t INA219_ReadCurrent_mA(INA219_t *ina219)
{
  uint16_t result = INA219_ReadCurrentRaw(ina219);

  return (result / ina219_currentDivider_mA);
}

/**
 * @brief  Read current register value, unit mV.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Shunt Voltage value.
 */
uint16_t INA219_ReadShuntVoltage_mV(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_SHUNT_VOLTAGE);

  /* When multiple sign bits are present, they will all be the same value.
   * Negative numbers are represented in 2's complement format.
   * Generate the 2's complement of a negative number by complementing the absolute value binary number and adding 1.
   * Extend the sign, denoting a negative number by setting the MSB = 1.
   * Extend the sign to any additional sign bits to form the 16-bit word. */
  if(result > MAX_SHUNT_RANGE)
  {
    result = 65536 - MAX_SHUNT_RANGE;
  }

  /* Shunt voltage, unit mV. */
  return (result / 100);
}

/**
 * @brief  INA219 system reset.
 * @param  ina219 Slave configuration structure of the IIC.
 */
void INA219_Reset(INA219_t *ina219)
{
  INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CONFIG, INA219_CONFIG_RESET);
  HAL_Delay(1);
}

/**
 * @brief Set calibration register.
 * @param ina219 Slave configuration structure of the IIC.
 * @param calibrationData Calibrated data.
 */
void INA219_SetCalibration(INA219_t *ina219, uint16_t calibrationData)
{
  INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CALIBRATION, calibrationData);
}

/**
 * @brief  Gets the value of the configuration register.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Configuration Register value.
 */
uint16_t INA219_GetConfigInfo(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_CONFIG);
  return result;
}

/**
 * @brief Set configuration register.
 * @param ina219 Slave configuration structure of the IIC.
 * @param configData Configuration data.
 */
void INA219_SetConfig(INA219_t *ina219, uint16_t configData)
{
  INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CONFIG, configData);
}

/**
 * @brief The measurement results are calibrated. Voltage range is 16V, Current range is 8A.
 * @param ina219 Slave configuration structure of the IIC.
 */
void INA219_SetCalibration_16V_8A(INA219_t *ina219)
{
  uint16_t configInfo = INA219_CONFIG_VOLTAGE_RANGE_16V |
                    INA219_CONFIG_GAIN_2_80MV | INA219_CONFIG_BADCRES_12BIT |
                    INA219_CONFIG_SADCRES_12BIT_1S_532US |
                    INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;

  // Current_LSB = Maximum Expected Current / 2^15 = (80 / 10) / 2^15 = 0.0002
  // Cal = 0.04096 / (Current_LSB / R) = 0.04096 / (0.0002A * 0.01R) = 20480 = 0x5000
  // Calibration Register = 20480
  ina219_calibrationValue = 20480;

  // 1mA = Current_LSB * bits = 200uA * 5bit (5 bit/mA)
  ina219_currentDivider_mA = 5;
  // 1mW = Power_LSB * bits = 4mW * 0.25bit (0.25f bit/mW)
  ina219_powerMultiplier_mW = 0.25f;

  INA219_SetCalibration(ina219, ina219_calibrationValue);
  INA219_SetConfig(ina219, configInfo);
}

/**
 * @brief  Ina219 driver initialization
 * @param  ina219 Slave configuration structure of the IIC.
 * @param  i2c Pointer to a I2C_HandleTypeDef structure that contains
 *             the configuration information for the specified I2C.
 * @param  Address  Configuration data.
 * @return status.
 */
uint8_t INA219_Init(INA219_t *ina219, I2C_HandleTypeDef *i2c, uint8_t Address)
{
  ina219->ina219_i2c = i2c;
  ina219->Address = Address;

  ina219_currentDivider_mA = 0;
  ina219_powerMultiplier_mW = 0;

  uint8_t ina219_isReady = HAL_I2C_IsDeviceReady(i2c, (Address << 1), 3, 2);

  if(ina219_isReady == HAL_OK)
  {

    INA219_Reset(ina219);
    INA219_SetCalibration_16V_8A(ina219);

    return 1;
  }

  else
  {
    return 0;
  }
}

2)头文件


#ifndef INA219AIDCNR_HELPER_H
#define INA219AIDCNR_HELPER_H


#define INA219_ADDRESS 							        (0x40)
#define MAX_SHUNT_RANGE                     			(0x0FA0)

/* Register */
#define	INA219_REG_CONFIG						        (0x00)
#define	INA219_REG_SHUNT_VOLTAGE				    	(0x01)
#define	INA219_REG_BUS_VOLTAGE					    	(0x02)
#define	INA219_REG_POWER						        (0x03)
#define	INA219_REG_CURRENT						      	(0x04)
#define	INA219_REG_CALIBRATION					    	(0x05)
//
#define INA219_CONFIG_RESET 					      	(0x8000)
//
#define INA219_CONFIG_VOLTAGE_RANGE_16V					(0x0000)      // 0-16V Range
#define INA219_CONFIG_VOLTAGE_RANGE_32V					(0x2000)      // 0-32V Range

#define	INA219_CONFIG_GAIN_1_40MV				    	(0x0000)      // Gain 1, 40mV Range
#define	INA219_CONFIG_GAIN_2_80MV				    	(0x0800)      // Gain 2, 80mV Range
#define	NA219_CONFIG_GAIN_4_160MV				    	(0x1000)      // Gain 4, 160mV Range
#define	INA219_CONFIG_GAIN_8_320MV				  		(0x1800)      // Gain 8, 320mV Range

#define	INA219_CONFIG_BADCRES_9BIT				      	(0x0000)  // 9-bit bus res = 0..511
#define	INA219_CONFIG_BADCRES_10BIT				      	(0x0080)  // 10-bit bus res = 0..1023
#define	INA219_CONFIG_BADCRES_11BIT				      	(0x0100)  // 11-bit bus res = 0..2047
#define	INA219_CONFIG_BADCRES_12BIT				      	(0x0180)  // 12-bit bus res = 0..4097
#define	INA219_CONFIG_BADCRES_12BIT_2S_1060US 			(0x0480)  // 2 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_4S_2130US	  		(0x0500)  // 4 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_8S_4260US	  		(0x0580)  // 8 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_16S_8510US			(0x0600)  // 16 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_32S_17MS	  		(0x0680)  // 32 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_64S_34MS	  		(0x0700)  // 64 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_128S_69MS	  		(0x0780)  // 128 x 12-bit bus samples averaged together

#define	INA219_CONFIG_SADCRES_9BIT_1S_84US		  		(0x0000)  // 1 x 9-bit shunt sample
#define	INA219_CONFIG_SADCRES_10BIT_1S_148US	  		(0x0008)  // 1 x 10-bit shunt sample
#define	INA219_CONFIG_SADCRES_11BIT_1S_276US	  		(0x0010)  // 1 x 11-bit shunt sample
#define	INA219_CONFIG_SADCRES_12BIT_1S_532US	  		(0x0018)  // 1 x 12-bit shunt sample
#define	INA219_CONFIG_SADCRES_12BIT_2S_1060US	  		(0x0048)  // 2 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_4S_2130US	  		(0x0050)  // 4 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_8S_4260US	 	 	(0x0058)  // 8 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_16S_8510US			(0x0060)  // 16 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_32S_17MS	  		(0x0068)  // 32 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_64S_34MS	  		(0x0070)  // 64 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_128S_69MS	  		(0x0078)  // 128 x 12-bit shunt samples averaged together

#define INA219_CONFIG_MODE_MASK					        0x07
#define	INA219_CONFIG_MODE_POWERDOWN			       	0x00
#define	INA219_CONFIG_MODE_SVOLT_TRIGGERED		   		0x01
#define	INA219_CONFIG_MODE_BVOLT_TRIGGERED		   		0x02
#define	INA219_CONFIG_MODE_SANDBVOLT_TRIGGERED	 		0x03
#define	INA219_CONFIG_MODE_ADCOFF				        0x04
#define	INA219_CONFIG_MODE_SVOLT_CONTINUOUS		   		0x05
#define	INA219_CONFIG_MODE_BVOLT_CONTINUOUS		   		0x06
#define	INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS  		0x07


typedef struct
{
  I2C_HandleTypeDef 	*ina219_i2c;
  uint8_t				Address;
} INA219_t;


uint8_t INA219_Init(INA219_t *ina219, I2C_HandleTypeDef *i2c, uint8_t Address);
uint16_t INA219_ReadBusVoltage(INA219_t *ina219);
uint16_t INA219_ReadCurrent_mA(INA219_t *ina219);
uint16_t INA219_ReadCurrent_raw(INA219_t *ina219);
uint16_t INA219_ReadShuntVoltage_mV(INA219_t *ina219);
uint16_t INA219_ReadDataForRegister_16Bits(INA219_t *ina219, uint8_t registerAddress);
uint16_t INA219_GetConfigInfo(INA219_t *ina219);

void INA219_Reset(INA219_t *ina219);
void INA219_SetCalibration(INA219_t *ina219, uint16_t calibrationData);
void INA219_SetConfig(INA219_t *ina219, uint16_t configData);
void INA219_SetCalibration_16V_8A(INA219_t *ina219);
void INA219_WriteDataToRegister_16Bits(INA219_t *ina219, uint8_t registerAddress, uint16_t Value);




#endif //INA219AIDCNR_HELPER_H

3) 测试代码

int main(void)
{
  /* USER CODE BEGIN 1 */
  uint16_t vbus, vshunt, current;
  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART1_UART_Init();
  MX_I2C2_Init();
  /* USER CODE BEGIN 2 */

  while(!INA219_Init(&ina219, &hi2c2, INA219_ADDRESS))
  {

  }
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
    vbus = INA219_ReadBusVoltage(&ina219);
    vshunt = INA219_ReadShuntVoltage_mV(&ina219);
    current = INA219_ReadCurrent_mA(&ina219);
    
    sprintf(strBuffer, "INA219 param: vbus:%d mV; current:%d mA\r\n", vbus, current);
    HAL_UART_Transmit(&huart1, strBuffer, strlen(strDataBuf), 0xff);

    UserDelay_ms(500);
  }

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

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

相关文章

jmeter+ant实现的接口自动化测试

jmeterANT接口自动化测试框架 项目说明 本框架是一套基于jmeterAntExcelPython而设计的数据驱动接口自动化测试框架&#xff0c;jmeter 作为执行器&#xff0c;Ant 作为构建工具&#xff0c;进行构建测试&#xff0c;本框架无需你使用代码编写用例&#xff0c;测试用例存储在…

基于CSP的运动想象EEG分类任务实战

基于运动想象的公开数据集&#xff1a;Data set IVa (BCI Competition III)1 数据描述参考前文&#xff1a;https://blog.csdn.net/qq_43811536/article/details/134224005?spm1001.2014.3001.5501 EEG 信号时频空域分析参考前文&#xff1a;https://blog.csdn.net/qq_4381153…

算法竞赛——数论(一),数论内容的介绍,基础数论

文章目录 一&#xff0c; 数论学习路线的介绍和相关建议1&#xff0c;建议学习人群 &#xff1a;2&#xff0c;建议学习时长3&#xff0c;学习路线的介绍1&#xff0c;基础数论2&#xff0c;组合数学3&#xff0c;计算几何 二&#xff0c;基础数论第一部分 —— 快速幂和快速幂…

2023年十大最佳 iPhone 恢复软件

您的 iPhone 存储了大量有价值的数据&#xff0c;包括照片和视频。但是&#xff0c;即使使用高度安全的 Apple 设备&#xff0c;数据丢失也可能随时发生。从众多可用工具中选择最适合 iPhone 的数据恢复软件可能是一项艰巨的任务。因此&#xff0c;我们测试了性能并审查了 2023…

使用Hypothesis生成测试数据

&#x1f4e2;专注于分享软件测试干货内容&#xff0c;欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1f4dd; 如有错误敬请指正&#xff01;&#x1f4e2;交流讨论&#xff1a;欢迎加入我们一起学习&#xff01;&#x1f4e2;资源分享&#xff1a;耗时200小时精选的「软件测试」资…

[vue-router]vue3.x Hash路由前缀问题

[vue-router]vue3.x Hash路由前缀问题 问题描述问题分析 问题描述 是在本地开发时&#xff0c;使用的HASH路由&#xff0c;然后在偶然的情况下在/#/前添加了前缀&#xff0c;发现不影响本地的路由的使用&#xff1f;&#xff1f;&#xff1f;&#xff01;&#xff01;&#xf…

rviz中引入SW的模型

一、SW装配图转urdf 参考链接&#xff1a;https://blog.csdn.net/weixin_45168199/article/details/105755388 这部分直接看参考链接就可以&#xff0c;主要思路如下 1、把sw中的零散零件按照机器人中连杆的分类整合成几个大零件 2、把几个大零件整合成装配体&#xff0c;并…

如何在Jetpack Compose中显示PDF?

当读取和显示 PDF 的组件缺失时该怎么办? 声明式编程可以拯救你. Jetpack Compose已经存在好几年了, 但_在某些方面它的使用仍然面临挑战_. 例如, 缺少用于查看PDF的官方组件, 而为数不多的第三方库通常也是有代价的. 在我们的应用中, 我们会遇到在许多场景中显示 PDF 的需求…

跨境电商源码独立开发:一次购买,终生使用

随着全球电子商务的快速发展&#xff0c;越来越多的企业开始涉足跨境电商领域。为了在这个竞争激烈的市场中脱颖而出&#xff0c;您需要一个专业的跨境电商解决方案。我们的团队为您提供最优质的源码独立开发服务&#xff0c;让您拥有一个功能强大、安全稳定的跨境电商平台。 一…

腾讯觅影数智医疗影像平台获颁世界互联网领先科技成果大奖

11月8日&#xff0c;2023年世界互联网大会乌镇峰会在乌镇举行&#xff0c;腾讯再度获颁“世界互联网领先科技成果”大奖。腾讯健康总裁吴文达在世界互联网领先科技成果发布活动中介绍&#xff0c;“腾讯觅影数智医疗影像平台”已全面开放20多个医疗AI引擎助力科研创新&#xff…

2007-2022年全国各地级市金融机构网点数据

2007-2022年地级市金融机构网点数据 1、时间&#xff1a;2007-2022年 2、指标&#xff1a;行政区划代码、年份、城市名称、所属省份、银行网点数量、其中-政策性银行及国家开发银行营业网点占比、其中-商业银行营业网点数量占比、其中-农村金融机构营业网点数量占比 3、范围…

P3379 【模板】最近公共祖先(LCA)

洛谷里面8页题解千篇一律&#xff0c;就没有用线段树求解的&#xff0c;这下不得不由本蒟蒻来生啃又臭又硬&#xff0c;代码又多的线段树了。 样例的欧拉序列&#xff1a;4 2 4 1 3 1 5 1 4 记录每个节点最早在欧拉序列中的时间&#xff0c;任意两个节点的LCA就是他们两个节点…

Python 实现动态动画心形图

在抖音上刷到其他人用 matlab 实现的一个动态心形图&#xff0c;就想也用 Python 实现&#xff0c;摸索了两种实现方式&#xff0c;效果如下&#xff1a; 方法一&#xff1a; 利用循环&#xff0c;结合 pyplot 的 pause 与 clf 参数实现图像的动态刷新 import matplotlib.p…

MATLAB绘图中文显示为方框

MATLAB绘图中文显示为方框 MATLAB显示英文和字母没有问题&#xff0c;但是当显示中文时会显示乱码&#xff0c;中文显示为方框&#xff0c;如下图&#xff1a; 可以在绘图命令中添加如下代码&#xff1a; set(gca,Fontname,Monospaced); 例如&#xff1a; % 滤波器系数%低通…

Kafka入门

kafka无疑是当今互联网公司使用最广泛的分布式实时消息流系统&#xff0c;它的高吞吐量&#xff0c;高可靠等特点为并发下的大批量实时请求处理提供了可靠保障。很多同学在项目中都用到过kafka&#xff0c;但是对kafka的设计原理以及处理机制并不是十分清楚。为了知其然知其所以…

vue项目代码防止被调试-打开控制台直接跳空白页面

vue项目代码防止被调试-打开控制台直接跳空白页面 前端代码上线后&#xff0c;代码会暴露&#xff0c;或者接口暴露&#xff0c;会被有心之人研究代码逻辑&#xff0c;找到项目bug漏洞&#xff01; 项目背景 被安全测试针对了&#xff0c;总是调试我这不太安全的代码。前端代码…

用dbeaver创建一个enum类型,并讲述一部分,mysql的enum类型的知识

写这个博客的目的就是我在网上看了半天&#xff0c;发现没有这方面的知识&#xff0c;也许是老手认为这个太简单了&#xff0c;不过我还是告诉新人使用dbeaver来创建一个enum类型的方法&#xff1a; 就是enum("a","b","name") 第一步用dbeaver…

搜索引擎Elasticsearch基础与实践

倒排索引 将文档中的内容分词&#xff0c;然后形成词条。记录每条词条与数据的唯一表示如id的对应关系&#xff0c;形成的产物就是倒排索引&#xff0c;如下图&#xff1a; ElasticSearch数据的存储和搜索原理 这里的索引库相当于mysql中的database。一个文档&#xff08;do…

大语言模型(LLM)综述(七):大语言模型设计应用与未来方向

A Survey of Large Language Models 前言8 A PRACTICAL GUIDEBOOK OF PROMPT DESIGN8.1 提示创建8.2 结果与分析 9 APPLICATIONS10 CONCLUSION AND FUTURE DIRECTIONS 前言 随着人工智能和机器学习领域的迅速发展&#xff0c;语言模型已经从简单的词袋模型&#xff08;Bag-of-…

Mabitys总结

一、ORM ORM(Object/Relation Mapping)&#xff0c;中文名称&#xff1a;对象/关系 映射。是一种解决数据库发展和面向对象编程语言发展不匹配问题而出现的技术。 使用JDBC技术时&#xff0c;手动实现ORM映射&#xff1a; 使用ORM时&#xff0c;自动关系映射&#xff1a; &am…