Full-automatic industrial production line analysis method and system

By exporting and inserting tagged PLC code and combining it with a large model to generate response text, the problems of PLC program invisibility and limited scalability are solved, and real-time natural language display of PLC progress and highly scalable applications with zero migration cost are achieved.

CN120654822APending Publication Date: 2025-09-16ZHEJIANG VOCATIONAL COLLEGE OF COMMERCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510737260.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing industrial monitoring systems have problems such as invisible PLC program operation, low human-computer interaction efficiency, and limited scalability. As a result, on-site personnel cannot intuitively understand the PLC operation progress, fault diagnosis is difficult, and it is difficult to adapt to process changes.

Method used

Export PLC code through Siemens' official automation interface, perform insertion marking and write back, read PLC data in real time, use large models to generate response text, achieve white-boxing of PLC programs and business understanding, and support natural language presentation.

Benefits of technology

It achieves visibility and business understanding of PLC programs, enables real-time monitoring of PLC progress without professional knowledge, supports multiple data display formats, and can be migrated to different production lines without modification, with zero migration cost and high scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654822A_ABST
    Figure CN120654822A_ABST
Patent Text Reader

Abstract

The invention discloses a full-automatic industrial production line analysis method and system, and the method comprises the steps: automatically exporting a PLC code through a Siemens official automation interface, and writing the PLC code into a server file system; performing instrumentation marking on the exported PLC code through a global variable, writing back the PLC code into a TIA Portal engineering project, and downloading the PLC code into PLC equipment; global variables in the data blocks corresponding to the PLC are read in real time, and all codes executed at the current moment are retrieved and matched in the PLC codes subjected to instrumentation marking; collecting PLC codes, and constructing the PLC codes into a JSON data set adaptive to the large model based on an industrial production line customization scene so as to train the large model; and obtaining a response text generated by the large model based on the trained large model. According to the method, the execution progress of the current PLC program can be automatically synchronized in real time and displayed in a natural language form, and zero migration cost is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial production line analysis technology, and in particular to a fully automatic industrial production line analysis method and system. Background Art

[0002] Existing industrial monitoring systems primarily rely on PLC registers to collect I / O signals and display them via an HMI (Human-Machine Interface) touchscreen or host computer to monitor progress. This presents the following drawbacks: ① Black-box execution logic: The PLC program execution process is difficult to intuitively understand, relying on the experience of experienced engineers to infer the execution phase. Field personnel cannot fully grasp the specific PLC's progress; fault diagnosis requires line-by-line code review, which is time-consuming and prone to misjudgment. ② Inefficient human-computer interaction: The HMI only displays the status of collected I / O tags and lacks business semantics. Field personnel cannot understand the connection between I / O tags and business status; field personnel require professional training to understand the code logic. ③ Limited scalability: Custom development is costly and difficult to adapt to process changes. Every change in signal logic requires modifications to the touchscreen display logic, PLC program, and PLC register logic. Interface development requires cross-device collaboration and re-negotiation of DB (data block) addresses, variable formats, visualization formats, sampling frequencies, and other specifications.

[0003] Therefore, there is an urgent need for a fully automatic industrial production line analysis system to solve the above problems. Summary of the Invention

[0004] The purpose of the present invention is to provide a fully automatic industrial production line analysis method and system to address the deficiencies of the existing technology.

[0005] The object of the present invention is achieved through the following technical solutions: In a first aspect, an embodiment of the present invention provides a fully automatic industrial production line analysis method, comprising the following steps:

[0006] (1) Automatically export the PLC code through the Siemens official automation interface and write it to the server file system;

[0007] (2) Mark the automatically exported PLC code with a stub mark using the global variable CurrentLine, and write the marked PLC code back to the TIA Portal project, and then download it to the PLC device;

[0008] (3) Read the global variable CurrentLine in the corresponding data block of the PLC in real time, and search the PLC code after the stub mark to match all the codes online_code executed at the current moment;

[0009] (4) Collect PLC codes, construct them into a JSON dataset adapted to the large model based on the customized scenario of the industrial production line, and use the dataset to train the large model; based on the trained large model, obtain the response text generated by the large model according to the global variable CurrentLine and code online_code read in step (3).

[0010] Furthermore, the step (1) specifically includes the following sub-steps:

