SpringMVC 如何优雅的处理各种异常?

ps: 本文讲得比较细,所以篇幅较长。阅读时间:30m~1h。请认真读完,希望你一小时后能对统一异常处理有一个清晰的认识。
背景
软件开发过程中,不可避免的是需要处理各种异常,就我自己来说,至少有一半以上的时间都是在处理各种异常情况,所以代码中就会出现大量的try {...} catch {...} finally {...} 代码块,不仅有大量的冗余代码,而且还影响代码的可读性。比较下面两张图,看看您现在编写的代码属于哪一种风格?然后哪种编码风格您更喜欢?
丑陋的 try catch 代码块
优雅的controller
上面的示例,还只是在controller层,如果是在service层,可能会有更多的try catch代码块。这将会严重影响代码的可读性、“美观性”。
所以如果是我的话,我肯定偏向于第二种,我可以把更多的精力放在业务代码的开发,同时代码也会变得更加简洁。
既然业务代码不显式地对异常进行捕获、处理,而异常肯定还是处理的,不然系统岂不是动不动就崩溃了,所以必须得有其他地方捕获并处理这些异常。
那么问题来了,如何优雅的处理各种异常?
什么是统一异常处理
spring在3.2版本增加了一个注解@controlleradvice,可以与@exceptionhandler、@initbinder、@modelattribute 等注解注解配套使用,对于这几个注解的作用,这里不做过多赘述,若有不了解的,可以参考spring3.2新注解@controlleradvice,先大概有个了解。
不过跟异常处理相关的只有注解@exceptionhandler,从字面上看,就是 异常处理器 的意思,其实际作用也是:若在某个controller类定义一个异常处理方法,并在方法上添加该注解,那么当出现指定的异常时,会执行该处理异常的方法,其可以使用springmvc提供的数据绑定,比如注入httpservletrequest等,还可以接受一个当前抛出的throwable对象。
但是,这样一来,就必须在每一个controller类都定义一套这样的异常处理方法,因为异常可以是各种各样。这样一来,就会造成大量的冗余代码,而且若需要新增一种异常的处理逻辑,就必须修改所有controller类了,很不优雅。
当然你可能会说,那就定义个类似basecontroller的基类,这样总行了吧。
这种做法虽然没错,但仍不尽善尽美,因为这样的代码有一定的侵入性和耦合性。简简单单的controller,我为啥非得继承这样一个类呢,万一已经继承其他基类了呢。大家都知道java只能继承一个类。
那有没有一种方案,既不需要跟controller耦合,也可以将定义的 异常处理器 应用到所有控制器呢?所以注解@controlleradvice出现了,简单的说,该注解可以把异常处理器应用到所有控制器,而不是单个控制器。借助该注解,我们可以实现:在独立的某个地方,比如单独一个类,定义一套对各种异常的处理机制,然后在类的签名加上注解@controlleradvice,统一对 不同阶段的、不同异常 进行处理。这就是统一异常处理的原理。
注意到上面对异常按阶段进行分类,大体可以分成:进入controller前的异常 和 service 层异常,具体可以参考下图:
不同阶段的异常
目标
消灭95%以上的 try catch 代码块,以优雅的 assert(断言) 方式来校验业务的异常情况,只关注业务逻辑,而不用花费大量精力写冗余的 try catch 代码块。
统一异常处理实战
注:因为整个统一异常处理方案涉及的代码比较多,这里不方便贴出所有代码,只会贴出关键部分,所以建议将源码clone到本地方便查看。源码地址:https://github.com/sprainkle/spring-cloud-advance,涉及到的项目包括:spring-cloud-advance-common、unified-exception-handling。
在定义统一异常处理类之前,先来介绍一下如何优雅的判定异常情况并抛异常。
用 assert(断言) 替换 throw exception
想必 assert(断言) 大家都很熟悉,比如 spring 家族的 org.springframework.util.assert,在我们写测试用例的时候经常会用到,使用断言能让我们编码的时候有一种非一般丝滑的感觉,比如:
    @test    public void test1() {        ...        user user = userdao.selectbyid(userid);        assert.notnull(user, 用户不存在.);        ...    }    @test    public void test2() {        // 另一种写法        user user = userdao.selectbyid(userid);        if (user == null) {            throw new illegalargumentexception(用户不存在.);        }    } 有没有感觉第一种判定非空的写法很优雅,第二种写法则是相对丑陋的 if {...} 代码块。那么神奇的 assert.notnull() 背后到底做了什么呢?下面是 assert 的部分源码:
public abstract class assert {
    public assert() {    }    public static void notnull(@nullable object object, string message) {        if (object == null) {            throw new illegalargumentexception(message);        }    }} 可以看到,assert 其实就是帮我们把 if {...} 封装了一下,是不是很神奇。虽然很简单,但不可否认的是编码体验至少提升了一个档次。那么我们能不能模仿org.springframework.util.assert,也写一个断言类,不过断言失败后抛出的异常不是illegalargumentexception 这些内置异常,而是我们自己定义的异常。下面让我们来尝试一下。
assert
public interface assert {
    /**     * 创建异常     * @param args     * @return     */    baseexception newexception(object... args);    /**     * 创建异常     * @param t     * @param args     * @return     */    baseexception newexception(throwable t, object... args);    /**     * 断言对象obj非空。如果对象obj为空,则抛出异常     *     * @param obj 待判断对象     */    default void assertnotnull(object obj) {        if (obj == null) {            throw newexception(obj);        }    }    /**     * 断言对象obj非空。如果对象obj为空,则抛出异常     * 异常信息message支持传递参数方式,避免在判断之前进行字符串拼接操作     *     * @param obj 待判断对象     * @param args message占位符对应的参数列表     */    default void assertnotnull(object obj, object... args) {        if (obj == null) {            throw newexception(args);        }    }} 注:
这里只给出assert接口的部分源码,更多断言方法请参考源码。
baseexception 是所有自定义异常的基类。
在接口中定义默认方法是java8的新语法。
上面的assert断言方法是使用接口的默认方法定义的,然后有没有发现当断言失败后,抛出的异常不是具体的某个异常,而是交由2个newexception接口方法提供。因为业务逻辑中出现的异常基本都是对应特定的场景,比如根据用户id获取用户信息,查询结果为null,此时抛出的异常可能为usernotfoundexception,并且有特定的异常码(比如7001)和异常信息“用户不存在”。所以具体抛出什么异常,有assert的实现类决定。
看到这里,您可能会有这样的疑问,按照上面的说法,那岂不是有多少异常情况,就得有定义等量的断言类和异常类,这显然是反人类的,这也没想象中高明嘛。别急,且听我细细道来。
善解人意的enum
自定义异常baseexception有2个属性,即code、message,这样一对属性,有没有想到什么类一般也会定义这2个属性?没错,就是枚举类。且看我如何将 enum 和 assert 结合起来,相信我一定会让你眼前一亮。如下:
public interface iresponseenum {    int getcode();    string getmessage();}/** * 业务异常
 * 业务处理时,出现异常,可以抛出该异常
 */public class businessexception extends  baseexception {    private static final long serialversionuid = 1l;    public businessexception(iresponseenum responseenum, object[] args, string message) {        super(responseenum, args, message);    }    public businessexception(iresponseenum responseenum, object[] args, string message, throwable cause) {        super(responseenum, args, message, cause);    }}public interface businessexceptionassert extends iresponseenum, assert {    @override    default baseexception newexception(object... args) {        string msg = messageformat.format(this.getmessage(), args);        return new businessexception(this, args, msg);    }    @override    default baseexception newexception(throwable t, object... args) {        string msg = messageformat.format(this.getmessage(), args);        return new businessexception(this, args, msg, t);    }}@getter@allargsconstructorpublic enum responseenum implements businessexceptionassert {    /**     * bad licence type     */    bad_licence_type(7001, bad licence type.),    /**     * licence not found     */    licence_not_found(7002, licence not found.)    ;    /**     * 返回码     */    private int code;    /**     * 返回消息     */    private string message;} 看到这里,有没有眼前一亮的感觉,代码示例中定义了两个枚举实例:bad_licence_type、licence_not_found,分别对应了badlicencetypeexception、licencenotfoundexception两种异常。以后每增加一种异常情况,只需增加一个枚举实例即可,再也不用每一种异常都定义一个异常类了。然后再来看下如何使用,假设licenceservice有校验licence是否存在的方法,如下:
    /**     * 校验{@link licence}存在     * @param licence     */    private void checknotnull(licence licence) {        responseenum.licence_not_found.assertnotnull(licence);    } 若不使用断言,代码可能如下:
   private void checknotnull(licence licence) {
       if (licence == null) {            throw new licencenotfoundexception();            // 或者这样            throw new businessexception(7001, bad licence type.);        }    } 使用枚举类结合(继承)assert,只需根据特定的异常情况定义不同的枚举实例,如上面的bad_licence_type、licence_not_found,就能够针对不同情况抛出特定的异常(这里指携带特定的异常码和异常消息),这样既不用定义大量的异常类,同时还具备了断言的良好可读性,当然这种方案的好处远不止这些,请继续阅读后文,慢慢体会。
注:上面举的例子是针对特定的业务,而有部分异常情况是通用的,比如:服务器繁忙、网络异常、服务器异常、参数校验异常、404等,所以有commonresponseenum、argumentresponseenum、servletresponseenum,其中 servletresponseenum 会在后文详细说明。
定义统一异常处理器类
@slf4j@component@controlleradvice@conditionalonwebapplication@conditionalonmissingbean(unifiedexceptionhandler.class)public class unifiedexceptionhandler {    /**     * 生产环境     */    private final static string env_prod = prod;    @autowired    private unifiedmessagesource unifiedmessagesource;    /**     * 当前环境     */    @value(${spring.profiles.active})    private string profile;    /**     * 获取国际化消息     *     * @param e 异常     * @return     */    public string getmessage(baseexception e) {        string code = response. + e.getresponseenum().tostring();        string message = unifiedmessagesource.getmessage(code, e.getargs());        if (message == null || message.isempty()) {            return e.getmessage();        }        return message;    }    /**     * 业务异常     *     * @param e 异常     * @return 异常结果     */    @exceptionhandler(value = businessexception.class)    @responsebody    public errorresponse handlebusinessexception(baseexception e) {        log.error(e.getmessage(), e);        return new errorresponse(e.getresponseenum().getcode(), getmessage(e));    }    /**     * 自定义异常     *     * @param e 异常     * @return 异常结果     */    @exceptionhandler(value = baseexception.class)    @responsebody    public errorresponse handlebaseexception(baseexception e) {        log.error(e.getmessage(), e);        return new errorresponse(e.getresponseenum().getcode(), getmessage(e));    }    /**     * controller上一层相关异常     *     * @param e 异常     * @return 异常结果     */    @exceptionhandler({            nohandlerfoundexception.class,            httprequestmethodnotsupportedexception.class,            httpmediatypenotsupportedexception.class,            missingpathvariableexception.class,            missingservletrequestparameterexception.class,            typemismatchexception.class,            httpmessagenotreadableexception.class,            httpmessagenotwritableexception.class,            // bindexception.class,            // methodargumentnotvalidexception.class            httpmediatypenotacceptableexception.class,            servletrequestbindingexception.class,            conversionnotsupportedexception.class,            missingservletrequestpartexception.class,            asyncrequesttimeoutexception.class    })    @responsebody    public errorresponse handleservletexception(exception e) {        log.error(e.getmessage(), e);        int code = commonresponseenum.server_error.getcode();        try {            servletresponseenum servletexceptionenum = servletresponseenum.valueof(e.getclass().getsimplename());            code = servletexceptionenum.getcode();        } catch (illegalargumentexception e1) {            log.error(class [{}] not defined in enum {}, e.getclass().getname(), servletresponseenum.class.getname());        }        if (env_prod.equals(profile)) {            // 当为生产环境, 不适合把具体的异常信息展示给用户, 比如404.            code = commonresponseenum.server_error.getcode();            baseexception baseexception = new baseexception(commonresponseenum.server_error);            string message = getmessage(baseexception);            return new errorresponse(code, message);        }        return new errorresponse(code, e.getmessage());    }    /**     * 参数绑定异常     *     * @param e 异常     * @return 异常结果     */    @exceptionhandler(value = bindexception.class)    @responsebody    public errorresponse handlebindexception(bindexception e) {        log.error(参数绑定校验异常, e);        return wrapperbindingresult(e.getbindingresult());    }    /**     * 参数校验异常,将校验失败的所有异常组合成一条错误信息     *     * @param e 异常     * @return 异常结果     */    @exceptionhandler(value = methodargumentnotvalidexception.class)    @responsebody    public errorresponse handlevalidexception(methodargumentnotvalidexception e) {        log.error(参数绑定校验异常, e);        return wrapperbindingresult(e.getbindingresult());    }    /**     * 包装绑定异常结果     *     * @param bindingresult 绑定结果     * @return 异常结果     */    private errorresponse wrapperbindingresult(bindingresult bindingresult) {        stringbuilder msg = new stringbuilder();        for (objecterror error : bindingresult.getallerrors()) {            msg.append(, );            if (error instanceof fielderror) {                msg.append(((fielderror) error).getfield()).append(: );            }            msg.append(error.getdefaultmessage() == null ?  : error.getdefaultmessage());        }        return new errorresponse(argumentresponseenum.valid_error.getcode(), msg.substring(2));    }    /**     * 未定义异常     *     * @param e 异常     * @return 异常结果     */    @exceptionhandler(value = exception.class)    @responsebody    public errorresponse handleexception(exception e) {        log.error(e.getmessage(), e);        if (env_prod.equals(profile)) {            // 当为生产环境, 不适合把具体的异常信息展示给用户, 比如数据库异常信息.            int code = commonresponseenum.server_error.getcode();            baseexception baseexception = new baseexception(commonresponseenum.server_error);            string message = getmessage(baseexception);            return new errorresponse(code, message);        }        return new errorresponse(commonresponseenum.server_error.getcode(), e.getmessage());    }} 可以看到,上面将异常分成几类,实际上只有两大类,一类是servletexception、serviceexception,还记得上文提到的 按阶段分类 吗,即对应 进入controller前的异常 和 service 层异常;然后 serviceexception 再分成自定义异常、未知异常。对应关系如下:
进入controller前的异常: handleservletexception、handlebindexception、handlevalidexception
自定义异常: handlebusinessexception、handlebaseexception
未知异常: handleexception
接下来分别对这几种异常处理器做详细说明。
异常处理器说明
handleservletexception
一个http请求,在到达controller前,会对该请求的请求信息与目标控制器信息做一系列校验。这里简单说一下:
nohandlerfoundexception:首先根据请求url查找有没有对应的控制器,若没有则会抛该异常,也就是大家非常熟悉的404异常;
httprequestmethodnotsupportedexception:若匹配到了(匹配结果是一个列表,不同的是http方法不同,如:get、post等),则尝试将请求的http方法与列表的控制器做匹配,若没有对应http方法的控制器,则抛该异常;
httpmediatypenotsupportedexception:然后再对请求头与控制器支持的做比较,比如content-type请求头,若控制器的参数签名包含注解@requestbody,但是请求的content-type请求头的值没有包含application/json,那么会抛该异常(当然,不止这种情况会抛这个异常);
missingpathvariableexception:未检测到路径参数。比如url为:/licence/{licenceid},参数签名包含@pathvariable(licenceid),当请求的url为/licence,在没有明确定义url为/licence的情况下,会被判定为:缺少路径参数;
missingservletrequestparameterexception:缺少请求参数。比如定义了参数@requestparam(licenceid) string licenceid,但发起请求时,未携带该参数,则会抛该异常;
typemismatchexception: 参数类型匹配失败。比如:接收参数为long型,但传入的值确是一个字符串,那么将会出现类型转换失败的情况,这时会抛该异常;
httpmessagenotreadableexception:与上面的httpmediatypenotsupportedexception举的例子完全相反,即请求头携带了content-type: application/json;charset=utf-8,但接收参数却没有添加注解@requestbody,或者请求体携带的 json 串反序列化成 pojo 的过程中失败了,也会抛该异常;
httpmessagenotwritableexception:返回的 pojo 在序列化成 json 过程失败了,那么抛该异常;
httpmediatypenotacceptableexception:未知;
servletrequestbindingexception:未知;
conversionnotsupportedexception:未知;
missingservletrequestpartexception:未知;
asyncrequesttimeoutexception:未知;
handlebindexception
参数校验异常,后文详细说明。
handlevalidexception
参数校验异常,后文详细说明。
handlebusinessexception、handlebaseexception
处理自定义的业务异常,只是handlebaseexception处理的是除了 businessexception 以外的所有业务异常。就目前来看,这2个是可以合并成一个的。
handleexception
处理所有未知的异常,比如操作数据库失败的异常。
注:上面的handleservletexception、handleexception 这两个处理器,返回的异常信息,不同环境返回的可能不一样,因为这些异常信息都是框架自带的异常信息,一般都是英文的,不太好直接展示给用户看,所以统一返回server_error代表的异常信息。
异于常人的404
上文提到,当请求没有匹配到控制器的情况下,会抛出nohandlerfoundexception异常,但其实默认情况下不是这样,默认情况下会出现类似如下页面:
whitelabel error page
这个页面是如何出现的呢?实际上,当出现404的时候,默认是不抛异常的,而是 forward跳转到/error控制器,spring也提供了默认的error控制器,如下:
basicerrorcontroller
那么,如何让404也抛出异常呢,只需在properties文件中加入如下配置即可:
spring.mvc.throw-exception-if-no-handler-found=truespring.resources.add-mappings=false 如此,就可以异常处理器中捕获它了,然后前端只要捕获到特定的状态码,立即跳转到404页面即可,具体可参考single page applications with spring boot。
捕获404对应的异常
统一返回结果
在验证统一异常处理器之前,顺便说一下统一返回结果。说白了,其实是统一一下返回结果的数据结构。code、message 是所有返回结果中必有的字段,而当需要返回数据时,则需要另一个字段 data 来表示。
所以首先定义一个 baseresponse 来作为所有返回结果的基类;
然后定义一个通用返回结果类commonresponse,继承 baseresponse,而且多了字段 data;
为了区分成功和失败返回结果,于是再定义一个 errorresponse;
最后还有一种常见的返回结果,即返回的数据带有分页信息,因为这种接口比较常见,所以有必要单独定义一个返回结果类 querydataresponse,该类继承自 commonresponse,只是把 data 字段的类型限制为 queryddata,queryddata中定义了分页信息相应的字段,即totalcount、pageno、 pagesize、records。
其中比较常用的只有 commonresponse 和 querydataresponse,但是名字又贼鬼死长,何不定义2个名字超简单的类来替代呢?于是 r 和 qr 诞生了,以后返回结果的时候只需这样写:new r(data)、new qr(querydata)。
所有的返回结果类的定义这里就不贴出来了,可以直接查看源码。
验证统一异常处理
因为这一套统一异常处理可以说是通用的,所有可以设计成一个 common包,以后每一个新项目/模块只需引入该包即可。所以为了验证,需要新建一个项目,并引入该 common包。项目结构如下:
项目结构
以后只需这样引入即可:
引入common包
主要代码
下面是用于验证的主要源码:
@servicepublic class licenceservice extends serviceimpl {    @autowired    private organizationclient organizationclient;    /**     * 查询{@link licence} 详情     * @param licenceid     * @return     */    public licencedto querydetail(long licenceid) {        licence licence = this.getbyid(licenceid);        checknotnull(licence);        organizationdto org = clientutil.execute(() -> organizationclient.getorganization(licence.getorganizationid()));        return tolicencedto(licence, org);    }    /**     * 分页获取     * @param licenceparam 分页查询参数     * @return     */    public querydata getlicences(licenceparam licenceparam) {        string licencetype = licenceparam.getlicencetype();        licencetypeenum licencetypeenum = licencetypeenum.parseofnullable(licencetype);        // 断言, 非空        responseenum.bad_licence_type.assertnotnull(licencetypeenum);        lambdaquerywrapper wrapper = new lambdaquerywrapper();        wrapper.eq(licence::getlicencetype, licencetype);        ipage page = this.page(new querypage(licenceparam), wrapper);        return new querydata(page, this::tosimplelicencedto);    }    /**     * 新增{@link licence}     * @param request 请求体     * @return     */    @transactional(rollbackfor = throwable.class)    public licenceaddrespdata addlicence(licenceaddrequest request) {        licence licence = new licence();        licence.setorganizationid(request.getorganizationid());        licence.setlicencetype(request.getlicencetype());        licence.setproductname(request.getproductname());        licence.setlicencemax(request.getlicencemax());        licence.setlicenceallocated(request.getlicenceallocated());        licence.setcomment(request.getcomment());        this.save(licence);        return new licenceaddrespdata(licence.getlicenceid());    }    /**     * entity -> simple dto     * @param licence {@link licence} entity     * @return {@link simplelicencedto}     */    private simplelicencedto tosimplelicencedto(licence licence) {        // 省略    }    /**     * entity -> dto     * @param licence {@link licence} entity     * @param org {@link organizationdto}     * @return {@link licencedto}     */    private licencedto tolicencedto(licence licence, organizationdto org) {        // 省略    }    /**     * 校验{@link licence}存在     * @param licence     */    private void checknotnull(licence licence) {        responseenum.licence_not_found.assertnotnull(licence);    }} ps: 这里使用的dao框架是mybatis-plus。启动时,自动插入的数据为:
-- licenceinsert into licence (licence_id,  organization_id, licence_type, product_name, licence_max, licence_allocated)values (1, 1, 'user','customerpro', 100,5);insert into licence (licence_id,  organization_id, licence_type, product_name, licence_max, licence_allocated)values (2, 1, 'user','suitability-plus', 200,189);insert into licence (licence_id,  organization_id, licence_type, product_name, licence_max, licence_allocated)values (3, 2, 'user','hr-powersuite', 100,4);insert into licence (licence_id,  organization_id, licence_type, product_name, licence_max, licence_allocated)values (4, 2, 'core-prod','wildcat application gateway', 16,16);-- organizationsinsert into organization (id, name, contact_name, contact_email, contact_phone)values (1, 'customer-crm-co', 'mark balster', 'mark.balster@custcrmco.com', '823-555-1212');insert into organization (id, name, contact_name, contact_email, contact_phone)values (2, 'hr-powersuite', 'doug drewry','doug.drewry@hr.com', '920-555-1212'); 开始验证
捕获自定义异常
获取不存在的 licence 详情:http://localhost:10000/licence/5。成功响应的请求:licenceid=1
校验非空
捕获 licence not found 异常
licence not found
根据不存在的 licence type 获取 licence 列表:http://localhost:10000/licence/list?licencetype=ddd。可选的 licence type 为:user、core-prod 。
校验非空
捕获 bad licence type 异常
bad licence type
捕获进入 controller 前的异常
访问不存在的接口:
http://localhost:10000/licence/list/ddd
捕获404异常
http 方法不支持:
http://localhost:10000/licence
postmapping
捕获 request method not supported 异常
request method not supported
校验异常1:
http://localhost:10000/licence/list?licencetype=
getlicences
licenceparam
捕获参数绑定校验异常
licence type cannot be empty
校验异常2:post 请求,这里使用postman模拟。
addlicence
licenceaddrequest
请求url即结果
捕获参数绑定校验异常
注:因为参数绑定校验异常的异常信息的获取方式与其它异常不一样,所以才把这2种情况的异常从 进入 controller 前的异常 单独拆出来,下面是异常信息的收集逻辑:
异常信息的收集
捕获未知异常
假设我们现在随便对 licence 新增一个字段 test,但不修改数据库表结构,然后访问:http://localhost:10000/licence/1。
增加test字段
捕获数据库异常
error querying database
小结
可以看到,测试的异常都能够被捕获,然后以 code、message 的形式返回。每一个项目/模块,在定义业务异常的时候,只需定义一个枚举类,然后实现接口 businessexceptionassert,最后为每一种业务异常定义对应的枚举实例即可,而不用定义许多异常类。使用的时候也很方便,用法类似断言。
扩展
在生产环境,若捕获到 未知异常 或者 servletexception,因为都是一长串的异常信息,若直接展示给用户看,显得不够专业,于是,我们可以这样做:当检测到当前环境是生产环境,那么直接返回 网络异常。
生产环境返回“网络异常”
可以通过以下方式修改当前环境:
修改当前环境为生产环境
总结
使用 断言 和 枚举类 相结合的方式,再配合统一异常处理,基本大部分的异常都能够被捕获。为什么说大部分异常,因为当引入 spring cloud security 后,还会有认证/授权异常,网关的服务降级异常、跨模块调用异常、远程调用第三方服务异常等,这些异常的捕获方式与本文介绍的不太一样,不过限于篇幅,这里不做详细说明,以后会有单独的文章介绍。
另外,当需要考虑国际化的时候,捕获异常后的异常信息一般不能直接返回,需要转换成对应的语言,不过本文已考虑到了这个,获取消息的时候已经做了国际化映射,逻辑如下:
获取国际化消息
由于国际化相关知识不属于本文介绍的范畴,所以不过多说明,以后也会有单独的文章介绍。


VICO-4 TICO SDI转换器可实现4:1无损压缩视频
紫光国微与国创中心战略合作 全面进军汽车电子产业
CES主办方预计2018年美消费技术收入增长3.9%达3510亿
新能源项目输出电压不稳定需要用电力电容器吗
AMD泰坦超算退役 将重新打造新超算未来有望成为新的TOP500第一
SpringMVC 如何优雅的处理各种异常?
气象传感器排名有哪些品牌质量好?
led驱动芯片应用电路
新势力第一车企诞生
数字鉴相器,数字鉴相器原理是什么?
钙钛矿太阳能电池优缺点
台积电将从明年起涨薪约20%
一种具有实际价值的加密货币BIG代币介绍
航运巨头UPS正在考虑通过LOCKER项目来接受比特币支付
数学通道应用注意事项与典型案例
FPGA技术之CRC校验的原理分析
采用LabVIEW软件设计的地面伽玛能谱仪校准软件的特点及应用
NVIDIA发布了GeForce 461.33驱动,修复多款游戏崩溃
关于无刷直流电机的知识汇总
分析总结LED贴片机的发展趋势及未来方向