Getting to Know Didi Trading Strategy 3: Supply and Demand Adjustment

This article is divided into:

1. What is supply and demand in the trading market?

  • The dynamics of supply and demand

  • Interaction of supply and demand

2. Supply and demand adjustment technology involved in Didi business scenarios

  • Supply and demand sensing and supply and demand forecasting

    • time series prediction

  • Adjust supply and demand to improve market matching and maintain a balance between supply and demand

    • integer programming

  • Plan a better way for drivers to drive

    • Imitation Learning

    • Offline Reinforcement Learning

3. Summary

1. What is supply and demand in the trading market?

423c5b6a65a7dfb20208fab831b55940.jpeg

A trading market is an economic environment formed by transactions between buyers and sellers. Buyers are those people or organizations who want to buy a certain commodity or service, while sellers are those people or organizations who are willing to sell a certain commodity or service. The basic structure of this trading market is the relationship between supply and demand.

In the trading market, the roles of buyers and sellers are different. Sellers are often called suppliers, they provide goods or services, and buyers are called demand sides, they buy goods or services. The supply and demand sides are the core members of the trading market, and the buying and selling behavior between them constitutes the trading activity.

In a modern economy, supply and demand can transact in a variety of ways. For example, they can trade through online markets, exchanges, stock markets, etc., all of which have their own unique laws of supply and demand. Supply and demand also change over time, and supply and demand in trading markets are an important part of economic analysis and forecasting.

The dynamic change of the supply-demand relationship has an important impact on economic operation. When the demand increases, the supply is often difficult to meet immediately, resulting in an imbalance in which the supply is less than the demand. Conversely, when demand does not expand immediately when supply increases, an oversupply will form. Understanding the changes and laws of supply and demand is very important for all participants in the trading market to make correct decisions.

Therefore, the trading market is a very complex economic environment, and it is necessary to deeply understand the dynamic changes in its supply and demand relationship and its impact on economic operations. Correct economic decisions can only be made by in-depth study of the relationship between supply and demand.

The dynamics of supply and demand

17ea5624a9ed9c61100091562c7a5600.png

The supply and demand relationship in some trading markets may be relatively stable, and the supply and demand relationship in these markets is usually affected by the demanders and demand willingness. Among them, the daily necessities market and the infrastructure service market are typical examples with a relatively stable supply and demand relationship.

In contrast, some trading markets can experience wild swings in supply and demand. The relationship between supply and demand in industries such as the raw material market, energy market, and investment product market fluctuates greatly, because the supply and demand factors in the market are easily affected by the external environment and other factors.

As a travel platform, Didi's supply and demand relationship is affected by various factors, which is a typical dynamic supply and demand market. In this market, both the supply side and the demand side will have an impact on the supply and demand relationship.

From the perspective of the supply side, new drivers entering the industry, old drivers leaving the industry due to accidents, and drivers having short-term errands will all lead to changes in supply. In the short term, drivers go to different areas to wait for orders based on habits and information, and external factors such as weather, oil prices, electricity prices, etc., will also affect the supply behavior of drivers, resulting in fluctuations and changes in supply.

960e1f10040e215af73a2b52e08ab210.jpeg

From the demand side, the influx of new passengers into the platform will increase market demand. Holidays, tourist peaks, Spring Festival travel, rainy and snowy weather, extreme temperatures, etc. will all affect the demand behavior of passengers, resulting in fluctuations and changes in demand. In addition, special events such as concerts will also lead to a temporary surge in demand.

In addition, there are also various random factors in the trading market communicated by people, which will also cause dynamic changes to the entire supply and demand relationship.

Therefore, for a dynamic supply and demand market like Didi, it is necessary to pay close attention to the changes and laws of the relationship between supply and demand, and adjust platform policies and resource allocation in a timely manner to adapt to changes in market demand, improve market operation efficiency, balance supply and demand, and improve user experience.

Interaction of supply and demand

In the trading market, supply and demand are two basic economic forces, and they interact to affect market transactions. Supply refers to the total amount of goods or services available for sale in the market, while demand refers to the total amount of goods or services that consumers are willing to buy in the market. A market is in equilibrium when supply and demand are close together.

If the increase in the demand side leads to an increase in market demand, resulting in a temporary "supply in short supply" situation, the increase in market opportunities stimulates the increase in supply on the supply side, because the supply side hopes to use the increase in market demand to increase sales and income , which in turn makes the supply and demand sides re-enter the equilibrium state. However, when the supply in the market reaches the limit and the supply cannot continue to increase, the demand will still not be fully absorbed, and a stable "supply in short supply" state will be formed.

vice versa.