[0011] (1.1) Use the C#TIA Openness API interface to open the TIAPortal project;

[0012] (1.2) Retrieve the CPU name of the corresponding PLC, obtain the device object, read the PLC code file in the CPU, and load it into the memory, naming the PLC code src_plc_code;

[0013] (1.3) Deploy the intranet Python server, use the pythonnet library, and call the C# DLL program in step (1.2) to write the src_plc_code code to the server file system.

[0014] Furthermore, the step (2) specifically includes the following sub-steps:

[0015] (2.1) Predefine the global variable CurrentLine in the TIA Portal project, assign a data block and offset to it, and configure it to allow PUT / GET communication access;

[0016] (2.2) Check the variable annotations of the variables in the src_plc_code code. When the proportion of unannotated variable names exceeds the preset value p, a pop-up window prompts;

[0017] (2.3) Based on the global variable CurrentLine, use a Python script to automatically insert line numbers into the exported PLC code, obtain the inserted PLC code, name it updated_code, and write the updated_code code into the server file system;

[0018] (2.4) Call the Openness API interface through pythonnet to obtain the device object and write the instrumented code updated_code into the TIAPortal project;

[0019] (2.5) Call the Openness API interface through pythonnet, trigger the compilation, establish an online link with the PLC, and download the updated_code code into the PLC device.

[0020] Furthermore, the step (3) specifically includes the following sub-steps:

[0021] (3.1) The Python server communicates with the PLC device through the snap7 library, and reads the global variable CurrentLine in the PLC's corresponding DB block in a round-robin manner and saves it in memory;

[0022] (3.2) The global variable CurrentLine read in step (3.1) is used as the end global variable CurrentLine. The line number that matches the global variable CurrentLine is searched in the PLC code after the stub mark. All codes that match the end global variable CurrentLine are also searched, that is, all codes that have been executed by the production line up to the current moment. The code is named online_code and saved in memory.

[0023] Furthermore, the step (4) specifically includes the following sub-steps:

[0024] (4.1) Collect and annotate PLC codes to construct them into a JSON dataset suitable for the large model;

[0025] (4.2) Load the word segmenter from the large model base model to obtain the vocabulary corresponding to the model;

[0026] (4.3) Use the vocabulary obtained in step (4.2) to map the text in the JSON dataset to the corresponding index input_ids and generate the word embedding matrix embedding;

[0027] (4.4) Using the JSON format data in the JSON dataset obtained in step (4.3) as training samples, fine-tune the base model using the LORA method. During the fine-tuning process, only the parameters of the low-rank matrix r in the base model are fine-tuned, and the remaining parameters in the base model are frozen. After the training is completed, a trained large model is obtained;

[0028] (4.5) The trained large model is deployed on the intranet server. Whenever the large model is called, the following process is executed: first, the global variable CurrentLine and the code online_code read in step (3) are loaded; then the above data are spliced ​​with the prompt word prompt; then the spliced ​​prompt format data is input into the trained large model for prediction, and the response text generated by the large model is named text and saved in memory.

[0029] Furthermore, after step (4), the method further includes:

[0030] The response text generated by the large model is used as data input for downstream services to implement the functions required by the corresponding downstream services; wherein, the downstream services include voice playback and digital human playback.

[0031] A second aspect of an embodiment of the present invention provides a system for implementing the above-mentioned fully automatic industrial production line analysis method, comprising:

[0032] PLC code automatic export module, used to automatically export PLC code through Siemens official automation interface and write it to the server file system;

[0033] The PLC code automated instrumentation and code writeback module is used to instrument the automatically exported PLC code using the global variable CurrentLine and write the instrumented PLC code back to the TIA Portal project for downloading to the PLC device.

[0034] The current progress real-time reading module is used to read the global variable CurrentLine in the corresponding data block of the PLC in real time, and retrieve all the codes online_code that match the current moment in the PLC code after the stub mark;

[0035] The industrial production line analysis result acquisition module is used to collect PLC code, construct it into a JSON dataset adapted to the large model based on the customized industrial production line scenario, and use this dataset to train the large model. Based on the trained large model, the global variable CurrentLine and code online_code read in the module are read in real time according to the current progress to obtain the response text generated by the large model.

[0036] Furthermore, the system also includes a downstream extension module, which is used to use the response text obtained by the industrial production line analysis result acquisition module as data input for the downstream service to achieve the functions required by the corresponding downstream service.

