当前位置:网站首页>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~
边栏推荐
猜你喜欢
随机推荐
Roslyn 在多开发框架让 msbuild 的 Target 仅运行一次
张乐:研发效能的黄金三角及需求与敏捷协作领域的实践|直播回顾
UWP WPF 解决 xaml 设计显示异常
长期更新的一些 pytorch 知识点总结
Go 事,如何成为一个Gopher ,并在7天找到 Go 语言相关工作,第1篇
不需要服务器,教你仅用30行代码搞定实时健康码识别
邮差"头":{“retCode”:“999999”
Go Go 简单的很,标准库之 fmt 包的一键入门
云存储硬核技术内幕——(13) 抓手,组合拳与闭环
西安纵横资讯×JNPF:适配中国企业特色,全面集成费用管控体系
初学爬虫笔记(收集数据)
界面组件DevExpress ASP.NET Core v22.1 - 增强数据导出功能
保证通信的机制有哪些
招募 | 香港理工大学Georg Kranz 博士诚招博士
云存储硬核技术内幕——(9) 相见时难别亦难
吴恩达机器学习[12]-机器学习系统设计
Matlab计算随模拟时间变化的热导率
多商户商城系统功能拆解24讲-平台端分销会员
(2022杭电多校五)C - Slipper (dijkstra+虚拟结点)
What is the difference between ITSM software and a work order system?