Generation method of function block diagram and related device

By using pre-trained functional block control loop identification model and functional block diagram generation model in the functional block diagram generation system in the field of industrial automation, the functional block diagram is automatically generated, which solves the problems of low manual drawing efficiency and accuracy, and achieves efficient and accurate functional block diagram generation.

CN119672172APending Publication Date: 2025-03-21SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411949912.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In the field of industrial automation, the existing technology requires engineers to manually draw functional block diagrams, resulting in poor generation efficiency and accuracy, and prone to drawing errors.

Method used

By applying the pre-trained functional block control loop identification model and functional block diagram generation model on the server side, the identification results of the functional block control loop are automatically extracted from the image and generated the corresponding functional block diagram.

Benefits of technology

It improves the efficiency and accuracy of the generation of functional block diagrams, avoids manual drawing errors, and ensures that the generated functional block diagram is consistent with the original image information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672172A_ABST
    Figure CN119672172A_ABST
Patent Text Reader

Abstract

The invention discloses a function block diagram generation method and a related device, and relates to the technical field of industrial automation, the method comprises the following steps: receiving an image of a function block diagram sent by a client, the image comprising at least one function block control loop; inputting the image into a pre-trained function block control loop identification model to obtain an identification result of at least one function block control loop, and sending the identification result of each function block control loop to the client, so that the client generates a function block diagram generation instruction; and receiving a function block diagram generation instruction sent by the client, and inputting the identification result of each function block control loop into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image. According to the scheme, the recognition result of the function block control loop is automatically extracted from the image and the corresponding function block diagram is generated by using the pre-trained function block control loop recognition model and the function block diagram generation model, so that the generation efficiency and accuracy of the function block diagram are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial automation, and in particular to a method for generating a function block diagram and related devices. Background Art

[0002] In the field of industrial automation, configuration is a crucial link. By setting and adjusting each component, it is ensured that each component can work together as expected, so as to achieve the goal of automated control. In the configuration process, the function block diagram graphically represents each function block and the logical relationship between them. Each function block represents a specific control function or operation. These function blocks are connected to each other through signal lines to realize data input and output, thereby simulating control logic. Therefore, the determination of the function block diagram is particularly important.

[0003] Currently, engineers are required to manually draw each functional block according to requirements and connect the functional blocks based on their expertise and experience to generate a functional block diagram.

[0004] However, this process requires manual drawing one by one, which consumes a lot of time, and due to the existence of human factors, such as fatigue or negligence, it is easy to make drawing errors, resulting in poor efficiency and accuracy in generating function block diagrams. Summary of the invention

[0005] In view of the above problems, the present application provides a method and a related device for generating a function block diagram in order to improve the efficiency and accuracy of generating a function block diagram. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a method for generating a function block diagram, which is applied to a server of a function block diagram generation system, wherein the server is connected to a client of the function block diagram generation system, and the method comprises:

[0007] Receiving an image of a function block diagram sent by the client, the image including at least one function block control loop;

[0008] Inputting the image into a pre-trained function block control loop recognition model to obtain a recognition result of at least one function block control loop, wherein the recognition result of each function block control loop includes the type of the function block control loop, the connection relationship between each function block in the function block control loop, and the type, input pin, output pin and parameter of each function block in the function block control loop;

[0009] Sending the identification result of each of the function block control loops to the client, so that the client generates a function block diagram generation instruction;

[0010] The function block diagram generation instruction sent by the client is received, and the recognition result of each function block control loop is input into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

[0011] In a possible implementation, the training process of the function block control loop identification model includes:

[0012] Obtaining a plurality of first training samples with recognition result labels of function block control loops, wherein the first training samples include a plurality of historical images, and each of the historical images includes at least one historical function block control loop;

[0013] The first initial model is trained using a plurality of the first training samples to obtain the functional block control loop recognition model, wherein the input of the functional block control loop recognition model is the image, and the output of the functional block control loop recognition model is the recognition result of at least one of the functional block control loops.

[0014] In a possible implementation, after inputting the image into a pre-trained functional block control loop recognition model to obtain a recognition result of at least one functional block control loop, the method further includes:

