A real-time data playback method and system for hot rolling process

By establishing a data communication connection between the TCP client and the server during the hot rolling process, and transmitting data to the pSpace database and front-end Web page, the problem of insufficient awareness of real-time data visualization is solved, and real-time data playback and playback of the hot rolling process are realized. Troubleshooting simplified.

CN117235389BActive Publication Date: 2024-09-03UNIV OF SCI & TECH BEIJING
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311101190.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-29
Publication Date
2024-09-03
Estimated Expiration
2043-08-29

AI Technical Summary

Technical Problem

The existing technology lacks visual recognition of real-time data in the hot rolling process, which increases the difficulty of selecting and applying fault diagnosis methods.

Method used

By establishing a data communication connection between the TCP client and the TCP server, the hot rolling process data is transmitted to the pSpace database and front-end Web page, real-time data playback is realized, a graphical user interface is provided for IP connection for communication and transmission of data and hardware equipment, and the Set the fault type, occurrence location, time and size.

Benefits of technology

It realizes real-time visual display of hot rolling process data, simplifies the selection and application of methods, simulates the generation and transmission of normal data and fault data, and enhances the visual display and real-time monitoring capabilities of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117235389B
    Figure CN117235389B
Patent Text Reader

Abstract

The present invention provides a real-time data playback method and system for a hot rolling process, which relates to the technical field of data playback simulation, including: establishing a data communication connection between a TCP client and a TCP server; the TCP server transmits the hot rolling process data to the TCP client; the TCP client receives the hot rolling process data, and sends the hot rolling process data to a pSpace database and a front-end Web page for display according to user needs, thereby completing the real-time data playback of the hot rolling process. The method and system of the present invention are based on common procedures of the hot rolling process of strip steel, simulate the on-site transmission of industrial real-time data in the actual production process, and simulate the data playback process from data generation to transmission and final real-time visual display in the hot rolling process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of data playback simulation, and in particular to a real-time data playback method and system for a hot rolling process. Background Art

[0002] The hot rolling process of the plate and strip mill system is large in scale and has a complex operating mechanism. When the working conditions and operating conditions change during the production process, the control performance of the process system will be different, which will have a certain impact on the control method used in the actual production process. As mentioned above, it is very important to simulate the on-site transmission of industrial real-time data in the actual production process to provide users with a more realistic environment for using and analyzing the real-time data of the actual hot rolling process.

[0003] At present, the hot rolling process fault diagnosis technology has attracted more and more attention from researchers and engineering designers. Many beginners lack the visualization of real-time data of the hot rolling process when learning and using these methods, which increases the difficulty of selecting and applying the methods. As mentioned above, it is crucial to provide researchers with a visual data playback process of real-time data. Summary of the invention

[0004] The present invention provides a real-time data playback method and system for a hot rolling process, which solves the problem in the prior art that there is a lack of visual recognition of real-time data of the hot rolling process, which increases the difficulty of method selection and application.

[0005] In order to solve the above-mentioned invention object, the technical solution provided by the present invention is as follows: a real-time data playback method of a hot rolling process, characterized in that the steps include:

[0006] S1, establish a data communication connection between the TCP client and the TCP server;

[0007] S2, the TCP server transmits the hot rolling process data to the TCP client;

[0008] S3. The TCP client receives the hot rolling process data and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, completing the real-time data playback of the hot rolling process.

[0009] Preferably, in step S1, establishing a data communication connection between a TCP client and a TCP server includes:

[0010] Complete the initialization of the socket object's identifier on the TCP server side;

[0011] The TCP server binds a specific IP address and port number through the bind() function;

[0012] The TCP server calls the listen() function to enable data monitoring for the IP address and port number, blocks data transmission, and waits for the TCP client to connect to the corresponding IP address;

[0013] When the TCP client sends a connect() request, the TCP server simultaneously calls accept() to receive the instruction and establishes a data communication connection between the TCP client and the TCP server.

[0014] Preferably, in step S3, the hot rolling process data includes:

[0015] Normal data of hot rolling process and data after fault injection.

[0016] Preferably, the TCP server and the TCP client both use Python for communication; Python is connected with the CodeSys industrial automation software platform, the Web page platform based on the Django framework, and the pSpace database data transmission.

[0017] Preferably, the TCP server transmits the hot rolling process data to the TCP client, including:

[0018] The TCP client sends a data request signal to the TCP server, and the TCP server receives and processes the data request signal;

[0019] The TCP client sends data at different sampling times to the TCP server in a cyclic manner;

[0020] After all data are sent, the server sends response data to the client, the client reads and processes the response data, and the TCP server receives the request data sending instruction and sends the hot rolling process data to the TCP client;

[0021] A data interaction between the client and the server ends, and the client and the server are disconnected.

[0022] Preferably, in step S3, the TCP client receives the hot rolling process data, and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user requirements, completing the real-time data playback of the hot rolling process, including:

[0023] Obtain user data viewing requirements;

[0024] Send the hot rolling process data to the pSpace database and front-end Web page according to the user's data viewing requirements;

[0025] Real-time data playback of the hot rolling process is performed through the pSpace database and front-end Web pages.

[0026] Preferably, step S3 further includes: before data display, configuring the pSpace database, including:

[0027] Configure the database's user groups, users, permissions and other related information;

