Method for recording and viewing model operation logs of machine learning platform, computer device, medium and program product

By generating a model task identifier in the machine learning platform and using sub-processes or sub-threads to record logs, the problem of low log viewing efficiency in the existing technology is solved, real-time independent viewing of model operation logs and rapid problem location are achieved, thereby improving the efficiency of problem troubleshooting.

CN118394593BActive Publication Date: 2025-09-30YGSOFT INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410457362.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2025-09-30
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

Existing machine learning platforms have defects such as low efficiency and inability to accurately locate problems when viewing model operation logs. They are unable to view and independently record the logs of a single model operation task in real time, resulting in high time and cost for problem troubleshooting.

Method used

By generating a model task identifier and using sub-processes or sub-threads to record the log information of the model running task, the log is returned to the user end in real time. It supports labeling logs by problem type and provides real-time viewing and downloading functions.

Benefits of technology

It enables real-time independent viewing of model operation logs, improves the efficiency of problem troubleshooting, and makes it easier for developers and business personnel to quickly locate and handle code, data, or environment anomalies, reducing troubleshooting time and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394593B_ABST
    Figure CN118394593B_ABST
Patent Text Reader

Abstract

The present invention provides a method for recording and viewing a model operation log of a machine learning platform, a computer device, a medium, and a program product, wherein the method includes: obtaining a model operation task; generating a model task identifier corresponding to the model operation task; determining whether to execute the model operation task and record a task log in a sub-process operation mode or a sub-thread operation mode according to a model operation parameter of the model operation task; returning the first task log information or the second task log information to a user end in real time; the method also includes sending the model operation task to a server end; obtaining a plurality of task log information and the model task identifier corresponding to the model operation task from the server end; and determining the target task log information corresponding to the model operation task based on the obtained model task identifier. The present invention enables real-time and independent viewing of task log information of the execution of the model operation task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for recording and viewing a model operation log of a machine learning platform, a computer device, a medium, and a program product. Background Art

[0002] Current machine learning platforms have some problems when viewing model operation logs in model deployment and model service modules: (1) After model development is completed, data is called for model testing. If the model fails to run, the problem needs to be troubleshooted based on the model operation log. However, existing technologies do not support real-time log viewing. Log files need to be retrieved from the database and then distributed to algorithm engineers and business personnel to help find the problem, which increases the time cost of troubleshooting and is inefficient. (2) When calling a model in a machine learning platform, the model may fail to run due to model code problems or data problems, which requires troubleshooting based on the real-time log of the run. However, the logs provided by existing technologies are basically global and cannot be recorded according to a single model run task. It is impossible to accurately locate the problem, which brings great inconvenience to the application of the model.

[0003] Since logs are global, they cannot be separated according to individual running tasks. Problems need to be analyzed from the global logs. Therefore, it is impossible to view logs in real time to understand and analyze the real-time status of model operation. You need to wait until the model is completed before downloading logs from the server for analysis and problem finding. Summary of the Invention

[0004] The first object of the present invention is to provide a method for recording and viewing model operation logs of a machine learning platform that enables real-time and independent viewing of logs of model operation tasks.

[0005] The second object of the present invention is to provide another method for recording and viewing the model operation log of a machine learning platform that enables real-time and independent viewing of the log of the model operation task.

[0006] The third object of the present invention is to provide a computer device that implements the method of recording and viewing the model operation log of the above-mentioned machine learning platform.

[0007] The fourth object of the present invention is to provide a computer-readable storage medium that implements the method of recording and viewing the model operation log of the above-mentioned machine learning platform.

[0008] The fifth object of the present invention is to provide a computer program product that implements the method of recording and viewing the model operation log of the above-mentioned machine learning platform.

[0009] In order to achieve the above-mentioned first purpose, the present invention provides a method for recording and viewing the model operation log of a machine learning platform, which is applied to the server side, and includes the following steps: obtaining a model operation task; generating a model task identifier corresponding to the model operation task; determining whether to execute the model operation task and record the task log in a sub-process operation mode or a sub-thread operation mode according to the model operation parameters of the model operation task; wherein, when executing the model operation task and recording the task log in a sub-process operation mode, it includes: recording the model task identifier to the model operation parameters; creating a sub-process for executing the model execution task, executing the sub-process, and executing the sub-process includes : Create a sub-process logger, record the first task log information through the sub-process logger and associate the first task log information with the model task identifier obtained from the model running parameters and save it to the global log manager; wherein, when executing the model running task and recording the task log in the sub-thread running mode, it includes: recording the model task identifier in the current thread; creating a sub-thread for executing the model execution task, and then executing the sub-thread, when executing the sub-thread, it includes: creating a sub-thread logger, recording the second task log information through the sub-thread logger and associate the second task log information with the model task identifier obtained from the current thread and save it to the global log manager; returning the first task log information or the second task log information to the user end in real time.

