边缘计算服务器项目,什么是边缘计算?三分钟看懂

什么是边缘计算呢?其实关于边缘计算的定义,目前国内还没有一个严格统一的定义。今天小编就给大家整理三个关于边缘计算的说法,帮助大家快速理解什么是边缘计算。

145R44409-0.jpg

1、维基百科说

维基百科上说,边缘计算是一种分散式运算的架构,将应用程序、数据资料与服务的运算,由网络中心节点,移往网络逻辑上的边缘节点来处理。边缘计算将原本完全由中心节点处理大型服务加以分解,切割成更小与更容易管理的部分,分散到边缘节点去处理。边缘节点更接近于用户终端装置,可以加快资料的处理与传送速度,减少延迟。我们认为边缘计算是在靠近数据源头的地方提供智能分析处理服务,减少时延,提升效率,提高安全隐私保护。这个概念可能比较抽象,接下来再举两个生动的例子给大家说明。

2、章鱼说

2016年4月,新西兰国家水族馆一只名为“Inky”的章鱼偷偷从水族缸里爬了出来,穿过房间并钻入一个排水口,通过50米长的水管逃回了外海中。Inky的成功向我们证明:章鱼是地球上非常聪明的生物之一。

那么,章鱼跟边缘计算有什么关系?其实,章鱼就是用“边缘计算”来解决实际问题的。作为无脊椎动物,章鱼拥有巨量的神经元,但60%分布在章鱼的八条腿(腕足)上,脑部仅有40%。章鱼在捕猎时异常灵巧迅速,腕足之间配合极好,从不会缠绕打结。这得益于它们类似分布式计算的“多个小脑+一个大脑”。边缘计算也属于一种分布式计算:在网络边缘侧的智能网关上就近处理采集到的数据,而不需要将大量数据上传到远端的核心管理平台。

3、仿生说

这个例子就更形象了,因为跟我们的日常生活息息相关。当我们不小心被针扎到手,或者不小心被开水烫到的时候,总是下意识地先缩手,然后大脑才反应过来手被针扎了、被开水烫了。而将手收回来的过程,正是由神经末端直接处理的非条件反射,否则如果把信号传到大脑,然后大脑再下发指令,这样只会延长时间,加重疼痛。这里的大脑就相当于“云计算”,神经末端就相当于“边缘计算”。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,@Mapper注解是Mybatis框架中用于标识数据访问层接口的注解,用于告诉Spring容器将该接口类实例化并注入到其他Bean中。其使用步骤如下: 1. 在Spring Boot项目中引入Mybatis和Mybatis-Spring的依赖 2. 在配置文件中配置数据源和Mybatis的相关属性 3. 创建一个数据访问层接口,使用@Mapper注解标识该接口 4. 在该数据访问层接口中定义需要操作的数据库方法 5. 在Service或Controller中注入该数据访问层接口的实例,并调用其中的方法 下面是一个示例: 1. 在pom.xml中添加Mybatis和Mybatis-Spring的依赖: ```xml <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.6</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.1</version> </dependency> ``` 2. 在application.properties中配置数据源和Mybatis的相关属性: ```properties spring.datasource.url=jdbc:mysql://localhost:3306/test spring.datasource.username=root spring.datasource.password=123456 mybatis.type-aliases-package=com.example.demo.entity mybatis.mapper-locations=classpath:mapper/*.xml ``` 3. 创建一个数据访问层接口UserMapper,使用@Mapper注解标识该接口: ```java @Mapper public interface UserMapper { User selectByPrimaryKey(Integer id); int insert(User record); int updateByPrimaryKey(User record); int deleteByPrimaryKey(Integer id); } ``` 4. 在mapper目录下创建UserMapper.xml,定义需要操作的数据库方法: ```xml <mapper namespace="com.example.demo.mapper.UserMapper"> <resultMap id="BaseResultMap" type="com.example.demo.entity.User"> <id column="id" property="id" jdbcType="INTEGER"/> <result column="username" property="username" jdbcType="VARCHAR"/> <result column="password" property="password" jdbcType="VARCHAR"/> </resultMap> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer"> select * from user where id = #{id,jdbcType=INTEGER} </select> <insert id="insert" parameterType="com.example.demo.entity.User" useGeneratedKeys="true" keyProperty="id"> insert into user (username, password) values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}) </insert> <update id="updateByPrimaryKey" parameterType="com.example.demo.entity.User"> update user set username = #{username,jdbcType=VARCHAR}, password = #{password,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER} </update> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> delete from user where id = #{id,jdbcType=INTEGER} </delete> </mapper> ``` 5. 在Service或Controller中注入UserMapper的实例,并调用其中的方法: ```java @Service public class UserServiceImpl implements UserService { @Autowired private UserMapper userMapper; @Override public User selectByPrimaryKey(Integer id) { return userMapper.selectByPrimaryKey(id); } @Override public int insert(User user) { return userMapper.insert(user); } @Override public int updateByPrimaryKey(User user) { return userMapper.updateByPrimaryKey(user); } @Override public int deleteByPrimaryKey(Integer id) { return userMapper.deleteByPrimaryKey(id); } } ``` 这就是使用@Mapper注解的基本步骤,希望对你有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值