[0037] A third aspect of an embodiment of the present invention provides a fully automatic industrial production line analysis device, comprising one or more processors and a memory, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned fully automatic industrial production line analysis method.

[0038] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, is used to implement the above-mentioned fully automatic industrial production line analysis method.

[0039] The beneficial effects of the present invention are as follows: the present invention solves the problem of PLC programs being visible but not understandable by white-boxing the PLC code, upgrading from signal monitoring to business understanding; the present invention does not require shutdown debugging or log collection, and does not require the participation of senior engineers, and can automatically synchronize the progress of the current PLC program execution in real time and display it in the form of natural language, so that on-site personnel can understand business progress without professional knowledge; the present invention can be migrated to any PLC-controlled industrial production line without modification, and can automatically adapt to changes in the production line code logic without any adjustment, achieving zero migration cost; the present invention has high scalability, and the downstream can be connected to any form of data display, including subtitle display, voice broadcast, digital human broadcast, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a flow chart of the fully automatic industrial production line analysis method of the present invention;

[0041] Figure 2 It is a structural schematic diagram of the fully automatic industrial production line analysis system of the present invention;

[0042] Figure 3 It is a structural schematic diagram of the fully automatic industrial production line analysis device of the present invention. DETAILED DESCRIPTION

[0043] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0044] The terms used in this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The singular forms "a," "the," and "the" used in this invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0045] It should be understood that although the terms "first," "second," "third," etc. may be used in the present invention to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."

[0046] The present invention will be described in detail below with reference to the accompanying drawings. Unless there is any conflict, the features of the following embodiments and implementations may be combined with each other.

[0047] See also Figure 1 The fully automatic industrial production line analysis method of the present invention specifically includes the following steps:

[0048] (1) Automatically export the PLC code through the Siemens official automation interface and write it to the server file system.

[0049] (1.1) Use the C# TIA Openness API to open the TIA Portal project. The TIA Openness API is an automation programming interface provided by Siemens. It allows developers to automate TIA Portal projects through external programs (such as C# and VB.NET), enabling batch processing and customized tool development.

[0050] (1.2) Retrieve the CPU name of the corresponding PLC, obtain the device object, read the PLC code file in the CPU, and load it into the memory, naming the PLC code src_plc_code.

[0051] (1.3) Deploy the intranet Python server, use the pythonnet library, and call the C# DLL program in step (1.2) to write the src_plc_code code to the server file system.

[0052] (2) The automatically exported PLC code is marked with a stub through the global variable CurrentLine, and the marked PLC code is written back to the TIA Portal project and then downloaded into the PLC device.

[0053] (2.1) Predefine the global variable CurrentLine in the TIA Portal project, assign it a data block (DB block) and offset, and configure it to allow PUT / GET communication access. The DB block and offset are assigned to the global variable CurrentLine. The DB block is used to store the global variable CurrentLine. The offset can be understood as the memory address where the global variable CurrentLine is stored in the PLC. The Python server can only read and write the global variable CurrentLine through this memory address. Allowing PUT / GET communication access is a configuration item in the TIA Portal project and is a necessary condition for interacting with the Python server.

[0054] (2.2) Check the variable annotations of the variables in the src_plc_code code. When the proportion of unannotated variable names exceeds the preset value p, a pop-up window prompts.

[0055] (2.3) Based on the global variable CurrentLine, use a Python script to automatically insert line numbers into the exported PLC code, obtain the inserted PLC code, name it updated_code, and write the updated_code code into the server file system. For example:

[0056]

[0057] (2.4) Call the Openness API interface through pythonnet to obtain the device object and write the code updated_code after the instrumentation mark to the TIAPortal project.

[0058] (2.5) Call the Openness API interface through pythonnet, trigger the compilation, establish an online link with the PLC, and download the updated_code code into the PLC device.

[0059] (3) Read the global variable CurrentLine in the PLC corresponding DB block in real time, and search the PLC code after the stub mark to find all the codes online_code that have been executed at the current moment.

[0060] (3.1) The Python server communicates with the PLC device through the snap7 library, and reads the global variable CurrentLine in the PLC's corresponding DB block in a round-robin manner and saves it in memory.