[0028] Manage the database measurement points, add measurement points for real-time data storage, modify the measurement point configuration, and configure the measurement point name and basic information of the node where the measurement point is located.

[0029] Preferably, the real-time data playback of the hot rolling process is performed through the pSpace database, including:

[0030] Put the pSpacepythonAPI file in the Lib\site-packages directory of the Python interpreter, and import the PythonAPI.PsServer package in the program;

[0031] Call the Psobject and connect functions in the software package to establish a connection with pSpace;

[0032] Write basic information such as data header, data storage point name, etc. into the dictionary;

[0033] Call the pSpace.RealWritelist function to write the real-time data into the real-time database, and monitor the uploaded real-time data in psMonitor.

[0034] A real-time data playback system for a hot rolling process, the system is used for the real-time data playback method for the hot rolling process, the system comprises:

[0035] TCP communication establishment module, used to establish a data communication connection between a TCP client and a TCP server;

[0036] TCP communication module, used by the TCP server to transmit hot rolling process data to the TCP client;

[0037] The data playback module is used for the TCP client to receive the hot rolling process data, and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, so as to complete the real-time data playback of the hot rolling process.

[0038] Preferably, the TCP communication establishment module is used to further complete the identification initialization of the socket object on the TCP server side;

[0039] The TCP server binds a specific IP address and port number through the bind() function;

[0040] The TCP server calls the listen() function to enable data monitoring for the IP address and port number, blocks data transmission, and waits for the TCP client to connect to the corresponding IP address;

[0041] When the TCP client sends a connect() request, the TCP server simultaneously calls accept() to receive the instruction and establishes a data communication connection between the TCP client and the TCP server.

[0042] On the one hand, an electronic device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the real-time data playback method of the above-mentioned hot rolling process.

[0043] On the one hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the real-time data playback method of the hot rolling process described above.

[0044] Compared with the prior art, the above technical solution has at least the following beneficial effects:

[0045] In the above scheme, this system mainly realizes two functions. One is to simulate the generation and transmission of normal data and fault data in software and hardware equipment, establish a graphical user interface for data and hardware equipment communication transmission IP connection, and also can set the data fault type, location, time and size. The second is to establish a communication connection between the simulation process and the front-end web page and real-time database, and realize real-time data upload to the real-time database and real-time display on the front-end web page. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 It is a schematic flow chart of a real-time data playback method for a hot rolling process provided by an embodiment of the present invention;

[0048] Figure 2 It is a relationship diagram between Socket and TCP / IP communication protocol provided by an embodiment of the present invention;

[0049] Figure 3 is a flow chart of communication between a server and a client provided by an embodiment of the present invention;

[0050] Figure 4is a diagram of a hardware platform provided by an embodiment of the present invention;

[0051] Figure 5 It is a Server module diagram provided by an embodiment of the present invention;

[0052] Figure 6 This is the overall internal module diagram of the Handler provided by the embodiment of the present invention;

[0053] Figure 7 It is a system TCP / IP communication architecture diagram provided by an embodiment of the present invention;

[0054] Figure 8 is a diagram of a configuration management tool for pSpace provided in an embodiment of the present invention;

[0055] Fig. 9 It is a workflow diagram of the MTV model provided by an embodiment of the present invention;

[0056] Fig.10 is an overall functional diagram of real-time data playback provided by an embodiment of the present invention;

[0057] Fig.11 A GUI for establishing a TCP / IP connection diagram provided by an embodiment of the present invention;

[0058] Fig.12 It is a real-time update diagram of the CodeSys curve provided by an embodiment of the present invention;

[0059] Fig.13 is a pSpace real-time curve graph provided by an embodiment of the present invention;

[0060] Fig.14 A front-end web page dynamically displays a diagram provided by an embodiment of the present invention;

[0061] Fig.15 It is a front-end web page dynamically displayed two pictures provided by an embodiment of the present invention;

[0062] Fig.16 is a block diagram of a real-time data playback system for a hot rolling process provided by an embodiment of the present invention;

[0063] Fig.17 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] The present invention aims at the problem that the prior art lacks visual recognition of real-time data of hot rolling process, which increases the difficulty of method selection and application, and provides a real-time data playback method and system for hot rolling process.

[0066] like Figure 1 As shown, an embodiment of the present invention provides a real-time data playback method for a hot rolling process, which can be implemented by an electronic device. Figure 1 The process flow chart of the real-time data playback method of the hot rolling process shown in the figure may include the following steps:

[0067] S101, establishing a data communication connection between a TCP client and a TCP server;

[0068] S102, the TCP server transmits the hot rolling process data to the TCP client;

[0069] S103, the TCP client receives the hot rolling process data, and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, thereby completing the real-time data playback of the hot rolling process.

[0070] In a feasible implementation, this system is a real-time data playback system applied to the hot rolling process. The system is based on the common process of the hot rolling process of strip steel, simulates the on-site transmission of industrial real-time data in the actual production process, and simulates the data playback process from data generation to transmission and final real-time visual display in the hot rolling process. This system mainly realizes two functions. One is to simulate the generation and transmission of normal data and fault data in software and hardware equipment, establish a graphical user interface for data and hardware equipment communication transmission IP connection, and also can set the fault type, location, time and size of the data. The second is to establish a communication connection between the simulation process and the front-end web page and real-time database, so as to realize the real-time data upload to the real-time database and the real-time display of the front-end web page.

