Request processing method of AI model, computer equipment, medium and product

The unified encapsulation of the requests of the AI ​​model through the network request library solves the problem of increasing resource consumption by requesting and encapsulation of the AI ​​model and improving system performance and development efficiency.

CN118972431APending Publication Date: 2024-11-15ZHONGDIAN DATA IND CO LTD +1

Patent Information

Application Number
CN202411441648.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The request encapsulation of the AI ​​model increases the consumption of computing resources, memory resources and other resources, resulting in the impact of system operation performance.

Method used

The AI ​​model call requests sent by front-end applications are intercepted through the network request library and uniformly encapsulated according to the preset model interface specifications, reducing the unique interface requirements for each AI model and reducing code redundancy and resource consumption.

Benefits of technology

It improves the system operation performance, reduces development costs and maintenance difficulties, and realizes code reusability and efficient resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972431A_ABST
    Figure CN118972431A_ABST
Patent Text Reader

Abstract

The invention discloses a request processing method of an AI model, computer equipment, a medium and a product, and relates to the technical field of artificial intelligence, and the method comprises the steps: intercepting an AI model calling request sent by a front-end application through a network request library, packaging the AI model calling request through a network request library according to a preset target interface specification corresponding to a request calling model to obtain a target request, the request calling model being an AI model specified by the AI model calling request; the target request is sent to a request calling model through the network request library, the back-end server calls the request calling model according to the target request, data processing is carried out based on the target request through the request calling model, and a model processing result is obtained and returned; and receiving a model processing result through the network request library and forwarding the model processing result to the front-end application. According to the method, code redundancy is reduced, code reusability is improved, development cost and maintenance difficulty are reduced, and system operation performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a request processing method, computer equipment, medium and product of an AI model. Background Art

[0002] In front-end development, it is usually necessary to obtain back-end data or interact with third-party APIs (Application Programming Interfaces) through network requests. For interface requests of AI (Artificial Intelligence) models, since AI models usually require data input in a specific format, such as the transmission of large binary data packets (such as model weights, predicted images, etc.), in order to adapt to the unique interface requirements of each AI model, developers usually encapsulate specific requests for different API endpoints. This request encapsulation method increases the consumption of computing resources, memory resources, and other resources, resulting in system performance (such as response speed, stability, etc.) being affected.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide an AI model request processing method, computer equipment, medium and product, aiming to solve the technical problem that the request encapsulation of the AI ​​model increases resource consumption and affects the system performance.

[0005] To achieve the above purpose, the present application proposes a request processing method for an AI model, the request processing method for the AI ​​model is applied to a computer device, a network request library is deployed in the computer device, the network request library is communicatively connected with the AI ​​model, and the request processing method for the AI ​​model includes: The AI ​​model call request sent by the front-end application is intercepted by the network request library, and the AI ​​model call request is encapsulated by the network request library according to the preset target interface specification corresponding to the request call model to obtain a target request, wherein the request call model is the AI ​​model specified by the AI ​​model call request; The target request is sent to the request calling model through the network request library, wherein the request calling model performs data processing based on the target request to obtain a model processing result, and returns the model processing result to the network request library; The model processing result is received through the network request library, and the model processing result is sent to the front-end application through the network request library.

[0006] In one embodiment, after the step of sending the target request to the request calling model through the network request library, the request processing method of the AI ​​model further includes: Detecting whether the network request library receives the model processing result within a preset time after issuing the target request; If the network request library receives the model processing result within the preset time period, the step of sending the model processing result to the front-end application through the network request library is executed.

[0007] In one embodiment, the step of receiving the model processing result through the network request library and sending the model processing result to the front-end application through the network request library includes: Intercepting the model processing result through the response interceptor of the network request library; The model processing result is processed by the network request library according to the page interface specification of the front-end application to obtain a target processing result, and the target processing result is sent to the front-end application.

[0008] In one embodiment, the step of encapsulating the AI ​​model call request to obtain a target request according to a preset target interface specification corresponding to the request call model through the network request library includes: Determine, by the network request library, from a plurality of AI models, a request calling model specified by the AI ​​model calling request; The target interface specification corresponding to the request calling model is determined from the preset model interface specifications corresponding to different AI models, and the AI ​​model calling request is encapsulated according to the target interface specification through the network request library to obtain the target request.

[0009] In one embodiment, the AI ​​model call request specifies multiple request call models; The step of encapsulating the AI ​​model call request to obtain a target request according to a preset target interface specification corresponding to the request call model through the network request library includes: Parsing the AI ​​model call request to obtain the call order of the multiple request call models; Determine whether the current model of the multiple request calling models is the first calling model according to the calling order; If it is determined that the current model is the first calling model, the AI ​​model calling request is encapsulated by the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model; If the current model is not the first called model, the output result of the previous model is obtained through the network request library, and the AI ​​model call request and the output result of the previous model are encapsulated through the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model, wherein the output result of the previous model is the model processing result of the request calling model whose calling order is before the current model and adjacent to the current model.

[0010] In one embodiment, before the step of encapsulating the AI ​​model call request to obtain the target request according to the preset target interface specification corresponding to the request call model through the network request library, the request processing method of the AI ​​model further includes: Obtaining user identity information carried in the AI ​​model call request; When the user identity information is verified, the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request is executed.

[0011] In one embodiment, before the step of encapsulating the AI ​​model call request to obtain the target request according to the preset target interface specification corresponding to the request call model through the network request library, the request processing method of the AI ​​model further includes: Detecting, by the network request library, whether the AI ​​model call request is associated with a corpus; If the AI ​​model call request is not associated with the corpus, the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request is executed.

[0012] In one embodiment, after the step of detecting whether the AI ​​model call request is associated with a corpus, the AI ​​model request processing method further includes: If the AI ​​model call request is associated with the corpus, the AI ​​model call request is encapsulated by the network request library according to a preset corpus interface specification to obtain a corpus request; The corpus request is sent to the corpus through the network request library, wherein the corpus parses the corpus request to obtain a request resource identifier, and sends the corpus resource corresponding to the request resource identifier in the corpus to the request calling model, and the request calling model uses the corpus resource to perform data processing according to the target request to obtain a model processing result, and returns the model processing result to the network request library.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the request processing method of the AI ​​model as described above.

