当前位置:网站首页>The writing speed is increased by tens of times. The application of tdengine in tostar intelligent factory solution
The writing speed is increased by tens of times. The application of tdengine in tostar intelligent factory solution
2022-06-10 01:09:00 【Taosi data tdengine】
Small T Reading guide : In tostar's intelligent factory overall solution project , The traditional relational database has been unable to process time series data efficiently , In the load 、 Storage, query and many other aspects have encountered challenges , Finally they chose TDengine To match the application analysis scenarios of industrial sensor data . This article will describe their application TDengine The concrete practice of .
Guangdong tostar Technology Co., Ltd ( abbreviation : Dostar , Stock code :300607) It is the first robot backbone enterprise landing on the gem in Guangdong Province . Tostar insists “ Make industrial manufacturing better ” Enterprise mission of , By using industrial robots 、 Injection molding machine 、CNC As the core intelligent equipment , And control 、 servo 、 Three core technologies of vision , Build an intelligent hardware platform driven by core technology , Provide manufacturing enterprises with overall solutions for intelligent factories .
In the field of industry , production 、 test 、 A large amount of sensor data with time stamp may be generated in the operation stage , These are typical time series data . Time series data are mainly monitored by various types of real-time data 、 Collected or generated by inspection and analysis equipment , Involving manufacturing 、 Electric power 、 chemical 、 Engineering operation and other industries , Ability to write more and read less 、 Typical characteristics such as very large quantity .
In our business , Traditional relational database (Relational Database) Time series data cannot be processed efficiently , In the load 、 Storage, query and many other aspects have encountered challenges . The main problems can be summarized as follows :
Low write throughput : Single machine write throughput is low , It is difficult to meet the write pressure of tens of millions of sequential data ;
Storage costs are high : Poor performance when compressing time series data , It takes up a lot of machine resources ;
Maintenance costs are high : Stand alone system , It is necessary to manually divide the warehouse and table on the upper layer , Maintenance costs are high ;
Poor query performance : The aggregation and analysis performance of massive real-time data is poor .
In order to better meet the processing requirements of time series data , We decided to conduct a database selection survey , Finally, the time series database is selected (Time-Series Database)TDengine. The fact proved that ,TDengine Write to timing data 、 Storage 、 Indexes 、 Query and other aspects have been specifically optimized , Thus, better data loading is realized 、 data compression 、 Query write performance , It is very suitable for the application analysis scenario of industrial sensor data .
Compared with general database ,TDengine Amazing compression , The core reason is that it uses columnar storage , And a two-stage compression strategy is adopted , Different compression algorithms are adopted for different data types , This compression mechanism makes its compression rate far higher than that of other databases .
Besides TDengine also It has extremely high read and write performance , And the reading and writing speed is affected by data Storage scale Has little impact , Need to know Once the amount of data in the general database exceeds one million , The reading and writing speed is Meeting There was a significant decline , Before We I did it once MySQL Test of batch inserting data , The performance gap is obvious , This is also At the mass level data storage Let's Will choose TDengine One of the important reasons . say concretely ,TDengine The advantages are as follows :
The data can be read and written quickly with time stamp , Use SQL Perform database operations , Easy to learn , Support complex queries
High data compression rate , A large amount of data will not occupy too much storage space , Data can be exported for backup
Have an exchange community and exchange group , Meet problems and TDengine Other users of , And the official students can also provide timely help
Of course , There is no perfect database , After the application, we summarized two areas for improvement :
Cannot use visualization software such as Navicat And so on (TDengine GUI)
Not yet Windows Server of version , Like our last customer , Only locally Windows Use the program on , Without installing the virtual machine and deploying it to the server , You can't deploy TDengine
But each product is gradually progressing in the step of finding and improving problems , And for our business implementation ,TDengine There is no obvious short board . There is no optimal database , In case of scene matching , We finally adopted TDengine.
The platform architecture
We push the data collected by the gateway to MQTT,Java After listening, the backend will write TDengine, The data is returned to the front end after the back end queries and processes according to the requirements .
say concretely , The gateway will first read the uplink rules published in the background , After collecting device data , Use the uplink rules to process and calculate the data, and then return the results to the downlink rules module , After background monitoring , Will connect TDengine Create and modify database tables and write data . We have used the cloud platform before Kafka Publish and subscribe data , Now all environments are changed to MQTT 了 .
Super table and modeling ideas
In the application TDengine when , We set up a pipeline database "iot_platform" It is used to store the data from the gateway , It is convenient for future query . We followed “ A collection point, a table , A kind of data is a super table ” The idea of building tables , Two super tables are designed in practice , One is for storing log Of instruction content “logs” surface , The other one is for storing the contents of other instructions “datas” surface , The data type is basically current and voltage 、 Equipment status, etc . When storing data, we will first judge the data , Then decide which table to store the data in .
After running for a while ,TDengine Query for 、 The writing speed can fully meet our current customer needs , The slowest minute , The fastest way to reach 1 One second ; At most one device a day can Write nearly 100000 pieces of data , Nearly a thousand devices write at the same time also No problem at all , Compared with before , The write speed is increased by tens of times . Query data in months by The time range of units is not too obvious Of Delay , The overall data compression ratio is about 1/10, The amount of data currently generated per day stay Count G about .
Pipeline data query