[0010] It can be seen from the above scheme that the present invention generates a unique model task identifier for the acquired model running task, and determines to record the task log information related to the current model running task through a sub-process or sub-thread according to the model running parameters, so as to realize the recording of task log information separately according to the specific model running task, solve the problem that the existing model running log and system log are confused in one file, and the recorded log is returned to the user end in real time, which is convenient for the user end to view the task log information in real time, and is convenient for developers or business personnel to discover problems in time and adjust model parameters or perform data preprocessing and other operations.

[0011] A further solution is, after determining the execution of the model running task and the recording of the task log in the sub-process running mode or the sub-thread running mode according to the model running parameters, it includes: marking the first task log information or the second task log information according to a preset problem classification type, and the problem classification type includes an abnormal log type and a normal log type.

[0012] A further solution is that the exception log type includes at least one of the following: a code exception log type, a data exception log type, and an environment exception log type.

[0013] It can be seen that compared with the existing model service log system, which does not classify and record according to the problem type, and needs to read the entire log content line by line when troubleshooting, the present invention marks the recorded task log information according to the preset problem classification type, which can locate the problem very conveniently and quickly. For example, a certain field type of the data does not meet the requirements, or there is a problem with a certain line of code in the model code file, etc., can be quickly and accurately located in the task log information, and then the problem can be conveniently moved to the user end of different personnel for processing. For example, data problems can be solved by business personnel, environmental problems can be solved by implementation personnel, and code problems can be solved by developers.

[0014] A further solution is that when determining whether to execute the model running task and record the task log in the sub-process running mode or the sub-thread running mode based on the model running parameters, the following steps are included: using the model task identifier as the name of the log file in which the first task log information or the second task log information is saved.

[0015] This shows that it is convenient to search by model task ID.

[0016] A further solution is that after generating a model task identifier corresponding to the model running task, and before determining whether to execute the model running task in a sub-process running mode or a sub-thread running mode and record the task log based on the model running parameters, the following steps are included: when determining whether the model running task belongs to the asynchronous execution type, if so, sending the model task identifier to the user end.

[0017] It can be seen from this that the model task identifier can be sent to the user end before the model running task is executed, so that the user end can view the task log information during the execution of the model running task in real time.

[0018] A further solution is that the second task log information includes log information of a sub-thread newly started during the execution of the sub-thread for executing the model execution task.

[0019] It can be seen from this that the relevant log information can also be recorded for the newly opened sub-process during the execution of the model running task.

[0020] In order to achieve the above-mentioned second purpose, the present invention provides a method for recording and viewing the model operation log of a machine learning platform, which is applied to the user side, and includes the following steps: sending the model operation task to the server side; obtaining multiple task log information and model task identifiers corresponding to the model operation task from the server side; and determining the target task log information corresponding to the model operation task based on the obtained model task identifier.

[0021] It can be seen from the above scheme that after uploading the model running task to the server side, the present invention searches for the target task log information through the model task identifier to realize the calling model in the machine learning platform, and provides a window for viewing the log in real time on the interface, and displays the log recorded by the running model in real time on the interface. Developers or business personnel can grasp the model running status in real time through the interface and adjust the code or parameters according to the log; and provide the function of viewing and downloading logs, which is convenient for subsequent problem analysis. There is no need to get log files from the database or server, which is more convenient and quick.

[0022] In order to achieve the third purpose mentioned above, the present invention provides a computer device, including a processor and a memory, wherein: a computer program is stored on the memory, and when the computer program is executed by the processor, it implements the method of recording and viewing the model operation log of the above-mentioned machine learning platform.

[0023] In order to achieve the fourth purpose mentioned above, the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein: when the computer program is processed qualitatively, it implements the method of recording and viewing the model operation log of the above-mentioned machine learning platform.

[0024] In order to achieve the fifth purpose mentioned above, the present invention provides a computer program product, including computer instructions, wherein: when the computer instructions are executed by the processor, the method for recording and viewing the model operation log of the above-mentioned machine learning platform is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a system block diagram of the model operation log recording and viewing system in the embodiment of the method for recording and viewing the model operation log of the machine learning platform of the present invention.

[0026] Figure 2 It is a flowchart executed by the server side in an embodiment of the method for recording and viewing the model operation log of the machine learning platform of the present invention.

[0027] The present invention will be further described below with reference to the accompanying drawings and embodiments. DETAILED DESCRIPTION

