Asynchronous AI reasoning method, device, equipment, medium and product

By adopting asynchronous methods and multi-threaded processing in the AI ​​inference platform, the problem of slow response speed of traditional synchronous inference platforms is solved, and parallel execution of inference tasks and log sending is realized, which improves the response speed and user experience.

CN119180337APending Publication Date: 2024-12-24STORAGEX TECHNOLOGY INC

Patent Information

Application Number
CN202411256647.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Traditional synchronous inference platforms are slow to respond when processing large amounts of data or long-term inference tasks, resulting in poor user experience.

Method used

The asynchronous AI inference method is adopted to simultaneously execute inference tasks and inference information sending tasks in different threads. Through asynchronous event loops and multi-threaded processing, the parallel execution of inference tasks and inference logs is realized.

Benefits of technology

It improves the response speed of the AI ​​inference platform, allowing users to view the inference progress and results in real time during the inference task, significantly improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180337A_ABST
    Figure CN119180337A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and particularly discloses an asynchronous AI reasoning method, device and equipment, a medium and a product, and the method comprises the steps: obtaining target data; the target data is uploaded to the AI reasoning platform by a user through a client; when a trigger operation of a user is received, establishing a target reasoning task and a reasoning information sending task for target data in different threads; the reasoning information sending task is used for acquiring and sending a reasoning log of the target reasoning task; and respectively running the target reasoning task and the reasoning information sending task in the different threads, and displaying a reasoning log of the target reasoning task on a display interface corresponding to the client. According to the scheme, an asynchronous method is used for executing the reasoning task, the platform does not block loading of other pages when the reasoning task is executed, reasoning result data can be checked in real time, and the reasoning response speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and specifically discloses an asynchronous AI reasoning method, device, equipment, medium and product. Background Art

[0002] An inference platform refers to a hardware and software system or architecture that supports the operation of model inference tasks. It usually includes computing resources, network interfaces, storage, model management tools, and APIs, etc., which are used to deploy and run machine learning models and provide external prediction services.

[0003] Traditional reasoning platforms use a synchronous web framework. Each task in the reasoning platform is reasoned synchronously, and only one task can be executed at a time. The next task can be executed after a task is completed, and other tasks can be performed after the reasoning task is completed. In other words, the reasoning information can only be sent to the user after the reasoning task is completed. If there is too much reasoning content and the reasoning time is long, the user needs to wait for a long time to obtain the relevant content of the reasoning, resulting in a slow response speed of the reasoning platform. Summary of the invention

[0004] In view of this, the present application provides an asynchronous AI reasoning method, device, equipment, medium and product, which improves the response speed of the AI ​​reasoning platform. The technical solution is as follows.

[0005] In a first aspect, an asynchronous AI reasoning method is provided, the method comprising:

[0006] Obtain target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client;

[0007] When a trigger operation is received from the user, a target reasoning task and a reasoning information sending task for the target data are established in different threads; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task;

[0008] The target reasoning task and the reasoning information sending task are respectively run in the different threads, and the reasoning log of the target reasoning task is displayed on the display interface corresponding to the client.

[0009] In a possible implementation, the reasoning information sending task includes a reasoning start log sending task and a reasoning end log sending task;

[0010] When a trigger operation is received from the user, a target reasoning task for the target data and a reasoning information sending task are established in different threads, including:

[0011] A target reasoning task is established in the first thread, a reasoning start log sending task is established in the second thread, and a reasoning end log sending task is established in the third thread.

[0012] In a possible implementation, respectively running the target reasoning task and the reasoning information sending task in the different threads, and displaying the reasoning log of the target reasoning task on a display interface corresponding to the client, includes:

[0013] Running the target reasoning task to identify the target data and generate the reasoning log;

[0014] Run the inference start log sending task to obtain the inference start log of the target inference task;

[0015] Run the inference completion log sending task to obtain the inference completion log of the target inference task;

[0016] The inference start log and the inference end log are sent to the client, so that the inference log of the target inference task is displayed on a display interface corresponding to the client.

[0017] In a possible implementation, when a trigger operation of a user is received, a target reasoning task for target data and a reasoning information sending task are established in different threads, including:

[0018] When receiving the trigger operation of the user, establishing an asynchronous event loop;