[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the request processing method of the AI ​​model as described above are implemented.

[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the request processing method of the AI ​​model as described above.

[0016] In the present application, the AI ​​model call request sent by the front-end application is intercepted by the network request library, and the AI ​​model call request is encapsulated by the network request library according to the preset target interface specification corresponding to the request call model to obtain a target request, wherein the request call model is the AI ​​model specified by the AI ​​model call request; the target request is sent to the request call model through the network request library, wherein the back-end server calls the request call model according to the target request, performs data processing based on the target request through the request call model to obtain a model processing result, and sends the target request to the request call model; the model processing result is received through the network request library, and the model processing result is sent to the front-end application through the network request library.

[0017] Compared with requesting and encapsulating each AI model separately according to the unique interface requirements of each AI model, this application uniformly receives AI model call requests sent by the front end through the network request library, and encapsulates them according to the preset model interface specifications. Developers only need to write a set of general encapsulation logic instead of writing specific encapsulation code for each model, which reduces code redundancy, improves code reusability, reduces development costs and maintenance difficulties, thereby reducing resource consumption and improving system operation performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flowchart of the first embodiment of the request processing method of the AI ​​model of this application; Figure 2 A flowchart diagram of the second embodiment of the request processing method of the AI ​​model of this application; Figure 3 A timing diagram of a request processing method of an AI model provided in one embodiment of the present application; Figure 4 A flowchart of a request processing method for an AI model provided in one embodiment of the present application; Figure 5 A flowchart of a request processing method for an AI model provided in one embodiment of the present application; Figure 6 This is a schematic diagram of the module structure of the request processing device of the AI ​​model in the embodiment of the present application; Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the request processing method of the AI ​​model in the embodiment of the present application.

[0021] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0022] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0023] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0024] The main solution of the embodiment of the present application is: intercepting the AI ​​model call request sent by the front-end application through the network request library, and encapsulating the AI ​​model call request according to the preset target interface specification corresponding to the request call model through the network request library to obtain a target request, wherein the request call model is the AI ​​model specified by the AI ​​model call request; sending the target request to the request call model through the network request library, wherein the request call model performs data processing based on the target request to obtain a model processing result, and returns the model processing result to the network request library; receiving the model processing result through the network request library, and sending the model processing result to the front-end application through the network request library.

[0025] In this embodiment, for ease of description, the following description is made with a computer device as the execution subject.

[0026] When the user performs certain operations on the front-end interface (such as clicking a button, entering data, etc.), the front-end application will generate corresponding requests (such as AI model call requests) and send them to the back-end server. After receiving these requests, the back-end server will send the data to the AI ​​model for processing, such as image recognition, natural language processing, etc. The back-end server will use the network request library to send the request to the AI ​​model. After the AI ​​model completes the processing, it will return the result to the back-end server, and the back-end server will send the result to the front-end application, ultimately responding to the user's request.

[0027] In front-end development, it is usually necessary to obtain back-end data or interact with third-party APIs through network requests. For interface requests of AI models, since AI models require data input in a specific format, including but not limited to specific JSON data structures and the transmission of large binary data packets (such as model weights, predicted images, etc.), in order to adapt to the unique interface requirements of each AI model, developers usually encapsulate specific requests for different API endpoints. This request encapsulation method increases the consumption of computing resources, memory resources and other resources, resulting in system performance (such as response speed, stability, etc.) being affected.

[0028] The network request libraries currently available on the market, such as axios, are powerful and widely used in front-end development, but they cannot directly support the interface request processing of AI models. This is mainly because AI models require data input in a specific format, including but not limited to data types, data structures, etc. These specific requirements are usually beyond the processing scope of general network request libraries, and the complexity of processing logic: AI model interface requests may involve complex logic processing, such as parameter encoding, parameter verification, data preprocessing, result parsing, etc. These processing steps may require specialized logic code to implement, while general network request libraries usually only provide basic request sending and response receiving functions.

[0029] The present application provides a solution. Compared with requesting and encapsulating each AI model separately according to the unique interface requirements of each AI model, the embodiment of the present application uniformly receives the AI ​​model call requests sent by the front end through a network request library, and encapsulates them according to the preset model interface specification. Developers only need to write a set of general encapsulation logic without having to write specific encapsulation code for each model, which reduces code redundancy, improves code reusability, reduces development costs and maintenance difficulties, thereby reducing resource consumption. In addition, the embodiment of the present application uniformly handles interface requests to facilitate subsequent maintenance of the interface, and the code is highly readable and easy to use.

[0030] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a computer device, etc. that can realize the above functions. The following takes a computer device as an example to illustrate this embodiment and the following embodiments. In this embodiment, the computer device can be a front-end device equipped with a front-end application, or a back-end server, or an electronic device that establishes communication connections with the front-end device and the back-end server respectively. There is no limitation here. A network request library is deployed in the computer device, and the network request library is connected to the AI ​​model for communication.

[0031] Based on this, the embodiment of the present application provides a request processing method for an AI model, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the request processing method of the AI ​​model of the present application.

[0032] In this embodiment, the request processing method of the AI ​​model includes steps S10 to S30: Step S10, intercepting the AI ​​model call request sent by the front-end application through the network request library, and encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain a target request, wherein the request call model is the AI ​​model specified by the AI ​​model call request; A network request library is a programming library that provides a set of APIs for sending and receiving network requests. Developers can use these APIs to easily implement communications over network protocols such as HTTP (HyperText Transfer Protocol) and HTTPS (HyperText Transfer Protocol Secure). Details: In Web (World Wide Web) development, commonly used network request libraries include Axios (JavaScript), Requests (Python), etc. These libraries usually support asynchronous requests, request interception, response interception and other functions, which can meet the various needs of developers during the development process.

