Mirror image file automatic programming method and device, equipment and storage medium
By cleaning and word segmentation of the initial burning document, extracting burning instructions and automatically generating burning code, the cumbersome and error problems in the burning process of mirror files of embedded devices are solved, and efficient and accurate automatic burning is achieved.
Patent Information
- Application Number
- CN202411386227.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
In the prior art, the process of writing mirror files of embedded devices is cumbersome and prone to errors, and the writing tools and steps of different devices are different, resulting in complex operations and inefficient efficiency, increasing the risk of manual intervention and errors.
By cleaning text and word segmentation of the initial burning document, extracting burning instructions, and automatically generating burning code using intelligent algorithms to realize the automated burning process and reduce manual intervention and errors.
It improves the accuracy and efficiency of mirror file filing, reduces the error rate and operation complexity, and ensures the efficiency, accuracy and controllability of the filing process.
Smart Images

Figure CN119311285A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automated script writing, and in particular to a method, device, equipment and storage medium for automatically burning an image file. Background Art
[0002] During the development of embedded devices, as image files are frequently updated, the devices need to be regularly reflashed or kernel updated. To ensure the normal operation of the device, developers need to accurately burn the device image files, including the kernel, file system, etc. Manual operation to burn image files is often inefficient and prone to errors. Therefore, improving the automation of image burning and reducing manual intervention have become important requirements in device maintenance and updates.
[0003] Currently, image file burning of embedded devices mostly relies on burning tools and manual input commands. Developers usually use serial ports, networks, etc. to transfer image files to devices, and manually perform burning operations through command lines. The burning process involves a lot of details, such as device connection configuration, burning command input, progress monitoring, etc., and during the burning process, developers need to pay attention to log information at all times to ensure that the operation is normal. In the case of burning failure, users need to check the log files themselves and judge and analyze the problem through experience.
[0004] The above manual operation method is not only cumbersome and time-consuming, but also prone to failure of burning due to input errors, device configuration errors or improper operation. In addition, different devices have different burning tools and operation steps. Users need to master multiple tools and commands, which is extremely unfriendly to users who are not familiar with embedded devices. When burning fails, log analysis usually relies on the developer's experience and manual troubleshooting. Problem location is complicated and labor-intensive. Therefore, the existing manual burning method is not only inefficient, but also increases the risk of operating errors and errors. Therefore, how to automate the image file burning process has become an urgent problem to be solved. Summary of the invention
[0005] The purpose of this application is to provide a method, device, equipment and storage medium for automatically burning an image file, aiming to solve the technical problem of how to automate the image file burning process. To achieve the above purpose, this application proposes a method for automatically burning an image file, the method comprising:
[0006] Obtain the initial burning document, perform text cleaning and word segmentation operations on the initial burning document, obtain the target burning document, and extract the burning instructions according to the target burning document;
[0007] Based on the burning instruction, automatically generate burning code through a burning template;
[0008] According to the programming code, the programming operation is performed and the programming result is fed back.
[0009] In one embodiment, extracting the burning instruction according to the target burning document includes:
[0010] According to the word embedding vector, the target burning document is represented by a vector to obtain a semantic feature vector;
[0011] Based on a preset algorithm, a preset label and the semantic feature vector, a label probability is obtained, where the label probability is a probability that a character in the target burning document corresponds to the preset label;
[0012] Based on the label probabilities, obtaining a label analysis sequence;
[0013] Based on the annotation analysis sequence, a programming instruction is obtained.
[0014] In one embodiment, obtaining a programming instruction based on the annotation analysis sequence includes:
[0015] According to the target burning document, obtain reference keywords;
[0016] Based on the preset keywords in the preset keyword library and the reference keywords, the target keywords are obtained;
[0017] Based on the marked analysis sequence, a burning instruction is obtained through the target keyword.
[0018] In one embodiment, based on the burning instruction, automatically generating the burning code through the burning template includes:
[0019] Get the object calling function and get the reference operation instruction;
[0020] Based on the preset operation instruction and the reference operation instruction, according to the mapping relationship of the target keyword, a burning template is obtained;
[0021] Based on the burning instruction and the burning template, a burning code is obtained.
[0022] In one embodiment, performing a burning operation according to the burning code and feeding back a burning result includes:
[0023] According to the syntax tree, the command structure is statically checked, and the programming code is verified to obtain the verification result;
[0024] If the verification result is no error, the programming operation is performed and the completion information is fed back;
[0025] If the verification result is an error, the error message is fed back and the analysis result is obtained through the anomaly detection method.
[0026] In one embodiment, the error information is fed back and the analysis result is obtained by an abnormality detection method, including:
[0027] Obtaining a generation log of the burning code;
[0028] Based on the target programming document and preset error keywords, a target error keyword is obtained;
[0029] Based on the generated log and the target error keyword, obtain a related error log;
[0030] The error log is analyzed to obtain an analysis result.
[0031] In one embodiment, analyzing the error log to obtain an analysis result includes:
[0032] Based on the error log, a preset case library is searched to obtain a search result;
[0033] If the search result is no match, the error log is updated to the preset case library;
[0034] If the search result is a match, the cause of the programming error and the corresponding solution are fed back according to the preset case library.
[0035] In addition, to achieve the above purpose, the present application also proposes a device for automatically burning an image file, the device comprising:
[0036] The acquisition module is used to acquire the initial burning document, perform text cleaning and word segmentation operations on the initial burning document, obtain the target burning document, and extract the burning instructions according to the target burning document;
[0037] A generation module, used for automatically generating a burning code through a burning template based on the burning instruction;
[0038] The execution module is used to execute the burning operation according to the burning code and feed back the burning result.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes an automatic image file burning device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the automatic image file burning method as described above.
[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the automatic burning method of the image file as described above are implemented.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the automatic burning method of the image file as described above are implemented.
[0042] One or more technical solutions proposed in this application have at least the following technical effects:
[0043] First, the initial burning document is cleaned and segmented to remove redundant information in the document, such as irrelevant characters, formatting issues, etc., and the document content is segmented into more structured sentences and words. The target burning document processed in this way can more accurately and effectively extract the required burning instructions, ensuring the accuracy and effectiveness of the data in the subsequent steps; then, the key instructions related to burning are automatically extracted from the target burning document through intelligent algorithms, avoiding the tedious process of manual recognition and command input. This can greatly reduce the possibility of human error, while ensuring that the extracted instructions are directly related to the burning operation, improving the accuracy and timeliness of the instructions; then, the standardized burning code is automatically generated through the predefined template, which greatly reduces the time of manual code writing, and ensures that the generated burning code meets the unified standards and format, improves the efficiency of the operation, and ensures the correctness and consistency of the code; finally, the automatically generated burning code is executed, and the burning process is automatically controlled by the system, avoiding errors caused by human intervention. During the burning process, the system will monitor and feedback the execution status and results of the burning in real time. The user can obtain the success or failure information of the burning in time, so as to quickly respond to and solve potential problems and reduce the time cost of fault location and processing. This application can ensure the accuracy of the document information by cleaning and structuring the initial burning document, and then efficiently extract the instructions related to the burning operation from it. The extracted burning instructions generate code through the automated template, which not only reduces human intervention, but also improves the consistency and accuracy of the code. In the process of automatically executing the burning code, the burning results are fed back in real time, making the entire burning process more efficient, accurate and controllable, further reducing the error rate and operation complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1A flowchart of the first embodiment of the automatic burning method of the image file of the present application is provided;
[0047] Figure 2 This is the Bi-LSTM-CRF algorithm principle diagram in the first method of automatic burning of image files in this application;
[0048] Figure 3 A flowchart of the second embodiment of the automatic burning method of the image file of the present application is provided;
[0049] Figure 4 A brief flowchart of the automatic burning method of the image file according to the embodiment of the present application;
[0050] Figure 5 This is a schematic diagram of the module structure of the automatic burning device of the image file according to the embodiment of the present application;
[0051] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the automatic burning method of the image file in the embodiment of the present application.
[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0055] In embedded device development, with the frequent updates of system images, the device needs to be reflashed or kernel updated regularly. At present, burning image files mainly relies on manual operation, using burning tools to transfer the image to the device through the serial port or network, and manually executing the burning command. This process is cumbersome and error-prone because many details need to be paid attention to, such as device configuration, command input, and progress monitoring. When the burning fails, users need to manually analyze the log file, which is time-consuming and experience-dependent. Since the burning tools and steps of different devices are different, the operation is complicated for unfamiliar users. The existing manual burning method is inefficient and has a high risk of error. Therefore, automating the burning process is a key requirement to improve efficiency and reduce errors.
[0056] The main solution of the embodiment of the present application is: first, the burning document is preprocessed, including cleaning and word segmentation, to remove irrelevant characters and format problems, and the content is structured into sentences and vocabulary. This step ensures the data accuracy and effectiveness of subsequent operations. Then, the key burning instructions are automatically extracted from the processed documents using intelligent algorithms, which not only reduces the tediousness of manual operations, but also improves the accuracy and timeliness of instruction extraction, while reducing the risk of human errors. Then, standardized burning codes are automatically generated through predefined templates, which not only saves the time of manual code writing, but also ensures the unified standards and formats of the codes, thereby improving the operating efficiency and the correctness of the codes. Finally, the system automatically executes the generated burning code, reducing manual intervention and potential errors. During the burning process, the system monitors and feedbacks the burning status in real time, so that users can understand the burning results in time, respond to and handle any problems quickly, and effectively reduce the time for fault location and processing. In general, burning instructions can be extracted efficiently and accurately through text cleaning and structured processing of burning documents. Automatic template generation of code reduces manual intervention and improves the consistency and accuracy of the code. Automatic execution of burning code and real-time feedback of results make the entire process more efficient, accurate and easy to control, significantly reducing the error rate and complexity of operation.
[0057] It should be noted that the execution subject of the embodiment of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a computer loaded with an automatic burning program of an image file as an example to illustrate this embodiment and the following embodiments.
[0058] Based on this, the embodiment of the present application provides a method for automatically burning an image file, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the automatic burning method of the image file of the present application.
[0059] In this embodiment, the image file automatic burning method includes steps S10 to S30:
[0060] Step S10, obtaining an initial burning document, performing text cleaning and word segmentation operations on the initial burning document to obtain a target burning document, and extracting burning instructions according to the target burning document;
[0061] It should be noted that the initial burning document refers to the original, unprocessed document, which usually contains the commands and operating instructions required to burn the embedded device. This document may exist in text form, which contains a series of burning steps, command codes, parameter settings, etc., and may also include some unnecessary explanatory text, formatting characters or other redundant information. The target burning document is a processed document, that is, a structured document obtained after the initial burning document is cleaned and word segmented. Text cleaning may include removing irrelevant formatting, comments, spaces, etc., while word segmentation is to divide the document content into meaningful sentences and words to make it more suitable for further analysis and processing. The target burning document is the basis for burning instruction extraction. It should only contain information directly related to the burning process, so as to accurately extract effective burning instructions. Burning instructions refer to specific commands and operating steps extracted from the target burning document, which will be used in the automated burning process. Burning instructions usually include specific command statements required to perform burning operations. These instructions are the direct basis for the automated script to perform burning tasks. In short, the initial burning document is the original data, the target burning document is the processed data, and the burning instruction is the specific command ultimately used for automated operations.
[0062] It is understandable that in the automated burning process, the initial burning document needs to be obtained first. This document is the starting point of the burning operation and may contain a series of burning commands and instructions, but it may also be mixed with non-essential information. Next, the document is cleaned. This step involves removing all irrelevant elements, such as comments, formatting marks, extra spaces or special characters, to ensure that only information that is critical to the burning process is retained in the document. Subsequently, the word segmentation operation is performed. This step breaks down the cleaned text into structured sentences and vocabulary to make it easier to analyze and process. Since the operation description in the burning document is in Chinese and the commands are mainly in English, they are classified and processed during the word segmentation process. The document obtained after such processing is called the target burning document, which presents the key information required for burning in a clear and orderly manner. Finally, according to the content in the target burning document, natural language processing technology is used to extract specific burning instructions. These instructions are the actual command sequences to be executed during the burning process. They will be further used to generate automated burning scripts, thereby realizing the automation of the burning process.
[0063] As an example, extracting burning instructions according to the target burning document includes: according to the word embedding vector, the target burning document is represented by a vector to obtain a semantic feature vector; based on a preset algorithm, a preset label and the semantic feature vector, a label probability is obtained, and the label probability is the probability that a character in the target burning document corresponds to the preset label; based on the label probability, a label analysis sequence is obtained; based on the label analysis sequence, a burning instruction is obtained.
[0064] Among them, word embedding vector refers to the technology of converting words into numerical vectors, which capture the semantic information of words. In natural language processing, word embedding can map words or phrases into real vector space, so that semantically similar words are also close in the vector space. Semantic feature vector refers to the vector obtained by word embedding technology that can represent the semantic information of each word or phrase in the target burning document. These vectors are used as the semantic representation of the burning document for subsequent semantic analysis and processing. Preset algorithm refers to the algorithm used to process word embedding vectors and perform entity recognition or labeling, such as BiLSTM-CRF. Preset label refers to the set of labels pre-defined when labeling documents, which represent possible entity types in the document, such as "command", "parameter", "device name", etc. Label probability refers to the probability that each character or word corresponds to the preset label calculated based on the given semantic feature vector and preset algorithm. These probabilities reflect the algorithm's confidence that each word or character belongs to each preset label. Label analysis sequence refers to the final label sequence determined according to the label probability, representing each character or word in the document. This sequence is obtained by decoding the label probabilities and selecting the label with the highest probability at each position.
[0065] Specifically, word embedding technology is used to convert each word in the document into a vector containing rich semantic information, namely a semantic feature vector. Then, a preset natural language processing algorithm (such as BiLSTM-CRF) is used to parse using BIO annotations, and the obtained semantic feature vector is input into BiLSTM and the probability of each character to the 5 annotation tags is predicted. These probabilities reflect the algorithm's judgment on the role that each word may play in the burning context. Then, based on these probabilities, the optimal label sequence, namely the annotation analysis sequence, is determined by a specific decoding algorithm, which identifies the role and meaning of each word in the document. Finally, based on this annotation sequence, specific burning instructions are identified and extracted, which will be used to control the burning device to perform corresponding operations. In short, this process realizes the automatic conversion from text documents to executable burning instructions through advanced natural language processing technology. The annotation results of the example sentences in the burning document can be shown in Table 1, and the principle of the Bi-LSTM-CRF algorithm is as follows: Figure 2 shown.
[0066] Table 1
[0067] <start> < / start> Burn Kernel fastboot flash Bootback G:\boot.img <end> < / end> BIO O B O B I I I O
[0068] As an example, based on the annotation analysis sequence, the burning instruction is obtained, including: obtaining reference keywords according to the target burning document; obtaining target keywords based on preset keywords in a preset keyword library and reference keywords; based on the annotation analysis sequence, obtaining the burning instruction through the target keywords.
[0069] Among them, reference keywords refer to words that may be related to the burning operation and are extracted from the target burning document. These keywords are analyzed from the document content and may be directly or indirectly related to the burning process. Preset keywords refer to a set of words pre-defined in the burning system or application, which are considered to be closely related to the burning operation. The preset keyword library is usually built based on experience and knowledge related to the burning operation. Target keywords refer to a set of keywords that are finally determined for burning instruction extraction after combining reference keywords and preset keywords. These keywords are screened and confirmed, and they are most likely to directly correspond to actual commands or parameters in the burning operation.
[0070] Specifically, words that may be related to the burning operation are identified from the target burning document. These words are called reference keywords. Then, these reference keywords are compared with a predefined keyword library, which contains words that are known to be directly related to the burning operation, namely preset keywords. Through matching and screening, the words that are truly related to the burning process are determined, and these confirmed words constitute the target keywords. Finally, using these target keywords, combined with the annotation analysis sequence obtained in the document through natural language processing technology, the system can accurately extract specific burning instructions from the document. These instructions can then be used to automate the burning task to ensure the accuracy and efficiency of the burning operation. At the same time, the sentences where the keyword-entities are located are retrieved from the annotated operation and command entities to determine the burning-related operations and commands. The relevance can be measured by calculating the vector distance of the keyword context to ensure their relevance to the burning operation and exclude irrelevant contexts. The cos similarity calculation formula is used to calculate the vector distance between keywords and contexts:
[0071]
[0072] A is a keyword, such as restart, burn, connect, set, and burn; B is a specific operation command in the burning instruction, such as restart, press Ctrl+C, burn, fastboot flash bootbak G:\boot.img, and Similarity(A, B) is the similarity result.
[0073] Step S20, based on the burning instruction, automatically generating a burning code through a burning template;
[0074] It should be noted that a flashing template refers to a predefined code framework or blueprint that contains the basic structure and format required for the flashing operation. This template defines the common parts of the flashing script, such as the initialization sequence, command execution format, error handling, logging, etc. The template may contain some placeholders or tags, which will be replaced by specific flashing instructions when the flashing code is actually generated. The purpose of the flashing template is to provide a standardized starting point for code generation to ensure that the flashing script follows consistent coding standards and structures. The flashing code refers to the specific execution code automatically generated based on the flashing instructions and the flashing template. This code is a set of instructions for actually controlling the flashing process, including specific API calls, command line instructions, control logic, etc. The flashing code is the conversion of the flashing instructions into executable program code, which can be run directly on the flashing device or control system to automatically complete the flashing task of the image file. The flashing code usually needs to be compiled or interpreted in order to be executed on a specific hardware or software platform.
[0075] It is understandable that specific burning instructions are extracted from the target burning document, and then the burning code is automatically generated using a pre-designed burning template. The burning template is a framework that defines the general structure of the burning script, including how to initialize the burning environment, how to execute the burning command, how to monitor the burning progress, and how to handle potential errors. Specific positions are reserved in the template for inserting actual burning instructions. Through the template engine, these extracted burning instructions will be dynamically filled into the corresponding positions of the template, replacing the placeholders, thereby generating a personalized burning script. This process usually involves text processing and programming language template technology, such as Python's Jinja2 library. The final burning code is a complete, executable program that can be directly run by a computer to perform the burning task, ensuring the automation and standardization of the burning process. The automatically generated burning code improves the efficiency and accuracy of the burning process, and reduces the time and possibility of errors in manual code writing.
[0076] As an example, based on the burning instruction, the burning code is automatically generated through the burning template, including: obtaining the object calling function to obtain the reference operation instruction; based on the preset operation instruction and the reference operation instruction, according to the mapping relationship between the target keywords, obtaining the burning template; based on the burning instruction and the burning template, obtaining the burning code.
[0077] Among them, object call function refers to the function or method used to access or operate the properties and methods of an object in object-oriented programming. In the context of burning code, these functions may refer to those functions that can perform specific burning tasks, such as sending commands, processing data, etc. Reference operation instructions refer to preliminary instructions extracted from the target burning document to guide the burning operation. These instructions are usually obtained based on the analysis of the document content and may include some basic operation steps or commands. Preset operation instructions refer to a set of operation instructions pre-defined in the burning system. These instructions are standardized and cover various operations that may be required during the burning process, such as connecting devices, erasing storage, writing data, etc.
[0078] Specifically, the Jinja2 library in Python is used to write the template engine, and the identified burning operations and commands are dynamically filled into the code template through the template engine technology to generate the final automatic burning script. Specifically, the program is written through Python's PySerial library and subprocess library to realize the control of the serial port and the PC terminal. Since the commonly used burning commands involve fastboot commands, adb commands, u-boot commands and terminal operation commands, the above common commands are integrated in the code template. In order to improve the encapsulation and code reusability of the automatic burning script and make its structure simple and clear, the object-oriented programming concept is adopted to design the serial port operation class and the terminal operation class, in which the basic operations of the serial port and the terminal commands are encapsulated into two classes. When dynamically mapping, only the serial port operation class and the terminal operation class need to be established. A set of basic operation instructions are obtained through the object calling function. These instructions define the actions that may need to be performed during the burning process. The operation and command entities and the function of calling the operation can be shown in Table 2:
[0079] Table 2
[0080] Operation and command entities Call the function of the operation class Restart serialService::reboot() Press Ctrl+C serialService::ctrlc() Fastboot flash bootbak G:\boot.img serialService::orderInput(order)
[0081] Then, these reference operation instructions are combined with the preset operation instructions, and a burning template is constructed by using the mapping relationship between the target keywords and the preset operations. It is only necessary to create objects according to the operation class and gradually add the object call functions corresponding to the operations and commands in the code template. Design corresponding functions for common operations in the operation class to establish mapping relationships. For command entities, string formatting technology is used to fill the commands as incoming parameters into the operation class command input function. This template is a framework that contains all the structures and logic required for burning operations. Finally, fill the specific burning instructions into this template to generate the final burning code. In addition, the results of the command execution need to be saved in the log file for the subsequent log analysis model. This code can be executed directly on the burning device to automatically complete the burning task. In short, this process creates an automated burning script by matching and fusing operation instructions and keywords, thereby improving the efficiency and accuracy of the burning operation.
[0082] Step S30, executing the burning operation according to the burning code, and feeding back the burning result.
[0083] It should be noted that the burning operation refers to the process of writing image files (such as operating systems, firmware, etc.) to embedded devices. This usually involves transferring data from a computer to the target device and performing necessary processing on the device to ensure that the data is correctly stored in the specified location, such as Flash memory or other types of non-volatile storage. The burning operation may include steps such as formatting the storage device, erasing old data, writing new data, and verifying the integrity of the written data. The burning result refers to the status after the burning operation is completed, which indicates whether the burning process was successful or whether an error was encountered. The burning result can be a successful confirmation, such as "burning completed, the image file has been successfully written to the device", or it can be a report of an error or exception, such as "burning failed, a storage device write protection error was found" or "burning process interrupted, the device did not respond." Burning results usually include error codes, reasons for failure, possible solutions, or suggestions for follow-up operations.
[0084] It is understood that the burning code is deployed to the burning device or control system, and then the burning process is started, which usually involves transferring the image file to the target embedded device through a serial port, network or other communication interface, and ensuring that the data is correctly written to the storage medium of the device. During the burning process, the system monitors the progress of the operation in real time, including the integrity of data transmission, the accuracy of writing, and the response status of the device. Once the burning operation is completed, the system will generate a burning result, which may include a success message indicating that the burning has been successfully completed, or an error report indicating any problems encountered during the burning process, such as communication failures, write errors, or data verification failures. These results are fed back to users or system administrators in the form of logs, user interface notifications, or return codes so that they can verify whether the burning is performed as expected, or take corrective measures if necessary. The automation of this process not only improves the efficiency and reliability of burning, but also reduces the possibility of human error and allows for faster diagnosis and resolution of problems.
[0085] This embodiment provides a method for automatically burning an image file. First, the burning document is preprocessed, including cleaning and word segmentation, to remove irrelevant characters and format problems, and the content is structured into sentences and words. This step ensures the data accuracy and effectiveness of subsequent operations. Then, the key burning instructions are automatically extracted from the processed document using an intelligent algorithm, which not only reduces the tediousness of manual operation, but also improves the accuracy and timeliness of instruction extraction, while reducing the risk of human error. Then, standardized burning codes are automatically generated through predefined templates, which not only saves the time of manual code writing, but also ensures the unified standard and format of the code, thereby improving the operating efficiency and the correctness of the code. Finally, the system automatically executes the generated burning code, reducing manual intervention and potential errors. During the burning process, the system monitors and feedbacks the burning status in real time, so that users can understand the burning results in time, respond to and handle any problems quickly, and effectively reduce the time for fault location and processing. In general, the burning instructions can be extracted efficiently and accurately through text cleaning and structured processing of the burning document. Automatic template generation of code reduces manual intervention and improves the consistency and accuracy of the code. Automatic execution of burning code and real-time feedback of results make the entire process more efficient, accurate and easy to control, significantly reducing the error rate and complexity of operation.
[0086] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 , Figure 3 This is a flow chart of the second embodiment of the automatic burning method of the image file of the present application. Step S30 of the automatic burning method of the image file includes steps S31-S32:
[0087] Step S31, checking the command structure statically according to the syntax tree, verifying the programming code, and obtaining the verification result;
[0088] It should be noted that static checking of command structure by syntax tree refers to the use of syntax analysis technology to verify whether the command structure in the burning code conforms to the predetermined syntax rules. In the context of burning code, static checking is usually used to ensure that the format of the burning command is correct, such as whether the number, type and order of parameters of the command are as expected, whether the correct syntax structure is used, etc. This kind of checking helps to find potential programming errors before the code is executed, thereby avoiding incorrect execution during the burning process. The verification result refers to the output obtained after the static checking of the syntax tree, which indicates whether the burning code has passed all syntax rule checks. If the code conforms to all predetermined syntax rules, the verification result will indicate that the code is correct and can be executed safely. On the contrary, if the check finds errors or irregular usage, the verification result will point out the specific problems, such as "parameter number mismatch", "unknown command", "type error", etc. The verification result is usually used to decide whether to perform the burning operation and whether the code needs to be modified or reviewed. In the automated burning system, the verification result can also be used to trigger the error handling process, such as reminding the user to correct the error, recording the error information to the log file, or automatically trying to correct some simple problems.
[0089] It is understandable that the burning code is compared with the predefined grammatical rules to verify whether the command structure in the code is correct. During the verification process, if the burning code fully complies with the grammatical rules, a result of passing the verification will be obtained, which means that the code can enter the subsequent burning execution stage. On the contrary, if it is found that there are places in the code that do not comply with the rules, the verification result will point out the problem in detail, such as missing parameters, command spelling errors, etc., so that developers can correct these problems in time to ensure the correct execution of the burning operation.
[0090] Step S32, if the verification result is no error, the programming operation is performed and completion information is fed back;
[0091] It is understandable that when the burning code passes the static check of the syntax tree, that is, the verification result shows that there are no syntax errors or structural problems in the code, the system will enter the burning execution phase. At this stage, the automated burning system will deploy the burning code to the burning device, start transferring the image file to the target embedded device, and monitor the entire burning process to ensure that the data is correctly written to the storage medium of the device. The burning operation may include steps such as erasing old data, writing new data, and verifying data integrity. The successful completion of the burning process will generate a completion message, which usually contains a status flag of successful burning, a timestamp of burning completion, and other relevant information, such as the burning time, the amount of data written, etc. The completion information will be fed back to the user or system administrator through system logs, user interface prompts, or message notifications to confirm that the burning task has been successfully completed as expected.
[0092] Step S33: If the verification result is an error, an error message is fed back and an analysis result is obtained through an abnormality detection method.
[0093] It should be noted that the anomaly detection method refers to a mechanism or algorithm used by the system to identify and respond to errors when the verification results of the burned code indicate that there are errors. The anomaly detection method may include real-time monitoring of error information, analysis of error logs, and matching of known error patterns. The purpose of this method is to quickly identify the problem so that appropriate remedial measures can be taken. The analysis result refers to the conclusion drawn by the anomaly detection method after processing the error information. This usually includes a detailed description of the error, possible causes, scope of impact, and recommended solutions. The analysis result can help users or system administrators understand the nature of the error and effectively solve the problem.
[0094] It is understandable that when verifying the burning code, if an error is found, the system will feedback specific error information, including error code and description. Then, the system automatically uses anomaly detection technology to analyze the cause of the error, which may use methods such as log analysis or fault tree analysis. After completing the analysis, the system will provide a report containing diagnostic information and solution suggestions to help users quickly solve the problem, reduce the impact of burning failure, and ensure that the burning task proceeds smoothly. This process enhances the reliability of the system and user experience.
[0095] As an example, error information is fed back and analysis results are obtained through an abnormality detection method, including: obtaining a generation log of the burning code; obtaining target error keywords based on the target burning document and preset error keywords; obtaining related error logs based on the generation log and the target error keywords; and analyzing the error logs to obtain analysis results.
[0096] Among them, the generated log refers to the detailed operation record automatically recorded by the system during the creation process of the burning code. These logs contain each step of the code generation process, the parameters used, the function calls, and any system-generated messages or warnings. The preset error keywords are a set of specific words or phrases pre-defined by the system to identify errors. These keywords are usually associated with known failure modes or error types, such as "failure", "error", "timeout", etc. The target error keywords refer to the error keywords that are selected from the preset error keywords and are particularly related to the current burning task. These keywords are determined based on the content and context of the target burning document and are used to more accurately identify and handle errors that may occur during the burning process. The relevant error logs refer to those log entries in the logs generated during the burning process that contain the target error keywords. These log entries are directly related to the problems that occurred during the burning process and are the key source of information for analyzing and diagnosing problems. The analysis results refer to the conclusions drawn after in-depth analysis of the relevant error logs. This includes the judgment of the type, cause, and scope of impact of the error, as well as possible solutions or recommended repair measures. Among them, the target error keywords can be composed of error keywords and warning keywords, as shown in Table 3:
[0097] Table 3
[0098]
[0099] Specifically, first, the detailed logs in the burning code generation process are captured and recorded. These logs contain each step of the code generation and system status information. Then, according to the target burning document and a set of predefined error keywords, determine which keywords are error indicators that are particularly suitable for the current burning task to form target error keywords. Then, scan the generation log to find the log entries containing these target error keywords, which constitute the relevant error logs. Finally, by deeply analyzing these error logs, identify the root cause of the problem, provide detailed information about the error and possible solutions, which is the analysis result. By automatically analyzing the log data, it helps developers or system administrators understand and solve problems encountered in the burning process.
[0100] As an example, the error log is analyzed to obtain an analysis result, including: based on the error log, searching a preset case library to obtain a search result; if the search result is a mismatch, updating the error log to the preset case library; if the search result is a match, feedback of the cause of the burning error and the corresponding solution is provided according to the preset case library.
[0101] Among them, the preset case library is a database or knowledge base that contains various error cases and their solutions encountered in the historical programming process. This library is used to store information such as descriptions of error conditions, cause analysis, solutions, and preventive measures, so that it can be quickly retrieved and referenced when encountering similar problems in the future. The retrieval result refers to the match obtained after searching for a specific error log in the preset case library. If the error log matches a case in the case library, the retrieval result will provide detailed information about the case, including the cause of the error and the solution, as shown in Table 4:
[0102] Table 4
[0103]
[0104] Specifically, based on the information recorded in the error log, a search is performed in the preset case library to find out whether there are similar error cases and solutions. If the search results show that there are no matching cases, this indicates that the current error is newly encountered, and the system will add the error log as a new case to the preset case library for future reference. If the search results find a matching case, the system will provide the cause of the error and recommended solutions based on the information in the case library to help users quickly locate the problem and take appropriate measures. This process not only improves the efficiency of error handling, but also enhances the system's ability to handle unknown errors by continuously updating the case library, thereby improving the overall programming reliability and user experience.
[0105] This embodiment first verifies whether the syntax structure of the burning code is correct through syntax tree analysis to ensure that the code complies with the predetermined format and rules. The burning code is strictly statically checked. If there is no problem with the code, the burning operation is executed and confirmed to be successful. The burning operation will be executed and the image file will be written to the target device; if there is a problem with the code, detailed error information is provided, and the cause of the problem is analyzed using an abnormality detection method, and a solution is finally given. This embodiment ensures the accuracy and reliability of the burning operation, and can provide clear guidance when encountering problems, speeding up the problem solving process.
[0106] For example, in order to help understand the implementation process of the image file automatic burning method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 4 , Figure 4 A brief flowchart of an automatic image file burning method is provided, specifically:
[0107] First, the original burning document is obtained, and then the document is cleaned and word-segmented to generate a structured target burning document. Next, the burning instructions are extracted from the target document using word embedding technology and preset algorithms, and the burning code is automatically generated through the burning template. After the burning code is verified by the static command structure, if there is no error, the burning operation is performed and the completion information is fed back; if the verification fails, the error is analyzed by the anomaly detection method, the generation log is obtained, the preset error keywords are matched, the error log is analyzed, and the cause and solution of the error are provided according to the preset case library, or the new error case is updated to the case library, so as to achieve efficient and accurate burning operations and optimize future burning tasks.
[0108] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the automatic burning method of the image file of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0109] This application also provides an automatic image file burning device, please refer to Figure 5 , the image file automatic burning device comprises:
[0110] The acquisition module 10 is used to acquire an initial burning document, perform text cleaning and word segmentation operations on the initial burning document to obtain a target burning document, and extract burning instructions according to the target burning document;
[0111] A generating module 20, configured to automatically generate a burning code through a burning template based on the burning instruction;
[0112] The execution module 30 is used to execute the burning operation according to the burning code and feed back the burning result.
[0113] The automatic image file burning device provided by the present application adopts the automatic image file burning method in the above embodiment, which can solve the technical problem of how to automate the image file burning process. Compared with the prior art, the beneficial effects of the automatic image file burning device provided by the present application are the same as the beneficial effects of the automatic image file burning method provided by the above embodiment, and other technical features in the automatic image file burning device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0114] In one embodiment, the acquisition module 10 is also used to vectorize the target burning document according to the word embedding vector to obtain a semantic feature vector; based on a preset algorithm, a preset label and the semantic feature vector, obtain a label probability, and the label probability is the probability that a character in the target burning document corresponds to the preset label; based on the label probability, obtain a label analysis sequence; based on the label analysis sequence, obtain a burning instruction.
[0115] In one embodiment, the acquisition module 10 is further used to acquire reference keywords according to the target burning document; obtain target keywords based on preset keywords in a preset keyword library and reference keywords; and obtain burning instructions through the target keywords based on the annotation analysis sequence.
[0116] In one embodiment, the generation module 20 is also used to obtain the object calling function to obtain a reference operation instruction; based on the preset operation instruction and the reference operation instruction, according to the mapping relationship between the target keywords, a burning template is obtained; based on the burning instruction and the burning template, a burning code is obtained.
[0117] In one embodiment, the execution module 30 is also used to statically check the command structure according to the syntax tree, verify the burning code, and obtain the verification result; if the verification result is no error, the burning operation is executed and the completion information is fed back; if the verification result is an error, the error information is fed back and the analysis result is obtained through the abnormality detection method.
[0118] In one embodiment, the execution module 30 is also used to obtain the generation log of the burning code; obtain target error keywords based on the target burning document and preset error keywords; obtain related error logs based on the generation log and the target error keywords; and analyze the error log to obtain analysis results.
[0119] In one embodiment, the execution module 30 is also used to search the preset case library based on the error log to obtain a search result; if the search result is a mismatch, the error log is updated to the preset case library; if the search result is a match, the cause of the burning error and the corresponding solution are fed back according to the preset case library.
[0120] The present application provides an automatic image file burning device, which includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the automatic image file burning method in the above-mentioned embodiment 1.
[0121] Reference below Figure 6, which shows a schematic diagram of the structure of an image file automatic burning device suitable for implementing the embodiment of the present application. The image file automatic burning device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The image file automatic burning device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0122] like Figure 6 As shown, the image file automatic burning device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the image file automatic burning device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the image file automatic burning device to communicate wirelessly or wired with other devices to exchange data. Although the image file automatic burning device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0123] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0124] The automatic image file burning device provided by the present application adopts the automatic image file burning method in the above embodiment, which can solve the technical problem of how to automate the image file burning process. Compared with the prior art, the beneficial effects of the automatic image file burning device provided by the present application are the same as the beneficial effects of the automatic image file burning method provided by the above embodiment, and other technical features in the automatic image file burning device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0125] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0126] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0127] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the automatic burning method of the image file in the above-mentioned embodiment.
[0128] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0129] The computer-readable storage medium may be included in the image file automatic burning device; or may exist independently without being assembled into the image file automatic burning device.
[0130] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the image file automatic burning device, the image file automatic burning device: obtains an initial burning document, performs text cleaning and word and sentence segmentation operations on the initial burning document to obtain a target burning document, and extracts burning instructions according to the target burning document; based on the burning instructions, automatically generates a burning code through a burning template; according to the burning code, executes the burning operation and feeds back the burning result.
[0131] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0134] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned automatic image file burning method, and can solve the technical problem of how to automate the image file burning process. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the automatic image file burning method provided by the above-mentioned embodiment, and will not be repeated here.
[0135] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for automatically burning an image file when executed by a processor.
[0136] The computer program product provided by the present application can solve the technical problem of how to automate the image file burning process. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the image file automatic burning method provided by the above embodiment, which will not be repeated here.
[0137] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for automatically burning an image file, characterized in that: The method comprises: Obtain the initial burning document, perform text cleaning and word segmentation operations on the initial burning document, obtain the target burning document, and extract the burning instructions according to the target burning document; Based on the burning instruction, automatically generate burning code through a burning template; According to the programming code, the programming operation is performed and the programming result is fed back.
2. The method according to claim 1, characterized in that: The step of extracting the burning instruction according to the target burning document comprises: According to the word embedding vector, the target burning document is represented by a vector to obtain a semantic feature vector; Based on a preset algorithm, a preset label and the semantic feature vector, a label probability is obtained, where the label probability is a probability that a character in the target burning document corresponds to the preset label; Based on the label probabilities, obtaining a label analysis sequence; Based on the annotation analysis sequence, a programming instruction is obtained.
3. The method according to claim 2, characterized in that The step of obtaining a programming instruction based on the marked analysis sequence includes: According to the target burning document, obtain reference keywords; Based on the preset keywords in the preset keyword library and the reference keywords, the target keywords are obtained; Based on the marked analysis sequence, a burning instruction is obtained through the target keyword.
4. The method according to any one of claims 1 to 3, characterized in that The method of automatically generating a burning code based on the burning instruction by using a burning template includes: Get the object calling function and get the reference operation instruction; Based on the preset operation instruction and the reference operation instruction, according to the mapping relationship of the target keyword, a burning template is obtained; Based on the burning instruction and the burning template, a burning code is obtained.
5. The method according to claim 1, characterized in that The performing of the burning operation according to the burning code and feeding back the burning result includes: According to the syntax tree, the command structure is statically checked, and the programming code is verified to obtain the verification result; If the verification result is no error, the programming operation is performed and the completion information is fed back; If the verification result is an error, the error message is fed back and the analysis result is obtained through the anomaly detection method.
6. The method according to claim 5, characterized in that The feedback error information and the analysis results obtained by the anomaly detection method include: Obtaining a generation log of the burning code; Based on the target programming document and preset error keywords, a target error keyword is obtained; Based on the generated log and the target error keyword, obtain a related error log; The error log is analyzed to obtain an analysis result.
7. The method according to claim 6, characterized in that The analyzing the error log to obtain an analysis result includes: Based on the error log, a preset case library is searched to obtain a search result; If the search result is no match, the error log is updated to the preset case library; If the search result is a match, the cause of the programming error and the corresponding solution are fed back according to the preset case library.
8. An automatic image file burning device, characterized in that: The device comprises: The acquisition module is used to acquire the initial burning document, perform text cleaning and word segmentation operations on the initial burning document, obtain the target burning document, and extract the burning instructions according to the target burning document; A generation module, used for automatically generating a burning code through a burning template based on the burning instruction; The execution module is used to execute the burning operation according to the burning code and feed back the burning result.
9. An automatic image file burning device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the automatic burning method for an image file according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the automatic burning method of the image file according to any one of claims 1 to 7 are implemented.