[0028] The present invention provides a method for recording and viewing model execution logs for a machine learning platform. The method provides task log information corresponding to the execution process of a model execution task to a user terminal based on a model task identifier generated by the model execution task. For each model execution task, the corresponding task log information can be provided to the user terminal separately and in real time. The present invention also provides a computer device, a computer-readable storage medium, and a computer program product for implementing the aforementioned method for recording and viewing model execution logs for a machine learning platform.

[0029] Example of a method for recording and viewing model operation logs of a machine learning platform:

[0030] See also Figure 1 The model operation log recording and viewing system for implementing the method for recording and viewing the model operation log of the machine learning platform of this embodiment includes a server end 11 and a user end 21. Among them, data transmission is performed between the server end 11 and the user end 21.

[0031] Specifically, a machine learning platform runs on the server side 11, and a model deployment module and a model calling module are set on the machine learning platform. The model deployment module is used to receive the uploaded machine learning model, and the model calling module is used to provide the machine learning model call in the model deployment module.

[0032] In this embodiment, the user terminal 21 sends a model running task to the server terminal 11 to call the specified machine learning model. The server terminal 11 returns the task log information in the model running task to the user terminal 21 in real time. The user terminal 21 confirms the task log information corresponding to the model running task through the model task identifier.

[0033] Specifically, the task log information of this embodiment includes the model file address, model data, configuration file information, Eureka / Nacos service information, model call information, log information printed by the model operation, model operation error information, model operation completion information, etc. The cause of the model operation failure can be quickly and accurately located based on the task log information.

[0034] Reference Figure 2 This embodiment is implemented by a computer program executed by the server 11, and specifically includes the following steps:

[0035] First, execute step S1 to obtain a model execution task. This task is used to call a machine learning model on the server. The task includes model execution parameters, which indicate the parameters involved in running the model, including the specific model information to be called and the Python version number to be run.

[0036] Then, step S2 is executed to generate a model task identifier corresponding to the model execution task. Specifically, for each model execution task submitted to the server, a unique corresponding model task identifier is generated, so that the user end can subsequently determine the task log information corresponding to the model execution task based on the model task identifier.

[0037] Then, step S3 is executed to send the model task identifier to the user terminal. In this embodiment, the model running task belongs to the asynchronous execution type. After the model task identifier is generated, the model task identifier can be directly sent to the user terminal so that the user terminal can query the real-time task log information during the execution of the model running task through the model task identifier.

[0038] Then, step S4 is executed to determine whether the model operation parameters in the model operation task meet the preset conditions. Specifically, the preset conditions can be set in advance, and the preset conditions can include multiple ones. Only one of them needs to be met to be considered to meet the preset conditions. In this embodiment, the preset conditions include model type requirements and Python version number requirements. The model type requirement represents a set of specific models that occupy more resources. The Python version number requirement is 3.11. Determining that the specific model information in the model operation parameters belongs to the model type requirement, and / or determining that the Python version number in the model operation parameters is 3.11, can determine that the model operation parameters in the model operation task meet the preset conditions.

[0039] Based on the judgment result, it is determined whether the model operation task is executed and the task log is recorded in the sub-process operation mode or the sub-thread operation mode. When the model operation parameters meet the preset conditions, the model operation task is executed and the task log is recorded in the sub-process operation mode, and the process branches to steps S51, S52 and S53. When the model operation parameters meet the preset conditions, the model operation task is executed and the task log is recorded in the sub-thread operation mode, and the process branches to steps S61, S62 and S63.

[0040] When the judgment result in step S4 is yes, the process proceeds to step S51 to record the model task identifier in the model operation parameters. By recording the model task identifier in the model operation parameters, the model task identifier is used by the sub-process logger in the sub-process created subsequently.

[0041] Then, step S52 is executed to create and execute a subprocess that associates the first task log information with the model task identifier and saves it to the global log manager. Specifically, a subprocess is created and executed, and the execution of the subprocess specifically includes the following steps: creating a subprocess logger, initializing the global log manager and the subprocess logger, executing the model operation task, and for the logs generated during the execution of the model operation task, the subprocess logger associates these logs with the model task identifier obtained from the model operation parameters and saves them to the global log manager to form the first task log information. In this embodiment, the model task identifier is used as the log file name of the first task log information.

[0042] When logging tasks using a subprocess, the created subprocess only supports the model's running tasks and will exit after the model's running tasks are completed. If the subprocess is a resident one, you need to use a subthread logger in the subprocess.

[0043] Then, step S53 is executed to mark the first task log information according to the preset problem classification type.

