The construction and implementation of the product promotion process in the Baidu trading platform

picture

Introduction : Starting from 2020, Baidu has begun to build its own product promotion system. At present, the system is used in Baijiahao and live broadcast scenarios, providing a convenient delivery process for B-end merchants, C-end authors and anchors, and provides users with Straightforward and simple shopping experience. This article introduces the product promotion system in the order of business concept, user interface, system architecture, and core implementation.

The full text is 5874 words, and the estimated reading time is 12 minutes.

An overview of the promotion process

The "Analysis of the Order System Architecture of Baidu Trading Platform" mentioned last time describes the implementation method and iterative process of the order system. Based on the order system, this issue will continue to introduce the design and implementation of the promotion system.

The product promotion system is a relatively common system in the current business of e-commerce platforms bringing goods. *Treasure Alliance, *East Alliance, Duo*Jinbao, etc. are all similar product promotion systems. In today's society, with the prosperity of knowledge payment, short video, and live broadcast services, the threshold for the public to express themselves has begun to decrease, and more and more content creators (in the short video era, most content creators are authors or anchors) has a strong influence. Therefore, the product promotion system for merchants and authors (hosts) is very important. This product promotion system connects both ends of BC and greatly liberates productivity.

The product promotion system centers around authors (hosts), merchants, and users, and provides a platform that can serve all three at the same time. In the promotion process, different roles have special titles. The author (host) is called the traffic master, and the business is called the advertiser.

(1) Traffic master

The goal of the Sponsored Products process is to maximize transactions. The general method of promoting products is to increase product exposure and increase product clicks. The more people see the product, the higher the possibility of promoting a transaction. The product promotion system is to promote together with influential anchors or authors, so as to expand the influence, which is usually called "carrying goods". The purpose of this program is to achieve the goal of promoting products by influencing influential people, through brand effect and celebrity effect. The authors or anchors participating in the promotion process are called “traffic masters” because they can help the order system to attract traffic.

(2) Advertisers

In the common product promotion process, in order to attract more traffic owners to join in the promotion, a commission rate will be designed for each order according to the category of the product. The traffic owner will get a certain percentage of the commission rebate. The amount of sub-commission cashback is provided by the merchant or platform, and there will be different strategies according to different scenarios.

For merchants who need to promote products, a promotion process is equivalent to advertising the products once, but the advertisement does not necessarily come from an advertising company, but may also come from an unknown ordinary person. These merchant roles are vividly called "advertisers" in the promotion process.

(3)CPS

With the development of science and technology, 3G and 4G networks have made mobile payment the "steam engine" of the Internet revolution, and 5G and big data have made information three-dimensional. On the basis of the two, the Sponsored Products process provides an opportunity for more people to participate in the transaction. Common e-commerce platforms basically support sub-commission promotion. In e-commerce scenarios, the sub-commission action is generally realized by means of CPS.

CPS is the abbreviation of Cost Per Sales. It is a common billing method in product promotion. It is charged through the actual sales volume, which is more suitable for shopping APP promotion, but requires accurate traffic for statistical conversion of data.

2. Business characteristics of Baidu product promotion process

CPS promotion and delivery requires a total of 3 different dimensions of users to provide services, corresponding to the traffic master (anchor + author), advertiser (merchant), and user (consumer) in the above. At the same time, the construction of the entire CPS promotion system , and also start from these three points for functional disassembly. It can be split into 3 user interface services and 5 internal core services.

picture