[0015] Sending the recognition results of each of the function block control loops to the client, so that the client verifies the recognition results of each of the function block control loops based on the recognition results of the preset function block control loops, and determines the recognition result adjustment instruction based on the verification result, wherein the recognition results of the preset function block control loops include the preset type of the function block control loop, the preset connection relationship of each function block in the function block control loop, and the preset type, preset input pin, preset output pin and preset parameter of each function block in the function block control loop;

[0016] Receiving the recognition result adjustment instruction sent by the client, parsing the recognition result adjustment instruction, and adjusting the recognition result of each of the functional block control loops based on the parsing result to obtain the adjusted recognition result of each of the functional block control loops;

[0017] The step of inputting the recognition results of each of the function block control loops into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image includes:

[0018] The recognition results after adjustment of each of the function block control loops are input into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

[0019] In a possible implementation, the training process of the function block diagram generation model includes:

[0020] Obtaining a plurality of second training samples with function block diagram labels, each of the second training samples comprising at least one recognition result of a historical function block control loop;

[0021] The second initial model is trained using a plurality of the second training samples to obtain the function block diagram generation model, wherein the input of the function block diagram generation model is the recognition result of at least one of the function block control loops, and the output of the function block diagram generation model is the function block diagram corresponding to the image. The second aspect of the present application provides a function block diagram generation system, comprising:

[0022] A receiving unit, configured to receive an image of a function block diagram sent by the client, wherein the image includes at least one function block control loop;

[0023] a first input unit, configured to input the image into a pre-trained functional block control loop recognition model to obtain a recognition result of at least one functional block control loop, wherein the recognition result of each functional block control loop includes a type of the functional block control loop, a connection relationship between functional blocks in the functional block control loop, and a type, input pin, output pin, and parameter of each functional block in the functional block control loop;

[0024] A sending unit, used for sending the identification result of each of the function block control loops to the client, so that the client generates a function block diagram generation instruction;

[0025] The second input unit is used to receive the function block diagram generation instruction sent by the client, and input the recognition result of each function block control loop into a pre-trained function block diagram generation model to obtain the function block diagram corresponding to the image.

[0026] In a possible implementation, the system further includes:

[0027] An obtaining unit, configured to obtain a plurality of first training samples with identification result labels of function block control loops, wherein the first training samples include a plurality of historical images, and each of the historical images includes at least one historical function block control loop;

[0028] A training unit is used to train the first initial model using multiple of the first training samples to obtain the functional block control loop recognition model, wherein the input of the functional block control loop recognition model is the image, and the output of the functional block control loop recognition model is the recognition result of at least one of the functional block control loops.

[0029] In a possible implementation, the system further includes:

[0030] a determination unit, configured to send the identification results of each of the function block control loops to the client, so that the client verifies the identification results of each of the function block control loops based on the identification results of the preset function block control loops, and determines the identification result adjustment instruction based on the verification result, wherein the identification results of the preset function block control loops include the preset type of the function block control loop, the preset connection relationship of each function block in the function block control loop, and the preset type, preset input pin, preset output pin and preset parameter of each function block in the function block control loop;

[0031] An adjustment unit, configured to receive the recognition result adjustment instruction sent by the client, parse the recognition result adjustment instruction, and adjust the recognition result of each of the functional block control loops based on the parsing result to obtain the recognition result of each of the functional block control loops after adjustment;

[0032] The second input unit comprises:

[0033] The input subunit is used to input the recognition results of each of the function block control loops after adjustment into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

[0034] A third aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the method for generating a functional block diagram of the first aspect or any implementation method of the first aspect.

[0035] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0036] The memory is used to store computer programs;

[0037] The processor is used to execute the computer program so that the electronic device can implement the method for generating a functional block diagram of the above-mentioned first aspect or any implementation manner of the first aspect.

[0038] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can generate the function block diagram of the first aspect or any implementation method of the first aspect.