[0061] (3.2) Use the global variable CurrentLine read in step (3.1) as the end global variable CurrentLine. Search the line number that matches the global variable CurrentLine in the PLC code after the stub mark. Then search all the code that matches the end global variable CurrentLine, that is, all the code that has been executed by the production line up to the current moment, name it online_code, and save it in memory. For example, suppose the PLC code after the stub mark is:

[0062] xxx

[0063] CurrentLine:=1

[0064] xxx

[0065] CurrentLine:=2

[0066]

[0067] xxx

[0068] CurrentLine:=10

[0069] xxx

[0070] CurrentLine:=11

[0071] In step (3.1), the global variable CurrentLine = 10 is read from the PLC device's DB. The PLC code after the stub marker is matched from the first line up to the line where CurrentLine: = 10. Each search and match begins at the first line of code. The matched PLC code is the code currently executed by the PLC, i.e., the current progress. The large model in subsequent steps interprets the current progress, i.e., the matched code, into natural language that can be understood by ordinary people.

[0072] (4) Collect the PLC code, construct it into a JSON dataset adapted to the large model (LLM) based on the customized scenario of the industrial production line, and use the dataset to train the LLM; based on the trained LLM, obtain the response text generated by the LLM according to the global variable CurrentLine and the code online_code read in step (3).

[0073] (4.1) Collect and annotate the PLC code to construct it into a JSON dataset suitable for LLM. The format is as follows:

[0074]

[0075] (4.2) Load the tokenizer from the DeepSeek LLM base model to obtain the vocabulary corresponding to the model.

[0076] (4.3) Use the vocabulary obtained in step (4.2) to map the text in the JSON dataset to the corresponding index input_ids and generate the word embedding matrix embedding. Where input_ids represents the index corresponding to each word in the vocabulary.

[0077] It should be understood that the text in the JSON dataset must first be mapped to an index before calculation. However, the index is a sparse vector and has low training efficiency, so it needs to be converted into a dense vector, namely the word embedding matrix embedding.

[0078] (4.4) Use the JSON format data in the JSON dataset obtained in step (4.3) as training samples, and use the LORA method to fine-tune the base model. During the fine-tuning process, only the parameters of the low-rank matrix r in the base model are fine-tuned, and the remaining parameters in the base model are frozen. After the training is completed, the trained LLM is obtained.

[0079] Specifically, LLM is trained using the LORA method, which is a specific and commonly used method for training and fine-tuning large models. The input and output of LLM are both text, and the context is predicted based on the previous context of the input. For example, when training LLM using training samples, the input of LLM is:

[0080]

[0081] The output is: "Assistant": "The throttle sensor has been detected and the motorcycle has started."

[0082] The training goal is to ensure that the text sequence output by the LLM is as accurate as possible. During training, most parameters in the base model are frozen, and only the parameters of the low-rank matrix r in the base model are fine-tuned. After training is completed, the trained LLM is obtained.

[0083] (4.5) Deploy the trained LLM on the intranet server. Whenever the LLM is called, the following process is executed: first, load the global variable CurrentLine and the code online_code read in step (3); then concatenate the above data with the prompt word prompt to form the following input format:

[0084]

[0085] The spliced ​​prompt format data is then fed into the trained LLM for prediction. The LLM's generated response text is named "text" and stored in memory. "Text" is a natural language explanation of all the code executed on the production line up to that point, allowing all on-site staff, without technical background, to understand the current production status.

[0086] It should be noted that steps (1) to (4) are all related to the industrial production line. The PLC is the controller of the industrial production line. Interacting with the PLC means interacting with the industrial production line. In addition, as long as the Python server and the PLC are connected to the same local area network via a network cable, steps (1) to (4) are fully automatic, that is, a fully automatic process led by the Python server program.

[0087] In some other embodiments, after step (4), the method further includes: using the response text generated by the LLM as data input for any form of downstream service to implement the functions required by the corresponding downstream service. The downstream services include voice playback, digital human playback, etc. For example, the response text generated by the LLM is converted into voice playback, or the response text generated by the LLM is converted into digital human playback, or the response text generated by the LLM is input into another large model, and its output is sent to the person in charge of the production line via SMS, etc.

[0088] It is worth mentioning that the embodiment of the present invention also provides a fully automatic industrial production line analysis system for implementing the fully automatic industrial production line analysis method of the above embodiment. Figure 2 As shown, the system includes a PLC code automatic export module, a PLC code automatic insertion and code write-back module, a current progress real-time reading module and an industrial production line analysis result acquisition module.

