A high-load balanced car-hailing method and system
By dividing the taxi system into multiple service nodes and adopting load balancing and adaptive scheduling algorithm, combined with message queue and data assessment and optimization, the existing car system load imbalance and the limitations of the scheduling algorithm have been solved, and efficient loads have been achieved. Balanced and dynamic task scheduling improve the performance and reliability of the system.
Patent Information
- Application Number
- CN202410417413.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-04-09
AI Technical Summary
The existing ride-hailing system has load imbalance, limitations of scheduling algorithms, and lack of system optimization and adjustment mechanisms, resulting in service delays and failures.
Through the distributed algorithm framework, the bothering system is divided into multiple service nodes. The load balancing algorithm and adaptive scheduling algorithm are used to combine the message queue for information exchange and collaboration, and optimize system performance and reliability through data assessment.
The load balancing allocation and dynamic task scheduling of the car -sharing request, improve the throughput and response speed of the system, enhance the scalability and flexibility of the system, and ensure the high availability and stability of the system.
Smart Images

Figure CN118261274B_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes a high-load balanced car-hailing method and system, belonging to the technical field of online car-hailing. Background Art
[0002] With the rapid development of science and technology and the acceleration of urbanization, shared travel has become an indispensable part of people's daily lives. As an important form of shared travel, the efficiency and reliability of ride-hailing services directly affect people's travel experience. However, in the existing technology, due to the load imbalance of the ride-hailing system, the limitations of the scheduling algorithm, and the lack of effective system optimization and adjustment mechanisms, ride-hailing services often experience delays, failures, and other problems.
[0003] Specifically, traditional ride-hailing systems usually adopt a centralized architecture, where all ride-hailing requests are concentrated on one server for processing, which overloads the server. Once a problem occurs on the server, the entire system will be affected. In addition, traditional scheduling algorithms usually only consider the priority of requests and ignore the load of the server, which may lead to server overload or waste of resources. At the same time, the existing technology lacks an effective system optimization and adjustment mechanism. The data generated during the operation of the system (such as execution data and operation data) is not fully utilized, and the performance and reliability of the system cannot be evaluated and optimized. Summary of the invention
[0004] The present invention provides a high-load balanced car-hailing method and system to solve the technical problems mentioned in the above background technology:
[0005] The present invention provides a high-load balanced car booking method, the method comprising:
[0006] S1: Divide the ride-hailing system into multiple service nodes through a distributed algorithm framework, and the service nodes are used to process ride-hailing requests and work in collaboration with other service nodes;
[0007] S2: Distribute the ride-hailing requests evenly to each of the service nodes through a load balancing algorithm, and dynamically allocate tasks according to the load of the service nodes and the priority of the ride-hailing requests through an adaptive scheduling algorithm;
[0008] S3: Information exchange and collaboration between different service nodes through message queues;
[0009] S4: Evaluate the performance and reliability of the ride-hailing system through relevant data of the ride-hailing system, and optimize and adjust the ride-hailing system based on the evaluation results; the relevant data includes execution data and operation data.
[0010] Furthermore, the car-hailing system is divided into multiple service nodes through a distributed algorithm framework, and the service nodes are used to process car-hailing requests and work in collaboration with other service nodes, including:
[0011] S11: Determine each service node required in the car-hailing system and define the function of the service node, wherein the service node includes an order management node, a driver dispatch node and a user interface node;
[0012] S12: Determine the number of service nodes that process the ride-hailing request based on the geographic location and load balancing and according to the scale and load of the ride-hailing system;
[0013] S13: Divide the ride-hailing request data according to the relevance and access frequency of the data, and assign them to corresponding service nodes;
[0014] S14: Execute communication and collaboration between various service nodes through RPC, introduce fault tolerance mechanism, design corresponding fault handling strategy, and handle faults. The handling strategy includes setting up backup nodes and automatic node switching.
[0015] Furthermore, the load balancing algorithm is used to evenly distribute the ride-hailing requests to each of the service nodes, and the adaptive scheduling algorithm is used to dynamically allocate tasks according to the load of the service node and the priority of the ride-hailing requests, including:
[0016] S21: Select a suitable load balancing algorithm according to the scenario and requirements, and evenly distribute the ride-hailing requests to each service node through the selected load balancing algorithm; the load balancing algorithm includes polling, random, least connection, weighted polling and IP hash;
[0017] S22: After receiving the car booking request, the service node divides the car booking request data into multiple data blocks, each data block includes one or more subtasks, and processes the subtasks through parallel processing;
[0018] S23: Monitor the load of each service node in real time through a heartbeat mechanism, where the load includes the current number of requests and processing time;
[0019] S24: Through the adaptive scheduling algorithm, according to the load of the service node and the priority of the ride-hailing request, combined with the load of the service node, determine which service node to assign the request to for processing.
[0020] Furthermore, the information exchange and collaboration between different service nodes through the message queue includes:
[0021] S31: When a service node receives a car booking request, it uses the car booking request as the content of a message, adds identification information to the message, and sends the car booking request to a message queue;
[0022] S32: Send the car booking request to the service node in the message queue to update the relevant information of the car booking request to the shared database or cloud space;
[0023] S33: After the data update is completed, the service node that sent the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed; other service nodes perform corresponding logical processing by listening to the confirmation message, and the processing includes updating the local cache and notifying the user;
[0024] S34: At the same time, other service nodes subscribe to the car booking request message through the message queue, obtain the latest car booking information, and perform corresponding processing.
[0025] Furthermore, the performance and reliability of the ride-hailing system are evaluated through the relevant data of the ride-hailing system, and the ride-hailing system is optimized and adjusted based on the evaluation results; the relevant data includes execution data and operation data, including:
[0026] S41: Collecting execution data of the ride-hailing system and obtaining system operation data through a log analysis tool; the execution data includes performance indicators and reliability indicators, the performance indicators include request response time, throughput and resource utilization; the reliability indicators include error rate and fault recovery time;
[0027] S42: Analyze the collected relevant data, evaluate the performance and reliability based on the analysis results, obtain the problems and bottlenecks in performance and reliability, and identify the key components, code segments or system designs that cause performance problems and failures;
[0028] S43: Optimizing and adjusting the ride-hailing system based on the evaluation results;
[0029] S44: Establish a monitoring system to monitor the performance and reliability indicators of the ride-hailing system in real time through the monitoring system; and regularly conduct performance and reliability evaluations of the ride-hailing system to identify potential problems and make improvements.
[0030] The present invention proposes a high-load balanced car-hailing system, the system comprising:
[0031] Node division module: divides the ride-hailing system into multiple service nodes through a distributed algorithm framework. The service nodes are used to process ride-hailing requests and work in collaboration with other service nodes.
[0032] Request distribution module: evenly distributes the ride-hailing requests to each of the service nodes through a load balancing algorithm, and dynamically allocates tasks according to the load of the service nodes and the priority of the ride-hailing requests through an adaptive scheduling algorithm;
[0033] Collaborative exchange module: information exchange and collaboration between different service nodes through message queues;
[0034] Optimization and adjustment module: evaluate the performance and reliability of the ride-hailing system through the relevant data of the ride-hailing system, and optimize and adjust the ride-hailing system based on the evaluation results;
[0035] Furthermore, the node division module includes:
[0036] Node determination module: determines each service node required in the car-hailing system and defines the functions of the service nodes, including order management nodes, driver dispatch nodes and user interface nodes;
[0037] Number determination module: Determines the number of service nodes that process ride-hailing requests based on geographic location and load balancing and according to the scale and load of the ride-hailing system;
[0038] Data allocation module: divides the ride-hailing request data according to the data relevance and access frequency, and allocates it to the corresponding service nodes;
[0039] Fault handling module: performs communication and collaboration between various service nodes through RPC, introduces fault-tolerant mechanism, designs corresponding fault handling strategies, and handles faults. The handling strategies include setting up spare nodes and automatic node switching.
[0040] Furthermore, the request distribution module includes:
[0041] Uniform distribution module: selects a suitable load balancing algorithm according to the scenario and requirements, and evenly distributes the ride-hailing requests to each service node through the selected load balancing algorithm; the load balancing algorithms include polling, random, least connection, weighted polling and IP hash;
[0042] Task division module: after receiving the ride-booking request, the service node divides the ride-booking request data into multiple data blocks, each of which includes one or more subtasks, and processes the subtasks through parallel processing;
[0043] Real-time monitoring module: monitors the load of each service node in real time through the heartbeat mechanism, including the current number of requests and processing time;
[0044] Scheduling module: Through the adaptive scheduling algorithm, according to the load of the service node and the priority of the ride-hailing request, combined with the load of the service node, it is determined which service node the request will be assigned to for processing.
[0045] Furthermore, the collaborative exchange module includes:
[0046] Information adding module: when a service node receives a car booking request, it takes the car booking request as the content of the message, adds identification information to the message, and sends the car booking request to the message queue;
[0047] Data update module: sends the ride-booking request to the service node in the message queue to update the relevant information of the ride-booking request to the shared database or cloud space;
[0048] Logical processing module: After the data update is completed, the service node that sends the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed; other service nodes perform corresponding logical processing by listening to the confirmation message, which includes updating the local cache and notifying the user;
[0049] Latest information acquisition module: At the same time, other service nodes subscribe to the car-booking request message through the message queue, obtain the latest car-booking information, and perform corresponding processing.
[0050] Furthermore, the optimization and adjustment module includes:
[0051] Data collection module: collects the execution data of the ride-hailing system and obtains the system's operating data through log analysis tools; the execution data includes performance indicators and reliability indicators, the performance indicators include request response time, throughput and resource utilization; the reliability indicators include error rate and fault recovery time;
[0052] Data analysis module: Analyze the collected relevant data, evaluate the performance and reliability based on the analysis results, obtain the problems and bottlenecks in performance and reliability, and identify the key components, code segments or system designs that cause performance problems and failures;
[0053] Optimization and adjustment module: optimize and adjust the ride-hailing system based on the evaluation results;
[0054] Monitoring system module: Establish a monitoring system to monitor the performance and reliability indicators of the ride-hailing system in real time through the monitoring system; and regularly conduct performance and reliability evaluations of the ride-hailing system to identify potential problems and make improvements.
[0055] Beneficial effects of the present invention: The high-load balanced car-hailing method can effectively disperse the processing load of car-hailing requests, so that the system can better cope with the needs under high concurrency. By dividing the car-hailing system into multiple service nodes and using a distributed algorithm framework and a load balancing algorithm, balanced distribution of requests and dynamic task scheduling can be achieved, thereby improving the throughput and response speed of the system. By dividing the car-hailing system into multiple service nodes through a distributed algorithm framework and defining the functions of each node, the system can have better scalability and flexibility. At the same time, determining the number of service nodes according to geographical location and load conditions can better adapt to the scale and load changes of the car-hailing system and improve the performance and efficiency of the system. Using a load balancing algorithm to evenly distribute car-hailing requests to each service node, and dynamically allocating tasks according to node load and request priority through an adaptive scheduling algorithm, the system can better utilize resources and improve the load balancing and task processing capabilities of the system. Information exchange and collaboration between different service nodes can be realized through a message queue, which can improve the reliability and flexibility of the system. When a service node receives a car-hailing request, it sends the request to other service nodes for processing through a message queue, and other nodes can obtain the latest car-hailing information through subscription messages, thereby realizing data sharing and collaborative work between systems. By evaluating and optimizing the relevant data of the ride-hailing system, we can help discover problems and bottlenecks in system performance and reliability, and make corresponding improvements. By collecting execution data and operation data, analyzing and evaluating them, we can timely discover system performance problems and failures, and take corresponding measures to optimize and adjust them to improve system performance and reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of the method of the present invention;
[0057] Figure 2 This is a system module diagram of the present invention. DETAILED DESCRIPTION
[0058] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0061] One embodiment of the present invention, as Figure 1 As shown, a high load balancing car booking method, the method comprising:
[0062] S1: Divide the ride-hailing system into multiple service nodes through a distributed algorithm framework, and the service nodes are used to process ride-hailing requests and work in collaboration with other service nodes;
[0063] S2: Distribute the ride-hailing requests evenly to each of the service nodes through a load balancing algorithm, and dynamically allocate tasks according to the load of the service nodes and the priority of the ride-hailing requests through an adaptive scheduling algorithm;
[0064] S3: Information exchange and collaboration between different service nodes through message queues;
[0065] S4: Evaluate the performance and reliability of the ride-hailing system through relevant data of the ride-hailing system, and optimize and adjust the ride-hailing system based on the evaluation results; the relevant data includes execution data and operation data.
[0066] The working principle of the above technical solution is as follows: the car-hailing system is divided into multiple service nodes, each of which is responsible for processing car-hailing requests and performing related tasks. This distributed architecture can improve the concurrent processing capability and scalability of the system. Each service node can independently process car-hailing requests and can communicate and work with other nodes; in order to disperse the load of car-hailing requests, a load balancing algorithm is used to evenly distribute the requests to each service node. Common load balancing algorithms include polling, random selection, weighted polling, etc. By using the load balancing algorithm, the system can avoid performance degradation caused by overloading of certain nodes and ensure that the load of each node is relatively balanced; in order to better cope with the load conditions of different nodes and the priority of car-hailing requests, an adaptive scheduling algorithm is applied. Such an algorithm can dynamically allocate tasks according to the load conditions of different nodes. For example, when a node is highly loaded, car-hailing requests with lower priorities may be assigned to other nodes with lower loads to balance the system load; in order to achieve information exchange and collaborative work between nodes, message queues are used for asynchronous communication. When a car-hailing request is assigned to a specific node, the node puts the relevant information into the message queue and notifies other nodes. In this way, other nodes can obtain the status and data of the ride-hailing request in a timely manner and make corresponding processing. The use of message queues can improve the concurrent processing capability and reliability of the system; in order to improve the performance and reliability of the ride-hailing system, the system is evaluated and optimized. By collecting execution data and operation data, such as response time, throughput, error rate and other indicators, the performance of the system can be evaluated. Based on the evaluation results, system adjustments and optimizations can be made, such as increasing the number of nodes, adjusting the load balancing algorithm, etc., to improve the efficiency and stability of the system.
[0067] The effects of the above technical solution are as follows: through the distributed algorithm framework and load balancing algorithm, the car-hailing system can handle a large number of car-hailing requests at the same time, improving the concurrent processing capacity of the system. This means that the system can provide car-hailing services to multiple users at the same time without causing system performance degradation due to too many requests; through the load balancing algorithm, car-hailing requests can be evenly distributed to each service node. This can avoid excessive load on some nodes and cause performance bottlenecks. Each service node can bear relatively balanced car-hailing requests, improving the stability and reliability of the system; through the adaptive scheduling algorithm, the car-hailing system can dynamically allocate tasks according to the load conditions of each node and the priority of the car-hailing request. In this way, resources can be reasonably allocated according to actual conditions, improving the efficiency and response speed of the system. For example, when a node has a high load, the system can allocate car-hailing requests with lower priority to nodes with lower load to balance the system load; through asynchronous communication through message queues, different service nodes can exchange information and work together in real time. This can improve the scalability and flexibility of the system, so that the system can better handle car-hailing requests and respond to user needs in a timely manner; by evaluating the relevant data of the car-hailing system, such as execution data and operation data, the performance status of the system can be understood. Based on the evaluation results, the ride-hailing system can be optimized and adjusted to further improve the system's performance and reliability. This ensures that the ride-hailing system is always in good operating condition.
[0068] In one embodiment of the present invention, the car booking system is divided into multiple service nodes through a distributed algorithm framework, and the service nodes are used to process car booking requests and work in collaboration with other service nodes, including:
[0069] S11: Determine each service node required in the car-hailing system and define the function of the service node, wherein the service node includes an order management node, a driver dispatch node and a user interface node;
[0070] S12: Determine the number of service nodes that process the ride-hailing request based on the geographic location and load balancing and according to the scale and load of the ride-hailing system;
[0071] S13: Divide the ride-hailing request data according to the relevance and access frequency of the data, and assign them to corresponding service nodes;
[0072] S14: Execute communication and collaboration between various service nodes through RPC, introduce fault tolerance mechanism, design corresponding fault handling strategy, and handle faults. The handling strategy includes setting up backup nodes and automatic node switching.
[0073] The working principle of the above technical solution is as follows: when designing a car-hailing system, it needs to be decomposed into different modules or service nodes, and each service node is responsible for processing different functions. According to the needs of the car-hailing system, the type and number of service nodes required are determined. For example, the order management node is responsible for managing the information of all orders, the driver dispatch node is responsible for allocating driver and vehicle resources, and the user interface node is responsible for interacting with users; when determining the number of service nodes required in the car-hailing system, the geographical location and load balancing need to be considered. According to the geographical location of the car-hailing request, the service nodes can be deployed in different areas so that the request can be responded to as quickly as possible. At the same time, according to the scale and load of the car-hailing system, the number of service nodes required can be determined to ensure that the system can run efficiently; when assigning the car-hailing request to the corresponding service node, the relevance and access frequency of the data need to be considered. For example, the order management node needs to process the information of all orders, so all order-related requests will be assigned to this node for processing. Requests related to user interaction may be assigned to the user interface node; communication and collaboration are required between the various service nodes to achieve the connection and coordination between different functions. This can be achieved through RPC (remote procedure call). At the same time, in order to ensure the reliability of the system, it is necessary to introduce a fault-tolerant mechanism and design a corresponding fault handling strategy. For example, a backup node can be set up to quickly switch when the main node fails; an automatic switching strategy can also be designed so that the system can automatically switch to the backup node when a problem occurs.
[0074] The effect of the above technical solution is: by dividing the car-hailing system into multiple service nodes, the number of service nodes can be dynamically adjusted according to demand and load conditions, thereby achieving elastic expansion of the system. This can better cope with the growth of the system and changes in traffic, and improve the performance and capacity of the system; assigning car-hailing requests to different service nodes for processing can achieve parallel processing and improve the concurrent processing capabilities of the system. This can respond to user requests faster, reduce waiting time, and improve user experience; by introducing fault-tolerant mechanisms and fault handling strategies, such as setting up backup nodes and automatic node switching, the high availability and stability of the system in the event of node failure or abnormality can be guaranteed. Even if a node fails, the system can continue to operate normally without affecting users; by clearly defining the functions and responsibilities of each service node, the various parts of the system can be better organized and managed. At the same time, by realizing communication and collaboration between nodes through RPC, a loosely coupled distributed architecture can be achieved, which improves the flexibility and maintainability of the system.
[0075] In one embodiment of the present invention, the load balancing algorithm is used to evenly distribute the ride-booking requests to each of the service nodes, and the adaptive scheduling algorithm is used to dynamically allocate tasks according to the load of the service node and the priority of the ride-booking requests, including:
[0076] S21: Select a suitable load balancing algorithm according to the scenario and requirements, and evenly distribute the ride-hailing requests to each service node through the selected load balancing algorithm; the load balancing algorithm includes polling, random, least connection, weighted polling and IP hash;
[0077] Round Robin: Allocate requests to each service node in order. This is suitable for situations where the performance of service nodes is similar and the request processing time is relatively stable.
[0078] Random: Randomly select a service node to process the request. This is suitable for situations where you want to randomly distribute requests to various service nodes to achieve load balancing.
[0079] Least Connections: Assign requests to the service node with the least number of current connections. This is suitable for situations where processing time is unstable and the number of requests varies. It can prevent some nodes from having performance degradation due to too many connections.
[0080] Weighted Round Robin: Allocate requests based on the weight of each service node. Nodes with higher weights receive more requests. This is suitable for situations where node performance is different and processing capacity is uneven.
[0081] IP Hash: Performs hash calculation based on the source IP address of the request, and assigns requests with the same IP address to the same service node. This is suitable for sessions that need to maintain the same client.
[0082] S22: After receiving the car booking request, the service node divides the car booking request data into multiple data blocks, each data block includes one or more subtasks, and processes the subtasks through parallel processing;
[0083] S23: Monitor the load of each service node in real time through the heartbeat mechanism. The load includes the current number of requests and processing time. The load calculation formula is:
[0084]
[0085] Among them, F load Indicates the load value of the service node. The larger the K value, the higher the load value of the service node. N represents the number of service nodes in the system. P j represents the number of requests processed by the jth service node, Q jrepresents the processing time of the jth service node, T represents the duration of a cycle, which is used to calculate the average load, and Z represents the total processing capacity of the service node, that is, the total number of requests that can be processed per second.
[0086] S24: Through the adaptive scheduling algorithm, according to the load of the service node and the priority of the ride-hailing request, combined with the load of the service node, determine which service node to assign the request to for processing. For example: Assume there are three service nodes, A, B and C. Each node can process the ride-hailing request, but the performance and load conditions may be different. At the same time, the ride-hailing request has different priorities, such as high, medium and low. Assume that node A is currently lightly loaded, node B is moderately loaded, node C is heavily loaded, and a high-priority ride-hailing request arrives at the system. The adaptive scheduling algorithm will first make a judgment based on the load of the node. Since node A is lightly loaded and can take on more tasks, it is a candidate node. Next, the algorithm will make a judgment based on the priority of the ride-hailing request. Since there is currently a high-priority request, the algorithm will tend to select a node with better performance to process the request. In this case, node A may be the best choice. Finally, the algorithm will comprehensively consider the load of the node and the priority of the ride-hailing request, and decide to assign the high-priority ride-hailing request to node A for processing.
[0087] The working principle of the above technical solution is: select a suitable load balancing algorithm according to the scenario and requirements, and evenly distribute the car-booking request to each service node. Common load balancing algorithms include polling, random, least connection, weighted polling, and IP hashing. These algorithms can select suitable nodes to process requests according to different situations to achieve load balancing; when the service node receives the car-booking request, it divides the request data into multiple data blocks, each of which contains one or more subtasks. Through parallel processing, each service node can process multiple subtasks at the same time, improving the concurrent processing capability and efficiency of the system; each service node monitors its own load in real time through the heartbeat mechanism, including the current number of requests and processing time. In this way, the load status of the node can be understood in time to prepare for subsequent task scheduling; according to the load status of the service node and the priority of the car-booking request, the load status is combined to determine which service node to assign the request to for processing. The adaptive scheduling algorithm can dynamically adjust the distribution of tasks according to the actual situation to ensure that each node can undertake tasks suitable for its processing capacity to avoid overload or waste of resources.
[0088] The effect of the above technical solution is: by selecting a suitable load balancing algorithm, the car-booking request can be evenly distributed to each service node, avoiding the overload of a single node and causing the system performance to degrade. This can improve the concurrent processing capability of the system and ensure that the user's car-booking request can be responded to in a timely manner; the car-booking request data is divided into multiple subtasks, and the system processing efficiency can be improved through parallel processing. Each service node can process multiple subtasks at the same time, speed up the processing speed of the car-booking request, and shorten the user's waiting time; the load of the service node is monitored in real time through the heartbeat mechanism, and the load status of the node can be timely understood, including the current number of requests and processing time. This can help system managers to timely discover the overload or abnormal status of the node, so as to make corresponding adjustments and optimizations; according to the load status of the service node and the priority of the car-booking request, tasks can be dynamically allocated through the adaptive scheduling algorithm, which can effectively utilize system resources and ensure that each node can undertake tasks suitable for its processing capacity. This can avoid the performance degradation caused by the overload of some nodes, and at the same time improve the stability and reliability of the system. The above formula can accurately measure the load status of the node, facilitate the comparison of the load between different nodes, and can be used for load balancing and performance optimization, thereby improving the performance and stability of the system. At the same time, the formula takes into account the number of request processing and processing time, which can more accurately reflect the load of the node; since the number of service nodes may be different, simply comparing the number of requests or processing time cannot accurately reflect the load of the node. The formula combines the number of request processing and processing time to calculate, which can easily compare the load between different nodes; by monitoring the load of each service node in real time and allocating requests according to the load value, load balancing can be achieved to avoid performance degradation caused by overloading of some nodes; by regularly measuring the load of each service node, nodes with excessive load can be discovered in time, and corresponding measures can be taken to optimize them, thereby improving the performance and stability of the system.
[0089] In one embodiment of the present invention, the information exchange and collaboration between different service nodes through the message queue includes:
[0090] S31: When a service node receives a car booking request, it uses the car booking request as the content of the message, adds identification information to the message, and sends the car booking request to the message queue; for example, the message type is car booking request.
[0091] S32: Send the car booking request to the service node in the message queue to update the relevant information of the car booking request to the shared database or cloud space;
[0092] S33: After the data update is completed, the service node that sent the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed; other service nodes perform corresponding logical processing by listening to the confirmation message, and the processing includes updating the local cache and notifying the user;
[0093] S34: At the same time, other service nodes subscribe to the car-hailing request message through the message queue, obtain the latest car-hailing information, and perform corresponding processing. For example: suppose there are two service nodes A and B, both of which provide car-hailing services. When a user initiates a car-hailing request, service node A receives the request and sends it to the message queue, while storing the relevant information of the request in a shared database or cloud space, and sending a confirmation message to the message queue. Other service nodes, such as node B, can obtain the latest car-hailing information by subscribing to the car-hailing request message. Once node B receives the car-hailing request message, it can perform corresponding processing, such as updating the local cache and notifying the user. In this way, no matter which service node receives the car-hailing request, other nodes can obtain the latest car-hailing information and perform corresponding processing, thereby achieving collaborative work.
[0094] The working principle of the above technical solution is as follows: when a service node receives a car booking request, the request is used as the content of the message, and identification information is added to the message, and the car booking request is sent to the message queue. For example, the message type may be a car booking request; the service node that sends the car booking request to the message queue updates the relevant information of the car booking request to a shared database or cloud space. In this way, other service nodes can obtain the latest car booking information by querying the database or cloud space. After the data update is completed, the service node that sends the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed. Other service nodes perform corresponding logical processing by listening to the confirmation message, including updating the local cache and notifying the user. At the same time, other service nodes subscribe to the car booking request message through the message queue, obtain the latest car booking information, and perform corresponding processing. In this way, each service node can work together and perform business processing based on the latest car booking information.
[0095] The effect of the above technical solution is: through the message queue, different service nodes can exchange information and collaborate asynchronously. When a service node receives a ride request, it sends the request to the message queue without waiting for the response of other nodes. This asynchronous decoupling method can improve the response speed and throughput of the system; due to the existence of the message queue, each service node can run independently and obtain the latest ride request by subscribing to the message queue. In this way, horizontal expansion can be achieved, and the number of service nodes can be increased or decreased as needed to meet the changes in system load; by updating the relevant information of the ride request to a shared database or cloud space, it can be ensured that all service nodes access the latest data. When the data update is completed, a confirmation message is sent to the message queue to ensure that other service nodes synchronously update the local cache to avoid data inconsistency problems; other service nodes obtain the latest ride information by listening to the confirmation message and perform corresponding processing. For example, the local cache is updated to maintain data consistency and the user is notified of the status and results of the ride request. This can provide real-time feedback and notifications to enhance the user experience; by using the message queue, even if a service node fails or is unavailable, other nodes can still continue to listen and process the ride request. This loosely coupled architecture can improve the fault tolerance and reliability of the system.
[0096] In one embodiment of the present invention, the performance and reliability of the ride-hailing system are evaluated through the relevant data of the ride-hailing system, and the ride-hailing system is optimized and adjusted based on the evaluation results; the relevant data includes execution data and operation data, including:
[0097] S41: Collecting execution data of the ride-hailing system and obtaining system operation data through a log analysis tool; the execution data includes performance indicators and reliability indicators, the performance indicators include request response time, throughput and resource utilization; the reliability indicators include error rate and fault recovery time;
[0098] S42: Analyze the collected relevant data, evaluate the performance and reliability based on the analysis results, obtain the problems and bottlenecks in performance and reliability; and identify the key components, code segments or system designs that cause performance problems and failures; specifically: clean and organize the collected data to ensure the accuracy and completeness of the data. This may involve removing invalid data, filling missing values, processing outliers, etc.; for performance indicators such as request response time, throughput and resource utilization, they can be analyzed in a statistical and visual way. The trends of average response time, throughput and resource utilization can be calculated, and the differences between different time periods or different nodes can be compared. This can help identify the performance bottlenecks and problems of the system; for reliability indicators such as error rate and fault recovery time, the trend of error rate can be calculated and common error types can be identified. In addition, the distribution and duration of fault recovery time can be analyzed to evaluate the reliability performance of the system. This helps to identify the key components, code segments or system designs that may cause performance problems and failures; using statistical analysis methods (such as regression analysis, hypothesis testing, etc.) and establishing appropriate models can further explore the correlation and causal relationship between data. For example, we can analyze the relationship between system load and response time, or the relationship between resource utilization and throughput; based on the analysis results, we can identify existing problems and bottlenecks and make corresponding improvement suggestions. This may involve improvement measures such as optimizing code, adjusting system configuration, and increasing hardware resources to improve system performance and reliability.
[0099] S43: Based on the evaluation results, the ride-hailing system is optimized and adjusted; the optimization and adjustment include: optimizing performance bottlenecks, such as optimizing key codes, increasing cache, adjusting database indexes, etc.; adjusting reliability issues, such as increasing error handling logic, improving fault-tolerance mechanisms, etc.; performing system optimization tests to verify the effects of optimization and adjustment; and continuously adjusting and optimizing the system based on the test results to improve performance and reliability.
[0100] S44: Establish a monitoring system to monitor the performance and reliability indicators of the ride-hailing system in real time through the monitoring system; and regularly conduct performance and reliability evaluations of the ride-hailing system to identify potential problems and make improvements.
[0101] The working principle of the above technical solution is as follows: the ride-hailing system will collect execution data, including performance indicators and reliability indicators. These data can be obtained through log analysis tools to record the system's operating data, such as request response time, throughput and resource utilization, as well as reliability indicators such as error rate and fault recovery time; the collected relevant data will be analyzed, and the performance and reliability of the system will be evaluated based on the analysis results. Through analysis, performance problems and bottlenecks can be determined, and key components, code segments or system designs that cause performance problems and failures can be identified; based on the evaluation results, the system will be optimized and adjusted. For performance bottlenecks, optimization can be carried out by optimizing key codes, increasing caches, adjusting database indexes, etc. For reliability issues, adjustments can be made by adding error handling logic, improving fault tolerance mechanisms, etc. At the same time, the system needs to be optimized and tested to verify the effects of optimization and adjustment, and the system needs to be continuously adjusted and optimized based on the test results to improve performance and reliability; in order to monitor the performance and reliability indicators of the ride-hailing system in real time, a monitoring system needs to be established. The monitoring system can monitor various indicators of the system and issue alarms when abnormalities or potential problems occur. Regular performance and reliability evaluations are carried out to identify potential problems and make improvements.
[0102] The effects of the above technical solutions are as follows: by collecting and analyzing the execution data and operation data of the ride-hailing system, performance problems and bottlenecks can be identified and optimized in a targeted manner. For example, by optimizing key codes, increasing caches, adjusting database indexes, etc., the system's response speed, throughput, and resource utilization can be improved, thereby improving the user experience; by collecting and analyzing the execution data and operation data of the ride-hailing system, the system's reliability can be evaluated, and key components, code segments, or system designs that cause reliability problems and failures can be identified. According to the evaluation results, corresponding adjustments and improvements can be made, such as adding error handling logic, improving fault-tolerant mechanisms, etc., to improve the stability and reliability of the system and reduce the possibility of failures; by establishing a monitoring system, the performance and reliability indicators of the ride-hailing system can be monitored in real time, and potential problems can be discovered and alarmed in a timely manner. Regular performance and reliability evaluations can help system administrators understand the operating status of the system, discover and solve problems in a timely manner, and ensure the stable operation of the system; by optimizing tests and feedback based on test results, the ride-hailing system can be continuously adjusted and optimized. Continuous optimization can enable the system to gradually improve performance and reliability, and make corresponding adjustments as user needs change.
[0103] One embodiment of the present invention, as Figure 2 As shown, a high load balancing car-hailing system comprises:
[0104] Node division module: divides the ride-hailing system into multiple service nodes through a distributed algorithm framework. The service nodes are used to process ride-hailing requests and work in collaboration with other service nodes.
[0105] Request distribution module: evenly distributes the ride-hailing requests to each of the service nodes through a load balancing algorithm, and dynamically allocates tasks according to the load of the service nodes and the priority of the ride-hailing requests through an adaptive scheduling algorithm;
[0106] Collaborative exchange module: information exchange and collaboration between different service nodes through message queues;
[0107] Optimization and adjustment module: Evaluate the performance and reliability of the ride-hailing system through the relevant data of the ride-hailing system, and optimize and adjust the ride-hailing system based on the evaluation results; the relevant data includes execution data and operation data.
[0108] The working principle of the above technical solution is as follows: the car-hailing system is divided into multiple service nodes, each of which is responsible for processing car-hailing requests and performing related tasks. This distributed architecture can improve the concurrent processing capability and scalability of the system. Each service node can independently process car-hailing requests and can communicate and work with other nodes; in order to disperse the load of car-hailing requests, a load balancing algorithm is used to evenly distribute the requests to each service node. Common load balancing algorithms include polling, random selection, weighted polling, etc. By using the load balancing algorithm, the system can avoid performance degradation caused by overloading of certain nodes and ensure that the load of each node is relatively balanced; in order to better cope with the load conditions of different nodes and the priority of car-hailing requests, an adaptive scheduling algorithm is applied. Such an algorithm can dynamically allocate tasks according to the load conditions of different nodes. For example, when a node is highly loaded, car-hailing requests with lower priorities may be assigned to other nodes with lower loads to balance the system load; in order to achieve information exchange and collaborative work between nodes, message queues are used for asynchronous communication. When a car-hailing request is assigned to a specific node, the node puts the relevant information into the message queue and notifies other nodes. In this way, other nodes can obtain the status and data of the ride-hailing request in a timely manner and make corresponding processing. The use of message queues can improve the concurrent processing capability and reliability of the system; in order to improve the performance and reliability of the ride-hailing system, the system is evaluated and optimized. By collecting execution data and operation data, such as response time, throughput, error rate and other indicators, the performance of the system can be evaluated. Based on the evaluation results, system adjustments and optimizations can be made, such as increasing the number of nodes, adjusting the load balancing algorithm, etc., to improve the efficiency and stability of the system.
[0109] The effects of the above technical solution are as follows: through the distributed algorithm framework and load balancing algorithm, the car-hailing system can handle a large number of car-hailing requests at the same time, improving the concurrent processing capacity of the system. This means that the system can provide car-hailing services to multiple users at the same time without causing system performance degradation due to too many requests; through the load balancing algorithm, car-hailing requests can be evenly distributed to each service node. This can avoid excessive load on some nodes and cause performance bottlenecks. Each service node can bear relatively balanced car-hailing requests, improving the stability and reliability of the system; through the adaptive scheduling algorithm, the car-hailing system can dynamically allocate tasks according to the load conditions of each node and the priority of the car-hailing request. In this way, resources can be reasonably allocated according to actual conditions, improving the efficiency and response speed of the system. For example, when a node has a high load, the system can allocate car-hailing requests with lower priority to nodes with lower load to balance the system load; through asynchronous communication through message queues, different service nodes can exchange information and work together in real time. This can improve the scalability and flexibility of the system, so that the system can better handle car-hailing requests and respond to user needs in a timely manner; by evaluating the relevant data of the car-hailing system, such as execution data and operation data, the performance status of the system can be understood. Based on the evaluation results, the ride-hailing system can be optimized and adjusted to further improve the system's performance and reliability. This ensures that the ride-hailing system is always in good operating condition.
[0110] In one embodiment of the present invention, the node partitioning module includes:
[0111] Node determination module: determines each service node required in the car-hailing system and defines the functions of the service nodes, including order management nodes, driver dispatch nodes and user interface nodes;
[0112] Number determination module: Determines the number of service nodes that process ride-hailing requests based on geographic location and load balancing and according to the scale and load of the ride-hailing system;
[0113] Data allocation module: divides the ride-hailing request data according to the data relevance and access frequency, and allocates it to the corresponding service nodes;
[0114] Fault handling module: performs communication and collaboration between various service nodes through RPC, introduces fault-tolerant mechanism, designs corresponding fault handling strategies, and handles faults. The handling strategies include setting up spare nodes and automatic node switching.
[0115] The working principle of the above technical solution is as follows: when designing a car-hailing system, it needs to be decomposed into different modules or service nodes, and each service node is responsible for processing different functions. According to the needs of the car-hailing system, the type and number of service nodes required are determined. For example, the order management node is responsible for managing the information of all orders, the driver dispatch node is responsible for allocating driver and vehicle resources, and the user interface node is responsible for interacting with users; when determining the number of service nodes required in the car-hailing system, the geographical location and load balancing need to be considered. According to the geographical location of the car-hailing request, the service nodes can be deployed in different areas so that the request can be responded to as quickly as possible. At the same time, according to the scale and load of the car-hailing system, the number of service nodes required can be determined to ensure that the system can run efficiently; when assigning the car-hailing request to the corresponding service node, the relevance and access frequency of the data need to be considered. For example, the order management node needs to process the information of all orders, so all order-related requests will be assigned to this node for processing. Requests related to user interaction may be assigned to the user interface node; communication and collaboration are required between the various service nodes to achieve the connection and coordination between different functions. This can be achieved through RPC (remote procedure call). At the same time, in order to ensure the reliability of the system, it is necessary to introduce a fault-tolerant mechanism and design a corresponding fault handling strategy. For example, a backup node can be set up to quickly switch when the main node fails; an automatic switching strategy can also be designed so that the system can automatically switch to the backup node when a problem occurs.
[0116] The effect of the above technical solution is: by dividing the car-hailing system into multiple service nodes, the number of service nodes can be dynamically adjusted according to demand and load conditions, thereby achieving elastic expansion of the system. This can better cope with the growth of the system and changes in traffic, and improve the performance and capacity of the system; assigning car-hailing requests to different service nodes for processing can achieve parallel processing and improve the concurrent processing capabilities of the system. This can respond to user requests faster, reduce waiting time, and improve user experience; by introducing fault-tolerant mechanisms and fault handling strategies, such as setting up backup nodes and automatic node switching, the high availability and stability of the system in the event of node failure or abnormality can be guaranteed. Even if a node fails, the system can continue to operate normally without affecting users; by clearly defining the functions and responsibilities of each service node, the various parts of the system can be better organized and managed. At the same time, by realizing communication and collaboration between nodes through RPC, a loosely coupled distributed architecture can be achieved, which improves the flexibility and maintainability of the system.
[0117] In one embodiment of the present invention, the request distribution module includes:
[0118] Uniform distribution module: selects appropriate load balancing algorithms according to scenarios and requirements, and evenly distributes ride-hailing requests to various service nodes through the selected load balancing algorithms; the load balancing algorithms include round-robin, random, least connection, weighted round-robin, and IP hash; Round Robin: distributes requests to each service node in order. It is suitable for situations where the performance of service nodes is similar and the request processing time is relatively stable.
[0119] Random: Randomly select a service node to process the request. This is suitable for situations where you want to randomly distribute requests to various service nodes to achieve load balancing.
[0120] Least Connections: Assign requests to the service node with the least number of current connections. This is suitable for situations where processing time is unstable and the number of requests varies. It can prevent some nodes from having performance degradation due to too many connections.
[0121] Weighted Round Robin: Allocate requests based on the weight of each service node. Nodes with higher weights receive more requests. This is suitable for situations where node performance is different and processing capacity is uneven.
[0122] IP Hash: Performs hash calculation based on the source IP address of the request, and assigns requests with the same IP address to the same service node. This is suitable for sessions that need to maintain the same client.
[0123] Task division module: after receiving the ride-booking request, the service node divides the ride-booking request data into multiple data blocks, each of which includes one or more subtasks, and processes the subtasks through parallel processing;
[0124] Real-time monitoring module: monitors the load of each service node in real time through the heartbeat mechanism. The load includes the current number of requests and processing time. The load calculation formula is:
[0125]
[0126] Among them, F load Indicates the load value of the service node. The larger the K value, the higher the load value of the service node. N represents the number of service nodes in the system. P j represents the number of requests processed by the jth service node, Q j represents the processing time of the jth service node, T represents the duration of a cycle, which is used to calculate the average load, and Z represents the total processing capacity of the service node, that is, the total number of requests that can be processed per second.
[0127] Scheduling module: Through the adaptive scheduling algorithm, according to the load of the service node and the priority of the ride-hailing request, combined with the load of the service node, determine which service node to assign the request to for processing. For example: suppose there are three service nodes, A, B, and C. Each node can process a ride-hailing request, but the performance and load conditions may be different. At the same time, ride-hailing requests have different priorities, such as high, medium, and low. Suppose node A is currently lightly loaded, node B is moderately loaded, node C is heavily loaded, and a high-priority ride-hailing request arrives at the system. The adaptive scheduling algorithm will first make a judgment based on the load of the node. Since node A is lightly loaded and can take on more tasks, it is a candidate node. Next, the algorithm will make a judgment based on the priority of the ride-hailing request. Since there is currently a high-priority request, the algorithm will tend to choose a node with better performance to process the request. In this case, node A may be the best choice. Finally, the algorithm will comprehensively consider the load of the node and the priority of the ride-hailing request and decide to assign the high-priority ride-hailing request to node A for processing.
[0128] The working principle of the above technical solution is: select a suitable load balancing algorithm according to the scenario and requirements, and evenly distribute the car-booking request to each service node. Common load balancing algorithms include polling, random, least connection, weighted polling, and IP hashing. These algorithms can select suitable nodes to process requests according to different situations to achieve load balancing; when the service node receives the car-booking request, it divides the request data into multiple data blocks, each of which contains one or more subtasks. Through parallel processing, each service node can process multiple subtasks at the same time, improving the concurrent processing capability and efficiency of the system; each service node monitors its own load in real time through the heartbeat mechanism, including the current number of requests and processing time. In this way, the load status of the node can be understood in time to prepare for subsequent task scheduling; according to the load status of the service node and the priority of the car-booking request, the load status is combined to determine which service node to assign the request to for processing. The adaptive scheduling algorithm can dynamically adjust the distribution of tasks according to the actual situation to ensure that each node can undertake tasks suitable for its processing capacity to avoid overload or waste of resources. The above formula can accurately measure the load of the node, which is convenient for comparing the load between different nodes. It can be used for load balancing and performance optimization, thereby improving the performance and stability of the system. At the same time, the formula takes into account the two factors of the number of request processing and the processing time, which can more accurately reflect the load of the node; since the number of service nodes may be different, simply comparing the number of requests or processing time cannot accurately reflect the load of the node. The formula combines the number of request processing and the processing time to calculate, which can easily compare the load between different nodes; by real-time monitoring of the load of each service node and allocating requests according to the load value, load balancing can be achieved to avoid performance degradation caused by overloading of some nodes; by regularly measuring the load of each service node, nodes with excessive load can be discovered in time, and corresponding measures can be taken to optimize and improve the performance and stability of the system.
[0129] The effect of the above technical solution is: by selecting a suitable load balancing algorithm, the car-booking request can be evenly distributed to each service node, avoiding the overload of a single node and causing the system performance to degrade. This can improve the concurrent processing capability of the system and ensure that the user's car-booking request can be responded to in a timely manner; the car-booking request data is divided into multiple subtasks, and the system processing efficiency can be improved through parallel processing. Each service node can process multiple subtasks at the same time, speed up the processing speed of car-booking requests, and shorten the user's waiting time; the load of the service node is monitored in real time through the heartbeat mechanism, and the load status of the node can be timely understood, including the current number of requests and processing time. This can help system managers to timely discover the overload or abnormal status of the node, so as to make corresponding adjustments and optimizations; according to the load status of the service node and the priority of the car-booking request, tasks can be dynamically allocated through the adaptive scheduling algorithm, which can effectively utilize system resources and ensure that each node can undertake tasks suitable for its processing capacity. This can avoid the performance degradation caused by the overload of some nodes, and at the same time improve the stability and reliability of the system.
[0130] In one embodiment of the present invention, the collaborative exchange module includes:
[0131] Information adding module: When a service node receives a car booking request, it uses the car booking request as the content of the message, adds identification information to the message, and sends the car booking request to the message queue; for example, the message type is a car booking request.
[0132] Data update module: sends the ride-booking request to the service node in the message queue to update the relevant information of the ride-booking request to the shared database or cloud space;
[0133] Logical processing module: After the data update is completed, the service node that sends the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed; other service nodes perform corresponding logical processing by listening to the confirmation message, which includes updating the local cache and notifying the user;
[0134] Latest information acquisition module: At the same time, other service nodes subscribe to the car-booking request message through the message queue, obtain the latest car-booking information, and perform corresponding processing.
[0135] For example: Suppose there are two service nodes A and B, both of which provide ride-hailing services. When a user initiates a ride-hailing request, service node A receives the request and sends it to the message queue, while storing the relevant information of the request in a shared database or cloud space, and sending a confirmation message to the message queue. Other service nodes, such as node B, can obtain the latest ride-hailing information by subscribing to the ride-hailing request message. Once node B receives the ride-hailing request message, it can perform corresponding processing, such as updating the local cache and notifying the user. In this way, no matter which service node receives the ride-hailing request, other nodes can obtain the latest ride-hailing information and perform corresponding processing, thereby achieving collaborative work.
[0136] The working principle of the above technical solution is as follows: when a service node receives a car booking request, the request is used as the content of the message, and identification information is added to the message, and the car booking request is sent to the message queue. For example, the message type may be a car booking request; the service node that sends the car booking request to the message queue updates the relevant information of the car booking request to a shared database or cloud space. In this way, other service nodes can obtain the latest car booking information by querying the database or cloud space. After the data update is completed, the service node that sends the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed. Other service nodes perform corresponding logical processing by listening to the confirmation message, including updating the local cache and notifying the user. At the same time, other service nodes subscribe to the car booking request message through the message queue, obtain the latest car booking information, and perform corresponding processing. In this way, each service node can work together and perform business processing based on the latest car booking information.
[0137] The effect of the above technical solution is: through the message queue, different service nodes can exchange information and collaborate asynchronously. When a service node receives a ride request, it sends the request to the message queue without waiting for the response of other nodes. This asynchronous decoupling method can improve the response speed and throughput of the system; due to the existence of the message queue, each service node can run independently and obtain the latest ride request by subscribing to the message queue. In this way, horizontal expansion can be achieved, and the number of service nodes can be increased or decreased as needed to meet the changes in system load; by updating the relevant information of the ride request to a shared database or cloud space, it can be ensured that all service nodes access the latest data. When the data update is completed, a confirmation message is sent to the message queue to ensure that other service nodes synchronously update the local cache to avoid data inconsistency problems; other service nodes obtain the latest ride information by listening to the confirmation message and perform corresponding processing. For example, the local cache is updated to maintain data consistency and the user is notified of the status and results of the ride request. This can provide real-time feedback and notifications to enhance the user experience; by using the message queue, even if a service node fails or is unavailable, other nodes can still continue to listen and process the ride request. This loosely coupled architecture can improve the fault tolerance and reliability of the system.
[0138] In one embodiment of the present invention, the optimization and adjustment module includes:
[0139] Data collection module: collects the execution data of the ride-hailing system and obtains the system's operating data through log analysis tools; the execution data includes performance indicators and reliability indicators, the performance indicators include request response time, throughput and resource utilization; the reliability indicators include error rate and fault recovery time;
[0140] Data analysis module: Analyze the collected relevant data, evaluate the performance and reliability based on the analysis results, obtain the problems and bottlenecks in performance and reliability; and identify the key components, code segments or system designs that cause performance problems and failures; specifically: clean and organize the collected data to ensure the accuracy and completeness of the data. This may involve removing invalid data, filling missing values, processing outliers, etc.; for performance indicators such as request response time, throughput and resource utilization, they can be analyzed in a statistical and visual way. The trend of average response time, throughput and resource utilization can be calculated, and the differences between different time periods or different nodes can be compared. This can help identify the performance bottlenecks and problems of the system; for reliability indicators such as error rate and fault recovery time, the trend of error rate can be calculated and common error types can be identified. In addition, the distribution and duration of fault recovery time can be analyzed to evaluate the reliability performance of the system. This helps to identify the key components, code segments or system designs that may cause performance problems and failures; using statistical analysis methods (such as regression analysis, hypothesis testing, etc.) and establishing appropriate models can further explore the correlation and causal relationship between data. For example, we can analyze the relationship between system load and response time, or the relationship between resource utilization and throughput; based on the analysis results, we can identify existing problems and bottlenecks and make corresponding improvement suggestions. This may involve improvement measures such as optimizing code, adjusting system configuration, and increasing hardware resources to improve system performance and reliability.
[0141] Optimization and adjustment module: Based on the evaluation results, the ride-hailing system is optimized and adjusted; the optimization and adjustment include: optimizing performance bottlenecks, such as optimizing key codes, increasing cache, adjusting database indexes, etc.; adjusting reliability issues, such as increasing error handling logic, improving fault-tolerant mechanisms, etc.; performing system optimization tests to verify the effects of optimization and adjustment; and continuously adjusting and optimizing the system based on test results to improve performance and reliability.
[0142] Monitoring system module: Establish a monitoring system to monitor the performance and reliability indicators of the ride-hailing system in real time through the monitoring system; and regularly conduct performance and reliability evaluations of the ride-hailing system to identify potential problems and make improvements.
[0143] The working principle of the above technical solution is as follows: the ride-hailing system will collect execution data, including performance indicators and reliability indicators. These data can be obtained through log analysis tools to record the system's operating data, such as request response time, throughput and resource utilization, as well as reliability indicators such as error rate and fault recovery time; the collected relevant data will be analyzed, and the performance and reliability of the system will be evaluated based on the analysis results. Through analysis, performance problems and bottlenecks can be determined, and key components, code segments or system designs that cause performance problems and failures can be identified; based on the evaluation results, the system will be optimized and adjusted. For performance bottlenecks, optimization can be carried out by optimizing key codes, increasing caches, adjusting database indexes, etc. For reliability issues, adjustments can be made by adding error handling logic, improving fault tolerance mechanisms, etc. At the same time, the system needs to be optimized and tested to verify the effects of optimization and adjustment, and the system needs to be continuously adjusted and optimized based on the test results to improve performance and reliability; in order to monitor the performance and reliability indicators of the ride-hailing system in real time, a monitoring system needs to be established. The monitoring system can monitor various indicators of the system and issue alarms when abnormalities or potential problems occur. Regular performance and reliability evaluations are carried out to identify potential problems and make improvements.
[0144] The effects of the above technical solutions are as follows: by collecting and analyzing the execution data and operation data of the ride-hailing system, performance problems and bottlenecks can be identified and optimized in a targeted manner. For example, by optimizing key codes, increasing caches, adjusting database indexes, etc., the system's response speed, throughput, and resource utilization can be improved, thereby improving the user experience; by collecting and analyzing the execution data and operation data of the ride-hailing system, the system's reliability can be evaluated, and key components, code segments, or system designs that cause reliability problems and failures can be identified. According to the evaluation results, corresponding adjustments and improvements can be made, such as adding error handling logic, improving fault-tolerant mechanisms, etc., to improve the stability and reliability of the system and reduce the possibility of failures; by establishing a monitoring system, the performance and reliability indicators of the ride-hailing system can be monitored in real time, and potential problems can be discovered and alarmed in a timely manner. Regular performance and reliability evaluations can help system administrators understand the operating status of the system, discover and solve problems in a timely manner, and ensure the stable operation of the system; by optimizing tests and feedback based on test results, the ride-hailing system can be continuously adjusted and optimized. Continuous optimization can enable the system to gradually improve performance and reliability, and make corresponding adjustments as user needs change.
[0145] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A high-load balanced car-hailing method, characterized in that: The method comprises: The car-hailing system is divided into multiple service nodes through a distributed algorithm framework, and the service nodes are used to process car-hailing requests and work in collaboration with other service nodes; The car-booking requests are evenly distributed to each of the service nodes through a load balancing algorithm, and tasks are dynamically allocated according to the load of the service nodes and the priority of the car-booking requests through an adaptive scheduling algorithm; Through the message queue, information exchange and collaboration between different service nodes are carried out; Evaluate the performance and reliability of the ride-hailing system through relevant data of the ride-hailing system, and optimize and adjust the ride-hailing system based on the evaluation results; the relevant data includes execution data and operation data; The performance and reliability of the ride-hailing system are evaluated through the relevant data of the ride-hailing system, and the ride-hailing system is optimized and adjusted based on the evaluation results; the relevant data includes execution data and operation data, including: Collect the execution data of the ride-hailing system and obtain the system's operating data through log analysis tools; the execution data includes performance indicators and reliability indicators, the performance indicators include request response time, throughput and resource utilization; the reliability indicators include error rate and fault recovery time; Analyze the collected relevant data, evaluate the performance and reliability based on the analysis results, obtain the problems and bottlenecks in performance and reliability; and identify the key components, code segments or system designs that cause performance problems and failures; Based on the evaluation results, the ride-hailing system is optimized and adjusted; Establish a monitoring system to monitor the performance and reliability indicators of the ride-hailing system in real time; and regularly evaluate the performance and reliability of the ride-hailing system to identify potential problems and make improvements; The load balancing algorithm is used to evenly distribute the ride-hailing requests to each of the service nodes, and the adaptive scheduling algorithm is used to dynamically allocate tasks according to the load of the service node and the priority of the ride-hailing requests, including: Select a suitable load balancing algorithm based on the scenario and requirements, and evenly distribute the ride-hailing requests to each service node through the selected load balancing algorithm; the load balancing algorithm includes polling, random, least connection, weighted polling and IP hash; After receiving the ride-booking request, the service node divides the ride-booking request data into a plurality of data blocks, each of which includes one or more subtasks, and processes the subtasks through parallel processing; The heartbeat mechanism is used to monitor the load of each service node in real time. The load includes the current number of requests and processing time. The load calculation formula is: Among them, F load Indicates the load value of the service node. The larger the K value, the higher the load value of the service node. N represents the number of service nodes in the system. P j represents the number of requests processed by the jth service node, Q j represents the processing time of the jth service node, T represents the duration of a cycle, which is used to calculate the average load, and Z represents the total processing capacity of the service node, that is, the total number of requests that can be processed per second; Through the adaptive scheduling algorithm, according to the load of the service node and the priority of the ride-hailing request, combined with the load of the service node, it is determined which service node the request should be assigned to for processing; The information exchange and collaboration between different service nodes are performed through the message queue, including: When a service node receives a car booking request, it uses the car booking request as the content of the message, adds identification information to the message, and sends the car booking request to the message queue; The service node that sends the ride-booking request to the message queue updates the relevant information of the ride-booking request to the shared database or cloud space; After the data update is completed, the service node that sent the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed; other service nodes perform corresponding logical processing by listening to the confirmation message, and the processing includes updating the local cache and notifying the user; At the same time, other service nodes subscribe to the car-booking request message through the message queue, obtain the latest car-booking information, and perform corresponding processing.
2. According to the high load balancing car booking method of claim 1, it is characterized in that: The car-hailing system is divided into multiple service nodes through a distributed algorithm framework. The service nodes are used to process car-hailing requests and work in collaboration with other service nodes, including: Determine each service node required in the ride-hailing system and define the functions of the service nodes, the service nodes including an order management node, a driver dispatch node, and a user interface node; Determine the number of service nodes that handle ride-hailing requests based on geographic location and load balancing, and according to the scale and load of the ride-hailing system; Divide the ride-hailing request data according to the data's relevance and access frequency, and assign them to the corresponding service nodes; The communication and collaboration between various service nodes are performed through RPC, and a fault-tolerant mechanism is introduced to design corresponding fault handling strategies to handle faults. The handling strategies include setting up backup nodes and automatic node switching.
3. A high-load balanced car-hailing system, characterized in that: The system comprises: Node division module: divides the ride-hailing system into multiple service nodes through a distributed algorithm framework. The service nodes are used to process ride-hailing requests and work in collaboration with other service nodes. Request distribution module: evenly distributes the ride-hailing requests to each of the service nodes through a load balancing algorithm, and dynamically allocates tasks according to the load of the service nodes and the priority of the ride-hailing requests through an adaptive scheduling algorithm; Collaborative exchange module: information exchange and collaboration between different service nodes through message queues; Optimization and adjustment module: evaluate the performance and reliability of the ride-hailing system through the relevant data of the ride-hailing system, and optimize and adjust the ride-hailing system based on the evaluation results; the relevant data includes execution data and operation data; The optimization and adjustment module comprises: Data collection module: collects the execution data of the ride-hailing system and obtains the system's operating data through log analysis tools; the execution data includes performance indicators and reliability indicators, the performance indicators include request response time, throughput and resource utilization; the reliability indicators include error rate and fault recovery time; Data analysis module: Analyze the collected relevant data, evaluate the performance and reliability based on the analysis results, obtain the problems and bottlenecks in performance and reliability, and identify the key components, code segments or system designs that cause performance problems and failures; Optimization and adjustment module: optimize and adjust the ride-hailing system based on the evaluation results; Monitoring system module: Establish a monitoring system to monitor the performance and reliability indicators of the ride-hailing system in real time through the monitoring system; and regularly evaluate the performance and reliability of the ride-hailing system to identify potential problems and make improvements; The request distribution module comprises: Uniform distribution module: selects a suitable load balancing algorithm according to the scenario and requirements, and evenly distributes the ride-hailing requests to each service node through the selected load balancing algorithm; the load balancing algorithms include polling, random, least connection, weighted polling and IP hash; Task division module: after receiving the ride-booking request, the service node divides the ride-booking request data into multiple data blocks, each of which includes one or more subtasks, and processes the subtasks through parallel processing; Real-time monitoring module: monitors the load of each service node in real time through the heartbeat mechanism. The load includes the current number of requests and processing time. The load calculation formula is: Among them, F load Indicates the load value of the service node. The larger the K value, the higher the load value of the service node. N represents the number of service nodes in the system. P j represents the number of requests processed by the jth service node, Q j represents the processing time of the jth service node, T represents the duration of a cycle, which is used to calculate the average load, and Z represents the total processing capacity of the service node, that is, the total number of requests that can be processed per second; Scheduling module: Through the adaptive scheduling algorithm, according to the load of the service node and the priority of the ride-hailing request, combined with the load of the service node, it is determined which service node the request should be assigned to for processing; The collaborative exchange module comprises: Information adding module: when a service node receives a car booking request, it takes the car booking request as the content of the message, adds identification information to the message, and sends the car booking request to the message queue; Data update module: sends the ride-booking request to the service node in the message queue to update the relevant information of the ride-booking request to the shared database or cloud space; Logical processing module: After the data update is completed, the service node that sends the car booking request to the message queue sends a confirmation message to the message queue to confirm that the car booking request has been successfully processed; other service nodes perform corresponding logical processing by listening to the confirmation message, which includes updating the local cache and notifying the user; Latest information acquisition module: At the same time, other service nodes subscribe to the car-booking request message through the message queue, obtain the latest car-booking information, and perform corresponding processing.
4. According to claim 3, a high-load balanced car-hailing system is characterized in that: The node division module comprises: Node determination module: determines each service node required in the car-hailing system and defines the functions of the service nodes, including order management nodes, driver dispatch nodes and user interface nodes; Number determination module: Determines the number of service nodes that process ride-hailing requests based on geographic location and load balancing and according to the scale and load of the ride-hailing system; Data allocation module: divides the ride-hailing request data according to the data relevance and access frequency, and allocates it to the corresponding service nodes; Fault handling module: performs communication and collaboration between various service nodes through RPC, introduces fault-tolerant mechanism, designs corresponding fault handling strategies, and handles faults. The handling strategies include setting up spare nodes and automatic node switching.
Citation Information
Patent Citations
Server resource scheduling method and system
CN113190341A