[0039] By means of the above technical scheme, the present application provides a method for generating a function block diagram and a related device, the method comprising: receiving an image of a function block diagram sent by a client, the image comprising at least one function block control loop; inputting the image into a pre-trained function block control loop recognition model to obtain a recognition result of at least one function block control loop, the recognition result of each function block control loop comprising the type of the function block control loop, the type of each function block in the function block control loop, the input pin, the output pin and the parameter, and the connection relationship of each function block in the function block control loop; sending the recognition result of each function block control loop to the client so that the client generates a function block diagram generation instruction; receiving the function block diagram generation instruction sent by the client, and inputting the recognition result of each function block control loop into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image. The present scheme automatically extracts the recognition result of the function block control loop from the image and generates the corresponding function block diagram by using a pre-trained function block control loop recognition model and a function block diagram generation model, thereby ensuring that the generated function block diagram is consistent with the information in the original image, avoiding manual drawing, and greatly improving the generation efficiency and accuracy of the function block diagram. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0041] Figure 1 A schematic diagram of a flow chart of a method for generating a function block diagram provided in an embodiment of the present application;

[0042] Figure 2 A process diagram of a model training method provided in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of an identification result of a function block control loop provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of a functional block connection relationship provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of a process for generating a function block diagram provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of a system for generating a function block diagram provided in an embodiment of the present application;

[0047] Figure 7A schematic diagram of the hardware structure of a device for generating a function block diagram provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0049] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0050] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0051] In order to improve the efficiency and accuracy of generating function block diagrams, the present application provides a method for generating function block diagrams. The method for generating function block diagrams provided in the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0052] Please see attached Figure 1 , Figure 1 A schematic flow chart of a method for generating a function block diagram provided in an embodiment of the present application. The method can be applied to a server of a function block diagram generation system, wherein the server is connected to a client of the function block diagram generation system.

[0053] The server of the function block diagram generation system is connected to the client of the function block diagram generation system, which can be implemented through a network, allowing the server and the client to communicate at different physical locations. This communication is bidirectional, meaning that the client can send a request to the server (such as uploading an image), and the server can send a response to the client (such as a generated function block diagram).

[0054] Among them, the server side of the function block diagram generation system builds LLM (Logical Management Module, large language model), which is responsible for processing the core part of business logic and instruction execution. The LLM model is a deep learning model trained with a large amount of text data. It can generate natural language text or understand the meaning of language text, can handle a variety of natural language tasks, and can perform different operations according to different instructions.

[0055] The method may include the following steps:

[0056] Step S101: receiving an image of a function block diagram sent by a client, where the image includes at least one function block control loop.

[0057] It should be noted that the client is usually a user-operated interface or software that allows the user to create, edit and view the image of the function block diagram. The image of the function block diagram sent by the client contains at least one function block control loop, which is the basic unit of the function block diagram and consists of multiple function blocks and the connecting lines between them, and is used to implement a specific control logic.

[0058] In this application, the image of the function block diagram is transmitted from the client to the server via HTTP, FTP or other network protocols. The image of the function block diagram can be in a variety of formats, such as JPEG, PNG, SVG, etc. The choice of format depends on the support of the client software and the quality requirements of the image. The server can receive and store the image of the function block diagram for subsequent processing.

[0059] Step S102: Input the image into a pre-trained function block control loop recognition model to obtain a recognition result of at least one function block control loop, wherein the recognition result of each function block control loop includes the type of the function block control loop, the connection relationship between the function blocks in the function block control loop, and the type, input pins, output pins and parameters of the function blocks in the function block control loop.

[0060] It should be noted that the function block control loop is a collection of function blocks used to implement specific control logic in industrial automation. Function block control loops can be classified according to different control requirements, such as single loop, cascade loop, feedforward control, split range control, etc., and also include some specific actuators such as handheld operators, shut-off valves, electric valves, motors, etc. Each FBD loop type has its specific application scenario and control logic. Function blocks are the basic building blocks of function block control loops, and each function block performs a specific control or calculation task.