[0089] In this embodiment, the PLC code automatic export module is used to automatically export the PLC code through the Siemens official automation interface and write it to the server file system.

[0090] In this embodiment, the PLC code automatic instrumentation and code writeback module is used to mark the automatically exported PLC code with an instrumentation mark through the global variable CurrentLine, and write the marked PLC code back to the TIA Portal project, and then download it into the PLC device.

[0091] In this embodiment, the current progress real-time reading module is used to read the global variable CurrentLine in the PLC corresponding DB block in real time, and retrieve all the codes online_code that match those executed at the current moment in the PLC code after the stub mark.

[0092] In this embodiment, the industrial production line analysis result acquisition module is used to collect PLC codes, construct them into a JSON data set adapted to the large model (LLM) based on the customized scenario of the industrial production line, and use the data set to train the LLM; based on the trained LLM, the global variable CurrentLine and code online_code read in the module are read in real time according to the current progress to obtain the response text generated by the LLM.

[0093] Furthermore, the system also includes a downstream extension module, which is used to use the response text text obtained by the industrial production line analysis result acquisition module as data input for any form of downstream service to achieve the functions required by the corresponding downstream service.

[0094] In summary, the present invention solves the problem of PLC programs being visible but not understandable by white-boxing the PLC code, and upgrades signal monitoring to business understanding; the present invention does not require shutdown debugging or log collection, and does not require the participation of senior engineers, and can automatically synchronize the progress of the current PLC program execution in real time and display it in the form of natural language, so that on-site personnel can understand business progress without professional knowledge; the present invention can be migrated to any PLC-controlled industrial production line without modification, and can automatically adapt to changes in the production line code logic without making any adjustments. The python server can be directly moved to any production line with a PLC as the controller without modifying the hardware configuration or the code, achieving zero migration cost; the present invention has high scalability, and the downstream can be connected to any form of data display, including subtitle display, voice broadcast, digital human broadcast, etc.

[0095] Corresponding to the aforementioned embodiment of the fully automatic industrial production line analysis method, the present invention also provides an embodiment of a fully automatic industrial production line analysis device.

[0096] See also Figure 3 An embodiment of the present invention provides a fully automatic industrial production line analysis device, including one or more processors and a memory, and the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the fully automatic industrial production line analysis method in the above embodiment.

[0097] The embodiment of the fully automatic industrial production line analysis device of the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capabilities in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution. From the hardware level, if Figure 3 The figure shows a hardware structure diagram of any device with data processing capability where the fully automatic industrial production line analysis device of the present invention is located. Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.

[0098] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0099] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present invention. A person of ordinary skill in the art can understand and implement the present invention without inventive work.

[0100] An embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the fully automatic industrial production line analysis method in the above embodiment is implemented.

[0101] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or memory. The computer-readable storage medium may also be any device with data processing capabilities, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capabilities and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.

[0102] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A fully automatic industrial production line analysis method, characterized in that: The following steps are involved: (1) Automatically export the PLC code through the Siemens official automation interface and write it to the server file system; (2) Mark the automatically exported PLC code with a stub mark using the global variable CurrentLine, and write the marked PLC code back to the TIA Portal project, and then download it to the PLC device; (3) Read the global variable CurrentLine in the corresponding data block of the PLC in real time, and search the PLC code after the stub mark to match all the codes online_code executed at the current moment; (4) Collect PLC codes, construct them into a JSON dataset adapted to the large model based on the customized scenario of the industrial production line, and use the dataset to train the large model; based on the trained large model, obtain the response text generated by the large model according to the global variable CurrentLine and code online_code read in step (3).

2. The fully automatic industrial production line analysis method according to claim 1, characterized in that: The step (1) specifically includes the following sub-steps: (1.1) Use the C#TIAOpenness API interface to open the TIA Portal project; (1.2) Retrieve the CPU name of the corresponding PLC, obtain the device object, read the PLC code file in the CPU, and load it into the memory, naming the PLC code src_plc_code; (1.3) Deploy the intranet Python server, use the pythonnet library, and call the C# DLL program in step (1.2) to write the src_plc_code code to the server file system.