[0071] In a feasible implementation manner, in step S101, establishing a data communication connection between a TCP client and a TCP server includes:

[0072] Complete the initialization of the socket object's identifier on the TCP server side;

[0073] The TCP server binds a specific IP address and port number through the bind() function;

[0074] The TCP server calls the listen() function to enable data monitoring for the IP address and port number, blocks data transmission, and waits for the TCP client to connect to the corresponding IP address;

[0075] When the TCP client sends a connect() request, the TCP server simultaneously calls accept() to receive the instruction and establishes a data communication connection between the TCP client and the TCP server.

[0076] In a feasible implementation, this system will simulate and replay the data transmission in the actual hot rolling process. The data playback communication part is to reproduce the communication transmission of data in the PLC hardware used in the actual hot rolling process. For this purpose, the system uses the CodeSys automation development platform used in the actual hot rolling process. At the same time, considering the characteristics of the hot rolling process such as large amount of data and rich data types, this system adopts a communication method based on the TCP / IP protocol.

[0077] In a feasible implementation, the Transmission Control Protocol / Internet Protocol (TCP / IP) is a set of industry standard protocols that serve wide area networks. Sockets, as the basis of communication and the middleware abstraction layer between the TCP / IP protocol family, provide a basic operation unit for network communications that support the TCP / IP protocol. Between the application layer and the transport layer, sockets provide a mechanism that enables data in the application to interact directly with the TCP / IP core, making it easier for developers to develop data communication programs.

[0078] like Figure 2 As shown in the figure, Socket is a software abstraction layer between the application layer and the TCP / IP and UDP communication protocol families. It is composed of a set of interfaces. In software design, Socket is used as a socket to set the complex TCP / IP network protocol family in the Socket interface. When users use network communication protocols, they only need to provide a simple data interface for the socket to use the network communication protocol that meets the user's needs.

[0079] In a feasible implementation, based on different transport protocols and transport layers, Socket sockets can be divided into three different types:

[0080] (1) Stream Socket: A socket based on TCP / IP that provides reliable byte stream data services for the application layer. It is suitable for non-repetitive and error-free transmission of large amounts of data.

[0081] (2) Datagram socket, a socket based on the UDP protocol, is suitable for situations where the order and reliability of data transmission are not required to be high. It transmits data in the form of independent data packets.

[0082] (3) Raw Socket: This type of socket allows applications to directly access the network layer and is usually intended for developers who develop new protocols.

[0083] Considering the applicable scope of different types of communication protocols and the characteristics of large data volume in the hot rolling process, this system adopts streaming sockets for data transmission and implements the following steps. First, the identification initialization of the socket object is completed on the server side. The server binds a specific IP address and port number through the bind() function. Then the server calls the listen() function to enable the data listening function for the IP address and port number, blocks data sending, and waits for the client to connect to the corresponding IP address. When the client sends a connect() request, the server calls accept() at the same time to receive the instruction. At this time, the data communication connection between the client and the server is successfully established. After that, the client sends a data request signal to the server, the server receives and processes the signal, and finally sends response data to the client. The client reads and processes the data, and a data interaction between the client and the server ends. Figure 3 The flowchart shown in the figure shows the realization principle of the system in detail and clearly. In order to meet the characteristics of large amount of data and no errors in the hot rolling process, this system selects stream socket for data transmission to better meet the actual operation requirements.

[0084] The present invention can use normal data and data after fault injection as data streams to be sent. After a connection is established and a data sending request is received, data at different sampling times are sent cyclically in sequence. After all the data are sent, an interaction ends and the connection is disconnected.

[0085] In a feasible implementation mode, the main hardware of the hot rolling process data playback system is as follows: Figure 4 As shown in the figure, a total of 4 PLCs are installed in the VME chassis to simulate the four processes of hot rolling, rough rolling, coiling and heating furnace in the industrial field. The rest of the hardware of this system consists of two PCs, a router, Ethernet cables and serial cables.

[0086] In a feasible implementation, the VME chassis is used as the target machine, and the backplane is based on the VME protocol. The CPU board, VME baseboard or other I / O daughter boards can be inserted to provide a basic operation and communication environment for the hardware, and also provide a power module.

[0087] The router acts as a gateway between networks, realizing the network connection of the required A021C boards, PCs and other devices, and ensuring the real-time transmission of data between devices.

[0088] Python software is installed on both PCs. One PC is responsible for fault injection into normal data and sending fault data to the board, while the other PC is responsible for receiving data from the board and uploading it to the real-time database and front-end web page display. At the same time, CodeSys V3.5 SP11 embedded development software is installed on the PC sending data to provide basic PLC communication and development environment.

[0089] A021C is a single-board computer based on the PowerPC architecture MPC85 series produced by Men Company of Germany. It is also a PLC used in the actual production process of hot rolling. It is oriented to embedded industrial applications, powered by 5V or 3.3V, and fully supports the VME64 standard. A021C is a Freescale P1013 core, with 2GB DDR3 memory space, 64MB Boot / Program Flash for loading BootLoader, saving environment variables or solidifying user programs, 128KB non-volatile memory FRAM for power-off preservation of certain variables, and 1MB dual-port memory, which can be directly accessed by the local CPU and can be accessed as a slave (Slave) by other CPUs (Master) through the VME bus to achieve memory sharing. There are 2 Ethernet ports, supporting Ethernet communication (1Gbit / s), used for network startup or shell interaction, etc., and 1 serial port, supporting serial communication, mainly used to configure environment variables and obtain print information. Both the network port and the serial port are RJ45 interfaces.