[0061] In the present application, the training process of the functional block control loop recognition model may include: obtaining a plurality of first training samples with recognition result labels of the functional block control loop, the first training samples including a plurality of historical images, each of which including at least one historical functional block control loop. The first initial model is trained using the plurality of first training samples to obtain the functional block control loop recognition model, wherein the input of the functional block control loop recognition model is an image, and the output of the functional block control loop recognition model is the recognition result of at least one functional block control loop.

[0062] It should be noted that these first training samples should cover images of various types of function block diagrams for training, and use an independent test set to test the function block control loop recognition model. The test set should contain data different from the first training set to ensure the generalization ability of the function block control loop recognition model. The first initial model can be a convolutional neural network, a recurrent neural network, or a combination thereof based on deep learning, such as a convolutional long short-term memory network. It can also be other models that can process images and extract features, such as traditional image processing algorithms combined with machine learning classifiers.

[0063] During the training process, checking the recognition accuracy of function block type, function block input and output, and function block connection relationship is a key step to ensure the performance of the function block control loop recognition model. The following is a detailed description of the recognition accuracy test of these three aspects:

[0064] The function block control loop identification model is tested using the test set to verify the ability of the function block control loop identification model to identify the function block type. By comparing the function block types predicted by the function block control loop identification model with the labeled function block types, a confusion matrix is ​​generated to understand the performance of different categories. The precision and recall rate of each category are calculated based on the confusion matrix to quantify the performance in function block type identification. Based on the quantified performance, the function block control loop identification model is optimized and adjusted until satisfactory recognition accuracy is achieved.

[0065] Use the test set to test the function block control loop identification model to verify the function block control loop identification model's ability to identify the function block input and output. Visually compare the input and output predicted by the function block control loop identification model with the labeled input and output to intuitively evaluate the model's performance. Based on the model's performance, provide feedback and optimize the function block control loop identification model until satisfactory recognition accuracy is achieved.

[0066] The function block control loop recognition model is tested using the test set to verify the recognition ability of the function block control loop recognition model for the function block connection relationship. The recognition accuracy is calculated by comparing the connection relationship predicted by the function block control loop recognition model with the labeled connection relationship. It can be calculated using the following formula: Recognition accuracy = (number of correctly recognized function blocks / total number of function blocks) × 100%. Based on the test results, the function block control loop recognition model is optimized and adjusted until a satisfactory recognition accuracy is achieved.

[0067] Use the test set to test the function block control loop identification model to verify the function block control loop identification model's ability to convert the function block control loop identification results. By comparing the function block control loop identification results converted by the function block control loop identification model with the pre-defined function block control loop identification results, determine whether the converted function block control loop identification results are correct, and optimize and adjust the function block control loop identification model until it is converted to the pre-defined function block control loop identification results. For ease of understanding, please refer to Figure 2 , Figure 2 A process diagram of a model training method provided in an embodiment of the present application.

[0068] The identification results of each function block control loop output by the function block control loop identification model describe various aspects in detail. For ease of understanding, please refer to Figure 3 , Figure 3 A schematic diagram of an identification result of a functional block control loop provided in an embodiment of the present application.

[0069] Among them, the loop name is used to identify and name each function block control loop, usually based on the bit name of a key function block. The loop type refers to the type of function block control loop, such as a single loop. The subdivision category further subdivides the function block control loop according to the control object (such as temperature, flow, pressure, etc.) for more accurate description and control. The function block list contains the information of all function blocks in the function block control loop, that is, the function block list. The function block list usually includes each function block type, input pin, output pin and function block parameters; the function block type identifies the type of function block, such as PID controller, adder, comparator, etc.; the input pin receives data from other function blocks or external signals; the output pin passes the processed data to other function blocks or output devices. Each input pin and output pin has a unique name or identifier to clearly distinguish different pins. These names are usually located next to the pins or on the function blocks and are expressed in text form; function block parameters are used to define the behavior and characteristics of the function blocks. Function block parameters include function block properties (such as whether it is enabled), basic function block parameters (such as the gain and integration time of the PID controller), function block extended parameters (such as additional settings specific to certain function blocks) and macro definitions (used to simplify parameter settings and code reuse).

