Method and device for realizing intelligent IP scheduling processing based on machine learning model prediction, processor and computer readable storage medium
Through the intelligent IP scheduling method based on machine learning model prediction, the problem that IP scheduling relies on manual experience and fixed rules in the existing technology is solved, and the adaptive optimization scheduling of server IP is realized, which significantly reduces client access delay and ensures stable server operation.
Patent Information
- Application Number
- CN202411349291.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-28
AI Technical Summary
The existing IP scheduling systems rely too much on manual experience and cannot guarantee that the IP obtained by the client is the optimal IP. IP scheduling based on fixed rules cannot adapt to complex and changeable practical application scenarios, resulting in the possibility of issuing low-quality IPs, causing server load imbalance, and even causing server crashes.
The intelligent IP scheduling method based on machine learning model prediction is adopted. By collecting client request feedback data and server data, building a data set and training a machine learning model, predicting the expected request response time of each server under each client request, and calculating the comprehensive weights based on the prediction time and request response rate, deciding which server IPs are issued to the client, and the model is regularly retrained to optimize the scheduling strategy.
It realizes adaptive optimized scheduling of server IP for different client requests, significantly reduces the overall access request delay of the client, and ensures the stable operation of the server, meeting the load balancing requirements of the actual production environment.
Smart Images