[0033] It should be noted that AI model call requests refer to requests sent by front-end applications to back-end servers to call AI models for data processing. These requests usually contain the data that needs to be processed by the AI ​​model, the type of request (such as prediction, classification, etc.), and other necessary parameters. The request call model is the AI ​​model specified in the AI ​​model call request. The target interface specification is the preset model interface specification corresponding to the request call model. The model interface specification refers to a set of rules that define the data format, request method (such as GET, POST, etc.), request path, and other specifications for the AI ​​model to receive requests and return responses. These rules ensure that the communication between the front-end application and the AI ​​model can proceed smoothly. Different AI models may correspond to different preset model interface specifications. Developers customize the interface specifications according to actual needs, and there is no restriction here.

[0034] The computer device intercepts the AI ​​model call request sent by the front-end application through the network request library, and the network request library encapsulates the received original AI model call request according to the preset target interface specification of the AI ​​model. The encapsulation process may include data format conversion (such as conversion from JSON to a specific format), adding necessary request header information (such as authentication information, version information, etc.), and possible other processing, which can be set according to actual needs and interface specifications, and is not limited here. For example, in one feasible implementation, the computer device intercepts the AI ​​model call request from the front-end application through the network request library, and the network request library pre-processes the received request, such as verifying the validity of the request, parsing the request parameters, etc., and then the network request library completes the encapsulation of the AI ​​model call request by setting the request method, request path, request header and other operations.

[0035] It should be noted that by encapsulating according to the preset target interface specifications, it can be ensured that the requests sent by the front-end application can be correctly parsed and processed by the AI ​​model, thereby improving the compatibility and stability of the system. Through the automated encapsulation process, the request format errors or omissions caused by human factors are reduced.

[0036] In a feasible implementation manner, the step S10: encapsulating the AI ​​model call request to obtain a target request according to a preset target interface specification corresponding to the request call model through the network request library may include: Step S101, determining the request calling model specified by the AI ​​model calling request from the plurality of AI models through the network request library; The network request library can establish a communication connection with multiple AI models, and determine the request calling model specified by the AI ​​model call request from multiple AI models through the network request library. The specific process can be: parsing the AI ​​model call request to obtain the request calling model identifier, wherein the request calling model identifier is the model identifier corresponding to the request calling model, and the model identifier is the unique identifier of the AI ​​model; then determining the AI ​​model corresponding to the request calling model identifier from each AI model, and using the AI ​​model corresponding to the request calling model identifier as the request calling model.

[0037] It is understandable that with the continuous development of AI technology, more AI models may be introduced into the system in the future. When it is necessary to introduce a new AI model or replace an existing model, it is only necessary to update the model interface configuration in the network request library. There is no need to make large-scale changes to the system as a whole, which improves the flexibility and ease of maintenance of the system.

[0038] Step S102, determining the target interface specification corresponding to the request calling model from the preset model interface specifications corresponding to different AI models, and encapsulating the AI ​​model calling request according to the target interface specification through the network request library to obtain the target request.

[0039] Different AI models have different preset model interface specifications. After determining the request calling model, find the target interface specification corresponding to the request calling model from the preset target interface specifications corresponding to each AI model, and encapsulate the AI ​​model calling request according to the target interface specification.

[0040] It is understandable that by encapsulating the call request in accordance with the target interface specification, it is possible to ensure that the format and type of the request data are consistent with the expected input of the AI ​​model. This helps reduce errors and anomalies caused by data format mismatches and improves the stability and reliability of the system.

[0041] Step S20, sending the target request to the request calling model through the network request library, wherein the request calling model performs data processing based on the target request to obtain a model processing result, and returns the model processing result to the network request library; The encapsulated target request is sent to the request calling model through the network request library. The request calling model performs corresponding data processing operations, such as image recognition, natural language processing, etc., according to the received target request, and generates model processing results. After the processing is completed, the AI ​​model returns the result to the network request library. It can be understood that the target request may involve the use of at least one AI model. When the target request requires the collaboration of multiple AI models, the target request can be sent to each AI model separately.

[0042] The network request library provides efficient network communication capabilities, which can quickly send requests to the AI ​​model and receive processing results. In addition, the network request library usually supports asynchronous processing mechanisms, allowing the backend server to continue processing other tasks while waiting for the AI ​​model processing results, thereby improving the system's concurrent processing capabilities.

[0043] Step S30, receiving the model processing result through the network request library, and sending the model processing result to the front-end application through the network request library.

[0044] After receiving the model processing result returned by the request calling model, the network request library forwards it to the front-end application. In some feasible implementations, the model processing result may be processed or converted as necessary before forwarding to ensure that the front-end application can correctly parse and use these results.

[0045] In this embodiment, the front-end application can receive the processing results of the AI ​​model in real time, improving the user experience and the response speed of the application. From the front-end application initiating the request to receiving the processing results, a complete closed-loop process is formed, which improves the overall performance and reliability of the system.

[0046] In a feasible implementation manner, the step S30: receiving the model processing result through the network request library, and sending the model processing result to the front-end application through the network request library, includes: Step S301, intercepting the model processing result through the response interceptor of the network request library; It should be noted that the response interceptor is an important feature in the network request library, which allows developers to check, modify or execute other custom logic on the response data before the response data is actually processed or forwarded.

[0047] By intercepting through the response interceptor of the network request library, the response data can be flexibly processed without modifying the original request processing logic, making the system more easily adaptable to different business needs and scenario changes. In the response interceptor, users can cache, compress and process the response data to reduce the amount of data transmission and improve the system's response speed and performance.

[0048] Step S302: Process the model processing result according to the page interface specification of the front-end application through the network request library to obtain a target processing result, and send the target processing result to the front-end application.

[0049] After the response data is intercepted by the interceptor, the network request library processes the model processing results according to the page interface specifications of the front-end application. The specific data processing can be set according to actual needs and is not limited here. For example, it can include data format conversion, data screening, data aggregation and other operations to ensure that the processed data meets the display requirements of the front-end application. After the processing is completed, the network request library sends the target processing results obtained to the front-end application through the back-end server.