[0090] This system software platform uses the powerful CodeSys automated development platform. It supports the IEC 61131-3 international standard, and its unique expertise is that users can achieve complete project solutions using only a single tool software. The CodeSys programming tool is also called a development system. The development system runs in the Windows environment and provides a PLC application writing and compiling and debugging environment; the operating system runs in the embedded device, and this platform runs in the embedded CPU board A021C. The development system and the operating system are the most basic conditions for the composition of the embedded soft PLC. The two are independent of each other and closely related.

[0091] The development system is mainly used to compile and debug PLC logic. It is based on the IEC61131-3 standard and supports five commonly used PLC programming languages: instruction list (IL), function block diagram (FBD), ladder diagram (LD), structured text (ST) and sequential function chart (SFC). In addition, CodeSys also supports the sixth programming language, continuous function chart (CFC), which is converted from function block diagram. Compared with other soft PLC products such as SIEMENS's SMATIC WinAC and SOFTPLC's Soft-PLC, the biggest advantage of CodeSys is that it integrates logic control, motion control and visualization into one, and visualization can be easily achieved without other configuration software. The operating system is the core of the embedded soft PLC. The operating system of this platform uses the latest development package CodeSys SP11 provided by Germany's 3S company. The development system and the running system communicate through the RS232 serial port or Ethernet, and can download, monitor and debug programs at breakpoints. The I / O drivers and OEM components are implemented by the controller developers through the library provided by the running system, and then the development system performs logical operations based on the interface provided by the running system.

[0092] In a feasible implementation manner, in step S103, the hot rolling process data includes:

[0093] Normal data of hot rolling process and data after fault injection.

[0094] Preferably, the TCP server and the TCP client both use Python for communication; Python is connected with the CodeSys industrial automation software platform, the Web page platform based on the Django framework, and the pSpace database data transmission.

[0095] Preferably, the TCP server transmits the hot rolling process data to the TCP client, including:

[0096] The TCP client sends a data request signal to the TCP server, and the TCP server receives and processes the data request signal;

[0097] The TCP client sends data at different sampling times to the TCP server in a cyclic manner;

[0098] After all data are sent, the server sends response data to the client, the client reads and processes the response data, and the TCP server receives the request data sending instruction and sends the hot rolling process data to the TCP client;

[0099] A data interaction between the client and the server ends, and the client and the server are disconnected.

[0100] In a feasible implementation, in step S103, the TCP client receives the hot rolling process data, sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user requirements, and completes the real-time data playback of the hot rolling process, including:

[0101] Obtain user data viewing requirements;

[0102] Send the hot rolling process data to the pSpace database and front-end Web page according to the user's data viewing requirements;

[0103] Real-time data playback of the hot rolling process is performed through the pSpace database and front-end Web pages.

[0104] In a feasible implementation, Python imports normal data from the database and can also further obtain fault data through the fault injection system that has been written. In order to realize the data communication connection between Python and CodeSys software, the corresponding TCP / IP communication module needs to be set in the CodeSys software platform. The modules involved will be introduced in detail below.

[0105] like Figure 5 As shown in the figure, the Server module contains 6 Handler submodules, which can provide 6 connection interfaces. The communication data of the corresponding client is stored in different Handler modules according to the client connection order. The NBS.TCP_server submodule in the figure is used to connect the Server module with the Handler submodule. xEnable is the enable end, which is always set to TRUE to put the Server in operation; xBusy is the activation output end. When the Server is in the connection state, the output is 1 to drive the subsequent Handler module to work; hServer is the Server connection end, which is used to connect multiple Handler modules to the server. The Handler module in the figure is the encapsulated module, xEnable is the enable end, and when it is set to TRUE, the module starts to work; hServer is the Server connection end, which is used to establish the connection between the Handler module and the Server.

[0106] The Handler module is used by CodeSys software and PLC hardware to read and write data transmitted from the outside through TCP / IP communication. Figure 6 The overall internal modules of Handler are given, and the functions of each module are introduced below.

[0107] The NBS.TCP_Read module is the system's read module. When the Handler module is in the connected state, the module stores the received data in the address corresponding to ADR (GVL.rdbuffer). The data size is the data size of the global variable GVL.rfbuffer. The Logical module is the driver module of the system's write module. The system write module can only be triggered when the Logical module generates a rising edge. The NBS.TCP_Write module is the system's write module. When receiving the rising edge generated by the Logical module, the write module starts working and sends the data in GVL.wrbuffer to the client. The data size is szSize bytes. The SrvErrorCoder and MUX modules together form the system read-write exception module, which displays whether it is currently in a read-write exception state. If it is in a read-write exception state, it will display whether the current state is in a read exception or a write exception state.

[0108] In a feasible implementation manner, the main functions implemented by the TCP / IP communication of the system include the communication between the fault injection system and the board card and the communication between the board card and the fault data receiving end PC.

[0109] The specific description of the system TCP / IP communication implementation architecture is as follows Figure 7 shown.