[0019] In the asynchronous event loop, the target reasoning task and the reasoning information sending task are set in different threads so that the target reasoning task and the reasoning information sending task are executed asynchronously.

[0020] In a possible implementation manner, the inference log data of the target inference task is shared among the different threads.

[0021] In a possible implementation, the client communicates with the AI ​​reasoning platform via WebSocket.

[0022] In a second aspect, an asynchronous AI reasoning device is provided, the device being arranged on an AI reasoning platform, the device comprising:

[0023] A data acquisition module, used to acquire target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client;

[0024] A task establishment module, which is used to establish a target reasoning task and a reasoning information sending task for target data in different threads when receiving a trigger operation from a user; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task;

[0025] The log generation module is used to respectively run the target reasoning task and the reasoning information sending task in the different threads, and display the reasoning log of the target reasoning task on the display interface corresponding to the client.

[0026] In a third aspect, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned asynchronous AI reasoning method.

[0027] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned asynchronous AI reasoning method.

[0028] In a fifth aspect, a computer program product or a computer program is provided, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned asynchronous AI reasoning method.

[0029] The technical solution provided by this application may have the following beneficial effects:

[0030] When the user uploads the target data to the AI ​​reasoning platform for reasoning through the client, the AI ​​reasoning platform will establish a target reasoning task and a reasoning information sending task for the target data in different threads, so that the target reasoning task and the reasoning information sending task are respectively run on different threads, and the reasoning log of the target reasoning task is pushed to the corresponding display interface of the client for display. The above scheme uses an asynchronous method to execute the reasoning task, so that the platform will not affect the execution of the reasoning log push task while executing the reasoning task, and the reasoning result data can be viewed in real time, thereby improving the response speed of reasoning. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 It is a structural diagram of an AI reasoning system according to an exemplary embodiment.

[0033] Figure 2 It is a method flow chart of an asynchronous AI reasoning method according to an exemplary embodiment.

[0034] Figure 3 It is a method flow chart of an asynchronous AI reasoning method according to an exemplary embodiment.

[0035] Figure 4 A flowchart of an inference task and inference log sending process involved in an embodiment of the present application is shown.

[0036] Figure 5 This is a schematic diagram of the structure of an asynchronous AI reasoning device provided in an embodiment of the present application.

[0037] Figure 6 It is a structural schematic diagram of a computer device provided by an optional embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0039] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.

[0040] Figure 1 FIG. 1 is a schematic diagram showing the structure of an AI reasoning system according to an exemplary embodiment. Figure 1 As shown, the AI ​​reasoning system includes a terminal device 110 and a server 120.

[0041] Optionally, the server 120 may be loaded with an AI reasoning platform, in which case the user may transmit the target data to the server 120 via a wired or wireless network through the terminal device 110, and the server 120 will process the target data through the AI ​​reasoning platform.

[0042] Optionally, the terminal device 110 can load the client corresponding to the AI ​​reasoning platform. At this time, the terminal device 110 can obtain the returned reasoning results from the server 120 through a wired or wireless network, and then display the reasoning results on a display component (such as a display screen) on the terminal device 110.

[0043] Optionally, the above-mentioned server can be a server cluster or a distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms and other technical computing services.

[0044] Optionally, the system may further include a management device, which is used to manage the system (such as managing the connection status between each module and the server, etc.), and the management device is connected to the server via a communication network. Optionally, the communication network is a wired network or a wireless network.

[0045] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any other network, including but not limited to any combination of local area network, metropolitan area network, wide area network, mobile, limited or wireless network, private network or virtual private network. In some embodiments, the technology and / or format including hypertext markup language, extensible markup language, etc. are used to represent the data exchanged through the network. In addition, conventional encryption technologies such as secure socket layer, transport layer security, virtual private network, Internet protocol security, etc. can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above-mentioned data communication technology.

[0046] Traditional reasoning platforms use a synchronous method to process reasoning tasks, which means that only one task can be executed at a time. The next task can only be carried out after a task is completed. This method has a slow response speed and poor user experience when processing large amounts of data or long-term reasoning tasks. To solve this problem, the new technology uses a multi-threaded asynchronous processing method, which allows reasoning tasks and reasoning log sending tasks to be executed in parallel, thereby improving the system's response speed. Figure 2is a method flow chart of an asynchronous AI reasoning method according to an exemplary embodiment. The method is executed by a computer device, which may be as follows Figure 1 The terminal device 110 or the server 120 in the AI ​​reasoning system shown. Figure 2 As shown, the method flow chart of the asynchronous AI reasoning method may include the following steps:

[0047] Step 201, obtain target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client.

[0048] The target data is uploaded by the user to the AI ​​inference platform through the client, where the target data can be the original data that needs to be inferred, such as pictures, text, or other forms of data.

[0049] Among them, an AI model is set in the AI ​​reasoning platform, and the AI ​​model can be a neural network model. The neural network model can reason (that is, recognize) the input data and finally obtain the recognition result.

[0050] Taking the field of industrial quality inspection as an example, users can upload pictures that require industrial quality inspection through the client running on the terminal device. At this time, the AI ​​inference platform running on the server can recognize the uploaded pictures and obtain the recognition results.

[0051] But generally speaking, the AI ​​reasoning platform needs to complete the image recognition before it can send the recognition result to the terminal device. The embodiment of the present application can use the following steps to ensure that during the image recognition process, whenever the AI ​​reasoning platform obtains the reasoning log, the reasoning log can be sent to the terminal device for display in a timely manner.

[0052] Step 202, when a trigger operation from the user is received, a target reasoning task and a reasoning information sending task for the target data are established in different threads; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task.

[0053] To achieve the above goals, after receiving the user's trigger operation (such as submitting a request), the system will create two tasks in different threads:

[0054] Target reasoning task: This task is responsible for processing the uploaded target data and performing actual reasoning work, such as model prediction.

[0055] Reasoning information sending task: This task is mainly responsible for real-time monitoring and recording the progress of reasoning tasks, and sending relevant reasoning logs to users.

[0056] In the method shown in step 202, multithreading is introduced to separate the reasoning task and the information sending task, allowing them to be performed simultaneously. This asynchronous operation helps to reduce waiting time, and the user can receive real-time reasoning progress information before the reasoning process is completely completed.

[0057] Step 203: Run the target reasoning task and the reasoning information sending task in the different threads respectively, and display the reasoning log of the target reasoning task on the display interface corresponding to the client.

[0058] At this time, the target inference task and the inference information sending task can be run separately in different threads. In this way, the inference task can focus on processing complex calculations, while the inference information sending task continues to push real-time inference logs to the client display interface.

[0059] In this way, users can view the inference progress in real time during the inference task, without having to wait until the entire inference task is completed to obtain information. Ultimately, this parallel processing mechanism significantly improves the response speed of the AI ​​inference platform and enhances the user experience.

[0060] In summary, when the user uploads the target data to the AI ​​reasoning platform for reasoning through the client, the AI ​​reasoning platform will establish target reasoning tasks and reasoning information sending tasks for the target data in different threads, so that the target reasoning tasks and reasoning information sending tasks are run on different threads respectively, and the reasoning log of the target reasoning task is pushed to the corresponding display interface of the client for display. The above scheme uses an asynchronous method to execute the reasoning task, so that the platform will not affect the execution of the reasoning log push task while executing the reasoning task, and the reasoning result data can be viewed in real time, thereby improving the response speed of reasoning.

[0061] Figure 3 is a method flow chart of an asynchronous AI reasoning method according to an exemplary embodiment. The method is executed by a computer device, which may be as follows Figure 1 The terminal device 110 or the server 120 in the AI ​​reasoning system shown. Figure 3 As shown, the method flow chart of the asynchronous AI reasoning method may include the following steps:

[0062] Step 301, obtain target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client.

[0063] This step is similar to step 201, and step 301 is still the starting point of the reasoning process. The user uploads the target data to the AI ​​reasoning platform through the client. This data may include content that needs to be reasoned, such as images, text, etc. The key to this step is the reliability and efficiency of data transmission. The client and the AI ​​reasoning platform can communicate through WebSocket, which can provide full-duplex, low-latency data transmission, further optimizing the efficiency and real-time performance of data acquisition.

[0064] Optionally, the client communicates with the AI ​​reasoning platform via WebSocket.

[0065] Step 302: When a trigger operation from the user is received, an asynchronous event loop is established.