[0050] It is understandable that sending the model processing results to the front-end application is the last key link in the entire request processing process. However, directly sending the original processing results may not meet the display requirements of the front-end application, or may contain some unnecessary and sensitive information. Therefore, the response data can be intercepted and processed by the response interceptor before sending, and then the data is further processed according to the page interface specification of the front-end application to ensure that the data finally sent to the front-end application is accurate, valid and meets the requirements. This processing method helps to improve the overall performance and user experience of the system, and enhance the reliability and stability of the system.

[0051] In this embodiment, through the collaborative work of the back-end server and the network request library, seamless integration between the front-end application and the AI ​​model is achieved. The accuracy and security of the request are ensured through preset target interface specifications and automated encapsulation processing. The system's concurrent processing capability and response speed are improved through efficient network communication mechanisms and asynchronous processing capabilities. Ultimately, through real-time feedback and closed-loop process design, user experience and application reliability are improved.

[0052] Compared with requesting and encapsulating each AI model separately according to the unique interface requirements of each AI model, this embodiment uniformly receives the AI ​​model call requests sent by the front end through the network request library, and encapsulates them according to the preset model interface specification. Developers only need to write a set of general encapsulation logic without having to write specific encapsulation code for each model, which reduces code redundancy, improves code reusability, reduces development costs and maintenance difficulty, thereby reducing resource consumption. In addition, the embodiment of the present application uniformly handles interface requests to facilitate subsequent maintenance of the interface, and the code is highly readable and easy to use.

[0053] In one feasible implementation, after the step S20: sending the target request to the AI ​​model through the network request library, the request processing method of the AI ​​model further includes: Step S40, detecting whether the network request library receives the model processing result within a preset time after issuing the target request; It should be noted that the network request library sends a request to the AI ​​model and expects a response. The target request may fail to return the result on time due to various reasons (such as network delays, long AI model processing time, server failure, etc.). In this implementation, a timeout processing and response mechanism is introduced to improve the robustness of the system and user experience, and also ensure data consistency and smooth process.

[0054] Specifically, in this embodiment, a preset duration is set. The preset duration is the maximum time that the network request library waits for the AI ​​model to respond. The specific duration can be set according to actual needs and is not limited here.

[0055] If the network request library does not receive any model processing results from the AI ​​model within this preset time, one of two possible operations is performed: the network request library rejects the model processing results, or the network request library no longer forwards data to the front-end application after receiving the model processing results.

[0056] By setting a reasonable timeout threshold, users can be prevented from waiting for unresponsive pages or operations for a long time, thereby improving the responsiveness of the user interface and user experience. Suspended network resources (such as network connections, threads, etc.) can also be released in a timely manner to avoid unnecessary resource occupation and potential memory leaks.

[0057] Step S50, if the model processing result is received within the preset time period, the step of sending the model processing result to the front-end application is executed.

[0058] When the model processing results are received within the preset time, subsequent data forwarding work is performed to ensure that users can seamlessly receive the processing results of the AI ​​model within the normal request-response cycle, avoiding unnecessary data waiting time and processing delays, and improving the overall efficiency of the system.

[0059] For example, a user uploads a picture through a front-end application (such as a mobile phone APP or a web page), hoping that the system can recognize the objects or scenes in the picture and give the corresponding results. After the user uploads the picture, the front-end application sends a recognition request to the back-end AI model service through the network request library (such as an HTTP client). If the request may not receive a response within the preset time due to network delays, long AI model processing time, or excessive server load, the network request library will trigger a timeout processing mechanism. The network request library may close or interrupt the network connection with the AI ​​model to avoid resource occupation. The front-end application will receive a timeout notification and display a corresponding error message or loading prompt to inform the user that the request is being processed or has timed out; if the network request library successfully receives the response of the AI ​​model service within the preset time, that is, the image recognition result, the network request library will pass the response data received from the AI ​​model to the front-end application, and the front-end application will parse and process the response data, extract the image recognition result, and display the recognition result to the user in a friendly manner, such as directly displaying the recognized object name or scene description on the page.

[0060] In a feasible implementation manner, before the step S10: encapsulating the AI ​​model call request to obtain the target request through the network request library according to the preset target interface specification corresponding to the request call model, the request processing method of the AI ​​model further includes: Step S01, obtaining user identity information carried in the AI ​​model call request; The user identity information is obtained by parsing the AI ​​model call request. The user identity information can be any information that can uniquely identify the user, such as user name, user identification number, token, etc. This information is usually included in the request header, request body or URL parameters.

[0061] Step S02, when the user identity information is verified, execute the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request.

[0062] When the user identity information is verified, the network request library encapsulates the AI ​​model call request according to the preset target interface specification corresponding to the request call model to obtain the target request and perform subsequent processing.

[0063] It should be noted that the specific process of verifying the user's identity information is not limited here, and the conventional verification process can be referred to. For example, the verification process may include checking the validity of the user's identity information (such as whether the token has expired), whether the user exists in the system, whether the user has the authority to access the AI ​​model, etc.

[0064] It is understandable that by verifying the user's identity information, the system can implement a sophisticated permission control strategy. This helps prevent users from unauthorized access or performing unauthorized operations, protecting the integrity of the system and the confidentiality of data. If the user's identity information verification fails, the system can immediately reject the request, avoiding unnecessary resource consumption and the execution of subsequent processing steps, which helps optimize the system's workflow and improve overall performance.

