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

ESP8266 (5),驱动屏幕

代码
第一步设置驱动库TFT_eSPI的默认配置文件
1,设置适配的屏幕 #define ST7789_DRIVER
2,设置屏幕大小 #define TFT_WIDTH 170
#define TFT_HEIGHT 320
3,设置屏幕驱动板端口和ESP8266对应的端口

// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
#define TFT_MISO  PIN_D6  // Automatically assigned with ESP8266 if not defined
#define TFT_MOSI  PIN_D7  // Automatically assigned with ESP8266 if not defined
#define TFT_SCLK  PIN_D5  // Automatically assigned with ESP8266 if not defined#define TFT_CS    PIN_D0  // Chip select control pin D8
#define TFT_DC    PIN_D3  // Data Command control pin
#define TFT_RST   PIN_D4  // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST  -1     // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
#define TFT_BL PIN_D1  // LED back-light (only for ST7789 with backlight control pin)

主代码

#include "ArduinoJson.h"
#include <TimeLib.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266WebServer.h>
#include <WiFiUdp.h>
#include <TFT_eSPI.h>
#include <SPI.h>
#include <TJpg_Decoder.h>
#include <EEPROM.h>
#include <Servo.h>
#include "loadingimg.h"
/*** Component objects ***/
LOADING_IMG  loadingimgclass;#include <WiFiManager.h>
//WiFiManager 参数
WiFiManager wm; // global wm instance/* *******字库、图片库******************************/
#include "font/ZdyLwFont_20.h"int AnimLoad = 0;           //开机图标显示指针记录
int AprevTimeLoad = 0;      //更新时间记录/* ************** 参数设置*********/
struct config_type
{char stassid[32];//定义配网得到的WIFI名长度(最大32字节)char stapsw[64];//定义配网得到的WIFI密码长度(最大64字节)
};//---------------修改此处""内的信息--------------------
//如开启WEB配网则可不用设置这里的参数,前一个为wifi ssid,后一个为密码
config_type wificonf = {{""}, {""}};//LCD屏幕相关设置
TFT_eSPI tft = TFT_eSPI(170,320);  // 引脚请自行配置tft_espi库中的 User_Setup.h文件
TFT_eSprite clk = TFT_eSprite(&tft);Servo servo;
#define PWM_DJ D8    //舵机控制
#define TOUCH_PIN D2    //触摸按钮
#define LCD_BL_PIN 5    //LCD背光引脚
uint16_t bgColor = 0x0000;
//其余状态标志位
int LCD_Rotation = 1;   //LCD屏幕方向
int LCD_BL_PWM = 70;//屏幕亮度0-100,默认10uint8_t Wifi_en = 1; //wifi状态标志位  1:打开    0:关闭unsigned long weaterTime = 0; //天气更新时间记录//EEPROM参数存储地址位
int BL_addr = 1;//被写入数据的EEPROM地址编号  1亮度
int wifi_addr = 30; //被写入数据的EEPROM地址编号  20wifi-ssid-psw//NTP服务器参数
static const char ntpServerName[] = "ntp6.aliyun.com";
const int timeZone = 8;     //东八区//wifi连接UDP设置参数
WiFiUDP Udp;
WiFiClient wificlient;
unsigned int localPort = 8000;//函数声明
time_t getNtpTime();
void sendNTPpacket(IPAddress &address);
void LCD_reflash(int en);
void savewificonfig();
void readwificonfig();
void deletewificonfig();/* ******函数******************************/
//wifi ssid,psw保存到eeprom
void savewificonfig()
{//开始写入uint8_t *p = (uint8_t*)(&wificonf);for (int i = 0; i < sizeof(wificonf); i++){EEPROM.write(i + wifi_addr, *(p + i)); //在闪存内模拟写入}delay(10);EEPROM.commit();//执行写入ROMdelay(10);
}
//删除原有eeprom中的信息
void deletewificonfig()
{config_type deletewifi = {{""}, {""}};uint8_t *p = (uint8_t*)(&deletewifi);for (int i = 0; i < sizeof(deletewifi); i++){EEPROM.write(i + wifi_addr, *(p + i)); //在闪存内模拟写入}delay(10);EEPROM.commit();//执行写入ROMdelay(10);
}//从eeprom读取WiFi信息ssid,psw
void readwificonfig()
{uint8_t *p = (uint8_t*)(&wificonf);for (int i = 0; i < sizeof(wificonf); i++){*(p + i) = EEPROM.read(i + wifi_addr);}
}//TFT屏幕输出函数
bool tft_output(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t* bitmap)
{if ( y >= tft.height() ) return 0;tft.pushImage(x, y, w, h, bitmap);// Return 1 to decode next blockreturn 1;
}//1、开机动画  屏幕加载动画替换进度条
byte loadNum = 6;           //原始默认为6
void loading(byte delayTime)//绘制进度条
{if (millis() - AprevTimeLoad > 1) //x ms切换一次         // int AprevTimeLoad = 0; 更新时间记录{AnimLoad++;                                           //int AnimLoad = 0;      开机图标显示指针记录AprevTimeLoad = millis();}if (AnimLoad == 36){AnimLoad = 0;}//调用函数显示图片,全局,TFT,loadingimgclass.printfloading(60,5,AnimLoad);clk.setColorDepth(8);clk.createSprite(200,60);//创建窗口clk.fillSprite(0x0000);   //填充率clk.setTextDatum(CC_DATUM);   //设置文本数据clk.setTextColor(TFT_ORANGE, 0x0000);clk.drawString("Hello inventor!", 100, 10, 2);//Connecting to WiFi......clk.setTextColor(TFT_WHITE, 0x0000);  clk.drawString("cat cat cat!", 100, 50, 2);//Connecting to WiFi......clk.pushSprite(60, 100); //窗口位置 130高度以下clk.deleteSprite();loadNum += 1;delay(delayTime);
}//WEB配网LCD显示函数
void Web_win()
{clk.setColorDepth(8);clk.createSprite(200,60);//创建窗口clk.fillSprite(0x0000);   //填充率clk.setTextDatum(CC_DATUM);   //设置文本数据clk.setTextColor(TFT_GREEN, 0x0000);clk.drawString("WiFi Connect Fail!", 100, 10, 2);//Connecting to WiFi......clk.setTextColor(TFT_YELLOW, 0x0000);  clk.drawString("SSID:AutoConnectAP", 100, 50, 2);//Connecting to WiFi......clk.pushSprite(60, 100); //窗口位置 130高度以下clk.deleteSprite();
}//WEB配网函数
void Webconfig()
{WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+APdelay(3000);wm.resetSettings(); // wipe settingsint customFieldLength = 40;WiFiManagerParameter  custom_bl("LCDBL", "LCD BackLight(1-100)", "8", 3);WiFiManagerParameter  p_lineBreak_notext("<p></p>");wm.addParameter(&p_lineBreak_notext);wm.addParameter(&custom_bl);wm.setSaveParamsCallback(saveParamCallback);std::vector<const char *> menu = {"wifi", "restart"};wm.setMenu(menu);// set dark themewm.setClass("invert");wm.setMinimumSignalQuality(20);  // set min RSSI (percentage) to show in scans, null = 8%bool res;// res = wm.autoConnect(); // auto generated AP name from chipidres = wm.autoConnect("AutoConnectAP"); // anonymous ap//  res = wm.autoConnect("AutoConnectAP","password"); // password protected apwhile (!res);
}String getParam(String name) {//read parameter from server, for customhmtl inputString value;if (wm.server->hasArg(name)) {value = wm.server->arg(name);}return value;
}void saveParamCallback() {LCD_BL_PWM = getParam("LCDBL").toInt();tft.fillScreen(0x0000);//清理屏幕Web_win();loadNum--;loading(1);if (EEPROM.read(BL_addr) != LCD_BL_PWM){EEPROM.write(BL_addr, LCD_BL_PWM);EEPROM.commit();delay(5);}//屏幕亮度Serial.println("亮度调整为:");analogWrite(LCD_BL_PIN, 1023 - (LCD_BL_PWM * 10));Serial.println(LCD_BL_PWM);
}void  draweye(){int  isTouch = digitalRead(TOUCH_PIN);if (isTouch == HIGH) {  //接收到触摸信号clk.setColorDepth(8);clk.createSprite(200,60);//创建窗口clk.fillSprite(0x0000);   //填充率clk.fillRoundRect(1, 25, 30, 5, 8,TFT_WHITE);clk.fillRoundRect(169, 25, 30, 5, 8,TFT_WHITE);clk.pushSprite(60, 50); //窗口位置 130高度以下clk.deleteSprite();servo.write(90);delay(100);} else {clk.setColorDepth(8);clk.createSprite(200,60);//创建窗口clk.fillSprite(0x0000);   //填充率clk.fillRoundRect(1, 1, 30, 60, 8,TFT_WHITE);clk.fillRoundRect(169, 1, 30, 60, 8,TFT_WHITE);clk.pushSprite(60, 50); //窗口位置 130高度以下clk.deleteSprite();servo.write(100);delay(100);}
}void setup()
{Serial.begin(115200);EEPROM.begin(1024);Serial.println("正在连接WIFI ");// WiFi.forceSleepWake();// wm.resetSettings();    //在初始化中使wifi重置,需重新配置WiFi//从eeprom读取背光亮度设置if (EEPROM.read(BL_addr) > 0 && EEPROM.read(BL_addr) < 100)LCD_BL_PWM = EEPROM.read(BL_addr);pinMode(LCD_BL_PIN, OUTPUT);analogWrite(LCD_BL_PIN, 1023 - (LCD_BL_PWM * 10));pinMode(TOUCH_PIN,INPUT);servo.attach(D8);tft.begin(); /* TFT init */tft.invertDisplay(1);//反转所有显示颜色:1反转,0正常tft.setRotation(LCD_Rotation);tft.fillScreen(0x0000);tft.setTextColor(TFT_BLACK, bgColor);readwificonfig();//读取存储的wifi信息Serial.print("正在连接WIFI ");Serial.println(wificonf.stassid);WiFi.begin(wificonf.stassid, wificonf.stapsw);TJpgDec.setJpgScale(1);TJpgDec.setSwapBytes(true);TJpgDec.setCallback(tft_output);while (WiFi.status() != WL_CONNECTED){loading(30);if (loadNum >= 194){Web_win();//显示配网Webconfig();break;}}delay(10);while (loadNum < 194) //让动画走完{loading(1);}if (WiFi.status() == WL_CONNECTED){strcpy(wificonf.stassid, WiFi.SSID().c_str()); //名称复制strcpy(wificonf.stapsw, WiFi.psk().c_str()); //密码复制savewificonfig(); //保存wifi密码readwificonfig();}Udp.begin(localPort);setSyncProvider(getNtpTime);setSyncInterval(300);TJpgDec.setJpgScale(1);TJpgDec.setSwapBytes(true);TJpgDec.setCallback(tft_output);tft.fillScreen(TFT_BLACK);//清屏WiFi.forceSleepBegin(); //wifi offSerial.println("WIFI休眠......");Wifi_en = 0;draweye();
}void loop()
{//LCD_reflash(0);draweye();
}//屏幕滚动
int currentIndex = 0;
int lastIndex = 0;
void LCD_reflash(int en)
{//两秒钟更新一次if (second() % 2 == 0 && lastIndex != second()) {lastIndex = second(); //设置一样scrollBanner();}if (millis() - weaterTime > 60000 ) { //10分钟更新一次if (Wifi_en == 0){WiFi.forceSleepWake();//wifi onSerial.println("WIFI恢复......");Wifi_en = 1;}if (WiFi.status() == WL_CONNECTED){Serial.println("WIFI已连接");weaterTime = millis();while (!getNtpTime());WiFi.forceSleepBegin(); // Wifi OffSerial.println("WIFI休眠......");Wifi_en = 0;}}
}TFT_eSprite clkb = TFT_eSprite(&tft);
String scrollText[7];void scrollBanner() {scrollText[0] = "实时天气000 ";scrollText[1] = "空气质量 1";scrollText[2] = "风向 2";scrollText[3] = "今日as3" ;scrollText[4] = "最低温度4";scrollText[5] = "最高温度5";if (scrollText[currentIndex]){clkb.setColorDepth(8);/***绘制相关文字***/clkb.loadFont(ZdyLwFont_20);clkb.createSprite(160, 20);clkb.fillSprite(bgColor);clkb.setTextWrap(false);clkb.setTextDatum(CC_DATUM);clkb.setTextColor(TFT_SILVER, bgColor);clkb.drawString(scrollText[currentIndex], 74, 16,2);clkb.pushSprite(100, 5);clkb.deleteSprite();clkb.unloadFont();if (currentIndex >= 5)currentIndex = 0;  //回第一个elsecurrentIndex += 1;  //准备切换到下一个}}/*-------- NTP code ----------*/
const int NTP_PACKET_SIZE = 48; // NTP时间在消息的前48字节中
byte packetBuffer[NTP_PACKET_SIZE]; //buffer to hold incoming & outgoing packets//获取时间
time_t getNtpTime()
{IPAddress ntpServerIP; // NTP server's ip addresswhile (Udp.parsePacket() > 0) ; // discard any previously received packetsWiFi.hostByName(ntpServerName, ntpServerIP);sendNTPpacket(ntpServerIP);uint32_t beginWait = millis();while (millis() - beginWait < 1500) {int size = Udp.parsePacket();if (size >= NTP_PACKET_SIZE) {Serial.println("Receive NTP Response");Udp.read(packetBuffer, NTP_PACKET_SIZE);  // read packet into the bufferunsigned long secsSince1900;// convert four bytes starting at location 40 to a long integersecsSince1900 =  (unsigned long)packetBuffer[40] << 24;secsSince1900 |= (unsigned long)packetBuffer[41] << 16;secsSince1900 |= (unsigned long)packetBuffer[42] << 8;secsSince1900 |= (unsigned long)packetBuffer[43];//Serial.println(secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR);return secsSince1900 - 2208988800UL + timeZone * SECS_PER_HOUR;}}return 0; // 无法获取时间时返回0
}// 向NTP服务器发送请求
void sendNTPpacket(IPAddress &address)
{// set all bytes in the buffer to 0memset(packetBuffer, 0, NTP_PACKET_SIZE);// Initialize values needed to form NTP request// (see URL above for details on the packets)packetBuffer[0] = 0b11100011;   // LI, Version, ModepacketBuffer[1] = 0;     // Stratum, or type of clockpacketBuffer[2] = 6;     // Polling IntervalpacketBuffer[3] = 0xEC;  // Peer Clock Precision// 8 bytes of zero for Root Delay & Root DispersionpacketBuffer[12] = 49;packetBuffer[13] = 0x4E;packetBuffer[14] = 49;packetBuffer[15] = 52;// all NTP fields have been given values, now// you can send a packet requesting a timestamp:Udp.beginPacket(address, 123); //NTP requests are to port 123Udp.write(packetBuffer, NTP_PACKET_SIZE);Udp.endPacket();
}

loadingimg.cpp

#include "loadingimg.h"
#include <TJpg_Decoder.h>//显示白色36*60大小数字
void LOADING_IMG::printfloading(int x,int y,int numn)
{switch (numn){case 0:TJpgDec.drawJpg(x, y, ii0, sizeof(ii0));break;case 1:TJpgDec.drawJpg(x, y, ii1, sizeof(ii1));break;case 2:TJpgDec.drawJpg(x, y, ii2, sizeof(ii2));break;case 3:TJpgDec.drawJpg(x, y, ii3, sizeof(ii3));break;case 4:TJpgDec.drawJpg(x, y, ii4, sizeof(ii4));break;case 5:TJpgDec.drawJpg(x, y, ii5, sizeof(ii5));break;case 6:TJpgDec.drawJpg(x, y, ii6, sizeof(ii6));break;case 7:TJpgDec.drawJpg(x, y, ii7, sizeof(ii7));break;case 8:TJpgDec.drawJpg(x, y, ii8, sizeof(ii8));break;case 9:TJpgDec.drawJpg(x, y, ii9, sizeof(ii9));break;case 10:TJpgDec.drawJpg(x, y, ii10, sizeof(ii10));break;case 11:TJpgDec.drawJpg(x, y, ii11, sizeof(ii11));break;case 12:TJpgDec.drawJpg(x, y, ii12, sizeof(ii12));break;case 13:TJpgDec.drawJpg(x, y, ii13, sizeof(ii13));break;case 14:TJpgDec.drawJpg(x, y, ii14, sizeof(ii14));break;case 15:TJpgDec.drawJpg(x, y, ii15, sizeof(ii15));break;case 16:TJpgDec.drawJpg(x, y, ii16, sizeof(ii16));break;case 17:TJpgDec.drawJpg(x, y, ii17, sizeof(ii17));break;case 18:TJpgDec.drawJpg(x, y, ii18, sizeof(ii18));break;case 19:TJpgDec.drawJpg(x, y, ii19, sizeof(ii19));break;case 20:TJpgDec.drawJpg(x, y, ii20, sizeof(ii20));break;case 21:TJpgDec.drawJpg(x, y, ii21, sizeof(ii21));break;case 22:TJpgDec.drawJpg(x, y, ii22, sizeof(ii22));break;case 23:TJpgDec.drawJpg(x, y, ii23, sizeof(ii23));break;case 24:TJpgDec.drawJpg(x, y, ii24, sizeof(ii24));break;case 25:TJpgDec.drawJpg(x, y, ii25, sizeof(ii25));break;case 26:TJpgDec.drawJpg(x, y, ii26, sizeof(ii26));break;case 27:TJpgDec.drawJpg(x, y, ii27, sizeof(ii27));break;case 28:TJpgDec.drawJpg(x, y, ii28, sizeof(ii28));break;case 29:TJpgDec.drawJpg(x, y, ii29, sizeof(ii29));break;case 30:TJpgDec.drawJpg(x, y, ii30, sizeof(ii30));break;case 31:TJpgDec.drawJpg(x, y, ii31, sizeof(ii31));break;case 32:TJpgDec.drawJpg(x, y, ii32, sizeof(ii32));break;case 33:TJpgDec.drawJpg(x, y, ii33, sizeof(ii33));break;case 34:TJpgDec.drawJpg(x, y, ii34, sizeof(ii34));break;case 35:TJpgDec.drawJpg(x, y, ii35, sizeof(ii35));break;default:Serial.println("显示AnimLoad错误");break;}
}

loadingimg.h


#define LOADING_IMG_H
#include <TFT_eSPI.h> 
//将图片转换过的。h文件
#include "img/picture/donghua/ii0.h"
#include "img/picture/donghua/ii1.h"
#include "img/picture/donghua/ii2.h"
#include "img/picture/donghua/ii3.h"
#include "img/picture/donghua/ii4.h"
#include "img/picture/donghua/ii5.h"
#include "img/picture/donghua/ii6.h"
#include "img/picture/donghua/ii7.h"
#include "img/picture/donghua/ii8.h"
#include "img/picture/donghua/ii9.h"
#include "img/picture/donghua/ii10.h"
#include "img/picture/donghua/ii11.h"
#include "img/picture/donghua/ii12.h"
#include "img/picture/donghua/ii13.h"
#include "img/picture/donghua/ii14.h"
#include "img/picture/donghua/ii15.h"
#include "img/picture/donghua/ii16.h"
#include "img/picture/donghua/ii17.h"
#include "img/picture/donghua/ii18.h"
#include "img/picture/donghua/ii19.h"
#include "img/picture/donghua/ii20.h"
#include "img/picture/donghua/ii21.h"
#include "img/picture/donghua/ii22.h"
#include "img/picture/donghua/ii23.h"
#include "img/picture/donghua/ii24.h"
#include "img/picture/donghua/ii25.h"
#include "img/picture/donghua/ii26.h"
#include "img/picture/donghua/ii27.h"
#include "img/picture/donghua/ii28.h"
#include "img/picture/donghua/ii29.h"
#include "img/picture/donghua/ii30.h"
#include "img/picture/donghua/ii31.h"
#include "img/picture/donghua/ii32.h"
#include "img/picture/donghua/ii33.h"
#include "img/picture/donghua/ii34.h"
#include "img/picture/donghua/ii35.h"class LOADING_IMG
{
private:public:void printfloading(int numx,int numy,int numn);};

相关文章:

ESP8266 (5),驱动屏幕

代码 第一步设置驱动库TFT_eSPI的默认配置文件 1&#xff0c;设置适配的屏幕 #define ST7789_DRIVER 2&#xff0c;设置屏幕大小 #define TFT_WIDTH 170 #define TFT_HEIGHT 320 3&#xff0c;设置屏幕驱动板端口和ESP8266对应的端口 // For NodeMCU - use pin numbers in the…...

ChatGPT-01 用ChatGPT指令,自学任何领域的系统知识

1. 指令位置 Github仓库&#xff1a;Mr Ranedeer AI Tutor 但是需要开通chatgtp plus版本&#xff0c;并且打开代码解释器 2 使用 学习内容 开始学习 GPT甚至可以给你思考题&#xff0c;给出的答案还能进行评价 配置 通过配置表修改 深度 学习风格 沟通风格 语气风格 …...

android studio模拟器不能打开

Andriod:The selected AVD is currently running in the Emulator. Please exit the emulator instance… 1.点击 2.删除下面文件 3.重新打开即可 参考...

设计模式学习笔记 - 面向对象 - 5.接口和抽象类的区别

简述 在面向对象编程中&#xff0c;抽象类和接口是常被用到的语法概念&#xff0c;是面向对象四大特性&#xff0c;以及很多设计模式、设计思想、设计原则实现的基础。它们之间的区别是什么&#xff1f;什么时候用接口&#xff1f;什么时候用抽象类&#xff1f;抽象类和接口存…...

PolarDN MISC做题笔记

cat flag 使用01打开flag.png,发现图片尾部有padding的数据。D0 CF 11 E0 A1 B1 1A E1为office2007以前版本的文件头。将其另存为flag.doc,打开发现提示需要密码。&#xff08;可以注意到&#xff1a;D0CF11E0非常类似DOCFILE&#xff09; 使用john的office2john.py 提取hash …...

Web安全之浅见

备注&#xff1a;这是我在2017年在自己的网站上写的文章&#xff0c;今天迁移过来。 昨天去参加了公司组织的一个关于网络安全的培训&#xff0c;了解了很多关于网络安全方面的知识&#xff0c;也才意识到网络安全是一项极其重要的领域。 本篇文章主要聊聊Web安全。不过我对于网…...

企业安全建设工具推荐

全自动化挖洞&#xff0c;助力企业安全建设&#xff0c;一键实现域名扫描、IP 发现、端口扫描、服务识别、网站识别、漏洞探测、分析发现、合规检查。 使用方式&#xff1a; 录入目标企业名称即可开始使用 技术细节&#xff1a; 第一步&#xff1a;通过企业主体关联企业备案…...

力扣(leetcode)第455题分发饼干(Python)

455.分发饼干 题目链接:455.分发饼干 假设你是一位很棒的家长,想要给你的孩子们一些小饼干。但是,每个孩子最多只能给一块饼干。 对每个孩子 i,都有一个胃口值 g[i],这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 j,都有一个尺寸 s[j] 。如果 s[j] >= g[i…...

隐私也要付费?Meta公司为收集用户数据再出“奇招”

Cybernews网站消息&#xff0c;有相关人士表示&#xff0c;如果欧洲数据保护委员会&#xff08;EDPB&#xff09;不明确指出Meta公司的“付费或同意”的模式违反了欧盟的隐私法规&#xff0c;那么这一模式很可能会被大规模复制&#xff0c;危及数百万欧洲公民的自由选择权。 自…...

Android14 InputManager-InputReader的处理

IMS启动时会调用InputReader.start()方法 InputReader.cpp status_t InputReader::start() {if (mThread) {return ALREADY_EXISTS;}mThread std::make_unique<InputThread>("InputReader", [this]() { loopOnce(); }, [this]() { mEventHub->wake(); });…...

web前端安全性——JSONP劫持

1、JSONP概念 JSONP(JSON with Padding)是JSON的一种“使用模式”&#xff0c;可用于解决主流浏览器的跨域数据访问的问题。由于同源策略&#xff0c;协议IP端口有任意不同都会导致请求跨域&#xff0c;而HTML的script元素是一个例外。利用script元素的这个开放策略&#xff0…...

从零开始学HCIA之广域网技术03

1、LCP中包含的报文类型 &#xff08;1&#xff09;Configure-Request&#xff08;配置请求&#xff09;&#xff0c;链路层协商过程中发送的第一个报文&#xff0c;该报文表明点对点双方开始进行链路层参数的协商。 &#xff08;2&#xff09; Configure-Ack&#xff08;配置…...

AI推介-大语言模型LLMs论文速览(arXiv方向):2024.01.01-2024.01.10

1.Pre-trained Large Language Models for Financial Sentiment Analysis 标题:用于金融情感分析的预训练大型语言模型 author:Wei Luo, Dihong Gong date Time:2024-01-10 paper pdf:http://arxiv.org/pdf/2401.05215v1 摘要&#xff1a; 金融情感分析是指将金融文本内容划分…...

Redis降低内存占用(二)分片结构

一、分区方法&#xff1a; 分片&#xff0c;也称为分区。Redis提供了多种分区实现方案: 1、哈希分区 2、区间分区 3、一致性哈希分区 4、虚拟分区 5、LUA脚本实现分片 二、...

vue大文件读取部分内容,避免重复加载大文件,造成流量浪费

使用场景&#xff1a;项目点云地图是pcd文件&#xff0c;但是文件可能上百兆&#xff0c;我需要获取到文件中的版本信息&#xff0c;跟本地的缓存文件做比较&#xff0c;如果不一致&#xff0c;才会加载整个文件。从而节省流量。 避免重复加载整个“.pcd文件&#xff0c;以最大…...

5G网络RedCap

RedCap&#xff1a;RedCap&#xff08;Reduced Capability&#xff09;&#xff0c;即“降低能力”。它是3GPP在5G R17阶段&#xff0c;针对速率、时延要求不高的5G应用场景&#xff0c;专门推出的一种新技术标准协议&#xff0c;旨在全面提升5G网络质量和覆盖率&#xff0c;也…...

vue+springboot登录与注册功能的实现

①首先写一个登录页面 <template> <div style"background-color: #42b983;display: flex;align-items: center;justify-content: center;height: 100vh"><div style"background-color: white;display: flex;width: 50%;height: 50%;overflow: h…...

数据结构D3作业

1. 2. 按位插入 void insert_pos(seq_p L,datatype num,int pos) { if(LNULL) { printf("入参为空&#xff0c;请检查\n"); return; } if(seq_full(L)1) { printf("表已满&#xff0c;不能插入\n"); …...

Spring框架@Autowired注解进行字段时,使用父类类型接收子类变量,可以注入成功吗?(@Autowired源码跟踪)

一、 前言 平常我们在使用spring框架开发项目过程中&#xff0c;会使用Autowired注解进行属性依赖注入&#xff0c;一般我们都是声明接口类型来接收接口实现变量&#xff0c;那么使用父类类型接收子类变量&#xff0c;可以注入成功吗&#xff1f;答案是肯定可以的&#xff01;…...

【springblade】springblade(bladeX) 数据权限失效原因分析

文章目录 数据权限接口权限 前言&#xff1a;最近博主在按照bladeX官方文档 配置数据权限 结果发现失效了&#xff0c;网上搜了一下没找到合适的答案&#xff0c;本着求人不如求己的精神&#xff0c;自己调试了一下发现了问题所在&#xff0c;也大致看了一下bladeX的权限逻辑。…...

单例模式的几种实现方式

在Java中&#xff0c;实现单例模式主要有几种方式&#xff1a;懒汉式、饿汉式、双重检查锁定、静态内部类和枚举。每种方式都有其特点和适用场景。 1. 饿汉式&#xff08;线程安全&#xff09; 饿汉式是最简单的一种实现方式&#xff0c;通过静态初始化实例&#xff0c;保证了…...

鸿蒙OS运行报错 ‘ToDoListItem({ item })‘ does not meet UI component syntax.

在学习harmonyOS时&#xff0c;原本是好好运行的。但是突然报错 ToDoListItem({ item }) does not meet UI component syntax. 一脸懵逼&#xff0c;以为是自己语法问题检查了半天也没问题。 网上搜索了一下&#xff0c;说把多余的js\map文件删除就行 才发现我的 鸿蒙的开…...

React18源码: reconciler执行流程

reconciler执行流程 1 &#xff09;概述 此处先归纳一下react-reconciler包的主要作用&#xff0c;将主要功能分为4个方面&#xff1a; 输入&#xff1a;暴露api函数&#xff08;如&#xff1a;scheduleUpdateOnFiber&#xff09;, 供给其他包&#xff08;如react包&#xff0…...

mapbox面图层标注

mapbox并没有一个属性类似于’text-field’的symbol图层的直接可以标注的办法&#xff0c;这里笔者提供两种其他的面图层标注的办法用来大家参考 效果图 方案一 把面图层当做点图层直接展示 在mapbox里面&#xff0c;面图层是可以直接渲染成线图层和点图层的&#xff0c;这里…...

MySQL|MySQL基础(求知讲堂-学习笔记【详】)

MySQL基础 目录 MySQL基础一、 MySQL的结构二、 管理数据库1&#xff09;查询所有的数据库2&#xff09;创建数据库3&#xff09;修改数据库的字符编码4&#xff09;删除数据库5&#xff09;切换操作的数据库 三、表的概念四、字段的数据类型4.1 整型4.2 浮点型(float和double)…...

10.docker exec -it /bin/bash报错解决、sh与bash区别

报错 进入容器时&#xff0c;报如下错误 dockeruserdell-PowerEdge-R740:~$ docker exec -it daf2 /bin/bash OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown…...

查询数据库的编码集Oracle,MySQL

1、查询数据库的编码集Oracle,MySQL 1.1、oracle select * from v$nls_parameters where parameterNLS_CHARACTERSET; 查询版本&#xff1a;SELECT * FROM v$version 2、MySQL编码集 SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SC…...

电商数据采集+跨境电商|API电商数据采集接口洞悉数字新零售发展

随着全球经济一体化和电子商务的快速发展&#xff0c;网络购物的需求日益增加。不断涌现的电商企业使得行业的竞争情况愈演愈烈。在这种情况下&#xff0c;企业不仅要加大经营力度&#xff0c;还要在自己的基础设施和技术上持续投入&#xff0c;才能更好的适应市场和消费习惯。…...

linux之用户和用户组

文章目录 一、简介1.1 用户1.2 用户组1.3 UID和GID1.4 用户账户分类 二、用户2.1 添加新的用户账号&#xff1a;useradd2.2 删除账号&#xff1a;userdel2.3 修改账号&#xff1a;usermod(modmodify)2.4 用户口令的管理:passwd2.5 切换用户&#xff1a;su 三、用户组3.1 增加一…...

人工智能深度学习

目录 人工智能 深度学习 机器学习 神经网络 机器学习的范围 模式识别 数据挖掘 统计学习 计算机视觉 语音识别 自然语言处理 机器学习的方法 回归算法 神经网络 SVM&#xff08;支持向量机&#xff09; 聚类算法 降维算法 推荐算法 其他 机器学习的分类 机器…...