3. The fully automatic industrial production line analysis method according to claim 1, characterized in that: The step (2) specifically includes the following sub-steps: (2.1) Predefine the global variable CurrentLine in the TIA Portal project, assign a data block and offset to it, and configure it to allow PUT / GET communication access; (2.2) Check the variable annotations of the variables in the src_plc_code code. When the proportion of unannotated variable names exceeds the preset value p, a pop-up window prompts; (2.3) Based on the global variable CurrentLine, use a Python script to automatically insert line numbers into the exported PLC code, obtain the inserted PLC code, name it updated_code, and write the updated_code code into the server file system; (2.4) Call the Openness API interface through pythonnet to obtain the device object and write the instrumented code updated_code into the TIA Portal project; (2.5) Call the Openness API interface through pythonnet, trigger the compilation, establish an online link with the PLC, and download the updated_code code into the PLC device.

4. The fully automatic industrial production line analysis method according to claim 1, characterized in that: The step (3) specifically includes the following sub-steps: (3.1) The Python server communicates with the PLC device through the snap7 library, and reads the global variable CurrentLine in the PLC's corresponding DB block in a round-robin manner and saves it in memory; (3.2) The global variable CurrentLine read in step (3.1) is used as the end global variable CurrentLine. The line number that matches the global variable CurrentLine is searched in the PLC code after the stub mark. All codes that match the end global variable CurrentLine are also searched, that is, all codes that have been executed by the production line up to the current moment. The code is named online_code and saved in memory.

5. The fully automatic industrial production line analysis method according to claim 1, characterized in that: The step (4) specifically includes the following sub-steps: (4.1) Collect and annotate PLC codes to construct them into a JSON dataset suitable for the large model; (4.2) Load the word segmenter from the large model base model to obtain the vocabulary corresponding to the model; (4.3) Use the vocabulary obtained in step (4.2) to map the text in the JSON dataset to the corresponding index input_ids and generate the word embedding matrix embedding; (4.4) Using the JSON format data in the JSON dataset obtained in step (4.3) as training samples, fine-tune the base model using the LORA method. During the fine-tuning process, only the parameters of the low-rank matrix r in the base model are fine-tuned, and the remaining parameters in the base model are frozen. After the training is completed, a trained large model is obtained; (4.5) The trained large model is deployed on the intranet server. Whenever the large model is called, the following process is executed: first, the global variable CurrentLine and the code online_code read in step (3) are loaded; then the above data are spliced ​​with the prompt word prompt; then the spliced ​​prompt format data is input into the trained large model for prediction, and the response text generated by the large model is named text and saved in memory.

6. The fully automatic industrial production line analysis method according to claim 1, characterized in that: After step (4), the method further comprises: The response text generated by the large model is used as data input for downstream services to implement the functions required by the corresponding downstream services; wherein, the downstream services include voice playback and digital human playback.

7. A system for implementing the fully automatic industrial production line analysis method according to any one of claims 1 to 6, characterized in that: include: PLC code automatic export module, used to automatically export PLC code through Siemens official automation interface and write it to the server file system; The PLC code automated instrumentation and code writeback module is used to instrument the automatically exported PLC code using the global variable CurrentLine and write the instrumented PLC code back to the TIA Portal project for downloading to the PLC device. The current progress real-time reading module is used to read the global variable CurrentLine in the corresponding data block of the PLC in real time, and retrieve all the codes online_code that match the current moment in the PLC code after the stub mark; The industrial production line analysis result acquisition module is used to collect PLC code, construct it into a JSON dataset adapted to the large model based on the customized industrial production line scenario, and use this dataset to train the large model. Based on the trained large model, the global variable CurrentLine and code online_code read in the module are read in real time according to the current progress to obtain the response text generated by the large model.

8. The system according to claim 7, characterized in that The system also includes a downstream expansion module, which is used to use the response text obtained by the industrial production line analysis result acquisition module as data input for downstream services to achieve the functions required by the corresponding downstream services.

9. A fully automatic industrial production line analysis device, comprising one or more processors and a memory, characterized in that: The memory is coupled to the processor; wherein, the memory is used to store program data, and the processor is used to execute the program data to implement the fully automatic industrial production line analysis method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that A program is stored thereon, which, when executed by a processor, is used to implement the fully automatic industrial production line analysis method according to any one of claims 1 to 6.