[0044] Specifically, the problem classification type is pre-set, and in this embodiment, it includes an abnormal log type and a normal log type. The abnormal log type includes a code abnormal log type, a data abnormal log type, and an environmental abnormal log type. The normal log type is an ordinary log in which the model call process is normal. The abnormal log type is a log in which there are abnormalities in the model call process. The abnormal log is further classified according to different abnormal situations. For example, logs with data problems such as array out of bounds, dictionary key not found, incorrect data type, data field mismatch or missing data are classified as data abnormal log types. Logs with environmental problems such as module failure, incorrect dependency package version, resource limitation, network error or database error are classified as environmental abnormal log type logs. Logs with code problems such as syntax errors and null pointers are classified as code abnormal log types.

[0045] Thus, the first task log information can be marked according to the preset problem classification type, and the developer can quickly locate the problem through the mark of the first task log information obtained by the user terminal. It should be noted that a first task log information belonging to the exception log type may include different marks. For example, the first part of the log information in the first task log information is marked with the code exception log type, and the other part of the log information is marked with the data exception log type.

[0046] When the judgment result in step S4 is no, the process proceeds to step S61 to record the model task identifier in the current thread, so as to provide the model task identifier for use by the sub-thread logger in the sub-thread created subsequently.

[0047] Then, step S62 is executed to create and execute a child thread that associates the second task log information with the model task identifier and saves it to the global log manager. Specifically, a child thread is created and executed in the current thread. Executing the child thread specifically includes the following steps: creating a child thread logger, initializing the child thread logger, recording the model task identifier obtained from the current thread in the child thread logger, adding the child thread logger to the global log manager, recording the model task identifier in the created child thread, and then executing the model running task. For logs generated during the execution of the model running task, the child thread logger associates these logs with the model task identifier and saves them to the global log manager to form the second task log information. Specifically, when the child thread logger obtains a log, it needs to determine whether the model task identifier recorded in the child thread is consistent with the model task identifier obtained by the child thread logger from the current thread. If they are consistent, the obtained log is saved as part of the second task log information. If they are inconsistent, the received log information is not processed. In this embodiment, the model task identifier is used as the log file name of the second task log information.

[0048] In addition, when executing a model run task, a new child thread may be started within the created child thread. When a log is received during the execution of the new child thread, the parent thread information of the new child thread needs to be obtained to check whether the model task identifier exists in the parent thread. If the model task identifier is not found, the parent thread is recursively searched upwards until the main thread is found. If the model task identifier is found, a new child thread logger is created for the new child thread. The received log is recorded as part of the second task log information through the new child thread logger. The execution process of the new child thread is the same as that of the first created child thread described above and will not be repeated here. Otherwise, the log information is ignored.

[0049] Then, step S63 is executed to mark the second task log information according to the preset problem classification type. The specific process is the same as step S53 above and will not be repeated here. Thus, the first task log information or the second task log information obtained during the execution of the model execution task in this embodiment is associated with the model task identifier and saved in the global log manager.

[0050] Finally, step S7 is executed to return the first task log information or the second task log information to the user end in real time. For the first task log information or the second task log information obtained, based on WebSocket technology, HTTP technology or other existing technologies, the global log manager can write the task log information into the stream in real time, and the user end can obtain the task log information from the stream in real time, thereby analyzing data and model problems based on the task log information. Specifically, during the model operation process, the user end can determine the target task log information corresponding to the uploaded model operation task from multiple task log information based on the model task identifier, or can pass in selection parameters and obtain a part of the log information in the target task log information by selecting the parameters, for example, only obtaining the abnormal part. After the model operation is completed, historical task log information can also be obtained based on the model task identifier. The historical task log information is the complete task log information after the model operation task is completed.

[0051] To sum up, the present invention generates a unique model task identifier for the acquired model running task, and determines to record the task log information related to the current model running task through a sub-process or sub-thread according to the model running parameters, so as to realize the recording of task log information separately according to the specific model running task, solve the problem that the existing model running log and system log are confused in one file, and the recorded log is returned to the user end in real time, so that the user end can view the task log information during or after the execution of the model running task in real time, and facilitate developers or business personnel to find problems in time and adjust model parameters or perform data preprocessing and other operations.

[0052] Computer device embodiment:

[0053] The computer device of this embodiment includes a processor and a memory. The memory stores a computer program. When the processor executes the computer program, it implements the above-mentioned method embodiment of recording and viewing the model operation log of the machine learning platform.

[0054] A computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that a computer device may include more or fewer components, or a combination of certain components, or different components. For example, a computer device may also include input and output devices, network access devices, a bus, and the like.

