Service request processing method and device based on artificial intelligence, equipment and medium
By adopting artificial intelligence-based business request processing methods in Shenyuanhai smart fishery breeding system, filtering and preloading target models and optimizing business request processing, the problems of inefficiency and cost increase caused by frequent loading of multiple intelligent models are solved, and the problem of inefficiency and cost increase is achieved. Efficient utilization of edge computing resources and intelligent scheduling.
Patent Information
- Application Number
- CN202411295363.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-17
AI Technical Summary
In Shenyuanhai smart fishery aquaculture system, due to the frequent loading and unloading of multiple intelligent models, business processing efficiency is inefficient, and due to the physical limitations of edge devices, the business processing cost is increased.
Using the business request processing method based on artificial intelligence, by receiving user behavior data, filtering the target model using a prediction model and preloading it, generating and processing business requests based on priority strategies, and determining whether the relevant model exists in the online model library. If it exists Inference processing is performed. If it does not exist, it will be loaded from the offline model library and inference processing is performed, and the model is scheduled and released when the capacity threshold is reached.
It improves the processing efficiency of business requests, reduces processing costs, realizes efficient utilization of edge computing resources, saves the cost of computing equipment, and realizes intelligent scheduling and collaborative operation of all models.
Smart Images

Figure CN119323481A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence development technology and financial technology, and in particular to a business request processing method, device, computer equipment and storage medium based on artificial intelligence. Background Art
[0002] In the field of marine aquaculture insurance, insurance companies are facing unprecedented challenges and complexities, which are mainly due to the unique nature of the aquaculture industry. As a major aquaculture country, my country has a wide range of aquaculture species, from traditional offshore aquaculture to emerging deep-sea smart fishery aquaculture, and production methods are becoming increasingly complex and diversified. However, this industry is extremely vulnerable to multiple factors such as natural disasters (such as typhoons and tsunamis), diseases and epidemics, and human operational errors, resulting in a significant increase in aquaculture risks. Therefore, when designing and implementing marine aquaculture policies, insurance companies must accurately assess and effectively cover these complex and changing risks.
[0003] With the advancement of science and technology, the deep-sea smart fishery farming system has emerged. The system integrates cutting-edge technologies such as the Internet, the Internet of Things, artificial intelligence, big data, cloud computing and edge computing, and realizes real-time monitoring, data analysis and intelligent decision-making of the farming environment, greatly improving the farming efficiency and risk management level. However, in the actual application of the deep-sea smart fishery farming system, due to the complexity and variability of the marine farming environment, multiple intelligent models are often required to work together to achieve comprehensive monitoring and prediction of different risk factors. If multiple intelligent models need to be frequently loaded and unloaded in memory, the response time of the system will be increased, resulting in inefficient business processing. In addition, due to the physical limitations of edge devices, in order to cope with the problem of insufficient computing resources, it may be necessary to purchase more edge processors, which in turn increases business processing costs and reduces the economic feasibility of the system. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a business request processing method, device, computer equipment and storage medium based on artificial intelligence, so as to solve the technical problems that in the actual application of the existing deep-sea smart fishery farming system, multiple intelligent models often need to be frequently loaded and unloaded in the memory, resulting in low business processing efficiency, and the physical limitations of the edge devices lead to increased business processing costs.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a service request processing method based on artificial intelligence, which adopts the following technical solution:
[0006] If a service request triggered by a user is received, the behavior data of the user is obtained;
[0007] Perform prediction processing on the behavior data based on the trained prediction model to obtain corresponding prediction demand results;
[0008] Filtering a target model corresponding to the predicted demand result from all pre-stored models, and pre-loading the target model in a preset online model library;
[0009] Generating a target priority corresponding to the service request based on a preset priority policy, and inserting the service request into a preset priority queue based on the target priority;
[0010] When the processing time of the service request arrives, extracting the service request from the priority queue;
[0011] Determine a relevant model corresponding to the business request, and determine whether the relevant model exists in the online model library;
[0012] If so, perform reasoning on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result;
[0013] The first inference result is returned to the user.
[0014] Furthermore, the step of preloading the target model in a preset online model library specifically includes:
[0015] Obtaining a target incremental loading strategy corresponding to the target model;
[0016] Determining a designated model portion corresponding to the target model based on the target incremental loading strategy;
[0017] Calling the online model library;
[0018] The designated model portion is loaded into the online model library.
[0019] Furthermore, the step of generating a target priority corresponding to the service request based on a preset priority policy specifically includes:
[0020] Obtaining a request time from the service request;
[0021] Calculate the corresponding waiting time based on the request time;
[0022] Determine whether the waiting time is greater than a preset time threshold;
[0023] If the waiting time is greater than the time threshold, setting the target priority of the service request to the first priority;
[0024] If the waiting time is less than the time threshold, determining whether the online model library contains all relevant models corresponding to the business request;
[0025] If all relevant models corresponding to the business request are included, the target priority of the business request is set to the second priority; otherwise, the target priority of the business request is set to the third priority.
[0026] Furthermore, the step of returning the first inference result to the user specifically includes:
[0027] Get the preset target response format;
[0028] Converting the first reasoning result based on the target response format to obtain a corresponding target reasoning result;
[0029] Determine the target presentation method;
[0030] Based on the target presentation mode, the target inference result is returned to the user.
[0031] Furthermore, after the step of determining the relevant model corresponding to the business request and judging whether the relevant model exists in the online model library, the method further includes:
[0032] If the relevant model does not exist in the online model library, loading the relevant model from a preset offline model library into the online model library;
[0033] Performing reasoning processing on the business request based on the relevant model in the online model library to obtain a corresponding second reasoning result;
[0034] The second inference result is returned to the user.
[0035] Furthermore, the artificial intelligence-based service request processing method further includes:
[0036] Determining whether the online model library has reached a preset capacity threshold;
[0037] If so, call the preset model to access the count table;
[0038] Processing the model access count table based on a least-used algorithm to filter out a first model with the least model access times from the online model library;
[0039] The first model is released in the online model library.
[0040] Furthermore, the artificial intelligence-based service request processing method further includes:
[0041] Obtain the last update time of the model access counts of all second models contained in the online model library;
[0042] Determine whether there is a specified last update time greater than a preset update time threshold among all the last update times;
[0043] If so, filtering out a third model corresponding to the specified last update time from all the second models;
[0044] The third model is transferred from the online model library to a preset offline model library.
[0045] In order to solve the above technical problems, the embodiment of the present application also provides a service request processing device based on artificial intelligence, which adopts the following technical solution:
[0046] A first acquisition module, configured to acquire the behavior data of a user upon receiving a service request triggered by the user;
[0047] A prediction module is used to perform prediction processing on the behavior data based on a trained prediction model to obtain corresponding prediction demand results;
[0048] A loading module, used to filter out a target model corresponding to the predicted demand result from all pre-stored models, and pre-load the target model in a preset online model library;
[0049] A generating module, configured to generate a target priority corresponding to the service request based on a preset priority strategy, and insert the service request into a preset priority queue based on the target priority;
[0050] An extraction module, configured to extract the service request from the priority queue when the processing time of the service request is reached;
[0051] A first judgment module, used to determine a relevant model corresponding to the business request, and to judge whether the relevant model exists in the online model library;
[0052] A first processing module, configured to perform reasoning processing on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result;
[0053] A first returning module is used to return the first inference result to the user.
[0054] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0055] If a service request triggered by a user is received, the behavior data of the user is obtained;
[0056] Perform prediction processing on the behavior data based on the trained prediction model to obtain corresponding prediction demand results;
[0057] Filtering a target model corresponding to the predicted demand result from all pre-stored models, and pre-loading the target model in a preset online model library;
[0058] Generating a target priority corresponding to the service request based on a preset priority policy, and inserting the service request into a preset priority queue based on the target priority;
[0059] When the processing time of the service request arrives, extracting the service request from the priority queue;
[0060] Determine a relevant model corresponding to the business request, and determine whether the relevant model exists in the online model library;
[0061] If so, perform reasoning on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result;
[0062] The first inference result is returned to the user.
[0063] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0064] If a service request triggered by a user is received, the behavior data of the user is obtained;
[0065] Perform prediction processing on the behavior data based on the trained prediction model to obtain corresponding prediction demand results;
[0066] Filtering a target model corresponding to the predicted demand result from all pre-stored models, and pre-loading the target model in a preset online model library;
[0067] Generating a target priority corresponding to the service request based on a preset priority policy, and inserting the service request into a preset priority queue based on the target priority;
[0068] When the processing time of the service request arrives, extracting the service request from the priority queue;
[0069] Determine a relevant model corresponding to the business request, and determine whether the relevant model exists in the online model library;
[0070] If so, perform reasoning on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result;
[0071] The first inference result is returned to the user.
[0072] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0073] If the present application receives a business request triggered by a user, the behavior data of the user is obtained; then the behavior data is predicted and processed based on the trained prediction model to obtain the corresponding prediction demand result; then the target model corresponding to the prediction demand result is screened out from all pre-stored models, and the target model is preloaded in the preset online model library; subsequently, a target priority corresponding to the business request is generated based on a preset priority strategy, and the business request is inserted into a preset priority queue based on the target priority; when the processing time of the business request is reached, the business request is extracted from the priority queue; further the relevant model corresponding to the business request is determined, and it is determined whether the relevant model exists in the online model library; if so, the business request is inferred based on the relevant model in the online model library to obtain the corresponding first inference result; finally, the first inference result is returned to the user. The present application receives a business request triggered by a user, and obtains a predicted demand result by using a prediction model to predict the obtained user behavior data, and then selects a target model corresponding to the predicted demand result from all pre-stored models and loads it into the online model library, so that when the business request is subsequently processed, the relevant model corresponding to the business request can be intelligently determined. If it is detected that the relevant model exists in the online model library, the business request is automatically and intelligently inferred based on the relevant model in the online model library to obtain the corresponding first inference result, and the first inference result is returned to the user. In this way, based on the use of the prediction model and the online model library, a processing solution is implemented that efficiently utilizes edge computing resources and saves the cost of computing equipment, realizes intelligent scheduling processing for all models, and then selects relevant models that match the business request triggered by the user on limited computing resources, and can realize collaborative operation based on relevant models to complete the inference processing of business requests, effectively improving the processing efficiency of business requests and reducing the processing cost of business requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0075] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0076] Figure 2 A flowchart of an embodiment of a method for processing business requests based on artificial intelligence according to the present application;
[0077] Figure 3 is a structural diagram of an embodiment of an artificial intelligence-based service request processing device according to the present application;
[0078] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0080] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0081] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0082] like Figure 1As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0083] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0084] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, the tablet computer 1012 or the mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, etc.
[0085] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0086] It should be noted that the artificial intelligence-based business request processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the artificial intelligence-based business request processing device is generally set in the server / terminal device.
[0087] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0088] Continue to refer Figure 2, showing a flowchart of an embodiment of a business request processing method based on artificial intelligence according to the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The business request processing method based on artificial intelligence provided in the embodiment of the present application can be applied to any scenario where request processing is required, and the business request processing method based on artificial intelligence can be applied to products in these scenarios, for example, business request processing in the financial insurance field. The business request processing method based on artificial intelligence includes the following steps:
[0089] Step S201: If a service request triggered by a user is received, the behavior data of the user is obtained.
[0090] In this embodiment, the service request processing method based on artificial intelligence runs on the electronic device (for example Figure 1 The server / terminal device shown in the figure) can obtain the user's behavior data through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (Ultra Wi DeBand) connection, and other wireless connection methods currently known or developed in the future. The present application can be applied to the deep-sea smart fishery farming system created by financial enterprises in the insurance field, and is used for the business scenario in which the edge control center of the deep-sea smart fishery farming system runs multiple models on limited computing resources to process the received business requests. Among them, the above-mentioned behavior data may at least include the user's historical data, user behavior data or time information, the historical data may include the historical request type or the model type used, the user behavior data may include activity, access model, and the time information may include the initiation time of the historical request.
[0091] Step S202: perform prediction processing on the behavior data based on the trained prediction model to obtain corresponding prediction demand results.
[0092] In this embodiment, the behavior data is predicted and processed by using a trained prediction model to predict the model that the user may need in the future, and the corresponding prediction demand result is output. Specifically, the process of building a prediction model may include: first, 1. Data preprocessing. Check and clean up errors, missing values and outliers in the historical behavior data collected in advance. Then select features that are useful for model prediction from the cleaned historical behavior data. For example, request time (including date, hour, day of the week, etc.), request type (or model type), request frequency, user behavior characteristics (such as activity, access mode, etc.). Then convert the features into a form suitable for model input. This may include numeralizing categorical variables (such as using unique hot encoding or label encoding), normalizing or standardizing numerical features, and processing time series data (such as sliding windows, differences, logarithmic transformations, etc.). 2. Model selection. First, determine that the prediction target is the demand probability of the prediction model, and then select a suitable prediction model based on the characteristics of the data and the complexity of the prediction problem. For time series data, you can choose ARIMA, seasonal ARIMA (SARIMA), exponential smoothing (such as HoltWinters), LSTM (long short-term memory network), etc. as the basic model of the prediction model. Alternatively, considering the user behavior characteristics, a hybrid model (such as a combination of time series and machine learning models) can be used as the basic model of the prediction model. 3. Model training. Divide the data set: Divide the preprocessed data set into training set, validation set, and test set. Usually, 70% of the data is used as the training set and 30% as the validation set. Then use the training set and validation set to train the model, and optimize the model parameters through methods such as cross-validation or grid search, and then obtain an accurate and practical prediction model, so that the prediction model can be used later to predict the demand for each model in the future.
[0093] Step S203, screening out a target model corresponding to the predicted demand result from all pre-stored models, and preloading the target model in a preset online model library.
[0094] In this embodiment, multiple models for providing services for requests are pre-built, and all models are stored for subsequent calls. Exemplarily, the above-mentioned model may specifically be an AI intelligent model used in the edge control center of the deep-sea smart fishery farming system. Among them, the above-mentioned predicted demand results correspond to the results of the models that are most likely to be used by users in the future. After obtaining the predicted demand results, the model that is most likely to be used, that is, the above-mentioned target model, can be screened out from all models in advance based on the predicted demand results, thereby improving the response speed of the system and user experience. In addition, the above-mentioned specific implementation process of preloading the target model in the preset online model library will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0095] Step S204: generating a target priority corresponding to the service request based on a preset priority policy, and inserting the service request into a preset priority queue based on the target priority.
[0096] In this embodiment, a priority queue is preferably constructed for storing pending requests. The specific implementation process of generating the target priority corresponding to the service request based on the preset priority strategy will be further described in detail in the subsequent specific embodiments of the present application, and will not be elaborated here.
[0097] Step S205: when the processing time of the service request arrives, extract the service request from the priority queue.
[0098] In this embodiment, after inserting the request into the priority queue according to the priority of the request, the priority queue will automatically sort the requests according to the priority and process the requests in descending order of priority. When the processing time of the service request is reached, the service request will be automatically extracted from the priority queue.
[0099] Step S206, determining the relevant model corresponding to the business request, and judging whether the relevant model exists in the online model library.
[0100] In this embodiment, a mapping relationship between a request and a required model is pre-stored, and a relevant model corresponding to the business request can be determined according to the mapping relationship.
[0101] Step S207: If yes, perform reasoning on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result.
[0102] In this embodiment, the business request is input into the relevant model already existing in the online model library, so as to perform reasoning processing on the business request through the relevant model and output a corresponding first reasoning result.
[0103] Step S208: Return the first inference result to the user.
[0104] In this embodiment, the specific implementation process of returning the first inference result to the user will be described in further detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0105] When receiving a business request triggered by a user, the present application uses a prediction model to predict the user's behavior data to obtain a predicted demand result, and then selects the target model corresponding to the predicted demand result from all pre-stored models and loads it into the online model library, so that when the business request is subsequently processed, the relevant model corresponding to the business request can be intelligently determined. If it is detected that the relevant model exists in the online model library, the business request will be automatically and intelligently inferred based on the relevant model in the online model library to obtain the corresponding first inference result, and the first inference result will be returned to the user. In this way, based on the use of the prediction model and the online model library, a processing solution is implemented that efficiently utilizes edge computing resources and saves the cost of computing equipment, realizes intelligent scheduling processing for all models, and then selects relevant models that match the business request triggered by the user on limited computing resources, and can realize collaborative operation based on relevant models to complete the inference processing of business requests, effectively improving the processing efficiency of business requests and reducing the processing cost of business requests.
[0106] In some optional implementations, the step of preloading the target model in a preset online model library in step S203 includes the following steps:
[0107] Obtain a target incremental loading strategy corresponding to the target model.
[0108] In this embodiment, for each pre-stored model, the architecture of each model is pre-analyzed to determine which model parts (such as layers, weights) are critical for common reasoning requests, and to identify model parts that can be loaded separately. Then, based on the results of the model architecture analysis, an incremental loading strategy is pre-established for each model to determine which model parts are only loaded when it is first loaded, and to ensure that the loaded model parts can cover most common reasoning scenarios and can efficiently load the rest when needed. In addition, the model loading logic can be modified based on the generated incremental loading strategy to support incremental loading. This can be achieved by writing a specific loading function or modifying the loading mechanism in an existing deep learning framework. In this way, when loading a model, only the necessary model parts are read from a file or storage system and loaded into memory.
[0109] A designated model portion corresponding to the target model is determined based on the target incremental loading strategy.
[0110] In this embodiment, the target incremental loading strategy may be subjected to content analysis to query the designated model portion corresponding to the target model.
[0111] The online model library is called.
[0112] In this embodiment, the online model library is a library that stores the models currently available in the memory.
[0113] The designated model portion is loaded into the online model library.
[0114] In this embodiment, the above-mentioned specified model part can be loaded into the online model library in the memory by using incremental loading technology.
[0115] The present application obtains the target incremental loading strategy corresponding to the target model; then determines the designated model part corresponding to the target model based on the target incremental loading strategy; then calls the online model library; and subsequently loads the designated model part into the online model library. The present application determines the designated model part corresponding to the target model according to the target incremental loading strategy, and then loads the designated model part into the online model library. During the use of the target model, only partial weights of the target model are loaded without loading the entire model, thereby effectively reducing memory usage and model loading time, which is beneficial to improving the processing efficiency of the target model, as well as improving the processing efficiency and processing intelligence of business requests.
[0116] In some optional implementations of this embodiment, the step S204 of generating a target priority corresponding to the service request based on a preset priority policy includes the following steps:
[0117] The request time is obtained from the service request.
[0118] In this embodiment, the above-mentioned priority strategy is a processing strategy corresponding to a pre-built priority controller. The priority controller consists of a relationship map and a wait map. The relationship map stores the relationship between the request and its required model. The wait map stores the waiting time of each request. And the priority rules corresponding to the priority controller include: if the waiting time of a request exceeds the preset time threshold, the priority of the request is the first priority, that is, the highest priority. In addition, if the relevant models of the request are all in the above-mentioned online model library, the priority of the request is the second priority, and the second priority represents a medium priority. The priority of the remaining requests except the above two cases is the third priority, and the third priority represents the lowest priority. In addition, when a request is executed, if all its related models are in the preset offline model library, these related models will be loaded into the memory.
[0119] In this embodiment, the corresponding request time may be extracted from the service request by parsing the service request information.
[0120] A corresponding waiting time is calculated based on the request time.
[0121] In this embodiment, if the service request is resubmitted or has existed before (such as waiting due to insufficient resources), the difference between the current time and the request time is calculated as the waiting time. If the service request is a new request, the waiting time can be initialized to 0.
[0122] Determine whether the waiting time is greater than a preset time threshold.
[0123] In this embodiment, there is no specific limitation on the selection of the value of the above time threshold, which can be set according to actual business needs, for example, it can be set to 60s.
[0124] If the waiting time is greater than the time threshold, the target priority of the service request is set to the first priority.
[0125] In this embodiment, based on the priority rule corresponding to the priority controller, if the waiting time is greater than the time threshold, the target priority of the service request is set to the first priority.
[0126] If the waiting time is less than the time threshold, it is determined whether the online model library contains all relevant models corresponding to the business request.
[0127] In this embodiment, the relationship mapping between the request and the model is traversed and the online model library is checked to determine whether the online model library contains all relevant models corresponding to the business request.
[0128] If all relevant models corresponding to the business request are included, the target priority of the business request is set to the second priority; otherwise, the target priority of the business request is set to the third priority.
[0129] In this embodiment, based on the priority rules corresponding to the above-mentioned priority controller, if the online model library contains all relevant models corresponding to the business request, the target priority of the business request is set to the second priority; if the online model library does not contain all relevant models corresponding to the business request, the target priority of the business request is set to the third priority.
[0130] The present application obtains the request time from the business request, calculates the corresponding waiting time based on the request time, and then analyzes the waiting time based on the use of the priority strategy. If the waiting time is greater than the preset time threshold, the target priority of the business request is set to the first priority. If the waiting time is less than the time threshold and the online model library contains all relevant models corresponding to the business request, the target priority of the business request is set to the second priority. Otherwise, the target priority of the business request is set to the third priority. Therefore, based on the use of the priority strategy, it is possible to quickly and accurately generate the target priority corresponding to the business request, thereby ensuring the data accuracy of the target priority of the business request.
[0131] In some optional implementations, step S208 includes the following steps:
[0132] Gets the preset target response format.
[0133] In this embodiment, there is no specific limitation on the selection of the above-mentioned target response format, which can be set according to actual response requirements, for example, it can include JSON, XML and other formats.
[0134] The first inference result is converted based on the target response format to obtain a corresponding target inference result.
[0135] In this embodiment, the inference result can be encapsulated into the above-mentioned target response format, thereby completing the conversion process of the first inference result and obtaining the corresponding target inference result.
[0136] Determine the target presentation method.
[0137] In this embodiment, there is no specific limitation on the selection of the above-mentioned target display mode, which can be set according to actual display needs, for example, it can include text display, voice display, chart display, etc.
[0138] Based on the target presentation mode, the target inference result is returned to the user.
[0139] In this embodiment, the target reasoning result can be presented to the user by adopting a target presentation method.
[0140] This application obtains a preset target response format; then converts and processes the first reasoning result based on the target response format to obtain a corresponding target reasoning result; then determines a target display method; and subsequently returns the target reasoning result to the user based on the target display method. After the application performs reasoning on the business request based on the relevant model in the online model library to obtain the corresponding first reasoning result, it will also intelligently convert and process the first reasoning result based on the obtained target response format to obtain a target reasoning result, and then return the target reasoning result to the user based on the target display method, thereby improving the standardization and intelligence of the reasoning result push, and is conducive to improving the user experience.
[0141] In some optional implementations, after step S206, the electronic device may further perform the following steps:
[0142] If the relevant model does not exist in the online model library, the relevant model is loaded into the online model library from a preset offline model library.
[0143] In this embodiment, the offline model library can be stored in a file system on a hard disk, and each model in the offline model library can be saved as a separate file or packaged into a library file. In order to quickly access, an index file or database table can be maintained to record the storage location and basic information of each model contained in the offline model library. In addition, the relevant model corresponding to the business request can be found from the offline model library, and then the relevant model in the offline model library can be loaded into the online model library.
[0144] The business request is inferred based on the relevant model in the online model library to obtain a corresponding second inference result.
[0145] In this embodiment, the business request is input into the relevant model loaded into the online model library, so that the business request is inferred through the relevant model and a corresponding second inference result is output.
[0146] The second inference result is returned to the user.
[0147] In this embodiment, the specific process of returning the second reasoning result to the user can refer to the above-mentioned process of returning the first reasoning result to the user, and will not be described in detail here.
[0148] If the present application detects that the relevant model does not exist in the online model library, the relevant model will be loaded from the preset offline model library into the online model library; then the business request will be inferred based on the relevant model in the online model library to obtain the corresponding second inference result; and the second inference result will be returned to the user. If the present application detects that the relevant model corresponding to the business request does not exist in the online model library, the relevant model will be intelligently loaded from the preset offline model library into the online model library; then the business request will be inferred based on the relevant model in the online model library to obtain the corresponding second inference result; and the second inference result will be returned to the user, thereby ensuring the smooth progress of the business request, which is beneficial to improving the user experience and improving the user's service satisfaction.
[0149] In some optional implementations of this embodiment, the electronic device may further perform the following steps:
[0150] It is determined whether the online model library has reached a preset capacity threshold.
[0151] In this embodiment, there is no specific limitation on the value of the capacity threshold, which can be processed according to actual business needs, for example, it can be set to 10.
[0152] If so, call the preset model to access the count table.
[0153] In this embodiment, a model access count table is pre-built to record the access count of each model. Whenever a model is loaded into the memory, the model access count of the model will increase by one.
[0154] The model access count table is processed based on a least-used algorithm to filter out a first model with the least model access times from the online model library.
[0155] In this embodiment, the implementation process of the least used algorithm may include: maintaining a priority queue based on model access counts, wherein the priority is determined by the inverse of the model access count (i.e., the lower the model access count, the higher the priority). When memory needs to be released, the model with the highest priority (i.e., the model with the lowest access count) is taken out from the priority queue.
[0156] The first model is released in the online model library.
[0157] In this embodiment, the selected first model may be removed from the online model library. In addition, some cleanup operations are performed, such as releasing resources (such as file handles, network connections, etc.) related to the first model.
[0158] The present application determines whether the online model library has reached a preset capacity threshold; if so, calls a preset model access count table; then processes the model access count table based on a least-used algorithm to filter out the first model with the least model access times from the online model library; and subsequently releases the first model from the online model library. If the present application detects that the online model library has reached a preset capacity threshold, it will intelligently call a preset model access count table, and process the model access count table based on a least-used algorithm to filter out the first model with the least model access times from the online model library, and then release the first model from the online model library to eliminate the least commonly used models in the online model library, thereby freeing up more memory space for the online model library and optimizing memory usage efficiency.
[0159] In some optional implementations of this embodiment, the electronic device may further perform the following steps:
[0160] The last update time of the model access counts of all second models contained in the online model library is obtained.
[0161] In this embodiment, a regularly executed time interval (such as daily or weekly) may be preset for offline analysis, i.e., detecting whether there are inactive models in the online model library. The last access time of all second models included in the online model library may be detected, i.e., the last update time of the model access count of the second model. An update time threshold may be set, such as when the last access time exceeds X days, to determine which models are considered to be inactive models that have not been used for a long time.
[0162] It is determined whether there is a designated last update time among all the last update times that is greater than a preset update time threshold.
[0163] In this embodiment, there is no specific limitation on the value of the update time threshold, which can be set according to actual business processing requirements.
[0164] If so, a third model corresponding to the specified last update time is selected from all the second models.
[0165] In this embodiment, the third model is a model among all the second models that has a matching relationship with the specified last update time.
[0166] The third model is transferred from the online model library to a preset offline model library.
[0167] In this embodiment, the transfer of the third model can be completed by moving the third model from the memory to an offline storage location, that is, the offline model library.
[0168] The present application obtains the last update time of the model access count of all the second models contained in the online model library; then determines whether there is a specified last update time greater than a preset update time threshold among all the last update times; if so, screens out a third model corresponding to the specified last update time from all the second models; and subsequently transfers the third model from the online model library to a preset offline model library. The present application obtains the last update time of the model access count of all the second models contained in the online model library. If it is detected that there is a specified last update time greater than a preset update time threshold among all the last update times, the third model corresponding to the specified last update time will be intelligently screened out from all the second models, and the third model will be transferred from the online model library to the preset offline model library, so that the infrequently used models in the online model library can be automatically and intelligently transferred to the offline model library, so that more memory space can be freed up for the online model library, and thus the memory usage efficiency can be effectively optimized.
[0169] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0170] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned first reasoning result, the above-mentioned first reasoning result can also be stored in a node of a blockchain.
[0171] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0172] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0173] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0175] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0176] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a service request processing device based on artificial intelligence. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0177] like Figure 3As shown, the business request processing device 300 based on artificial intelligence in this embodiment includes: a first acquisition module 301, a prediction module 302, a loading module 303, a generation module 304, an extraction module 305, a first judgment module 306, a first processing module 307 and a first return module 308. Among them:
[0178] The first acquisition module 301 is used to acquire the user's behavior data if a service request triggered by the user is received;
[0179] The prediction module 302 is used to perform prediction processing on the behavior data based on the trained prediction model to obtain corresponding prediction demand results;
[0180] A loading module 303 is used to filter out a target model corresponding to the predicted demand result from all pre-stored models, and pre-load the target model in a preset online model library;
[0181] A generating module 304, configured to generate a target priority corresponding to the service request based on a preset priority policy, and insert the service request into a preset priority queue based on the target priority;
[0182] An extraction module 305, configured to extract the service request from the priority queue when the processing time of the service request is reached;
[0183] A first determination module 306 is used to determine a relevant model corresponding to the business request, and determine whether the relevant model exists in the online model library;
[0184] A first processing module 307 is used to perform reasoning processing on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result;
[0185] The first returning module 308 is configured to return the first inference result to the user.
[0186] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0187] In some optional implementations of this embodiment, the loading module 303 includes:
[0188] A first acquisition submodule, used to acquire a target incremental loading strategy corresponding to the target model;
[0189] A first determination submodule, configured to determine a designated model portion corresponding to the target model based on the target incremental loading strategy;
[0190] A calling submodule, used for calling the online model library;
[0191] The loading submodule is used to load the specified model part into the online model library.
[0192] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0193] In some optional implementations of this embodiment, the generating module 304 includes:
[0194] A second acquisition submodule, used to obtain a request time from the service request;
[0195] A calculation submodule, used for calculating the corresponding waiting time based on the request time;
[0196] A first judgment submodule, used to judge whether the waiting time is greater than a preset time threshold;
[0197] A first setting submodule, configured to set the target priority of the service request to a first priority if the waiting time is greater than the time threshold;
[0198] A second judgment submodule is used to judge whether the online model library contains all relevant models corresponding to the business request if the waiting time is less than the time threshold;
[0199] The second setting submodule is used to set the target priority of the business request to the second priority if all relevant models corresponding to the business request are included, and otherwise set the target priority of the business request to the third priority.
[0200] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0201] In some optional implementations of this embodiment, the first returning module 308 includes:
[0202] The third acquisition submodule is used to obtain a preset target response format;
[0203] A conversion submodule, used for converting the first reasoning result based on the target response format to obtain a corresponding target reasoning result;
[0204] The second determination submodule is used to determine the target display mode;
[0205] The return submodule is used to return the target reasoning result to the user based on the target presentation mode.
[0206] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0207] In some optional implementations of this embodiment, the service request processing device based on artificial intelligence further includes:
[0208] A second processing module, configured to load the relevant model from a preset offline model library into the online model library if the relevant model does not exist in the online model library;
[0209] A third processing module, configured to perform reasoning processing on the business request based on the relevant model in the online model library to obtain a corresponding second reasoning result;
[0210] The second returning module is used to return the second inference result to the user.
[0211] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0212] In some optional implementations of this embodiment, the service request processing device based on artificial intelligence further includes:
[0213] A second judgment module is used to judge whether the online model library has reached a preset capacity threshold;
[0214] A calling module, used for calling a preset model access count table if yes;
[0215] A first screening module, configured to process the model access count table based on a least-used algorithm, so as to screen out a first model with the least model access times from the online model library;
[0216] A release module is used to release the first model in the online model library.
[0217] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0218] In some optional implementations of this embodiment, the service request processing device based on artificial intelligence further includes:
[0219] A second acquisition module, used to acquire the last update time of the model access counts of all second models contained in the online model library;
[0220] A third judgment module is used to judge whether there is a specified last update time greater than a preset update time threshold among all the last update times;
[0221] A second screening module, for, if yes, screening out a third model corresponding to the specified last update time from all the second models;
[0222] A transfer module is used to transfer the third model from the online model library to a preset offline model library.
[0223] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based business request processing method in the aforementioned implementation mode, and are not repeated here.
[0224] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0225] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0226] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0227] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of a business request processing method based on artificial intelligence. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0228] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the artificial intelligence-based business request processing method.
[0229] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0230] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned artificial intelligence-based business request processing method.
[0231] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0232] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A business request processing method based on artificial intelligence, characterized in that: The steps include: If a service request triggered by a user is received, the behavior data of the user is obtained; Perform prediction processing on the behavior data based on the trained prediction model to obtain corresponding prediction demand results; Filtering a target model corresponding to the predicted demand result from all pre-stored models, and pre-loading the target model in a preset online model library; Generating a target priority corresponding to the service request based on a preset priority policy, and inserting the service request into a preset priority queue based on the target priority; When the processing time of the service request arrives, extracting the service request from the priority queue; Determine a relevant model corresponding to the business request, and determine whether the relevant model exists in the online model library; If so, perform reasoning on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result; The first inference result is returned to the user.
2. The method for processing business requests based on artificial intelligence according to claim 1, characterized in that: The step of preloading the target model in a preset online model library specifically includes: Obtaining a target incremental loading strategy corresponding to the target model; Determining a designated model portion corresponding to the target model based on the target incremental loading strategy; Calling the online model library; The designated model portion is loaded into the online model library.
3. The method for processing business requests based on artificial intelligence according to claim 1, characterized in that: The step of generating a target priority corresponding to the service request based on a preset priority strategy specifically includes: Obtaining a request time from the service request; Calculate the corresponding waiting time based on the request time; Determine whether the waiting time is greater than a preset time threshold; If the waiting time is greater than the time threshold, setting the target priority of the service request to the first priority; If the waiting time is less than the time threshold, determining whether the online model library contains all relevant models corresponding to the business request; If all relevant models corresponding to the business request are included, the target priority of the business request is set to the second priority; otherwise, the target priority of the business request is set to the third priority.
4. The method for processing business requests based on artificial intelligence according to claim 1, characterized in that: The step of returning the first inference result to the user specifically includes: Get the preset target response format; Converting the first reasoning result based on the target response format to obtain a corresponding target reasoning result; Determine the target presentation method; Based on the target presentation mode, the target inference result is returned to the user.
5. The method for processing business requests based on artificial intelligence according to claim 1, characterized in that: After the steps of determining the relevant model corresponding to the business request and judging whether the relevant model exists in the online model library, the method further includes: If the relevant model does not exist in the online model library, loading the relevant model from a preset offline model library into the online model library; Performing reasoning processing on the business request based on the relevant model in the online model library to obtain a corresponding second reasoning result; The second inference result is returned to the user.
6. The method for processing business requests based on artificial intelligence according to claim 1, characterized in that: The artificial intelligence-based service request processing method further includes: Determining whether the online model library has reached a preset capacity threshold; If so, call the preset model to access the count table; Processing the model access count table based on a least-used algorithm to filter out a first model with the least model access times from the online model library; The first model is released in the online model library.
7. The method for processing business requests based on artificial intelligence according to claim 1, characterized in that: The artificial intelligence-based service request processing method further includes: Obtain the last update time of the model access counts of all second models contained in the online model library; Determine whether there is a specified last update time greater than a preset update time threshold among all the last update times; If so, filtering out a third model corresponding to the specified last update time from all the second models; The third model is transferred from the online model library to a preset offline model library.
8. A service request processing device based on artificial intelligence, characterized in that: include: A first acquisition module, configured to acquire the behavior data of a user upon receiving a service request triggered by the user; A prediction module is used to perform prediction processing on the behavior data based on a trained prediction model to obtain corresponding prediction demand results; A loading module, used to filter out a target model corresponding to the predicted demand result from all pre-stored models, and pre-load the target model in a preset online model library; A generating module, configured to generate a target priority corresponding to the service request based on a preset priority strategy, and insert the service request into a preset priority queue based on the target priority; An extraction module, configured to extract the service request from the priority queue when the processing time of the service request is reached; A first judgment module, used to determine a relevant model corresponding to the business request, and to judge whether the relevant model exists in the online model library; A first processing module, configured to perform reasoning processing on the business request based on the relevant model in the online model library to obtain a corresponding first reasoning result; A first returning module is used to return the first inference result to the user.
9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the business request processing method based on artificial intelligence as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the artificial intelligence-based business request processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Offline model application method, electronic equipment, storage medium and product
CN120032117A