[0110] (1) The fault data sending end uses the VME chassis as the target machine to send fault data to two A021C boards of the PowerPC architecture MPC85 series. This interactive process is completed based on the TCP / IP communication protocol.

[0111] (2) The router side acts as a gateway to complete the real-time transmission of fault data between the sending and receiving ends (A021C board, PC and other equipment).

[0112] (3) The fault data receiving end completes the reading of the fault data transferred by the A021C board through TCP / IP communication, and then sends the fault data to the front-end web page for real-time display and uploads it to the real-time database pSpace.

[0113] The following introduces the implementation principle of sending and receiving data based on Python Socket client in the data playback system.

[0114] Sending end: Import the Socket software package in Python; create a Socket object by calling the function socket(AF_INET,SOCK_STREAM); call the connect function in the software package to establish a connection with the server; convert the data to be sent into a byte stream, and call the send function in the software package to send the data.

[0115] Receiving end: Import the Socket software package in Python; create a Socket object by calling the function socket(AF_INET,SOCK_STREAM); call the connect function in the software package to establish a connection with the server; call the recv function in the software package to receive byte stream data and convert it into the original data type.

[0116] In a feasible implementation, the innovation of the communication method implemented by the data playback system can be described as follows:

[0117] The data communication of this system includes TCP Client and TCP Server, and the TCP Client and TCP Server communicate with each other through Python. Python, as the hub of system data transmission, connects CodeSys industrial automation software platform, Web page platform based on Django framework and pSpace industrial real-time / historical database, and also adds industrial field-level PLC as the carrier of hardware data transmission, realizing data communication between multiple software and industrial hardware PLC in laboratory environment, overcoming the difficulties of incompatible data communication methods between software and between software and hardware, and the inability to transmit data in industrial PLC hardware in a real and efficient manner, indicating the good software communication compatibility and rich data display methods of the system. The method of TCP / IP communication application of this system includes: TCP Client and TCP Server establish a communication connection based on TCP / IP protocol; TCP Client sends a request data sending instruction to TCP Server; when TCP Server receives the request data sending instruction, TCP Server generates the required normal data and fault data of hot rolling process, and sends the data to TCP Client; TCP Client receives the data and sends the data to pSpace database and front-end Web page for real-time display according to user needs. In the entire data communication process, the TCP / IP communication method is used as the basis, combined with the communication implementation principles of various software and hardware, and comprehensive consideration of the compatibility of communication between various software and hardware and the efficiency and diversity of data display, to build a software and hardware data playback system platform based on Python's Socket communication. For example, in the CodeSys software, the corresponding communication module and the global variable area for storing and sending data need to be configured, and the communication module includes real-time communication with Python and PLC hardware; the corresponding access variables and addresses need to be reserved in the global variable area, and the necessary programs should be written in the CodeSys software to control the data communication in the global variable area.

[0118] In a feasible implementation manner, step S103 further includes: before displaying the data, configuring the pSpace database, including:

[0119] Configure the database's user groups, users, permissions and other related information;

[0120] Manage the database measurement points, add measurement points for real-time data storage, modify the measurement point configuration, and configure the measurement point name and basic information of the node where the measurement point is located.

[0121] In a feasible implementation, real-time data playback of the hot rolling process is performed through the pSpace database, including:

[0122] Put the pSpacepythonAPI file in the Lib\site-packages directory of the Python interpreter, and import the PythonAPI.PsServer package in the program;

[0123] Call the Psobject and connect functions in the software package to establish a connection with pSpace;

[0124] Write basic information such as data header, data storage point name, etc. into the dictionary;

[0125] Call the pSpace.RealWritelist function to write the real-time data into the real-time database, and monitor the uploaded real-time data in psMonitor.

[0126] In a feasible implementation, pSpace has the ability to process real-time data from various external systems such as PLC and underlying I / O devices. Its powerful functions and flexibility help effectively manage and process large amounts of data from different systems. The storage of pSpace real-time data includes many basic information, such as real-time data value, real-time data timestamp and quality stamp.

[0127] pSpace has many features. This system uses pSpace as the real-time database for the data playback part mainly based on its following advantages:

[0128] (1) Efficient collection and storage of massive industrial data. The number of measuring points is large. The pSpace measuring point capacity is 6 million points for a single machine and 30 million points for a cluster, which fully meets the requirements of the hot rolling process of this system for the number of measuring points; the data reading and writing capabilities are excellent, and the database historical data reading and writing capabilities can reach 15 million points / second; the historical data storage time is unlimited, and its storage is only limited by the hardware capacity of the storage device. In theory, the amount of data stored is unlimited; it supports a variety of data types. pSpace supports floating point, Boolean and other data types, which meets the requirements of the industrial hot rolling process background of this system for data types and data storage capacity.

[0129] (2) Rich data and programming interfaces, easy to integrate with third-party systems. Python software that supports the use of fault injection systems provides programming interfaces for database connection and data upload, and can directly obtain real-time data processed by Python programs.

[0130] (3) Redundancy mechanism improves system connectivity and reliability. It supports status monitoring and disconnection reconnection functions, which means that when any part of the entire system fails, the system can detect it in time and automatically restore normal operation.

