what is a TFT?

本文介绍Traffic Flow Template (TFT)的概念及其在不同PDP上下文中如何为数据包提供质量服务(QoS),通过使用TFT,可以将匹配特定过滤器的数据路由到指定的PDP上下文。

from: http://www.aosusa.com/pdf/bgan/Using_TFTs_on_BGAN.pdf

 

What is a TFT?
A Traffic Flow Template (TFT) is a series of up to eight filters that allows traffic that matches the
filters to be routed on a particular PDP context, and given a different QoS to traffic on other PDP
contexts. When incoming data arrives at the terminal, a packet classifier makes a PDP context
selection based on the TFT, and maps the incoming data packets to the correct PDP context, with
specified QoS attributes. In this way, multiple PDP contexts (called secondary PDP contexts) can be
associated with the same PDP address (defined by the primary PDP context).

/* An example analogue clock using a TFT LCD screen to show the time use of some of the drawing commands with the library. For a more accurate clock, it would be better to use the RTClib library. But this is just a demo. This sketch uses font 4 only. Make sure all the display driver and pin connections are correct by editing the User_Setup.h file in the TFT_eSPI library folder. ######################################################################### ###### DON'T FORGET TO UPDATE THE User_Setup.h FILE IN THE LIBRARY ###### ######################################################################### Based on a sketch by Gilchrist 6/2/2014 1.0 */ #include <SPI.h> #include <TFT_eSPI.h> // Hardware-specific library #define TFT_GREY 0x5AEB TFT_eSPI tft = TFT_eSPI(); // Invoke custom library float sx = 0, sy = 1, mx = 1, my = 0, hx = -1, hy = 0; // Saved H, M, S x & y multipliers float sdeg=0, mdeg=0, hdeg=0; uint16_t osx=120, osy=120, omx=120, omy=120, ohx=120, ohy=120; // Saved H, M, S x & y coords uint16_t x0=0, x1=0, yy0=0, yy1=0; uint32_t targetTime = 0; // for next 1 second timeout static uint8_t conv2d(const char* p); // Forward declaration needed for IDE 1.6.x uint8_t hh=conv2d(__TIME__), mm=conv2d(__TIME__+3), ss=conv2d(__TIME__+6); // Get H, M, S from compile time bool initial = 1; void setup(void) { tft.init(); tft.setRotation(0); //tft.fillScreen(TFT_BLACK); //tft.fillScreen(TFT_RED); //tft.fillScreen(TFT_GREEN); //tft.fillScreen(TFT_BLUE); //tft.fillScreen(TFT_BLACK); tft.fillScreen(TFT_GREY); tft.setTextColor(TFT_WHITE, TFT_GREY); // Adding a background colour erases previous text automatically // Draw clock face tft.fillCircle(120, 120, 118, TFT_GREEN); tft.fillCircle(120, 120, 110, TFT_BLACK); // Draw 12 lines for(int i = 0; i<360; i+= 30) { sx = cos((i-90)*0.0174532925); sy = sin((i-90)*0.0174532925); x0 = sx*114+120; yy0 = sy*114+120; x1 = sx*100+120; yy1 = sy*100+120; tft.drawLine(x0, yy0, x1, yy1, TFT_GREEN); } // Draw 60 dots for(int i = 0; i<360; i+= 6) { sx = cos((i-90)*0.0174532925); sy = sin((i-90)*0.0174532925); x0 = sx*102+120; yy0 = sy*102+120; // Draw minute markers tft.drawPixel(x0, yy0, TFT_WHITE); // Draw main quadrant dots if(i==0 || i==180) tft.fillCircle(x0, yy0, 2, TFT_WHITE); if(i==90 || i==270) tft.fillCircle(x0, yy0, 2, TFT_WHITE); } tft.fillCircle(120, 121, 3, TFT_WHITE); // Draw text at position 120,260 using fonts 4 // Only font numbers 2,4,6,7 are valid. Font 6 only contains characters [space] 0 1 2 3 4 5 6 7 8 9 : . - a p m // Font 7 is a 7 segment font and only contains characters [space] 0 1 2 3 4 5 6 7 8 9 : . tft.drawCentreString("Time flies",120,260,4); targetTime = millis() + 1000; } void loop() { if (targetTime < millis()) { targetTime += 1000; ss++; // Advance second if (ss==60) { ss=0; mm++; // Advance minute if(mm>59) { mm=0; hh++; // Advance hour if (hh>23) { hh=0; } } } // Pre-compute hand degrees, x & y coords for a fast screen update sdeg = ss*6; // 0-59 -> 0-354 mdeg = mm*6+sdeg*0.01666667; // 0-59 -> 0-360 - includes seconds hdeg = hh*30+mdeg*0.0833333; // 0-11 -> 0-360 - includes minutes and seconds hx = cos((hdeg-90)*0.0174532925); hy = sin((hdeg-90)*0.0174532925); mx = cos((mdeg-90)*0.0174532925); my = sin((mdeg-90)*0.0174532925); sx = cos((sdeg-90)*0.0174532925); sy = sin((sdeg-90)*0.0174532925); if (ss==0 || initial) { initial = 0; // Erase hour and minute hand positions every minute tft.drawLine(ohx, ohy, 120, 121, TFT_BLACK); ohx = hx*62+121; ohy = hy*62+121; tft.drawLine(omx, omy, 120, 121, TFT_BLACK); omx = mx*84+120; omy = my*84+121; } // Redraw new hand positions, hour and minute hands not erased here to avoid flicker tft.drawLine(osx, osy, 120, 121, TFT_BLACK); osx = sx*90+121; osy = sy*90+121; tft.drawLine(osx, osy, 120, 121, TFT_RED); tft.drawLine(ohx, ohy, 120, 121, TFT_WHITE); tft.drawLine(omx, omy, 120, 121, TFT_WHITE); tft.drawLine(osx, osy, 120, 121, TFT_RED); tft.fillCircle(120, 121, 3, TFT_RED); } } static uint8_t conv2d(const char* p) { uint8_t v = 0; if ('0' <= *p && *p <= '9') v = *p - '0'; return 10 * v + *++p - '0'; }
09-13
内容概要:本文详细介绍了“秒杀商城”微服务架构的设计与实战全过程,涵盖系统从需求分析、服务拆分、技术选型到核心功能开发、分布式事务处理、容器化部署及监控链路追踪的完整流程。重点解决了高并发场景下的超卖问题,采用Redis预减库存、消息队列削峰、数据库乐观锁等手段保障数据一致性,并通过Nacos实现服务注册发现与配置管理,利用Seata处理跨服务分布式事务,结合RabbitMQ实现异步下单,提升系统吞吐能力。同时,项目支持Docker Compose快速部署和Kubernetes生产级编排,集成Sleuth+Zipkin链路追踪与Prometheus+Grafana监控体系,构建可观测性强的微服务系统。; 适合人群:具备Java基础和Spring Boot开发经验,熟悉微服务基本概念的中高级研发人员,尤其是希望深入理解高并发系统设计、分布式事务、服务治理等核心技术的开发者;适合工作2-5年、有志于转型微服务或提升架构能力的工程师; 使用场景及目标:①学习如何基于Spring Cloud Alibaba构建完整的微服务项目;②掌握秒杀场景下高并发、超卖控制、异步化、削峰填谷等关键技术方案;③实践分布式事务(Seata)、服务熔断降级、链路追踪、统一配置中心等企业级中间件的应用;④完成从本地开发到容器化部署的全流程落地; 阅读建议:建议按照文档提供的七个阶段循序渐进地动手实践,重点关注秒杀流程设计、服务间通信机制、分布式事务实现和系统性能优化部分,结合代码调试与监控工具深入理解各组件协作原理,真正掌握高并发微服务系统的构建能力。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值