Query the flow data in a certain time period , Using query statements :
SELECT datagettime as ts , ${dataName} as data FROM ${tableName}<where>uuid = ${uuid}<if test="startTime != null ">and datagettime > #{startTime}</if><if test="endTime != null ">and #{endTime} > datagettime</if>and ${dataName} is not null</where>limit 0, ${countLimit}
The aggregate function calculates the data for a day

Use TDengine Calculate the daily electricity consumption as a function of , Then calculate the monthly and annual data every day , The query statement is :
select diff(${dataName}) as datafrom ${tableName}where ${dataName} > 0and datagettime > #{startTime}and #{endTime} >= datagettime
Calculate the data in a certain period of time

select ${method}(${dataName}) as datafrom ${tableName}where uuid = ${uuid}and datagettime > #{startTime}and #{endTime} > datagettime;
Under the background of the rapid development of industrial Internet , A large number of equipment sensors and monitoring systems have been put into the industrial production site , The real-time data provided by the two can reflect the equipment status and production progress , Most of the data are real-time data formed in chronological order , These massive real-time data have diverse analysis needs and important reference value .
Hope for the future TDengine It can provide more complex flow computing 、 Query, analysis, monitoring and early warning , It can be used for visual operation and maintenance of products 、 Predictive maintenance 、 Provide data basis for remote intelligent management , Thus reducing personnel 、 Time and other costs , Accelerate the deep integration of industrialization and informatization , Promote the transformation and upgrading of complex heavy equipment manufacturing industry , Produce social and economic benefits .
Click on Read the original , Understand the experience TDengine!
This article is from WeChat official account. - TDengine(taosdata_news).
If there is any infringement , Please contact the [email protected] Delete .
Participation of this paper “OSC Source creation plan ”, You are welcome to join us , share .
边栏推荐
- 写入速度提升数十倍,TDengine 在拓斯达智能工厂解决方案上的应用
- BGP protocol experiment
- Application scheme of residual pressure monitoring system in a high-rise residential building
- Have you learned about arrays and slices in golang in go question bank · 1?
- TensorFlow新文档发布:新增CLP、DTensor...最先进的模型已就绪
- Force deduction solution summary 497 random points in non overlapping rectangles
- The binary tree is expanded into a linked list [the essence of tree processing -- how to handle each sub tree]
- Web3对元宇宙的数据主权至关重要
- Node-RED系列(二六):使用dashboard节点开发常见的表格搜索布局
- MySQL -- how to solve the problem of data read consistency
猜你喜欢

Think of GPL as a "virus"? Please stop defaming GPL

Two problems of DataGrid

Interface control devaxpress WinForms -- new WXI skin grabs "fresh" view

Never far away, five programming languages that may be doomed to decline

Application of fire emergency evacuation indication system in a biopharmaceutical factory project

The state of gurobi solution and its attribute acquisition

图片批量下载 +图片马赛克:多张图片组成端午安康

Alleviate and repair Android studio Caton, kotlin code prompt is slow
![[GoogleCTF2019 Quals]Bnv -S](/img/85/b8ed2ed1b3a5484007dba0f7c0eb55.png)
[GoogleCTF2019 Quals]Bnv -S

Node-RED系列(二三):在Node-RED中开发一个高德地图面板dashboard
随机推荐
内网渗透第4章
Application scheme of residual pressure monitoring system in a high-rise residential building
别再重复造轮子了,推荐使用 Google Guava 开源工具类库,真心强大!
Mysql——》查看索引的大小
Analyse du code source de la Bibliothèque open source de Tencent libco CO CO - Process
0基础入行软件测试只靠自学可行吗?看完这篇不迷茫....
亚洲首屈一指的Web3盛事“TOKEN2049新加坡”公布冠名赞助商
MongoDB 开源“可查询加密”系统 Queryable Encryption
Unity技术 - 2D项目经验
数据库之App.config配置文件错误
TensorFlow新文档发布:新增CLP、DTensor...最先进的模型已就绪
《Go题库·1》Golang里的数组和切片有了解过吗?
MySQL - transaction attributes
Shell Eval usage explanation command replacement
剑指 Offer II 014. 字符串中的变位词
ThingsBoard教程(十九):规则节点概览介绍
OSPF first experiment
花了两小时体验IDEA最新史诗皮肤
防火门监控系统在某住宅项目上的应用
Have you learned about arrays and slices in golang in go question bank · 1?