[0065] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 The AI ​​model call request specifies multiple request call models in each of the AI ​​models, and the step S10: encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain a target request includes: Step S103, parsing the AI ​​model call request to obtain the call order of each of the multiple request call models; In this embodiment, the AI ​​model call request is parsed to obtain the call order of each request calling model. The process of parsing the AI ​​model call request to obtain the call order is not limited here. For example, in one feasible embodiment, the call request may include the call order specified by the user based on the human-computer interaction interface, and the call order can be obtained by extracting the information carried in the AI ​​model call request. For example, in another feasible embodiment, the call request may include the dependency relationship of data transmission between each model, and the call order relationship of each model is obtained by extracting the dependency relationship of data transmission between each model. The models are arranged according to the call order relationship between each model to obtain the call order. For example, the call request associates model A, model B and model C. The call request is parsed to obtain that the input of model A is the output of model B, and the input of model B is the output of model A. Then the call order of model A is third, the call order of model B is second, and the call order of model C is first.

[0066] Step S104, determining whether the current model of the multiple request calling models is the first calling model according to the calling order; It should be noted that the current model is the model currently traversed by the network request library among multiple request call models. The first call model refers to the model with the first call order among all request call models. The first call model is also a request call model that has no pre-dependencies on other models.

[0067] Step S105: if it is determined that the current model is the first calling model, the AI ​​model calling request is encapsulated according to the preset target interface specification corresponding to the current model through the network request library to obtain the target request corresponding to the current model; If it is determined that the current model is the first calling model, the calling order of the current model is determined to be the first, and the calling request is directly encapsulated according to the target interface specification corresponding to the model through the network request library to obtain the target request corresponding to the model.

[0068] Step S106: If the current model is not the first called model, the output result of the previous model is obtained through the network request library, and the AI ​​model call request and the output result of the previous model are encapsulated through the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model, wherein the output result of the previous model is the model processing result of the request calling model whose calling order is before the current model and adjacent to the current model.

[0069] It should be noted that the output result of the previous model is the model processing result of the request calling model that is before the current model and adjacent to the current model in the calling order. If the calling model is not the first calling model, it means that the current model depends on the output result of the previous model. The network request library encapsulates the output result of the previous model together with the original AI model calling request according to the target interface specification corresponding to the current model to obtain the target request corresponding to the current model.

[0070] It is understandable that an AI model call request may require the assistance of multiple request call models to complete, and there may be a calling order dependency between these models. By determining the target interface specification corresponding to each request call model, the calling order system can then call each request call model in an orderly manner. For models without pre-dependencies, the system directly encapsulates them; for models with pre-dependencies, the system first obtains the output result of the previous model, and then encapsulates it together with the call request. The system can convert complex AI model call requests into target requests that can be understood and processed by each request call model in the correct order and format.

