暂无个人介绍
2019年11月
go语言用VS也可以的。 他自己也有自己的编译器liteide。 但是用的也不是很多。 我在用liteide。免安装的。用用凑合的。 go语言的程序.go结尾的哦
我在写完了专著《区块链正在改变世界》之后, 已经完成了《Go语言程序入门》的编写。需要的话,电子书的有可以提供。
4V
第一个V——高容量
这个最好理解,数据量一定要大,才好意思称自己为大数据嘛。大到什么程度呢?依目前行情来看,至少也要到TB级,很多案例都是PB甚至更高。但如果是GB级,非说自己是大数据也不是不可以,就是有点无颜见江东父老啊……
第二个V——多样化
这个很关键了!是区别于以往海量数据挖掘的最主要特征。它有两层含义,一是数据来源多样化,系统数据、设备日志、传感器、文件系统等等来源。二是数据结构多样化,这是核心特征!要包含结构化数据、非结构数据(包括所谓半结构化数据)。
总结起来就是,多源异构。这就是为什么有人认为使用NoSQL数据库(如MongoDB)就是大数据了,因为满足了多样化的特征,但其实还不够。
第三个V——高速
即时效性,基本上至少也要达到亿级数据一秒查询,做的比较好的可以达到千亿级数据一秒查询。这个特征几乎决定了传统技术架构无法满足要求,因此Hadoop架构的出现催化了大数据的发展,也是有人认为Hadoop就是大数据的原因。
第四个V——价值
这个很好理解,数据一定要有价值、而后才能产生价值。就好比存商品的叫才能仓库,存垃圾的叫垃圾填满坑一样。没价值的数据就像一个垃圾填满坑,这也是为什么数据治理在大数据实施中非常重要的原因之一。
最后,也是最重要的,以上4个V是逻辑与的关系,即需同时、注意是同时满足上述四个特征,就可以放心的说自己是大数据了!
AliOS Things发布于2017年杭州云栖大会, 是 AliOS 家族旗下的、面向IoT领域的、高可伸缩的物联网操作系统,于2017年10月20号宣布在github上开源. Architecture Overview AliOS Things 支持多种CPU架构,包括:ARM,C-Sky,MIPS,rl78,rx600,xtensa等。同时AliOS Things也支持相当多的开发板. 从架构的角度来看,AliOS Things适配了分层架构和组件架构。从上到下,AliOS Things包括以下部分: BSP: 板级支持包,主要由SoC开发商开发和维护 HAL: 硬件适配层,像是WiFi,UART等 Kernel: 包括Rhino RTOS 内核,Yloop, VFS, KV Storage等 Protocol Stack: 包括LwIP TCPIP 协议栈, uMesh mesh networking stack等 Security: 包括TLS, TFS(Trusted Framework Service), TEE(Trusted Exexcution Environment)等 AOS API: AliOS Things 提供给应用软件和中间件的API Middleware: 阿里巴巴增值和常用的物联网组件 Examples: 手把手的示例代码,以及一些严格测试的应用程序,像是 linkkitapp 所有的模块都作为组件的形式存在,每一个组件都有自己的.mk文件,用来描述与其他组件的描述关系,应用程序可以很方便的通过这种形式选择需要的组件。
在android上拍的图片上传到阿里云上进行图像识别,上传图片然后调用阿里图像识别
package com.feng1.foundation.service.impl;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONObject; import com.feng1.foundation.dto.BankCardInfoDTO; import com.feng1.foundation.dto.IdentityCardInfoDTO; import com.feng1.foundation.po.*; import com.feng1.foundation.service.IDictionaryService; import com.feng1.foundation.service.IImageRecognitionService; import com.feng1.foundation.service.vo.DictionaryItemVO; import com.feng1.framework.common.domain.result.ModelResult; import com.feng1.framework.common.domain.result.ModelResultClient; import com.feng1.framework.common.http.HttpClient; import com.feng1.framework.util.DateUtil; import com.feng1.framework.util.JsonUtils; import com.google.common.collect.Lists; import okhttp3.MediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RestController;
import java.io.; import java.net.HttpURLConnection; import java.net.URL; import java.util.;
import static org.apache.commons.codec.binary.Base64.encodeBase64;
@RestController public class ImageRecognitionServiceImpl implements IImageRecognitionService {
private static final Logger LOGGER = LoggerFactory.getLogger(ImageRecognitionServiceImpl.class);
@Autowired
HttpClient httpClient;
@Autowired
IDictionaryService dictionaryService;
@Value("${imageRecognition.idCardHost}")
private String idCardHost;
@Value("${imageRecognition.idCardServicePath}")
private String idCardServicePath;
@Value("${imageRecognition.appcode}")
private String appcode;
@Value("${imageRecognition.qiniuPath}")
private String qiniuPath;
@Value("${imageRecognition.bankCardHost}")
private String bankCardHost;
@Value("${imageRecognition.bankCardServicePath}")
private String bankCardServicePath;
/**
* 获取参数的json对象
*/
public static JSONObject getParam(int type, String dataValue) {
JSONObject obj = new JSONObject();
try {
obj.put("dataType", type);
obj.put("dataValue", dataValue);
} catch (JSONException e) {
LOGGER.error("JSONException",e);
}
return obj;
}
@Override
public ModelResult<IdentityCardInfoDTO> identityCardRecognition(String imagePath) {
String imgFilePath = qiniuPath +"/"+ imagePath;
//String imgFilePath ="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531919752737&di=8f489a54cd0e4beb43c424858cdb9a09&imgtype=0&src=http%3A%2F%2Fcq.focus.cn%2Fupload%2Fphotos%2F1760%2F7Nh8JmKZ.jpg";
//如果文档的输入中含有inputs字段,设置为True, 否则设置为False
//获取图片文件
File imageFile = getImageFile(imgFilePath);
//请根据线上文档修改configure字段
JSONObject configObj = new JSONObject();
configObj.put("side", "face");
String config_str = configObj.toString();
// 对图像进行base64编码
String imgBase64 = "";
try {
byte[] content = new byte[(int) imageFile.length()];
FileInputStream finputstream = new FileInputStream(imageFile);
finputstream.read(content);
finputstream.close();
imgBase64 = new String(encodeBase64(content));
} catch (IOException e) {
e.printStackTrace();
return new ModelResultClient<IdentityCardInfoDTO>().failFactory("-1","IO异常");
}
// 拼装请求body的json字符串
JSONObject requestObj = new JSONObject();
try {
requestObj.put("image", imgBase64);
if(config_str.length() > 0) {
requestObj.put("configure", config_str);
}
} catch (JSONException e) {
e.printStackTrace();
}
String bodys = requestObj.toString();
IdentityCardInfoResult identityCardInfoResult =null;
try {
String res = httpClient.httpPostForImageRecog(idCardHost + idCardServicePath, bodys, MediaType.parse("application/x-www-form-urlencoded"),appcode);
identityCardInfoResult = JsonUtils.jsonToBean(res, IdentityCardInfoResult.class);
} catch (Exception e) {
e.printStackTrace();
}
if(!"true".equalsIgnoreCase(identityCardInfoResult.getSuccess())){
imageFile.delete();
return new ModelResultClient<IdentityCardInfoDTO>().failFactory(identityCardInfoResult.getCode(),identityCardInfoResult.getMessage());
}
IdentityCardInfoDTO identityCardInfoDTO = new IdentityCardInfoDTO();
String birth = identityCardInfoResult.getBirth();
Date yyyyMMdd = DateUtil.parseDate(birth, "yyyy-MM-dd");
int diffMonth = DateUtil.diffMonth(yyyyMMdd,new Date());
int age = diffMonth / 12;
BeanUtils.copyProperties(identityCardInfoResult,identityCardInfoDTO);
identityCardInfoDTO.setAge(age);
imageFile.delete();
return new ModelResultClient<IdentityCardInfoDTO>().successFactory(identityCardInfoDTO);
}
@Override
public ModelResult<BankCardInfoDTO> bankCardRecognition(String imagePath) {
String imgFilePath = qiniuPath +"/"+ imagePath;
File imageFile = getImageFile(imgFilePath);
String imgBase64 = "";
try {
byte[] content = new byte[(int) imageFile.length()];
FileInputStream finputstream = new FileInputStream(imageFile);
finputstream.read(content);
finputstream.close();
imgBase64 = new String(encodeBase64(content));
} catch (IOException e) {
e.printStackTrace();
return new ModelResultClient<BankCardInfoDTO>().failFactory("-1","IO异常");
}
JSONObject imageBody = new JSONObject();
imageBody.put("dataType",50);
imageBody.put("dataValue",imgBase64);
JSONObject imageBodyOutSide = new JSONObject();
imageBodyOutSide.put("image",imageBody);
List<JSONObject> objects = Lists.newArrayList();
objects.add(imageBodyOutSide);
JSONObject requestBody = new JSONObject();
requestBody.put("inputs",objects);
String requestString = requestBody.toString();
BankCardInfoResult bankCardInfoResult = new BankCardInfoResult();
try {
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
String res = httpClient.httpPostForImageRecog(bankCardHost + bankCardServicePath, requestString, MediaType.parse("application/json;charset=utf-8"),appcode);
bankCardInfoResult= JsonUtils.jsonToBean(res, BankCardInfoResult.class);
} catch (Exception e) {
LOGGER.error("调用阿里银行卡图像识别接口失败",e);
}
List<BankCardOutput> outputs = bankCardInfoResult.getOutputs();
BankCardOutput bankCardOutput = outputs.get(0);
BankCardOutputValue outputValue = bankCardOutput.getOutputValue();
String dataValue = outputValue.getDataValue();
BankCardDataValue bankCardDataValue = JsonUtils.jsonToBean(dataValue, BankCardDataValue.class);
String successRes = bankCardDataValue.getSuccess();
if(!"true".equalsIgnoreCase(successRes)){
imageFile.delete();
return new ModelResultClient<BankCardInfoDTO>().failFactory();
}
//获取银行卡号
String card_num = bankCardDataValue.getCard_num();
String res =null;
try {
res = httpClient.httpGet("https://ccdcapi.alipay.com/validateAndCacheCardInfo.json?cardNo="+card_num+"&cardBinCheck=true");
} catch (IOException e) {
LOGGER.error("根据银行卡号调用接口查询银行信息失败",e);
}
BankNamePO bankNamePO = JsonUtils.jsonToBean(res, BankNamePO.class);
if("true".equalsIgnoreCase(successRes) && "false".equalsIgnoreCase(bankNamePO.getValidated())){
imageFile.delete();
return new ModelResultClient<BankCardInfoDTO>().failFactory("未找到匹配的银行信息");
}
//获取的是银行缩写,须查询数据字典
String bank = bankNamePO.getBank();
BankCardInfoDTO bankCardInfoDTO = new BankCardInfoDTO();
bankCardInfoDTO.setBankCardNum(card_num);
bankCardInfoDTO.setBankCode(bank);
ModelResult<List<DictionaryItemVO>> bankNameResult = dictionaryService.getDictItems("BankName");
List<DictionaryItemVO> bankList = bankNameResult.getData();
for (DictionaryItemVO dictionaryItemVO : bankList) {
if(dictionaryItemVO.getValue().equalsIgnoreCase(bank)){
bankCardInfoDTO.setBankName(dictionaryItemVO.getLabel());
break;
}
}
imageFile.delete();
return new ModelResultClient<BankCardInfoDTO>().successFactory(bankCardInfoDTO);
}
private File getImageFile(String imgFilePath){
URL url = null;
File imageFile =null;
try {
//new一个URL对象
url = new URL(imgFilePath);
//打开链接
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
//设置请求方式为"GET"
conn.setRequestMethod("GET");
//超时响应时间为5秒
conn.setConnectTimeout(5 * 1000);
//通过输入流获取图片数据
InputStream inStream = conn.getInputStream();
//得到图片的二进制数据,以二进制封装得到数据,具有通用性
byte[] data = readInputStream(inStream);
//new一个文件对象用来保存图片,默认保存当前工程根目录
imageFile = new File("BeautyGirl"+UUID.randomUUID()+".jpg");
//创建输出流
FileOutputStream outStream = new FileOutputStream(imageFile);
//写入数据
outStream.write(data);
//关闭输出流
outStream.close();
} catch (Exception e) {
LOGGER.error("根据七牛云图片url生成图片文件异常"+e);
}
return imageFile;
}
private static byte[] readInputStream(InputStream inStream) throws Exception{
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
//创建一个Buffer字符串
byte[] buffer = new byte[1024];
//每次读取的字符串长度,如果为-1,代表全部读取完毕
int len = 0;
//使用一个输入流从buffer里把数据读取出来
while( (len=inStream.read(buffer)) != -1 ){
//用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
outStream.write(buffer, 0, len);
}
//关闭输入流
inStream.close();
//把outStream里的数据写入内存
return outStream.toByteArray();
}
}
物联网是很好的创业方向。 现在有很多的创业机会和创业的投资机构,可以提交BP过来联系我,帮你解决一些融资以及项目开发过程中的问题。
有的,现在在工地里都用我们的刷脸的方案啦。 使用刷脸机
最大的可能是没有连接后台的数据库。扫码了,但是没有后台数据的比对。
1.采用独立的数据库
优点: 为安全性要求较高的租户提供了一定程度的逻辑数据隔离,并不是完全隔离;每个数据库可支持更多的租户数量。
缺点: 如果出现故障,数据恢复比较困难,因为恢复数据库将牵涉到其他租户的数据; 如果需要跨租户统计数据,存在一定困难。
优点: 三种方案比较,第三种方案的维护和购置成本最低,允许每个数据库支持的租户数量最多。
缺点: 隔离级别最低,安全性最低,需要在设计开发时加大对安全的开发量; 数据备份和恢复最困难,需要逐表逐条备份和还原。 如果希望以最少的服务器为最多的租户提供服务,并且租户接受牺牲隔离级别换取降低成本,这种方案最适合。
增值电信业务许可证的全称是“中华人民共和国电信与信息服务业务经营许可证”,是通过互联网向上网用户提供有偿信息、网上广告、代制作网页、电子商务及其它网上应用服务的公司必须办理的网络经营许可证 ,国家对经营性网站实行增值电信业务许可证可证制度
关于增值电信业务许可证的办理请参考:http://baike.baidu.com/link?url=n6Vd4P01gZSrqJclB_UszJpZx-GBG2MaYY41PWejy1tQN29_vpVlcRsj8IfFgZhbbb65bCCNZI-zOVlsw7MI5a。
您可以通过以下四种途径在阿里云进行企业实名认证: 1. 通过企业支付宝授权认证。 2. 通过企业法人支付宝授权认证。 3. 通过企业法人扫脸认证。 4. 通过企业银行打款方式认证。
将用户本地上传的资源转化,即用户通过浏览器点击文件上传时,将图片资源转化成base64 var reader = new FileReader(); var AllowImgFileSize = 2100000; //上传图片最大值(单位字节)( 2 M = 2097152 B )超过2M上传失败 var file = $("#image")[0].files[0]; var imgUrlBase64; if (file) { //将文件以Data URL形式读入页面
imgUrlBase64 = reader.readAsDataURL(file); reader.onload = function (e) { //var ImgFileSize = reader.result.substring(reader.result.indexOf(",") + 1).length;//截取base64码部分(可选可不选,需要与后台沟通) if (AllowImgFileSize != 0 && AllowImgFileSize < reader.result.length) { alert( '上传失败,请上传不大于2M的图片!'); return; }else{ //执行上传操作 alert(reader.result); } } }
参看流程
1、ALIN10146-自查方案。参考蚂蚁金服技术支持 https://openclub.alipay.com/club/history/read/6918 2、iwebshop 对接支付宝app支付
异步通知的url不要携带?号
后台开启伪静态
服务器进行伪静态设置
location /{ if (!-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } }
1、成为云大使。通过阿里云双 11 活动页推荐客户下单买 ECS,活动页规则要求新用户以及企业新用户才可以下单的 ECS,客户成功参与并付款。 2、不是新用户,非通过双 11 活动页下单,不诚信的不能得到返利