Data processing methods, apparatuses, electronic devices, storage media, and software products
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 苏州凌云光工业智能技术有限公司
- Filing Date
- 2025-12-25
- Publication Date
- 2026-05-26
Smart Images

Figure CN122086857A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of industrial vision, and in particular relates to a data processing method, apparatus, electronic device, storage medium and program product. Background Technology
[0002] AOI (Automatic Optical Inspection) systems are primarily used for automated optical inspection. Their core functions include data acquisition, inspection, and result feedback. Typically, AOI systems generate numerous log files containing information about the equipment's operation, such as acquisition status, inspection process, inspection results, and the status of related algorithms. These logs are mainly for development and maintenance personnel to view, analyze system performance, and troubleshoot problems. When AOI equipment malfunctions or malfunctions, technicians often need to manually analyze the logs to identify the cause and perform troubleshooting. These logs usually include the name and version information of the detection algorithm, dependency library information, and file attributes. However, the output of these logs is often lengthy, poorly structured, and lacks automated analysis capabilities. Furthermore, due to differences in developers, the log formats, styles, and terminology vary, making them difficult to read. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a data processing method, apparatus, electronic device, storage medium, and program product, enabling users to more directly understand the causes of anomalies and handle corresponding anomaly problems, thereby improving the efficiency of equipment fault diagnosis.
[0004] Firstly, this application provides a data processing method, which includes: Based on a preset log format, the initial log is processed to obtain a standardized log; the preset log format includes at least one of the following: timestamp, thread number, log level, log content, and code location; wherein, the log content includes an action or result field and a parameter field; Output the standardized log.
[0005] According to one embodiment of this application, the preset log format includes, in sequence: the timestamp, the thread number, the log level, the action or result field, the parameter field, and the code location.
[0006] According to one embodiment of this application, the parameter field is represented based on key names in a preset standardized terminology; wherein, the standardized terminology includes at least one of the following: detection object, algorithm, camera, image, time consumption, detection result, and error number.
[0007] According to one embodiment of this application, the processing of the initial log based on a preset log format includes: If an anomaly is detected, an initial anomaly log is generated; Based on the preset log format, the initial abnormal log is processed to obtain a standardized log corresponding to the initial abnormal log.
[0008] According to one embodiment of this application, generating an initial exception log upon detecting an anomaly includes: If the actual number of images acquired is less than the target number of images acquired, an initial log for an abnormal acquisition integrity error will be generated. If the actual collection time is greater than the target collection time, an initial abnormal log corresponding to the abnormal collection time will be generated. If the actual runtime of the target algorithm exceeds the target runtime, generate an initial exception log corresponding to the runtime exception. If no target data is obtained within the target monitoring period, an initial log of an anomaly corresponding to the result integrity error is generated.
[0009] According to one embodiment of this application, before processing the initial log based on a preset log format to obtain a standardized log, the method further includes: Obtain the version information of the target algorithm and its dependent libraries; If the version information does not match the preset version, an initial exception log corresponding to the version exception is generated.
[0010] According to the data processing method of this application, the initial logs are processed based on a preset log format, transforming the originally redundant and inconsistent log information into standardized logs. While retaining key information, the initial logs are graded and simplified, organizing the log content according to a unified structure. This reduces the complexity of the system log content and improves the system's usability and automation level. The standardized logs generated based on the above processing method allow users to understand the causes of anomalies and handle corresponding anomalies more intuitively without having to analyze large amounts of unstructured initial log text line by line, thereby improving the efficiency of equipment fault diagnosis.
[0011] Secondly, this application provides a data processing apparatus, which includes: The first processing module is used to process the initial log based on a preset log format to obtain a standardized log; the preset log format includes at least one of the following: timestamp, thread number, log level, log content, and code location; wherein, the log content includes an execution action or result field and a parameter field; The second processing module is used to output the standardized log.
[0012] According to the data processing device of this application, the initial log is processed based on a preset log format, transforming the originally redundant and inconsistent log information into standardized logs. While retaining key information, the initial logs are graded and simplified, so that the log content is organized according to a unified structure, reducing the complexity of the system log content and improving the system's usability and automation level. The standardized logs generated based on the above processing method allow users to understand the causes of anomalies and handle corresponding anomalies more intuitively without having to analyze a large amount of unstructured initial log text one by one, thereby improving the efficiency of equipment fault diagnosis.
[0013] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data processing method described in the first aspect above.
[0014] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method as described in the first aspect above.
[0015] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method described in the first aspect above.
[0016] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects: The initial logs are processed based on a preset log format, transforming the originally redundant and inconsistent log information into standardized logs. While retaining key information, the initial logs are graded and simplified, organizing the log content according to a unified structure. This reduces the complexity of the system log content and improves the system's usability and automation level. The standardized logs generated based on the above processing method allow users to understand the causes of anomalies and handle corresponding anomalies more intuitively, without having to analyze large amounts of unstructured initial log text line by line, thereby improving the efficiency of equipment fault diagnosis.
[0017] Furthermore, by setting up a standardized terminology, the parameter information in the logs remains consistent at the semantic level. This allows users to quickly locate the information category of interest directly based on the key name when viewing the logs, without having to repeatedly compare and understand the log content. At the same time, when automatically parsing and analyzing the logs, the parameter information can also be classified based on the key name, reducing the reliance on unstructured text parsing and making it easier for users to analyze and understand the log content.
[0018] Furthermore, during the system startup phase, based on the pre-exported database file, the system checks the filenames and version information of the detection algorithms and their dependent libraries to confirm whether they meet the version requirements. If the filenames or version information do not meet the preset version conditions, a corresponding initial exception log is generated, enabling version inconsistency issues to be identified before the system officially runs, reducing abnormal interruptions caused by version inconsistencies during subsequent operation. The initial exception log is then output in a preset log format to help users understand the device status in a timely manner and quickly handle problems, reducing the time required for manual troubleshooting, improving the stability of system operation, and reducing reliance on developers, thereby achieving efficient automatic exception analysis.
[0019] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0020] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is one of the flowcharts illustrating the data processing method provided in the embodiments of this application; Figure 2 This is a log illustration of the data processing method provided in the embodiments of this application; Figure 3 This is a second schematic flowchart of the data processing method provided in the embodiments of this application; Figure 4 This is the third flowchart illustrating the data processing method provided in the embodiments of this application; Figure 5 This is the fourth flowchart illustrating the data processing method provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the data processing apparatus provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0022] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0023] The data processing method, data processing device, electronic device, and readable storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0024] The data processing method can be applied to the terminal, and can be executed by the hardware or software in the terminal.
[0025] The terminal includes portable communication devices such as mobile phones or tablets. It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer.
[0026] It is understood that the terminal may also include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0027] The data processing method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the data processing method. The electronic devices mentioned in this application embodiment include, but are not limited to, mobile phones, tablets, computers, cameras, and wearable devices. The data processing method provided in this application embodiment is described below using an electronic device as the execution subject.
[0028] During the research and development process, the inventors discovered that Automatic Optical Inspection (AOI) systems in related technologies typically generate a large amount of log information regarding the internal state of the system. This type of log content is complex in structure, highly specialized, and lacks necessary simplification and hierarchical representation, requiring users to invest significant time and effort in viewing and understanding it. When system malfunctions or anomalies occur, the log information generated by these technologies often requires technicians to read and analyze each entry, a process that is not only time-consuming and labor-intensive but also demands a high level of understanding of the system's internal implementation details from operators. Furthermore, because log information primarily records internal operational details in a formal manner, the lack of a unified and standardized expression method makes it difficult for technicians to directly obtain key anomaly information without a deep understanding of the system's internal structure, thus affecting the effective transmission and feedback of anomaly information between the system and technicians. In addition, AOI systems in related technologies heavily rely on developer involvement for log parsing and anomaly localization, making it difficult for ordinary users to quickly and accurately identify the causes of anomalies through log content, thereby limiting the system's usability and automation level to some extent.
[0029] Based on the above considerations, in order to solve the problem of the lack of unified standardization of log information in AOI system, which affects reading efficiency and automated analysis capabilities, a data processing method is designed, including: processing the initial log based on a preset log format to obtain a standardized log; the preset log format includes at least one of the following: timestamp, thread number, log level, log content, and code location; wherein, the log content includes an execution action or result field and a parameter field; and outputting the standardized log.
[0030] According to the data processing method provided in the embodiments of this application, the initial log is processed based on a preset log format, transforming the originally redundant and inconsistent log information into standardized logs. While retaining key information, the initial logs are graded and simplified, so that the log content is organized according to a unified structure, reducing the complexity of the system log content and improving the system's usability and automation level. The standardized logs generated based on the above processing method allow users to understand the causes of anomalies and handle corresponding anomalies more intuitively without having to analyze a large amount of unstructured initial log text one by one, thereby improving the efficiency of equipment fault diagnosis.
[0031] like Figure 1 As shown, the data processing method includes steps 110 and 120.
[0032] Step 110: Based on the preset log format, process the initial log to obtain a standardized log; In this step, the preset log format includes at least one of the following: timestamp, thread number, log level, log content, and code location; wherein, the log content includes the action or result field and the parameter field.
[0033] During actual execution, the initial logs are processed according to a preset log format, ensuring that each log record includes one or more of the following: timestamp, thread number, log level, log content, and code location. The timestamp records the specific time the log was generated, supporting the location of abnormal events. The thread number identifies the system execution thread corresponding to the log, facilitating the differentiation of different execution flows in a multi-threaded environment. The log level indicates the importance of the log information, including levels such as Debug, Info, Warning, and Error. The log content records the execution action or result along with corresponding parameter information, represented in a standardized format. The code location indicates the location of the code that generated the log, aiding in locating the relevant functional module.
[0034] According to the data processing method of this application embodiment, by simplifying and structuring the log content, the log records, while including the fields corresponding to the log format, reduce the complexity of reading and parsing, and enable the log content to be read and parsed uniformly.
[0035] In some embodiments, the preset log format includes, in sequence: timestamp, thread number log level, action or result field, parameter field, and code location.
[0036] In this embodiment, sequential arrangement means that in a single log record, each field is output and displayed linearly in a preset order.
[0037] It should be noted that the order of the fields in the preset log format can be customized based on the user's actual needs, and this application does not impose specific restrictions on it.
[0038] The following is based on Figure 2 Taking this as an example, we will explain the preset log format.
[0039] Figure 2 The text displays an example of logs generated according to a preset log format. Each log record is arranged and output in the order of timestamp, thread number, log level, action or result field, parameter field, and code location. The first half of the log is a basic information area, displaying information such as the log generation time, corresponding thread, and log level. Angle brackets are used to identify the action or result, clearly indicating the specific detection process node corresponding to the log, such as algorithm loading, configuration update, or detection process execution.
[0040] Continue to refer to Figure 2 Following the action or result field, the parameter field is displayed in a structured format to record configuration parameters, algorithm names, or dependency library information related to the current action. For example, fixed fields can be used to identify the algorithm type, configuration path, or dynamic link library name. The code location field indicates the location of the code module that generated the log, to help locate the source of the log.
[0041] Continue to refer to Figure 2 The default log format sets up an independent area for parameter fields and uses a key-value pair representation to constrain the log output interface. This ensures that the output fields of the log interface are limited to the key names in the default rule table, thereby guaranteeing the consistency of log content in terms of format and semantics, making it easier for users to read and parse the log content.
[0042] According to the data processing method provided in the embodiments of this application, based on a preset log format, by using a structured representation of parameter fields in the log (e.g., using a standard parameter vocabulary defined in a file), the detection algorithm, dependent libraries, and related configuration parameters can be recorded as independent fields, so that the process information and parameter information in the log remain relatively independent, reducing the mixed presentation of different types of information in the same text.
[0043] In some embodiments, parameter fields are represented based on key names in a preset standardized vocabulary.
[0044] In this embodiment, the standardized terminology includes at least one of the following: detection object, algorithm, camera, image, time consumption, detection result, and error number.
[0045] In actual implementation, the key names and Chinese definitions in the pre-set standardized terminology table can be shown in Table 1 below.
[0046]
[0047] Referring to the standardized terminology table in Table 1, corresponding key names are predefined for different types of information in the log parameter fields to distinguish and describe parameter content from different detection stages and different functional modules.
[0048] For example, the key name used to characterize the detected object is used to record the type or number information of the object currently being detected; the key name used to characterize the algorithm is used to record the name of the algorithm or the identifier of the algorithm module participating in the current detection process; the key name used to characterize the camera and the image is used to record the camera number, the captured image, or related configuration parameters used in the image acquisition process; the key name used to characterize the time consumption is used to record the time consumption information corresponding to the execution of the detection process or algorithm; the key name used to characterize the detection result is used to record the detection judgment result; and the key name used to characterize the error number is used to record the abnormal or error status identifier that occurs during the detection process.
[0049] Using the above method, parameter information from different sources and for different purposes can be clearly distinguished under the same log format and uniformly included in the parameter field for recording.
[0050] According to the data processing method provided in the embodiments of this application, by setting a standardized terminology, the parameter information in the logs remains consistent at the semantic level, allowing users to quickly locate the information category of interest directly based on the key name when viewing the logs, without having to repeatedly compare and understand the log content; at the same time, when automatically parsing and analyzing the logs, the parameter information can also be classified based on the key name, reducing the reliance on unstructured text parsing and making it easier for users to analyze and understand the log content.
[0051] In some embodiments, the initial log is processed based on a preset log format, and the processing of the initial log includes: If an anomaly is detected, an initial anomaly log is generated; Based on a preset log format, the initial exception log is processed to obtain a standardized log corresponding to the initial exception log.
[0052] In this embodiment, the initial anomaly log refers to the log record generated by the system and associated with the anomaly event when an anomaly event is detected.
[0053] In some embodiments, the initial log includes an exception log, as well as other log information used to record the system's operating status.
[0054] In this embodiment, other log information used to record the system's operating status may include log information related to the system's operation process, the execution status of functional modules, or resource usage, such as process start and end records, module loading status, parameter configuration records, running time information, or environmental status information. This log information can be used to assist in anomaly analysis, as well as for backtracking and status analysis of the system's operation process.
[0055] In some embodiments, upon detecting an anomaly, an initial log is generated, including: If the actual number of images acquired is less than the target number of images acquired, an initial log for an abnormal acquisition integrity error will be generated. If the actual collection time is greater than the target collection time, an initial abnormal log corresponding to the abnormal collection time will be generated. If the actual runtime of the target algorithm exceeds the target runtime, generate an initial exception log corresponding to the runtime exception. If no target data is obtained within the target monitoring period, an initial log of an anomaly corresponding to the result integrity error is generated.
[0056] In this embodiment, the initial exception log is used to record runtime information related to the acquisition process, algorithm execution, or result generation when an exception occurs.
[0057] refer to Figure 3 After the software starts and completes initialization, follow the instructions. Figure 3 The process shown sequentially enters the acquisition, detection, and result summarization stages. Specifically, the acquisition stage collects image data and generates logs related to the image acquisition process; the detection stage performs detection processing based on the acquired images and generates logs related to the detection process and algorithm execution; the summarization stage summarizes the detection results and generates logs related to the result output status; after the summarization stage, the operations from the acquisition stage are repeated.
[0058] In actual execution, the generated initial logs are preprocessed to extract log fields corresponding to the collection phase, detection phase, and result summary phase, and it is determined whether the log fields meet the preset conditions corresponding to the preset target parameters of the corresponding phase. Among them, the target parameters of the collection phase include the target number of images and the target collection time; the target parameters of the detection phase include the target algorithm runtime; and the target parameters of the result summary phase include the target monitoring period or result acquisition conditions.
[0059] In some embodiments, the target parameters described above may be obtained based on detection templates, algorithm configurations, or user-defined settings.
[0060] In actual execution, if the actual number of images acquired is less than the target number of images acquired, an acquisition integrity anomaly is determined based on the image acquisition quantity information, and an initial anomaly log corresponding to the acquisition integrity anomaly is generated. The generated initial anomaly log may include information such as product identifier, camera number, actual acquisition quantity, and target acquisition quantity.
[0061] If the actual acquisition time is detected to be greater than the target acquisition time, the acquisition time is determined to be abnormal based on the acquisition start and end time information, and an initial abnormal log corresponding to the acquisition time abnormality is generated. The generated initial abnormal acquisition time log may include information such as product identifier, camera number and actual acquisition time.
[0062] If the actual runtime of the target algorithm exceeds the target runtime, a runtime anomaly is identified based on the algorithm call and execution time information recorded in the log, and a corresponding initial runtime anomaly log is generated. The generated initial runtime anomaly log may include information such as product identifier, screen identifier, algorithm name, and algorithm execution time.
[0063] If the target data is not obtained within the target monitoring period, the system determines that the result is incomplete based on the summary information recorded in the log, and generates a corresponding initial log for the anomaly. For example, if a material feeding timeout occurs and the system still fails to obtain the corresponding detection result data after extending the monitoring period by one cycle, it is determined that the result is incomplete.
[0064] It is understandable that the above-mentioned target image acquisition quantity, target acquisition time, target runtime, and target detection cycle can be based on detection templates or process configuration files, or they can be based on user-defined settings.
[0065] In some embodiments, exceptions may also include exceptions related to the system operating environment, configuration status, or dependency conditions, and a corresponding initial exception log is generated when the corresponding exception is detected.
[0066] For example, if system configuration parameters are found to be missing, parameter values do not meet preset conditions, or configuration loading fails, an initial exception log corresponding to the abnormal configuration parameters is generated; the initial exception log is used to record the abnormal parameter items and their corresponding configuration status information.
[0067] For example, if the acquisition device or detection device is detected to be in an unavailable state, an initial abnormal log corresponding to the abnormal device status is generated; the initial abnormal log is used to record the identification information and status information of the abnormal device.
[0068] For example, if a parameter value conflict, an unreasonable parameter combination, or a failure to meet the constraints between parameters is detected during system operation, an initial exception log corresponding to the parameter consistency anomaly is generated; the initial exception log is used to record the conflicting parameter items and their associated information.
[0069] According to the data processing method provided in this application, based on the number of data collected, collection time, algorithm runtime, and result acquisition status recorded in the initial log, the system differentiates and processes the anomaly types, and generates initial anomaly logs corresponding to data collection integrity anomalies, data collection time anomalies, runtime anomalies, and result integrity anomalies, respectively. Through this method, the system can generate initial anomaly logs corresponding to different anomaly types for different anomaly scenarios, ensuring that anomaly information is clearly distinguished and recorded at the log level. This facilitates rapid location and analysis of the anomaly source during subsequent processing, thereby improving the targeting of anomaly analysis and problem troubleshooting.
[0070] In some embodiments, after generating the initial exception log corresponding to the version exception, step 110 can be repeated.
[0071] In some embodiments, before processing the initial log based on a preset log format to obtain a standardized log, the method further includes: Obtain the version information of the target algorithm and its dependent libraries; If the version information does not match the preset version, generate the initial exception log corresponding to the version exception.
[0072] In this embodiment, mismatch refers to an anomaly where, during the software or system startup phase, the version of the target algorithm and its dependent libraries does not meet the preset version requirements during actual operation, such as an outdated version or failure to load the corresponding files into the system.
[0073] In some embodiments, the system continues to run if the version information matches a preset version.
[0074] In some embodiments, the target algorithm may include image preprocessing algorithms, defect detection algorithms, feature extraction and recognition algorithms, size measurement algorithms, and detection result determination algorithms for use in AOI systems.
[0075] In some embodiments, the database file for obtaining the system version information includes: Receive the user's first input; In response to the first input, obtain the filenames and version information of the detection algorithms and dependent libraries in the system; Export the database file containing the filenames and version information.
[0076] In this embodiment, the first input is used to load or obtain the filenames and version information of the detection algorithms and dependent libraries in the system.
[0077] The first input may include at least one of the following methods: Firstly, the first input can be a touch operation, including but not limited to click, swipe, and press operations.
[0078] In this embodiment, receiving the user's first input can be receiving the user's touch operation on the display area of the terminal screen.
[0079] In actual implementation, the first input can be achieved through the user interface set in the AOI system, or through the display screen of a mobile terminal that communicates with the AOI system, such as a mobile phone screen.
[0080] For example, after the AOI system is turned on, the terminal display shows the control interface. The user can touch the target control used to obtain the file name and version information of the detection algorithm and dependent library in the system to achieve the first input.
[0081] Secondly, the first input can be a physical button input.
[0082] In this embodiment, the user's first input can be received through a remote control device that communicates with the AOI system or through physical buttons set on the AOI system. This can be receiving the user's operation of pressing the corresponding physical button; the first input can also be a combination operation of pressing multiple physical buttons simultaneously.
[0083] Thirdly, the first input can be voice input.
[0084] In this implementation, when the AOI system receives a voice message such as "read file name and version information", it triggers the acquisition and export of the file name and version information corresponding to the detection algorithm and dependent libraries in the system.
[0085] Of course, in other embodiments, the first input may also be in other forms, including but not limited to character input, etc., which can be determined according to actual needs, and this application embodiment does not limit it.
[0086] In some embodiments, the database file may include tables, text, or binary data structures.
[0087] The following section explains how to obtain the filenames and version information of the detection algorithms and dependent libraries in the system, and how to export the database files corresponding to the filenames and version information.
[0088] refer to Figure 4 In actual execution, after the software starts, the user enters the first input by clicking the "Load File" button; the first input is used to trigger the file loading operation and determine the target folder containing the detection algorithm and dependency libraries.
[0089] Continue to refer to Figure 4In response to the first input, the system reads the file information from the selected folder, retrieves the filename (including file extension) and version number information for each file, and displays them. Each filename corresponds to a row in the table, and the version number corresponds to an editable cell. For files whose version number is not detected, the initial version number can be set to 0.
[0090] Continue to refer to Figure 4 After the user confirms or modifies the version number, the filenames and corresponding version number information in the table are exported to generate a database file corresponding to the selected folder. This database file records the version information of the detection algorithm and dependent libraries. The filename can be set to "folder_name_list.db", and the table columns include a filename column and a version number column, for example, set to dll_name and min_version respectively.
[0091] In some embodiments, based on a database file, the correctness of the system's dependencies is verified, and corresponding prompts are output, including: Based on the database file, obtain the filenames and version information of the detection algorithms and dependent libraries in the system.
[0092] In this embodiment, the database file is used to record the filenames and version information of the detection algorithm and its dependent libraries.
[0093] In some embodiments, dependencies may include dynamic link libraries, algorithm libraries, image processing libraries, inference libraries, or system runtime libraries related to the operation of the AOI system.
[0094] In actual implementation, refer to Figure 5 Read the list (such as PreAlg_list.db or Alg17_list.db); load the corresponding dynamic link library (DLL) file, and obtain the file name and version number in the list, including the file name and version number of the detection algorithm and its dependent libraries, as the preset version for subsequent verification.
[0095] Continue to refer to Figure 5 Verify that the filenames and version numbers in the database file match the preset versions in the list. Compare the actual filenames and versions in the database file with the preset versions in the list, checking whether the filenames match and whether the version numbers meet the preset version requirements.
[0096] Continue to refer to Figure 5When the judgment result is that the file name or version number does not meet the requirements, a prompt message is displayed to the user through a pop-up window. The prompt message includes the current file path and file name, as well as the fact that it is not applicable to the current version of the software, and prompts the user to update the relevant file. The judgment result is also recorded as the initial log of the version exception. When the judgment result or the user modifies it after being prompted by the pop-up window to meet the preset version, the subsequent running process of the software is executed.
[0097] According to the data processing method provided in this application embodiment, during the system startup phase, based on a pre-exported database file, the filenames and version information corresponding to the detection algorithms and their dependent libraries in the system are judged to confirm whether they meet the version requirements. If the filename or version information does not meet the preset version conditions, a corresponding initial abnormal log is generated, so that version inconsistency issues can be identified before the system officially runs, reducing abnormal interruptions caused by version inconsistency during subsequent operation. Subsequently, the initial abnormal log is output in a preset log format to help users understand the device status in a timely manner and quickly handle problems, reducing the time required for manual troubleshooting, improving the stability of system operation, and on this basis, reducing the dependence on developers, thereby achieving efficient automatic abnormal analysis.
[0098] Step 120: Output standardized logs.
[0099] In this step, the standardized log is output in the preset log format from step 110.
[0100] In some embodiments, the output format of standardized logs may include image format, text format, or file storage format, to adapt to different usage scenarios and user needs. For example, during local device operation, standardized logs can be presented on the interface through pop-ups or based on preset display templates; in scenarios requiring subsequent analysis or archiving, standardized logs can also be stored as files to support the retrieval and processing of historical operation information.
[0101] In some embodiments, when it is necessary to quickly prompt the abnormal or critical status corresponding to the log, auxiliary output can also be provided by combining sound prompts or indicator light prompts.
[0102] In some embodiments, the output triggering conditions of standardized logs may include situations such as the occurrence of anomalies, changes in system state, switching of process nodes, or user operations, so that the logs can cover key events in the process of system operation, and are not limited to abnormal scenarios.
[0103] In some embodiments, the storage and persistence strategy for standardized logs may include selecting different storage methods based on log type or importance, such as storing some logs in the form of files and storing critical logs in a database or cache structure, thereby supporting log traceability while taking into account the consumption of storage resources.
[0104] In actual implementation, taking text display as an example, standardized logs can be formatted according to... Figure 2 The format shown is displayed in the user interface, where the log fields are arranged in a preset order, including timestamp, thread number, log level, action or result field, parameter field, and code location.
[0105] The data processing method provided in this application can be executed by a data processing device. This application uses an example of a data processing device executing the data processing method to illustrate the data processing device provided in this application.
[0106] This application also provides a data processing apparatus.
[0107] like Figure 6 As shown, the data processing device includes: a first processing module 610 and a second processing module 620.
[0108] The first processing module 610 is used to process the initial log based on a preset log format to obtain a standardized log; the preset log format includes at least one of the following: timestamp, thread number, log level, log content, and code location; wherein, the log content includes an execution action or result field and a parameter field; The second processing module 620 outputs standardized logs.
[0109] According to the data processing apparatus provided in the embodiments of this application, the initial log is processed based on a preset log format, transforming the originally redundant and inconsistent log information into standardized logs. While retaining key information, the initial logs are graded and simplified, so that the log content is organized according to a unified structure, reducing the complexity of the system log content and improving the system's usability and automation level. The standardized logs generated based on the above processing method allow users to understand the causes of anomalies and handle corresponding anomalies more intuitively without having to analyze a large amount of unstructured initial log text line by line, thereby improving the efficiency of equipment fault diagnosis.
[0110] In some embodiments, the first processing module 610 may also be used for: If an anomaly is detected, an initial anomaly log is generated; Based on a preset log format, the initial exception log is processed to obtain a standardized log corresponding to the initial exception log.
[0111] In some embodiments, the first processing module 610 may also be used for: If the actual number of images acquired is less than the target number of images acquired, an initial log for an abnormal acquisition integrity error will be generated. If the actual collection time is greater than the target collection time, an initial abnormal log corresponding to the abnormal collection time will be generated. If the actual runtime of the target algorithm exceeds the target runtime, generate an initial exception log corresponding to the runtime exception. If no target data is obtained within the target monitoring period, an initial log for the result integrity error will be generated.
[0112] In some embodiments, the data processing apparatus further includes a third processing module for: Obtain the version information of the target algorithm and its dependent libraries; If the version information does not match the preset version, generate the initial exception log corresponding to the version exception.
[0113] The data processing device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0114] The data processing device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0115] The data processing device provided in this application embodiment can achieve... Figures 1 to 5The various processes implemented in the method implementation examples will not be described again here to avoid repetition.
[0116] In some embodiments, such as Figure 7 As shown, this application embodiment also provides an electronic device 700, including a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. When the program is executed by the processor 701, it implements the various processes of the above-described data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0117] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0118] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described data processing method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0119] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0120] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described data processing method.
[0121] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0122] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above data processing method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0123] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0124] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0126] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0127] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0128] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A data processing method, characterized by, The method comprises: processing the initial log based on a preset log format to obtain a standardized log; the preset log format comprises at least one of a timestamp, a thread number, a log level, log content, and a code location; the log content comprises an execution action or result field and a parameter field; outputting the standardized log.
2. The data processing method according to claim 1, characterized in that, The preset log format comprises, in sequence: the timestamp, the thread number, the log level, the execution action or result field, the parameter field, and the code location.
3. The data processing method of claim 1, wherein, The parameter field is represented based on a key name in a preset standardized vocabulary table; the standardized vocabulary table comprises at least one of a detection object, an algorithm, a camera, a picture, a time consumption, a detection result, and an error number.
4. The data processing method according to any one of claims 1 to 3, characterized in that, The processing the initial log based on a preset log format to obtain a standardized log comprises: generating an abnormal initial log when an abnormality is detected; processing the abnormal initial log based on the preset log format to obtain a standardized log corresponding to the abnormal initial log.
5. The data processing method according to claim 4, characterized in that, The generating an abnormal initial log when an abnormality is detected comprises: generating an abnormal initial log corresponding to a collection integrity abnormality when an actual collection quantity is less than a target collection quantity; generating an abnormal initial log corresponding to a collection time consumption abnormality when an actual collection time consumption is greater than a target collection time consumption; generating an abnormal initial log corresponding to a running time length abnormality when an actual running time length of a target algorithm is greater than a target running time length; generating an abnormal initial log corresponding to a result integrity abnormality when target data is not acquired within a target monitoring period.
6. The data processing method according to any one of claims 1 to 3, characterized in that, Before the processing the initial log based on a preset log format to obtain a standardized log, the method further comprises: acquiring version information corresponding to a target algorithm and a dependent library; generating an abnormal initial log corresponding to a version abnormality when the version information does not match a preset version.
7. A data processing apparatus, characterized by, The method comprises: a first processing module configured to process an initial log based on a preset log format to obtain a standardized log; the preset log format comprises at least one of a timestamp, a thread number, a log level, log content, and a code location; the log content comprises an execution action or result field and a parameter field; a second processing module configured to output the standardized log.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the data processing method according to any one of claims 1-6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method according to any one of claims 1-6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method according to any one of claims 1-6.