[0070] The function block connection relationship describes the connection between function blocks in the function block control loop. If the function block control loop contains only one function block, there is no connection relationship. Otherwise, the connection relationship defines how data flows between function blocks. In the function block control loop, the connection relationship between function blocks is represented by line segments. If the input pin of a function block is connected to the output pin of another function block through a line segment, there is a connection relationship between the two function blocks, forming a path for data flow or signal flow. Recognition steps in the training process: First, the function block control loop recognition model needs to be able to recognize each function block in the function block control loop. This is usually achieved through image recognition technology, such as convolutional neural network. After identifying the function block, the function block control loop recognition model can further determine the type and coordinate position of the function block. Next, the function block control loop recognition model needs to identify the line segments connecting the function blocks. This can be achieved through edge detection, shape matching and other methods in image processing technology. By identifying the line segments, the function block control loop recognition model can determine the connection relationship between function blocks. After identifying the function block and the line segment, the function block control loop recognition model also needs to recognize the text name on the pin. This is usually achieved through optical character recognition technology. Through text recognition, the function block control loop recognition model can obtain the name of each input and output pin. Finally, the function block control loop recognition model combines the above recognition results to construct the function block connection relationship. For easy understanding, please refer to Figure 4 , Figure 4A schematic diagram of a functional block connection relationship provided in an embodiment of the present application.

[0071] The recognition results of the function block control loop have a unified standard, which reduces errors and failures caused by inconsistent recognition results of the function block control loop, and stores the recognition results of the function block control loop in a database to facilitate subsequent processing and analysis.

[0072] After inputting the image into a pre-trained functional block control loop recognition model to obtain the recognition result of at least one functional block control loop, the method further includes: firstly sending the recognition result of each functional block control loop to the client, so that the client verifies the recognition result of each functional block control loop based on the recognition result of the preset functional block control loop, and determines the recognition result adjustment instruction based on the verification result, wherein the recognition result of the preset functional block control loop includes the preset type of the functional block control loop, the preset connection relationship of each functional block in the functional block control loop, and the preset type, preset input pin, preset output pin and preset parameter of each functional block in the functional block control loop. Then, the recognition result adjustment instruction sent by the client is received, and the recognition result adjustment instruction is parsed, and the recognition result of each functional block control loop is adjusted based on the parsing result to obtain the adjusted recognition result of each functional block control loop.

[0073] Specifically, the data predicted by the functional block control loop identification model is sent to the client, and the client verifies the identification result of the functional block control loop predicted by the functional block control loop identification model based on the preset identification result of the functional block control loop (including the type of the functional block control loop, the connection relationship, type, pin and parameter of the functional block) to ensure that the identification result of the functional block control loop meets the design specifications and standards. Based on the verification result, the client generates an identification result adjustment instruction, which indicates what modifications need to be made to the identification result of the functional block control loop to meet the preset standard. The server receives the identification result adjustment instruction sent by the client and parses it. According to the parsing result, the server adjusts the identification result of the functional block control loop to obtain the adjusted identification result.

[0074] When LLM receives an instruction from the client, it first parses the instruction, which includes identifying the type and parameters of the instruction, and determining the specific operation to be performed. LLM maps the parsed instruction to the corresponding business logic operation, which is usually achieved by calling a predefined function or method. Once the operation to be performed is determined, LLM will call the corresponding function or method and pass the necessary parameters. These operations may involve data processing, database access, network communication, etc. After the operation is completed, LLM returns the result to the client, which can include data, status information, error messages, etc. Throughout the process, LLM also needs to handle possible errors and exceptions, including recording error logs, returning error information to the client, and trying to recover or retry the operation. By building LLM and performing different operations according to different instructions, the server can flexibly respond to client requests and handle various complex business logics. At the same time, the database is updated to ensure the accuracy and consistency of the data.

[0075] Step S103: sending the identification result of each functional block control loop to the client, so that the client generates a functional block diagram generation instruction.

[0076] In this application, once the identification results of the function block control loop are prepared, they need to be sent to the client. The client may be a designer's workstation, a dedicated application or any other system capable of receiving and processing this data. Data transmission can be carried out over the network, using common communication protocols (such as HTTP, TCP / IP, etc.) to ensure the integrity and security of the data. During the transmission process, the data may need to be encoded or encrypted to ensure that they are not tampered with or leaked during transmission.