Figure CN119539116A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to the field of machine learning model prediction, and specifically refers to a method, device, processor and computer-readable storage medium thereof for realizing intelligent IP scheduling processing based on machine learning model prediction. Background Art
[0002] In the field of financial services, financial service platforms play an important role, providing a variety of services such as trading, market conditions, and financial management. In order to improve user access speed and security, these platforms usually use httpDNS technology to replace traditional domain name resolution methods, allowing users to obtain the IP address available for business services through http requests on the client side, and then make requests to the IP.
[0003] For client requests, the existing IP scheduling system mostly adopts a rule-based IP scheduling method. For example, based on the monitoring data of performance indicators such as server load and traffic, combined with the client's geographical location, operator and other information, the priority of all IPs to be scheduled is calculated according to a certain rule designed manually, and then a certain strategy is adopted to distribute IPs based on the result of priority sorting. Although this IP scheduling method has a fast calculation speed and is easy to implement, it relies too much on manual experience and cannot guarantee that the IP obtained by the client is the optimal IP (that is, the request response time of the server to which the IP belongs is the shortest); and it cannot adapt to complex and changeable actual application scenarios based on fixed rules, which may lead to the issuance of low-quality IPs (that is, the request response time of the server to which the IP belongs is relatively high). In addition, calculating the IP priority based on fixed rules will cause the IP priority to be relatively fixed, which will show a high probability of continuously issuing the same IP to client requests with the same type of characteristics. In the case of high concurrency, this approach will cause the server load to be very unbalanced, and in extreme cases, it will even cause the server to crash, which poses a threat to the stable operation of the business and seriously affects the user experience. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, device, processor and computer-readable storage medium thereof for realizing intelligent IP scheduling processing based on machine learning model prediction, which have good stability, load balancing and a wide range of applications.
[0005] In order to achieve the above objectives, the method, device, processor and computer-readable storage medium thereof for realizing intelligent IP scheduling processing based on machine learning model prediction of the present invention are as follows:
[0006] The method for realizing intelligent IP scheduling based on machine learning model prediction is mainly characterized in that the method comprises the following steps:
[0007] (1) Collect client request feedback data and server data, clean and process the data, and build a data set for training and testing machine learning models;
[0008] (2) Select and import a machine learning model, train the model using the constructed data set, and test it to obtain a model with optimal parameters;
[0009] (3) Enumerate all possible client requests, query server data every fixed time interval T, clean and process all client request data and all server data to build a data set, input it into the machine learning model, use the machine learning model to predict the expected request response time of each server under each client request, and cache the prediction results; track and record the number of request responses of each server in real time within the fixed time interval T′;
[0010] (4) For a client request, the comprehensive weight of each server is calculated based on the predicted time consumption of each server and its request response rate, and the server IP addresses to be sent to the client are determined based on the comprehensive weight;
[0011] (5) Retrain the model at every interval T″ to update and optimize the model.
[0012] Preferably, the step (1) specifically comprises the following steps:
[0013] (1.1) Collect client request feedback data and server data;
[0014] (1.2) Clean and process the collected client request feedback data and server data accordingly;
[0015] (1.3) For the processed data, the server request response time field data is used as the target feature data, and the other field data is used as the input feature data. The data is divided into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0016] Preferably, the step (1.2) specifically comprises the following steps:
[0017] (1.2.1) For client request feedback and server data, if the value of some fields is empty, all corresponding client request feedback data and server data will be cleared;
[0018] (1.2.2) If the server IP in the server data corresponds to the LVS cluster IP, certain field data of all servers under the LVS cluster are aggregated, and the aggregated data is used as the field data corresponding to the LVS;
[0019] (1.2.3) Merge the processed client request feedback data and server data to obtain complete data;
[0020] (1.2.4) Use the top n frequency coding method to encode the category data, calculate the frequency of each category in each category field data, and take the top n categories ranked from high to low as valid categories, and classify the remaining categories as "other categories"; for the missing or unknown field values in the actual production environment, classify them as "unknown categories"; use digital id to represent the category, and record the mapping relationship between the category and its digital id;
[0021] (1.2.5) Encode time data and extract specific elements of time.
[0022] Preferably, the step (2) specifically comprises the following steps:
[0023] (2.1) Import the machine learning model and set the initial values of relevant important parameters;
[0024] (2.2) Use the hyperparameter search method to train the model on the training set and validation set to search for the best parameter combination of the model;
[0025] (2.3) After obtaining the currently trained model with the best parameters, test the model on the test set. If the test result meets the test index requirements, save the model; otherwise, adjust the parameter value range and repeat steps (2.2) and (2.3).
[0026] Preferably, the step (3) specifically comprises the following steps:
[0027] (3.1) Obtain the decision boundary data corresponding to each numerical field in the client request data in the model;
[0028] (3.2) Obtain the number of categories of all categories contained in each category field data in the client request data;
[0029] (3.3) Based on the number of decision boundaries of all numerical fields and the number of categories of all category fields obtained in steps (3.1) and (3.2), enumerate all possible combinations of client requests and calculate the number of all possible client requests N client ;
[0030] (3.4) Get the current time t and extract the time data; get the data of all servers and process them; combine the time data with the server data and the obtained client request data to get the complete input feature data, that is, N input feature data; the number of available servers is N server , then N = N client ×Nserver ;
[0031] (3.5) Input the N input feature data into the model, use the model to predict the request response time corresponding to the N input feature data, obtain an N-dimensional vector, and reshape it into N client ×N server The matrix D is cached;
[0032] (3.6) Requery the server information once every interval T, recalculate the request response time matrix D in step (3.5) according to the method in step (3.3) and step (3.4), and update the cache;
[0033] (3.7) In the time interval T′, the number of responses of each server to the client request is tracked and recorded in real time, using a length of N server The list is represented by C; each element in the list C represents the number of real-time request responses of its corresponding server within T′, and the order of the servers corresponding to the list is consistent with the order of the servers in the request response time matrix D.
[0034] Preferably, in step (3.3), all possible client request numbers N are calculated. client , specifically:
[0035] Calculate the number of all possible client requests N according to the following formula client :
[0036]
[0037] Among them, there are m numerical fields in the client request data, and the number of numerical values in the decision boundary data corresponding to the i-th field is There are n category fields in the client request data, and the number of categories contained in the jth field is
[0038] Preferably, the step (3.4) specifically comprises the following steps:
[0039] (3.4.1) When querying all server data after a time interval T, obtain the current time t, encode the time data, and extract the month, day, day of the week, hour and minute as the field data corresponding to the client request sending time;
[0040] (3.4.2) Obtain data from all servers and process the server data accordingly;
[0041] (3.4.3) Combine the time data and server data with the obtained client request data to obtain complete input feature data.
[0042] Preferably, the step (4) specifically comprises the following steps:
[0043] (4.1) For any client request in an actual production environment, extract the specific field data corresponding to each numerical field and category field from the client request data; convert these field data into corresponding digital IDs according to certain mapping rules, and calculate the row index of the client request in the request-response time matrix D according to these digital IDs; extract the corresponding row data in the matrix D according to the row index, and the extracted row data is represented by D;
[0044] (4.2) For the server request response times list C, divide each element in C by the server_maxservicecount value of its corresponding server, and convert the request response times into a request response rate; perform a Softmax operation on the converted list C to convert the element value to between 0 and 1; and perform a Softmax operation on the row data D as well;
[0045] (4.3) Perform weighted summation on C and D obtained after conversion in (4.2) to calculate the final delivery weight W of each server IP;
[0046] (4.4) Sort the server IP delivery weights obtained in step (4.3) from small to large, and deliver the IP addresses of the servers corresponding to the first or top K weight values to the client according to actual needs.
[0047] Preferably, the step (5) specifically comprises the following steps:
[0048] (5.1) Sampling the historical client request feedback data and server data in the most recent mT″ historical time periods, merging the sampled data with the data in the current time period T″, processing the merged data, and constructing a data set for training a new model;
[0049] (5.2) Train a new model and replace the original model with the new model.
[0050] The system for realizing intelligent IP scheduling based on machine learning model prediction has the following main features:
[0051] A query module, used to query server data from the cache module;
[0052] A model updating module, connected to the query module, is used to train the model to update the model, and generate decision boundary data of all numerical fields and category data of all category fields according to the model, and transmit them to the data processing module and the IP scheduling module respectively;
[0053] A data processing module, connected to the model updating module, is used to process the server data obtained by query, process the client request data in real time, and enumerate and process all the client request data;
[0054] A request response time prediction module, connected to the data processing module, is used to calculate the expected request response time of all servers under all possible client requests using a machine learning model, and store the calculation results in a cache module;
[0055] An IP scheduling module, connected to the model updating module, is used to obtain the server request response time and the server request response times, and perform IP scheduling for different client requests;
[0056] The monitoring module is used to monitor the operation of the pipeline and the status of the server. If the monitoring finds that the pipeline operation is abnormal or the server status is abnormal, an alarm signal will be issued to remind the maintenance personnel to perform relevant operations;
[0057] A cache module, connected to the request response time prediction module, used to store server data and server request response time data;
[0058] The persistent database module is used to persistently store client request feedback data and server data.
[0059] The main feature of the device for realizing intelligent IP scheduling processing based on machine learning model prediction is that the device comprises:
[0060] a processor configured to execute computer-executable instructions;
[0061] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing intelligent IP scheduling processing based on machine learning model prediction are implemented.
[0062] The processor for implementing intelligent IP scheduling processing based on machine learning model prediction has the main feature that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for implementing intelligent IP scheduling processing based on machine learning model prediction are implemented.
[0063] The main feature of this computer-readable storage medium is that a computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for realizing intelligent IP scheduling processing based on machine learning model prediction.
[0064] The method, device, processor and computer-readable storage medium for realizing intelligent IP scheduling based on machine learning model prediction of the present invention are adopted, and the machine learning model is introduced to accurately predict the expected request response time of the server to the client request, and an IP scheduling strategy based on the expected request response time of the server and the server request response rate is designed, so as to realize adaptive optimization scheduling of server IP for different client requests, significantly reduce the overall access request delay of the client, and ensure the stable operation of the server. At the same time, the present invention also provides an efficient caching strategy, which can effectively support the proposed scheduling method to quickly respond to client requests, and fully meet the needs of the actual production environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is an example diagram of server request response time prediction for the method of the present invention for realizing intelligent IP scheduling processing based on machine learning model prediction.
[0066] Figure 2 The present invention is a flowchart of a method for realizing intelligent IP scheduling processing based on machine learning model prediction.
[0067] Figure 3 This is a structural diagram of the system for realizing intelligent IP scheduling processing based on machine learning model prediction of the present invention. DETAILED DESCRIPTION
[0068] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0069] The method of the present invention for realizing intelligent IP scheduling processing based on machine learning model prediction includes the following steps:
[0070] (1) Collect client request feedback data and server data, clean and process the data, and build a data set for training and testing machine learning models;
[0071] (2) Select and import the LightGBM model in the field of machine learning gradient boosted trees, use the constructed data set to train the model and test it to obtain a model with the best parameters;
[0072] (3) Enumerate all possible client requests, query server data every fixed time interval T, clean and process all client request data and all server data to build a data set, input it into the LightGBM model, use the LightGBM model to predict the expected request response time of each server under each client request, and cache the prediction results; track and record the number of request responses of each server in real time within the fixed time interval T′;
[0073] (4) For a client request, the comprehensive weight of each server is calculated based on the predicted time consumption of each server and its request response rate, and the server IP addresses to be sent to the client are determined based on the comprehensive weight;
[0074] (5) Retrain the model at every interval T″ to update and optimize the model.
[0075] As a preferred embodiment of the present invention, the step (1) specifically comprises the following steps:
[0076] (1.1) Collect client request feedback data and server data;
[0077] (1.2) Clean and process the collected client request feedback data and server data accordingly;
[0078] (1.3) For the processed data, the server request response time field data is used as the target feature data, and the other field data is used as the input feature data. The data is divided into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0079] As a preferred embodiment of the present invention, the step (1.2) specifically includes the following steps:
[0080] (1.2.1) For client request feedback and server data, if the value of some fields is empty, all corresponding client request feedback data and server data will be cleared;
[0081] (1.2.2) If the server IP in the server data corresponds to the LVS cluster IP, certain field data of all servers under the LVS cluster are aggregated, and the aggregated data is used as the field data corresponding to the LVS;
[0082] (1.2.3) Merge the processed client request feedback data and server data to obtain complete data;
[0083] (1.2.4) Use the top n frequency coding method to encode the category data, calculate the frequency of each category in each category field data, and take the top n categories ranked from high to low as valid categories, and classify the remaining categories as "other categories"; for the missing or unknown field values in the actual production environment, classify them as "unknown categories"; use digital id to represent the category, and record the mapping relationship between the category and its digital id;
[0084] (1.2.5) Encode time data and extract specific elements of time.
[0085] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:
[0086] (2.1) Import the LightGBM model and set the initial values of relevant important parameters;
[0087] (2.2) Use the hyperparameter search method to train the model on the training set and validation set to search for the best parameter combination of the model;
[0088] (2.3) After obtaining the currently trained model with the best parameters, test the model on the test set. If the test result meets the test index requirements, save the model; otherwise, adjust the parameter value range and repeat steps (2.2) and (2.3).
[0089] As a preferred embodiment of the present invention, the step (3) specifically comprises the following steps:
[0090] (3.1) Obtain the decision boundary data corresponding to each numerical field in the client request data in the model;
[0091] (3.2) Obtain the number of categories of all categories contained in each category field data in the client request data;
[0092] (3.3) Based on the number of decision boundaries of all numerical fields and the number of categories of all category fields obtained in steps (3.1) and (3.2), enumerate all possible combinations of client requests and calculate the number of all possible client requests N client ;
[0093] (3.4) Get the current time t and extract the time data; get the data of all servers and process them; combine the time data with the server data and the obtained client request data to get the complete input feature data, that is, N input feature data; the number of available servers is N server , then N=N client ×N server ;
[0094] (3.5) Input the N input feature data into the model, use the model to predict the request response time corresponding to the N input feature data, obtain an N-dimensional vector, and reshape it into N client ×N server The matrix D is cached;
[0095] (3.6) Requery the server information once every interval T, recalculate the request response time matrix D in step (3.5) according to the method in step (3.3) and step (3.4), and update the cache;
[0096] (3.7) In the time interval T′, the number of responses of each server to the client request is tracked and recorded in real time, using a length of Nserver The list is represented by C; each element in the list C represents the number of real-time request responses of its corresponding server within T′, and the order of the servers corresponding to the list is consistent with the order of the servers in the request response time matrix D.
[0097] As a preferred embodiment of the present invention, the step (3.3) calculates the number of all possible client requests N client , specifically:
[0098] Calculate the number of all possible client requests N according to the following formula client :
[0099]
[0100] Among them, there are m numerical fields in the client request data, and the number of numerical values in the decision boundary data corresponding to the i-th field is There are n category fields in the client request data, and the number of categories contained in the jth field is
[0101] As a preferred embodiment of the present invention, the step (3.4) specifically includes the following steps:
[0102] (3.4.1) When querying all server data after a time interval T, obtain the current time t, encode the time data, and extract the month, day, day of the week, hour and minute as the field data corresponding to the client request sending time;
[0103] (3.4.2) Obtain data from all servers and process the server data accordingly;
[0104] (3.4.3) Combine the time data and server data with the obtained client request data to obtain complete input feature data.
[0105] As a preferred embodiment of the present invention, the step (4) specifically comprises the following steps:
[0106] (4.1) For any client request in an actual production environment, extract the specific field data corresponding to each numerical field and category field from the client request data; convert these field data into corresponding digital IDs according to certain mapping rules, and calculate the row index of the client request in the request-response time matrix D according to these digital IDs; extract the corresponding row data in the matrix D according to the row index, and the extracted row data is represented by D;
[0107] (4.2) For the server request response times list C, divide each element in C by the server_maxservicecount value of its corresponding server, and convert the request response times into a request response rate; perform a Softmax operation on the converted list C to convert the element value to between 0 and 1; and perform a Softmax operation on the row data D as well;
[0108] (4.3) Perform weighted summation on C and D obtained after conversion in (4.2) to calculate the final delivery weight W of each server IP;
[0109] (4.4) Sort the server IP delivery weights obtained in step (4.3) from small to large, and deliver the IP addresses of the servers corresponding to the first or top K weight values to the client according to actual needs.
[0110] As a preferred embodiment of the present invention, the step (5) specifically comprises the following steps:
[0111] (5.1) Sampling the historical client request feedback data and server data in the most recent mT″ historical time periods, merging the sampled data with the data in the current time period T″, processing the merged data, and constructing a data set for training a new model;
[0112] (5.2) Train a new model and replace the original model with the new model.
[0113] The system of the present invention for realizing intelligent IP scheduling processing based on machine learning model prediction, wherein the system comprises:
[0114] A query module, used to query server data from the cache module;
[0115] A model updating module, connected to the query module, is used to train the model to update the model, and generate decision boundary data of all numerical fields and category data of all category fields according to the model, and transmit them to the data processing module and the IP scheduling module respectively;
[0116] A data processing module, connected to the model updating module, is used to process the server data obtained by query, process the client request data in real time, and enumerate and process all the client request data;
[0117] A request response time prediction module, connected to the data processing module, is used to calculate the expected request response time of all servers under all possible client requests using a machine learning model, and store the calculation results in a cache module;
[0118] An IP scheduling module, connected to the model updating module, is used to obtain the server request response time and the server request response times, and perform IP scheduling for different client requests;
[0119] The monitoring module is used to monitor the operation of the pipeline and the status of the server. If the monitoring finds that the pipeline operation is abnormal or the server status is abnormal, an alarm signal will be issued to remind the maintenance personnel to perform relevant operations;
[0120] A cache module, connected to the request response time prediction module, used to store server data and server request response time data;
[0121] The persistent database module is used to persistently store client request feedback data and server data.
[0122] The device for implementing intelligent IP scheduling based on machine learning model prediction of the present invention, wherein the device comprises:
[0123] a processor configured to execute computer-executable instructions;
[0124] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing intelligent IP scheduling processing based on machine learning model prediction are implemented.
[0125] The processor of the present invention is used to implement intelligent IP scheduling processing based on machine learning model prediction, wherein the processor is configured to execute computer executable instructions, and when the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for implementing intelligent IP scheduling processing based on machine learning model prediction are implemented.
[0126] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for realizing intelligent IP scheduling processing based on machine learning model prediction.
[0127] In a specific embodiment of the present invention, it relates to an IP scheduling system in the field of financial services. In view of the shortcomings of the existing IP scheduling system, an innovative intelligent IP scheduling method and system based on machine learning model prediction is proposed, aiming to reduce the overall access request latency of the client, ensure server load balancing, and improve the quality of financial services and user experience.
[0128] The present invention innovatively uses client requests and server data to train a machine learning model, and uses the model to predict the expected response time of the server IP to different client requests. At the same time, an IP scheduling strategy that combines the IP predicted response time and the IP delivery rate is designed to achieve effective and balanced IP scheduling.
[0129] In order to meet the actual high-concurrency requests, the present invention also innovatively designs a set of efficient and lightweight caching strategies, enumerating and calculating the expected response time of different IPs under all possible client requests in a certain way and caching them, so that when the client issues a request, it can quickly retrieve relevant results from the cache and respond, greatly improving service efficiency. Through these innovative measures, the present invention significantly reduces the access request latency of the client and ensures the stable operation of the server, which can effectively support the financial service platform to provide efficient, stable and high-quality financial services.
[0130] The present invention provides an intelligent IP scheduling method based on machine learning model prediction, which is characterized by comprising the following steps:
[0131] Step 1: Collect client request feedback data and server data, clean and process the data, and build a data set for training and testing machine learning models;
[0132] Step 2: Select and import the machine learning gradient boosted tree model, train the model using the constructed data set and test it to obtain the model with the best parameters;
[0133] Step 3: Enumerate all possible client requests, query the server data once every fixed time interval T, and then process all client request data and all server data in the same way as in step 1, input them into the LightGBM model, and use the model to predict the expected request response time of each server under each client request, and finally cache the prediction results; in addition, the number of request responses of each server is tracked and recorded in real time within a fixed time interval T′ (T′≥T) to achieve balanced scheduling of server IPs;
[0134] Step 4: For a client request, the comprehensive weight of each server is calculated based on the predicted time consumption of each server and its request response rate. Finally, based on the comprehensive weight, the server IP addresses to be sent to the client are determined.
[0135] Step 5: Retrain the model at every interval T″(T″>T) to update and optimize the model.
[0136] The specific process of step 1 is as follows:
[0137] Step 1.1: Collect client request feedback data and server data;
[0138] Step 1.2: Clean and process the collected client request feedback data and server data accordingly, including:
[0139] Step 1.2.1: For client request feedback and server data, if the value of some fields is empty, all corresponding client request feedback data and server data are cleared;
[0140] Step 1.2.2: In the server data, if a server IP corresponds to an LVS cluster IP, aggregate certain field data of all servers under the LVS cluster, and use the aggregated data as the field data corresponding to the LVS;
[0141] Step 1.2.3: Merge the processed client request feedback data and server data to obtain complete data;
[0142] Step 1.2.4: Use the top n frequency coding method to encode the category data, calculate the frequency of each category in each category field data, and then take the categories ranked top n (from large to small) in frequency as valid categories, and the remaining categories are uniformly classified as "other categories"; in addition, for missing or unknown field values that may appear in the actual production environment, they are all classified as "unknown categories"; after determining all the categories contained in each category field data, use digital id to represent the category, and record the mapping relationship between the category and its digital id;
[0143] Step 1.2.5: Encode the time data and extract the specific elements of time, including month, day, day of the week, hour and minute;
[0144] The above Sunday number refers to the day of the week to which this day belongs, 0 represents the first day (Monday), and 6 represents the 7th day (Sunday).
[0145] Step 1.3: For the data processed in step 1.2, the server request response time field data is used as the target feature data, and the other field data is used as the input feature data, and the data is divided into a training set, a validation set, and a test set in a ratio of 8:1:1;
[0146] The specific process of step 2 is as follows:
[0147] Step 2.1: Import the machine learning model and set the initial values of relevant important parameters;
[0148] Step 2.2: Use the hyperparameter search method to train the model on the training set and validation set to search for the best parameter combination of the model;
[0149] Step 2.3: After obtaining the currently trained model with the best parameters, test the model on the test set. If the test result meets the test index requirements, save the model. Otherwise, adjust the parameter value range and repeat steps 2.2 and 2.3.
[0150] The specific process of step 3 is as follows:
[0151] Step 3.1: Obtain the decision boundary data corresponding to each numerical field in the client request data in the model (remove duplicate values); assuming that there are m numerical fields in the client request data, then the number of values in the decision boundary data corresponding to the i-th field is recorded as
[0152] Step 3.2: Get the number of categories of all categories contained in each category field in the client request data; assuming that there are n category fields in the client request data, then record the number of categories contained in the jth field as
[0153] Step 3.3: Based on the number of decision boundaries of all numerical fields and the number of categories of all category fields obtained in steps 3.1 and 3.2, enumerate all possible combinations of client requests; denote the number of all possible client requests as N client , then N client The calculation formula is as follows:
[0154]
[0155] Step 3.4: When querying all server data after a time interval T, first obtain the current time t, and extract the month, day, day of the week, hour and minute as the field data corresponding to the client request sending time in the manner of step 1.2.5; then obtain the data of all servers, and process the server data accordingly in the manner of steps 1.2.2 and 1.2.4; finally, combine the time data with the server data and the client request data obtained in step 3.3 to obtain the complete input feature data. Assume that there are N server servers, then we can get N = N client ×N server Input feature data;
[0156] Step 3.5: Input these N input feature data into the model, use the model to predict the request response time corresponding to these N input feature data, obtain an N-dimensional vector, and then reshape the vector into N client ×N server The matrix is then cached; the matrix is recorded as D, and each row of data in D represents the expected request response time of each server under the client request within the time interval T;
[0157] Step 3.6: Requery the server information once every interval T, and then recalculate the request response time matrix D in step 3.5 in the manner of steps 3.3 and 3.4, and update the cache;
[0158] Step 3.7: In the time interval T', track and record the number of responses of each server to the client's request in real time, using a length of N server The list is represented by C; each element in the list C represents the number of real-time request responses of its corresponding server within T′, and the order of the servers corresponding to the list is consistent with the order of the servers in the request response time matrix D.
[0159] The specific process of step 4 is as follows:
[0160] Step 4.1: For any client request in the actual production environment, firstly, extract the specific field data corresponding to each numerical field and category field from the client request data; then convert these field data into corresponding digital IDs according to certain mapping rules, and calculate the row index of the client request in the request-response time matrix D according to these digital IDs; finally, extract the corresponding row data in the matrix D according to the row index, and the extracted row data is represented by D;
[0161] Step 4.2: Since different servers have different maximum serviceable users, the number of request responses cannot be used directly to measure the balance of server IP issuance. Therefore, for the server request response count list C, divide each element in C by the server_maxservicecount value of its corresponding server, so as to convert the request response count into the request response rate; then perform the Softmax operation on the converted list C to convert the element value to between 0 and 1; and perform the Softmax operation on the row data D; the calculation process is as follows:
[0162]
[0163] C = Softmax(C)
[0164] D = Softmax(D)
[0165] Where server_maxservicecount k Indicates the server_maxservicecount value of the server corresponding to the kth element in C, 0≤k≤N server -1; Taking List C as an example, the Softmax operation calculation formula is as follows:
[0166]
[0167] Step 4.3: Perform a weighted sum of C and D obtained after the conversion in step 4.2 to calculate the final delivery weight of each server IP, represented by W. The result is as follows:
[0168] W = w1 × C + w2 × D;
[0169] Where w1 and w2 are the weights of C and D, respectively, with values ranging from 0 to 1, and w1+w2=1;
[0170] Step 4.4: Sort the server IP delivery weights obtained in step 4.3 from small to large, and then deliver the IP of the server corresponding to the first or top K weight values to the client according to actual needs.
[0171] The specific process of step 5 is as follows:
[0172] Step 5.1: Sample the historical client request feedback data and server data saved in the most recent mT″ historical time periods, merge the sampled data with the data in the current time period T″, and then use steps 1.2 and 1.3 to process the merged data to construct a data set for training a new model;
[0173] Step 5.2: Based on the data set obtained in step 5.1, train a new model according to steps 2.2 and 2.3 to replace the original model.
[0174] The present invention also discloses an intelligent IP scheduling system based on machine learning model prediction, which includes: a query module, a model update module, a data processing module, a request response time prediction module, an IP scheduling module, a monitoring module, a cache module, and a persistent database module;
[0175] The query module is used to query server data from the cache module.
[0176] The model updating module is used to train the model to update the model, and generate decision boundary data of all numerical fields and category data of all category fields according to the model, and provide them to the data processing module and the IP scheduling module respectively.
[0177] The data processing module is used to process the server data obtained by query, process the client request data in real time, and enumerate and process all the client request data.
[0178] The request response time prediction module is used to calculate the expected request response time of all servers under all possible client requests using a machine learning model, and store the calculation results in a cache module.
[0179] The IP scheduling module is used to obtain the server request response time and the server request response times, and perform IP scheduling for different client requests.
[0180] The monitoring module is used to monitor the operation of the pipeline and the status of the server. If the monitoring finds that the operation of the pipeline is abnormal or the status of the server is abnormal, an alarm signal is issued to remind the maintenance personnel to perform relevant operations.
[0181] The cache module is used to store server data and server request response time-consuming data.
[0182] The persistent database module is used to persistently store client request feedback data and server data.
[0183] Figure 1 , Figure 2 , Figure 3 The following are respectively an example diagram of server request response time prediction based on the LightGBM model provided in an embodiment of the present invention, a flow chart of an intelligent IP scheduling method based on LightGBM model prediction, and a structural diagram of an intelligent IP scheduling system based on LightGBM model prediction, combined with Figure 1 , Figure 2 and Figure 3 , in a specific embodiment of the present invention, the following steps are included:
[0184] Step 1: Collect client request feedback data and server data, clean and process the data, and build a data set for training and testing machine learning models, including:
[0185] Step 1.1: Collect client request feedback data and server data;
[0186] Optionally, in this embodiment, detailed information of the collected client request feedback data and server data is shown in Table 1;
[0187] Table 1 Detailed information of client request feedback data and server data
[0188]
[0189]
[0190] As shown in Table 1, although the field names of client_ip and outer_ip are different, the unique server IP values they contain are the same.
[0191] Step 1.2: Clean and process the collected client request feedback data and server data accordingly, including:
[0192] Step 1.2.1: For client request feedback and server data, if the value of some fields is empty, all corresponding client request feedback data and server data are cleared.
[0193] Optionally, in this embodiment, for client request feedback data, if the data in the client_send_time or duration field is empty, all corresponding client request feedback data are removed; for server data, if the data in any field is empty, all corresponding server data are deleted.
[0194] Step 1.2.2: In the server data, if outer_IP corresponds to the IP of the LVS cluster, aggregate the field data such as server_online, server_maxservicecount, server_cpu, server_mem and server_isp of each server under the LVS cluster, and use the aggregated data as the field data corresponding to the LVS.
[0195] Optionally, in this embodiment, for numerical field data such as server_online, server_maxservicecount, server_cpu, server_mem, etc., their values are averaged and aggregated; for server_isp category field data, the categories with a frequency of occurrence exceeding 1 / 3 are first extracted, and then these category strings are concatenated into a complete string with spaces according to alphabetical sorting as the aggregated category.
[0196] Step 1.2.3: According to client_ip and outer_ip, merge the client request feedback data and server data through equal connection to obtain complete data. The field name corresponding to the merged server IP is named server_ip, and the client_ip and outer_ip fields are deleted.
[0197] Step 1.2.4: Use the top n frequency coding method to encode the category data, calculate the frequency of each category in each category field data, and then take the categories ranked in the top n (from large to small) in frequency as valid categories, and the remaining categories are uniformly classified as "other categories"; in addition, for missing or unknown field values that may appear in the actual production environment, they are all classified as "unknown categories"; after determining all the categories contained in each category field data, use digital id to represent the category, and record the mapping relationship between the category and its digital id.
[0198] Optionally, in this embodiment, for the client_os_type, client_isp and server_isp fields, n is set to 9, 3 and 10 respectively; after considering other categories and unknown categories, these three fields contain 11, 5 and 12 different categories respectively; then the categories are represented by digital ids, the ids corresponding to different categories in client_os_type are 0-10, the ids corresponding to different categories in client_isp are 0-4, and the ids corresponding to different categories in server_isp are 0-11.
[0199] Step 1.2.5: Encode the time data (field data of type time) client_send_time, and extract the specific elements of time, including month, day, day of the week, hour and minute; name the field names of the encoded time elements as client_send_time_month, client_send_time_day, client_send_time_weekday, client_send_time_hour, client_send_time_minute, and delete the client_send_time field.
[0200] After step 1.2, the field information of the complete data is shown in Table 2, with a total of 16,167,815 data items;
[0201] Table 2 Field information of complete data
[0202] client_longitude client_send_time_month server_ip server_cpu client_latitude client_send_time_day server_longitude server_mem client_os_type client_send_time_weekday server_latitude server_isp client_isp client_send_time_hour server_online duration client_send_time_minute server_maxservicecount
[0203] Step 1.3: For the data processed in step 1.2, use the duration field data as the target feature data and the other field data as the input feature data, and divide the data into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0204] Step 2: Select and import the machine learning model in the field of machine learning gradient boosted trees, train the model with the constructed data set and test it to obtain the model with the best parameters, including:
[0205] Step 2.1: Import the LightGBM model and set the initial values of relevant important parameters.
[0206] Optionally, in this embodiment, information of relevant important parameters is shown in Table 3.
[0207] Table 3 Important parameter information
[0208]
[0209]
[0210] Step 2.2: Use the hyperparameter search method to train the model on the training set and validation set to search for the best parameter combination of the model.
[0211] Optionally, in this embodiment, the hyperparameter search method used is a Bayesian optimization technique and a 5-fold cross validation method.
[0212] Step 2.3: After obtaining the currently trained model with the best parameters, test the model on the test set. If the test result meets the test index requirements, save the model; otherwise, adjust the parameter value range and repeat steps 2.2 and 2.3.
[0213] Optionally, in this embodiment, the test indicator in step 2.3 is mean absolute error (MAE), which is used to measure the accuracy of the model predicting the time consumption of the server request response, and the calculation formula is as follows:
[0214]
[0215] In the formula, n represents the amount of test data, y i represents the true target feature value (i.e., the true duration value) corresponding to the i-th test data. It is the target feature value (i.e. predicted duration value) predicted by the model for the i-th test data. The smaller the MAE value, the better.
[0216] The model prediction process is as follows Figure 1 As shown in the figure, given an input feature data composed of client request data and server data, the model will Figure 1 The method shown predicts the expected request response time of the server to the client request.
[0217] After training the LightGBM model, Figure 2 The following process is used as an example to illustrate the adaptive IP scheduling based on the LightGBM model:
[0218] Step 3: Enumerate all possible client requests. After obtaining the data of all servers in each query, process all client request data and all server data in the same way as in step 1, and then input them into the LightGBM model. Use the model to predict the expected request response time of each server under each client request, and finally cache the prediction results, including:
[0219] Step 3.1: Get the decision boundary data corresponding to the client_longitude and client_latitude fields in the client request data in the LightGBM model, denoted as client_longitude_borders and client_latitude_borders respectively, and the number of values contained is denoted as N log and N lat .
[0220] Step 3.2: Get all the categories contained in the client_os_type and client_isp fields in the client request data, and record the number of categories as N os and N isp .
[0221] Step 3.3: Based on the number of decision boundaries and the number of categories obtained in steps 3.1 and 3.2, enumerate all possible combinations of client requests. A total of N client Client requests, N is calculated as follows:
[0222] N client =N os ×N isp ×(N log +1)×(N lat +1)
[0223] Step 3.4: When querying all server data after a time interval T, first obtain the current time t, and extract the month, day, day of the week, hour and minute as the field data corresponding to the client request sending time in the manner of step 1.2.5; then obtain the data of all servers, and process the server data accordingly in the manner of steps 1.2.2 and 1.2.4; finally, combine the time data with the server data and the client request data obtained in step 3.3 to obtain the complete input feature data. Assume that there are N server servers, then we can get N = N client ×N server Input feature data.
[0224] Step 3.5: Input these N input feature data into the model, use the model to predict the request response time corresponding to these N input feature data, obtain an N-dimensional vector, and then reshape the vector into N client ×N server The matrix is then cached; the matrix is recorded as D, and each row of data in D represents the expected request response time of each server under the client request within the time interval T.
[0225] Optionally, in this embodiment, T=15s.
[0226] Step 3.6: Requery the server information every time interval T, and then recalculate the request response time matrix D in step 3.5 according to the method in steps 3.3 and 3.4, and update the cache.
[0227] Step 3.7: In the time interval T', use a length of N server The list C tracks and records the number of times each server responds to client requests in real time; each element in C represents the number of real-time request responses of its corresponding server within T′, and the order of the servers corresponding to the list is consistent with the order of the servers in the request response time matrix D.
[0228] Optionally, in this embodiment, T′=15s;
[0229] Step 4: For a client request, the comprehensive weight of each server is calculated based on the predicted time consumption of each server and its request response rate. Finally, based on the comprehensive weight, the server IP addresses to be sent to the client are determined, including:
[0230] Step 4.1: For any client request in the actual production environment, first extract the specific data corresponding to the four fields of client_longitude, client_latitude, client_os_type and client_isp from the client request data; then convert the four field data into corresponding digital IDs according to certain mapping rules, and calculate the row index of the client request in the request-response time matrix D according to these digital IDs; finally, take out the corresponding row data in the matrix D according to the row index.
[0231] Optionally, in this embodiment, the request response time matrix D is stored in the form of a key-value pair, where the key is the row index of D and the value is the row data D corresponding to D; the mapping rules are as follows:
[0232] For the client_os_type and client_isp fields, first convert the field values into corresponding categories, then further convert the categories into digital ids according to the mapping relationship between categories and digital ids, and finally use the digital ids as indexes of the two field values, denoted as client_os_type_index and client_isp_index respectively.
[0233] For the two fields client_longitude and client_latitude, the values in the decision boundaries client_longitude_borders and client_latitude_borders described in step 3.1 divide the longitude and latitude into N log +1 and N lat +1 interval, the corresponding digital ids of the intervals are 0-N log and 0-N lat Therefore, we first determine which interval the field values of the two fields belong to, and then obtain the corresponding interval id as its corresponding index, which is recorded as client_longitude_index and client_latitude_index respectively; if the field value is missing, the default corresponding interval id is N log or N lat .
[0234] Convert these four data IDs into strings and then concatenate them with spaces to get the query key. The query key is in the form of:
[0235] {client_longitude_index}_{client_latitude_index}_{client_os_type_index}_{client_isp_index}; {} means converting the internal numeric variable into a string variable.
[0236] Step 4.2: For the server request response times list C, divide each element in C by the server_maxservicecount value of its corresponding server to calculate the server request response rate; then perform a Softmax operation on the converted list C to convert the element value to between 0 and 1; and also perform a Softmax operation on the row data D; the calculation process is as follows:
[0237]
[0238] C = Softmax(C)
[0239] D = Softmax(D)
[0240] Where server_maxservicecount k Indicates the server_maxservicecount value of the server corresponding to the jth element in C, 0≤k≤N server -1; Taking List C as an example, the Softmax operation calculation formula is as follows:
[0241]
[0242] Step 4.3: Perform a weighted sum of C and D obtained after the conversion in step 4.2 to calculate the final delivery weight of each server IP, represented by W. The result is as follows:
[0243] W=w1×C+w2×D
[0244] Where w1 and w2 are the weights of C and D, respectively, with values ranging from 0 to 1, and w1+w2=1;
[0245] Optionally, in this embodiment, w1=w2=0.5.
[0246] Step 4.4: Sort the server IP delivery weights obtained in step 4.3 from small to large, and then deliver the IP of the server corresponding to the first or top K weight values to the client according to actual needs.
[0247] Step 5: Retrain the model at every interval T″ to update and optimize the model, including:
[0248] Step 5.1: Perform stratified random sampling on the historical client request feedback data and server data saved in the most recent mT″ historical time periods, merge the sampled data with the data in the current time period T″, and then use the steps 1.2 and 1.3 to process the merged data to construct a data set for training a new model.
[0249] Optionally, in this embodiment, m=2, T″ is 1 week, and the model update is performed at 1 a.m. every Sunday; when sampling using the stratified random sampling method, the data is stratified at a granularity of minutes, and then the stratified data is sampled at a frequency of 0.5. After sampling, the data is merged to obtain complete sampled data.
[0250] Step 5.2: Based on the dataset obtained in step 5.1, train a new LightGBM model according to steps 2.2 and 2.3, and then replace the original LightGBM model.
[0251] The embodiment of the present invention also provides an intelligent IP scheduling system. Figure 3 A schematic diagram of the structure of the LightGBM model provided in the embodiment of the present invention is shown below. Figure 3 This system will be described in detail.
[0252] like Figure 3 As shown, the system includes:
[0253] The query module is used to query server data from the cache module.
[0254] The model update module is used to train the model to update the model, and generate decision boundary data for all numerical fields and category data for all category fields according to the model, and provide them to the data processing module and the IP scheduling module respectively.
[0255] Specifically, the client request feedback and server data of the past two weeks and the current week are obtained from the persistent database module, and the new model is retrained after sampling and other processing of the data; then, the decision boundary data client_longitude_borders and client_latitude_borders, as well as all category data contained in client_os_type and client_isp are generated according to the new model.
[0256] The data processing module is used to process the server data obtained by the query, process the client request data in real time, and enumerate and process all client request data.
[0257] Specifically, all possible client request data are enumerated and processed using client_longitude_borders and client_latitude_borders provided by the model update module, as well as all categories of client_os_type and client_isp.
[0258] The request response time prediction module is used to use the LightGBM model to calculate the expected request response time of all servers under all possible client requests, and store the calculation results in the cache module.
[0259] Specifically, all possible client request data and server data processed by the data processing module are obtained, combined and input into the LightGBM model to calculate the expected request response time of each server under each request; then the corresponding key is generated according to the client request data, and all expected request response times are stored in redis in the form of key-value pairs.
[0260] The IP scheduling module is used to obtain the server request response time and the server request response times, and perform IP scheduling for different client requests.
[0261] Specifically, the client request data is parsed, and the corresponding query key is generated according to the client_longitude_borders and client_latitude_borders provided by the model update module, as well as all category data of client_os_type and client_isp. The request response time of all servers under the request is queried from the cache module. At the same time, the number of server request response requests is obtained in real time, and the server IP is selected based on the server request response time and the server request response number and sent to the client.
[0262] The monitoring module is used to monitor the operation of the pipeline and the status of the server. If the monitoring finds that the pipeline operation is abnormal or the server status is abnormal, an alarm signal will be issued to remind the maintenance personnel to perform relevant operations.
[0263] Specifically, when monitoring finds that the current pipeline task execution is abnormal, or the current server failure ratio exceeds 50% or the server load balancing is seriously abnormal, an alarm signal is issued to remind maintenance personnel to switch the current IP scheduling system to a rule-based IP scheduling system.
[0264] The cache module is used to store server data and server request response time data.
[0265] Specifically, redis is used to store server data and server request and response time data.
[0266] The persistent database module is used to persistently store customer request feedback data and server data.
[0267] Specifically, a MySQL database is used to persistently store customer request feedback data and server data.
[0268] In an embodiment of the present invention, each module of the intelligent IP scheduling system based on LightGBM model prediction is implemented by corresponding hardware and software.
[0269] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.
[0270] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0271] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0272] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0273] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0274] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0275] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0276] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0277] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0278] The method, device, processor and computer-readable storage medium for realizing intelligent IP scheduling based on machine learning model prediction of the present invention are adopted, and the machine learning model is introduced to accurately predict the expected request response time of the server to the client request, and an IP scheduling strategy based on the expected request response time of the server and the server request response rate is designed, so as to realize adaptive optimization scheduling of server IP for different client requests, significantly reduce the overall access request delay of the client, and ensure the stable operation of the server. At the same time, the present invention also provides an efficient caching strategy, which can effectively support the proposed scheduling method to quickly respond to client requests, and fully meet the needs of the actual production environment.
[0279] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A method for realizing intelligent IP scheduling based on machine learning model prediction, characterized in that: The method comprises the following steps: (1) Collect client request feedback data and server data, clean and process the data, and build a data set for training and testing machine learning models; (2) Select and import a machine learning model in the field of machine learning gradient boosted trees, use the constructed data set to train the model and test it to obtain a model with the best parameters; (3) Enumerate all possible client requests, query server data at a fixed time interval T, clean and process all client request data and all server data to construct a data set, input it into the machine learning model, use the machine learning model to predict the expected request response time of each server under each client request, and cache the prediction results; at a fixed time interval T ′ Track and record the number of requests and responses of each server in real time; (4) For a client request, the comprehensive weight of each server is calculated based on the predicted time consumption of each server and its request response rate, and the server IP addresses to be sent to the client are determined based on the comprehensive weight; (5) Each interval time T ″′ Retrain the model to update and optimize it.
2. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 1, characterized in that: The step (1) specifically comprises the following steps: (1.1) Collect client request feedback data and server data; (1.2) Clean and process the collected client request feedback data and server data accordingly; (1.3) For the processed data, the server request response time field data is used as the target feature data, and the other field data is used as the input feature data. The data is divided into a training set, a validation set, and a test set in a ratio of 8:1:
1.
3. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 2, characterized in that: The step (1.2) specifically comprises the following steps: (1.2.1) For client request feedback and server data, if the value of some fields is empty, all corresponding client request feedback data and server data will be cleared; (1.2.2) If the server IP in the server data corresponds to the LVS cluster IP, certain field data of all servers under the LVS cluster are aggregated, and the aggregated data is used as the field data corresponding to the LVS; (1.2.3) Merge the processed client request feedback data and server data to obtain complete data; (1.2.4) Use the top n frequency coding method to encode the category data, calculate the frequency of each category in each category field data, and take the top n categories ranked from high to low as valid categories, and classify the remaining categories as "other categories"; for missing or unknown field values in the actual production environment, classify them as "unknown categories"; use digital id to represent the category, and record the mapping relationship between the category and its digital id; (1.2.5) Encode time data and extract specific elements of time.
4. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 1, characterized in that: The step (2) specifically comprises the following steps: (2.1) Import the machine learning model and set the initial values of relevant important parameters; (2.2) Use the hyperparameter search method to train the model on the training set and validation set to search for the best parameter combination of the model; (2.3) After obtaining the currently trained model with the best parameters, test the model on the test set. If the test result meets the test index requirements, save the model; otherwise, adjust the parameter value range and repeat steps (2.2) and (2.3).
5. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 1, characterized in that: The step (3) specifically comprises the following steps: (3.1) Obtain the decision boundary data corresponding to each numerical field in the client request data in the model; (3.2) Obtain the number of categories of all categories contained in each category field data in the client request data; (3.3) Based on the number of decision boundaries of all numerical fields and the number of categories of all category fields obtained in steps (3.1) and (3.2), enumerate all possible combinations of client requests and calculate the number of all possible client requests N client ; (3.4) Get the current time t and extract the time data; get the data of all servers and process them; combine the time data with the server data and the obtained client request data to get the complete input feature data, that is, N input feature data; the number of available servers is N server , then N = N client ×N server ; (3.5) Input the N input feature data into the model, use the model to predict the request response time corresponding to the N input feature data, obtain an N-dimensional vector, and reshape it into N client ×N server The matrix D is cached; (3.6) Requery the server information once every interval T, recalculate the request response time matrix D in step (3.5) according to the method in step (3.3) and step (3.4), and update the cache; (3.7) In the time interval T ′ In the real-time tracking record, the number of times each server responds to client requests is recorded, using a length of N server List representation, denoted as C; each element in list C represents its corresponding server in T ′ The order of servers corresponding to the list is consistent with the order of servers in the request response time matrix D.
6. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 5, characterized in that: In step (3.3), the number of all possible client requests N is calculated. client , specifically: Calculate the number of all possible client requests N according to the following formula client : Among them, there are m numerical fields in the client request data, and the number of numerical values in the decision boundary data corresponding to the i-th field is There are n category fields in the client request data, and the number of categories contained in the jth field is 7. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 5, characterized in that: The step (3.4) specifically comprises the following steps: (3.4.1) When querying all server data after a time interval T, obtain the current time t, encode the time data, and extract the month, day, day of the week, hour and minute as the field data corresponding to the client request sending time; (3.4.2) Obtain data from all servers and process the server data accordingly; (3.4.3) Combine the time data and server data with the obtained client request data to obtain complete input feature data.
8. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 1, characterized in that: The step (4) specifically comprises the following steps: (4.1) For any client request in an actual production environment, extract the specific field data corresponding to each numerical field and category field from the client request data; convert these field data into corresponding digital IDs according to certain mapping rules, and calculate the row index of the client request in the request-response time matrix D according to these digital IDs; retrieve the corresponding row data in the matrix D according to the row index, and the retrieved row data is represented by D; (4.2) For the server request response times list C, divide each element in C by the server_maxservicecount value of its corresponding server, and convert the request response times into a request response rate; perform a Softmax operation on the converted list C to convert the element value to between 0 and 1; and perform a Softmax operation on the row data D as well; (4.3) Perform weighted summation on C and D obtained after conversion in (4.2) to calculate the final delivery weight W of each server IP; (4.4) Sort the server IP delivery weights obtained in step (4.3) from small to large, and deliver the IP addresses of the servers corresponding to the first or top K weight values to the client according to actual needs.
9. The method for realizing intelligent IP scheduling based on machine learning model prediction according to claim 1, characterized in that: The step (5) specifically comprises the following steps: (5.1) Sample the historical client request feedback data and server data saved in the most recent mT″ historical time periods, and compare the sampled data with the current time period T ′′ Merge the data in the dataset, process the merged data, and construct a data set for training a new model; (5.2) Train a new model and replace the original model with the new model.
10. A system for realizing intelligent IP scheduling based on machine learning model prediction, characterized in that: The system comprises: A query module, used to query server data from the cache module; A model updating module, connected to the query module, is used to train the model to update the model, and generate decision boundary data of all numerical fields and category data of all category fields according to the model, and transmit them to the data processing module and the IP scheduling module respectively; A data processing module, connected to the model updating module, is used to process the server data obtained by query, process the client request data in real time, and enumerate and process all the client request data; A request response time prediction module, connected to the data processing module, is used to calculate the expected request response time of all servers under all possible client requests using a machine learning model, and store the calculation results in a cache module; An IP scheduling module, connected to the model updating module, is used to obtain the server request response time and the server request response times, and perform IP scheduling for different client requests; The monitoring module is used to monitor the operation of the pipeline and the status of the server. If the monitoring finds that the pipeline operation is abnormal or the server status is abnormal, an alarm signal will be issued to remind the maintenance personnel to perform relevant operations; A cache module, connected to the request response time prediction module, used to store server data and server request response time data; The persistent database module is used to persistently store client request feedback data and server data.
11. A device for implementing intelligent IP scheduling based on machine learning model prediction, characterized in that: The device comprises: a processor configured to execute computer executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the method for realizing intelligent IP scheduling processing based on machine learning model prediction described in any one of claims 1 to 9 are implemented.
12. A processor for implementing intelligent IP scheduling based on machine learning model prediction, characterized in that: The processor is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the various steps of the method for realizing intelligent IP scheduling processing based on machine learning model prediction described in any one of claims 1 to 9 are implemented.
13. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for realizing intelligent IP scheduling processing based on machine learning model prediction as described in any one of claims 1 to 9.