elasticsearch 环境搭建和基本操作
参考资料
-
适合后端编程人员的elasticsearch快速实战教程
-
ElasticSearch最新实战教程
-
ElasticSearch配套笔记
-
自制搜索引擎
-
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/setup.html
restful风格的api
REST 设计风格
例如以下springboot示例
@RestController
@RequestMapping("rest")
public class ResuFulController{@GetMapping("getOne/{id}/{name}")public User getOne(@PathVariable("id") String id, @PathVariable("name") String name){System.out.println("id: "+id);return new User("demo",12);}
}
REST:表现层状态转化(Representational State Transfer),如果一个架构符合REST原则,就称它为RESTful架构风格。
-
资源:就是网络上的一个实体
-
表现层:资源具体呈现出来的形式,叫做"表现层"(Representation)。
-
状态转化:客户端想要操作服务器,必须通过某种手段让服务器端发生状态转化(State Transfer)。而这种转化是建立在表现层之上的,所以就是"表现层状态转化"。
REST原则就是指一个URL代表一个唯一资源,并且通过HTTP协议里面四个动词:GET、POST、PUT、DELETE对应四种服务器端的基本操作:
- GET用来获取资源
- POST用来添加资源(也可以用于更新资源)
- PUT用来更新资源
- DELETE用来删除资源
全文检索
全文检索是计算机程序通过扫描文章中的每一个词,对每一个词建立一个索引,指明该词在文章中出现的次数和位置。当用户查询时根据建立的索引查找。
全文检索以文本作为检索对象,找出含有指定词汇的文本。全面、准确和快速是衡量全文检索系统的关键指标。
- 只处理文本
- 不处理语义
- 搜索时英文不区分大小写
- 结果列表有相关度排序
ElasticSearch简称ES,是基于Apache Lucenei构建的开源搜索引睾。Lucene本身就可以被认为迄今为止性能最好的一款开源搜索引擎工具包,但是lucene的PI相对复杂,需要深厚的搜索理论。ES是采用java语言编写,提供了简单易用的RestFul API,开发者可以使用其简单的RestFul API,开发相关的搜索功能,从而避免lucenel的复杂性。
ES主要以轻量级JSON作为数据存储格式,与MongoDB有点类似,但它在读写性能上优于MongoDB。同时也支持地理位置查询,还方便地理位置和文本混合查询。以及统计、日志类数据存储和分析、可视化
ES stack的安装
https://www.elastic.co/guide/en/elasticsearch/reference/8.6/setup.html
官方提供了不同的安装方式
- 下载压缩包安装,windows的zip包
- 包管理器安装
- docker安装
需要提前配置好java环境
安装elasticsearch
使用rpm安装8.6.2版本的目录结构如下
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.6.2-x86_64.rpm
$ sudo rpm --install elasticsearch-8.6.2-x86_64.rpm
$ rpm -ql elasticsearch
/etc/elasticsearch
/etc/elasticsearch/elasticsearch-plugins.example.yml
/etc/elasticsearch/elasticsearch.yml
/etc/elasticsearch/jvm.options
/etc/elasticsearch/jvm.options.d
/etc/elasticsearch/log4j2.properties
/etc/elasticsearch/role_mapping.yml
/etc/elasticsearch/roles.yml
/etc/elasticsearch/users
/etc/elasticsearch/users_roles
/etc/sysconfig/elasticsearch
/usr/lib/sysctl.d/elasticsearch.conf
/usr/lib/systemd/system/elasticsearch.service
/usr/share/elasticsearch/bin
/usr/share/elasticsearch/bin/elasticsearch
...
/usr/share/elasticsearch/lib/...
/usr/share/elasticsearch/jdk/...
/usr/share/elasticsearch/modules/...
...
/usr/share/elasticsearch/plugins
/var/lib/elasticsearch
/var/log/elasticsearch# 卸载
$ sudo rpm -e elasticsearch
目前es版本已经更新到7和8,和视频版本一致这里使用压缩包安装elasticsearch6.8.0版本
elasticsearch发行版本列表,https://www.elastic.co/cn/downloads/past-releases#elasticsearch
Elasticsearch 6.8.0,https://www.elastic.co/cn/downloads/past-releases/elasticsearch-6-8-0
注意:es无法在root用户下运行
解压和安装
tar -zxvf elasticsearch-6.8.0.tar.gz
目录结构,可见和rpm包的目录一致
- bin 可执行的二进制文件的目录
- config 配置文件的目录
- lib 运行时依赖的库
- logs 运行时日志文件
- modules 运行时依赖的模块
- plugins 可以安装官方以及第三方插件
启动服务
./bin/elasticsearch
es并没有提供webui界面,测试启动返回json信息
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vOPxXnrT-1679215134302)(assets/image-20230319123324540.png)]
$ curl http://localhost:9200
{"name" : "9cWvHvU","cluster_name" : "elasticsearch","cluster_uuid" : "TLtGg3X5QjiK4-5-7XVBMg","version" : {"number" : "6.8.0","build_flavor" : "default","build_type" : "tar","build_hash" : "65b6179","build_date" : "2019-05-15T20:06:13.172855Z","build_snapshot" : false,"lucene_version" : "7.7.0","minimum_wire_compatibility_version" : "5.6.0","minimum_index_compatibility_version" : "5.0.0"},"tagline" : "You Know, for Search"
}
为了公开访问需要调整配置文件的监听端口为0.0.0.0
$ vim config/elasticsearch.yml
network.host: 0.0.0.0
生产环境的资源要求较高,重启可能会出现的报错如下
[1]: max file descriptiors [4096] for elasticsearch process is too low, increase to as least [65535]
[2]: max numer of threads [3082] for user [ec2-user] is too low, increase to as least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
错误1,修改配置文件,对当前登录的用户生效,重新登录使配置生效
$ sudo vim /etc/security/limits.conf
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
错误2,修改系统配置
$ sudo vim /etc/security/limits.d/20-nproc.conf
ec2-user soft nproc 4096
错误3,修改系统配置
$ sudo vim /etc/sysctl.conf
vm.max_map_count=655360
$ sudo sysctl -p
fs.inotify.max_user_watches = 524288
vm.max_map_count = 655360
测试远程访问
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J4AUXI1R-1679215134304)(assets/image-20230319125149742.png)]
安装kibana
安装步骤和elasticsearch相同,和es版本保持一致。感觉类似于grafana和prometheus的关系
下载地址,https://www.elastic.co/cn/downloads/past-releases/kibana-6-8-0
安装
tar -xzvf kibana-6.8.0-linux-x86_64.tar.gz
修改配置文件,指向es主机地址
$ vim kibana-6.8.0-linux-x86_64/config/kibana.yml
server.host: "0.0.0.0" # kibana服务器主机地址
elasticsearch.hosts: ["http://127.0.0.1:9200"] # ES服务器地址
启动
./bin/kibana
访问
http://127.0.0.1:5601/app/kibana
基本概念
-
接近实时(NRT Near Real Time ),从索引一个文档直到这个文档能够被搜索到有一个轻微的延迟(通常是1秒内)
-
索引(index),索引就是拥有相似特征的文档的集合。一个索引由一个名字来标识(必须全部是小写字母)。在集群中可以定义任意多的索引。
-
类型(type),在一个索引中可以定义一种或多种类型。类型是索引的一个逻辑上的分类/分区,其语义完全由用户确定。
-
映射(Mapping),类似于传统关系型数据中table的schema,用于定义一个索引(index)中的类型(type)的数据的结构。可以手动创建type(相当于table)和mapping(相关与schema)。在默认配置下,ES可以根据插入的数据自动地创建type及其mapping。 mapping中主要包括字段名、字段数据类型和字段索引类型
-
文档(document),文档是一个可被索引的基础信息单元,类似于表中的一条记录(json)
以下是5.x版本和6.x版本的模型如下
NOTE: 在5.x版本以前可以在一个索引中定义多个类型,6.x之后版本也可以使用但是不推荐,在7~8.x版本中彻底移除一个索引中创建多个类型
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kJ6PkrJG-1679215134306)(assets/image-20230319141929186.png)]
创建测试数据集
官方提供了示例数据,加载示例数据的方式
wget https://download.elastic.co/demos/kibana/gettingstarted/logs.jsonl.gz
wget https://download.elastic.co/demos/kibana/gettingstarted/accounts.zip
wget https://download.elastic.co/demos/kibana/gettingstarted/shakespeare_6.0.json
数据集创建
PUT /shakespeare
{"mappings": {"doc": {"properties": {"speaker": {"type": "keyword"},"play_name": {"type": "keyword"},"line_id": {"type": "integer"},"speech_number": {"type": "integer"}}}}
}PUT /bank
{"mappings": {"account": {"properties": {"account_number": {"type": "integer"},"balance": {"type": "integer"},"firstname": {"type": "keyword"},"lastname": {"type": "keyword"},"age": {"type": "integer"},"gender": {"type": "keyword"},"address": {"type": "text"},"employer": {"type": "keyword"},"email": {"type": "keyword"},"city": {"type": "keyword"},"state": {"type": "keyword"}}}}
}
查看索引
GET /_cat/indices?vhealth status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .kibana_1 yLxMUBLfT3GHGnVuvhXbJg 1 0 4 0 14.5kb 14.5kb
yellow open bank jJujmI8WQnGgKbtutfhkvw 5 1 1000 0 327.2kb 327.2kb
green open .kibana_task_manager 5itOVO27SIuSc9qE73dabw 1 0 2 0 12.6kb 12.6kb
yellow open shakespeare Mv98eNoUTpaGIBJXkBmR3Q 5 1 111396 0 21.8mb 21.8mb
查看数据文档
$ curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.jsonGET /shakespeare/doc/_search
{"query": {"match_all": {}}
}$ curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.jsonGET /bank/account/_search
{"query": {"match_all": {}}
}
简单的测试数据集
PUT /ems
{"mappings":{"emp":{"properties":{"name":{ "type":"text" },"age":{ "type":"integer" },"birth":{ "type":"date" },"content":{ "type":"text" },"address":{ "type":"keyword" }}}}
}PUT /ems/emp/_bulk
{"index":{}}{"name":"apple","age":23,"bir":"2019-8-22","content":"Choosing a good MVC framework for the development team is a difficult task, and it takes a high level of experience to choose among the many possible solutions","address":"beijing"}
{"index":{}}{"name":"banana","age":24,"bir":"2021-6-6","content":"The Spring framework is a layered architecture consisting of seven well-defined modules. The Spring module is built on top of a core container that defines how beans are created, configured, and managed","address":"shandong"}
{"index":{}}{"name":"cat","age":8,"bir":"2023-1-16","content":"As the micro-services framework of the Java language, Spring Cloud relies on Spring Boot for fast development, continuous delivery, and easy deployment. Spring Cloud has a lot of components covering all aspects of micro-services, and it's getting better and better with the open source community of Spring and companies like Netflix and Pivotal","address":"shanghai"}
{"index":{}}{"name":"dog","age":9,"bir":"2022-9-24","content":"Spring's goal is to simplify Java development in all its aspects. This leads to more explanations of how Spring simplifies Java Development?","address":"nanjing"}
{"index":{}}{"name":"ears","age":43,"bir":"2018-12-12","content":"Redis is an open-source, web-enabled, memory-based, persistent, Key-Value database written in ANSI C, and provides apis in multiple languages","address":"hangzhou"}
{"index":{}}{"name":"fat","age":59,"bir":"2017-12-23","content":"Elastic search is a Lucene-based search server. It provides a distributed, multi-user, full-text search engine based on the RESTful web interface","address":"fujian"}GET /ems/emp/_search
{"query": {"match_all": {}}
}
基本操作
主要是使用devtools来进行前端命令操作
索引(index)操作
index的增删改查
# 创建索引
PUT /indexname/
# 删除索引
DELETE /indexname
# 删除所有索引[ElasticSearch会自带两个索引,如果删除kibana客户端将不能使用,只能重启]
DELETE /*
# 查看索引信息
GET /_cat/indices?v
类型(type)操作
创建index指定mapping,要求index不存在
- 对于类型,es7每个索引只有一种类型
- 对于属性类型,可以设置为 text , keyword , date ,integer, long , double , boolean,ip
PUT /book
{"mappings": {"musicbook": { "properties": {"name":{"type":"keyword"},"price":{"type":"double"},"desc":{"type":"text"}}}}
}
output:
{"acknowledged" : true,"shards_acknowledged" : true,"index" : "book"
}
查看type
GET /book/_mapping
output:
{"book" : {"mappings" : {"musicbook" : {"properties" : {"desc" : {"type" : "text"},"name" : {"type" : "keyword"},"price" : {"type" : "double"}}}}}
}
文档(document)操作
插入文档
PUT /book/musicbook/1
{"name":"ClassicMusic","price":"22.0","desc":"This is a book about classic music"
}
output:
{"_index" : "book","_type" : "musicbook","_id" : "1","_version" : 3,"result" : "created","_shards" : {"total" : 2,"successful" : 1,"failed" : 0},"_seq_no" : 2,"_primary_term" : 1
}
查询文档
GET /book/musicBook/1
output:
{"_index" : "book","_type" : "musicbook","_id" : "1","_version" : 1,"_seq_no" : 0,"_primary_term" : 1,"found" : true,"_source" : {"name" : "ClassicMusic","price" : "22.0","desc" : "This is a book about classic music"}
}
删除文档
DELETE /book/musicBook/1
更新文档
POST /book/musicbook/1
{"name":"PopMusic", "price":"17.0"
}
output:
{"_index" : "book","_type" : "musicbook","_id" : "1","_version" : 2,"result" : "updated","_shards" : {"total" : 2,"successful" : 1,"failed" : 0},"_seq_no" : 1,"_primary_term" : 1
}
再次查询文档发现之前的其他字段都被覆盖掉,不想覆盖需要以下方式更新
POST /book/musicbook/1/_update
{"doc": {"price":"40"}
}
批量操作
批量操作只是将多个操作写在一条命令中,并非原子操作,仍旧分步执行,并且不会由于单个命令失败而停止执行后续命令
同时增加两个文档
PUT /book/musicbook/_bulk
{"index":{"_id": "3"}}{ "name":"America's Music", "price":"57","des":"An ear-opening exploration of music's New World, from Puritan psalmody to Hamilton"}
{"index":{"_id": "4"}}{"name":"Basic Music Theory","price":"48","desc":"The text covers various concepts in music theory, some of which are fundamental, and others are advanced and complex"}
同时修改和删除文档
PUT /book/musicbook/_bulk
{"update":{"_id":"3"}}{"doc":{"name":"after change"}}
{"delete":{"_id":"4"}}
高级检索(Query)
ES官方提供了两中检索方式:
-
通过 URL 参数搜索
GET /索引/类型/_search?参数
-
通过 DSL(Domain Specified Language) 搜索
GET /索引/类型/_search {}
通过URL查询
GET /ems/emp/_search?q=*&sort=age:desc&size=5&from=0&_source=name,age,bir
通过DSL查询
查询所有
GET /ems/emp/_search
{"query": {"match_all": {}}
}
指定返回条数
GET /ems/emp/_search
{"query": {"match_all": {}},"size": 5
}
分页查询
GET /ems/emp/_search
{"query": {"match_all": {}},"size": 5,"from": 0
}
查询字段
GET /ems/emp/_search
{"query": {"match_all": {}},"_source": ["name","age"]
}
查询关键词
GET /ems/emp/_search
{"query": {"term": {"address": {"value": "fujian"}}}
}
注意
- 使用term查询,默认使用标准分词器(StandardAnalyzer),标准分词器对于英文单词分词,对于中文单字分词
- keyword , date ,integer, long , double , boolean or ip 这些类型不分词**,**只有text类型分词
范围查询
GET /ems/emp/_search
{"query": {"range": {"age": {"gte": 5,"lte": 10}}}
}
前缀查询
GET /ems/emp/_search
{"query": {"prefix": {"name": {"value": "F"}}}
}
通配符查询
GET /ems/emp/_search
{"query": {"wildcard": {"name": {"value": "Ca?"}}}
}
多id查询
GET /ems/emp/_search
{"query": {"ids": {"values": ["AlSspHYBh-o7eO8i7bUf","BVSspHYBh-o7eO8i7bUf"]}}
}
模糊查询
GET /ems/emp/_search
{"query": {"fuzzy": {"content": "sprin"}}
}
布尔查询
bool 关键字: 用来组合多个条件实现复杂查询
- must: 相当于&& 同时成立
- should: 相当于|| 成立一个就行
- must_not: 相当于! 不能满足任何一个
GET /ems/emp/_search
{"query": {"bool": {"must": [{"range": {"age": {"gte": 5,"lte": 10}}}],"must_not": [{"term": {"address": {"value": "nanjing"}}}]}}
}
多字段查询
可以指定分词器
GET /dangdang/book/_search
{"query": {"query_string": {"query": "spring",// "analyzer": "ik_max_word", "fields": ["name","content"]}}
}
需要注意的点
(1)大小写问题
elasticsearch在创建倒排索引时,就已经将大写转为小写,而后写入索引
GET /_analyze
{"text": "Fat","analyzer": "standard"
}
output:
{"tokens" : [{"token" : "fat","start_offset" : 0,"end_offset" : 3,"type" : "<ALPHANUM>","position" : 0}]
}
索引建立过程:分词 -> 语法处理(还原时态等等)-> 排序 -> 创建索引
https://www.elastic.co/guide/en/elasticsearch/reference/6.0/normalizer.html
相关文章:

elasticsearch 环境搭建和基本操作
参考资料 适合后端编程人员的elasticsearch快速实战教程 ElasticSearch最新实战教程 ElasticSearch配套笔记 自制搜索引擎 https://www.elastic.co/guide/en/elasticsearch/reference/7.17/setup.html restful风格的api REST 设计风格 例如以下springboot示例 RestContr…...

IDEA操作:Springboot项目打包为jar包并运行
在IDEA环境下对Springboot项目打包为jar包且在terminal运行操作 1、 2、 3、注意:在项目目录里创建一个用来存放jar包的文件夹(res),该路径不能使用IDEA设置的默认路径,必须手动创建。 4、 5、点击ok后加载运行包 (8…...

原理底层计划---JVM
二、JVM对空间大小怎么配置?各区域怎么划? 新生代:短时间生成,可以马上回收 老生代:少部分对象会存在很久,回收策略应不同 三、JVM哪些内存区域会发生内存溢出(程序计数器不会) …...

CSDN-猜年龄、纸牌三角形、排他平方数
猜年龄 原题链接:https://edu.csdn.net/skill/practice/algorithm-a413078fb6e74644b8c9f6e28896e377/2258 美国数学家维纳(N.Wiener)智力早熟,11岁就上了大学。他曾在1935~1936年应邀来中国清华大学讲学。 一次,他参加某个重要会议…...

【Linux】软件包管理器 yum
什么是软件包和软件包管理器 在 Linux 下需要安装软件时, 最原始的办法就是下载到程序的源代码, 进行编译得到可执行程序。但是这样太麻烦了,所以有些人就把一些常用的软件提前编译好, 做成软件包 ( 就相当于windows上的软件安装程序)放在服…...

一天吃透TCP面试八股文
本文已经收录到Github仓库,该仓库包含计算机基础、Java基础、多线程、JVM、数据库、Redis、Spring、Mybatis、SpringMVC、SpringBoot、分布式、微服务、设计模式、架构、校招社招分享等核心知识点,欢迎star~ Github地址:https://github.com/…...

zzu天梯赛选拔
C. NANA去上课 — 简单数学 需要记录上一步处在哪个位置 然后判断如果是同一侧移动距离就是abs(x1 - x2) 如果不同就是x1 x2 #include <iostream> #include <cmath> using namespace std; #define int long long signed main() {int n; c…...

【C语言】一篇让你彻底吃透(结构体与结构体位段)
本章重点 主要讲解结构体和位移动的使用和定义与声明,并且结构体和位段在内存中是如何存储的。 文章目录结构体结构体类型的声明结构体特殊的声明结构体变量的定义和初始化结构体成员的访问结构的自引用结构体内存对齐结构体传参位段什么是位段位段的内存分配位段的…...

数据结构之二叉树构建、广度/深度优先(前序、中序、后序)遍历
一、二叉树 1.1 树 说到树,我们暂时忘记学习,来看一下大自然的树: 哈哈 以上照片是自己拍的,大家凑合看看 回归正题,那么在数据结构中,树是什么呢,通过上面的图片大家也可以理解 树是一种非…...

“国产版ChatGPT”文心一言发布会现场Demo硬核复现
文章目录前言实验结果一、文学创作问题1 :《三体》的作者是哪里人?问题2:可以总结下三体的核心内容吗?如果要续写的话,可以从哪些角度出发?问题3:如何从哲学角度来进行续写?问题4:电…...

202304读书笔记|《不被定义的女孩》——做最真实最漂亮的自己,依心而行
202304读书笔记|《不被定义的女孩》——做最真实最漂亮的自己,依心而行《不被定义的女孩》作者ASEN,很棒的书。处处透露着洒脱,通透,悦己,阅世界的自由的氛围和态度! 部分节选如下: 让自己活得…...

SpringBoot帮你优雅的关闭WEB应用程序
Graceful shutdown 应用 Graceful shutdown说明 Graceful shutdown is supported with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and servlet-based web applications. It occurs as part of closing the applica…...

递归与递推
递归 直白理解:函数在其内部调用自身(自己调用自己)所有递归都可以采用递归搜索树来理解递归的特点: 一般来说代码较为简短,但是理解难度大一般时间和空间消耗较大,容易产生重复计算,可能爆栈 …...

使用<style scoped>导致的样式问题
问题描述: 今天使用开源组件库TDesign的自动补全组件时,遇到了一个样式失效问题,一开始怎么也找不到问题出在哪,后面一个偶然去掉了scoped,竟然发现样式竟然正常了,具体原因不知道在哪,有大佬知…...

Elasticsearch深入理解(十八)-集群关键指标及调优指南
1、CPU使用率 CPU使用率是指在一段时间内CPU执行程序的百分比,它是衡量系统资源利用率的一种指标。 1.1 详细说明: 在Elasticsearch中,高的CPU使用率通常意味着节点正在执行大量的计算任务,这可能是因为索引和搜索操作的负载较大…...

Transformer到底为何这么牛
从注意力机制(attention)开始,近两年提及最多的就是Transformer了,那么Transformer到底是什么机制,凭啥这么牛?各个领域都能用?一文带你揭开Transformer的神秘面纱。 目录 1.深度学习࿰…...

【Spring事务】声明式事务 使用详解
个人简介:Java领域新星创作者;阿里云技术博主、星级博主、专家博主;正在Java学习的路上摸爬滚打,记录学习的过程~ 个人主页:.29.的博客 学习社区:进去逛一逛~ 声明式事务一、编程式事务二、声明式事务&…...

学习28个案例总结
学习前 对于之前遇到的问题没有及时总结,导致做什么事情都是新的一样。没有把之前学习到接触到的内容应用上。通过这次对28个案例的学习。把之前遇到的问题总结成自己的经验,在以后的开发过程中避免踩重复性的坑。多看帮助少走弯路。 学习中 对28个案例…...

刷题Java常用方法总结
刷题Java常用方法总结 文章目录刷题Java常用方法总结快速查看:静态数组 Static Array初始化instance属性length技巧Arrays.sort从小到大排序Arrays.fill填满一个数组Arrays.copyOf / arr.clone()复制一个数组(二维数组也可以)动态数组 List & Dynamic Array初始化常规 - Ar…...

大数据技术之Hive
第1章Hive基本概念1.1 Hive1.1.1 Hive的产生背景在那一年的大数据开源社区,我们有了HDFS来存储海量数据、MapReduce来对海量数据进行分布式并行计算、Yarn来实现资源管理和作业调度。但是面对海量数据和负责的业务逻辑,开发人员要编写MR来对数据进行统计…...

第33篇:Java集合类框架总结
目录 1、集合概念 2、集合与数组的区别 3、集合框架的特性 1)高性能 2)可操作...

数据结构 | 栈的中缀表达式求值
目录 什么是栈? 栈的基本操作 入栈操作 出栈操作 取栈顶元素 中缀表达式求值 实现思路 具体代码 什么是栈? 栈是一种线性数据结构,具有“先进后出”(Last In First Out, LIFO)的特点。它可以看作是一种受限的…...

vue2前端实现html导出pdf功能
1. 功能实现方案 1.html转换成canvas后生成图片导出pdf(本文选用) html转canvas插件:html2canvas是一款将HTML代码转换成Canvas的插件;canvas生成pdf:jsPDF是一个使用Javascript语言生成PDF的开源库 2.HTML代码转出…...

用 ChatGPT 辅助学好机器学习
文章目录一、前言二、主要内容🍉 CSDN 叶庭云:https://yetingyun.blog.csdn.net/ 一、前言 探索更高效的学习方法可能是有志者共同的追求,用好 ChatGPT,先行于未来。 作为一个人工智能大语言模型,ChatGPT 可以在帮助初…...

【动态规划】最长上升子序列(单调队列、贪心优化)
Halo,这里是Ppeua。平时主要更新C语言,C,数据结构算法......感兴趣就关注我吧!你定不会失望。 🌈个人主页:主页链接 🌈算法专栏:专栏链接 我会一直往里填充内容哒! &…...

海思SD3403/SS928V100开发(7)mcp2515-SPI转CAN驱动开发
1. 前言 需求: 需要一路can进行收发 分析: 根据目前使用较多的方案是使用主控端SPI接口 接入MCP2515芯片进行CAN协议转换 硬件: MCP2515->SPI2->SS928 2. Uboot开发 2.1 pinmux复用配置 2.1.1 修改uboot参数表 路径: osdrv/tools/pc/uboot_tools/ SS928V100…...

【安卓源码】SurfaceFlinger 启动及其与应用通信
1. surfaceFlinger 初始化和消息队列处理机制 surfaceflinger 的makefile 文件 /frameworks/native/services/surfaceflinger/Android.bp 235 cc_binary { 236 name: "surfaceflinger", 237 defaults: ["libsurfaceflinger_binary"], 238 i…...

springboot车辆充电桩
sprinboot车辆充电桩演示录像2022开发语言:Java 框架:springboot JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7(一定要5.7版本) 数据库工具:Navicat11 开发软件:ecli…...

linux进程和进程通信编程(1)
What makes the desert beautiful is that somewhere it hides a well. 沙漠之所以美丽,是因为在它的某个角落隐藏着一口井. linux进程和进程通信编程(1)1.什么是进程2.进程id(pid)3.进程间通信的方法管道信号IPCSocket4.创建进程forkfork有三个返回值父…...

操作系统(1.3)--习题
一、课堂习题 1、一个作业第一 次执行时用了5min ,而第二次执行时用了6min,这说明了操作系统的( )特点。 A、并发性 B、共享性 C、虚拟性 D、不确定性 D 2、在计算机系统中,操作系统是( )。 A、处于裸机之上的第一层软件 B、处于硬件之下的低层软件 C、处于应用软件之上的系统软…...