当前位置:网站首页>Summary of advertisement business bug replay
Summary of advertisement business bug replay
2022-07-02 06:26:00 【dotaer-df】
Because of the company's business adjustment , Recently took over the business of the company's advertising system , One of them encountered such a Bug, Its appearance is like this : There is no money in the advertiser's account , But the advertisement still put it on him .
One 、 Basic business logic
First of all, there are several ways to charge advertisements ,CPA,CPT,CPC,CPM etc. , and CPM This billing method is per 1000 Charge for each exposure x element , That is to say, if the unit price is 10 element , Then a single exposure is 0.01 element , For each exposure, we will first deduct the corresponding money from the cache balance of the advertising system , Deduct all the money , Will send a message to the account system , And then execute local things , Drop the deduction order , Submit sth , Then the account system will also record the deduction amount in the cache , If the account fails to deduct money , It will also send a message of failed deduction , After the advertising system receives this message , It will replenish the balance into its own cache .
Here is a point that I don't quite understand :
Why has the advertisement been exposed , But calling the account system to deduct money failed , It is necessary to make up the user's balance , For example, merchants have sold their goods , But the user failed to deduct money when paying , The balance is made up for the user again .
Two 、Bug spot
bug Just before the deduction failed , Make up the user's balance here , Because it is sending to the account system CPM A kind of advertising message , Will improve the accuracy 3, That is, the amount of a single exposure will * 1000 Send to the account system , When the account system fails to deduct money , Will be intact * 1000 Send the later unit price , And make up the user balance of the advertising system . Here's an example :
Assume user balance 1000, Single exposure 2 element ( Expensive, huh ~), After a single exposure , The user balance should be 998 element , But the account system failed to deduct money , Will make up the user's balance , because * 1000, promote 3 precision , The balance made up becomes 998 + 2 * 1000 = 2998
Pinduoduo doesn't bring how to play ...
That's what happened There is no money in the advertiser's account , But the advertisement still put it on him . Because the user cache balance of the advertising system is much larger than the balance of the account system , When the cache balance is less than 0 It will trigger an advertisement off the shelf , In this way, it will not be triggered , And because the account is out of money , The advertising system has been receiving the message of failed deduction , Crazy continue to fill the balance ...
3、 ... and 、 Remedial measures
1、 Precision processing : Contact the students of the account system , Add a precision to the message scale Field , Such as scale = 3, Corresponding to will amout / 1000
2、 The message of deduction failure is the message that the account balance is insufficient , Do not make up the balance
Then I found that the code has such a comment , Then I'll do it to the end , By the way
// Pseudo code
Long setnx = redis.setnx( Business Key+ The only news id,"1"); redis.expire( Business Key+ The only news id,x); if(setnx == 0) return;
边栏推荐
- 亚马逊aws数据湖工作之坑1
- Codeforces Round #797 (Div. 3) A—E
- 【每日一题】写一个函数,判断一个字符串是否为另外一个字符串旋转之后的字符串。
- LeetCode 39. Combined sum
- 深入学习JVM底层(二):HotSpot虚拟机对象
- LeetCode 83. Delete duplicate elements in the sorting linked list
- 广告业务Bug复盘总结
- Learn about various joins in SQL and their differences
- New version of dedecms collection and release plug-in tutorial tool
- The real definition of open source software
猜你喜欢
Leverage Google cloud infrastructure and landing area to build enterprise level cloud native excellent operation capability
Data science [viii]: SVD (I)
VLAN experiment of switching technology
深入学习JVM底层(二):HotSpot虚拟机对象
Don't use the new WP collection. Don't use WordPress collection without update
Find the highest value of the current element Z-index of the page
Hydration failed because the initial UI does not match what was rendered on the server. One of the reasons for the problem
Browser principle mind map
Redis——大Key問題
WLAN相关知识点总结
随机推荐
浅谈三点建议为所有已经毕业和终将毕业的同学
CUDA用户对象
VLAN experiment of switching technology
Hydration failed because the initial UI does not match what was rendered on the server.问题原因之一
Redis---1.数据结构特点与操作
In depth understanding of JUC concurrency (I) what is JUC
In depth understanding of JUC concurrency (II) concurrency theory
Redis——大Key問題
Invalid operation: Load into table ‘sources_ orderdata‘ failed. Check ‘stl_ load_ errors‘ system table
深入了解JUC并发(二)并发理论
计算属性普通函数写法 和 set get 写法
Singleton mode compilation
Contest3147 - game 38 of 2021 Freshmen's personal training match_ G: Flower bed
Current situation analysis of Devops and noops
链表(线性结构)
【程序员的自我修养]—找工作反思篇二
Step by step | help you easily submit Google play data security form
Generic classes and parameterized classes of SystemVerilog
The Chinese word segmentation task is realized by using traditional methods (n-gram, HMM, etc.), neural network methods (CNN, LSTM, etc.) and pre training methods (Bert, etc.)
Reading classic literature -- Suma++