Disclosure of Invention
In view of this, the present invention mainly aims to provide a VPLC configuration method, a configuration apparatus, and a computer-readable storage medium for an industrial server, so as to implement more convenient VPLC configuration for the industrial server.
The VPLC configuration method of the industrial server provided by the invention comprises the following steps:
the graphical configuration interface of the upper computer displays a component list area, a graphical configuration area and an attribute list configuration area;
receiving configuration operation of a user on a graphical configuration interface;
when a VPLC component displayed in the component list area is judged to be dragged and dropped into a frame body corresponding to a physical kernel in the graphical configuration area, the VPLC component is added and displayed in the frame body, a configuration item of the VPLC is displayed in the attribute list configuration area, and a configuration operation of a user on the configuration item is received;
determining a physical kernel corresponding to the frame body, and generating VPLC configuration information for the physical kernel based on the VPLC configuration items;
and compiling the generated configuration information to generate a format which can be recognized by the industrial server and downloading the format to the industrial server.
Therefore, the invention can display the frame body corresponding to each physical kernel through the graphical configuration area of the graphical configuration interface, and each configured VPLC can be displayed in each frame body, thereby realizing that a plurality of physical kernels and a plurality of VPLCs can be configured in one configuration interface, and because the VPLC can be configured for the physical kernels of the industrial server in a mode of dragging and dropping components, the VPLC can be configured very conveniently, and the problem that the code needs to be manually typed in the background technology is solved.
Optionally, the method further includes: when a port assembly displayed in the assembly list area is judged to be dragged and dropped into a VPLC assembly in the graphical configuration area, the port assembly is added in the graphical configuration area and displayed corresponding to the VPLC assembly, configuration items of the ports are displayed in the attribute list configuration area, and configuration operation of a user on the configuration items is received;
the generating the configuration information of the VPLC further comprises: and generating port configuration information for the VPLC corresponding to the VPLC component based on the configuration item of the port.
Therefore, the port is configured for the VPLC based on the drag-and-drop component, the VPLC can be configured conveniently, and the problem that manual configuration needs to be carried out by manually typing codes in the background technology is solved.
Optionally, the port component displayed in the graphical configuration area is located below the frame corresponding to the physical kernel for display;
and hiding the corresponding port component in the graphical configuration area aiming at the VPLC component which is not currently selected.
Therefore, the ports configured by the current VPLC can be visually displayed, and the ports configured by other VPLCs are hidden, so that the user mismatch is avoided.
Optionally, the method further includes: the graphical configuration interface also displays a project list area for displaying the configurable project engineering of the tree structure;
and after the configurable project engineering is clicked, the configurable components under the project engineering are displayed in the component list area.
Therefore, by displaying the configurable project engineering of the tree structure, each configurable component is classified, and the component to be used is more favorably found.
Optionally, the method further includes configuring a scheduling priority of each VPLC task, including:
configuring each physical kernel operation cycle in the configuration items of the attribute list configuration area corresponding to each physical kernel, wherein the operation cycle corresponds to a first priority of task scheduling of a VPLC configured by each physical kernel; and/or
And for different VPLC components in the frame corresponding to the same physical kernel, setting the value of the operation period for each corresponding VPLC according to the arrangement sequence of each VPLC component, wherein the value corresponds to the second priority of the task scheduling of each VPLC configured by the same physical kernel.
By the above configuration of two layers of priorities, the priorities of task scheduling can be flexibly generated for each VPLC. And the corresponding size value of the operation period of each VPLC is automatically set through the arrangement sequence of the VPLC components, so that manual configuration is omitted, and the second priority can be configured more conveniently.
Optionally, the method further includes: and when judging that one component or frame in the graphical configuration area is clicked, displaying the corresponding configuration item in the attribute list configuration area and receiving the configuration operation of the user on the configuration item.
Therefore, the configuration items can be visually displayed through the attribute list configuration area, and the configuration of a user is facilitated.
Optionally, the method further includes: when a VPLC component in a frame corresponding to a physical kernel is judged to be dragged and dropped to another frame, the corresponding VPLC and the physical kernels corresponding to the two frames are determined;
and deleting the configuration information of the VPLC in the configuration information of the physical kernel corresponding to the frame before dragging and dropping, and adding the configuration information of the VPLC in the configuration information of the physical kernel corresponding to the frame after dragging and dropping.
Therefore, the VPLC is configured on each physical kernel in a drag-and-drop mode, and configuration is more convenient.
Optionally, the method further includes: and when the VPLC component is judged to be in the selected state, displaying a control for controlling the running of the corresponding VPLC on the VPLC component.
Therefore, the operation of the VPLC can be conveniently and visually controlled.
The invention also provides a VPLC configuration device of the industrial server, which comprises:
the system comprises a graphical configuration interface of an upper computer, a display component list area, a graphical configuration area and an attribute list configuration area;
the configuration operation receiving module is used for receiving the configuration operation of a user on the graphical configuration interface;
the VPLC component configuration module is used for increasing and displaying a VPLC component in a frame body when judging that the VPLC component displayed in the component list area is dragged and dropped into the frame body corresponding to a physical kernel in the graphical configuration area, displaying a configuration item of the VPLC in the attribute list configuration area and receiving the configuration operation of a user on the configuration item;
the configuration information generating module is used for determining a physical kernel corresponding to the frame body and generating the configuration information of the VPLC for the physical kernel based on the configuration item of the VPLC;
and the downloading module is used for compiling the generated configuration information to generate a format which can be recognized by the industrial server and downloading the format into the industrial server.
The invention also provides a readable storage medium, which stores computer-executable instructions for causing the computer to execute any of the VPLC configuration methods described above.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, the present application will be further described in detail with reference to the accompanying drawings.
The invention provides a method for configuring VPLC through a graphical interface, which is characterized in that a graphical configuration interface is provided by configuration software installed on an upper computer, a user operates through dragging, clicking and typing operation modes, the configuration software creates a configuration file according to the operation mode, and the configuration file is compiled and then downloaded to an industrial server to enable the configuration to take effect, so that the VPLC configuration is completed for the industrial server.
The configuration method of the present invention is described in detail below with reference to the flow chart shown in fig. 1, and includes the following steps:
s100: and establishing communication connection between the upper computer provided with the configuration software and the industrial server.
The upper computer and the industrial server can establish communication connection through a Socket, and after the upper computer equipment and the industrial server establish communication connection, the hardware configuration information of the industrial server and the configuration information of each VPLC configured on the industrial server (on the premise of configuration) can be obtained.
The hardware configuration information of the industrial server can be acquired from the industrial server or can be pre-stored in a database, and the configuration software calls the hardware configuration information corresponding to the model from the database according to the model of the industrial server to be configured.
S200: and displaying a graphical configuration interface through configuration software of the upper computer, and graphically displaying the VPLC (under the configured premise) configured by the industrial server on the interface according to the obtained configuration information.
Fig. 2 shows a specific embodiment of a graphical configuration interface, in which the graphical configuration interface mainly comprises four parts, which are, in order from left to right:
the project list area displays configurable project projects in a list display mode of a tree structure;
when a configurable project of the project list area is selected and a Device Management item (Device Management) is clicked, the configurable components under the project are displayed in the component list area;
the graphical configuration area displays the VPLC configured by the physical kernel in a graphical mode;
the attribute list configuration area displays attribute configuration items of an object (e.g., a box or a component described later) in a tabular manner.
The configuration information of the industrial server and each VPLC thereon acquired in S100 includes: the mapping relationship between each physical core of the industrial server and the VPLC is that the VPLC is configured in each physical core of the industrial server (i.e., each CPU, if it is a multi-core CPU, unless otherwise specified, the CPU refers to a core in the multi-core CPU). The mapping in this example is: CPU2 of the industrial server is configured with VPLC _3, CPU3 is configured with VPLC _1 and VPLC _2, CPU1 and CPU4 are not configured with VPLC, wherein CPU1 is reserved as the industrial server.
Accordingly, as shown in fig. 2, the graphic configuration interface constructs 4 parallel frames in the graphic configuration area to represent 4 CPUs of the industrial server, and represents VPLC configured by the CPU corresponding to the frame by VPLC components in the frame, so VPL _3 components are displayed in the frame corresponding to CPU2, VPLC _1 and VPLC _2 components are displayed in the frame corresponding to CPU3, and the frames of CPU1 and CPU4 not configured with VPLC are empty.
And for each VPLC component, after being clicked, if the upper computer is currently in a connection state with the industrial server and the VPLC configured on the industrial server is in an online running state, a control for controlling the running of the VPLC is also displayed on the VPLC component, as shown in fig. 2, when VPLC _1 is clicked in an Active state, a running control, a stopping control, and a reloading (restarting) control are displayed thereon. And the corresponding control of the VPLC component which is not clicked is in a non-display state. As shown in fig. 2, the three ports configured by the clicked VPLC _1 are also shown below the CPU box in the graphic configuration area.
S300: when the user carries out configuration operation through the graphical configuration interface of the configuration software, the configuration software receives the configuration operation of the user, generates corresponding configuration information and stores the configuration information in the upper computer. The configured content may include the following:
A. the method comprises the following steps of carrying out attribute configuration on a CPU, wherein the configuration mode comprises the following configuration modes:
and the user operates the configuration software, moves the mouse to a frame body corresponding to a CPU of the graphical configuration area and clicks the frame body, and when the configuration software judges that the frame body is clicked, namely is in an Active state, the CPU corresponding to the frame body is determined, the configuration information of the CPU is called and displayed in the attribute list configuration area, then the configuration of the CPU in the attribute list configuration area by the user is received, and the configuration information is stored. The allocated partial information, such as a Cycle (Cycle), can be displayed in the CPU casing.
In addition, since the CPU1 is reserved for the server, when the casing corresponding to the CPU1 is clicked, the configuration information of the CPU may be retrieved, and the CPU to be configured may be selected by a pull-down menu in the configuration information.
Configuration items for the CPU operation cycles are provided in the attribute list configuration area of the CPU, different operation cycles of different CPUs can be configured according to the priority of task scheduling, and the shorter the operation cycle, the higher the priority. For different VPLC components in a frame corresponding to the same CPU, configuration software sets different values for the operation period of the corresponding VPLC according to the sequence (draggable adjustment) of the positions of the VPLC components to realize the automatic task scheduling priority of each VPLC configured by the same CPU, wherein the closer the arrangement position is, the smaller the value of the configured operation period is, the higher the priority is. Through the configuration of the CPU operation period and the automatic configuration of the VPLC operation period, the priority setting of two levels of VPLC task scheduling is realized, when task scheduling is carried out in the operation process of each VPLC of the industrial server, the priority of the task scheduling of the VPLC configured by the CPU with high priority is also high (the priority of the first level), and the priority of the VPLC task scheduling with high priority configured under the same CPU is also high (the priority of the second level under the second level of the first level).
B. The method comprises the following steps of configuring the mapping relation between the physical kernel of the industrial server and the VPLC, namely configuring the VPLC for the CPU, wherein the method comprises the following configuration modes:
b1, increasing:
and operating configuration software by a user, determining a CPU corresponding to a frame when the configuration software judges that a VPLC component displayed in the component list area is clicked and the VPLC component is dragged and dropped into a CPU frame of the graphical configuration area, adding a VPLC item and a related configuration item (namely establishing a mapping relation) for the CPU of the frame in the configuration information, and displaying the VPLC component in the CPU frame of the graphical configuration area. And on the other hand, the attribute list configuration area on the right side of the graphical configuration area shows the configuration items of the VPLC for the user to configure.
B2, deleting:
the user operates the configuration software, moves the mouse to a VPLC component in the graphical configuration area, clicks a 'delete' item (through a 'delete' item in a configuration software function menu or a function list of a right mouse button or a 'delete' button on a keyboard), and the configuration software executes a delete instruction, wherein the delete instruction comprises the following steps: determining a frame body where a mouse is currently located and a selected VPLC component, determining a CPU and a VPLC corresponding to the frame body and the component, deleting the VPLC item and related configuration information in the configuration information of the CPU corresponding to the frame body, and deleting the VPLC component in the frame body in a graphical configuration area.
B3: modifying the mapping relation between the VPLC and the CPU:
the user operates configuration software, a VPLC component is selected by a mouse in the graphical configuration area, dragged and dropped into a frame corresponding to another CPU and released, and the configuration software executes a mapping relation changing instruction, and the method comprises the following steps: determining a VPLC component clicked by a mouse and frames where the VPLC component is respectively located before and after dragging, determining a corresponding VPLC and CPUs corresponding to the two frames before and after dragging, deleting the VPLC item and related configuration information in the configuration information of the CPUs corresponding to the frames before and after dragging, adding the VPLC item and related configuration information in the configuration information of the CPUs corresponding to the frames after dragging, and displaying that the VPLC component moves into the corresponding frame in an imaging configuration area.
C. The VPLC is configured in the following configuration mode:
c1: configuring the attributes of the VPLC: the method comprises the steps that a user operates configuration software, a VPLC component is clicked in a graphical configuration area through a mouse, the configuration software judges that the VPLC component is clicked, namely the VPLC component is in an Active state, the current VPLC component and a frame body located in the VPLC component are determined, a CPU and a VPLC corresponding to the frame body and the VPLC component are determined, stored configuration information of the VPLC is read and displayed in an attribute list configuration area, then configuration operation of the VPLC in the attribute list configuration area by the user is received, and the configuration information is stored.
Fig. 2 shows configuration items of the VPLC displayed in the attribute list configuration area in this example, including Station ID (Station number for inter-Station communication), redundant (whether Redundant or not), sntp Server IP (Sntp Server IP address), and the like. As described above, cycles (operation cycles) of the VPLC are automatically allocated by the configuration software according to the sequence of the VPLC module in the frame corresponding to the CPU, and the previously allocated cycles have a small value and a high priority.
C2: configuration of VPLC ports:
the user operates configuration software, a port assembly displayed in the assembly list area is clicked through a mouse, the port assembly is dragged and dropped into a VPLC assembly in the graphical configuration area, and the configuration software executes a port increasing instruction, wherein the port increasing instruction comprises the following steps: determining that a port component displayed in a component list area is clicked, determining a VPLC corresponding to the VPLC when the port component is dragged and dropped into a VPLC component, adding port configuration information of a type corresponding to the port component to the VPLC in the configuration information, and displaying the port component below a CPU frame body in an imaging configuration area to represent that the VPLC is configured with the port. And on the other hand, the attribute list configuration area on the right side of the graphical configuration area displays the configuration items of the type ports for the user to perform configuration operation and store.
The port assembly comprises various types including a management network port and a bus port, and the bus port comprises a network port, a serial port, a CAN port, a two-wire port and the like. In fig. 2 corresponding to this example, the network port 2-1 and the serial port COM1 of the bus port are configured for the VPLC _1 in a drag-and-drop manner, where the management network port 2-0 is created by default by configuration software.
For the management network port, the configuration software can default to configure a management network port for each VPLC to be used for remote connection of the VPLC, so that the management network port can be automatically created by the configuration software. When the management network port 2-0 of the graphical configuration area is clicked, the attribute list configuration area on the right side of the graphical configuration area displays configuration items of the port, including configuration items such as an IP (Internet protocol), a gateway and a mask.
For a bus port, the VPLC is enabled to establish communication with the fieldbus by configuring the VPLC with a corresponding virtual port. The attribute list configuration area on the right side of the graphical configuration area shows configuration items of the port, for example, configuration items of the internet access include: IP, gateway, mask, VLAN period and other information; the configuration items of the serial port comprise: baud rate, data bits, stop bits, parity, etc.; the configuration items of the CAN port comprise: port number, communication baud rate, operating mode, etc.
The deletion of a certain port of the VPLC is similar to that described in the foregoing B2, and is not described again.
In addition, a copy operation may also be performed, for example, VPLC _2 in a CPU3 frame is dragged and copied to a CPU1 frame, and the configuration software adds the dragged and dropped information related to VPLC _2 to the configuration information corresponding to the CPU 1. If the COM1 port component corresponding to the VPLC _1 component is dragged and dropped and copied to the VPLC _3 component, the configuration software adds the relevant information of the dragged COM1 port to the configuration information corresponding to the VPLC _ 3.
S400: as described above, after the configuration software completes the required configurations through the graphical configuration interface provided by the configuration software, the configuration software will save the configuration information as a file with a set format as the generated configuration file, in this case, an XML format file, according to the file format requirement set inside.
The configuration file includes hardware configuration information of the industrial server (such as configuration information of a memory, a hard disk, a network card, a serial port, a usb, a video card, and the like), and related information configured in step S300, such as the port (a virtual network port, a serial port, a CAN port, and the like), a micro system mirror image used for creating a VPLC, and some configuration information related to task scheduling.
In the configuration process in S300, multiple XML files may be generated for the configuration of each project, and in this step, the XML files are integrated into one XML file, which is convenient for the subsequent compiling process and downloading.
S500: compiling the stored configuration file line in the format to generate a file in a corresponding format which can be recognized by the industrial server, for example, compiling an XML file to generate a C language format file, and then downloading the C language format file to the industrial server.
The execution of the step can be triggered by selecting a corresponding instruction in a menu bar at the top of a graphical configuration interface of the configuration software by a user.
S600: and restarting the industrial server to enable the configuration information of the downloaded file to take effect, and the industrial server can execute initialization according to the configuration information, wherein the initialization comprises memory address allocation, VPLC (virtual private LAN access control) creation and the like, so that the configuration of the VPLC is completed.
After the configuration of the VPLC of the industrial server is completed, a subsequent programmer can program each VPLC, that is, program the internal control logic of each VPLC and the scheduling logic between each VPLC, which is not a concern of the present invention, and as for how to program VPLC graphically and graphically, reference may be made to a Structured Text (ST) language editor, an Intermediate Language (IL) language editor, a Function Block Diagram (FBD) language editor, a sequential function diagram (SFC) language editor, and a ladder diagram (LAD) language editor of the IEC61131 standard; the functional block diagram editor, the execution control diagram (ECC) editor, the cross editor, etc. of the IEC61499 standard are not described in detail.
The configuration process of the VPLC of the industrial server is mainly described as an example, and it is understood that the configuration software is also suitable for online monitoring (obtaining configuration information and running information of the industrial server and the VPLC for display) and management (corresponding to configuration) of the industrial server, and is not described again.
In another embodiment, the present invention further provides a configuration device for implementing the VPLC configuration method of the industrial server, including:
the system comprises a graphical configuration interface of an upper computer, a display item list area, a component list area, a graphical configuration area and an attribute list configuration area, wherein the graphical configuration interface is used for displaying a project list area, a component list area, a graphical configuration area and an attribute list configuration area;
the configuration operation receiving module is used for receiving the configuration operation of a user on the graphical configuration interface;
the VPLC component configuration module is used for increasing and displaying a VPLC component in a frame body when judging that the VPLC component displayed in the component list area is dragged and dropped into the frame body corresponding to a physical kernel in the graphical configuration area, and displaying a configuration item of the VPLC in the attribute list configuration area and receiving the configuration of a user;
the configuration information generation module is used for determining a physical kernel corresponding to the frame body and generating the configuration information of the VPLC for the physical kernel according to the configuration item of the VPLC;
the downloading module is used for compiling the generated configuration information to generate a format which can be recognized by the industrial server and downloading the format into the industrial server;
the port component configuration module is used for judging that a port component displayed in the component list area is dragged and dropped into a VPLC component in the graphical configuration area, adding the port component in the graphical configuration area and displaying the port component corresponding to the VPLC component, and displaying a configuration item of a port in the attribute list configuration area and receiving the configuration of a user;
each VPLC task scheduling priority configuration module is used for configuring each physical kernel operation cycle in the configuration item of the attribute list configuration area corresponding to each physical kernel, and the operation cycle corresponds to the first priority of the VPLC task scheduling configured by each physical kernel; and/or different VPLC components in the frame corresponding to the same physical kernel automatically set the size value of the corresponding operation period of each VPLC according to the arrangement sequence of each VPLC component, wherein the size value corresponds to the second priority of task scheduling of each VPLC configured by the same physical kernel.
In another embodiment, the present application further provides a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the VPLC configuration method of the industrial server in the above embodiments.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any combination thereof, and when the implementation is realized by a software program, all or part of the implementation may be realized in the form of a computer program product. The computer program product includes one or more instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The instructions may be stored in a computer storage medium or transmitted from one computer storage medium to another, e.g., from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optics, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer storage media may be any available media that can be accessed by a computer or a data storage device, such as a server, data center, etc., that incorporates one or more available media. The usable medium may be a magnetic medium (e.g., a flexible Disk, a hard Disk, a magnetic tape, a magneto-optical Disk (MO), etc.), an optical medium (e.g., a CD, a DVD, a BD, an HVD, etc.), or a semiconductor medium (e.g., a ROM, an EPROM, an EEPROM, a nonvolatile memory (NAND FLASH), a Solid State Disk (SSD)), etc. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
The instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.