Grouping method and device, equipment and storage medium
By dynamically allocating addresses and port numbers and determining grouping relationships based on group numbers, the existing technology solves the problems of complex manual configuration and inability to support dynamic expansion, and achieves efficient network device grouping and dynamic expansion.
Patent Information
- Application Number
- CN202411102093.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-15
Smart Images

Figure CN118784491A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of industrial control technology, and in particular to a grouping method, apparatus, device and storage medium. Background Art
[0002] In the field of industrial control, taking energy storage power stations as an example, project site service personnel need to configure static IP addresses for controllers and network devices according to the network planning of the power station. In addition, the IP and port number of the server need to be configured on the client device. When there is a device failure in the network that needs to be replaced, or when new equipment is needed due to power station expansion, the network address configuration of the new equipment needs to be manually updated or added on the controller. Therefore, during the project implementation and maintenance phases, this manual configuration of network addresses is cumbersome, and the current static configuration of equipment does not support dynamic expansion. It needs to be shut down and re-imported before the configuration takes effect, so lossless switching cannot be achieved. In addition, in actual networking, there are some combination relationships between the devices connected to the controller. When the controller connects to these devices, it needs to identify the combination relationship between the two. The combination relationship between the static configuration devices on the controller cannot be dynamically obtained, which seriously affects the grouping efficiency. Summary of the invention
[0003] The embodiments of the present invention provide a grouping method, apparatus, device and storage medium to achieve IP address configuration-free network device side, and no manual configuration of network device address information is required on the controller side. The controller dynamically obtains the association relationship between devices to improve grouping efficiency.
[0004] According to one aspect of the present invention, there is provided a grouping method, comprising:
[0005] receiving a broadcast message sent by each network device, and assigning an address to each of the network devices;
[0006] Acquire the address and port number corresponding to each of the network devices, and establish a connection with each of the network devices based on the address and port number corresponding to each of the network devices;
[0007] The group number corresponding to each of the network devices is obtained, and the grouping relationship is determined based on the group number corresponding to each of the network devices.
[0008] According to another aspect of the present invention, there is provided a grouping device, the device comprising:
[0009] A receiving and allocating module, used for receiving a broadcast message sent by each network device and allocating an address to each of the network devices;
[0010] An acquisition and establishment module, used to acquire the address and port number corresponding to each of the network devices, and establish a connection with each of the network devices based on the address and port number corresponding to each of the network devices;
[0011] The acquisition and determination module is used to acquire the group number corresponding to each of the network devices and determine the grouping relationship based on the group number corresponding to each of the network devices.
[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the grouping method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the grouping method described in any embodiment of the present invention when executed.
[0017] The embodiment of the present invention receives the broadcast message sent by each network device through the controller, and assigns an address to each network device. Then the controller obtains the address and port number corresponding to each network device, and establishes a connection with each network device based on the address and port number corresponding to each network device. Finally, the controller obtains the group number corresponding to each network device, and determines the grouping relationship between each network device based on the group number corresponding to each network device. Through the technical solution of the present invention, it is possible to implement IP address configuration-free network device side, and the controller side does not need to manually configure network device address information. The controller dynamically obtains the association relationship between devices, thereby improving grouping efficiency.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flow chart of a grouping method in an embodiment of the present invention;
[0021] Figure 2 is a signaling diagram of a grouping method in an embodiment of the present invention;
[0022] Figure 3 is a structural schematic diagram of a grouping device in an embodiment of the present invention;
[0023] Figure 4 It is a structural schematic diagram of an electronic device for implementing the grouping method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their meanings are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0027] Embodiment 1
[0028] In the field of industrial control (such as photovoltaic / energy storage power stations), a master-slave architecture is often used to build monitoring networks and control networks. That is, a controller is deployed to monitor a series of electrical equipment and sensors in the station, collect signals for centralized processing and control their operation.
[0029] Taking the energy storage power station as an example, the local controller, as the upper computer, is connected to the lower-level devices such as the energy storage converter (Power Conversion System, PCS) and the battery management system (Battery Management System, BMS) through Ethernet, and periodically collects signals and stores them locally for display on the monitoring interface. At the same time, based on these data calculations, commands are sent to the lower-level devices to control the operation of the equipment.
[0030] However, under the above communication architecture, there are the following pain points and disadvantages: Complex configuration: In the above communication architecture, the project site service personnel need to configure static IP addresses for the controller and each network device (PCS, BMS, etc.) according to the network planning of the power station; in addition, the IP and port number of the server must be configured on the client device. For example, when the device is used as a server connected to TCP (Transmission Control Protocol), the user needs to configure the IP address and port number of each network device on the controller, and then the controller can initiate a connection, establish a TCP connection to each device, and finally complete the access process from the controller to each device; in addition, when there is a device failure in the network that needs to be replaced, or when new equipment needs to be added due to power station expansion, it is also necessary to manually update or add the network address configuration of the new device on the controller. Therefore, during the project implementation and maintenance stages, this method of manually configuring network addresses is more cumbersome. Since the IP addresses of various devices in the same LAN in the power station cannot conflict, the equipment manufacturer cannot preset the same IP address during the production stage, so the configuration of the project site can also be simplified by pre-configuring the IP during the production stage. Not conducive to dynamic expansion of power stations: Taking energy storage power stations as an example, after construction and commissioning, there is a scenario where energy storage equipment needs to be expanded as business needs to develop. The current static configuration of equipment does not support dynamic expansion and requires shutdown and re-import of configuration to take effect, so lossless switching cannot be achieved.
[0031] In addition, in actual networking, there are some combination relationships between the devices connected to the controller. For example, a PCS and a storage battery cluster form an energy storage unit. The controller needs to identify the combination relationship between the two devices when connecting to these devices. The current common practice is to statically configure the combination relationship between devices on the controller, but this cannot achieve dynamic acquisition, which will seriously affect the grouping efficiency.
[0032] Figure 1 is a flow chart of a grouping method in an embodiment of the present invention. This embodiment is applicable to the situation where the controller groups each network device in all local area networks that conform to the master-slave architecture, including energy storage power stations. The method can be executed by the grouping device in an embodiment of the present invention, and the device can be implemented in software and / or hardware, such as Figure 1As shown, the method specifically comprises the following steps:
[0033] S101. Receive a broadcast message sent by each network device and assign an address to each network device.
[0034] It should be noted that the network device can be a device in all local area networks that conform to the master-slave architecture. In all local area networks that conform to the master-slave architecture taking the energy storage power station as an example, the network device can be, for example, the PCS, BMS, etc. in the energy storage power station.
[0035] In this embodiment, the address may be an IP address, wherein the broadcast message may be a message in which the network device broadcasts a request to obtain an IP address.
[0036] Specifically, after each network device is powered on, it sends a broadcast message to request an IP address. The controller receives the broadcast message sent by each network device and allocates an IP address to each network device.
[0037] S102: Acquire the address and port number corresponding to each network device, and establish a connection with each network device based on the address and port number corresponding to each network device.
[0038] For example, in the case of an energy storage power station, Modbus-TCP is used to communicate between the controller and the network device, where the network device is a TCP Server and the controller is a TCP Client. That is, the controller needs to send a TCP link establishment request to the network device, but the prerequisite is that the server needs to know the address of the client (IP and port, that is, IP address and port number). That is, the controller needs to obtain the IP address and port number corresponding to each network device, and then establish a connection with each network device based on the IP address and port number corresponding to each network device.
[0039] S103: Obtain a group number corresponding to each network device, and determine a grouping relationship based on the group number corresponding to each network device.
[0040] In actual networking, there are some combination relationships between the network devices connected to the controller. For example, in an energy storage power station, a PCS and an energy storage battery cluster form an energy storage unit. When the controller accesses these network devices, it needs to identify the combination relationship between the network devices, which can be identified by the group number of each network device. For example, the group number of PCS1 is 001, the group number of BMS1 is 001, the group number of PCS2 is 002, and the group number of BMS2 is 002. Then the group relationship can be PCS1 and BMS1 are in one group, and PCS2 and BMS2 are in one group.
[0041] Specifically, after the network devices are powered on, the group numbers to which they belong are defined based on the network planning. The controller obtains the group number corresponding to each network device and determines the combination relationship between the devices based on the group number corresponding to each network device.
[0042] The embodiment of the present invention receives the broadcast message sent by each network device through the controller, and assigns an address to each network device. Then the controller obtains the address and port number corresponding to each network device, and establishes a connection with each network device based on the address and port number corresponding to each network device. Finally, the controller obtains the group number corresponding to each network device, and determines the grouping relationship between each network device based on the group number corresponding to each network device. Through the technical solution of the present invention, it is possible to implement IP address configuration-free network device side, and the controller side does not need to manually configure network device address information. The controller dynamically obtains the association relationship between devices, thereby improving grouping efficiency.
[0043] Optionally, receiving a broadcast message sent by each network device and assigning an address to each network device includes:
[0044] Receive broadcast messages sent by each network device.
[0045] In actual operation, the DHCP (Dynamic Host Configuration Protocol) service is installed on the local controller. When a network device is connected to the network, it sends a request through a broadcast message (called DHCP Discover) to find an available DHCP server. This broadcast message will be sent to all network devices on the local network.
[0046] Send a response message to each network device.
[0047] It should be noted that the response information may be a DHCP Offer message sent by the controller to the network device after receiving the broadcast message sent by the network device, which includes network configuration information such as an available IP address, subnet mask, and default gateway.
[0048] The response information includes the address allocated to each network device, and the address is an unallocated address selected from the address pool.
[0049] It should be noted that the address pool can be understood as a database storing a number of IP addresses to be allocated.
[0050] Specifically, the local controller plans an IP address pool for allocating IP addresses to network devices in the local area network. After the DHCP server on the network (i.e., the controller in this embodiment) receives a DHCP Discover request from the network device, it selects an unassigned IP address from the IP address pool, and then replies to the network device with a DHCP Offer message, which includes an available IP address, subnet mask, default gateway and other network configuration information.
[0051] Receive request messages sent by each network device.
[0052] The request message may be a message sent by the network device to the controller for confirming the selection.
[0053] Specifically, after receiving the DHCP Offer message, the network device sends a DHCP Request message to the corresponding controller to confirm the selection.
[0054] A confirmation message is sent to each network device to complete the operation of allocating addresses to each network device.
[0055] The confirmation message may be a message sent by the controller to the network device to confirm the IP address and other configuration information allocated to the network device.
[0056] Specifically, after receiving the request from the network device, the controller will send a DHCPAcknowledgement (ACK) message to the network device to confirm the IP address and other configuration information assigned to the client. After receiving the DHCP ACK message, the network device will apply the assigned IP address and other configuration information to its own network interface, thereby completing the network configuration on the device side.
[0057] In actual operation, if the controller cannot meet the client's request, it can also send a DHCP Negative Acknowledgement (NAK) message to notify the client to re-request or provide other configuration information.
[0058] In particular, if a network device restarts after being assigned a dynamic IP, the network device will reapply to the controller for an IP address and prioritize the original IP address. Unless the IP address has been assigned to another network device, the controller will still assign the original IP address to the network device.
[0059] After the network device dynamically applies for an IP address, the next step is to establish an application layer connection.
[0060] Optionally, obtain the address and port number corresponding to each network device, including:
[0061] Monitor LAN broadcast messages and record the address and port number corresponding to each network device in the LAN broadcast messages.
[0062] It should be noted that the local area network broadcast message may be a message sent by all network devices or controllers in the local area network in a broadcasting manner.
[0063] The address and port number corresponding to each network device in the local area network broadcast message are obtained by broadcasting each network device in the local area network based on the broadcast protocol.
[0064] In this embodiment, the broadcast protocol in the local area network can be UDP (User Datagram Protocol) broadcast, SSDP (Simple Service Discovery Protocol) broadcast or mDNS (Multicast DNS) broadcast, which is not limited in this embodiment.
[0065] Specifically, after the network device is assigned a dynamic IP address through DHCP, it broadcasts the IP address and Modbus-TCP service port number (default 502) in the local area network, and the controller monitors the broadcast message in real time and records the IP address and port number of the network device.
[0066] In actual operation, if the controller is reset and restarted after obtaining the IP address of the network device, then after the restart, the controller needs to actively request the server address from the network device in the local area network by broadcasting.
[0067] In the implementation process, when the controller obtains the Modbus-TCP service address (IP and port, i.e. IP address and port number) of the network device, it initiates a TCP connection request to the address and establishes a TCP connection through a TCP three-way handshake. Subsequently, the controller and the network device can interact at the application layer through Modbus-TCP.
[0068] Optionally, obtain the group number corresponding to each network device, including:
[0069] Read the group number corresponding to each network device through the Modbus function code.
[0070] It can be known that the Modbus function code is an important part of the Modbus message frame, which occupies one byte and has a value range of 1 to 127. The function code + 0x80 is used to indicate an abnormal state, that is, 129 to 255 represents an abnormal code.
[0071] Specifically, the controller reads the group number to which the network device belongs through the Modbus function code, and determines the combination relationship between the network devices based on the group number.
[0072] Optionally, obtain the address and port number corresponding to each network device, including:
[0073] The address and port number corresponding to each network device that receives proxy server notifications.
[0074] In this embodiment, the proxy server can be represented by broker.
[0075] The address and port number corresponding to each network device in the proxy server are obtained by publishing each network device to the proxy server.
[0076] Specifically, a proxy server (broker) is deployed in the local area network. When the network device obtains the IP address, it publishes the address information to the broker; and the controller subscribes to the IP address of the network device from the broker to receive the IP address and port number of each network device notified by the proxy server.
[0077] In actual operation, when the IP address of a network device changes or the controller is restarted, the broker will notify the controller of the address information of the network device.
[0078] In the implementation process, when the controller obtains the Modbus-TCP service address (IP and port, i.e. IP address and port number) of the network device, it initiates a TCP connection request to the address and establishes a TCP connection through a TCP three-way handshake. Subsequently, the controller and the network device can interact at the application layer through Modbus-TCP.
[0079] Optionally, obtain the group number corresponding to each network device, including:
[0080] The group number corresponding to each network device that receives proxy server notifications.
[0081] The group number corresponding to each network device in the proxy server is obtained by publishing each network device to the proxy server.
[0082] Specifically, through the above-mentioned Broker method, the network device publishes the belonging group number to the Broker, and the controller obtains this information by subscription.
[0083] Optionally, before the address and port number corresponding to each network device notified by the proxy server, the following is also included:
[0084] Subscribe the address of each network device to the proxy server.
[0085] Specifically, after the network device obtains the IP address, it publishes the address information to the proxy server, the controller subscribes to the IP of the network device from the proxy server, and the proxy server notifies the controller of the IP address and port number of each network device.
[0086] Figure 2 This is a signaling diagram of a grouping method in an embodiment of the present invention. Taking the energy storage power station as an example, network devices such as PCS1, BMS1, etc. establish a physical connection with the local controller through a switch. The following takes PCS1 as an example to explain the process of dynamically allocating IP after PCS1 is turned on, establishing an application layer connection, and completing device grouping. Figure 2 As shown, the grouping method includes the following operations:
[0087] The DHCP service is deployed on the controller, and the IP address pool is configured according to the plan after startup.
[0088] During the DHCP address allocation phase:
[0089] After the device PCS1 is powered on, it broadcasts a DHCP Discover request in the LAN to apply for an IP address. The controller replies with a DHCP Offer message to PCS1 to assign an IP address to PCS1. After receiving the DHCP Offer message, PCS1 sends a DHCP Request message to the controller to confirm the selection. After receiving the DHCP Request message, the controller sends a DHCP ACK message to PCS1 to confirm the IP address and other configuration information assigned to PCS1.
[0090] During the service address broadcast and TCP connection establishment phase:
[0091] Broadcast mode: After PCS1 obtains the dynamic IP, it uses a broadcast protocol (such as UDP) to broadcast the address and port number (configurable, Modbus-TCP defaults to 502) in the LAN. Each network can receive the LAN broadcast message (IP, port).
[0092] Subscription method: After PCS1 obtains the dynamic IP, it publishes the device service address information (IP, port) to the proxy server (Broker). The controller subscribes to the address of PCS1 from the Broker, and the Broker notifies the subscriber (controller) of (IP, port).
[0093] After receiving the address information of the server, the controller initiates a TCP connection to the address and establishes a TCP connection through a TCP three-way handshake.
[0094] During the device grouping phase:
[0095] Direct request method: The controller requests the device group number from PCS1. After PCS1 responds, the controller stores the device group number locally.
[0096] Subscription method: PCS1 publishes device grouping information to Broker, the controller subscribes to the address of PCS1 from Broker, and Broker notifies the subscriber (controller) of the device grouping information.
[0097] Then, the controller determines the group relationship of the plurality of network devices based on the obtained group numbers thereof.
[0098] The technical solution of the embodiment of the present invention can realize IP address configuration-free device side within the station, dynamically request and allocate IP addresses through DHCP. At the same time, the controller side does not need to configure device address information (TCP server information), and can obtain server address information and device grouping information through broadcasting within the local area network, publishing to the agent, and subscription-notification. This can achieve the beneficial effect of the controller dynamically obtaining the association relationship between devices.
[0099] Embodiment 2
[0100] Figure 3 is a schematic diagram of the structure of a grouping device in an embodiment of the present invention. This embodiment is applicable to the situation where the controller groups each network device in all local area networks that conform to the master-slave architecture, including energy storage power stations. The device can be implemented in software and / or hardware, and can be integrated in any device that provides grouping functions, such as Figure 3 As shown, the grouping device specifically includes: a receiving and allocating module 201, an acquiring and establishing module 202 and an acquiring and determining module 203.
[0101] The receiving and allocating module 201 is used to receive the broadcast message sent by each network device and allocate an address to each of the network devices;
[0102] The acquisition and establishment module 202 is used to acquire the address and port number corresponding to each of the network devices, and establish a connection with each of the network devices based on the address and port number corresponding to each of the network devices;
[0103] The acquisition and determination module 203 is used to acquire the group number corresponding to each of the network devices, and determine the grouping relationship based on the group number corresponding to each of the network devices.
[0104] Optionally, the receiving and allocating module 201 is specifically used for:
[0105] Receive broadcast messages sent by each network device;
[0106] Sending response information to each of the network devices, wherein the response information includes an address allocated to each of the network devices, wherein the address is an unallocated address selected from an address pool;
[0107] Receive request messages sent by each network device;
[0108] A confirmation message is sent to each of the network devices to complete the operation of allocating an address to each of the network devices.
[0109] Optionally, the acquisition and establishment module 202 is specifically used for:
[0110] Monitor the local area network broadcast message, and record the address and port number corresponding to each of the network devices in the local area network broadcast message. The address and port number corresponding to each of the network devices in the local area network broadcast message are obtained by broadcasting each of the network devices in the local area network based on the broadcast protocol.
[0111] Optionally, the acquisition and determination module 203 is specifically used for:
[0112] The group number corresponding to each of the network devices is read through the Modbus function code.
[0113] Optionally, the acquisition and establishment module 202 is specifically used for:
[0114] The address and port number corresponding to each of the network devices notified by the proxy server are received. The address and port number corresponding to each of the network devices in the proxy server are obtained by publishing each of the network devices to the proxy server.
[0115] Optionally, the acquisition and determination module 203 is specifically used for:
[0116] The group number corresponding to each of the network devices notified by the proxy server is received, and the group number corresponding to each of the network devices in the proxy server is obtained by publishing each of the network devices to the proxy server.
[0117] Optionally, the device further comprises:
[0118] A subscription unit, configured to subscribe the address of each network device to the proxy server.
[0119] The above-mentioned product can execute the grouping method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0120] Embodiment 3
[0121] Figure 4A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0122] like Figure 4 As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32, and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.
[0123] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0124] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 31 performs the various methods and processes described above, such as the grouping method:
[0125] receiving a broadcast message sent by each network device, and assigning an address to each of the network devices;
[0126] Acquire the address and port number corresponding to each of the network devices, and establish a connection with each of the network devices based on the address and port number corresponding to each of the network devices;
[0127] The group number corresponding to each of the network devices is obtained, and the grouping relationship is determined based on the group number corresponding to each of the network devices.
[0128] In some embodiments, the grouping method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the grouping method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the grouping method in any other appropriate manner (e.g., by means of firmware).
[0129] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0130] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0131] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0133] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0134] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0135] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0136] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A grouping method, characterized in that: include: receiving a broadcast message sent by each network device, and assigning an address to each of the network devices; Acquire the address and port number corresponding to each of the network devices, and establish a connection with each of the network devices based on the address and port number corresponding to each of the network devices; The group number corresponding to each of the network devices is obtained, and the grouping relationship is determined based on the group number corresponding to each of the network devices.
2. The method according to claim 1, characterized in that Receiving a broadcast message sent by each network device and assigning an address to each of the network devices, including: Receive broadcast messages sent by each network device; Sending response information to each of the network devices, wherein the response information includes an address allocated to each of the network devices, wherein the address is an unallocated address selected from an address pool; Receive request messages sent by each network device; A confirmation message is sent to each of the network devices to complete the operation of allocating an address to each of the network devices.
3. The method according to claim 1, characterized in that Obtaining the address and port number corresponding to each of the network devices, including: Monitor the local area network broadcast message, and record the address and port number corresponding to each of the network devices in the local area network broadcast message. The address and port number corresponding to each of the network devices in the local area network broadcast message are obtained by broadcasting each of the network devices in the local area network based on the broadcast protocol.
4. The method according to claim 1, characterized in that: Obtaining the group number corresponding to each of the network devices, including: The group number corresponding to each of the network devices is read through the Modbus function code.
5. The method according to claim 1, characterized in that Obtaining the address and port number corresponding to each of the network devices, including: The address and port number corresponding to each of the network devices notified by the proxy server are received. The address and port number corresponding to each of the network devices in the proxy server are obtained by publishing each of the network devices to the proxy server.
6. The method according to claim 5, characterized in that Obtaining the group number corresponding to each of the network devices, including: The group number corresponding to each of the network devices notified by the proxy server is received, and the group number corresponding to each of the network devices in the proxy server is obtained by publishing each of the network devices to the proxy server.
7. The method according to claim 5, characterized in that Before receiving the address and port number corresponding to each of the network devices notified by the proxy server, the method further includes: The address of each of the network devices is subscribed to the proxy server.
8. A grouping device, characterized in that: include: A receiving and allocating module, used for receiving a broadcast message sent by each network device and allocating an address to each of the network devices; An acquisition and establishment module, used to acquire the address and port number corresponding to each of the network devices, and establish a connection with each of the network devices based on the address and port number corresponding to each of the network devices; The acquisition and determination module is used to acquire the group number corresponding to each of the network devices and determine the grouping relationship based on the group number corresponding to each of the network devices.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the grouping method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the grouping method according to any one of claims 1 to 7 when executed.
