当前位置:网站首页>No server is required, teach you to get real-time health code recognition with only 30 lines of code
No server is required, teach you to get real-time health code recognition with only 30 lines of code
2022-08-04 16:02:00 【InfoQ】
This article is shared from HUAWEI CLOUD Community "
Helping epidemic prevention and control, 30 lines of code can handle real-time serverless health code recognition!
", author: HUAWEI CLOUD PaaS service Xiaozhi.
The COVID-19 outbreak has spread far and wide and has lasted longer than we expected.Since the outbreak of the epidemic, almost everyone's life has been affected. Fortunately, it is now the digital era. In order to prevent and control the epidemic, the health code has become our passport, which has minimized the epidemic's restrictions on our travel..
In April, the epidemic in Shanghai was raging, and the development of the epidemic affected the hearts of countless Chinese people. Everyone was doing their best to fight the epidemic. At that time, I saw an article "
Dr. Fudan used 130 lines of code to solve nucleic acid statistics, and completed an hour of manual workload in 2 minutes
” report, which reminds me of myself as a mother,One of the things that must be done every day is to upload the health codes of yourself and your family to the school. From another perspective, during the epidemic, various schools, governments, shopping malls and other institutions need to collect a large number of nucleic acid reports and health codes every day. Manual review is not only time-consuming and time-consuming.It is easy to make mistakes and cannot find problems in time.For solving manual repetitive work, computer programs can be said to bear the brunt. Like this Fudan doctor, it is a good idea to use python code for nucleic acid statistics.
I remembered a HUAWEI CLOUD developer event "Serverless Master Pretenders Crash Course" that used the text recognition OCR mentioned in the report, the difference is that HUAWEI CLOUD is based onIt is provided in the form of cloud services, and the platform-function workflow FunctionGraph used in this activity, does not need to build a local code environment to develop directly on the cloud, deploy on the cloud, and does not require a server, which feels more lightweight and convenient. Thinking of this, II am going to use the content of this study to build an application for health code recognition.
First of all, the main content of the health code is all text, so I opened it firstUniversal text recognition service for HUAWEI CLOUD OCR.
then press activityGuide, create a function in the function workflow FunctionGraph, and reuse the code used in the activity, but change the type of the ocr service called to general text recognition.
That's it?With trepidation, I identified a big data formation card of my own.
So farIt all looks good, but considering that if it is put into actual business scenarios, this seems to be far from enough.If the screenshots are collected and then analyzed and processed centrally, it will definitely take a while, and there is still a problem that the screenshots cannot be analyzed in a timely manner in the centralized processing. For example, the time for submitting an abnormal screenshot and the time for centralized processing are relatively largeIf there is a time difference, it will cause the possibility of further spread of the epidemic.
Function Workflow FunctionGraph supports the creation of triggers, so I created an OBS trigger for the function, so that as long as an image is uploaded to this OBS, it will trigger the execution of the health code recognition function.
Try again, is it OK to upload a screenshot of the health code to the OBS bucketTrigger function execution.
It's done, I counted it, except for the comments, there are only thirty or soThe real-time analysis of the health code can be done with just one line of code, and the sense of achievement is full. For those who want to try it, I have carefully prepared "
30 lines of code to realize serverless real-time health code recognition.--Operation Manual
", use it quickly!!!
Of course, to put it into use, other capabilities are needed, such as health code submission entry, abnormal code alarm, data storage, etc. These are left to developers to play freely!
Click to follow and learn about HUAWEI CLOUD's new technologies for the first time~
边栏推荐
- 5 基本引用类型
- Go 言 Go 语,一文看懂 Go 语言文件操作
- Legal education combined with VR panorama, intuitively feel and learn the spirit of the rule of law
- 面渣逆袭:MySQL六十六问,两万字+五十图详解
- 字节API鉴权方法
- 【伸手党福利】投影仪初学者入门——投影亮度及幕布选择——从入门到精通
- Li Mu's deep learning notes are here!
- In action: 10 ways to implement delayed tasks, with code!
- 云存储硬核技术内幕——(11) 女子会所的秘密
- 农产品期货开户哪家好??
猜你喜欢
随机推荐
直播回放含 PPT 下载|基于 Flink & DeepRec 构建 Online Deep Learning
PHP 图片转PDF
《电磁兼容防护EMC》学习笔记
农产品期货开户哪家好??
GET 和 POST 请求的区别
现代 ABAP 编程语言中的正则表达式
学 Go,最常用的技能是什么?打日志
【Es6中的promise】
把boot和APP一起烧录进MCU
To ensure that the communication mechanism
uni-app之renderjs
Typora收费?搭建VS Code MarkDown写作环境
攻防视角下,初创企业安全实战经验分享
吴恩达机器学习[9]-神经网络学习
GPS卫星同步时钟,NTP网络同步时钟,北斗时钟服务器(京准)
Pisanix v0.2.0 发布|新增动态读写分离支持
DevOps平台中的制品库是什么?有什么用处?
Crawler Xiaobai Notes (yesterday's supplement to pay attention to parsing data)
Pulsar消费者处理不当导致的消息积压问题
UWP WPF 解决 xaml 设计显示异常