[0077] After receiving the identification results of the function block control loop, the client will parse and process them. The parsing process may involve converting the identification results of the function block control loop into a format or representation that the client system can understand. The processing process may include verifying the integrity of the data, checking whether the data meets the preset standards or specifications, and generating function block diagram generation instructions based on the data. The generated instructions will be sent to the server to guide the function block diagram to start generation.

[0078] Step S104: receiving a function block diagram generation instruction sent by the client, and inputting the recognition result of each function block control loop into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

[0079] In the present application, the training process of the function block diagram generation model includes: first, obtaining a plurality of second training samples with function block diagram labels, each second training sample includes at least one recognition result of a historical function block control loop. Then, the second initial model is trained using the plurality of second training samples to obtain the function block diagram generation model, wherein the input of the function block diagram generation model is the recognition result of at least one function block control loop, and the output of the function block diagram generation model is the function block diagram corresponding to the image.

[0080] In order to ensure the generalization ability of the function block diagram generation model, the second training sample can fully cover all possible function block control loop situations. Each second training sample contains at least one historical function block control loop recognition result. Use these second training samples to train the second initial model. The purpose of training is to enable the model to accurately generate the corresponding function block diagram from the input function block control loop function block control loop recognition result. This training process is achieved by continuously adjusting the parameters of the model until the performance of the model on the training set reaches the preset standard. In addition, in order to ensure the stability and reliability of the model, an independent test set is also used to test the trained function block diagram generation model. This test set is completely different from the second training set, and it contains various new data that have never appeared in the training set. Through the performance on the test set, the generalization ability of the model can be evaluated, that is, whether the model can still maintain a high accuracy when facing new and unknown data. The choice of the second initial model can be a neural network model based on deep learning or other types of machine learning models. The specific choice of model depends on factors such as the complexity of the problem, the characteristics of the data, and the efficiency of training. As another possible implementation method, a function block diagram generation function can be called to quickly generate a function block diagram. The function block diagram generation function includes but is not limited to: a single loop generation function, a cascade loop generation function, a feedforward control generation function, a split range control generation function, a hand operator generation function, a shut-off valve generation function, an electric valve generation function, a motor generation function, etc. Each function block diagram generation function corresponds to a specific type of function block control loop in the function block diagram.

[0081] Specifically, the function block diagram generation function reads the identification result of the corresponding function block control loop from the database according to the function block diagram generation instruction, and calls the function block diagram generation function corresponding to the type of the function block control loop. These functions generate the corresponding function block diagram according to the input data and parameters. The generated function block diagram can be returned to the user end for the user to view or display. For easy understanding, please refer to Figure 5 , Figure 5 An embodiment of the present application provides a flow chart of generating a function block diagram.

[0082] In summary, by means of the above technical scheme, the present application provides a method for generating a function block diagram and a related device, the method comprising: receiving an image of a function block diagram sent by a client, the image comprising at least one function block control loop; inputting the image into a pre-trained function block control loop recognition model to obtain a recognition result of at least one function block control loop, the recognition result of each function block control loop comprising the type of the function block control loop, the type of each function block in the function block control loop, the input pin, the output pin and the parameter, and the connection relationship of each function block in the function block control loop; sending the recognition result of each function block control loop to the client so that the client generates a function block diagram generation instruction; receiving the function block diagram generation instruction sent by the client, and inputting the recognition result of each function block control loop into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image. This scheme automatically extracts the recognition result of the function block control loop from the image and generates the corresponding function block diagram by using a pre-trained function block control loop recognition model and a function block diagram generation model, ensuring that the generated function block diagram is consistent with the information in the original image, avoiding manual drawing, and greatly improving the generation efficiency and accuracy of the function block diagram.

[0083] A method for generating a function block diagram provided in an embodiment of the present application is introduced above, and a system for executing the method for generating a function block diagram is introduced below.

