Search request processing method and device, electronic equipment and storage medium
By obtaining and analyzing the running status table of the server group, dynamically selecting the target server group and the target server, and processing information search requests, the problems of slow response speed and insufficient resource utilization of traditional systems are solved, and more efficient search request processing is achieved.
Patent Information
- Application Number
- CN202411863525.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
When traditional freight search systems handle large-scale user search requests, the response speed is low and the real-time performance of computing resource scheduling is poor, resulting in insufficient utilization of server resources.
By obtaining the running status tables of multiple server groups, selecting the target server group and the target server, processing information search requests based on the target server, dynamically update and maintaining the running status table to achieve load balancing.
It improves the response speed of the search request processing system to information search requests, ensures full utilization of server resources, and improves user experience and system efficiency.
Smart Images

Figure CN119807523A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of network engineering and civil aviation services, and in particular to a search request processing method and device, electronic equipment, and storage medium. Background Art
[0002] In the digital age, the aviation industry's online ticketing query and booking systems play a key role in providing fast and accurate flight information and fares to hundreds of millions of passengers around the world. As a core component, the performance of the fare search system directly affects user satisfaction and the overall efficiency of the system. In the fare search system, how to efficiently handle massive user search requests while ensuring full utilization of server resources has become a challenge that the technical team needs to solve urgently.
[0003] Although traditional freight rate search systems can disperse requests to a certain extent when processing large-scale requests, they mainly rely on static indicators such as hardware load and response time, which makes the real-time performance of the freight rate search system in computing resource scheduling poor, and thus leads to a low response speed of the freight rate search system to user search requests.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a search request processing method and device, an electronic device, and a storage medium, so as to at least solve the technical problem of low response speed to user information search requests in the related art.
[0006] According to one aspect of an embodiment of the present invention, a search request processing method is provided, comprising: obtaining an operation status table of multiple server groups, wherein the operation status table is used to store the operation status of multiple servers included in different server groups; in response to receiving an information search request, selecting a target server group from the multiple server groups in a preset manner; based on the operation status table, selecting a target server from the multiple servers included in the target server group; and processing the information search request based on the target server.
[0007] Furthermore, an operation status table of multiple server groups is obtained, including: obtaining the maximum waiting queue length of multiple servers included in different server groups; monitoring the request processing status of multiple servers to obtain the current waiting queue length of different servers; determining the remaining waiting queue length of different servers based on the maximum waiting queue length and the current waiting queue length; and constructing an operation status table of different server groups based on the remaining waiting queue length.
[0008] Furthermore, a target server group is selected from multiple server groups in a preset manner, including: evaluating the status of multiple server groups based on an operation status table to obtain evaluation indicators corresponding to different server groups, wherein the evaluation indicators are used to reflect the efficiency of processing information search requests using multiple servers included in different server groups; sorting the multiple server groups based on the evaluation indicators to obtain a server group sequence; and selecting a target server group from the server group sequence in a preset manner.
[0009] Furthermore, a target server group is selected from a server group sequence in a preset manner, including: selecting a first server group from a plurality of server groups based on an evaluation indicator, wherein an evaluation indicator of the first server group is greater than evaluation indicators of other server groups except the first server group; obtaining a first identifier of a server group used to process a last received information search request; in response to the identifier of the first server group being not the first identifier, determining the first server group as the target server group; in response to the identifier of the first server group being the first identifier, selecting a second server group from a plurality of server groups according to the server group sequence, and determining the second server group as the target server group, wherein an evaluation indicator of the second server group is greater than evaluation indicators of other server groups except the first server group and the second server group.
[0010] Furthermore, after processing the information search request based on the target server, the method also includes: updating the remaining waiting queue of the target server based on the information search request to obtain a new remaining waiting queue length; updating the operation status table of the target server group based on the new remaining waiting queue length to obtain a new operation status table corresponding to the target server group.
[0011] Furthermore, the method also includes: obtaining hardware configuration parameters of a plurality of initial servers; and grouping the plurality of initial servers based on the hardware configuration parameters to obtain a plurality of server groups.
[0012] Furthermore, the multiple initial servers are grouped based on hardware configuration parameters to obtain multiple server groups, including: matching the hardware configuration parameters of different initial servers to obtain a parameter matching result; in response to the parameter matching result that the hardware configuration parameters of different initial servers are the same, the multiple initial servers are evenly grouped to obtain multiple server groups; in response to the parameter matching result that the hardware configuration parameters of different initial servers are different, the multiple initial servers are grouped based on the maximum waiting queue lengths of the multiple initial servers to obtain multiple server groups.
[0013] Furthermore, the method also includes: in response to any one server in the multiple server groups being offline, grouping the other servers based on hardware configuration parameters of the other servers except any one server in the multiple initial servers to obtain multiple new server groups.
[0014] According to another aspect of an embodiment of the present invention, a search request processing device is also provided, including: a status table acquisition module, used to obtain an operation status table of multiple server groups, wherein the operation status table is used to store the operation status of multiple servers included in different server groups; a server group selection module, used to select a target server group from multiple server groups in a preset manner in response to receiving an information search request; a server selection module, used to select a target server from multiple servers included in the target server group based on the operation status table; and a request processing module, used to process the information search request based on the target server.
[0015] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.
[0016] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0017] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0018] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0019] According to another aspect of the embodiments of the present invention, a computer program is further provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.
[0020] In an embodiment of the present invention, a method is adopted to obtain operation status tables of multiple server groups; in response to receiving an information search request, a target server group is selected from the multiple server groups according to a preset method; based on the operation status table, a target server is selected from the multiple servers included in the target server group; based on the way in which the target server processes the information search request, by analyzing the operation status tables of different server groups, it can be known which servers have a faster processing speed, and the above-mentioned servers with faster processing speeds are selected as the above-mentioned target servers. The search request processing system can use the target server to process the above-mentioned information search request, thereby achieving the purpose of quickly responding to the user's information search request, thereby realizing the technical effect of improving the response speed of the search request processing system to the information search request, and further solving the technical problem of low response speed to user information search requests in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a flow chart of a search request processing method according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of an optional system structure for collecting and pushing freight rate search data according to an embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of an optional server grouping relationship according to an embodiment of the present invention;
[0025] Figure 4 It is a schematic diagram of a search request processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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 should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] According to an embodiment of the present invention, an embodiment of a search request processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] Figure 1 is a flowchart of a search request processing method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0030] Step S102: obtaining an operation status table of multiple server groups, wherein the operation status table is used to store the operation status of multiple servers included in different server groups.
[0031] The server group may refer to a group of servers with similar functions or common goals. For example, the server group may be a cluster consisting of multiple Searchone servers, but is not limited thereto. The operation status table may be a data structure or database table for tracking and displaying the real-time operation status of each server in each server group.
[0032] In an optional embodiment, considering that the operation status table provides the current load status, resource usage and other performance indicators of each server, such as the waiting queue length, etc., based on this information, the search request processing system (hereinafter referred to as the processing system) can understand the working status of each server in real time, and then make more accurate request allocation decisions. Therefore, the processing system can first obtain the operation status tables of the above-mentioned multiple server groups to improve the stability and response speed of the processing system under high concurrency.
[0033] For example, it can be assumed that the processing system is composed of N server groups, each of which contains multiple Searchone servers. In order to accurately obtain the operation status table of the above server groups, the processing system can collect the server's operation data in real time on each Searchone server, and integrate the acquired data according to the unique identity of the server, thereby obtaining the operation status table of the above N server groups.
[0034] Step S104: in response to receiving the information search request, selecting a target server group from a plurality of server groups in a preset manner.
[0035] The above-mentioned information search request may refer to a request initiated by a user to the processing system through a client (such as a web page, mobile application, etc.) to obtain the flight fare or itinerary information specified by the user. The above-mentioned preset method may refer to a strategy for the processing system to dynamically select a target server group according to a pre-defined rule or algorithm when allocating information search requests. The above-mentioned target server group may refer to a server group selected by the processing system according to the above-mentioned preset method for processing the current information search request.
[0036] In an optional embodiment, considering that the processing system may include multiple server groups, some of the server groups may be overloaded, while other server groups may have idle resources, resulting in the overloaded server groups processing slower when responding to search requests, thereby reducing the search request response efficiency of the entire processing system. In order to avoid the above situation and improve the response rate of the processing system to user search requests, when receiving a search request, the processing system can reasonably select a server group with a lower current load from the multiple server groups to process the above request through the above preset method, so as to achieve reasonable scheduling of the resources of the entire processing system, thereby improving the response speed of the processing system.
[0037] For example, the above-mentioned preset method can be to select a group with a smaller number of currently pending search requests to process new requests, so as to achieve the purpose of improving resource utilization and improving response time. It can be assumed that the processing system includes server group A, server group B and server group C. At the current moment, the number of pending search requests of server group A is higher, server group A is relatively busy, the number of pending search requests of server group B is lower than that of server group A, and the number of pending search requests of server group C is lower than that of server group A, but higher than that of server group B. At this time, if the processing system receives a new information search request, the request can be assigned to server B for processing, thereby realizing the processing system for the information search request quickly, while ensuring the reasonable allocation of server resources, and avoiding some servers being in a high load state for a long time while other server resources are idle.
[0038] Step S106: Select a target server from the multiple servers included in the target server group based on the operation status table.
[0039] The target server may be a server in the target server group that is used to process the current user information search request.
[0040] In an optional embodiment, considering that the above-mentioned operation status table contains real-time server performance data such as waiting queue length, CPU usage, memory usage, etc., the processing system can analyze the above-mentioned server performance data to accurately determine which of the above-mentioned servers currently has stronger processing capabilities, thereby responding to the user's information search request more quickly. Based on this, the processing system can select a server with better performance from the above-mentioned target server group as the target server, thereby improving the search response speed of the processing system, reducing the user's waiting time, and improving the user's search experience.
[0041] For example, after the processing system receives the user's information search request, it can select server group A as the above-mentioned target server group according to the above steps. The processing system can further analyze the operation status table corresponding to server group A. The analysis results show that the waiting queue length of server A3 in server group A is shorter. Therefore, the processing system can select server A3 as the above-mentioned target server to improve the response speed of the processing system.
[0042] Step S108: Processing the information search request based on the target server.
[0043] In an optional embodiment, considering that the above-mentioned target server is selected by the processing system based on the operating status of different servers, the target server has a shorter waiting queue and a lower load than other servers in the processing system. Therefore, the processing system can process information search requests based on the above-mentioned target server, so that the user's search request can be received and processed faster, thereby reducing the user's waiting time and improving the user experience.
[0044] In an embodiment of the present invention, a method is adopted to obtain operation status tables of multiple server groups; in response to receiving an information search request, a target server group is selected from the multiple server groups according to a preset method; based on the operation status table, a target server is selected from the multiple servers included in the target server group; based on the way in which the target server processes the information search request, by analyzing the operation status tables of different server groups, it can be known which servers have a faster processing speed, and the above-mentioned servers with faster processing speeds are selected as the above-mentioned target servers. The search request processing system can use the target server to process the above-mentioned information search request, thereby achieving the purpose of quickly responding to the user's information search request, thereby realizing the technical effect of improving the response speed of the search request processing system to the information search request, and further solving the technical problem of low response speed to user information search requests in the related technology.
[0045] Furthermore, an operation status table of multiple server groups is obtained, including: obtaining the maximum waiting queue length of multiple servers included in different server groups; monitoring the request processing status of multiple servers to obtain the current waiting queue length of different servers; determining the remaining waiting queue length of different servers based on the maximum waiting queue length and the current waiting queue length; and constructing an operation status table of different server groups based on the remaining waiting queue length.
[0046] The maximum waiting queue length may refer to the maximum number of information search requests waiting to be processed in the server. The request processing state may refer to the state in which the server is currently processing a request. The current waiting queue length may refer to the number of information search requests that are currently in a waiting state and have not been processed by the server. The remaining waiting queue length may be the difference between the maximum waiting queue length and the current waiting queue length.
[0047] In an optional embodiment, considering that the maximum waiting queue length indicates the number of requests that the server can accept and queue for processing without exceeding the resource limit of the processing system, the processing system can obtain the maximum waiting queue length of multiple servers contained in different server groups, so as to understand the current processing capacity of each server, which helps the processing system to reasonably allocate the user's information search request to avoid server overload. After obtaining the maximum waiting queue length, the processing system can also know the number of information search requests currently waiting for processing on each server through real-time monitoring, that is, the current waiting queue length, based on which the processing system can accurately evaluate the instantaneous load status of the server. Subsequently, the processing system can calculate the difference between the maximum waiting queue length and the current waiting queue length to obtain the remaining waiting queue length of different servers, and the remaining waiting queue length can reflect how much remaining space the current server has for processing new information search requests. Finally, the processing system can construct an operation status table of different server groups based on the remaining waiting queue length. Through this table, the load of the system can be fully understood, so that the processing system can make intelligent decisions and dynamically adjust the allocation strategy of information search requests, thereby improving the response speed of the processing system to user information search requests.
[0048] For example, it can be assumed that the processing system is composed of two groups of servers, each server group contains 3 Searchone servers, the servers in server group A can be respectively recorded as A1, A2, and A3, and the servers in server group B can be respectively recorded as B1, B2, and B3, wherein each server can be deployed based on the Linux operating system, and pre-deploy an open source daemon capable of collecting server performance data, such as the Collectd program, but not limited to this. The processing system and each server can also pre-deploy a high-performance asynchronous messaging library, such as Zeromq, but not limited to this. Since the maximum waiting queue length in the server deployed based on the Linux system is a fixed value, in order to accurately construct the operation status table of the above-mentioned different server groups, the processing system can first obtain the maximum waiting queue length of each server based on the Linux cat / proc / sys / net / core / somaxconn or sysct la|grep net.core.somaxconn command. In this embodiment, it can be assumed that the maximum waiting queue length of all servers is 128. Then, each server can use the above-mentioned Collectd program to collect the current waiting queue length of the server in the current second through the command ss-tn lp at a collection frequency of 1000 milliseconds. Subsequently, each server can use the collection script of Collectd to calculate the difference between the maximum waiting queue length of the server and the current waiting queue length, thereby obtaining the remaining waiting queue length of the server. Here, server A1 can be taken as an example. After the above steps, server A1 can calculate that the current remaining waiting queue length is 30, then server A1 can integrate the remaining waiting queue length data into the format of A1:30 and submit it to the above-mentioned Zeromq asynchronous messaging library. The Zeromq asynchronous messaging library will return the remaining waiting queue length data to the processing system as soon as possible. Based on this, the processing system can construct the operation status table of different server groups according to the remaining waiting queue lengths of the above-mentioned different servers to intuitively display the processing capacity of each server.
[0049] It should be noted that the above-mentioned specific values such as the number of server groups, the number of servers in each server group, the maximum waiting queue length, the remaining waiting length, etc. are only for illustrative purposes. The staff can set them according to actual needs and there is no restriction here.
[0050] Furthermore, a target server group is selected from multiple server groups in a preset manner, including: evaluating the status of multiple server groups based on an operation status table to obtain evaluation indicators corresponding to different server groups, wherein the evaluation indicators are used to reflect the efficiency of processing information search requests using multiple servers included in different server groups; sorting the multiple server groups based on the evaluation indicators to obtain a server group sequence; and selecting a target server group from the server group sequence in a preset manner.
[0051] The above evaluation index may be an index used to quantify or describe the efficiency of different server groups in processing information search requests. The above server group sequence may refer to a list of server groups sorted according to the evaluation index.
[0052] In an optional embodiment, considering that the above-mentioned operation status table summarizes the performance indicator data of each server group, such as the remaining waiting queue length, the processing system can analyze the above-mentioned data to evaluate the processing efficiency of the server group for the information search request, so as to obtain the evaluation indicators corresponding to different server groups. In order to determine which server groups are more suitable as the target server group for receiving new requests in the current state, the processing system can sort the multiple server groups based on the above-mentioned evaluation indicators to obtain a sorted server group sequence. The purpose of the above-mentioned sorting operation is to determine the priority order when allocating new information search requests according to the processing efficiency and immediate status of each server group. At this time, the processing system can select the target server group from the server group sequence based on the above-mentioned preset method.
[0053] For example, in order to obtain evaluation indicators corresponding to different server groups and select server groups with higher processing efficiency as target server groups, the processing system can calculate the average remaining waiting queue lengths of different processor groups based on the above-mentioned operation status table, and sort the different server groups in order from large to small according to the above-mentioned average remaining waiting queue lengths, thereby obtaining a server group sequence. At this time, the processing system can give priority to server groups with larger average remaining waiting queue lengths as the above-mentioned target server groups.
[0054] Furthermore, a target server group is selected from a server group sequence in a preset manner, including: selecting a first server group from a plurality of server groups based on an evaluation indicator, wherein an evaluation indicator of the first server group is greater than evaluation indicators of other server groups except the first server group; obtaining a first identifier of a server group used to process a last received information search request; in response to the identifier of the first server group being not the first identifier, determining the first server group as the target server group; in response to the identifier of the first server group being the first identifier, selecting a second server group from a plurality of server groups according to the server group sequence, and determining the second server group as the target server group, wherein an evaluation indicator of the second server group is greater than evaluation indicators of other server groups except the first server group and the second server group.
[0055] The first server group may refer to a server group with a relatively large evaluation index value in the processing system. The first identifier may refer to an identifier used to mark the server group that processed the last received information search request. The second server group may refer to a server group whose evaluation index is second only to the first server group when the first server group has been selected to process the last received information search request.
[0056] In an optional embodiment, considering that the above-mentioned evaluation index is an indicator that reflects the ability of a server group to process information search requests, the indicator can help the processing system identify a server group that currently has higher processing efficiency and more abundant resources. Therefore, the processing system can select the above-mentioned first server group from multiple server groups based on the evaluation index. The evaluation index of this server group is greater than the evaluation indexes of other server groups except the first server group, so that the processing system can give priority to the use of server resources with stronger processing capabilities, thereby speeding up the response speed of information search requests and improving user experience. Further considering that the above-mentioned first server group may be continuously assigned multiple information search requests, thereby causing an unbalanced load on the processing system, in order to avoid multiple information search requests being continuously assigned to the same server group, the processing system can obtain the first identifier of the server group used to process the last received information search request. If the identifier of the above-mentioned first server group is different from the above-mentioned first identifier, the processing system can determine that the first server group is the target server group. If the identifier of the above-mentioned first server group is the same as the above-mentioned first identifier, the processing system can select a second server group from multiple server groups according to the server group sequence. The evaluation index of the above-mentioned second server group is greater than the evaluation index of other server groups except the first server group and the second server group. The processing system can use the above-mentioned second server group as the target server group. Through the above steps, it is ensured that new information search requests can be assigned to server groups with relatively high processing capabilities, while avoiding new information search requests from being continuously assigned to the same server group, thereby achieving a wider load balancing.
[0057] For example, it can be assumed that the processing system includes three server groups. According to the identifiers of each server group, the three server groups can be recorded as: server group A, server group B and server group C, each group including multiple Searchone servers. In this embodiment, the average remaining waiting queue length of different server groups can be used as an evaluation indicator. The average remaining waiting queue lengths of server group A, server group B and server group C are 110, 90 and 100 respectively, indicating that the information search request processing capability of server group A is stronger among the three server groups, while the information search request processing capability of server group B is weaker, and the information search request processing capability of server group C is in the middle. Therefore, the processing system can give priority to server group A as the first server group. Then, the processing system can further obtain the identifier of the server group that processed the previous information search request, that is, the first identifier. If the first identifier is not A, then the identifier is inconsistent with the identifier of the first server group. At this time, the processing system can determine that the first server group is the target server group. If the identifier is A, it is consistent with the identifier of the first server group. To avoid allocating two consecutive requests to the same server group, the processing system may reselect server group C as the second server group and determine the second server group as the target server group.
[0058] Furthermore, after processing the information search request based on the target server, the method also includes: updating the remaining waiting queue of the target server based on the information search request to obtain a new remaining waiting queue length; updating the operation status table of the target server group based on the new remaining waiting queue length to obtain a new operation status table corresponding to the target server group.
[0059] The new remaining waiting queue length may be the remaining waiting queue length after the remaining waiting queue of the target server is updated.
[0060] In an optional embodiment, considering that when allocating a request to a server, the waiting queue length of the server will increase and the remaining waiting queue length will decrease accordingly, in order to ensure that the data in the operation status table is relatively new to reflect the current load of the server, the processing system can simultaneously update the remaining waiting queue length of the target server when allocating an information search request to the target server to obtain a new remaining waiting queue length. Subsequently, the processing system can further update the operation status table of the target server group based on the new remaining waiting queue length to obtain a new operation status table corresponding to the target server group, so that the processing system can accurately understand the current load of each server and each server group, so as to make more intelligent decisions in subsequent request allocation, avoid resource waste and local overload, and ensure that the user's information search request can be processed quickly and effectively.
[0061] For example, it can be assumed that the remaining waiting queue length before the above-mentioned target server is assigned a new information search request is N. When the processing system assigns the new information search request to the target server, the new remaining waiting queue length of the target server becomes N-1. Subsequently, the processing system can update the above-mentioned new remaining waiting queue length to the operation status table of the above-mentioned target server group, thereby obtaining a new operation status table corresponding to the target server group. By updating the remaining waiting queue length and the operation status table of the target server in real time, the processing system can achieve dynamic load balancing and optimize the utilization of server resources, thereby improving the response speed to the above-mentioned requests for user information.
[0062] Furthermore, the method also includes: obtaining hardware configuration parameters of a plurality of initial servers; and grouping the plurality of initial servers based on the hardware configuration parameters to obtain a plurality of server groups.
[0063] The above hardware configuration parameters may be physical hardware attributes and resources of the server, and the above hardware configuration parameters may directly reflect the information search request processing capability of the server.
[0064] In an optional embodiment, considering that different servers may have different hardware configurations, including CPU model, memory size, disk read / write speed, network bandwidth, etc., the above hardware configuration parameters directly affect the processing capacity and response speed of the server. Therefore, the processing system can first obtain the hardware configuration parameters of multiple initial servers to better understand the capabilities of each server, thereby providing basic data for subsequent grouping and load balancing strategies. After successfully obtaining the hardware configuration parameters of the above multiple initial servers, the processing system can further group the multiple initial servers based on the hardware configuration parameters to obtain multiple server groups, so as to avoid uneven processing caused by hardware differences, while ensuring the high efficiency and stability of the processing system.
[0065] For example, after the processing system obtains the hardware configuration parameters of the above-mentioned multiple initial servers, the servers with similar hardware configurations can be grouped into the same group, so that the processing system can set more reasonable evaluation indicators for each group. When allocating new information search requests, the processing system can make decisions based on the performance indicators of the entire server group rather than the indicators of a single server, thereby achieving load balancing more efficiently, thereby ensuring that the processing system responds quickly to the user's information search request and improving the overall user experience.
[0066] Furthermore, the multiple initial servers are grouped based on hardware configuration parameters to obtain multiple server groups, including: matching the hardware configuration parameters of different initial servers to obtain a parameter matching result; in response to the parameter matching result that the hardware configuration parameters of different initial servers are the same, the multiple initial servers are evenly grouped to obtain multiple server groups; in response to the parameter matching result that the hardware configuration parameters of different initial servers are different, the multiple initial servers are grouped based on the maximum waiting queue lengths of the multiple initial servers to obtain multiple server groups.
[0067] The parameter matching result may be a result obtained by comparing the hardware configuration parameters of different initial servers, and the result may be used to determine whether the hardware configurations of the multiple initial servers are the same or similar.
[0068] In an optional embodiment, considering that servers with similar hardware configurations can bear similar loads, servers with similar hardware configurations are divided into the same server group. The processing system can ensure that information search requests are evenly distributed in each server group, avoiding the situation where a server with slightly stronger performance is overused while other servers have idle resources. Therefore, the processing system can first match the hardware configuration parameters of different initial servers to obtain parameter matching results. If the above parameter matching results show that the hardware configuration parameters of the above different initial servers are the same, the processing system can group these servers evenly, that is, each group contains the same number of servers, thereby obtaining the above multiple server groups. If the above parameter matching results show that the hardware configuration parameters of the above different initial servers are different, the processing system can group them based on the maximum waiting queue length of each server, thereby obtaining the above multiple server groups, so that the processing system can define more reasonable load limits for servers with different configurations, thereby avoiding server load imbalance caused by hardware performance differences under high concurrent requests.
[0069] For example, it can be assumed that the processing system includes six servers, and the six servers can be respectively recorded as server A, server B, server C, server D, server E, and server F. The processing system matches the hardware configuration parameters of the six servers. If the hardware matching result shows that the hardware parameters of the six servers are the same, the processing system can group the six servers equally, and obtain server group 1 including server A and server B, server group 2 including server C and server D, and server group 3 including server E and server F. If the hardware matching result shows that the hardware parameters of the six servers are different, and the maximum waiting queue length of server A and server B is p, and the maximum waiting queue length of server C, server D, server E, and server F is q, then the processing system can group the six servers based on the maximum waiting queue length of the six servers, and obtain server group 1 including server A and server B, and server group 2 including server C, server D, server E, and server F.
[0070] It should be noted that the number of the above servers is only for illustrative purposes and the staff can set it according to actual needs. There is no limitation here.
[0071] Furthermore, the method also includes: in response to any one server in the multiple server groups being offline, grouping the other servers based on hardware configuration parameters of the other servers except any one server in the multiple initial servers to obtain multiple new server groups.
[0072] In an optional embodiment, considering that after a server in a server group goes offline, the information search request processing capacity of the server group will decrease, which may cause other servers to bear too much load, thereby affecting the overall performance and response speed of the processing system. Therefore, when any server in the above-mentioned multiple server groups goes offline, the processing system can group the other servers based on the hardware configuration parameters of the other servers in the multiple initial servers except the above-mentioned offline server according to the above-mentioned grouping steps, thereby obtaining multiple new server groups. Through the above-mentioned regrouping, the processing system can ensure that other servers that are not offline can share the workload evenly, thereby avoiding the occurrence of single-point overload.
[0073] For ease of understanding, Figure 2 FIG. 1 is a schematic diagram of an optional system structure for collecting and pushing freight rate search data according to an embodiment of the present invention. Figure 2As shown, the structure includes a gateway system 202 and Searchone server 204, Searchone server 206, and Searchone server 208. Among them, the gateway system includes a Zeromq message queue 2022. Searchone server 204 also includes a Zeromq message queue 2042 and a Collected application 2044. Searchone server 206 also includes a Zeromq message queue 2062 and a Collected application 2064. Searchone server 208 also includes a Zeromq message queue 2082 and a Collected application 2084. In this embodiment, the Collected program is mainly responsible for collecting the current waiting queue length of each Searchone server, that is, the number of requests currently waiting to be processed. Collectd can calculate the remaining waiting queue length of the server based on the collected data, that is, the difference between the maximum waiting queue length and the current waiting queue length. The above-mentioned remaining waiting queue length reflects the current processing capacity of each server and the remaining ability to receive new requests. Each Searchone server can standardize the data format of the calculated remaining waiting queue length, so that the remaining waiting queue lengths of different Searchone servers have a unified format. Subsequently, each Searchone server can push the processed data in real time through the Zeromq message queue service to ensure that the processed data can be accurately pushed to the gateway system at a millisecond speed. The gateway system receives data from Zeromq and can set a reasonable request allocation strategy based on this data. Finally, the gateway system can group multiple Searchone servers and sort them within the group according to the queue length to decide which Searchone server to assign the new information search request to.
[0074] Figure 3 is a schematic diagram of an optional server grouping relationship according to an embodiment of the present invention, such as Figure 3As shown, the figure includes a gateway system 302 and Searchone server A304, Searchone server B306, Searchone server C308, and Searchone server D310. The gateway system can group the above four Searchone servers according to the remaining waiting queue length of each server, thereby obtaining two server groups, namely the first group 3022 and the second group 3024. Specifically, the first group contains the identifier A of Searchone server A and the remaining waiting queue length 33 of Searchone server A, as well as the identifier B of Searchone server B and the remaining waiting queue length 25 of Searchone server B. The second group contains the identifier C of Searchone server C and the remaining waiting queue length 9 of Searchone server C, as well as the identifier D of Searchone server D and the remaining waiting queue length 17 of Searchone server D. It should be noted that, Figure 3 Only four Searchone servers are shown in the figure. In actual applications, the gateway system may manage more servers. Figure 3 As shown in the architecture, the gateway system can collect the remaining waiting queue length of the Searchone server in real time. Subsequently, the gateway system can sort the Searchone servers based on the remaining waiting queue length and dynamically allocate requests to ensure the load balancing of each server and the efficient operation of the system, thereby effectively improving the response speed of the processing system to the user's information search request, thereby improving the user experience.
[0075] According to an embodiment of the present invention, an embodiment of a search request processing device is provided. It should be noted that the device can be used to execute the above search request processing method. The specific implementation and application scenario are the same as the above embodiment, and will not be repeated here.
[0076] Figure 4 is a schematic diagram of a search request processing device according to an embodiment of the present invention. Figure 4 As shown, the device comprises:
[0077] The status table acquisition module 402 is used to acquire the operation status tables of multiple server groups, wherein the operation status tables are used to store the operation status of multiple servers included in different server groups.
[0078] The server group selection module 404 is used to select a target server group from multiple server groups in a preset manner in response to receiving an information search request.
[0079] The server selection module 406 is used to select a target server from a plurality of servers included in the target server group based on the operation status table.
[0080] The request processing module 408 is used to process the information search request based on the target server.
[0081] Furthermore, the status table acquisition module is also used to: obtain the maximum waiting queue length of multiple servers included in different server groups; monitor the request processing status of multiple servers to obtain the current waiting queue length of different servers; determine the remaining waiting queue length of different servers based on the maximum waiting queue length and the current waiting queue length; and construct an operation status table of different server groups based on the remaining waiting queue length.
[0082] Furthermore, the server group selection module is also used to: evaluate the status of multiple server groups based on the operation status table to obtain evaluation indicators corresponding to different server groups, wherein the evaluation indicators are used to reflect the efficiency of processing information search requests using multiple servers included in different server groups; sort multiple server groups based on the evaluation indicators to obtain a server group sequence; and select a target server group from the server group sequence according to a preset method.
[0083] Furthermore, the server group selection module is also used to: select a first server group from multiple server groups based on an evaluation indicator, wherein the evaluation indicator of the first server group is greater than the evaluation indicators of other server groups except the first server group; obtain a first identifier of the server group used to process the last received information search request; in response to the identifier of the first server group being not the first identifier, determine that the first server group is the target server group; in response to the identifier of the first server group being the first identifier, select a second server group from multiple server groups according to the server group sequence, and determine the second server group as the target server group, wherein the evaluation indicator of the second server group is greater than the evaluation indicators of other server groups except the first server group and the second server group.
[0084] Furthermore, after processing the information search request based on the target server, the device also includes: a first update module, used to update the remaining waiting queue of the target server based on the information search request to obtain a new remaining waiting queue length; a second update module, used to update the operation status table of the target server group based on the new remaining waiting queue length to obtain a new operation status table corresponding to the target server group.
[0085] Furthermore, the device also includes: a first acquisition module, used to acquire hardware configuration parameters of multiple initial servers; a first grouping module, used to group the multiple initial servers based on the hardware configuration parameters to obtain multiple server groups.
[0086] Furthermore, the first grouping module is also used to: match the hardware configuration parameters of different initial servers to obtain a parameter matching result; in response to the parameter matching result that the hardware configuration parameters of different initial servers are the same, group the multiple initial servers evenly to obtain multiple server groups; in response to the parameter matching result that the hardware configuration parameters of different initial servers are different, group the multiple initial servers based on the maximum waiting queue lengths of the multiple initial servers to obtain multiple server groups.
[0087] Furthermore, the device also includes: a second grouping module, which is used to group other servers based on hardware configuration parameters of other servers except any one server in the multiple initial servers to obtain multiple new server groups in response to any one server in the multiple server groups being offline.
[0088] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0089] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0090] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0091] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0092] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0093] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0094] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0095] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0096] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0097] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0098] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A search request processing method, characterized in that: include: Acquire an operation status table of multiple server groups, wherein the operation status table is used to store the operation status of multiple servers included in different server groups; In response to receiving the information search request, selecting a target server group from the plurality of server groups in a preset manner; Based on the operation status table, selecting a target server from a plurality of servers included in the target server group; The information search request is processed based on the target server.
2. The method according to claim 1, characterized in that Get the running status table of multiple server groups, including: Obtaining maximum waiting queue lengths of the multiple servers included in different server groups; Monitor the request processing status of the multiple servers to obtain the current waiting queue lengths of different servers; Determine the remaining waiting queue lengths of different servers based on the maximum waiting queue length and the current waiting queue length; Based on the remaining waiting queue lengths, operation status tables of different server groups are constructed.
3. The method according to claim 1, characterized in that Selecting a target server group from the plurality of server groups in a preset manner includes: Evaluate the status of the multiple server groups based on the operation status table to obtain evaluation indicators corresponding to different server groups, wherein the evaluation indicators are used to reflect the efficiency of processing the information search request using the multiple servers included in the different server groups; Sorting the multiple server groups based on the evaluation index to obtain a server group sequence; The target server group is selected from the server group sequence in a preset manner.
4. The method according to claim 3, characterized in that Selecting the target server group from the server group sequence in a preset manner includes: Based on the evaluation index, selecting a first server group from the multiple server groups, wherein the evaluation index of the first server group is greater than the evaluation indexes of other server groups except the first server group; Obtaining a first identifier of a server group used to process a last received information search request; In response to the identifier of the first server group not being the first identifier, determining that the first server group is the target server group; In response to the identifier of the first server group being the first identifier, a second server group is selected from the multiple server groups according to the server group sequence, and the second server group is determined as the target server group, wherein an evaluation index of the second server group is greater than an evaluation index of other server groups except the first server group and the second server group.
5. The method according to claim 1, characterized in that After processing the information search request based on the target server, the method further includes: Based on the information search request, the remaining waiting queue of the target server is updated to obtain a new remaining waiting queue length; The operation status table of the target server group is updated based on the new remaining waiting queue length to obtain a new operation status table corresponding to the target server group.
6. The method according to claim 1, characterized in that The method further comprises: Obtain hardware configuration parameters of multiple initial servers; The multiple initial servers are grouped based on the hardware configuration parameters to obtain the multiple server groups.
7. The method according to claim 6, characterized in that The multiple initial servers are grouped based on the hardware configuration parameters to obtain the multiple server groups, including: Match the hardware configuration parameters of different initial servers to obtain parameter matching results; In response to the parameter matching result that the hardware configuration parameters of different initial servers are the same, the multiple initial servers are evenly grouped to obtain the multiple server groups; In response to the parameter matching result that the hardware configuration parameters of different initial servers are different, the multiple initial servers are grouped based on the maximum waiting queue lengths of the multiple initial servers to obtain the multiple server groups.
8. The method according to claim 6, characterized in that The method further includes: in response to any one server in the multiple server groups being offline, grouping the other servers based on hardware configuration parameters of the other servers in the multiple initial servers except the any one server to obtain multiple new server groups.
9. A search request processing device, characterized in that: include: A status table acquisition module, used to acquire an operation status table of multiple server groups, wherein the operation status table is used to store the operation status of multiple servers included in different server groups; A server group selection module, configured to select a target server group from the plurality of server groups in a preset manner in response to receiving an information search request; A server selection module, configured to select a target server from a plurality of servers included in the target server group based on the operation status table; A request processing module is used to process the information search request based on the target server.
10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 8 when running.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.