The interplay between supply and demand can become more complex when multiple factors are present in the market at the same time. For example, when the production cost of a certain product rises, the supply side may reduce the supply, making supply more difficult, which in turn may reduce the demand side. If a certain new technology promotes the improvement of production efficiency on the supply side, the supply volume may increase, the supply difficulty will be reduced, and the supply quality will be improved. At the same time, it may also stimulate more demand parties to enter the market.

In a market economy, the interaction of supply and demand is the basic reason for changes in market transactions. Understanding this interplay can help us better understand how and where markets work.

Beyond the classical simplifications of microeconomics described above, when faced with real-world situations, a variety of different real-world situations are encountered.

As a travel platform, Didi faces a very common interaction between supply and demand. We can give you a typical introductory example: After a large-scale event, a large number of passengers need to take a taxi, and the order surges, providing more market demand. Obviously, the area has entered into a serious shortage of supply and demand, thus attracting nearby drivers to provide services in this area, increasing the available supply in this area, and improving the order response rate.

When almost all nearby drivers have joined, the supply has reached the short-term limit, but it is still far from enough to meet the demand. Some passengers have to turn to other travel plans such as buses and subways because they cannot get a taxi, so that the demand no longer increases.

With the gradual evacuation of race spectators and no more new orders, some drivers in this area will gradually run out of orders and enter a state of oversupply. These drivers may start to use the Didi Driver app to find other areas that need more orders. Go to a new area.

In a scenario similar to the above, in order to ensure a better experience for passengers and drivers in the process, Didi strives to alleviate the mismatch between supply and demand in the market through various supply and demand adjustment technologies.

2. The supply and demand adjustment technology involved in the Didi business scenario

Supply and demand sensing and supply and demand forecasting

00e01ee4826c9a986be5383d9b8aed09.jpeg

Facing the dynamically changing supply and demand situation, how to perceive and reasonably predict will become an important cornerstone of supply and demand adjustment.

Time-series forecasting of quantities supplied and demanded is an important problem in many fields, including supply chain management, logistics, finance, healthcare, and power. Although there are many methods that can be used to forecast demand, there are still many technical challenges:

  1. Incomplete and missing data : Predictive models require large amounts of historical data in order to train and make predictions. However, historical data may be incomplete or missing, which affects the accuracy of the model.

  2. Seasonal and cyclical changes : The demand for many products or services is affected by seasonal and cyclical changes, such as holidays, weekends and seasons. These changes can affect the accuracy of the predictive model.

  3. Unexpected events : Unforeseen events such as weather, natural disasters, etc., may have an unpredictable impact on demand, which makes forecasting more difficult.

  4. Data Quality Issues : Data quality issues can affect the accuracy of predictive models, such as data errors, duplications, anomalies, etc.

  5. Model complexity : If the forecasting model is too simple, it may fail to capture complex demand patterns. However, if the predictive model is too complex, it may lead to overfitting the data, reducing its predictive power.

  6. Time Lag Effect : In some cases, changes in the quantity demanded may lag behind changes in the factors that affect it. If a forecasting model fails to capture this time-lag effect, its predictions may be biased.

37da64f4c597db796c77d188d055a3fb.png

https://arxiv.org/pdf/2104.13463.pdf

Therefore, it is necessary to adopt appropriate algorithms and technologies to solve these technical problems, and make appropriate adjustments and optimizations according to specific industries and needs.

time series prediction

Time series forecasting is a technical field with a long history of development. Its main purpose is to predict future values ​​based on historical data. Common algorithms include:

  1. Smoothing methods : including moving average method, exponential smoothing method, etc., usually used for stable or weak trend time series data prediction.

  2. ARIMA model : ARIMA (autoregressive moving average model) is a statistical model based on time series, which is usually used to predict time series data with trend and seasonality.

  3. LSTM Models : LSTM (Long Short-Term Memory Model) neural network models can handle long-term dependencies and perform well in cases where predictions need to consider multiple time steps.

  4. Deep learning model : After the popularity of deep learning, a large number of models that use deep neural networks for time series prediction emerged as the times require, and are usually used to predict nonlinear and complex time series data. For example, Transformer-based TFT and NSTransformers (a general prediction framework for non-stationary time series), DeepAR (deep autoregressive recurrent network), etc.

0671cbf0b5e6efa997c6b1e38f490ee4.png

上图引自:Shuai Ling, Zhe Yu, Shaosheng Cao, Haipeng Zhang, and Simon Hu. 2023. STHAN: Transportation Demand Forecasting with Compound Spatio-Temporal Relationships. ACM Trans. Knowl. Discov. Data 17, 4, Article 54 (May 2023), 23 pages. https://doi.org/10.1145/3565578