[0084] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a system for generating a function block diagram provided in an embodiment of the present application. Figure 6 As shown, the generation system of the function block diagram includes:

[0085] The receiving unit 11 is used to receive an image of a function block diagram sent by a client, where the image includes at least one function block control loop.

[0086] The first input unit 12 is used to input the image into a pre-trained function block control loop recognition model to obtain a recognition result of at least one function block control loop, and the recognition result of each function block control loop includes the type of the function block control loop, the connection relationship between each function block in the function block control loop, and the type, input pin, output pin and parameter of each function block in the function block control loop.

[0087] The sending unit 13 is used to send the identification result of each functional block control loop to the client, so that the client generates a functional block diagram generation instruction.

[0088] The second input unit 14 is used to receive a function block diagram generation instruction sent by the client, and input the recognition result of each function block control loop into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

[0089] In a possible implementation, the system further includes:

[0090] The obtaining unit is used to obtain a plurality of first training samples with recognition result labels of function block control loops, wherein the first training samples include a plurality of historical images, and each historical image includes at least one historical function block control loop.

[0091] A training unit is used to train a first initial model using multiple first training samples to obtain a functional block control loop recognition model, wherein the input of the functional block control loop recognition model is an image, and the output of the functional block control loop recognition model is a recognition result of at least one functional block control loop.

[0092] In a possible implementation, the system further includes:

[0093] A determination unit is used to send the identification results of each functional block control loop to the client, so that the client verifies the identification results of each functional block control loop based on the identification results of the preset functional block control loop, and determines the identification result adjustment instruction based on the verification result. The identification results of the preset functional block control loop include the preset type of the functional block control loop, the preset connection relationship of each functional block in the functional block control loop, and the preset type, preset input pin, preset output pin and preset parameter of each functional block in the functional block control loop.

[0094] The adjustment unit is used to receive the recognition result adjustment instruction sent by the client, parse the recognition result adjustment instruction, and adjust the recognition result of each functional block control loop based on the parsing result to obtain the adjusted recognition result of each functional block control loop.

[0095] The second input unit comprises:

[0096] The input subunit is used to input the recognition results after adjustment of each functional block control loop into a pre-trained functional block diagram generation model to obtain a functional block diagram corresponding to the image.

[0097] In a possible implementation, the system further includes:

[0098] The sample obtaining unit is used to obtain a plurality of second training samples with function block diagram labels, each second training sample including at least one recognition result of a historical function block control loop.

[0099] A model training unit is used to train the second initial model using multiple second training samples to obtain a function block diagram generation model, wherein the input of the function block diagram generation model is the recognition result of at least one function block control loop, and the output of the function block diagram generation model is the function block diagram corresponding to the image.

[0100] The present application also provides an electronic device in an embodiment. Figure 7 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0101] like Figure 7 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 to a random access memory (RAM) 703. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0102] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a memory card, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0103] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any method for generating a function block diagram provided in the embodiment of the present application.

[0104] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any method for generating a function block diagram provided in an embodiment of the present application.

[0105] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0106] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0107] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0108] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A method for generating a function block diagram, characterized in that: A server end applied to a function block diagram generation system, the server end being connected to a client end of the function block diagram generation system, the method comprising: Receiving an image of a function block diagram sent by the client, the image including at least one function block control loop; Inputting the image into a pre-trained function block control loop recognition model to obtain a recognition result of at least one function block control loop, wherein the recognition result of each function block control loop includes the type of the function block control loop, the connection relationship between each function block in the function block control loop, and the type, input pin, output pin and parameter of each function block in the function block control loop; Sending the identification result of each of the function block control loops to the client, so that the client generates a function block diagram generation instruction; The function block diagram generation instruction sent by the client is received, and the recognition result of each function block control loop is input into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

2. The method for generating a function block diagram according to claim 1, characterized in that: The training process of the functional block control loop identification model includes: Obtaining a plurality of first training samples with recognition result labels of function block control loops, wherein the first training samples include a plurality of historical images, and each of the historical images includes at least one historical function block control loop; The first initial model is trained using a plurality of the first training samples to obtain the functional block control loop recognition model, wherein the input of the functional block control loop recognition model is the image, and the output of the functional block control loop recognition model is the recognition result of at least one of the functional block control loops.