[0131] (4) Supports the collection of accurate information such as data timestamps and quality stamps. pSpace's data collection program fully meets the requirements of the OPC protocol for timestamps and quality stamps. Users can choose to use the timestamps and quality stamps of the field equipment itself or those provided by pSpace to collect data according to actual working conditions and personal needs.

[0132] Before uploading real-time data to the pSpace database, the pSpace tool client needs to be equipped and managed. These tool clients have the characteristics of secure login and remote management, which is convenient for users to use.

[0133] In a feasible implementation, Figure 8 As shown in the upper left part, psConfig is the database configuration tool of pSpace. To realize real-time data writing into pSpace, it needs to be configured as follows: configure the database user groups, users, permissions and other related information, manage the database measurement points, add measurement points for real-time data storage, and modify the measurement point configuration measurement point name, the node where the measurement point is located and other basic information.

[0134] like Figure 8 As shown in the lower right part, psMonitor is the database monitoring tool of pSpace, which is used for measuring point data monitoring. It also needs to be configured: configure the measuring points to be monitored to monitor the real-time data and historical data of the corresponding measuring points; configure the server to monitor and display information, obtain the current status of the server, the number of measuring points, authorization information, connection client information, collector information, computing station information, equipment information, etc.

[0135] The Python-based pSpace real-time fault data playback method is as follows:

[0136] (1) Place the pSpacepythonAPI file in the Lib\site-packages directory of the Python interpreter, and import the PythonAPI.PsServer software package into the program.

[0137] (2) Call the Psobject and connect functions in the software package to establish a connection with pSpace.

[0138] (3) Write basic information such as data header and data storage point name into the dictionary, and finally call the pSpace.RealWritelist function to write the real-time data into the real-time database. At this time, the uploaded real-time data can be monitored in psMonitor.

[0139] In a feasible implementation, with the rapid development of Internet technology, network technology based on information publishing and retrieval technology has been widely used, which has made the architecture of network application systems evolve from the traditional master-slave type to a flexible distributed type. This evolution has brought a new technology-based modern information network. This architecture is called the Browser / Server (B / S) architecture. Compared with the traditional C / S model, the B / S structure has many advantages.

[0140] First, users only need to install a single browser software (such as IE, Microsoft Edge, etc.), the installation process is simple, the operation interface is simple and unified, saving user machine resources and providing a good user experience. Secondly, the basis of the B / S model is the standard TCP / IP and HTTP protocols, which makes the system more closely connected with the Internet. At the same time, HTML is an open data format standard, which enables the B / S system to be easily compatible with files of various formats, thereby better realizing information interaction. The establishment of the B / S model is based on web pages and browsers, and the visual expression is more vivid than other models, providing users with a better interactive experience. The development difficulty of the visual interface is relatively low, which reduces the development cost of programmers.

[0141] Based on the above advantages, this system uses the front-end web page to display real-time data to visualize the fault data, providing users with better data visualization effects.

[0142] As a Python-based web application framework, Django provides various components and tools required for front-end web development, providing great convenience for users. Django and Python together form an efficient and easy-to-maintain web development architecture and platform, allowing users to easily implement powerful and easy-to-maintain web applications. Django's architecture is called MTV (Model-Template-View), in which the Model part is used to interact with the database, the Template provides HTML templates for data display, and the View controls the coordination of the application, the processing of data and templates, etc.

[0143] Down Fig. 9 The workflow of the MTV model is demonstrated. The model part (models.py) establishes a mapping relationship between the system and the database, which facilitates reading data from the database for processing and display; the template part (templates.py) contains the written HTML web page file, which is used to dynamically display the data processing results in the browser, so that users can easily view the data; the view part includes three functions, namely receiving real-time data through Socket, uploading real-time data to the pSpace real-time database, and returning data to the Web page front end. The view module converts byte stream data into floating-point data, and uses the pSpace write method to write the floating-point data into the pSpace real-time database, and then calls the HTML file in the template to display the data in real time in the browser.

[0144] This system uses the Django framework developed in Python to realize the front-end web page display of real-time data. The steps for the front-end web page of the system to interact with the back-end data through the AJAX technology of the Django framework are as follows:

[0145] (1) Introduce the jQuery library and CSRF token into the front-end page;

[0146] (2) Define the view in the Django backend and specify the format of the returned data;

[0147] (3) Define routes in Django's URL configuration file;

[0148] (4) The browser sends different page requests to the routing distributor (urls.py) through AJAX technology according to demand;

[0149] (5) The distributor then calls the corresponding view function (views.py) according to the set path;

[0150] (6) The view function calls the web page in the template according to the received request and returns data to it for real-time display on the browser.

[0151] In a feasible implementation mode, the overall function of real-time data playback is as follows: Fig.10As shown. The data required for data playback is generated by the hot rolling process fault injection system. The user sets the corresponding IP address and basic data information on the graphical user interface. Then the Python software on the sending host sends data to the PLC based on the TCP / IP protocol and the Socket communication method. The CodeSys on the other host receives and tracks the real-time data, and draws the tracking curve through the Track module. At the same time, the Python of the host receives the real-time data written out by the PLC, uploads the real-time data to the pSpace real-time database in Python, and sends it to the front-end web page for display. The following will elaborate on the contents of the three main parts of the hot rolling process data playback system:

[0152] (1) CodeSys / PLC sends and receives data. This part of the data communication is based on the TCP / IP protocol. The IP address of the PLC is fixed. Both PCs establish a Socket object through Python and then establish a data connection with the PLC. They respectively assume the functions of data reception and data transmission. When the four processes are working normally, CodeSys and Python establish a connection through TCP / IP. The data stored in the global variable GVL.wrbuffer in CodeSys is sent to the Socket client established in Python in real time. Then the data is immediately uploaded from Python to the pSpace real-time database in real time. When fault injection is performed on the four processes, normal data enters the hot rolling process fault injection system based on Python to obtain fault data. Then Python establishes Socket communication with CodeSys and sends the fault data to the PLC through the TCP / IP communication protocol. At the same time, the CodeSys software stores the received data in the global variable GVL.rdbuffer. When the PLC write signal is triggered, CodeSys transfers the data to the global variable GVL.wrbuffer and then sends it to the Socket client established in Python. After receiving the data, Python immediately uploads the data to the pSpace real-time database in real time.

[0153] like Fig.11 As shown, the GUI establishes a connection with the corresponding IP address and is ready to send fault data to the PLC. Fig.12 As shown, the global variable curve in CodeSys is updated in real time, reflecting that the fault data is transmitted in real time through the PLC, and CodeSys / PLC successfully realizes the function of sending and receiving real-time data.

[0154] In the embodiment of the present invention, artificial intelligence technology is deeply integrated with civil engineering, and swarm intelligence technology is introduced to propose a set of intelligent rolling operation strategies for a rolling robot swarm system suitable for non-friendly construction environments and complex construction conditions, which can effectively improve the rolling quality and construction efficiency of filling projects and enhance the intelligence level of rolling machine equipment.

[0155] Real-time data is uploaded to the pSpace real-time database. This part of data transmission requires the support and management of the pSpace data tool client, and then configure the relevant environment in Python and call the pSpace.RealWritelist function to upload the data received from the PLC in real time. Fig.13 As shown in the figure, after receiving PLC data and uploading it to the real-time database, the real-time curve of the corresponding variable can be viewed in the database monitoring end psMonitor, and the historical data curve at the previous moment can also be viewed. The function of uploading real-time data to the pSpace real-time database is verified.

[0156] Real-time data display on the front-end web page. This part is based on Django for front-end data display. The browser request command is sent to the Django back-end, and the request data is sent to the front-end web page for display. Fig.14 and Fig.15 As shown, the real-time curves of the 25th to 34th and 32nd to 41st groups of data displayed on the front-end are respectively shown, which verifies the dynamic display function of real-time data on the front-end web page.

[0157] Fig.16 2 is a schematic diagram of a real-time data playback system for a hot rolling process of the present invention. The system 200 is used for real-time data playback of the hot rolling process. The system 200 includes:

[0158] TCP communication establishment module 210, used to establish a data communication connection between a TCP client and a TCP server;

[0159] TCP communication module 220, used for the TCP server to transmit hot rolling process data to the TCP client;

[0160] The data playback module 230 is used for the TCP client to receive the hot rolling process data, and send the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, so as to complete the real-time data playback of the hot rolling process.

[0161] Preferably, the TCP communication establishing module 210 is used to further complete the identification initialization of the socket object at the TCP server end;

[0162] The TCP server binds a specific IP address and port number through the bind() function;

[0163] The TCP server calls the listen() function to enable data monitoring for the IP address and port number, blocks data transmission, and waits for the TCP client to connect to the corresponding IP address;

[0164] When the TCP client sends a connect() request, the TCP server simultaneously calls accept() to receive the instruction and establishes a data communication connection between the TCP client and the TCP server.

[0165] Preferably, the data playback module 230 is used for normal data of the hot rolling process and data after fault injection.

[0166] Preferably, the TCP server and the TCP client both use Python for communication; Python is connected with the CodeSys industrial automation software platform, the Web page platform based on the Django framework, and the pSpace database data transmission.

[0167] Preferably, the TCP server transmits the hot rolling process data to the TCP client, including:

[0168] The TCP client sends a data request signal to the TCP server, and the TCP server receives and processes the data request signal;

[0169] The TCP client sends data at different sampling times to the TCP server in a cyclic manner;

[0170] After all data are sent, the server sends response data to the client, the client reads and processes the response data, and the TCP server receives the request data sending instruction and sends the hot rolling process data to the TCP client;

[0171] A data interaction between the client and the server ends, and the client and the server are disconnected.

[0172] Preferably, the data playback module 230 is used to obtain the user's data viewing requirements;

[0173] Send the hot rolling process data to the pSpace database and front-end Web page according to the user's data viewing requirements;

[0174] Real-time data playback of the hot rolling process is performed through the pSpace database and front-end Web pages.

[0175] Preferably, the data playback module 230 is also used to configure the pSpace database before data display, including:

[0176] Configure the database's user groups, users, permissions and other related information;

[0177] Manage the database measurement points, add measurement points for real-time data storage, modify the measurement point configuration, and configure the measurement point name and basic information of the node where the measurement point is located.

[0178] Preferably, the real-time data playback of the hot rolling process is performed through the pSpace database, including:

[0179] Put the pSpacepythonAPI file in the Lib\site-packages directory of the Python interpreter, and import the PythonAPI.PsServer package in the program;