It is worth mentioning that Didi has cooperated with ShanghaiTech University and Zhejiang University through the "Gaia Scientific Research Cooperation Program" to propose a transportation demand prediction model based on spatio-temporal heterogeneous graph (Spatio-Temporal Heterogeneous graph Attention Network, STHAN) , using a spatio-temporal heterogeneous graph with multiple edge types and meta-paths to describe multiple spatial and composite relationships between regions, and designing a hierarchical attention mechanism including node hierarchy and meta-path hierarchy to capture the spatial relationship Heterogeneity has achieved significant effect improvement in Didi business scenarios.

Improve market matching and maintain a balance between supply and demand

The adjustment of supply and demand in travel scenarios is widely implemented in many scenarios, which is also Didi's continuous contribution to the entire travel market.

This article only introduces part of the content, focusing on the main work of urban driver regulation within a day.

The best supply and demand is "supply and demand balance", but in reality, various imbalances will inevitably occur, which will bring bad experience to drivers or passengers. When there is an imbalance between supply and demand, it is necessary to balance local supply and demand through driver scheduling.

29e72715ffd4df6c4f4bdf5995cd81a0.png

If you want to achieve "supply and demand balance" in all areas as much as possible through driver scheduling (scheduling some drivers from the current location to the designated location), then what should you do algorithmically?

integer programming

The above problem can be simply defined as solving an optimization problem: Knowing the current location of all drivers, any driver can be dispatched from the current location to the designated location, but each time there will be a corresponding cost (such as driving distance), so how to choose Drivers schedule routes so that total cost is minimized?

This is a typical integer programming problem.

Integer programming is a mathematical optimization problem in operations research. Its goal is to find the value of an integer variable that minimizes or maximizes a linear objective function under certain constraints. Unlike linear programming, integer programming requires variables to take only integer values. Therefore, integer programming problems are more challenging than linear programming problems.

In the paper "When Recommender Systems Meet Fleet Management: Practical Study in Online Driver Repositioning System" published by Didi, an effective method for online driver scheduling is introduced in detail. It involves three steps:

1.  Candidate dispatch task : select a more suitable dispatch driver, dispatch destination, and provide expiration time and compensation amount.

d5882c66ab9cc9195683904e5e22d745.png

2.  Task scoring : Calculate the marginal gain that may be brought by adding an idle driver to the dispatching terminal space-time, and use it as the scoring result of each candidate dispatching task.

0a0fe5661804962e5d31832eeff3e07b.png

92ac87bb786a5f493d9f5457f30ef00f.png

At the same time, the number of driver gaps in each space-time state can also be obtained:

4abf29d32e650715f5ab3acc3563b44d.png

3.  Carry out planning and solving: take the guarantee of driver experience as a constraint, and maximize the total revenue of dispatching.

ae72cf022bc4e03b269ef5b0c55c817a.png

Plan a better way for drivers to drive

931db5af71ba6168d21a805bed510a11.jpeg

Drivers run in the city all day, and usually plan their own way of dispatching/receiving orders, such as estimating which areas have more orders, whether to rest when they are free, time to dispatch and collect cars, etc. In some product forms, drivers You can choose the order that suits you, so this is also a manifestation of the driver's active choice.

After many years of exploration, many drivers will form their own way of dispatching/receiving orders and become experienced drivers. And many new drivers who join the platform lack these experiences, so it may not be smooth in the short term.

The platform strives to provide drivers with more information and support, which can help drivers plan their own way of driving and become a veteran driver as soon as possible, including but not limited to:

- heat map

- Hot zone red envelope

- Long-term route planning

Imitation Learning

The most intuitive way to help new drivers is to "imitate old drivers". We can form some "strategies" based on the old drivers' way of dispatching/receiving orders to help new drivers get familiar with it as soon as possible.

Imitation learning is a machine learning method whose goal is to learn a policy that performs on a given task similarly to known demonstration samples. Unlike reinforcement learning, imitation learning does not require interaction with the environment, but uses known demonstration data to learn.

In imitation learning, supervised learning methods are usually used to learn a mapping from state to action. Specifically, we take the known demonstration data as input and the actions taken by the demonstrator in each state as output, and utilize a supervised learning algorithm to learn an optimal mapping function. This mapping function is our learned policy.

Offline Reinforcement Learning

Offline reinforcement learning is a reinforcement learning method that, unlike online reinforcement learning, does not require interaction with the environment, but directly uses offline datasets for training. The goal of offline reinforcement learning is to learn an optimal policy from a given dataset so that it can achieve the maximum reward in future practical applications.

In offline reinforcement learning, datasets usually consist of historical empirical data that have been generated by previous interactive learning or simulations and can be directly used for offline training. The advantage of offline reinforcement learning is that it can reduce the actual interaction cost, can use a large amount of historical experience data for training, and can avoid the risk and uncertainty of real-time learning.

