{"id":5827,"date":"2022-05-20T18:22:31","date_gmt":"2022-05-21T01:22:31","guid":{"rendered":"https:\/\/tdengine.com\/?p=5827"},"modified":"2025-03-30T20:05:24","modified_gmt":"2025-03-31T03:05:24","slug":"a-time-series-platform-for-autonomous-driving-technology","status":"publish","type":"post","link":"https:\/\/tdengine.com\/a-time-series-platform-for-autonomous-driving-technology\/","title":{"rendered":"Building a Time-Series Platform for Autonomous Driving Data"},"content":{"rendered":"\n<p>ECARX faced two problems in their secure SuperCloud: large amounts of data storage was being consumed and real-time queries of vehicle status had high latency. After due diligence and development, they ended up using TDengine as the foundation of their system. TDengine is responsible for the writing, storage and real-time queries of real-time vehicle data. This article describes the specific difficulties encountered by the R&amp;D team in their use of Apache HBase and why they chose TDengine over OpenTSDB. The article also discusses the process they went through and the deployment of TDengine.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-ecda5c01 gb-headline-text\">Project Introduction<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.ecarxgroup.com\/\" rel=\"noopener\">ECARX<\/a>&nbsp;has developed Cloud-based solutions which use AI and various sensor technologies such as cameras, radar, and sonar to ensure the safety of drivers and passengers. The ultimate aim is to develop autonomous driving capabilities. The core data that is collected in autonomous driving&nbsp;is the background telemetry data as well as data on the status of the equipment in vehicles. In order to achieve autonomous driving capability, there needs to be precise and robust data collection from the onboard equipment and this needs to be combined with data from high-resolution maps.<\/p>\n\n\n\n<p>TDengine plays an important role in the ECARX SuperCloud data center with responsibility for the writing, storage, and instantaneous queries, of real-time vehicle data.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-d9ff2886 gb-headline-text\">Database Selection<\/h2>\n\n\n\n<p>The prior architecture consisted of Kafka + Flink + HBase. As our business grew we found that the Key-Value storage model of HBase was not suitable for our use cases. For structured data, the Key-Value storage model leads to a particularly large disk footprint and high latency in real-time queries of the latest vehicle status. These were the two core problems that we needed to solve urgently.<\/p>\n\n\n\n<p>We looked into various solutions and realized that what we needed was a <a href=\"https:\/\/tdengine.com\/what-is-a-time-series-database\/\">time-series database<\/a> (TSDB). The core data that we needed to store was time-series data. We looked at the various time series databases on the market and decided to take a closer look at InfluxDB, TDengine, and OpenTSDB.<\/p>\n\n\n\n<p>Initially, we were leaning towards OpenTSDB because it is based on HBase and it would have been an easier deployment.&nbsp;However, we realized that OpenTSDB would not solve our performance and compression ratio problems since these are intrinsic to HBase. When we looked at InfluxDB, we realized that the open-source version only allows a single node and this would not give us the performance, high availability, and scalability that we needed in a production environment.&nbsp;Finally, after comparing various dimensions, we decided that TDengine was the optimal choice for us &#8211; an open-source database engine, with performance, high availability, and scalability built into the open-source version and with SQL support.<\/p>\n\n\n\n<p>TDengine is, not coincidentally, highly aligned with our current business use-cases. We say &#8220;not coincidentally&#8221; because TDengine is designed specifically for IoT time-series big data. We were especially thrilled with the novel concept of the &#8220;super table&#8221; and it felt tailor-made for our use-cases.&nbsp;We assigned a subtable to each vehicle to receive the data generated by the IHU device.&nbsp;The&nbsp;IHU is the first-generation vehicle computing platform product released by ECARX in the second quarter of 2017. It is an infotainment device with various functions including navigation, multimedia entertainment, and vehicle information.<\/p>\n\n\n\n<p>The new and optimized architecture consists of Kafka + Flink + TDengine.&nbsp;The data streaming into Flink consists of structured data stored in JSON and unstructured data such as pictures and videos.&nbsp;If the data is structured JSON data, it is written to TDengine as follows: Kafka\u2014&gt;Flink\u2014&gt;TDengine. If it is unstructured data, it is stored directly on S3, and then the file paths&nbsp;are written to TDengine as follows:<\/p>\n\n\n\n<p>S3\u2014&gt;Kafka\u2014&gt; Flink\u2014&gt;TDengine.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-e18cd4b3 gb-headline-text\">Deployment and Results<\/h2>\n\n\n\n<p>We chose to deploy on a three node cluster in single-copy mode. Each node is configured with 8 Cores, 16 GB RAM and&nbsp;a 500G hard drive.&nbsp;There are 3 super tables and 276571 tables in the current environment.<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-1ffeaf54\"><img decoding=\"async\" width=\"828\" height=\"166\" class=\"gb-image gb-image-1ffeaf54\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes.png?strip=all&amp;sharp=1 828w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes-300x60.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes-768x154.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes.png?strip=all&amp;sharp=1&amp;w=165 165w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes.png?strip=all&amp;sharp=1&amp;w=496 496w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-01-dnodes.png?strip=all&amp;sharp=1&amp;w=662 662w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/figure>\n\n\n\n<figure class=\"gb-block-image gb-block-image-d4f216b3\"><img decoding=\"async\" width=\"948\" height=\"394\" class=\"gb-image gb-image-d4f216b3\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row.png?strip=all&amp;sharp=1 948w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row-300x125.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row-768x319.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row.png?strip=all&amp;sharp=1&amp;w=189 189w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row.png?strip=all&amp;sharp=1&amp;w=379 379w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row.png?strip=all&amp;sharp=1&amp;w=568 568w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-02-row.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 948px) 100vw, 948px\" \/><\/figure>\n\n\n\n<figure class=\"gb-block-image gb-block-image-325eacd2\"><img decoding=\"async\" width=\"829\" height=\"107\" class=\"gb-image gb-image-325eacd2\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2.png?strip=all&amp;sharp=1 829w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2-300x39.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2-768x99.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2.png?strip=all&amp;sharp=1&amp;w=165 165w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2.png?strip=all&amp;sharp=1&amp;w=497 497w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-03-row-2.png?strip=all&amp;sharp=1&amp;w=663 663w\" sizes=\"(max-width: 829px) 100vw, 829px\" \/><\/figure>\n\n\n\n<p>The structure of the super table is as follows:<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-6aded6ac\"><img decoding=\"async\" width=\"1224\" height=\"532\" class=\"gb-image gb-image-6aded6ac\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable.png?strip=all&amp;sharp=1 1224w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable-300x130.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable-1024x445.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable-768x334.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable.png?strip=all&amp;sharp=1&amp;w=244 244w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-04-supertable.png?strip=all&amp;sharp=1&amp;w=489 489w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>Since our JSON is rather large, we choose to use&nbsp;<a href=\"https:\/\/github.com\/protocolbuffers\/protobuf\" rel=\"noopener\">protobuf<\/a>&nbsp;(Google&#8217;s open-source, language neutral data interchange format)&nbsp;to compress it and then write it to TDengine. This allows us to limit the JSON structured data to 1500 bytes. Data can be deserialized as needed from TDengine.<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-2c9983df\"><img decoding=\"async\" width=\"750\" height=\"156\" class=\"gb-image gb-image-2c9983df\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-05-count.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-05-count.png?strip=all&amp;sharp=1 750w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-05-count-300x62.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-05-count.png?strip=all&amp;sharp=1&amp;w=150 150w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-05-count.png?strip=all&amp;sharp=1&amp;w=450 450w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-05-count.png?strip=all&amp;sharp=1&amp;w=600 600w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>The current largest super table has stored more than 30 billion pieces of data with each row being 2362 bytes.&nbsp;Roughly estimated,&nbsp;<strong>the total data volume should be about 68T&nbsp;<\/strong>since the beginning of the project. But&nbsp;<strong>TDengine&#8217;s compression ratios allow the actual storage on disk to be only 1.4 TB.<\/strong>&nbsp;Typically we would generate and use 15 TB every 20 days but now we no longer have to worry about running out of storage and worrying about the cost of storage.&nbsp;<strong>The resource usage with TDengine is nearly a hundred times lower than it was with our prior architecture.<\/strong><\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-97e8f8aa\"><img decoding=\"async\" width=\"1068\" height=\"426\" class=\"gb-image gb-image-97e8f8aa\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources.png?strip=all&amp;sharp=1 1068w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources-300x120.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources-1024x408.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources-768x306.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources.png?strip=all&amp;sharp=1&amp;w=213 213w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources.png?strip=all&amp;sharp=1&amp;w=427 427w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources.png?strip=all&amp;sharp=1&amp;w=640 640w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-06-resources.png?strip=all&amp;sharp=1&amp;w=854 854w\" sizes=\"(max-width: 1068px) 100vw, 1068px\" \/><\/figure>\n\n\n\n<p>Additionally the high query latency issue that we had been experiencing will be solved when we upgrade to the newest release of TDengine. The &#8220;last&#8221; function of TDengine can return the latest status of a device in milliseconds.&nbsp;Since the version we are currently using is still relatively old 2.0.18, there is no cache for the last function in this version. The most commonly used SQL for querying the real-time location of a vehicle is as follows, all of which return results at the millisecond level:<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-f2a9ac9e\"><img decoding=\"async\" width=\"1920\" height=\"238\" class=\"gb-image gb-image-f2a9ac9e\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency.png?strip=all&sharp=1\" alt=\"\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency.png?strip=all&amp;sharp=1 1920w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency-300x37.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency-1024x127.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency-768x95.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency-1536x190.png?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency.png?strip=all&amp;sharp=1&amp;w=384 384w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency.png?strip=all&amp;sharp=1&amp;w=1152 1152w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/22.034-07-latency.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"gb-headline gb-headline-7daae631 gb-headline-text\">Conclusion<\/h2>\n\n\n\n<p>As we have seen above, the major pain points that we were experiencing i.e. extremely high storage consumption and very high query latency for real-time vehicle status have been solved by TDengine and resource consumption is nearly 2 orders of magnitude lower. TDengine has helped us reduce costs while increasing efficiency and performance.&nbsp;In addition, TDengine will also form the foundation for our future projects which include equipment monitoring and statistics. In terms of our deployment of TDengine, we received very timely and comprehensive support from TDengine&#8217;s support staff which shortened our timelines.&nbsp;As ECARX grows and scales,&nbsp;we hope to partner with TDengine to develop an industry-standard model for autonomous driving.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ECARX replaced HBase with TDengine to ingest autonomous driving data from Flink and reduce storage space and query latency.<\/p>\n","protected":false},"author":81,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[23,233,268],"tags":[],"ppma_author":[167],"class_list":["post-5827","post","type-post","status-publish","format-standard","hentry","category-case-studies","category-connected-cars","category-industrial-data"],"authors":[{"term_id":167,"user_id":81,"is_guest":0,"slug":"chait","display_name":"Chait Diwadkar","avatar_url":{"url":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-05-cdiwadkar.jpg","url2x":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-05-cdiwadkar.jpg"},"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/5827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/comments?post=5827"}],"version-history":[{"count":9,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/5827\/revisions"}],"predecessor-version":[{"id":24623,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/5827\/revisions\/24623"}],"wp:attachment":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media?parent=5827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/categories?post=5827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/tags?post=5827"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/ppma_author?post=5827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}