技术标签: java maven SpringBoot 后端
学习今日内容,必备基础知识:
Spring的对象ioc容器:new ClassPathXMLApplicationContext()、@Value、@Configuration
SpringMVC:@RestController、@RequestMapping
Maven知识:依赖传递、依赖管理(BOM,Bill of Material)、依赖冲突、依赖排除、打包
Mybatis:@Select注解
定时器:cron表达式
当前互联网后端开发中,JavaEE占据了主导地位。对JavaEE开发,首选框架是Spring框架。在传统的Spring开发中,需要使用大量的与业务无关的XML配置才能使Spring框架运行起来,这点备受许多开发者诟病。随着Spring4.x发布,Spring已经完全脱离XML,只使用注解就可以运行项目。为了进一步简化Spring应用的开发,SpringBoot诞生了。它是由Pivotal团队提供的全新框架,其设计目的是简化Spring应用的搭建及开发过程,并迎合时下流行的分布式微服务设计思想,越来越多企业在使用SpringBoot。本课程跟随时代的潮流,带大家张掌握这门技术。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Lp1Sa2i3-1595429002867)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1558504218790.png)]
Spring Boot 的2.2.2.RELEASES正式发行版,使用Java8、Java 11或Java 13,对应的Spring版本是5.2.0。构建工具Maven版本要求是3.3及以上,最好是使用Maven的3.5.4版本。
Servlet容器版本:
SpringBoot 支持如下的嵌入式Servlet容器,Spring Boot应用程序最低支持到Servlet 3.1的容器。
Name | Servlet Version |
---|---|
Tomcat 9.0 | 4.0 |
Jetty 9.4 | 3.1 |
Undertow 2.0 | 4.0 |
我们怎么开发一个web项目:
但是如果用 Spring Boot 呢?
超简单!无需配置!!无感Tomcat!超迅速搭建功能强大的整套 Web!到底多简单?入门案例揭晓。
Maven搭建SpringBoot工程,实现web的请求响应。浏览器访问在页面中输出helloworld
。
实现步骤:
实现过程:
创建Maven工程day01_springboot_helloworld
pom.xml文件中配置父坐标和web的起步依赖
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--继承SpringBoot父POM文件-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
</parent>
<groupId>com.itheima</groupId>
<artifactId>day01_springboot_helloword</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!--web 开发的相关依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>
编写SpringBoot引导类
@Configuration//配置类
@EnableAutoConfiguration//开启自动配置
@ComponentScan//包扫描
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class,args);
}
}
编写三层架构代码:Controller
controller
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello(String name){
return "hello world!!!";
}
}
访问http://localhost:8080/hello测试[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-KbVrgU7C-1595429002869)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1565659397803.png)]
使用Spring Initializr 方式创建SpringBoot工程。然后实现入门案例的代码。
俗称:基础部分重复架构代码
实现步骤:
使用Spring Initializr创建SpringBoot
配置项目信息
勾选起步依赖
配置文件存储路径地址
再次编写入门案例三层架构代码
访问http://localhost:8080/hello接口测试
实现过程:
只需导入开发者工具依赖坐标,即可实现热部署功能:
<!--spring-boot开发工具jar包,支持热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
但还需注意:加入坐标之后,如果想要代码立即生效,必须在修改代码之后进行代码构建。默认情况IDEA不会自动构建,需要手动构建。如图两处地方均可。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-T5VTa8VJ-1595429002883)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/image-20191116073526958.png)]
每次手动构建很麻烦?!!还有一种自动构建解决方案,但不建议使用。就是设置Build Project Automatically
。同时打开Maintenance维护(打开快捷键Shift + Ctrl + Alt + /
),选择Registry(注册表),设置运行时自动编译。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Cq1z22RZ-1595429002886)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/image-20191116073950737.png)]
starters是依赖关系的整理和封装。是一套依赖坐标的整合,可以让导入应用开发的依赖坐标更方便。
利用依赖传递的特性:帮你把依赖打包了,starter
搞框架:
有了这些Starters,你获得Spring和其整合的所有技术的一站式服务。无需配置(自动配置)、无需复制粘贴依赖坐标,一个坐标即可完成所有入门级别操作。举例:Web开发,只需要导入spring-boot-starter-web
。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
每个Starter包含了当前功能下的许多必备依赖坐标,这些依赖坐标是项目开发,上线和运行必须的。同时这些依赖也支持依赖传递。举例:spring-boot-starter-web
包含了所有web开发必须的依赖坐标
常用的starters有哪些?非常多,一下只列举部分:
starter为什么不需要写版本?
BOM(Bill of Materials)依赖清单,是由Maven提供的功能,
BOM内定义成套相互兼容的jar包版本集合
使用时依赖时,只需依赖该BOM文件,即可放心的使用清单内的依赖jar包,且无需版本号。
BOM设计初衷:方便维护项目依赖版本升级。
依赖管理(Dependency Management)
继承了spring-boot-starter-parent
的好处和特点
POM文件中的Maven插件
<!-- 作用:将一个SpringBoot的工程打包成为可执行的jar包 -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
如果想使用父pom文件中的任何插件,无需配置即可使用
所有我们要配置的项目Pivotal团队的开发人员,帮我们写好了,怎么实现的,主要是通过@Configuration实现
SpringBoot采用约定大于配置设计思想,将所有可能遇到的配置信息提前配置好,写在自动配置的jar包中。每个Starter基本都会有对应的自动配置。
SpringBoot帮我们将配置信息写好,存放在一个jar包中:spring-boot-autoconfigure-2.1.11.RELEASE.jar
jar包里,存放的都是配置类,让配置类生效的"规则类"
自动配置的值在哪里?
自动配置的值怎么才能生效?
查看启动类注解@SpringBootApplication
追踪步骤:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-h21JmMsQ-1595429002887)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1558508958144.png)]
有了自动配置,那么基本全部采用默认配置。当然也可以更改默认配置,怎么改?
官网的自动配置的地址: https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/common-application-properties.html
三种配置文件:
#
server.port=8080
server.address=127.0.0.1
<server>
<port>8080</port>
<address>127.0.0.1</address>
</server>
server:
port: 8080
address: 127.0.0.1
我们知道SpringBoot是约定大于配置的,所以很多配置都有默认值。如果想修改默认配置,可以使用application.properties或application.yml(application.yaml)自定义配置。SpringBoot默认从Resource目录加载自定义配置文件。application.properties是键值对类型(一直在用)。application.yml是SpringBoot中一种新的配置文件方式。
YML文件格式是YAML(YAML Aint Markup Language)编写的文件格式。可以直观被电脑识别的格式。容易阅读,容易与脚本语言交互。可以支持各种编程语言(C/C++、Ruby、Python、Java、Perl、C#、PHP)。以数据为核心,比XML更简洁。扩展名为.yml或.yaml;
官网地址:https://yaml.org/
YAML: YAML Ain't Markup Language
What It Is: YAML is a human friendly data serialization standard for all programming languages
server:
port: 8080
address: 127.0.0.1
name: abc
单个:
# 单引号忽略转义字符
message1: 'hello \n world'
# 双引号识别转义字符
message2: "hello \n world"
对象(map):键值对的集合:
person:
name: lisi
age: 31
addr: beijing
# 行内写法
person: {
name: haohao, age: 31, addr: beijing}
数组:一组按次序排列的值
city:
- beijing
- shanghai
- guangzhou
# 行内写法
city: [beijing,shanghai,guangzhou]
集合:
#集合中的元素是对象形式
animals:
- name: dog
age: 2
- name: tomcat
age: 3
- name: pig
age: 5
配置引用:
name: lisi
person:
name: ${
name}
配置随机数:
# 随机字符串
my.secret: ${
random.value}
# 随机数
my.number: ${
random.int}
# 随机数小于10
my.number.less.than.ten: ${
random.int(10)}
# 随机数范围在1024-65536之间
my.number.in.range: ${
random.int[1024,65536]}
融合所有写法:
person:
name: haohao
age: 31
addr: beijing
city:
- beijing
- shanghai
- guangzhou
animals:
- name: dog
age: 2
- name: tomcat
age: 3
- name: pig
age: 5
修改配置时,配置项目查询方式
第一种:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gnldiMLa-1595429002888)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1566907147015.png)]
第二种:
官方查询地址:https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE/reference/htmlsingle/#common-application-properties
常用配置:
# QUARTZ SCHEDULER (QuartzProperties)
spring.quartz.jdbc.initialize-schema=embedded # Database schema initialization mode.
spring.quartz.jdbc.schema=classpath:org/quartz/impl/jdbcjobstore/tables_@@platform@@. sql # Path to the SQL file to use to initialize the database schema.
spring.quartz.job-store-type=memory # Quartz job store type.
spring.quartz.properties.*= # Additional Quartz Scheduler properties.
# ----------------------------------------
# WEB PROPERTIES
# ----------------------------------------
# EMBEDDED SERVER CONFIGURATION (ServerProperties)
server.port=8080 # Server HTTP port. server.servlet.context-path= # Context path of the application. server.servlet.path=/ # Path of the main dispatcher servlet.
# HTTP encoding (HttpEncodingProperties)
spring.http.encoding.charset=UTF-8 # Charset of HTTP requests and responses. Added to the "Content-Type" header if not set explicitly.
# JACKSON (JacksonProperties)
spring.jackson.date-format= # Date format string or a fully-qualified date format class name. For instance, `yyyy-MM-dd HH:mm:ss`.
可以通过修改application.properties或者application.yml来修改SpringBoot的默认配置
例如:
application.properties文件
# 常见配置项目
# 端口
server.port=8080
# 项目的contentpath路径
server.servlet.context-path=/demo
# 开启debug模式
debug=true
# 配置日志级别,为debug
logging.level.com.example=debug
application.yml文件
server:
port: 8888
servlet:
# 应用的
context-path: /demo
扩展点
@value注解将配置文件的值映射到Spring管理的Bean属性值
通过注解@ConfigurationProperties(prefix=’'配置文件中的key的前缀")可以将配置文件中的配置自动与实体进行映射。
使用@ConfigurationProperties方式必须提供Setter方法,使用@Value注解不需要Setter方法。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-oofAFdOb-1595429002890)(01-SpringBoot-讲义.assets\1558515690311.png)]
注入Environment对象,即可从对象中获取配置文件中的值
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-asvhgx4A-1595429002891)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/image-20191127102315407.png)]
使用SpringBoot整合MyBatis,完成查询所有功能。
实现步骤:
实现过程:
创建SpringBoot工程,day01_springboot_mybatis;
勾选依赖坐标
创建User表—>创建实体UserBean
创建表
-- ----------------------------
-- Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'zhangsan', '123', '张三');
INSERT INTO `user` VALUES ('2', 'lisi', '123', '李四');
创建实体
public class User {
private Integer id;
private String username;//用户名
private String password;//密码
private String name;//姓名
//getter setter...
//toString
}
编写用户Controller,编写UserService
UserController
@RestController
@RequestMapping("user")
public class UserController {
@Autowired
private UserService userService;
@RequestMapping("findAll")
public List<User> findAll(){
return userService.findAll();
}
UserService
public interface UserService {
List<User> findAll();
}
UserServiceImpl
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserMapper userMapper;
@Override
public List<User> findAll() {
return userMapper.findAll();
}
}
编写Mapper:使用@Mapper标记该类是一个Mapper接口,可以被SpringBoot自动扫描
@Mapper
public interface UserMapper {
@Select("select * from user;")
List<User> findAll();
}
还有一种办法,可以在配置类中配置Mapper扫描
/**
* @MapperScan(basePackages = "com.itheima.mapper")
* 扫描指定包下的所有Mapper接口,将动态代理的实现类对象注入Spring容器中
* basePackages属性:指定扫描的包路径地址
* 作用相当于:
* <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
* <property name="basePackage" value="com.itheima.dao"/>
* </bean>
*/
@SpringBootApplication
@MapperScan(basePackages = "com.itheima.mapper")
public class SpringbootMybatisApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootMybatisApplication.class, args);
}
}
在application.properties中添加数据库连接信息
# DB 配置
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.password=root
spring.datasource.username=root
# spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
,不然会报错访问测试地址 http://localhost:8080/user/findAll
SpringBoot整合了Redis之后,做用户数据查询缓存。
实现步骤:
实现过程:
添加Redis起步依赖
<!--spring data redis 依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
配置Redis连接信息
# Redis 配置(不填也是可以的)
spring.redis.host=localhost
spring.redis.port=6379
注入RedisTemplate测试Redis操作
@Test
public void testRedis() throws JsonProcessingException {
String users = (String) redisTemplate.boundValueOps("user.findAll").get();
if (users == null) {
List<User> userList = userMapper.queryUserList();
ObjectMapper jsonFormat = new ObjectMapper();
users = jsonFormat.writeValueAsString(userList);
redisTemplate.boundValueOps("user.findAll").set(users);
System.out.println("==============从数据库中获取用户数据===================");
}else {
System.out.println("==============从Redis缓存中获取用户数据===================");
}
System.out.println(users);
}
需求:使用SpringBoot开发定时器,每隔5秒输出一个当前时间。
实现步骤:
开启定时器注解
@SpringBootApplication
@EnableScheduling//开启定时器
public class Day01SpringbootIntergrationApplication {
public static void main(String[] args) {
SpringApplication.run(Day01SpringbootIntergrationApplication.class, args);
}
}
配置定时器方法
@Component
public class TimerUtil {
@Scheduled(initialDelay = 1000,fixedRate = 1000)
public void mytask(){
System.out.println(LocalDateTime.now());
}
}
测试定时器。[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kmWWmCaH-1595429002892)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1558524182866.png)]
目标需求:发送Http请求
实现步骤:
实现过程:
创建一个springboot的工程,勾选Web的Starter
勾选web开发的Starter
在项目启动类位置中注册一个RestTemplate对象
@Configuration
public class MyConfiguration {
@Bean
public RestTemplate restTemplate(){
return new RestTemplate();
}
}
在测试类ApplicationTests中@Autowired
注入RestTemplate
通过RestTemplate的getForObject()方法,传递url地址及实体类的字节码
@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTests {
@Autowired
private RestTemplate restTemplate;
@Test
public void testREST() {
String url = "http://baidu.com";
String json = restTemplate.getForObject(url, String.class);
System.out.println(json);
}
}
运行测试类中的testREST方法;[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-XDu7rF0h-1595429002894)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1564627515537.png)]
目标:SpringBoot集成JUnit测试功能,进行查询用户接口测试
实现步骤:
添加Junit起步依赖(默认就有)
<!--spring boot测试依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
编写测试类:
SpringRunner继承SpringJUnit4ClassRunner,使用哪一个Spring提供的测试引擎都可以。指定运行测试的引擎
@SpringBootTest的属性值指的是引导类的字节码对象
注意:最新版的2.2.0.RELEASE中,springboot测试类不再需要@Runwith的注解
@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTests {
@Autowired
private UserMapper userMapper;
@Test
public void test() {
List<User> users = userMapper.queryUserList();
System.out.println(users);
}
}
控制台打印信息[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-rgToX14k-1595429002895)(01-SpringBoot-%E8%AE%B2%E4%B9%89.assets/1558522980982.png)]
启动方式有两种,一种是打成jar直接执行,另一种是打包成war包放到Tomcat服务下,启动Tomcat。
执行maven打包命令或者使用IDEA的Maven工具打包
## 移动至项目根目录,与pom.xml同级
mvn clean package
## 或者执行下面的命令 排除测试代码后进行打包
mvn clean package -Dmaven.test.skip=true
需要注意项目pom.xml文件中的打包类型
<packaging>jar</packaging>
启动命令:启动之前先检查自己的pom.xml文件中是否有springboot的maven插件
java -jar target/day01_springboot_demo01-1.0-SNAPSHOT.jar
启动命令的时候配置jvm参数也是可以的。然后查看一下Java的参数配置结果
java -Xmx80m -Xms20m -jar target/day01_springboot_demo01-1.0-SNAPSHOT.jar
<packaging>war</packaging>
//WEB-INF/web.xml
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(DemoApplication.class);
}
}
## 6.2 打成war包部署
1. 执行maven打包命令或者使用IDEA的Maven工具打包,需要修改pom.xml文件中的打包类型。
```xml
<packaging>war</packaging>
//WEB-INF/web.xml
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(DemoApplication.class);
}
}
文章浏览阅读364次。1.WebMagicWebMagic是一个简单灵活的Java爬虫框架。基于WebMagic,你可以快速开发出一个高效、易维护的爬虫。2.在Eclipse中配置WebMagic1.首先需要下载WebMagic的压缩包官网地址为:WebMagic官网最新版本为:WebMagic-0.7.3,找到对应版本,打开下载界面,注意,下载要选择Source code(zip)版本,随便下载到哪里都可以;2.下载好的压缩包需要解压,此时解压到的位置即为后续新建的Eclipse的project位置,比如我的Ecli_使用eclipse搭建webmagic工程
文章浏览阅读1.9k次。mysql数据库是一种开放源代码的关系型数据库管理系统,有很多朋友都在使用。一些在linux系统上安装了mysql数据库的朋友,却不知道该如何对mysql数据库进行配置。那么linux该如何启动mysql服务呢?接下来小编就给大家带来linux启动mysql服务的命令教程。具体步骤如下:1、首先,我们需要修改mysql的配置文件,一般文件存放在/etc下面,文件名为my.cnf。2、对于mysql..._linux中 mysql 启动服务命令
文章浏览阅读537次。详解OJ(Online Judge)中PHP代码的提交方法及要点Introduction of How to submit PHP code to Online Judge SystemsIntroduction of How to commit submission in PHP to Online Judge Systems在目前常用的在线oj中,codeforces、spoj、uva、zoj..._while(fscanf(stdin, "%d %d", $a, $b) == 2)
文章浏览阅读534次。一、设置MyEclipse编码(1)修改工作空间的编码方式:Window-->Preferences-->General-->Workspace-->Text file encoding(2)修改一类文件的编码方式:Window-->Preferences-->General-->content Types-->修改default Encoding(..._java修改快捷缩写内容
文章浏览阅读1.4w次,点赞19次,收藏76次。1.前言市面上关于Android的技术书籍很多,几乎每本书也都会涉及到蓝牙开发,但均是上层应用级别的,而且篇幅也普遍短小。对于手机行业的开发者,要进行蓝牙模块的维护,就必须从Android系统底层,至少框架层开始,了解蓝牙的结构和代码实现原理。这方面的文档、网上的各个论坛的相关资料却少之又少。分析原因,大概因为虽然蓝牙协议是完整的,但是并没有具体的实现。蓝牙芯片公司只负责提供最底层的API_蓝牙原理图详解
文章浏览阅读7.7k次。图/源于网络文/曲尚菇凉1.今天早上出门去逛街,在那家冰雪融城店里等待冰淇淋的时候,听到旁边两个女生在讨论很久之前的一期《奇葩说》。那期节目主持人给的辩论题是“从未在一起和最终没有在一起哪个更遗憾”,旁边其中一个女生说,她记得当时印象最深的是有个女孩子说了这样一句话。她说:“如果我喜欢一个人呢,我就从第一眼到最后一眼,把这个人爱够,把我的感觉用光,我只希望那些年让我成长的人是他,之后的那些年他喝过..._从未在一起更遗憾
文章浏览阅读175次。Spring Cloud Alibaba 介绍Sping体系Spring 以 Bean(对象) 为中心,提供 IOC、AOP 等功能。Spring Boot 以 Application(应用) 为中心,提供自动配置、监控等功能。Spring Cloud 以 Service(服务) 为中心,提供服务的注册与发现、服务的调用与负载均衡等功能。Sping Cloud介绍官方介绍 Tools for building common patterns in distributed systems_sprngcloud alba
文章浏览阅读3.2k次,点赞4次,收藏21次。我这里是根据之前在测试数据类项目过程中的一些总结经验和掉过个坑,记录一下,可以给其他人做个参考,没什么高深的东西,但是如果不注意这些细节点,后期也许会陷入无尽的扯皮当中。1 需求实现的准确度根据产品需求文档描述发现不明确不详细的或者存在歧义的地方一定要确认,例如数据表中的一些字段,与开发和产品确认一遍,如有第三方相关的,要和第三方确认,数据类项目需要的是细心,哪怕数据库中的一个字段如果没有提前对清楚,后期再重新补充,会投入更大的精力。2 数据的合理性根据业务场景/常识推理,提..._基础字段的测试点
文章浏览阅读491次。大家好,我是爱学习的小xiong熊妹。在工作和面试中,很多小伙伴会遇到“对XX行业进行分析”的要求。一听“行业分析”四个字,好多人会觉得特别高大上,不知道该怎么做。今天给大家一个懒人攻略,小伙伴们可以快速上手哦。一、什么是行业?在做数据分析的时候,“行业”两个字,一般指的是:围绕一个商品,从生产到销售相关的全部企业。以化妆品为例,站在消费者角度,就是简简单单的从商店里买了一支唇膏回去。可站在行业角度,从生产到销售,有相当多的企业在参与工作(如下图)在行业中,每个企业常常扮._码工小熊
文章浏览阅读1.6w次,点赞2次,收藏2次。还需要做更多的研究来解决大型语言模型中的偏见、有毒评论和幻觉的风险。我们在数万亿个令牌上训练我们的模型,并表明可以仅使用公开可用的数据集来训练最先进的模型,而无需诉诸专有和不可访问的数据集。在大型语言模型空间中训练像 LLaMA 这样的小型基础模型是可取的,因为它需要更少的计算能力和资源来测试新方法、验证他人的工作和探索新的用例。作为 Meta 对开放科学承诺的一部分,今天我们公开发布 LLaMA(大型语言模型元 AI),这是一种最先进的基础大型语言模型,旨在帮助研究人员推进他们在 AI 子领域的工作。_llma
文章浏览阅读223次,点赞3次,收藏5次。1.背景介绍制造业是国家经济发展的重要引擎,其产能和质量对于国家经济的稳定和发展具有重要意义。随着工业技术的不断发展,制造业的生产方式也不断发生变化。传统的制造业通常依赖于人工操作和手工艺,这种方式的缺点是低效率、低产量和不稳定的质量。随着信息化、智能化和网络化等新技术的出现,制造业开始向智能制造迈出了第一步。智能制造的核心是通过大数据、人工智能、计算机视觉等技术,实现制造过程的智能化、自动化...
文章浏览阅读938次。系列文章目录文章目录系列文章目录 前言 一、ansible是什么? 二、使用步骤 1.引入库 2.读入数据 总结前言菜鸟一只,刚开始使用,仅作以后参考使用。边学习,边记录,介绍一下最基础的使用,可能会有理解不到位的地方,可以共同交流,废话不多说,走起。一、ansible 简介?ansible是自动化运维工具的一种,基于Python开发,可以实现批量系统配置,批量程序部署,批量运行命令,ansible是基于模块工作的,它本身没有批量部署的能力,真正.._pip安装ansible