[0071] For example, please refer to Figure 3 As shown in the timing diagram, when the AI ​​model call request specifies multiple request call models and there may be a call order dependency between these models, the data processing process from the first model to the last model is an orderly and step-by-step process, which can be: first, parse the AI ​​model call request sent by the front-end application to identify all specified request call models and their possible call orders; for each request call model, find and determine its corresponding target interface specification; for the request call model with the first call order, the network request library encapsulates the original AI model call request according to the target interface specification corresponding to the model to obtain the target request corresponding to the model, and sends the encapsulated target request to the first request call model (that is, request The network request library waits for and receives the model processing result of the first request calling model, encapsulates the obtained model processing result together with the original AI model calling request (or the modified request modified as needed) according to the target interface specification corresponding to the second model (that is, the request calling model 2), obtains a new target request, sends the encapsulated new target request to the second model for processing, waits for and receives the model processing result of the second model, and traverses each request calling model according to this process until all specified request calling models are processed in the calling order; the network request library may need to integrate or further process the response results of all models to generate the final output result.

[0072] For example, the intelligent customer service system of an e-commerce platform is connected to multiple AI models, including natural language processing (NLP) models, product information retrieval models, user behavior analysis models, etc., to support complex multi-round dialogue scenarios. When a user makes a query request, the system needs to call these models in a certain order and logic to gradually analyze the user's intention, query relevant information, and finally give a satisfactory answer. The user enters a query request through the chat interface, such as "I want to find a dress suitable for summer." In this scenario, the NLP model may be called first for intent recognition, then the product information retrieval model may be called for query, and finally the user behavior analysis model may need to be called to recommend personalized products. The specific model calling process can be: the system encapsulates the user's original request into a format that the NLP model can understand, and sends it to the NLP model for processing. The NLP model parses the user request, recognizes that the user's intention is to query the product, and extracts key information (such as "summer", "dress") as input for subsequent queries; the network request library receives the response result of the NLP model and obtains the user's query intention and key information; the network request library uses the key information extracted by the NLP model (such as "summer", "dress") as query conditions, encapsulates it into a format that the product information retrieval model can understand, and sends it to the model for query. The product information retrieval model searches the product database for information. The network request library retrieves the qualified product information and returns it to the network request library; the network request library receives the response result of the product information retrieval model and obtains the qualified product list; the network request library obtains the target request based on the product list and the call request encapsulation, and sends the target request to the user behavior analysis model. The user behavior analysis model processes the user behavior data, generates a personalized recommendation list, and returns it to the network request library. The network request library receives the response result of the user behavior analysis model, combines the result of the product information retrieval model, and generates the final recommendation list; the front-end application displays the final recommendation list to the user in a friendly way, such as sending product links, pictures and brief descriptions through the chat interface.

[0073] Based on the first and / or second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the first and / or second embodiments can be referred to the above description and will not be described in detail later. On this basis, before the step S10: encapsulating the AI ​​model call request by the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request, the request processing method of the AI ​​model also includes: Step A01, detecting whether the AI ​​model call request is associated with a corpus through the network request library; A corpus is a large text dataset used for tasks such as language analysis and model training in the field of natural language processing and artificial intelligence. It contains text data in various languages, on various topics, and in various styles. These data can be books, articles, news reports, social media posts, etc. When training a language model, the corpus provides a large amount of text data as input, allowing the model to learn the laws and characteristics of the language; when generating natural language responses, the corpus can be used as a reference or template to help the model generate more natural and fluent text. The corpus can also be used for a variety of natural language processing tasks such as sentiment analysis, named entity recognition, and machine translation.

[0074] It should be noted that the network request library is also connected to the corpus to detect whether the AI ​​model call request is associated with the corpus and determine whether the current call request needs to interact with the corpus.

[0075] Step A02, if the AI ​​model call request is not associated with the corpus, execute the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request.

[0076] If it is determined that the AI ​​model call request is not associated with the corpus, the network request library encapsulates the call request according to the preset target interface specification corresponding to the AI ​​model to obtain the target request.

[0077] It is understandable that in modern AI applications, different AI models may have different functions and requirements. Some models may directly rely on the corpus for tasks such as language analysis, text generation or knowledge reasoning, while other models may be completely independent of the corpus and only perform calculations and predictions through input parameters and internal algorithms. In order to support the flexible integration and expansion of different AI models, the system usually adopts a modular design approach. Each AI model is regarded as an independent module with its own interface specifications and data processing logic. The corpus is also regarded as an independent resource module, which can be called by different AI models as needed. When processing AI model call requests, the AI ​​model and corpus can be intelligently connected during the request processing according to actual needs, so that computer devices can process AI model call requests more intelligently and efficiently, thereby meeting the diverse needs in different application scenarios.

[0078] In one possible implementation, referring to Figure 4 After the step A01: detecting whether the AI ​​model call request is associated with a corpus, the AI ​​model request processing method further includes: Step A03: if the AI ​​model call request is associated with the corpus, the AI ​​model call request is encapsulated by the network request library according to a preset corpus interface specification to obtain a corpus request; The original AI model call request is encapsulated according to the preset corpus interface specification to generate a corpus request specifically used to interact with the corpus. The specific encapsulation process is not described here.

[0079] By encapsulating according to the corpus interface specification, it can be ensured that the generated corpus request can be correctly parsed and processed by the corpus, thereby improving the compatibility between systems.

[0080] Step A04, sending the corpus request to the corpus through the network request library, wherein the corpus parses the corpus request to obtain a request resource identifier, and sends the corpus resource corresponding to the request resource identifier in the corpus to the request calling model, and the request calling model uses the corpus resource to perform data processing according to the target request to obtain a model processing result, and returns the model processing result to the network request library.

[0081] The corpus request is sent to the corpus. After receiving the request, the corpus will parse the resource identifier and other information in the request, retrieve the corpus resources that match the request from its own storage, and return these resources to the AI ​​model that initiated the request.

[0082] It is understandable that with the support of the corpus, the AI ​​model can easily access and use a large amount of text data resources, which helps to improve the performance and accuracy of the model. As an independent resource module, the corpus can be expanded as the amount of data increases without modifying the AI ​​model itself, which helps to maintain the flexibility and scalability of the system.

[0083] Exemplarily, in the case where an AI model call request is associated with a corpus, the request transmission process may be: the front-end application initiates a call request to the AI ​​model to detect whether the call request is associated with a corpus; if it is detected that the call request is associated with a corpus, the original AI model call request is encapsulated through the network request library according to the preset corpus interface specification to generate a corpus request specifically for interacting with the corpus; the network request library sends the encapsulated corpus request to the corpus, and after receiving the request, the corpus parses the resource identifier and other information in the request, and retrieves the corpus resources that match the request from its own storage; the corpus sends the retrieved corpus resources to request the specified AI model; after receiving the corpus resources returned by the corpus, the AI ​​model uses the corpus resources to process and generate model processing results according to the tasks in the request; the AI ​​model returns the processing results to the network request library.

[0084] Exemplarily, when a user sends a question to the intelligent customer service system through the chat interface, such as: "What is the battery capacity of your company's latest mobile phone?"; after receiving the user's question, the intelligent customer service system generates an AI model call request, and the computer device requests detection to determine whether the request needs to be associated with a corpus. In this example, since the request involves detailed information about a specific product, the AI ​​model call request needs to be associated with a corpus containing product information. The network request library encapsulates the AI ​​model call request into a corpus request and sends it to the corpus according to the corpus interface specification corresponding to the corpus containing product information; after receiving the request, the corpus parses the parameters in the request, retrieves information related to "the battery capacity of the latest mobile phone" from its own storage, and returns it to the network request library; the network request library generates a target request based on the received corpus resources and the AI ​​model call request, and sends the target request to the request call model; the request call model outputs the model processing result according to the corpus resources and the AI ​​model call request and sends it to the network request library; the network request library returns the answer to the intelligent customer service, and the intelligent customer service system returns the answer generated by the AI ​​model to the user.

[0085] For example, to help understand the implementation process of the request processing method of the AI ​​model obtained by combining the above-mentioned embodiments 1, 2 and 3, please refer to Figure 5 , Figure 5 A brief flowchart of a request processing method for an AI model is provided, specifically: 1. Request configuration, the front-end page configures the AI ​​model call request.

[0086] 2. The request interceptor intercepts the request, intercepts the AI ​​model call request sent by the front-end application through the request interceptor of the network request library, and encapsulates the AI ​​model call request according to the preset target interface specification corresponding to the request call model through the network request library to obtain the target request. It should be noted that the AI ​​model interface request is encapsulated, and its interface is encapsulated according to the interface specification of the AI ​​model, including the agreement of request parameters, the parsing of return results, etc. On this basis, the corresponding API interface is designed to expose the corresponding calling method to the front-end developer. It should be noted that this embodiment uses the configuration file to manage the API interface specification, and uniformly processes the interface request, which is convenient for subsequent maintenance of the interface, the code is highly readable, and simple to use. In this embodiment, the axios library is used to encapsulate the network request, and the network request function provided by the axios library is used to realize the centralized processing of network requests. For the interface request of the AI ​​model, the request link, request header, request parameters, etc. are processed to generate a request body that meets the requirements, and the axios library is called to perform network request operations on it.

[0087] 3. Send a request. Send the target request to the request calling model through the network request library. The request calling model processes the data based on the target request to obtain the model processing result, and returns the model processing result to the network request library.

[0088] 4. Request cancellation, detect whether the network request library receives the model processing result within the preset time after issuing the target request; if the network request library receives the model processing result within the preset time, execute the step of sending the model processing result to the front-end application through the network request library; if the network request library receives the model processing result within the preset time, cancel the AI ​​model call request.

[0089] 5. Response interceptor, intercepts the model processing results through the response interceptor of the network request library.

[0090] 6. Process the response data (i.e., the model processing result) in the format required by the front-end page, and process the model processing result through the network request library according to the page interface specification of the front-end application to obtain the target processing result. It should be noted that in this embodiment, during the request sending process, the request parameters need to be preprocessed (such as parameter encoding, parameter formatting, parameter verification, etc.), and the returned results need to be parsed and processed.

[0091] 7. Return the response result and display the page. Send the target processing result to the front-end application.

[0092] This embodiment uses a promise-based network request library to encapsulate requests. The return value of the network request is returned in the form of a promise, which can flexibly deal with abnormal situations, has better compatibility, and is more in line with the writing of modern JavaScript.

[0093] This embodiment uses a configuration file to manage the API interface, and uniformly processes the interface requests, which facilitates subsequent maintenance of the interface. The code is highly readable and easy to use.

[0094] The interception in this embodiment is divided into two categories: before the request interface and after the request interface. The interception before the request interface allows the user to modify the parameters, etc. The interception after the request interface can facilitate the user to process the returned data and display / prompt normal and abnormal data.

[0095] In this embodiment, for some interface requests, when a certain threshold is reached and no data is returned, it can be considered that the request is abnormal and needs to be terminated in time, which can save server resources and improve user experience.

[0096] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the request processing method of the AI ​​model of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0097] This application also provides a request processing device for an AI model, please refer to Figure 6 , the request processing device of the AI ​​model is deployed on a computer device, a network request library is deployed in the computer device, the network request library is communicatively connected with the AI ​​model, and the request processing device of the AI ​​model includes: The encapsulation module 10 is used to intercept the AI ​​model call request sent by the front-end application through the network request library, and encapsulate the AI ​​model call request according to the preset target interface specification corresponding to the request call model through the network request library to obtain a target request, wherein the request call model is the AI ​​model specified by the AI ​​model call request; A sending module 20, configured to send the target request to the request calling model through the network request library, wherein the request calling model performs data processing based on the target request to obtain a model processing result, and returns the model processing result to the network request library; The receiving module 30 is used to receive the model processing result through the network request library, and send the model processing result to the front-end application through the network request library.