[0066] In the embodiment of the present application, after receiving the user's trigger operation, the AI ​​reasoning platform establishes an asynchronous event loop. The asynchronous event loop is the center for managing the execution of asynchronous tasks. It runs continuously in the background, scheduling and executing suspended tasks, processing I / O operations, and switching to the next task at the appropriate time. It enables the program to perform non-blocking I / O operations, such as network requests, file reading and writing, etc.

[0067] The asynchronous event loop mechanism allows the system to process multiple tasks at the same time without blocking the entire system due to the waiting of a certain task. By introducing the asynchronous event loop, the system can use resources more efficiently and reduce response time.

[0068] Step 303, in the asynchronous event loop, the target reasoning task and the reasoning information sending task are set in different threads so that the target reasoning task and the reasoning information sending task are executed asynchronously; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task.

[0069] The inference log data of the target inference task is shared between the different threads.

[0070] In a possible implementation, the reasoning information sending task includes a reasoning start log sending task and a reasoning end log sending task. At this time, the AI ​​reasoning platform establishes a target reasoning task in the first thread, establishes a reasoning start log sending task in the second thread, and establishes a reasoning end log sending task in the third thread.

[0071] Further, the AI ​​reasoning platform runs the target reasoning task to identify the target data and generate the reasoning log;

[0072] The AI ​​inference platform runs the inference start log sending task and obtains the inference start log of the target inference task;

[0073] The AI ​​inference platform runs the inference completion log sending task and obtains the inference completion log of the target inference task;

[0074] The AI ​​reasoning platform then sends the reasoning start log and the reasoning end log to the client to display the reasoning log of the target reasoning task on the display interface corresponding to the client.

[0075] Please refer to Figure 4 , which shows a flow chart of a reasoning task and reasoning log sending process involved in an embodiment of the present application. Figure 4 As shown in the figure, the entire reasoning task is a synchronous reasoning task and cannot be directly added to the event loop to be executed asynchronously, because this will block the event loop. It is necessary to add it to the event loop in a multi-threaded manner so that it will not block the event loop and can be executed asynchronously.

[0076] However, in the inference task, there is a module for sending logs. This module needs to send logs to the front-end display in an asynchronous manner relative to the inference task. Otherwise, the logs can only be sent after the inference task is completed, which cannot achieve the purpose of viewing logs while inference. However, since the inference task itself is synchronous and the log module itself is asynchronous, the log module can be added to the event loop for asynchronous execution.

[0077] As described above, while executing the reasoning task, the user can also view the relevant log information of the reasoning task being processed in real time.

[0078] Step 304: Run the target reasoning task and the reasoning information sending task in the different threads respectively, and display the reasoning log of the target reasoning task on the display interface corresponding to the client.

[0079] The target reasoning task and the reasoning information sending task in different threads run in parallel. Due to the sharing of log data, the reasoning information sending task can send the reasoning log to the client in real time during and after the reasoning task is executed, and display it on the client's display interface, which not only improves the response speed of the platform, but also enables users to obtain timely information feedback at each key node of the reasoning process.

[0080] In the embodiment of the present application, an asynchronous web framework is used, and multithreading is used to execute synchronous reasoning tasks to avoid blocking the execution of the main event loop. Since WebSocket is used to send reasoning information, the WebSocket that comes with the asynchronous web framework is also used in the synchronous reasoning task. Since the WebSocket that comes with the asynchronous web framework is asynchronously programmed, it cannot be used directly in the synchronous reasoning task. At this time, an asynchronous library will be used to execute the asynchronous WebSocket separately in the synchronous task. Thereby, the asynchronous execution of reasoning tasks and the function of sending reasoning logs in real time are realized. And since the asynchronous method is used to execute reasoning tasks, the platform will not block the loading of other pages while the reasoning task is executed, and the result data of reasoning can be viewed in real time.

[0081] In summary, when the user uploads the target data to the AI ​​reasoning platform for reasoning through the client, the AI ​​reasoning platform will establish target reasoning tasks and reasoning information sending tasks for the target data in different threads, so that the target reasoning tasks and reasoning information sending tasks are run on different threads respectively, and the reasoning log of the target reasoning task is pushed to the corresponding display interface of the client for display. The above scheme uses an asynchronous method to execute the reasoning task, so that the platform will not affect the execution of the reasoning log push task while executing the reasoning task, and the reasoning result data can be viewed in real time, thereby improving the response speed of reasoning.