[0055] For example, a processor can be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microcontroller or any conventional processor. The processor is the control center of a computer device, connecting the various parts of the entire computer device using various interfaces and lines.

[0056] The memory can be used to store computer programs and / or modules. The controller implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. For example, the memory may mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound receiving function, a sound-to-text conversion function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, text data, etc.). In addition, the memory can include high-speed random access memory and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0057] Computer readable storage medium embodiment:

[0058] If the module integrated in the computer device of the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the process of the embodiment of the method for recording and viewing the model operation log of the machine learning platform can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the controller, it can implement the steps of the embodiment of the method for recording and viewing the model operation log of the machine learning platform. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The storage medium can include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer-readable media can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable media does not include electrical carrier signals and telecommunications signals.

[0059] Computer program product embodiment:

[0060] The computer program product of this embodiment includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform each step of the embodiment of the method for recording and viewing model execution logs on a machine learning platform.

Claims

1. A method for recording and viewing model operation logs of a machine learning platform, applied to a server, characterized in that: The following steps are involved: Get the model running task; Generate a model task identifier corresponding to the model running task; Determining whether to execute the model running task and record the task log in a sub-process running mode or a sub-thread running mode according to the model running parameters of the model running task; Among them, when executing the model running task and recording the task log in the sub-process running mode, it includes: recording the model task identifier to the model running parameters; creating a sub-process for executing the model running task, executing the sub-process, and when executing the sub-process, it includes: creating a sub-process logger, recording first task log information through the sub-process logger and associating the first task log information with the model task identifier obtained from the model running parameters and saving it to the global log manager; Among them, when executing the model running task and recording the task log in the manner of sub-thread operation, it includes: recording the model task identifier in the current thread; creating a sub-thread for executing the model running task, and then executing the sub-thread, and when executing the sub-thread, it includes: creating a sub-thread logger, recording the second task log information through the sub-thread logger and associating the second task log information with the model task identifier obtained from the current thread and saving it to the global log manager; The first task log information or the second task log information is returned to the user terminal in real time.

2. The method for recording and viewing a model operation log of a machine learning platform according to claim 1, wherein: After determining according to the model running parameters to execute the model running task and record the task log in the sub-process running mode or the sub-thread running mode, the following is also performed: marking the first task log information or the second task log information according to a preset problem classification type, and the problem classification type includes an abnormal log type and a normal log type.

3. The method for recording and viewing a model operation log of a machine learning platform according to claim 2, wherein: The exception log type includes at least one of the following: a code exception log type, a data exception log type, and an environment exception log type.

4. The method for recording and viewing a model operation log of a machine learning platform according to any one of claims 1 to 3, characterized in that: When determining, based on the model running parameters, whether to execute the model running task in a sub-process running mode or a sub-thread running mode and record the task log, the following steps are included: The model task identifier is used as the name of a log file in which the first task log information or the second task log information is saved.

5. The method for recording and viewing a model operation log of a machine learning platform according to any one of claims 1 to 3, characterized in that: After generating a model task identifier corresponding to the model running task, and before determining, based on the model running parameters, whether to execute the model running task in a sub-process running mode or a sub-thread running mode and recording the task log, the following steps are included: When determining whether the model running task belongs to the asynchronous execution type, if so, sending the model task identifier to the user terminal.

6. The method for recording and viewing a model operation log of a machine learning platform according to any one of claims 1 to 3, characterized in that: The second task log information includes log information of a newly started sub-thread during the execution of the sub-thread for executing the model running task.

7. A method for recording and viewing model operation logs of a machine learning platform, applied to a user end, characterized in that: The following steps are involved: Send model running tasks to the server; Acquire multiple task log information and model task identifiers corresponding to the model running tasks from the server side; Determine the target task log information corresponding to the model running task according to the obtained model task identifier; The server side executes the method for recording and viewing the model operation log of the machine learning platform described in any one of claims 1 to 6 above.

8. A computer device comprising a processor and a memory, characterized in that: A computer program is stored on the memory, and when the computer program is executed by the processor, it implements the method for recording and viewing the model operation log of the machine learning platform described in any one of claims 1 to 6 or claim 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for recording and viewing the model operation log of the machine learning platform described in any one of claims 1 to 6 or claim 7.

10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by the processor, the method for recording and viewing the model operation log of the machine learning platform described in any one of claims 1 to 6 or claim 7 is implemented.

Citation Information

Patent Citations

  • Intelligent task scheduling method and device, computer equipment and storage medium

    CN115237725A

  • Real-time transcoding monitoring method and real-time transcoding system

    WO2017101488A1