[0098] Optionally, the request processing device of the AI ​​model is also used for: Detecting whether the network request library receives the model processing result within a preset time after issuing the target request; If the network request library receives the model processing result within the preset time period, the step of sending the model processing result to the front-end application through the network request library is executed.

[0099] Optionally, the receiving module 30 is further used for: Intercepting the model processing result through the response interceptor of the network request library; The model processing result is processed by the network request library according to the page interface specification of the front-end application to obtain a target processing result, and the target processing result is sent to the front-end application.

[0100] Optionally, the encapsulation module 10 is further used for: Determine, by the network request library, from a plurality of AI models, a request calling model specified by the AI ​​model calling request; The target interface specification corresponding to the request calling model is determined from the preset model interface specifications corresponding to different AI models, and the AI ​​model calling request is encapsulated according to the target interface specification through the network request library to obtain the target request.

[0101] Optionally, the AI ​​model call request specifies multiple request call models; the encapsulation module 10 is further used to: Parsing the AI ​​model call request to obtain the call order of the multiple request call models; Determine whether the current model of the multiple request calling models is the first calling model according to the calling order; If it is determined that the current model is the first calling model, the AI ​​model calling request is encapsulated by the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model; If the current model is not the first called model, the output result of the previous model is obtained through the network request library, and the AI ​​model call request and the output result of the previous model are encapsulated through the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model, wherein the output result of the previous model is the model processing result of the request calling model whose calling order is before the current model and adjacent to the current model.

[0102] Optionally, the request processing device of the AI ​​model is also used for: Obtaining user identity information carried in the AI ​​model call request; When the user identity information is verified, the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request is executed.

[0103] Optionally, the request processing device of the AI ​​model is also used for: Detecting, by the network request library, whether the AI ​​model call request is associated with a corpus; If the AI ​​model call request is not associated with the corpus, the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request is executed.

[0104] Optionally, the request processing device of the AI ​​model is also used for: If the AI ​​model call request is associated with the corpus, the AI ​​model call request is encapsulated by the network request library according to a preset corpus interface specification to obtain a corpus request; The corpus request is sent to the corpus through the network request library, wherein the corpus parses the corpus request to obtain a request resource identifier, and sends the corpus resource corresponding to the request resource identifier in the corpus to the request calling model, and the request calling model uses the corpus resource to perform data processing according to the target request to obtain a model processing result, and returns the model processing result to the network request library.

[0105] The request processing device of the AI ​​model provided in the present application adopts the request processing method of the AI ​​model in the above-mentioned embodiment, which can solve the technical problem that the request encapsulation of the AI ​​model increases resource consumption and affects the system performance. Compared with the prior art, the beneficial effects of the request processing device of the AI ​​model provided in the present application are the same as the beneficial effects of the request processing method of the AI ​​model provided in the above-mentioned embodiment, and the other technical features in the request processing device of the AI ​​model are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0106] The present application provides a computer device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the request processing method of the AI ​​model in the above-mentioned embodiment one.

[0107] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer device suitable for implementing the embodiments of the present application. The computer device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Figure 7As shown, the computer device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the computer device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the computer device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a computer device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0109] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0110] The computer device provided by the present application adopts the request processing method of the AI ​​model in the above embodiment, which can solve the technical problem that the request encapsulation of the AI ​​model increases resource consumption and affects the system performance. Compared with the prior art, the beneficial effects of the computer device provided by the present application are the same as the beneficial effects of the request processing method of the AI ​​model provided by the above embodiment, and the other technical features in the computer device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0111] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0112] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0113] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the request processing method of the AI ​​model in the above-mentioned embodiment.

