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

springmvc--请求参数的绑定

目录

一、创建项目,pom文件

二、web.xml

三、spring-mvc.xml

四、index.jsp

五、实体类

Address类

User类

六、UserController类

七、请求参数解决中文乱码

八、配置tomcat,然后启动tomcat

1.

2.

3.

4.

九、接收Map类型

1.直接接收Map类型

(1)Get请求

第一种情况,什么注解也没有

第二种情况:传个值

第三种情况:声明是get请求

第四种情况:加@RequestParam

(2)post请求:

第一种情况:什么注解也没有

前端页面:加一个表单

第二种情况:声明是post请求

第三种情况:加上@RequestParam注解

表单和controller类中的方法改改(加个username)

第四种情况:加@RequestBody注解

2.用对象接收map

(1)User类里加一个map

(2)前端:

(3)运行:

十、在控制器中使用原生的ServletAPI对象 


一、创建项目,pom文件

​
<?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><groupId>com.qcby</groupId><artifactId>springMVC12</artifactId><version>1.0-SNAPSHOT</version><packaging>war</packaging><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><spring.version>5.0.2.RELEASE</spring.version></properties><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>${spring.version}</version></dependency><dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version><scope>provided</scope></dependency><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.0</version><scope>provided</scope></dependency></dependencies></project>​

二、web.xml

​
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"version="4.0"><!--前端控制器--><servlet><servlet-name>dispatcherServlet</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring-mvc.xml</param-value></init-param><!--配置启动加载--><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>dispatcherServlet</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping></web-app>​

三、spring-mvc.xml

​
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:context="http://www.springframework.org/schema/context"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd"><!-- 配置spring创建容器时要扫描的包 --><context:component-scan base-package="com.qcby.controller"></context:component-scan><!-- 配置视图解析器 --><bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/pages/"></property><property name="suffix" value=".jsp"></property></bean><!-- 配置spring开启注解mvc的支持--><!--    <mvc:annotation-driven></mvc:annotation-driven>--></beans>​

四、index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %><html><head><title>请求参数绑定</title></head><body><form action="user/save1.do" method="post">姓名:<input type="text" name="username" /><br/>年龄:<input type="text" name="age" /><br/><input type="submit" value="提交" /></form><h3>请求参数绑定(封装到实体类)</h3><form action="user/save2.do" method="post">姓名:<input type="text" name="username" /><br/>年龄:<input type="text" name="age" /><br/><input type="submit" value="提交" /></form><h3>请求参数绑定(封装到实体类)</h3><form action="user/save3.do" method="post">姓名:<input type="text" name="username" /><br/>年龄:<input type="text" name="age" /><br/>金额:<input type="text" name="address.money" /><br/><input type="submit" value="提交" /></form><h3>请求参数绑定(封装到实体类,存在list集合)</h3><form action="user/save4.do" method="post">姓名:<input type="text" name="username" /><br/>年龄:<input type="text" name="age" /><br/>金额:<input type="text" name="address.money" /><br/>集合:<input type="text" name="list[0].money" /><br/>集合:<input type="text" name="list[1].money" /><br/><input type="submit" value="提交" /></form></body></html>

五、实体类

Address类

import java.io.Serializable;public class Address implements Serializable {private Double money;public Double getMoney() {return money;}public void setMoney(Double money) {this.money = money;}@Overridepublic String toString() {return "Address{" +"money=" + money +'}';}}

User类