3. The method for generating a function block diagram according to claim 1, characterized in that: After inputting the image into a pre-trained functional block control loop recognition model to obtain a recognition result of at least one functional block control loop, the method further includes: Sending the recognition results of each of the function block control loops to the client, so that the client verifies the recognition results of each of the function block control loops based on the recognition results of the preset function block control loops, and determines the recognition result adjustment instruction based on the verification result, wherein the recognition results of the preset function block control loops include the preset type of the function block control loop, the preset connection relationship of each function block in the function block control loop, and the preset type, preset input pin, preset output pin and preset parameter of each function block in the function block control loop; Receiving the recognition result adjustment instruction sent by the client, parsing the recognition result adjustment instruction, and adjusting the recognition result of each of the functional block control loops based on the parsing result to obtain the adjusted recognition result of each of the functional block control loops; The step of inputting the recognition results of each of the function block control loops into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image includes: The recognition results after adjustment of each of the function block control loops are input into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

4. The method for generating a function block diagram according to claim 1, characterized in that: The training process of the function block diagram generation model includes: Obtaining a plurality of second training samples with function block diagram labels, each of the second training samples comprising at least one recognition result of a historical function block control loop; The second initial model is trained using a plurality of the second training samples to obtain the function block diagram generation model, wherein the input of the function block diagram generation model is the recognition result of at least one of the function block control loops, and the output of the function block diagram generation model is the function block diagram corresponding to the image.

5. A system for generating a function block diagram, characterized in that: include: A receiving unit, configured to receive an image of a function block diagram sent by the client, wherein the image includes at least one function block control loop; a first input unit, configured to input the image into a pre-trained functional block control loop recognition model to obtain a recognition result of at least one functional block control loop, wherein the recognition result of each functional block control loop includes a type of the functional block control loop, a connection relationship between functional blocks in the functional block control loop, and a type, input pin, output pin, and parameter of each functional block in the functional block control loop; A sending unit, used for sending the identification result of each of the function block control loops to the client, so that the client generates a function block diagram generation instruction; The second input unit is used to receive the function block diagram generation instruction sent by the client, and input the recognition result of each function block control loop into a pre-trained function block diagram generation model to obtain the function block diagram corresponding to the image.

6. The function block diagram generation system according to claim 5, characterized in that: The system further comprises: An obtaining unit, configured to obtain a plurality of first training samples with identification result labels of function block control loops, wherein the first training samples include a plurality of historical images, and each of the historical images includes at least one historical function block control loop; A training unit is used to train the first initial model using multiple of the first training samples to obtain the functional block control loop recognition model, wherein the input of the functional block control loop recognition model is the image, and the output of the functional block control loop recognition model is the recognition result of at least one of the functional block control loops.

7. The function block diagram generation system according to claim 5, characterized in that: The system further comprises: a determination unit, configured to send the identification results of each of the function block control loops to the client, so that the client verifies the identification results of each of the function block control loops based on the identification results of the preset function block control loops, and determines the identification result adjustment instruction based on the verification result, wherein the identification results of the preset function block control loops include the preset type of the function block control loop, the preset connection relationship of each function block in the function block control loop, and the preset type, preset input pin, preset output pin and preset parameter of each function block in the function block control loop; An adjustment unit, configured to receive the recognition result adjustment instruction sent by the client, parse the recognition result adjustment instruction, and adjust the recognition result of each of the functional block control loops based on the parsing result to obtain the recognition result of each of the functional block control loops after adjustment; The second input unit comprises: The input subunit is used to input the recognition results of each of the function block control loops after adjustment into a pre-trained function block diagram generation model to obtain a function block diagram corresponding to the image.

8. A computer program product, characterized in that It comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the method for generating a function block diagram as claimed in any one of claims 1 to 4.

9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the method for generating a function block diagram as described in any one of claims 1 to 4.

10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the method for generating a function block diagram as described in any one of claims 1 to 4.