当前位置:网站首页>How pbidea imports large medical insurance files
How pbidea imports large medical insurance files
2022-04-21 08:18:00 【lxbin2003】
PbIdea How to import large medical insurance files ?
The national medical insurance program is based on zip Provide drugs in the format 、 Material Library Download ,zip Inside the file is a text file , The text file is utf8 code , There are hundreds of decompressed M. This document is right PB Come on , It's hard to deal with .PbIdea There are special functions to process this file .
use first uo_httpclient or uo_curl object , According to the medical insurance interface document zip File download , Save as a file . Suppose the file is saved as d:\ 202202187369608330634159091.zip. Next, how to import the data in this compressed package into the database .
First step : Parse data file , Break it down into several small json file .
Break down into small pieces json The advantage of data files is that they don't take up too much memory , Each data import can be processed quickly .
uo_yibao yb; yb = create uo_yibao
uo_json jsYB;jsYB = create uo_json
yb.ImportYiBaoZip("d:\ 202202187369608330634159091.zip",jsYB)
establish yb and json object , And then call the function. ImportYiBaoZip.ImportYiBaoZip The parameters of the function can be zip file , You don't need to decompress . It can also be decompressed txt file .
Under normal circumstances , This process is about 10 More seconds . If something goes wrong , See for yourself jsYB Deal with the contents of . If it's right ,jsYB The content is like this :
See the picture below :
“files” part , Is an array , Contains a list of files , You can cycle it out , use uo_json After the parsing , then dwImportJson Import DW.
“lines” part , Is to detect which rows of data in the data may have problems , Manual correction is required . These lines are not resolved to JSON Li Lai .
“message” part , Prompt information , If something goes wrong , Here is the error message .
“result” part , How many lines have been successfully parsed this time .

The second step : Resolve each of JSON Import DW.
JSON The file format is array , Each line of sub field data parsed from the data file .Iine Is the number of lines in the data file ,f1-fn Field name , Each according to the business definition .

string ls_file
int i
i = 0
do while true
if jsYB.Get("/files/" + string(i) + "/file",ref ls_file) then
dw_1.dataobject = "" // Here can be your own definition DW, You can also leave it blank ,uo_json Will dynamically create a suitable DW
jsData = create uo_json
if jsData.parseFile(ls_file) then
if jsData.dwImportJson(dw_1) then
// Here, update to the database in your own way
end if
end if
destroy jsData
else
exit // Cycle through all the files in the list
end if
i++
loop
Through the above code , Loop will all JSON File import DW.
With 300 many M Of TXT file (ZIP The file is about 60M about ) Come on , expect 20-30 Seconds can all be imported into DW. As for how long it takes to import the database , It depends on the functions realized by their respective businesses .
Of course , After data import , You can go through the cycle by yourself , Take out each file name , And delete it .
Great freedom QQ781770213
2022/4/14
版权声明
本文为[lxbin2003]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210743252976.html
边栏推荐
- 机器人无人机视觉避障常见方式及优缺点总结
- [web system course design] version 2022
- Kernel PWN learning (1) -- environment construction
- Is int not supported in analyticdb MySQL?
- 在链表结点前插入新结点
- MySQL创建新表
- Postgresql limit sql性能分析
- Installer mongodb
- How to solve the failure of importing Excel data into the database
- [interview ordinary people vs Expert Series] understanding of B tree and B + tree
猜你喜欢

解决数据库无法启动

将excel数据向数据库里导入时失败怎么解决

【C语言入门系列(8)(9)】第八、九章、指针、结构体

容联七陌助力知名新零售品牌,重塑企业增长新链路

一本快速入门ARM64体系结构的编程书

【读书笔记->统计学】07-01 离散型概率分布-几何分布概念简介
![[introduction to C language series (8) (9)] Chapter 8 and 9, pointer and structure](/img/98/33ce4ce21f036ace1b75cdddb4f158.png)
[introduction to C language series (8) (9)] Chapter 8 and 9, pointer and structure

Postgresql limit sql性能分析

echart双折线-echart图表(二)

Redis (15) -- master-slave replication of redis -- sentinel mode
随机推荐
【get C】数据在内存是如何存储的
Record the fuck string of C # to Base64 and Base64 restore string
【MATLAB】绘制泽尼克多项式
Redis(14) -- Redis的主从复制
ehcart 地图
【一、xxx病虫害检测项目】2、网络结构尝试改进:Resnet50、SE、CBAM、Feature Fusion
Compile u-boot for stm32mp157 development board
echart双折线-echart图表(二)
重置kubernetes集群
If ehcache is changed to redis cache according to the requirements, the detailed integration steps are as follows:
kernel-pwn学习(2)--kernel uaf&&CISCN2017 - babydriver
Thinkphp快速入门(三)
request与response对象
带自己学paddle(四)
Web漏洞详解:SQL注入漏洞
第七章 Select子句与子查询
Installation of redis in Linux
What is the difference between localhost and 127.0.0.1? (Reprinted)
Use of antv X6 layout
Security settings of SQL Server database of SQL Server database