[0114] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0115] The computer-readable storage medium may be included in the computer device; or may exist independently without being installed in the computer device.

[0116] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a computer device, the computer device executes the steps of the above embodiments.

[0117] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0120] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the request processing method of the above-mentioned AI model, and can solve the technical problem that the request encapsulation of the AI ​​model increases resource consumption and affects system performance. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the request processing method of the AI ​​model provided in the above-mentioned embodiment, and will not be repeated here.

[0121] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the request processing method of the AI ​​model as described above.

[0122] The computer program product provided by the present application can solve the technical problem that the request encapsulation of the AI ​​model increases resource consumption and affects the system performance. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the request processing method of the AI ​​model provided by the above embodiment, which will not be repeated here.

[0123] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A request processing method for an AI model, characterized in that: The request processing method of the AI ​​model is applied to a computer device, a network request library is deployed in the computer device, the network request library is communicatively connected with the AI ​​model, and the request processing method of the AI ​​model includes: The AI ​​model call request sent by the front-end application is intercepted by the network request library, and the AI ​​model call request is encapsulated by the network request library according to the preset target interface specification corresponding to the request call model to obtain a target request, wherein the request call model is the AI ​​model specified by the AI ​​model call request; The target request is sent to the request calling model through the network request library, wherein the request calling model performs data processing based on the target request to obtain a model processing result, and returns the model processing result to the network request library; The model processing result is received through the network request library, and the model processing result is sent to the front-end application through the network request library.

2. The AI ​​model request processing method according to claim 1, characterized in that: After the step of sending the target request to the request calling model through the network request library, the request processing method of the AI ​​model further includes: Detecting whether the network request library receives the model processing result within a preset time after issuing the target request; If the network request library receives the model processing result within the preset time period, the step of sending the model processing result to the front-end application through the network request library is executed.

3. The request processing method of the AI ​​model according to claim 1, characterized in that: The step of receiving the model processing result through the network request library and sending the model processing result to the front-end application through the network request library includes: Intercepting the model processing result through the response interceptor of the network request library; The model processing result is processed by the network request library according to the page interface specification of the front-end application to obtain a target processing result, and the target processing result is sent to the front-end application.

4. The AI ​​model request processing method according to claim 1, characterized in that: The step of encapsulating the AI ​​model call request to obtain a target request according to a preset target interface specification corresponding to the request call model through the network request library includes: Determine, by the network request library, from a plurality of AI models, a request calling model specified by the AI ​​model calling request; The target interface specification corresponding to the request calling model is determined from the preset model interface specifications corresponding to different AI models, and the AI ​​model calling request is encapsulated according to the target interface specification through the network request library to obtain the target request.

5. The AI ​​model request processing method according to claim 1, characterized in that: The AI ​​model calling request specifies multiple requested calling models; The step of encapsulating the AI ​​model call request to obtain a target request according to a preset target interface specification corresponding to the request call model through the network request library includes: Parsing the AI ​​model call request to obtain the call order of the multiple request call models; Determine whether the current model of the multiple request calling models is the first calling model according to the calling order; If it is determined that the current model is the first calling model, the AI ​​model calling request is encapsulated by the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model; If the current model is not the first called model, the output result of the previous model is obtained through the network request library, and the AI ​​model call request and the output result of the previous model are encapsulated through the network request library according to the preset target interface specification corresponding to the current model to obtain the target request corresponding to the current model, wherein the output result of the previous model is the model processing result of the request calling model whose calling order is before the current model and adjacent to the current model.

6. The AI ​​model request processing method according to claim 1, characterized in that: Before the step of encapsulating the AI ​​model call request to obtain the target request according to the preset target interface specification corresponding to the request call model through the network request library, the request processing method of the AI ​​model also includes: Obtaining user identity information carried in the AI ​​model call request; When the user identity information is verified, the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request is executed.

7. The request processing method of the AI ​​model according to any one of claims 1 to 6, characterized in that: Before the step of encapsulating the AI ​​model call request to obtain the target request according to the preset target interface specification corresponding to the request call model through the network request library, the request processing method of the AI ​​model also includes: Detecting, by the network request library, whether the AI ​​model call request is associated with a corpus; If the AI ​​model call request is not associated with the corpus, the step of encapsulating the AI ​​model call request through the network request library according to the preset target interface specification corresponding to the request call model to obtain the target request is executed.

8. The AI ​​model request processing method according to claim 7, characterized in that: After the step of detecting whether the AI ​​model call request is associated with a corpus, the AI ​​model request processing method further includes: If the AI ​​model call request is associated with the corpus, the AI ​​model call request is encapsulated by the network request library according to a preset corpus interface specification to obtain a corpus request; The corpus request is sent to the corpus through the network request library, wherein the corpus parses the corpus request to obtain a request resource identifier, and sends the corpus resource corresponding to the request resource identifier in the corpus to the request calling model, and the request calling model uses the corpus resource to perform data processing according to the target request to obtain a model processing result, and returns the model processing result to the network request library.

9. A computer device, characterized in that: The computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the request processing method of the AI ​​model as described in any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the request processing method of the AI ​​model as described in any one of claims 1 to 8 are implemented.

11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the request processing method of the AI ​​model as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Implementation system for remotely calling service framework

    CN110287040A

  • Service operation method and device based on micro-service architecture, platform and storage medium

    CN110489181A

  • Data processing method and device, computer equipment and storage medium

    CN113641337A

  • Processing method and device based on neural network model, equipment and storage medium

    CN114116051A

  • Task processing method, system and platform and automatic question answering method

    CN116431316A

Cited By

  • Decoration design drawing acquisition method and device, electronic equipment and storage medium

    CN119848990A

  • Method and device for intelligently processing network request, electronic equipment and system

    CN120499270A

  • AI component calling method and device, medium and computer program product

    CN120909681A

  • Artificial intelligence component invocation method, device, medium, and computer program product

    CN120909681B