Cassandra 5.0 Spring Boot 3.3 CRUD

news2024/11/15 6:53:40

概览

  • 因AI要使用到向量存储,JanusGraph也使用到Cassandra

卸载先前版本

docker stop cassandra && docker remove cassandra && rm -rf cassandra/

运行Cassandra容器

docker run \
	--name cassandra \
	--hostname cassandra \
	-p 9042:9042 \
	--privileged=true \
	--net network-common \
	-v /elf/cassandra:/var/lib/cassandra \
	-itd cassandra:5.0.0

连接到Cassanra

# docker logs --tail 100 cassandra

# 等完全启动后
# docker exec -it cassandra /bin/bash

# 查询集群状态,用于应用程序连接等,详情参考Troubleshooting章节
# /opt/cassandra/bin/nodetool status

# show version
[cqlsh 6.2.0 | Cassandra 5.0.0 | CQL spec 3.4.7 | Native protocol v5]

# cqlsh 127.0.0.1 9042 -u cassandra -p cassandra

# describe keyspaces;

system       system_distributed  system_traces  system_virtual_schema
system_auth  system_schema       system_views
# /opt/cassandra/bin/nodetool status

Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens  Owns (effective)  Host ID                               Rack
UN  172.18.0.2  136.3 KiB  16      100.0%            63c1c77a-fa0b-4630-9fd0-9568133bd1df  rack1

Dependency

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

<dependency>
	<groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>

Product

import java.util.UUID;
import org.springframework.data.cassandra.core.mapping.Column;
import org.springframework.data.cassandra.core.mapping.PrimaryKey;
import org.springframework.data.cassandra.core.mapping.Table;

@Table
public class Product {
	
	@PrimaryKey
	@Column(value = "product_id")
	private UUID productId;

	@Column(value = "product_name")
	private String productName;
	
	@Column(value = "product_memo")
	private String productMemo;
	
	@Column(value = "product_state")
	private boolean productState;
	
	public Product() {} 
	
	public Product(UUID productId, String productName,
		String productMemo, boolean productState) {
		super();
		this.productId = productId;
		this.productName = productName;
		this.productMemo = productMemo;
		this.productState = productState;
	}

	@Override
	public String toString() {
		return "Product [productId=" + productId
			+ ", productName=" + productName + ", productMemo=" 
			+ productMemo + ", productState=" + productState + "]";
	}

	public UUID getProductId() {
		return productId;
	}
	public void setProductId(UUID productId) {
		this.productId = productId;
	}

	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getProductMemo() {
		return productMemo;
	}
	public void setProductMemo(String productMemo) {
		this.productMemo = productMemo;
	}

	public boolean isProductState() {
		return productState;
	}
	public void setProductState(boolean productState) {
		this.productState = productState;
	}
	
}

ProductRepository

import java.util.List;
import java.util.UUID;
import io.os.cassandra.model.Product;
import org.springframework.data.cassandra.repository.AllowFiltering;
import org.springframework.data.cassandra.repository.CassandraRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface ProductRepository extends CassandraRepository<Product,UUID> {
	
	//@AllowFiltering:允许方法对服务器端筛选,等效于
	//select * from product where product_state = [true/false];
	@AllowFiltering
	List<Product> findByProductState(boolean productState);
	  
	List<Product> findByProductMemo(String productName);
}

ProductController

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.os.cassandra.model.Product;
import io.os.cassandra.repository.ProductRepository;

@RestController
@RequestMapping("/api/product")
public class ProductController {

	@Autowired
	private ProductRepository productRepository;

	@GetMapping("/getAllProductProduct")
	public ResponseEntity<List<Product>> getAllProductProduct(
		@RequestParam(required = false,value = "productMemo") String productMemo) {
		
		try {
			List<Product> productList = new ArrayList<Product>();

		    if (productMemo == null) {
		    	productRepository.findAll().forEach(productList::add);
		    } else {
		    	productRepository.findByProductMemo(productMemo).forEach(productList::add);
		    }
		    
		    if (productList.isEmpty()) {
		    	return new ResponseEntity<>(HttpStatus.NO_CONTENT);
		    } else {
		    	return new ResponseEntity<>(productList, HttpStatus.OK);
		    }
		  } catch (Exception e) {
			  return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
		  }
	}