[0082] In the embodiments of the present application, an asynchronous AI reasoning device is also provided, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0083] The present application embodiment provides an asynchronous AI reasoning device, Figure 5 : is a schematic diagram of the structure of an asynchronous AI reasoning device provided in an embodiment of the present application, the device comprising:

[0084] The data acquisition module 501 is used to acquire target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client;

[0085] The task establishment module 502 is used to establish a target reasoning task and a reasoning information sending task for target data in different threads when a trigger operation of the user is received; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task;

[0086] The log generating module 503 is used to respectively run the target reasoning task and the reasoning information sending task in the different threads, and display the reasoning log of the target reasoning task on the display interface corresponding to the client.

[0087] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0088] The asynchronous AI reasoning device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0089] The embodiment of the present invention also provides a computer device having the above Figure 5 The asynchronous AI reasoning device shown.

[0090] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphic information in a graphical user interface on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0091] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0092] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0093] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0094] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0095] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0096] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0097] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0098] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the present invention.

Claims

1. An asynchronous AI reasoning method, characterized in that: The method is applied to an AI reasoning platform, and the method includes: Obtain target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client; When a trigger operation is received from the user, a target reasoning task and a reasoning information sending task for the target data are established in different threads; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task; The target reasoning task and the reasoning information sending task are respectively run in the different threads, and the reasoning log of the target reasoning task is displayed on the display interface corresponding to the client.

2. The method according to claim 1, characterized in that The reasoning information sending task includes a reasoning start log sending task and a reasoning end log sending task; When a trigger operation is received from the user, a target reasoning task for the target data and a reasoning information sending task are established in different threads, including: A target reasoning task is established in the first thread, a reasoning start log sending task is established in the second thread, and a reasoning end log sending task is established in the third thread.

3. The method according to claim 2, characterized in that The step of respectively running the target reasoning task and the reasoning information sending task in the different threads, and displaying the reasoning log of the target reasoning task on the display interface corresponding to the client, includes: Running the target reasoning task to identify the target data and generate the reasoning log; Run the inference start log sending task to obtain the inference start log of the target inference task; Run the inference completion log sending task to obtain the inference completion log of the target inference task; The inference start log and the inference end log are sent to the client, so that the inference log of the target inference task is displayed on a display interface corresponding to the client.

4. The method according to claim 1, characterized in that: When a trigger operation is received from the user, a target reasoning task for the target data and a reasoning information sending task are established in different threads, including: When receiving the trigger operation of the user, establishing an asynchronous event loop; In the asynchronous event loop, the target reasoning task and the reasoning information sending task are set in different threads so that the target reasoning task and the reasoning information sending task are executed asynchronously.

5. The method according to claim 4, characterized in that The different threads share the inference log data of the target inference task.

6. The method according to claim 5, characterized in that The client communicates with the AI ​​reasoning platform via WebSocket.

7. An asynchronous AI reasoning device, characterized in that: The device is arranged on an AI reasoning platform, and the device comprises: A data acquisition module, used to acquire target data; the target data is uploaded to the AI ​​reasoning platform by the user through the client; A task establishment module, which is used to establish a target reasoning task and a reasoning information sending task for target data in different threads when receiving a trigger operation from a user; the reasoning information sending task is used to obtain and send the reasoning log of the target reasoning task; The log generation module is used to respectively run the target reasoning task and the reasoning information sending task in the different threads, and display the reasoning log of the target reasoning task on the display interface corresponding to the client.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the asynchronous AI reasoning method according to any one of claims 1 to 7 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute any one of the asynchronous AI reasoning methods in claims 1 to 7.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the asynchronous AI reasoning method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for showing and querying logs in real time

    CN106294672A

  • Real-time asynchronous log collection method and system

    CN106598815A

  • Log collection method as well as device and equipment

    CN109309585A

  • Database data synchronous parallel execution method and device based on asynchronous submission

    CN109657007A

  • Log file generation method and device, computer equipment and storage medium

    CN111290919A

Cited By

  • Real-time distribution method, system and equipment for AI dialogue streams based on publishing and subscribing mode, medium and program product

    CN121567542A