import java.io.Serializable;import java.util.List;public class User implements Serializable {private String username;private Integer age;// 引用对象private Address address;// list集合private List<Address> list;public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public Integer getAge() {return age;}public void setAge(Integer age) {this.age = age;}public Address getAddress() {return address;}public void setAddress(Address address) {this.address = address;}public List<Address> getList() {return list;}public void setList(List<Address> list) {this.list = list;}@Overridepublic String toString() {return "User{" +"username='" + username + '\'' +", age=" + age +", address=" + address +", list=" + list +'}';}}

六、UserController类

import com.qcby.pojo.User;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;@Controller@RequestMapping("/user")public class UserController {@RequestMapping("/save1.do")public String save(String username,Integer age){System.out.println("姓名:"+username);System.out.println("年龄:"+age);return "success";}@RequestMapping("/save2.do")public String save2(User user){System.out.println("user对象:"+user);return "success";}@RequestMapping("/save3.do")public String save3(User user){System.out.println("user对象:"+user);return "success";}@RequestMapping("/save4.do")public String save4(User user){System.out.println("user对象:"+user);return "success";}}

七、请求参数解决中文乱码

在web.xml中配置Spring提供的过滤器

​
<!-- 配置过滤器,解决中文乱码的问题 --><filter><filter-name>characterEncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><!-- 指定字符集 --><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param></filter><filter-mapping><filter-name>characterEncodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping>现在的web.xml:<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"version="4.0"><!-- 配置过滤器,解决中文乱码的问题 --><filter><filter-name>characterEncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><!-- 指定字符集 --><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param></filter><filter-mapping><filter-name>characterEncodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping><!--前端控制器--><servlet><servlet-name>dispatcherServlet</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring-mvc.xml</param-value></init-param><!--配置启动加载--><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>dispatcherServlet</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping></web-app>​

八、配置tomcat,然后启动tomcat

1.

2.

3.

4.

九、接收Map类型

1.直接接收Map类型

如果想直接接收前端传过来的map参数,应该使用两个注解(RequestBody或RequestParam;RequestParam--get和post请求都可以,RequestBody只能post请求,底层封装都是LinkedHashMap)

(1)Get请求

第一种情况,什么注解也没有

UserController类里加一个方法

@RequestMapping("/mapSave1.do")public String mapSave1(Map<String, Objects> map){System.out.println("map:"+map);return "success";}

没有JSP页面,启动tomcat

控制台:什么输出也没有,没有值

第二种情况:传个值

控制台:还是什么都没有

第三种情况:声明是get请求

UserController类的mapSave1()方法:

@RequestMapping(value = "/mapSave1.do",method = RequestMethod.GET)public String mapSave1(Map<String, Objects> map){System.out.println("map:"+map);return "success";}

再启动:

控制台:还是没有值

所以跟请求是什么没关系,要想接收就要加注解

第四种情况:加@RequestParam
@RequestMapping(value = "/mapSave1.do")public String mapSave1(@RequestParam Map<String, Objects> map){System.out.println("map:"+map);return "success";}

再运行:

所以,我传递一个map在后端接收,用get请求必须加@RequestParam注解

(2)post请求:

第一种情况:什么注解也没有
@RequestMapping(value = "/mapSave2.do")public String mapSave1(Map<String, Objects> map){System.out.println("map:"+map);return "success";}
前端页面:加一个表单
<h3>请求参数的绑定--map集合</h3><form action="user/mapSave2.do" method="post">map集合key:<input type="text" name="map.key" /><br/>map集合value:<input type="text" name="map.value" /><br/><input type="submit" value="提交" /></form>

运行

点提交

控制台:什么也没有

第二种情况:声明是post请求
@RequestMapping(value = "/mapSave2.do",method = RequestMethod.POST)public String mapSave2(Map<String, Objects> map){System.out.println("map:"+map);return "success";}

再运行:

点提交

控制台:

说明跟get的一样,不加注解是没有办法接收到的

第三种情况:加上@RequestParam注解
@RequestMapping(value = "/mapSave2.do",method = RequestMethod.POST)public String mapSave2(@RequestParam Map<String, Objects> map){System.out.println("map:"+map);return "success";}

运行:

点提交

控制台:

可以看出,get请求和post请求都可以用@RequestParam注解

表单和controller类中的方法改改(加个username)

表单:

<h3>请求参数的绑定--map集合</h3><form action="user/mapSave2.do" method="post">username:<input type="text" name="username"><br/>map集合:<input type="text" name="test1"><br/><%-- test1就是map的key,输入框中的就是map的value --%><input type="submit" value="提交" /></form>

方法:

@RequestMapping(value = "/mapSave2.do")public String mapSave2(@RequestParam Map<String, Objects> map,String username){System.out.println("map:"+map);System.out.println("username:"+username);return "success";}

运行:

点提交:

控制台:

可以看到:表单中的数据都被封装到了map集合中

第四种情况:加@RequestBody注解

但是这样的话,它只能接收json数据

现在用表单接收就会报错:

@RequestMapping(value = "/mapSave2.do")public String mapSave2(@RequestBody Map<String, Objects> map, String username){System.out.println("map:"+map);System.out.println("username:"+username);return "success";}

运行:

点提交:(报错)

总结:无注解时,什么都接收不了;@RequestParam注解时,将参数包装成LinkedHashMap对象,参数的key是Map的key,参数的值是Map的value,get和

post请求都支持;@RequestBody注解接收json类型的数据(跟表单不一样,表单传不了),也会包装成LinkedHashMap对象,该注解不支持get请求,get请求没有请求体,不能传json

2.用对象接收map

(1)User类里加一个map

private Map<String,Address> userMap;

(2)前端:

<h3>请求参数绑定(封装到实体类,存在map集合)</h3><form action="user/save5.do" method="post">姓名:<input type="text" name="username" /><br/>年龄:<input type="text" name="age" /><br/>金额:<input type="text" name="address.money" /><br/>Map集合:<input type="text" name="userMap['one'].money" /><br/>Map集合:<input type="text" name="userMap['two'].money" /><br/><input type="submit" value="提交" /></form>

(3)运行:

点提交:

控制台:

十、在控制器中使用原生的ServletAPI对象 

只需要在控制器的方法参数定义HttpServletRequest和HttpServletResponse对象

UserController里加:

/*原生的API*/
@RequestMapping("/save6.do")
public String save6(HttpServletRequest request, HttpServletResponse response){System.out.println(request);// 获取到HttpSession对象HttpSession session = request.getSession();System.out.println(session);System.out.println(response);return "success";
}

运行:

控制台:

 

相关文章:

springmvc--请求参数的绑定

目录 一、创建项目&#xff0c;pom文件 二、web.xml 三、spring-mvc.xml 四、index.jsp 五、实体类 Address类 User类 六、UserController类 七、请求参数解决中文乱码 八、配置tomcat,然后启动tomcat 1. 2. 3. 4. 九、接收Map类型 1.直接接收Map类型 &#x…...

Redis查询缓存

什么是缓存&#xff1f; 缓存是一种提高数据访问效率的技术&#xff0c;通过在内存中存储数据的副本来减少对数据库或其他慢速存储设备的频繁访问。缓存通常用于存储热点数据或计算代价高的结果&#xff0c;以加快响应速度。 添加Redis缓存有什么好处&#xff1f; Redis 基…...

双馈风电DFIG并网系统次转子侧变流器RSC抑制策略研究基于LADRC和重复控制的方法

风电装机容量的持续增长以及电力电子装置的大规模接入&#xff0c;导致电网强度降低&#xff0c;系 统运行特性发生深刻变化&#xff0c;严重威胁风电并网系统的安全稳定运行。因此本文以双馈风 电场经串补线路并网系统为研究对象&#xff0c;在深入分析双馈风电并网系统振荡…...

国产编辑器EverEdit - 使用技巧:变量重命名的一种简单替代方法

1 使用技巧&#xff1a;变量重命名的一种简单替代方法 1.1 应用场景 写过代码的都知道&#xff0c;经常添加功能的时候&#xff0c;是把别的地方的代码拷贝过来&#xff0c;改吧改吧&#xff0c;就能用了&#xff0c;改的过程中&#xff0c;就涉及到一个变量名的问题&#xff…...

使用SSH建立内网穿透,能够访问内网的web服务器

搞了一个晚上&#xff0c;终于建立了一个内网穿透。和AI配合&#xff0c;还是得自己思考&#xff0c;AI配合才能搞定&#xff0c;不思考只依赖AI也不行。内网服务器只是简单地使用了python -m http.server 8899&#xff0c;但是对于Gradio建立的服务器好像不行&#xff0c;会出…...

JWT认证实战

JWT&#xff08;JSON Web Token&#xff09;是一种轻量级的、基于 JSON 的开放标准&#xff08;RFC 7519&#xff09;&#xff0c;用于在各方之间安全地传递信息。JWT 的特点是结构简单、轻量化和跨平台支持&#xff0c;适用于用户身份验证、信息加密以及无状态的 API 访问控制…...

计算机网络 (23)IP层转发分组的过程

一、IP层的基本功能 IP层&#xff08;Internet Protocol Layer&#xff09;是网络通信模型中的关键层&#xff0c;属于OSI模型的第三层&#xff0c;即网络层。它负责在不同网络之间传输数据包&#xff0c;实现网络间的互联。IP层的主要功能包括寻址、路由、分段和重组、错误检测…...

权限管理的方法

模块化分类 功能模块划分 把人资管理系统按业务逻辑拆分成清晰的功能区&#xff0c;例如招聘管理、培训管理、绩效管理、员工档案管理等。招聘管理模块下还能细分职位发布、简历筛选、面试安排等子功能&#xff1b;员工档案管理涵盖基本信息、教育经历、工作履历录入与查询等。…...

【郑大主办、ACM出版、EI稳定检索】第四届密码学、网络安全与通信技术国际会议 (CNSCT 2025)

第四届密码学、网络安全与通信技术国际会议(CNSCT 2025)将于2025年1月17-19日在中国郑州盛大启幕&#xff08;线上召开&#xff09;。本次会议旨在汇聚全球密码学、网络安全与通信技术领域的顶尖学者、研究人员与行业领袖&#xff0c;共同探索计算机科学的最新进展与未来趋势。…...

48小时,搭建一个设备巡检报修系统

背景 时不时的&#xff0c;工地的设备又出了状况。巡检人员一顿懵逼、维修人员手忙脚乱&#xff0c;操作工人抱怨影响进度。老板看着待完成的订单&#xff0c;就差骂娘了&#xff1a;“这么搞下去&#xff0c;还能有效率吗&#xff1f;”。 于是&#xff0c;抱着试一试的心态…...

基于Redisson实现重入锁

一. 分布式锁基础 在分布式系统中&#xff0c;当多个客户端&#xff08;应用实例&#xff09;需要访问同一资源时&#xff0c;可以使用分布式锁来确保同一时刻只有一个客户端能访问该资源。Redis作为高性能的内存数据库&#xff0c;提供了基于键值对的分布式锁实现&#xff0c…...

Java文件操作的简单示例

使用原生库 创建空白文件 package com.company; import java.io.File; import java.io.IOException;public class Main {public static void main(String[] args) {File f new File("newfile.txt");try {boolean flag f.createNewFile();System.out.println(&quo…...

删除与增加特定行

1.删除特定行 new_df <- df[-c(4), ] #删除第4行 new_df <- df[-c(2:4), ] #去除第2-4行 new_df <- subset(df, col1 < 10 & col2 < 6) #删除特定第一列<10和第二列&#xff1c;6的行。按名字删除 无论行列&#xff0c;可以找出对应索引或构造相同长…...

动态规划六——两个数组的dp问题

目录 题目一——1143. 最长公共子序列 - 力扣&#xff08;LeetCode&#xff09; 题目二——1035. 不相交的线 - 力扣&#xff08;LeetCode&#xff09; 题目三——115. 不同的子序列 - 力扣&#xff08;LeetCode&#xff09; 题目四—— 44. 通配符匹配 - 力扣&#xff08;…...

项目优化之策略模式

目录 策略模式基本概念 策略模式的应用场景 实际项目中具体应用 项目背景&#xff1a; 策略模式解决方案&#xff1a; 计费模块策略模式简要代码 策略模式基本概念 策略模式(Strategy Pattern) 是一种行为型设计模式&#xff0c;把算法的使用放到环境类中&#xff0c;而算…...

[读书日志]从零开始学习Chisel 第四篇:Scala面向对象编程——操作符即方法(敏捷硬件开发语言Chisel与数字系统设计)

3.2操作符即方法 3.2.1操作符在Scala中的解释 在其它语言中&#xff0c;定义了一些基本的类型&#xff0c;但这些类型并不是我们在面向对象中所说的类。比如说1&#xff0c;这是一个int类型常量&#xff0c;但不能说它是int类型的对象。针对这些数据类型&#xff0c;存在一些…...

三子棋游戏

目录 1.创建项目 2.主函数编写 3.菜单函数编写 4.宏定义棋盘行和列 5.棋盘初始化 6.打印棋盘 7.玩家下棋 8.电脑下棋 9.平局判断 10.输赢判断 11.game函数 三子棋游戏&#xff08;通过改变宏定义可以变成五子棋&#xff09;&#xff0c;玩家与电脑下棋 1.创建项目…...

MyBatis执行一条sql语句的流程(源码解析)

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 MyBatis执行一条sql语句的流程&#xff08;源码解析&#xff09; MyBatis执行sql语句的流程加载配置文件加载配置文件的流程 创建sqlsessionFactory对象解析Mapper创建sqlses…...

【电机控制】低通滤波器及系数配置

【电机控制】低通滤波器及系数配置 文章目录 [TOC](文章目录) 前言一、低通滤波器原理二、理论计算三、代码四、参考资料总结 前言 提示&#xff1a;以下是本篇文章正文内容&#xff0c;下面案例可供参考 一、低通滤波器原理 二、理论计算 三、代码 //低通滤波 pv->Ealpha…...

ArcgisServer过了元旦忽然用不了了?许可过期

昨天过完元旦之后上班发现好多ArcgisServer的站点运行出错了&#xff0c;点击日志发现&#xff0c;说是许可过去&#xff0c;也就是当时安装ArcgisServer时读取的ecp文件过期了&#xff0c;需要重新读取。 解决方法 1.临时方法&#xff0c;修改系统时间&#xff0c;早于2024年…...

业务系统对接大模型的基础方案:架构设计与关键步骤

业务系统对接大模型&#xff1a;架构设计与关键步骤 在当今数字化转型的浪潮中&#xff0c;大语言模型&#xff08;LLM&#xff09;已成为企业提升业务效率和创新能力的关键技术之一。将大模型集成到业务系统中&#xff0c;不仅可以优化用户体验&#xff0c;还能为业务决策提供…...

测试markdown--肇兴

day1&#xff1a; 1、去程&#xff1a;7:04 --11:32高铁 高铁右转上售票大厅2楼&#xff0c;穿过候车厅下一楼&#xff0c;上大巴车 &#xffe5;10/人 **2、到达&#xff1a;**12点多到达寨子&#xff0c;买门票&#xff0c;美团/抖音&#xff1a;&#xffe5;78人 3、中饭&a…...

高等数学(下)题型笔记(八)空间解析几何与向量代数

目录 0 前言 1 向量的点乘 1.1 基本公式 1.2 例题 2 向量的叉乘 2.1 基础知识 2.2 例题 3 空间平面方程 3.1 基础知识 3.2 例题 4 空间直线方程 4.1 基础知识 4.2 例题 5 旋转曲面及其方程 5.1 基础知识 5.2 例题 6 空间曲面的法线与切平面 6.1 基础知识 6.2…...

Java 加密常用的各种算法及其选择

在数字化时代&#xff0c;数据安全至关重要&#xff0c;Java 作为广泛应用的编程语言&#xff0c;提供了丰富的加密算法来保障数据的保密性、完整性和真实性。了解这些常用加密算法及其适用场景&#xff0c;有助于开发者在不同的业务需求中做出正确的选择。​ 一、对称加密算法…...

RNN避坑指南:从数学推导到LSTM/GRU工业级部署实战流程

本文较长&#xff0c;建议点赞收藏&#xff0c;以免遗失。更多AI大模型应用开发学习视频及资料&#xff0c;尽在聚客AI学院。 本文全面剖析RNN核心原理&#xff0c;深入讲解梯度消失/爆炸问题&#xff0c;并通过LSTM/GRU结构实现解决方案&#xff0c;提供时间序列预测和文本生成…...

Qemu arm操作系统开发环境

使用qemu虚拟arm硬件比较合适。 步骤如下&#xff1a; 安装qemu apt install qemu-system安装aarch64-none-elf-gcc 需要手动下载&#xff0c;下载地址&#xff1a;https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x…...

关于uniapp展示PDF的解决方案

在 UniApp 的 H5 环境中使用 pdf-vue3 组件可以实现完整的 PDF 预览功能。以下是详细实现步骤和注意事项&#xff1a; 一、安装依赖 安装 pdf-vue3 和 PDF.js 核心库&#xff1a; npm install pdf-vue3 pdfjs-dist二、基本使用示例 <template><view class"con…...

LCTF液晶可调谐滤波器在多光谱相机捕捉无人机目标检测中的作用

中达瑞和自2005年成立以来&#xff0c;一直在光谱成像领域深度钻研和发展&#xff0c;始终致力于研发高性能、高可靠性的光谱成像相机&#xff0c;为科研院校提供更优的产品和服务。在《低空背景下无人机目标的光谱特征研究及目标检测应用》这篇论文中提到中达瑞和 LCTF 作为多…...

Python实现简单音频数据压缩与解压算法

Python实现简单音频数据压缩与解压算法 引言 在音频数据处理中&#xff0c;压缩算法是降低存储成本和传输效率的关键技术。Python作为一门灵活且功能强大的编程语言&#xff0c;提供了丰富的库和工具来实现音频数据的压缩与解压。本文将通过一个简单的音频数据压缩与解压算法…...

第一篇:Liunx环境下搭建PaddlePaddle 3.0基础环境(Liunx Centos8.5安装Python3.10+pip3.10)

第一篇&#xff1a;Liunx环境下搭建PaddlePaddle 3.0基础环境&#xff08;Liunx Centos8.5安装Python3.10pip3.10&#xff09; 一&#xff1a;前言二&#xff1a;安装编译依赖二&#xff1a;安装Python3.10三&#xff1a;安装PIP3.10四&#xff1a;安装Paddlepaddle基础框架4.1…...