	@GetMapping("/getProductById/{id}")
	public ResponseEntity<Product> getProductById(
		@PathVariable("id") String id) {
		var product = productRepository.findById(UUID.fromString(id));

		if (product.isPresent()) {
			return new ResponseEntity<>(product.get(), HttpStatus.OK);
		} else {
		    return new ResponseEntity<>(HttpStatus.NOT_FOUND);
		}
	}

	@PostMapping("/createProduct")
	public ResponseEntity<Product> createProduct(
		@RequestBody Product product) {
		var requestProduct = new Product(
			UUID.randomUUID(),product.getProductName(),
			product.getProductMemo(),product.isProductState());
		
		try {
			Product p = productRepository.save(requestProduct);
		    return new ResponseEntity<>(p,HttpStatus.CREATED);
		} catch (Exception e) {
		    return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

	@PutMapping("/updateProduct/{id}")
	public ResponseEntity<Product> updateProduct(
		@PathVariable("id") String id,@RequestBody Product product) {
		
		var updateProduct = productRepository.findById(UUID.fromString(id));

		if (updateProduct.isPresent()) {
			var p = updateProduct.get();
			p.setProductName(product.getProductName());
			p.setProductMemo(product.getProductMemo());
			p.setProductState(product.isProductState());
			return new ResponseEntity<>(productRepository.save(p), HttpStatus.OK);
		} else {
			return new ResponseEntity<>(HttpStatus.NOT_FOUND);
		}
	}

	@DeleteMapping("/deleteProductById/{id}")
	public ResponseEntity<HttpStatus> deleteProductById(
		@PathVariable("id") String id) {
		try {
			productRepository.deleteById(UUID.fromString(id));
		    return new ResponseEntity<>(HttpStatus.NO_CONTENT);
		} catch (Exception e) {
		    return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

	@DeleteMapping("/deleteAllProduct")
	public ResponseEntity<HttpStatus> deleteAllProduct() {
		try {
			productRepository.deleteAll();
		    return new ResponseEntity<>(HttpStatus.NO_CONTENT);
		} catch (Exception e) {
		    return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

	@GetMapping("/getProductByState")
	public ResponseEntity<List<Product>> findByProductState() {
		try {
			var productList = productRepository.findByProductState(true);

		    if (productList.isEmpty()) {
		    	return new ResponseEntity<>(HttpStatus.NO_CONTENT);
		    } else {
		    	return new ResponseEntity<>(productList, HttpStatus.OK);
		    }
		} catch (Exception e) {
			return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
		}
	}

}

application.yaml

  • application.yaml和CassandraConfig.java,二选一
server:
  port: 8080
  servlet:
    context-path: /

spring: 
  data:
    cassandra:
      repositories:
        type: imperative
  cassandra:
    keyspace-name: elf
    port: 9042
    contact-points:
    - 192.168.0.123:9042
    schema-action: create-if-not-exists
    password: cassandra
    username: cassandra
    # /opt/cassandra/bin/nodetool status命令查询
    local-datacenter: datacenter1
import java.net.InetSocketAddress;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories;
import com.datastax.oss.driver.api.core.CqlSession;

@Configuration
@EnableCassandraRepositories
public class CassandraConfig {

	@Bean
	CqlSession session() {
		return CqlSession.builder().withKeyspace("elf")
			.withAuthCredentials("cassandra", "cassandra")
			.withLocalDatacenter("datacenter1")
			.addContactPoint(InetSocketAddress.createUnresolved("192.168.0.123",9042))
			.build();
	}
	
}

CassandraEntry

import java.lang.invoke.MethodHandles;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;

@SpringBootApplication
public class CassandraEntry {

	public static void main(String[] sa) {
		var cls = MethodHandles.lookup().lookupClass();
		SpringApplication.run(cls,sa);
	}
	
}

Environment

# cassandra为Cassandra容器名
docker start cassandra

# docker exec -it cassandra /bin/bash

# 查询集群状态,用于应用程序连接等,详情参考Troubleshooting章节
# /opt/cassandra/bin/nodetool status

# cqlsh 127.0.0.1 9042 -u cassandra -p cassandra

# describe keyspaces;

Product.cql

create keyspace if not exists elf with replication={'class':'SimpleStrategy','replication_factor':1};

use elf;

create table if not exists elf.product(
	product_id uuid primary key,
	product_name varchar,
	product_memo text,
   	product_state boolean
);

select * from elf.product;
truncate table elf.product;

# 不要换行,不要随意添加空格,否则cql语法可能无法通过;
# UUID:Java UUID.randomUUID()形式,Cassandra uuid()形式;

insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'JanusGraph','Graph,Open Source',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Cassandra','Wide Column,Vector,Multi Model',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Presto','Relational,Open Source,Big Data',false);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Trino','Relational,Document,Spatial,TS,KV',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Weaviate','Vector,AI,Real Time',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Milvus','Vector,Similarity Search,ML',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Qdrant','Vector,NN,Semantic Matching',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'ElasticSearch','Search,Document,Spatial,Vector',true);
+--------------------------------------+-----------------------------------+---------------+--------------+
| product_id                           | product_memo                      | product_name  | product_state|
|--------------------------------------+-----------------------------------+---------------+--------------|
| 29af0738-4a17-4571-90cd-700ab8995db7 |       Vector,Similarity Search,ML |        Milvus |          True|
| 3a3415aa-8dfa-42fa-9723-0142960b687a |   Relational,Open Source,Big Data |        Presto |         False|
| 741e5240-8a7b-40fa-b07c-e88b3638bf36 |                 Graph,Open Source |    JanusGraph |          True|
| 63608ee0-eaf1-41cf-970e-04238a556103 |               Vector,AI,Real Time |      Weaviate |          True|
| 6d580a60-daba-46cc-b3d9-6061aa48f0ff |    Search,Document,Spatial,Vector | ElasticSearch |          True|
| d4760f62-9b76-4c40-8a56-8c1e7214dfdd |    Wide Column,Vector,Multi Model |     Cassandra |          True|
| ddfe8f96-c49f-4ad0-899a-9b3b484419d8 |       Vector,NN,Semantic Matching |        Qdrant |          True|
| cb99a803-2443-48ec-accb-5262ef9bc429 | Relational,Document,Spatial,TS,KV |         Trino |          True|
+--------------------------------------+-----------------------------------+---------------+--------------+

Visualization Tool

  • 安装DbVisualizer V24.1.4;

  • Tool ☞ Driver Manager ☞ 搜索Cassandra
    ☞ 右键选择Create User Driver from Template
    在这里插入图片描述

  • Name:Custom Cassandra

  • Url:jdbc:cassandra://192.168.0.123:9042

  • Driver Class:com.simba.cassandra.jdbc42.Driver

  • 点击右侧地球仪:Download/Update driver for remote artifact,
    下载完成后关闭窗口;

  • 点击左上角加号 ☞ Create Database Connection:

在这里插入图片描述

  • SQL Commander ☞ New SQL Commander ☞ select * from elf.product;

在这里插入图片描述

Create Product

  • http://localhost:8080/api/product/createProduct

  • 请求方法:POST,请求对象和响应对象分别为:

{
    "productName":"Cassandra",
    "productMemo":"Wide Column,Vector,Multi Model",
    "productState":true
}

{
    "productId": "24672630-4ca4-424b-8fc5-c20f1400074b",
    "productName": "Cassandra",
    "productMemo": "Wide Column,Vector,Multi Model",
    "productState": true
}

Update Product

  • http://localhost:8080/api/product/updateProduct/productId
    http://localhost:8080/api/product/updateProduct/24672630-4ca4-424b-8fc5-c20f1400074b

  • 请求方法:PUT,请求对象和响应对象分别为:

{
    "productName":"Cassandra-Update",
    "productMemo":"Wide Column,Vector,Multi Model",
    "productState":true
}

{
    "productId": "24672630-4ca4-424b-8fc5-c20f1400074b",
    "productName": "Cassandra-Update",
    "productMemo": "Wide Column,Vector,Multi Model",
    "productState": true
}

Retrieve By Id

  • 请求方法:GET;

  • http://localhost:8080/api/product/getProductById/productId
    http://localhost:8080/api/product/getProductById/29af0738-4a17-4571-90cd-700ab8995db7

{
    "productId": "29af0738-4a17-4571-90cd-700ab8995db7",
    "productName": "Milvus",
    "productMemo": "Vector,Similarity Search,ML",
    "productState": true
}

Retrieve All Product

  • 请求方法:GET;

  • http://localhost:8080/api/product/getAllProductProduct

[
    {
        "productId": "29af0738-4a17-4571-90cd-700ab8995db7",
        "productName": "Milvus",
        "productMemo": "Vector,Similarity Search,ML",
        "productState": true
    },
    {
        "productId": "3a3415aa-8dfa-42fa-9723-0142960b687a",
        "productName": "Presto",
        "productMemo": "Relational,Open Source,Big Data",
        "productState": false
    },
    {
        "productId": "741e5240-8a7b-40fa-b07c-e88b3638bf36",
        "productName": "JanusGraph",
        "productMemo": "Graph,Open Source",
        "productState": true
    },
    {
        "productId": "63608ee0-eaf1-41cf-970e-04238a556103",
        "productName": "Weaviate",
        "productMemo": "Vector,AI,Real Time",
        "productState": true
    },
    {
        "productId": "6d580a60-daba-46cc-b3d9-6061aa48f0ff",
        "productName": "ElasticSearch",
        "productMemo": "Search,Document,Spatial,Vector",
        "productState": true
    },
    {
        "productId": "d4760f62-9b76-4c40-8a56-8c1e7214dfdd",
        "productName": "Cassandra",
        "productMemo": "Wide Column,Vector,Multi Model",
        "productState": true
    },
    {
        "productId": "ddfe8f96-c49f-4ad0-899a-9b3b484419d8",
        "productName": "Qdrant",
        "productMemo": "Vector,NN,Semantic Matching",
        "productState": true
    },
    {
        "productId": "cb99a803-2443-48ec-accb-5262ef9bc429",
        "productName": "Trino",
        "productMemo": "Relational,Document,Spatial,TS,KV",
        "productState": true
    }
]
  • http://localhost:8080/api/product/getAllProductProduct?productMemo=vector

  • 关于自定义索引,后续章节说明,此处不再赘述;

select * from elf.product where product_memo like '%vector%';
----

[source,sql]
----
InvalidRequest: Error from server: code=2200 [Invalid query] 
	msg="like restriction only support on properly indexed column
	product_memo LIKE '%vector%' is not valid."

Delete Product

  • 请求方法:DELETE;

  • http://localhost:8080/api/deleteProductById/productId
    http://localhost:8080/api/deleteProductById/6d580a60-daba-46cc-b3d9-6061aa48f0ff

Delete All Product

  • 请求方法:DELETE;

  • http://localhost:8080/api/product/deleteAllProduct

Retrieve By State

  • 请求方法:GET;

  • http://localhost:8080/api/product/getProductByState

[
    {
        "productId": "29af0738-4a17-4571-90cd-700ab8995db7",
        "productName": "Milvus",
        "productMemo": "Vector,Similarity Search,ML",
        "productState": true
    },
    {
        "productId": "741e5240-8a7b-40fa-b07c-e88b3638bf36",
        "productName": "JanusGraph",
        "productMemo": "Graph,Open Source",
        "productState": true
    },
    {
        "productId": "63608ee0-eaf1-41cf-970e-04238a556103",
        "productName": "Weaviate",
        "productMemo": "Vector,AI,Real Time",
        "productState": true
    },
    {
        "productId": "d4760f62-9b76-4c40-8a56-8c1e7214dfdd",
        "productName": "Cassandra",
        "productMemo": "Wide Column,Vector,Multi Model",
        "productState": true
    },
    {
        "productId": "ddfe8f96-c49f-4ad0-899a-9b3b484419d8",
        "productName": "Qdrant",
        "productMemo": "Vector,NN,Semantic Matching",
        "productState": true
    },
    {
        "productId": "cb99a803-2443-48ec-accb-5262ef9bc429",
        "productName": "Trino",
        "productMemo": "Relational,Document,Spatial,TS,KV",
        "productState": true
    }
]

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

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

相关文章

SpringCloud Alibaba五大组件之——Sentinel

SpringCloud Alibaba五大组件之——Sentinel&#xff08;文末附有完整项目GitHub链接&#xff09; 前言一、什么是Sentinel二、Sentinel控制台1.下载jar包2.自己打包3.启动控制台4.浏览器访问 三、项目中引入Sentinel1.在api-service模块的pom文件引入依赖&#xff1a;2.applic…

【干货整理】什么软件能监控员工电脑?六大好用的电脑监控软件,抢手推荐!

什么软件能监控员工电脑&#xff1f; 电脑监控软件啦&#xff01; 要是能有一双无形的眼睛&#xff0c;既监督员工的工作状态&#xff0c;又保护着公司的数据安全&#xff0c;这无疑是企业管理者的福音。 今天&#xff0c;我们就来一起探索那些能够精准助力、高效护航的六大电…

张养浩,文坛政坛的双重巨匠

张养浩&#xff0c;字希孟&#xff0c;号云庄&#xff0c;又称齐东野人&#xff0c;生于元世祖至元七年&#xff08;公元1270年&#xff09;&#xff0c;卒于元英宗至治三年&#xff08;公元1329年&#xff09;&#xff0c;享年59岁。他是中国元代著名的文学家、政治家&#xf…

【Linux】解锁系统编程奥秘,高效文件IO的实战技巧

文件 1. 知识铺垫2. C文件I/O2.1. C文件接口2.2 fopen()与重定向2.3. 当前路径2.4. stdin、stdout、stderr 3. 系统文件I/O3.1. 前言3.2. open3.2.1. flags</h3>3.2.2. mode</h3>3.2.3. 返回值fd 3.3. write</h2>3.4. read3.5. close</h2>3.6. lseek&l…

快速响应:提升前端页面加载速度技巧的必知策略方案

在本文中&#xff0c;我们将深入探讨导致页面加载缓慢的常见原因&#xff0c;并分享一系列切实可行的优化策略&#xff0c;无论你是刚入门的新手&#xff0c;还是经验丰富的开发者&#xff0c;这些技巧都将帮助你提升网页性能&#xff0c;让你的用户体验畅快无阻。 相信作为前端…

【JavaEE精炼宝库】HTTP | HTTPS 协议详解

文章目录 一、HTTP 简介二、HTTP 协议格式&#xff1a;2.1 抓包工具的使用&#xff1a;2.2 HTTP 请求报文格式&#xff1a;2.3 HTTP 响应报文格式&#xff1a;2.4 HTTP 协议格式总结&#xff1a; 三、HTTP 请求详解&#xff1a;3.1 刨析 URL&#xff1a;3.2 方法(method)&#…

极度精简 Winows11 系统镜像!Tiny11 2311下载 - 支持苹果 M 芯片 Mac 安装 (ARM 精简版)!

最新推出的 Tiny11 是一款极端精简版 Windows 11 系统镜像&#xff0c;针对苹果 M 芯片 Mac 用户&#xff08;ARM 架构&#xff09;提供良好支持。Tiny11 内置了众多优化特性&#xff0c;如更小的安装体积和更快的启动速度&#xff0c;特别适合有特殊需求或老机型的用户。用户可…

centos 安装VNC,实现远程连接

centos 安装VNC&#xff0c;实现远程连接 VNC(Virtual Network Computing)是一种远程控制软件&#xff0c;可以实现通过网络远程连接计算机的图形界面。 服务器安装VNC服务 yum install -y tigervnc-server*启动VNC服务&#xff0c;过程中需要输入连接密码 vncserver :1查看…

2024华为杯研究生数学建模C题【数据驱动下磁性元件的磁芯损耗建模】思路详解

问题一 励磁波形分类 励磁波形作为影响磁芯性能的核心要素之一&#xff0c;其形态深刻影响着磁芯的损耗特性。励磁波形的独特形状直接塑造了磁芯内部磁通的动态行为&#xff0c;不同的波形轮廓影响了磁通密度随时间的变化速率&#xff0c;导致其损耗特性呈现出显著差异。因此&…

ESP32本地大模型对话机器人制作教程

整体架构 在本地电脑部署好Ollama服务&#xff0c;安装qwen大模型和llama3.1大模型。 ESP32接入局域网&#xff0c;用户通过串口给esp32发送问题&#xff0c;esp32打包json后向ollama服务发送请求&#xff0c;ollama返回响应&#xff0c;esp32解析结果并通过串口打印出来。 …

MavenMyBatis

Maven&MyBatis 目标 能够使用Maven进行项目的管理能够完成Mybatis代理方式查询数据能够理解Mybatis核心配置文件的配置 1&#xff0c;Maven Maven是专门用于管理和构建Java项目的工具&#xff0c;它的主要功能有&#xff1a; 提供了一套标准化的项目结构 提供了一套标准…

24最新Stable Diffusion 本地部署教程!

前言 1.前言&#xff1a; 最近看Stable Diffusion开源了&#xff0c;据说比Disco Diffusion更快&#xff0c;于是从git上拉取了项目尝试本地部署了&#xff0c;记录分享一下过程~ 这里是官网介绍&#xff1a;https://stability.ai/blog/stable-diffusion-public-release 嫌弃…

解决【WVP服务+ZLMediaKit媒体服务】加入海康摄像头后,能发现设备,播放/点播失败,提示推流超时!

环境介绍 每人搭建的环境不一样&#xff0c;情况不一样&#xff0c;但是原因都是下面几种&#xff1a; wvp配置不当网络端口未放开网络不通 我搭建的环境&#xff1a; WVP服务&#xff1a;windows下&#xff0c;用idea运行的源码 ZLM服务&#xff1a;虚拟机里 问题描述 1.…

计算机视觉的应用34-基于CV领域的人脸关键点特征智能提取的技术方法

大家好&#xff0c;我是微学AI&#xff0c;今天给大家介绍一下计算机视觉的应用34-基于CV领域的人脸关键点特征智能提取的技术方法。本文主要探讨计算机视觉领域中人脸关键点特征智能提取的技术方法。详细介绍了基于卷积神经网络模型进行人脸关键点提取的过程&#xff0c;包括使…

基于springboot学生健康管理系统的设计与实现

文未可获取一份本项目的java源码和数据库参考。 进入21世纪以来&#xff0c;随着经济水平的高速发展&#xff0c;人们的生活质量有了很大提升&#xff0c;物质和精神生活得到了极大满足。但人们的健康水平却情况堪忧。据不完全统计&#xff0c;全国近七层人口处于亚健康状态&a…

数据结构(Day18)

一、周学习内容 1、9.18 数据结构&#xff08;Day15&#xff09;-CSDN博客 2、9.19 数据结构&#xff08;Day16&#xff09;-CSDN博客 3、9.20 链表 目的 插入删除不需要移动任何节点&#xff08;元素&#xff09;。 不需要预估存储空间大小&#xff0c;长度动态增长或减小。…

Linux文件IO(六)-多次打开同一个文件

大家看到这个小节标题可能会有疑问&#xff0c;同一个文件还能被多次打开&#xff1f;事实确实如此&#xff0c;同一个文件可以被多次打开&#xff0c;譬如在一个进程中多次打开同一个文件、在多个不同的进程中打开同一个文件&#xff0c;那么这些操作都是被允许的。本小节就来…

PyRosetta打分函数介绍

在 PyRosetta 中,蛋白质结构的能量是通过打分函数(ScoreFunction)来评估的,这些打分函数基于 Rosetta 的能量方程。Rosetta 的能量函数是一种加权的分项能量表达式,包括不同的能量项来描述蛋白质的构象、相互作用和能量。核心能量函数的形式如下: 在 PyRosetta 中,打分函…

神经网络推理加速入门——一个例子看懂流水

之前的两篇文章介绍了流水这一技术&#xff0c;它用来进行程序的性能加速&#xff0c;本篇通过一个生活中的小例子&#xff0c;让大家更直观的了解什么是流水。 举个例子 早晨从起床到上班出门&#xff0c;我们一般会做以下几件事&#xff1a;刷牙、烧水、喝水、出门。 如果…

应届生必看 | 毕业第一份工作干销售好不好?

吉祥知识星球http://mp.weixin.qq.com/s?__bizMzkwNjY1Mzc0Nw&mid2247485367&idx1&sn837891059c360ad60db7e9ac980a3321&chksmc0e47eebf793f7fdb8fcd7eed8ce29160cf79ba303b59858ba3a6660c6dac536774afb2a6330&scene21#wechat_redirect 《网安面试指南》…