# Online and Offline Model for Housekeeping Order Assignment Based on Dynamic Programming Algorithm
## 1 Introduction  
With the continuous development of the social economy and the improvement in people's living standards, domestic service has gradually become an indispensable part of modern city residents' lives. The related service platform provides house cleaning, babysitting, moving, maintenance, and other services for people's lives. When the customer places a service order on the platform, the platform will assign the order to the service personnel, who will provide the cleaning/takeaway ordering services according to the service time specified by the customer [1; 2; 3]. As an important part of the daily life of city residents, this kind of domestic service is of great importance to society for its efficient and high-quality operation. However, with the increasing demand for domestic service and the continuous growth of service personnel, the issue of order allocation has become increasingly prominent, and order matching is a core issue in the operation of domestic service platforms [4]. Optimizing order matching can significantly improve the efficiency and quality of domestic service, so that the service demand-side can be better satisfied, but can also improve the income and employment satisfaction of domestic service personnel, and then promote the developmentof related industries. Therefore, the research and practice of an order matching algorithm has important social significance for promoting the healthy development of urban domestic service industry and improving the quality of life of urban residents. In the current domestic service platform, there are some pain points and problems in order matching. Firstly, the highly diverse and uncertain demand for domestic services leads to the complexity of order matching. Second, the number and skill level of service personnel are unbalanced, which often leads to a waste of resources or an imbalance between supply and demand in the matching process. In addition, order matching requires high timeliness, and the traditional manual matching method often struggles to meet the need for a rapid response. With fierce platform competition and increasing customer demand, platforms are seeking efficient order matching strategies to reduce costs and improve service quality. There are many factors that affect order matching, such as butler rating, travel speed, order start time, order location, and so on. How to combine these factors into a comprehensive order assignment strategy is a complex problem. Dynamic programming (DP) is an optimization method for solving multi-stage decision problems. By dividing complex problems into multiple stages and solving them step by step using the optimal substructure property, the global optimal solution is obtained [5]. By defining optimal strategies, this method can be applied to various types of problems, including discrete deterministic, discrete stochastic, infinite stochastic, and continuous deterministic problems [6]. For the order matching problem of the service platform, the most important thing is to match the most suitable orders with the most suitable service personnel. Compared with other algorithms, dynamic programming can efficiently and quickly obtain the most suitable assignment scheme, thus achieving good economic benefits. This paper explores how the DP algorithm can be applied to the order matching problem of the domestic service platform to achieve the perfect match between the order and the domestic service personnel. The main contributions of this paper are as follows:  
(1) Based on DP, with the goal of maximizing the total weighted value, the order assignment models of offline and online domestic service were established. (2) We studied the effect of order backlog on the total weighted value of online order assignment and obtained the optimal order backlog threshold with the goal of maximizing the total weighted value.