[0180] Call the Psobject and connect functions in the software package to establish a connection with pSpace;

[0181] Write basic information such as data header, data storage point name, etc. into the dictionary;

[0182] Call the pSpace.RealWritelist function to write the real-time data into the real-time database, and monitor the uploaded real-time data in psMonitor.

[0183] In the embodiment of the present invention, two functions are mainly realized. One is to simulate the generation and transmission of normal data and fault data in software and hardware devices, establish a graphical user interface for data and hardware device communication and transmission IP connection, and also set the fault type, location, time and size of the data. The second is to establish a communication connection between the simulation process and the front-end web page and real-time database, and realize real-time data upload to the real-time database and real-time display on the front-end web page.

[0184] Fig.17 1 is a schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present invention. The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 301 and one or more memories 302, wherein the memory 302 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 301 to implement the following steps of the real-time data playback method of the hot rolling process:

[0185] S1, establish a data communication connection between the TCP client and the TCP server;

[0186] S2, the TCP server transmits the hot rolling process data to the TCP client;

[0187] S3. The TCP client receives the hot rolling process data and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, completing the real-time data playback of the hot rolling process.

[0188] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, which can be executed by a processor in a terminal to complete the real-time data playback method of the hot rolling process. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0189] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

Claims

1. A real-time data playback method for hot rolling process, characterized in that: The method steps include: S1, establish a data communication connection between the TCP client and the TCP server; The TCP server and the TCP client both use Python for communication; the Python is connected with the CodeSys industrial automation software platform, the Web page platform based on the Django framework, and the pSpace database data transmission; S2, the TCP server transmits the hot rolling process data to the TCP client; The TCP server transmits the hot rolling process data to the TCP client, including: The TCP client sends a data request signal to the TCP server, and the TCP server receives and processes the data request signal; The TCP client sends data at different sampling times to the TCP server in a cyclic manner; After all data are sent, the server sends response data to the client, the client reads and processes the response data, and the TCP server receives the request data sending instruction and sends the hot rolling process data to the TCP client; A data interaction between the client and the server ends, and the client is disconnected from the server; S3, the TCP client receives the hot rolling process data, sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, and completes the real-time data playback of the hot rolling process; In step S3, the TCP client receives the hot rolling process data, and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user requirements, completing the real-time data playback of the hot rolling process, including: Obtain user data viewing requirements; Sending the hot rolling process data to the pSpace database and the front-end Web page according to the user's data viewing requirements; Real-time data playback of hot rolling process is performed through the pSpace database and the front-end Web page; The real-time data playback of the hot rolling process through the pSpace database includes: Put the pSpacepythonAPI file in the Lib\site-packages directory of the Python interpreter, and import the PythonAPI.PsServer package in the program; Call the Psobject and connect functions in the software package to establish a connection with pSpace; Write the basic information of data header and data storage measuring point name into the dictionary; Call the pSpace.RealWritelist function to write the real-time data into the real-time database, and monitor the uploaded real-time data in psMonitor.

2. The method according to claim 1, characterized in that In step S1, establishing a data communication connection between a TCP client and a TCP server includes: Complete the initialization of the socket object's identifier on the TCP server side; The TCP server binds a specific IP address and port number through the bind() function; The TCP server calls the listen() function to enable data monitoring for the IP address and port number, blocks data transmission, and waits for the TCP client to connect to the corresponding IP address; When the TCP client sends a connect() request, the TCP server simultaneously calls accept() to receive the instruction and establishes a data communication connection between the TCP client and the TCP server.

3. The method according to claim 1, characterized in that In step S3, the hot rolling process data includes: Normal data of hot rolling process and data after fault injection.

4. The method according to claim 3, characterized in that The step S3 further includes: before the data is displayed, configuring the pSpace database, including: Configure the user groups, users and permissions related information of the database; Manage the database measurement points, add measurement points for real-time data storage, modify the measurement point configuration, and configure the measurement point name and basic information of the node where the measurement point is located.

5. A real-time data playback system for hot rolling process, characterized in that: The system is used for the real-time data playback method of the hot rolling process according to any one of claims 1 to 4, and the system comprises: TCP communication establishment module, used to establish a data communication connection between a TCP client and a TCP server; TCP communication module, used by the TCP server to transmit hot rolling process data to the TCP client; The data playback module is used for the TCP client to receive the hot rolling process data, and sends the hot rolling process data to the pSpace database and the front-end Web page for display according to user needs, so as to complete the real-time data playback of the hot rolling process.

6. The system according to claim 5, characterized in that The TCP communication establishment module is used to further complete the identification initialization of the socket object on the TCP server side; The TCP server binds a specific IP address and port number through the bind() function; The TCP server calls the listen() function to enable data monitoring for the IP address and port number, blocks data transmission, and waits for the TCP client to connect to the corresponding IP address; When the TCP client sends a connect() request, the TCP server simultaneously calls accept() to receive the instruction and establishes a data communication connection between the TCP client and the TCP server.

Citation Information

Patent Citations

  • Method, system and device for data transmission

    CN101272402A

  • System and method for extending asynchronous Web access based on Django

    CN113609416A

  • Django-based multi-terminal docking service system and basic environment construction method thereof

    CN115757467A

  • Methods, systems, and machine readable programming for interposing front end servers between servers and clients

    US6609159B1