(Figure 1: Baidu's overall delivery system construction)


(1) Three user interfaces

As can be seen from Figure 1, the product promotion system mainly has three user interfaces, namely, the B-side of the applet for advertisers, the product selection interface for traffic owners, and the order purchase interface for users. The following describes the three interfaces respectively.

In the advertiser's interface part, the B-side service of the applet acts as the merchant's end to provide product registration services for advertisers, that is, advertisers can activate the product sub-commission and carry goods on the interface of the applet background, so as to promote their own products.

picture

(Figure 2: Mini Program B-side delivery interface)

picture

(Figure 3: Mini Program B-end user income interface)

In the actual delivery process, the developer can open the delivery as an advertiser, and this method has a certain development cost (such as Dangdang, Amazon, etc.); Baidu also provides a complete set of store opening services, which can be purchased through a very low cost. The cost of participating in the product promotion process (such as Duxiaodian).

In the main interface of traffic, Baijiahao and live broadcast ecology are used as product selection services as entrances, providing convenient and fast product introduction for anchors and authors, and in this part, Baidu's own system products can also be introduced.

picture

(Figure 4: Baijiahao editor selection interface)

The above picture is the editing interface of Baijiahao. The traffic master can add products through the edit button, select products from the product library, and embed the product window into the article. If the product link embedded in the article is clicked by ordinary users and the order is successfully placed, the order will be counted as a promotion by the traffic master according to certain rules. In the interface of Baijiahao live broadcast, you can also select products and add product links, which will not be repeated here.

picture

(Figure 5: Selection interface of product selection platform)

Picture 2, this is the product selection interface of Baijiahao. You can see that the selection includes not only the sub-commissioned products of Taobao, JD.com, and Pinduoduo, but also some selection libraries with Baidu characteristics, including Duxiaodian. , Dangdang.com, Amazon, Movie Fancier, etc.

The user interface part is similar to that of advertisers. The interface of commodities and orders relies on Baidu applet for display. This design is convenient for sharing within the Baidu APP product matrix. In terms of technical implementation, the commodity interface of advertisers only needs to be Once developed, it can be displayed and promoted on all Baidu ecological APPs.

picture

(Figure 6: User Interface)

The user interface is mainly for consumers. When consumers are watching the live broadcast or watching the author's article, if the live broadcast or article contains product promotion, they can purchase the product according to the process shown in Figure 6. The product purchased at this time is from the product promotion system.

(2) Five core services

By sorting out the user interface, the product promotion system can be divided according to function points. In the implementation of this issue, it is divided into 5 core services. Services are listed in the table below:

picture

Among the 5 core services, the mounting service and the promotion service are redesigned and developed for the commodity promotion scenario, and the transaction system, settlement system, and asset system are the capabilities that the transaction center already has.

(3) Build a promotion process with Baidu characteristics

Beginning in 2020, Baidu started to build a product promotion system within the group. During the construction of the system, it faced many technical challenges, mainly in the following aspects:

  • Baidu's business product matrix formed by multiple APPs, how to provide a unified technical implementation plan, so that both traffic owners and advertisers can enjoy the best quality products and services

  • How to effectively collect user promotion behavior in colorful and changeable pages

  • How to integrate existing order and settlement systems and output a standard model of payment and settlement

The above are just some of the big problems listed above. On top of the details, there are many problems that the front desk cannot see, but which affect the experience. For example, after the main traffic hits the effective promotion, it is necessary to allocate commissions. This part of the commissions How can the calculation be realized, and how can the distributed commission actually become the income of the traffic master? For another example, as an advertiser, how can I see my own promotion record quantitatively and stereotyped? There are always money movements involved, and anyone wants to look carefully.

However, aside from the challenges, the CPS promotion system was built from the middle of the transaction, and it was standing on the shoulders of giants at the beginning. Relying on the underlying transaction capabilities, a set of CPS can be quickly established to promote implementation, and the existing capabilities can be fully reused in business, including order placement, fund pooling, asset accounting, and cash withdrawal. The underlying framework of the transaction, quickly implement functions.

3. Realization of product promotion services

picture

(Figure 7: Mounting Service && Promotion Service Architecture Diagram)

Although the mounting service and the promotion service play a very important role in the complex product promotion system, from the design point of view, after being split separately, their respective functions are actually relatively single, which is also in line with the high internal relationship between the systems. Poly low coupling standard.

The above figure divides the service into 4 levels according to the hierarchical design method, from top to bottom, as follows:

Business layer : This layer refers to abstract services, which are multiple service providers that can be extended. Different service providers access from different perspectives, including different services from multiple perspectives of advertisers, traffic owners, and users.

Access layer : This layer mainly refers to the service gateway layer that provides services to the business layer. The main functions are traffic forwarding, service authentication, and load balancing. In addition to the functions of conventional gateways, the access layer also separates different traffic on both sides of the BC (B for merchants, C for users). The unified transaction gateway is mainly responsible for the traffic from consumers. The gateway is characterized by a large amount of user requests, but it is relatively simple. Therefore, for the design of the gateway, in terms of non-functional requirements, performance and security are the main considerations. Among them, the e-commerce open platform (trade.baidu.com) is used as the gateway entrance of the merchant side. The traffic of this part of the gateway is not so high, so it mainly focuses on business processing and association.

Service layer : This layer is the core service provider, including multiple services in the foreground and background.

Dynamic library : the core front-end component of product promotion, mainly responsible for the reporting of promotion data, and needs to ensure security and data legitimacy;

Registration service : This is a background service, which provides the registration and opening of advertisers and traffic masters, and provides the functions of product import and commission ratio setting in conjunction with the lower-level commodity system and settlement system.

Mounting service : The mounting service is provided after the product is registered to generate the link of the product window and verify the authenticity of the data.

Promotion service : The core back-end component of product promotion, it undertakes the reporting of promotion records from the dynamic library externally, and undertakes the order and promotion judgment from the trading system internally.

Component layer : This layer relies on various middleware inside the length to quickly implement functions.

For the promotion record and the mount service, the design difficulty lies in the connection with the overall system, and the business itself is relatively simple. It is worth introducing two parts here, one part is the promotion record report based on the dynamic library, and the other part is based on the database. Write optimization for batch writes.

(1) Reporting of promotion records based on dynamic library

[Dynamic library] is a framework component provided by Baidu applet, which can provide the underlying basic capabilities for the applet in a bypass mode, such as ECharts chart, editor rich text editor, etc. The product dynamic library uses this bypass design method to embed into the developer's product detail page, and can fully obtain the extended parameters of the product page. (Copy the link here to view the official documentation of the Mini Program Dynamic Library: https://smartprogram.baidu.com/docs/develop/framework/editor/)

picture

(Figure 8: Schematic diagram of the small program dynamic library)

The applet dynamic library is shown in the figure above. The top layer is the purchase page of the order, the bottom layer is the running container of the applet, and the middle layer is the dynamic library. The dynamic library is a basic library that is dynamically loaded on demand. It is released by some specific small program business platforms (such as Dasou, Fengchao, etc.), and can provide some business functions or constraints of the business platform. The dynamic library has the following characteristics:

  • The dynamic library will be updated silently, and the updater of the dynamic library decides to update, and the applet developer cannot decide when to update.

  • Dynamic libraries can provide custom components or JS modules for applets to use.

  • The publisher of the dynamic library can only be Baidu now.

  • The use of dynamic libraries requires developers to clearly identify them on the page before they can be referenced.

Since the dynamic library itself is developed and maintained by the transaction center, the promotion data is uploaded through the dynamic library. The realization of data reporting based on dynamic library has obvious advantages:

1. Follow the principle of opening and closing: avoid hard-coding in the order page to achieve data reporting. Completely decoupled from the order page, no matter whether the developer upgrades or reports the logic update, it does not affect each other.

2. Change one place and use it in many places: The small program dynamic library can be seamlessly applied to each matrix APP, and can also be open-sourced and applied to the external host APP in the future. The scalability and compatibility are very good.

3. Excellent maintainability: Since the promotion report is completely separated from the order page, the development does not need to consider business implementation and problems, and has good scalability.

However, because the dynamic library is a relatively low-level implementation, as the saying goes, the greater the ability, the greater the responsibility. In the actual development of the dynamic library, it has very high requirements for performance and security, and the loading of the dynamic library cannot slow down the development. Bill of Lading page.

As for the data protocol, although the dynamic library can run independently of the order page, how to design a widely used data protocol for the dynamic library and make it have good scalability is a problem. In practice, by transforming the mount link function, we have realized a closed loop of server-side generation link + dynamic library parsing link.

See the figure below;

picture

(Figure 9: Closed loop of dynamic library with cargo link)

The mount service provides the ability to generate links for the product selection interface. For different products, a specific link of the exclusive traffic master will be generated, and some extended parameters will be carried. These parameters are loaded along with the product page. Although these parameters do not affect the product page, they are necessary parameters for dynamic library loading. These parameters contain a self-verification mechanism, and if they are arbitrarily modified, they will be found in the report verification. For different merchants and products, you can achieve personalized promotion data reporting capabilities by setting different parameters in the mount link. For example, for different types of services, hit the promotion link, and the length of stay on the product details page can be different to a certain extent.

The unified format of the data protocol is also beneficial for the subsequent judgment of whether the promotion is successful. For example, a unified time window strategy can be used to determine whether the user's promotion for the main traffic is successful. For some merchants, it can also jump out of the category of products and directly determine the user at this time. Whether to hit other effective promotions of the merchant.

(2) Write optimization based on database batch write

Promotion data reporting has the characteristics of a large amount of requests and relatively simple business. In addition, the demand for real-time query of promotion data is not so strong. In actual development, we have adopted the mechanism of asynchronous batch writing to the database for promotion services to improve performance.

picture

(Figure 10: Bulk write write optimization)

Now let’s illustrate the optimization process with the figure above. The single write before the improvement is actually a straightforward single write. Every time the data is reported, a process is performed, and the data is written through the control layer, the service layer, and the data persistence layer. The advantage of this is that the logic is simple, the writing is real-time, and it is suitable for general OLTP services. However, for data reporting services (similar services include management services, log reporting, etc.), there is no real-time query requirement, so under the premise of limited service resources, batch writing can be used to make full use of resources. Increase the throughput of the service.

The right part of the figure is the optimized batch write, which is essentially a producer-consumer model, with the goal of reducing the TPS of the database. Each time a report record is received in the figure, it will be added to the blocking queue in the memory, and the synchronous write will be changed to an asynchronous write. The queue performs a write at a certain time, so that the QPS of the database write is actually greatly reduced.

In the transaction center, the db design of horizontal sub-tables is generally adopted, and the design of promotion records is the same. The data tables are routed and stored in different data tables according to the fields of the sub-tables, and for different tables, they can also be separated into different database instances. , and further horizontal expansion. The following figure shows the data sub-table rules in "Analysis of the Order System Architecture of Baidu Trading Center". Promotion records are divided into tables in the same way.

picture

(Figure 11: Sub-table rules)

For this kind of database result, another optimization can be performed in the batch writing of the database, that is, the same instance and sub-table records are aggregated, and then executed uniformly. This can further improve the writing efficiency of the database.

4. Summary

The difficulty of building a product promotion system is that the business is complex, the construction path is long, and it requires cross-team and cross-department cooperation.

After the business is sorted out, for the implementation of the technical side, except for the dynamic library, the implementation complexity of other parts is not too high. The key lies in the control of boundary conditions and whether the control of details is comprehensive. The promotion system and the middle stage of the transaction are fortunate to stand on the shoulders of giants and ride the wave, and naturally do more with less.

Throughout the ages, software development projects are mostly divided into system engineers, algorithm engineers and business engineers according to their work fields. No matter what kind of engineer you are, if you want to live up to your mission, you need to accumulate on the breadth and details.

Job Offers

Baidu Mobile Ecology Division MEG, user center recruits R&D positions (PHP/GO/C++), we are mainly responsible for the company's core business directions such as Passport, user assets, attributes, Baidu APP membership, etc., and are committed to creating an efficient, convenient and secure user system . If you are interested in Passport, millions of QPS services, distributed design & governance, welcome to join us.

Pay attention to the public account of the same name Baidu Geek, and click "Internal Push" in the menu bar to join the Search Architecture Department. We look forward to your joining!

Recommended reading:

|The Story of Baidu Search Stability Analysis (Part 2)

|The Story of Baidu Search Stability Analysis (Part 1)

Baidu's exploration of micro-front-end architecture EMP: landing production-available micro-front-end architecture

Community coding to identify black and gray products attack practice

---------- END ----------

Baidu Geek says

Baidu's official technical public account is online!

Technical dry goods·Industry information·Online salon·Industry conference

Recruitment information · Internal push information · Technical books · Baidu peripherals

Welcome students to pay attention

{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/4939618/blog/5124266