An automatic addressing method for distributed emulsification pump station control system
By adopting the automatic addressing method in the emulsification pump station control system and utilizing the DHCP and DSA functions, automatic IP address allocation without manual configuration is realized, which solves the production shutdown problem caused by the failure of the main control CPU module and improves production efficiency and system stability. sex.
Patent Information
- Application Number
- CN202410910878.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-09
AI Technical Summary
When the main control CPU module of the existing emulsification pump station control system fails, manual configuration and software installation are required, resulting in a high error probability, long production shutdown time, and redundant stocking, which increases costs.
The automatic addressing method of the distributed emulsification pumping station control system is adopted, the main station controller is used to preset the IP address table of the sub-station controller, and the MAC address and IP binding method of the DHCP service program are used to realize automatic IP address allocation and storage. Combined with the DSA function and VLAN forwarding feature of the network switching chip, automatic addressing is achieved.
It realizes automatic addressing without manual configuration, reduces error probability and production downtime, saves costs, and is suitable for multi-level controller systems, improving production efficiency and system stability.
Smart Images

Figure CN118466164B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of distributed control, and in particular to an automatic addressing method for a distributed emulsification pump station control system. Background Art
[0002] With the continuous popularization and promotion of intelligent coal mines, the automation control system of fully mechanized mining working faces is also constantly developing and improving. The emulsification pump control system is the basis of the working face automation control system. It has a vital impact on the follow-up speed and working stability of the hydraulic support. It is an important equipment to ensure safe production and improve work efficiency.
[0003] The emulsification pump station control system includes a master station controller and multiple substation controllers of different types. The substation controllers include emulsification pump controllers, spray pump controllers, liquid tank controllers, and water tank controllers. The master station controller is the management and dispatching center of the substation controllers and the first controller of the emulsification pump station control system. It is connected to the underground ring network and the substation controller. The substation controller directly controls the corresponding pump body. In the long-term operation of the controller, it is inevitable that a certain controller will be damaged, and the main control CPU module, which is the core and brain of the controller, is often damaged. In today's underground pump station control system, if the main control CPU module of a controller fails or is abnormal, the entire pump station system will shut down and production will stagnate. Then replace this controller, and after the replacement, it is necessary to manually configure and install the software for which substation control is currently being used, which increases the probability of error, and also prolongs the downtime, affecting production efficiency. Another method is to prepare stocks in advance and configure the CPU modules of each substation controller in advance. Although this method saves configuration time, it also does not solve the probability of errors caused by manual configuration and software installation, and it also brings a new problem. The same hardware module needs to be prepared in multiple ways due to different software and configurations, which increases labor costs and material management costs. In addition, there is no flexibility in stocking, and a large amount of stock redundancy is required, which wastes costs. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides an automatic addressing method for a distributed emulsification pump station control system.
[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0006] A distributed emulsification pump station control system automatic addressing method comprises the following steps:
[0007] The main control CPU module of the main station controller in the distributed emulsification pump station control system is used to preset the IP address table of all substation controllers;
[0008] Use the main control CPU module of the master station controller to obtain the MAC address of the main control CPU module of the substation controller;
[0009] The main control CPU module of the master station controller uses the MAC address and IP binding method of the DHCP service program to allocate an IP address to the main control CPU module of the substation controller;
[0010] In response to the notification that the main control CPU module of the substation controller receives the IP address, the main control CPU module of the main station controller sends the IP address table of all substation controllers to the main control CPU module of the substation controller, and the main control CPU module of the substation controller stores the IP address table of all subsequent substation controllers.
[0011] Preferably, the distributed emulsification pump station control system includes:
[0012] One master station controller and multiple substation controllers of different types;
[0013] Both the master station controller and the substation controller include a network switching module, a main control CPU module, multiple MCU input and output modules and a backplane module;
[0014] Ports 0 to 7 of the network switch module are connected to multiple MCU input and output modules through the backplane module;
[0015] Port 8 of the network switch module is connected to the main control CPU module through the backplane module;
[0016] Port 9 of the network switching module is connected to port 10 of the network switching module in the next-level controller;
[0017] Port 10 of the network switching module is connected to port 9 of the network switching module in the upper-level controller.
[0018] Preferably, using the main control CPU module of the main station controller to obtain the MAC address of the main control CPU module of the substation controller includes:
[0019] Use the main control CPU module of the master station controller to configure the DSA working mode of the network switch module, so that the network switch module operates in Special Tag mode;
[0020] A DSA processing layer is added to the data link layer of the kernel layer of the main control CPU module of the master station controller, so that the data packet sent by the main control CPU module of the next controller is forwarded to the port 8 of the network switching module after passing through the port 9 of the network switching module of the master station controller; when the network card driver layer of the main control CPU module receives the data packet, the data packet carries the target MAC address and the original MAC address as well as the Special Tag of the physical port where the data packet enters, and then the DSA processing layer of the main control CPU module parses the Special Tag, extracts the source MAC of the data packet whose source port is 9 and stores it, and creates a kernel sysfs file system interface, writes the MAC address of port 9 into the sysfs file system interface, and then removes the Special Tag and forwards it to the TCP / IP layer and application layer of the main control CPU module.
[0021] Preferably, the network switching module is operated in a Special Tag mode, including:
[0022] The network switching module operating in the Special Tag mode adds a Special Tag to the data frame entering from the current physical port, and sends the data frame with the Special Tag; wherein the Special Tag includes the source port of the data frame.
[0023] Preferably, when the main control CPU module sends a data packet, the data packet received from the application layer passes through the TCP / IP layer, and then the DSA processing layer adds a Special Tag to the data frame and then forwards it to the network card driver layer.
[0024] Preferably, when the main control CPU module of the main station controller is used to obtain the MAC address of the main control CPU module of the sub-station controller, the network switching module of the main station controller uses a virtual LAN table to control the forwarding path of the data flow, so that the data packets that first enter port 9 are only the data packets sent by the main control CPU module of the next-level controller, and other modules are allowed to perform corresponding forwarding only after the controller at the previous level obtains the MAC address and completes the IP address allocation.
[0025] Preferably, when the main control CPU module of the main station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the data forwarding function between the main control CPU module and the MCU input and output module of the main station controller is turned on, the data forwarding function between the main control CPU module of the main station controller and the uplink is turned on, and the data forwarding function between the main control CPU module of the main station controller and the downlink is turned on.
[0026] As a preferred embodiment, when the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network card driver layer of the master station controller is controlled to configure the virtual LAN table of the network switching module, so that the data packets from port 1 to port 7 are forwarded to port 8, and the data packets from port 8 are forwarded to port 1 to port 7. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the MCU input and output module to be turned on through the sysfs interface switch;
[0027] The network card driver layer of the master station controller is controlled to configure the virtual LAN table of the network switching module, so that the data packets of port 10 are forwarded to port 8, and the data packets of port 8 are forwarded to port 10. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the uplink to be turned on through the sysfs interface switch;
[0028] The network card driver layer that controls the master station controller configures the virtual LAN table of the network switching module so that the data packets of port 9 are forwarded to port 8, and the data packets of port 8 are forwarded to port 9. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the downlink through the sysfs interface switch.
[0029] Preferably, when the MAC address of the master CPU module of the substation controller is obtained by using the master CPU module of the main station controller, the data forwarding function of the master CPU module and the uplink of the substation controller is turned on by default; the data forwarding function of the master CPU module and the downlink is prohibited by default, and the data forwarding function is turned on after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; the data forwarding function of the MCU input and output module and the uplink is prohibited by default, and the data forwarding function is turned on after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; the data forwarding function of the downlink and uplink is prohibited by default, and the data forwarding function is turned on after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller.
[0030] As a preferred embodiment, when the main control CPU module of the main station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data of port 10 is forwarded to port 8, and the data packet of port 8 is forwarded to port 10, and at the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the main control CPU module and the uplink to be turned on through the sysfs interface switch;
[0031] The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module so that the data of port 8 is not forwarded to port 9, and the data packets of port 9 are not forwarded to port 8. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the main control CPU module and the downlink through the sysfs interface switch to turn on or off;
[0032] The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data from port 1 to port 7 is not forwarded to port 10, and the data packets of port 10 are not forwarded to port 1 to port 7. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the MCU input and output module and the uplink to be turned on or off through the sysfs interface switch;
[0033] The network card driver layer that controls the substation controller configures the virtual LAN table of the network switching module so that the data of port 9 is not forwarded to port 10, and the data packets of port 10 are not forwarded to port 9. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the uplink and downlink through the sysfs interface switch to turn on or off.
[0034] The present invention has the following beneficial effects:
[0035] (1) The present invention utilizes the DSA function of the network switching chip in combination with the VLAN forwarding characteristics to implement an automatic addressing method, so that the master station controller can automatically assign a specified IP address to each substation controller according to the physical connection order of each substation controller, thereby realizing automatic addressing of different substation controllers.
[0036] (2) The automatic addressing method for a distributed emulsification pump station control system proposed in the present invention is implemented purely by software, does not require additional circuits, saves costs, and has strong versatility. It is not only applicable to pump station control systems, but also to any system using a multi-level controller, such as a bracket control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 The figure is a flow chart of an automatic addressing method for a distributed emulsification pump station control system. DETAILED DESCRIPTION
[0038] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0039] like Figure 1 As shown, the embodiment of the present invention provides a distributed emulsification pump station control system automatic addressing method, including the following steps S1 to S4:
[0040] S1. Preset the IP address table of all substation controllers by using the main control CPU module of the main station controller in the distributed emulsification pump station control system;
[0041] In an optional embodiment of the present invention, the distributed emulsification pump station control system in this embodiment includes:
[0042] One master station controller and multiple substation controllers of different types;
[0043] Both the master station controller and the substation controller include a network switching module, a main control CPU module, multiple MCU input and output modules and a backplane module;
[0044] Ports 0 to 7 of the network switch module are connected to multiple MCU input and output modules through the backplane module;
[0045] Port 8 of the network switch module is connected to the main control CPU module through the backplane module;
[0046] Port 9 of the network switching module is connected to port 10 of the network switching module in the next-level controller;
[0047] Port 10 of the network switching module is connected to port 9 of the network switching module in the upper-level controller.
[0048] Specifically, the distributed emulsification pump station control system includes a master station controller and multiple substation (emulsification pump, spray pump, liquid tank, water tank) controllers. Each controller integrates a network switching module, a main control CPU module, multiple MCU input and output modules, and a backplane unit; the network switching module contains 11 ports, of which port 0 to port 7 are connected to the MCU input and output module through the backplane as a data acquisition and control channel; port 8 is connected to the main control CPU module through the backplane, and the main control CPU exchanges data with the MCU module and the upper and lower controllers through this port; port 9 is connected to port 10 of the network switching module in the next-level controller to interact with the lower-level controller; port 10 is connected to port 9 of the network switching module in the upper-level controller to interact with the upper-level controller, and each controller is connected one by one in this way. The master station controller is the first controller of the system, and the substation controller of the next level is the emulsification pump controller, followed by the spray pump controller, liquid tank controller, and water tank controller. The switching module port 10 of the master station controller is connected to the downhole ring network, the switching module port 9 of the master station controller is connected to the port 10 of the emulsification pump controller, the switching module port 9 of the emulsification pump controller is connected to the switching module port 10 of the spray pump controller, the switching module port 9 of the spray pump controller is connected to the switching module port 10 of the liquid tank controller, and the switching module port 9 of the liquid tank controller is connected to the switching module port 10 of the water tank controller.
[0049] The network connection order of each controller in the distributed emulsification pump station control system is fixed, that is, the main station controller is the first controller of the system, the next-level substation controller is the emulsification pump controller, followed by the spray pump controller, liquid tank controller, and water tank controller. There can be multiple substation controllers of the same type. For the convenience of description, the present invention is described based on the situation that there is only one substation controller of each type. The method described in the present invention is also applicable to the situation where there are multiple substation controllers of the same type. The main control CPU module and MCU module inside the controller are connected via Ethernet, and each controller is also connected via Ethernet. All the main control CPU modules and MCU modules of the main station and substation in the system are in a local area network. The main control CPU module is the core and brain of the controller. The method described in the present invention runs on the main control CPU module, and the controller's control function, data exchange and processing function, logical operation function, etc. of the peripherals also run on the main control CPU module. The main control CPU module of each substation controller has no difference in software and hardware when it leaves the factory, and the software installed on the equipment is zero-installed and zero-configured.
[0050] The control software and configuration of each substation controller in the distributed emulsification pump station control system of this embodiment are different, but the main control CPU module is the same when leaving the factory, so the configuration and control software of all substation controllers are sent from the main control CPU module of the main station controller to the main control CPU module of the substation controller when the system is started. When the main control CPU module of any substation controller fails, the control function of this substation controller on the peripherals will be seamlessly switched to the main station or other substation controllers. This distributed control system changes the current control mode of the emulsification pump control system, enhances the stability of the system, and realizes the technological transformation of this type of control system; it solves the pain points of the current emulsification pump control system, greatly improves production efficiency, saves production costs, and has great application value.
[0051] The distributed emulsification pump station control system of this embodiment adopts a hot backup function, that is, when the main control CPU module of any substation controller fails, the control function of this substation controller on the peripherals will be seamlessly switched to the main station or other substation controllers; when the main control CPU module of this substation controller returns to normal, the control function of this substation controller on the peripherals will automatically switch back to this substation controller.
[0052] The key and difficulty of implementing the distributed emulsification pump station control system in this embodiment lies in how the master station controller knows which substation controller is connected to the next level, and which substation controller is connected to the next level, and so on. The automatic addressing method of a distributed emulsification pump station control system proposed in this embodiment aims to solve this difficulty, so that the master station controller clearly knows the network topology of the current emulsification pump station system and realizes automatic addressing of each substation controller. This provides a basis for the configuration of the substation controller, the distribution of control software, and the hot backup function.
[0053] In this embodiment, the main control CPU module of the master station controller maintains an IP address table corresponding to the main control CPU modules of each substation controller.
[0054] S2, using the main control CPU module of the master station controller to obtain the MAC address of the main control CPU module of the substation controller;
[0055] In an optional embodiment of the present invention, the present embodiment uses the main control CPU module of the master station controller to obtain the MAC address of the main control CPU module of the substation controller, including:
[0056] The main control CPU module of the master station controller is used to configure the DSA working mode of the network switch module, so that the network switch module operates in the Special Tag mode; wherein the network switch module is operated in the Special Tag mode, including:
[0057] The network switching module operating in the Special Tag mode adds a Special Tag to the data frame entering from the current physical port, and sends the data frame with the Special Tag; wherein the Special Tag includes the source port of the data frame.
[0058] A DSA processing layer is added to the data link layer of the kernel layer of the main control CPU module of the master station controller, so that the data packet sent by the main control CPU module of the next controller is forwarded to the port 8 of the network switching module after passing through the port 9 of the network switching module of the master station controller; when the network card driver layer of the main control CPU module receives the data packet, the data packet carries the target MAC address and the original MAC address as well as the Special Tag of the physical port where the data packet enters, and then the DSA processing layer of the main control CPU module parses the Special Tag, extracts the source MAC of the data packet whose source port is 9 and stores it, and creates a kernel sysfs file system interface, writes the MAC address of port 9 into the sysfs file system interface, and then removes the Special Tag and forwards it to the TCP / IP layer and application layer of the main control CPU module.
[0059] In this embodiment, when the main control CPU module sends a data packet, the data packet received from the application layer passes through the TCP / IP layer, and the DSA processing layer adds a Special Tag to the data frame, and then forwards it to the network card driver layer.
[0060] In this embodiment, when the main control CPU module of the main station controller is used to obtain the MAC address of the main control CPU module of the sub-station controller, the network switching module of the main station controller adopts a virtual LAN table to control the forwarding path of the data flow, so that the data packets that first enter port 9 are only the data packets sent by the main control CPU module of the next-level controller, and other modules are allowed to perform corresponding forwarding only after the controller of the upper level obtains the MAC address and completes the IP address allocation.
[0061] In this embodiment, when the main control CPU module of the main station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the data forwarding function between the main control CPU module and the MCU input and output module of the main station controller is turned on, the data forwarding function between the main control CPU module of the main station controller and the uplink is turned on, and the data forwarding function between the main control CPU module of the main station controller and the downlink is turned on.
[0062] When the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network card driver layer of the master station controller is controlled to configure the virtual local area network table of the network switching module, so that the data packets from port 1 to port 7 are forwarded to port 8, and the data packets from port 8 are forwarded to port 1 to port 7. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the MCU input and output module to be turned on through the sysfs interface switch;
[0063] The network card driver layer of the master station controller is controlled to configure the virtual LAN table of the network switching module, so that the data packets of port 10 are forwarded to port 8, and the data packets of port 8 are forwarded to port 10. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the uplink to be turned on through the sysfs interface switch;
[0064] The network card driver layer that controls the master station controller configures the virtual LAN table of the network switching module so that the data packets of port 9 are forwarded to port 8, and the data packets of port 8 are forwarded to port 9. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the downlink through the sysfs interface switch.
[0065] In this embodiment, when the master CPU module of the main station controller obtains the MAC address of the master CPU module of the substation controller, the data forwarding function of the master CPU module and the uplink of the substation controller is turned on by default; the data forwarding function of the master CPU module and the downlink is prohibited by default, and the data forwarding function is turned on after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; the data forwarding function of the MCU input and output module and the uplink is prohibited by default, and the data forwarding function is turned on after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; the data forwarding function of the downlink and uplink is prohibited by default, and the data forwarding function is turned on after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller.
[0066] When the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data of port 10 is forwarded to port 8, and the data packet of port 8 is forwarded to port 10. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the main control CPU module and the uplink to be turned on through the sysfs interface switch;
[0067] The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module so that the data of port 8 is not forwarded to port 9, and the data packets of port 9 are not forwarded to port 8. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the main control CPU module and the downlink through the sysfs interface switch to turn on or off;
[0068] The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data from port 1 to port 7 is not forwarded to port 10, and the data packets of port 10 are not forwarded to port 1 to port 7. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the MCU input and output module and the uplink to be turned on or off through the sysfs interface switch;
[0069] The network card driver layer that controls the substation controller configures the virtual LAN table of the network switching module so that the data of port 9 is not forwarded to port 10, and the data packets of port 10 are not forwarded to port 9. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the uplink and downlink through the sysfs interface switch to turn on or off.
[0070] Specifically, the MAC address is the unique identity information of the network device, which is unique and fixed. The main station controller first finds the MAC address of the main control CPU module of the adjacent substation controller (emulsification pump controller), and uses the MAC address and IP binding method of the DHCP service program to assign its IP address. Then the emulsification pump controller finds the MAC address of the main control CPU module of the adjacent substation controller (spray pump controller), and similarly uses the MAC address and IP binding method of the DHCP service program to assign its IP address, and so on, assigning addresses to the main control CPU modules of each substation controller one level at a time.
[0071] In this embodiment, when obtaining the MAC address of the main control CPU module of the emulsification pump controller, the following two problems need to be solved:
[0072] 1. How does the main control CPU module of the master station controller obtain the MAC address of the data packet coming from port 9?
[0073] 2. It is necessary to confirm that this MAC address is the MAC address of the main control CPU module of the adjacent substation controller (emulsification pump controller). Because the MCU module, main control CPU module of the main station controller and the MCU modules and main control CPU modules of all substation controllers are in the same network, as we all know, the network switching module forwards all ports by default, and the data packets of the MCU module of the main station controller and the MCU modules and main control CPU modules of all substation controllers will be forwarded to port 9, so it is necessary to obtain the data packets from the main control CPU module of the emulsification pump substation controller and obtain the MAC address from them.
[0074] In response to the first problem mentioned above, this embodiment first configures the network switching module to the DSA (distributed switch architecture) working mode, so that its switching chip operates in Special Tag mode: that is, the switching chip operating in Special Tag mode adds a Special Tag to the data frame entering from the current physical port. The Special Tag is 4 bytes of data. The Special Tag includes Src_Port, and Src_Port represents the source port of the data frame; and sends the data frame with the Special Tag, and the main control CPU module can obtain the MAC address of the corresponding port.
[0075] The present embodiment then improves the data link layer of the kernel layer of the master control CPU module and adds a DSA processing layer. The data packet from the master control CPU module of the next controller is forwarded to port 8 after passing through port 9 of the network switch module of the master station controller. When the network card driver layer receives the data packet, the data packet carries the target MAC address and the original MAC address as well as the Special Tag of the physical port into which the data packet enters. The DSA processing layer parses the Special Tag, takes out the source MAC of the data packet whose Src_Port is 9 and stores it, and simultaneously creates a kernel sysfs file system interface, and transmits the MAC address of port 9 to the interface variable of sysfs. The upper layer application directly uses the cat command to read the interface variable of the sysfs file system and can obtain the MAC address of the data packet entering port 9, without the need to develop application software. In the present invention, the following command cat / sys / kernel / eth0 / slot_mac is used. Then remove the Tag and forward it to the TCP / IP layer.
[0076] When the main control CPU module sends a data packet, the data packet from the application layer passes through the TCP / IP layer, the DSA processing layer adds a Special Tag, and then forwards it to the network card driver layer.
[0077] In response to the second problem mentioned above, this embodiment uses VLAN TABLE to control the forwarding path of the data flow to ensure that the main control CPU only obtains the MAC address of the corresponding port; that is, the forwarding function of the network switching module is used to control that the data entering port 9 first is only from the main control CPU module of the next-level controller. Only after the controller at the previous level obtains the MAC address and completes the IP address allocation, other modules are allowed to perform corresponding forwarding. The main control CPU module of the main station control first allocates an IP to the main control CPU module of the adjacent emulsification pump controller. After the main control CPU module of the emulsification pump controller obtains the IP, it allocates the IP to the main control CPU module of the next-level spray pump controller, and the allocation is in turn. The MCU module of the controller of this station obtains the IP from the main control CPU module of the controller of this station.
[0078] For the master controller, the settings are as follows:
[0079] 1. The data of the main control CPU module and the MCU module must be forwarded to each other to ensure that an IP address can be assigned to the MCU module;
[0080] 2. The main control CPU module and uplink data must be forwarded to each other to ensure access to the underground ring network;
[0081] 3. The main control CPU module and the downlink data must be forwarded to each other to ensure that the IP address can be allocated to the next-level substation controller (emulsification pump controller);
[0082] The corresponding specific implementation methods are:
[0083] Because the main control CPU module is connected to port 8 of the network switch module, the MCU module is connected to ports 1 to 7 of the network switch module, the port for entering the underground ring network is port 10, and the port for connecting to the next level controller is port 9, so:
[0084] 1. The driver layer configures the virtual LAN table of the network switching module so that the data packets from port 1 to 7 are forwarded to port 8, and the data packets from port 8 are forwarded to ports 1 to 7. At the same time, the sysfs file system interface is created. The application layer controls the data forwarding function of the main control CPU module and the MCU input and output module through the sysfs interface switch.
[0085] 2. The driver layer configures the virtual LAN table of the network switching module so that the data packets of port 10 are forwarded to port 8, and the data packets of port 8 are forwarded to port 10. At the same time, a sysfs file system interface is created. The application layer controls the data forwarding function of the main control CPU module and the uplink through the sysfs interface switch.
[0086] 3. The driver layer configures the virtual LAN table of the network switching module so that the data packets of port 9 are forwarded to port 8, and the data packets of port 8 are forwarded to port 9. At the same time, the sysfs file system interface is created. The application layer controls the data forwarding function of the main control CPU module and the downlink through the sysfs interface switch.
[0087] For all substation controllers:
[0088] 1. By default, the master CPU module and its uplink data are forwarded to each other to ensure that the master CPU module of the upper-level controller can obtain the MAC address of the CPU module of the substation controller.
[0089] 2. By default, the master CPU module and its downlink data are prohibited from forwarding each other, ensuring that the master CPU module will not obtain the IP from the master CPU module of the next-level controller. After the master CPU module of the substation controller obtains the IP and receives the IP address table sent by the upper-level controller, forwarding is enabled.
[0090] 3. By default, the MCU module and the uplink data are prohibited from forwarding each other, ensuring that the MAC address obtained by the CPU module of the upper-level controller through port 9 will not be the MAC address of the MCU module of the substation controller. After the main CPU module of the substation controller obtains the IP and receives the IP address table sent by the upper-level controller, forwarding is enabled.
[0091] 4. By default, downlink data and uplink data are prohibited from forwarding each other, ensuring that the MAC address obtained by the CPU module of the upper-level controller through port 9 will not be the MAC address of the lower-level controller. After the main CPU module of the substation controller obtains the IP and receives the IP address table sent by the upper-level controller, forwarding is enabled.
[0092] The corresponding specific implementation methods are:
[0093] 1. The driver layer configures the virtual LAN table of the network switching module so that the data from port 10 is forwarded to port 8, and the data packets from port 8 are forwarded to port 10. At the same time, a sysfs file system interface is created. The application layer controls the data forwarding function of the main control CPU module and the uplink through the sysfs interface switch.
[0094] 2. The driver layer configures the virtual LAN table of the network switching module so that the data from port 8 is not forwarded to port 9, and the data packets from port 9 are not forwarded to port 8. At the same time, a sysfs file system interface is created. The application layer controls the data forwarding function between the main control CPU module and the downlink through the sysfs interface switch to be turned on or off.
[0095] 3. The driver layer configures the virtual LAN table of the network switching module so that the data from port 1 to 7 is not forwarded to port 10, and the data packets from port 10 are not forwarded to ports 1 to 7. At the same time, a sysfs file system interface is created. The application layer controls the data forwarding function of the MCU input and output module and the uplink through the sysfs interface switch to turn it on or off.
[0096] 4. The driver layer configures the virtual LAN table of the network switching module so that the data from port 9 is not forwarded to port 10, and the data packets from port 10 are not forwarded to port 9. At the same time, a sysfs file system interface is created. The application layer controls the data forwarding function of the uplink and downlink through the sysfs interface switch to turn it on or off.
[0097] S3, using the MAC address and IP binding method of the DHCP service program of the main control CPU module of the master station controller to assign an IP address to the main control CPU module of the substation controller;
[0098] In an optional embodiment of the present invention, a common DHCP service program is run on all controllers, and no additional modification is required to the DHCP service program.
[0099] After the main control CPU module of the master station controller obtains the MAC address of the main control CPU module of the emulsification pump controller, it updates the DHCP configuration file, binds this MAC and the IP address of the main control CPU module of the emulsification pump controller, and then starts the DHCP service program to assign an IP to the main control CPU module of the emulsification pump controller.
[0100] The IP address is the primary condition for network control system communication. The automatic addressing in the present invention means that each substation controller can automatically obtain an IP address, that is, the main control CPU module of each substation controller can automatically obtain an IP address. After each substation controller has an IP address, data can be exchanged, and the main station controller can complete the distribution of its configuration information and control software. This function is the basis for the realization of a distributed pump station control system.
[0101] S4. In response to the notification that the main control CPU module of the substation controller receives the IP address, the main control CPU module of the main station controller sends the IP address table of all substation controllers to the main control CPU module of the substation controller, and the main control CPU module of the substation controller stores the IP address table of all subsequent substation controllers.
[0102] In an optional embodiment of the present invention, after the main control CPU module of the emulsification pump controller of this embodiment obtains the IP, the main control CPU module of the master station controller sends all substation control IP address tables to the main control CPU module of the emulsification pump controller.
[0103] The main control CPU module of the emulsification pump controller stores all IP address tables of the subsequent substation controllers, and then continues a similar process to assign IPs to the main control CPU module of the next-level spray pump controller.
[0104] The present invention utilizes the DSA function of the network switching chip in combination with the VLAN forwarding characteristics to realize an automatic addressing algorithm, so that the master station controller can automatically assign a specified IP address to each substation controller according to the physical connection order of each substation controller, so as to realize automatic addressing of different substation controllers. The automatic addressing method of a distributed emulsification pump station control system proposed by the present invention is implemented purely by software, does not require additional circuits, saves costs, has strong versatility, and is not only applicable to pump station control systems, but also to any system using multi-level controllers, such as bracket control systems, etc.
[0105] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0108] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0109] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A distributed emulsification pump station control system automatic addressing method, characterized in that: The following steps are involved: The main control CPU module of the main station controller in the distributed emulsification pump station control system is used to preset the IP address table of all substation controllers; Use the main control CPU module of the master station controller to obtain the MAC address of the main control CPU module of the substation controller; When the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network switching module of the master station controller uses a virtual LAN table to control the forwarding path of the data flow, so that the data packets that first enter port 9 are only the data packets sent by the main control CPU module of the next-level controller, and other modules are allowed to forward accordingly only after the controller at the previous level obtains the MAC address and completes the IP address allocation; When the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the data forwarding function between the main control CPU module and the MCU input and output module of the master station controller is turned on, the data forwarding function between the main control CPU module of the master station controller and the uplink is turned on, and the data forwarding function between the main control CPU module of the master station controller and the downlink is turned on; When the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network card driver layer of the master station controller is controlled to configure the virtual LAN table of the network switching module, so that the data packets from port 1 to port 7 are forwarded to port 8, and the data packets from port 8 are forwarded to port 1 to port 7. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the MCU input and output module to be turned on through the sysfs interface switch; The network card driver layer of the master station controller is controlled to configure the virtual LAN table of the network switching module, so that the data packets of port 10 are forwarded to port 8, and the data packets of port 8 are forwarded to port 10. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the uplink to be turned on through the sysfs interface switch; The network card driver layer of the master station controller is controlled to configure the virtual LAN table of the network switching module, so that the data packets of port 9 are forwarded to port 8, and the data packets of port 8 are forwarded to port 9. At the same time, a sysfs file system interface is created, and the application layer of the master station controller is used to control the data forwarding function of the main control CPU module and the downlink to be turned on through the sysfs interface switch; When the master CPU module of the master station controller is used to obtain the MAC address of the master CPU module of the substation controller, the data forwarding function of the master CPU module and the uplink is enabled by default for the substation controller; the data forwarding function of the master CPU module and the downlink is disabled by default, and the data forwarding function is enabled after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; the data forwarding function of the MCU input / output module and the uplink is disabled by default, and the data forwarding function is enabled after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; the data forwarding function of the downlink and uplink is disabled by default, and the data forwarding function is enabled after the master CPU module of the substation controller obtains the IP address and receives the IP address table sent by the upper-level controller; When the main control CPU module of the master station controller is used to obtain the MAC address of the main control CPU module of the substation controller, the network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data of port 10 is forwarded to port 8, and the data packet of port 8 is forwarded to port 10. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the main control CPU module and the uplink to be turned on through the sysfs interface switch; The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module so that the data of port 8 is not forwarded to port 9, and the data packets of port 9 are not forwarded to port 8. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the main control CPU module and the downlink through the sysfs interface switch to turn on or off; The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data from port 1 to port 7 is not forwarded to port 10, and the data packets of port 10 are not forwarded to port 1 to port 7. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the MCU input and output module and the uplink to be turned on or off through the sysfs interface switch; The network card driver layer of the substation controller is controlled to configure the virtual LAN table of the network switching module, so that the data of port 9 is not forwarded to port 10, and the data packets of port 10 are not forwarded to port 9. At the same time, a sysfs file system interface is created, and the application layer of the substation controller is used to control the data forwarding function of the uplink and downlink to be turned on or off through the sysfs interface switch; the main control CPU module of the main station controller adopts the MAC address and IP binding method of the DHCP service program to allocate an IP address to the main control CPU module of the substation controller; In response to the notification that the main control CPU module of the substation controller receives the IP address, the main control CPU module of the main station controller sends the IP address table of all substation controllers to the main control CPU module of the substation controller, and the main control CPU module of the substation controller stores the IP address table of all subsequent substation controllers.
2. According to claim 1, a distributed emulsification pump station control system automatic addressing method is characterized in that: Distributed emulsification pump station control system includes: One master station controller and multiple substation controllers of different types; The main station controller and the substation controller both include a network switching module, a main control CPU module, multiple MCU input and output modules and a backplane module; Ports 0 to 7 of the network switch module are connected to multiple MCU input and output modules through the backplane module; Port 8 of the network switch module is connected to the main control CPU module through the backplane module; Port 9 of the network switching module is connected to port 10 of the network switching module in the next-level controller; Port 10 of the network switching module is connected to port 9 of the network switching module in the upper-level controller.
3. The automatic addressing method of a distributed emulsification pump station control system according to claim 1 is characterized in that: Use the main control CPU module of the master station controller to obtain the MAC address of the main control CPU module of the substation controller, including: Use the main control CPU module of the master station controller to configure the DSA working mode of the network switch module, so that the network switch module operates in Special Tag mode; A DSA processing layer is added to the data link layer of the kernel layer of the main control CPU module of the master station controller, so that the data packet sent by the main control CPU module of the next controller is forwarded to the port 8 of the network switching module after passing through the port 9 of the network switching module of the master station controller; when the network card driver layer of the main control CPU module receives the data packet, the data packet carries the target MAC address and the original MAC address as well as the Special Tag of the physical port where the data packet enters, and then the DSA processing layer of the main control CPU module parses the Special Tag, extracts the source MAC of the data packet whose source port is 9 and stores it, and creates a kernel sysfs file system interface, writes the MAC address of port 9 into the sysfs file system interface, and then removes the Special Tag and forwards it to the TCP / IP layer and application layer of the main control CPU module.
4. The automatic addressing method of a distributed emulsification pump station control system according to claim 3 is characterized in that: Enable the network switch module to run in Special Tag mode, including: The network switching module operating in the Special Tag mode adds a Special Tag to the data frame entering from the current physical port, and sends the data frame with the Special Tag; wherein the Special Tag includes the source port of the data frame.
5. The automatic addressing method of a distributed emulsification pump station control system according to claim 3 is characterized in that: When the main control CPU module sends a data packet, the data packet received from the application layer passes through the TCP / IP layer, and the DSA processing layer adds a Special Tag to the data frame and then forwards it to the network card driver layer.