To give a simple example: consider an Agent from the perspective of a single driver, view the supply and demand situation around its location, and the order-listing mode as a State, and imitate the driver’s actions such as wandering to the surrounding location and selecting an order as Actions, and take a long period of time The total income of is used as Reward. Then a complete reinforcement learning system can be constructed.

On this system, a variety of offlineRL methods can be used for learning, such as AWAC, TD3+BC, CQL, IQL, etc. At the same time, methods such as importance sampling and FQE can also be used for offline evaluation.

3. Summary

Supply and demand are the most important subjects in the trading market, and their influence on the market is crucial. There are complex dynamic changes and interactions among them, which require precise forecasting and adjustment to ensure the balance and smooth operation of the market. As a platform, Didi faces the challenges of supply and demand changes, and needs to continuously adopt appropriate strategies to deal with it, so as to build a good market environment.

As a travel platform, Didi needs to adjust the allocation and scheduling of resources according to the supply and demand in different regions and time periods to ensure the experience of drivers and passengers. In this process, Didi needs to make good supply and demand forecasts, use data analysis and machine learning and other technical means to predict market trends, and make corresponding adjustments and optimizations.

At the same time, Didi is also constantly helping new drivers to become experienced drivers, allowing them to master better ways of dispatching cars to improve efficiency and profitability. Through information and suggestions, Didi helps drivers better understand market demand, improve service quality and order efficiency, and thus earn more income.

As a coordination platform between supply and demand, Didi is committed to achieving a balanced and well-experienced supply and demand environment, and providing passengers and drivers with better services and experiences.

4. Quote

1.https://www.techopedia.com/definition/32904/algorithm-economy

2.Shuai Ling, Zhe Yu, Shaosheng Cao, Haipeng Zhang, and Simon Hu. 2023. STHAN: Transportation Demand Forecasting with Compound Spatio-Temporal Relationships. ACM Trans. Knowl. Discov. Data 17, 4, Article 54 (May 2023), 23 pages.

3 .Zhe Xu, Chang Men, Peng Li, Bicheng Jin, Ge Li, Yue Yang, Chunyang Liu, Ben Wang, and Xiaohu Qie. 2020. When Recommender Systems Meet Fleet Management: Practical Study in Online Driver Repositioning System. In Proceedings of The Web Conference 2020 (WWW '20). Association for Computing Machinery, New York, NY, USA, 2220–2229. https://doi.org/10.1145/3366423.3380287

recommended reading

bee34424ec58c2e33dfc15ee0cdab54a.png

c6b93edcd0b34e8df959b6902b83050b.png

3b889a3a1151a64e9c017c71140eb266.jpeg

3f25f03bcab3a3e9e78f548d01e13a88.jpeg

e6523056dc0046a786a453a0ceb96936.jpeg

61751cabb9086ce8338323b84c88e2a8.png

End

Author and department introduction 

The author of this article, Zhong Chen, is from Didi’s online car-hailing MPT team (Marketplace Technology). The team is committed to building the world's top intelligent trading platform, including order allocation, driver scheduling, carpooling, pricing, etc., through continuous exploration of cutting-edge technologies such as machine learning and reinforcement learning, to improve the design of the trading market, to achieve optimal allocation of resources, and to strive to solve the problem of Occurrences and potential imbalances between supply and demand meet the diversified travel needs of the platform to the greatest extent, continuously optimize passenger experience and guarantee driver income, improve business operation efficiency, and lead the transformation and development of the travel industry.

Job Offers

We are recruiting for the backend of the team and algorithm needs. Interested partners are welcome to join. You can send your resume to [email protected], or scan the QR code below to send your resume directly. Looking forward to your joining!

Senior R&D Engineer

Job Responsibilities:

1. Responsible for the design and development of the core dispatch engine architecture, distributed matching computing system, etc.;

2. Responsible for the architecture design and development of complex strategies such as order distribution, flow diversion, and supply and demand forecasting;

3. Responsible for the exploration of new business models.

e4fdda0f8f0e0288a7c45f8ddd7a096c.png

Senior Algorithm Engineer

Job Responsibilities: 

1. Research algorithms including various transaction matching, order dispatching, and passenger expectations under the modes of solo rides and shared rides, and continue to improve the efficiency of core transactions;

2. Utilize techniques such as causal inference, operational planning, and machine learning to improve the effects of core operational algorithms such as supply and demand forecasting and pricing;

3. Use algorithm technology to achieve efficient growth of users of each business line of the group and optimize traffic operation efficiency;

4. Solve driver and passenger disputes and experience problems through machine learning technology, create a good driver experience and platform order, build a fair judgment ability for drivers and passengers, and protect the safety of drivers and passengers.

e2ecc558936f998bdb5dbbad99baf569.png

Guess you like

Origin blog.csdn.net/DiDi_Tech/article/details/131198983