摘 要: JSON通常被广泛应用于服务器与客户端浏览器之间的数据交互。某些场景下,由于客户端请求数据量过大,会导致服务器运算时间及网络传输时间加长,严重影响用户体验。针对此问题,提出了一种数据压缩、数据缓存及分页传输的优化处理策略,查询数据库的数据缓存至服务器内存中,在相同的查询条件下不再查询数据库而是通过读取内存数据库Redis直接调取数据,并通过Gzip将数据压缩之后再通过分页方法,每次仅传输数据量的一部分到客户端浏览器。通过真实金融大规模数据集进行方法验证,结果表明,该方法能提高了45%以上的查询效率,有效地改善用户体验。 |
关键词: 数据压缩;缓存;内存数据库;分页 |
中图分类号: TP393.01
文献标识码: A
|
基金项目: 安徽高校自然科学研究重大项目(KJ2019ZD09);安徽省重点研究与开发计划项目(202004a07020028). |
|
Real-time Query Optimization for Large-scale Data of Internet Applications |
SHA Mengfan1, XU Lanmei2, TENG Qingyong1,3, WANG Xiaolin1,2
|
( 1.Information Technology Research Institute, Anhui University of Technology, Ma'anshan 243000, China ; 2.School of Computer Science, Anhui University of Technology, Ma'anshan 243000, China ; 3.Ma 'anshan University, Ma 'anshan 243000, China )
649945261@qq.com; 1294641349@qq.com; 2322619935@qq.com; wxl@ahut.edu.cn
|
Abstract: JSON (JavaScript Object Notation) is widely used for data exchange between server and client. However, large amount of data requests may result in long time delay on searching and transmission which will seriously affect users' experience. To solve these problems, this paper proposes an optimization strategy of data compression, data cache and paging transmission. Data of the query database is cached in memory. Next time with the same query conditions, data can be directly retrieved by reading Redis, a memory-based database, instead of being queried from within a disk-based database. The data will be compressed by Gzip compression technology and then transferred only a part by paging method to the browser each time. It is verified though the real large-scale financial data sets. The results show that the proposed strategy can effectively improve query efficiency by more than 45%, with improved user experience. |
Keywords: data compression; cache; memory database; paging |