Device parameter setting method, device, computer device and readable storage medium

Through the collector parsing device information frames and feedback the target set frames of correct parameters, the frequent changes and conflicts of IP addresses caused by the DHCP protocol are solved, and the accuracy and comprehensiveness of device parameter settings are achieved to ensure the normal operation of the device.

CN118784478BActive Publication Date: 2025-08-26ZHEJIANG CHINT IOT TECH CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411262044.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-08-26
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

The existing technology dynamically allocates IP addresses to devices through the DHCP protocol, resulting in frequent changes in IP addresses, and the IP addresses cannot be detected accurately, which is prone to conflicts with other devices, and other parameters other than IP addresses cannot be set synchronously, resulting in the device being unable to use normally.

Method used

The collector receives the device information frame broadcast by the device, analyzes the accuracy of the device information, and feedbacks the target setting frame carrying the correct parameters to ensure that the device is set according to the correct parameters, including the synchronization of IP addresses and other configuration parameters.

Benefits of technology

It realizes the accuracy and comprehensiveness of device parameter settings, avoids IP address conflicts, ensures that the equipment is quickly networked and put into use, and reduces the time for equipment to go online.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784478B_ABST
    Figure CN118784478B_ABST
Patent Text Reader

Abstract

This application provides a device parameter setting method, apparatus, computer device, and readable storage medium. The method first receives a device information frame broadcast by the device, then obtains the device information carried in the device information frame, analyzes the accuracy of the device information, and, if the device information is incorrect, feeds back a target setting frame carrying the correct parameters to the device, allowing the device to set parameters according to the target setting frame. This application can improve the accuracy and stability of device parameter setting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet of Things technology, and specifically to a device parameter setting method, apparatus, computer equipment, and readable storage medium. Background Art

[0002] The IP address is a crucial parameter for network communication devices. A fixed IP address must be set for the device before it can establish network communication with other devices. Currently, DHCP (Dynamic Host Configuration Protocol) is commonly used to dynamically assign an IP address to a device for configuration and use.

[0003] However, using DHCP to dynamically assign IP addresses to devices can cause the device's IP address to change frequently in different scenarios, and the device's IP address cannot be accurately verified. This can easily cause conflicts with the IP addresses of other devices in the scenario. Furthermore, this method only allocates and configures IP addresses, and cannot synchronize settings for other parameters besides the IP address. Furthermore, it cannot accurately verify the settings of other parameters, potentially rendering the device unusable due to IP address conflicts or other parameter errors.

[0004] Therefore, the accuracy and comprehensiveness of device parameter settings through existing protocols are poor. Summary of the Invention

[0005] The present application provides a device parameter setting method, apparatus, computer device and readable storage medium, which can improve the accuracy, comprehensiveness and reliability of device parameter setting.

[0006] In a first aspect, the present application provides a device parameter setting method, applied to a collector connected to a device, the method comprising:

[0007] receiving a device information frame broadcast by the device;

[0008] The device information carried by the device information frame is obtained, and the accuracy of the device information is analyzed. If the device information is incorrect, a target setting frame carrying correct parameters is fed back to the device, so that the device performs parameter setting according to the target setting frame.

[0009] Optionally, parsing the device information and feeding back a corresponding target setting frame to the device includes:

[0010] Searching for the registration result of the device information in the collector;

[0011] The target setting frame is fed back to the device according to the registration result.

[0012] Optionally, feeding back the target setting frame to the device according to the registration result includes:

[0013] If the registration result is that the device information has been registered in the collector, determining whether the current first IP address of the device is the same as the second IP address recorded by the collector;

[0014] If they are different, a first setting frame including the second IP address is fed back to the device.

[0015] Optionally, the method further includes:

[0016] Determine whether a first setting parameter of the device other than the IP address is the same as a second setting parameter recorded by the collector;

[0017] If the first IP address is the same as the second IP address, and the first setting parameter is the same as the second setting parameter, the collector does not perform any operation;

[0018] If the first IP address is the same as the second IP address, and the first setting parameter is different from the second setting parameter, the device information recorded by the collector is updated to the first device information.

[0019] Optionally, feeding back the target setting frame to the device according to the registration result includes:

[0020] If the registration result is that the device information is not registered in the collector, a second setting frame including a third IP address and a third setting parameter that are not registered in the collector is sent to the device.

[0021] Optionally, both the device information frame and the target setting frame include a MAC address of a device, so that the collector identifies the device corresponding to the device information frame according to the MAC address, and the device identifies the device corresponding to the target setting frame according to the MAC address.

[0022] Optionally, the method further includes:

[0023] Broadcasting a request frame for requesting to obtain device information of each device to the first port, so that each device broadcasts a reply frame containing the device information to the second port;

[0024] receiving and parsing the reply frame to obtain device information of each device, and comparing the first IP address of each device with the second IP address registered in the collector to see whether they are the same;

[0025] For second devices whose first IP address is different from the second IP address registered in the collector, a setting frame is broadcast to the first port, so that each second device performs parameter setting according to the setting frame.

[0026] Optionally, the method further includes:

[0027] acquiring second device information from a device registration table for recording device information, and adding the second device information to the second setting frame;

[0028] broadcasting the second setting frame to the device, so that the device performs parameter setting according to the second setting frame and then feeds back a device information frame of the device to the collector;

[0029] receiving and parsing the device information frame to obtain third device information of the device, and if the third device information is the same as the second device information, no longer sending the second setting frame to the device having the second device information;

[0030] If the third device information is different from the second device information, the second setting frame is broadcast to the device again, so that the device repeats the operations of parameter setting and feeding back the device information frame.

[0031] In a second aspect, the present application provides a device parameter setting method, which is applied to a device connected to a collector, and the method includes:

[0032] Broadcasting a device information frame to the collector, so that the collector feeds back a corresponding target setting frame to the device according to the device information carried in the device information frame;

[0033] The target setting frame is received, and parameter setting information is performed according to the target setting frame.

[0034] Optionally, the method further includes:

[0035] Before receiving the target setting frame, receiving the target setting frame with a first delay time as a period;

[0036] After the target setting frame has been received, after the second delay time has passed, the device information is broadcast to the collector with the first delay time as a period.

[0037] In a third aspect, the present application further provides a device parameter setting apparatus, which is applied to a collector connected to a device, and the apparatus comprises:

[0038] a data receiving unit, configured to receive a device information frame broadcast by the device;

[0039] The parameter parsing unit is used to obtain the device information carried by the device information frame, parse the accuracy of the device information, and if the device information is incorrect, feed back a target setting frame carrying correct parameters to the device, so that the device performs parameter setting according to the target setting frame.

[0040] In a fourth aspect, the present application further provides a device parameter setting apparatus, which is applied to a device connected to a collector, and the apparatus comprises:

[0041] a data broadcast unit, configured to broadcast a device information frame to the collector, so that the collector feeds back a corresponding target setting frame to the device according to the device information carried in the device information frame;

[0042] The parameter setting unit is configured to receive the target setting frame and perform parameter setting information according to the target setting frame.

[0043] In a fifth aspect, the present application also provides a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the device parameter setting method in any of the above embodiments are implemented.

[0044] In a sixth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the device parameter setting method in any of the above embodiments are implemented.

[0045] The device parameter setting method provided by this application is that the collector can receive the device information frame broadcast by the device in real time, and parse the correctness of the device information of each device in the device information frame. When a device with incorrect device information is found, it can promptly broadcast a target setting frame containing correct parameters to the corresponding device. Compared with the traditional method of dynamically allocating IP addresses through the DHCP protocol, a process for verifying the accuracy of the device's IP address and other parameters is added to ensure that each device can be assigned a unique and correct IP address and other configuration parameters, avoiding the frequent changes and conflicts of IP addresses caused by dynamic routing allocation. At the same time, other configuration parameters other than the IP address can also be synchronized to the device and checked, thereby improving the accuracy, reliability and comprehensiveness of the device parameter setting, enabling new devices to be quickly networked and put into use, and reducing the time it takes for the device to go online. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] Figure 1 This is a schematic diagram of an application scenario of the device parameter setting method provided in an embodiment of the present application;

[0048] Figure 2 Schematic diagram of the device parameter setting method provided in the embodiment of the present application;

[0049] Figure 3 Schematic diagram of the device parameter setting method provided in the embodiment of the present application;

[0050] Figure 4 Schematic diagram of data interaction between a collector and a device provided in an embodiment of the present application;

[0051] Figure 5 This is a functional module diagram of a device parameter setting apparatus provided in an embodiment of the present application;

[0052] Figure 6 This is a functional module diagram of a device parameter setting apparatus provided in an embodiment of the present application;

[0053] Figure 7 It is a structural diagram of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0055] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise specifically defined.

[0056] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. At the same time, it is understood that in the specific implementation of this application, when user information, user data, and other related data are involved, when the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of relevant data must comply with relevant laws, regulations, and standards of relevant countries and regions.

[0057] The following description is provided to enable any person skilled in the art to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that one of ordinary skill in the art will recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.

[0058] The present application provides a device parameter setting method, apparatus, computer equipment, and readable storage medium, which are described in detail below.

[0059] See also Figure 1 , Figure 1 Schematic diagram of the application scenario of the device parameter setting method provided in the embodiment of this application. Figure 1 As shown in the figure, this scenario can include a switch, a collector, and multiple devices. The switch can serve as the infrastructure for network communication in the scenario, connecting the collector to multiple devices. After the collector is connected to the switch, it can manage the IP address allocation and parameter settings of all devices in the network.

[0060] like Figure 1 As shown in the figure, after each device is powered on, it can use the default static IP address 192.168.0.100 to connect to the network through a switch. The device can then send a message containing its MAC address, the current default IP address 192.168.0.100, and other configuration information to the collector via UDP (User Datagram Protocol). The MAC address is a unique identifier for each device, used to uniquely identify it. The IP address is used for device communication and management. Other configuration information includes various device configuration parameters, such as the subnet mask, gateway address, and device name.

[0061] After receiving the above information sent by the device, the collector can assign an available, non-conflicting pre-assigned IP address to each device based on the available IP addresses recorded inside the collector.

[0062] like Figure 1 As shown, before the collector allocates an IP address to each device, it can first obtain the unique MAC (Media Access Control Address) address of each device from the device information reported by each device, and then issue different IP addresses to each device in sequence according to preset rules, such as sorting by the MAC addresses of different devices, to generate a pre-allocated IP address corresponding to each device. Figure 1 In the example, the MAC address of device 1 is 1, and the corresponding pre-assigned address is 192.168.23.160. The MAC address of device 2 is 2, and the corresponding pre-assigned address is 192.168.23.161. This allows the collector to flexibly and accurately assign IP addresses. It should be noted that the collector can also dynamically assign setting parameters other than the device IP address through the above method, enabling comprehensive and accurate parameter settings for the device.

[0063] It should be noted that Figure 1 The scenario diagram of the device parameter setting method shown is only an example. The device parameter setting device and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the device parameter setting device and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.

[0064] like Figure 2 As shown, Figure 2 This is a flow chart of a device parameter setting method in one embodiment of the present application, which is applied to Figure 1 The collector in the device parameter setting device executes the device parameter setting method through the device parameter setting device to improve the accuracy, efficiency and stability of the device parameter setting. The device parameter setting method may include the following steps 101 to 102.

[0065] Step 101: Receive a device information frame broadcast by the device.

[0066] The term "device" refers to the device for which parameters are to be set. In some embodiments, the device in this scenario may be an electrical device, such as an electric meter, flow meter, industrial controller, or other related equipment. After the device leaves the factory, various parameters such as the IP address, voltage limit, current limit, and software leakage type can be set to ensure proper operation.

[0067] The collector can be the host device used to manage the device, specifically responsible for managing and distributing device parameters. For example, it can manage and maintain parameters such as the device's IP address, MAC address, voltage limit, current limit, and issue the correct parameters to the device.

[0068] In some embodiments, after the device is powered on, it may broadcast a device information frame to the collector. The device information frame may carry device information of the device, such as the two most important parameters, MAC address and IP address, as well as other parameters such as overcurrent threshold and overvoltage threshold.

[0069] In some embodiments, the broadcast address may be a port of 255.255.255.255. Among various types of IP addresses, 255.255.255.255 basically represents the broadcast address of the corresponding subnet.

[0070] To help you understand the concept of device information frame, the following is a detailed example of the format of the device information frame and the device information it contains:

[0071] In some embodiments, the format of the device information frame is as follows:

[0072]

[0073] As an example only, assume that multiple devices broadcast their own device information frames. For device 1, device 2, device 3, and device 4, the parameters of the device information included in the device information frame corresponding to each device are as follows.

[0074] Device 1: Factory default: 192.168.0.100, subnet mask: 255.255.255.0, gateway address: 192.168.0.1, MAC address: 34:AD:E4:10:03:BE, Modbus TCP port: 502, address: 1, overcurrent threshold: 24, overvoltage threshold: 500, undervoltage threshold: 345, software leakage type: 1, software leakage threshold: 100, undervoltage threshold: 10, device name: REVPDU01.

[0075] Device 2: Factory default: 192.168.0.100, subnet mask: 255.255.255.0, gateway address: 192.168.0.1, MAC address: 34:AD:E4:10:03:BF, Modbus TCP port: 502, address: 1, overcurrent threshold: 24, overvoltage threshold: 500, undervoltage threshold: 345, software leakage type: 1, software leakage threshold: 100, undervoltage threshold: 10, device name: REVPDU01.

[0076] Device 3: Factory default: 192.168.0.100, subnet mask: 255.255.255.0, gateway address: 192.168.0.1, MAC address: 34:AD:E4:10:03:C0, Modbus TCP port: 502, address: 1, overcurrent threshold: 24, overvoltage threshold: 500, undervoltage threshold: 345, software leakage type: 1, software leakage threshold: 100, undervoltage threshold: 10, device name: REVPDU01.

[0077] Device 4: Factory default: 192.168.0.100, subnet mask: 255.255.255.0, gateway address: 192.168.0.1, MAC address: 34:AD:E4:10:03:C1, Modbus TCP port: 502, address: 1, overcurrent threshold: 24, overvoltage threshold: 500, undervoltage threshold: 345, software leakage type: 1, software leakage threshold: 100, undervoltage threshold: 10, device name: REVPDU01.

[0078] Through the above method, each device in the scene can broadcast a device information frame carrying its own device information to the collector, so that the collector can subsequently effectively receive and process the device information frame broadcast by the device, realize automatic configuration and management of the device, thereby improving the automation level of device parameter setting, reducing the complexity and error rate of manual configuration, and ensuring the reliability of information synchronization and communication between the device and the collector.

[0079] Step 102: Obtain device information carried in the device information frame, analyze the accuracy of the device information, and if the device information is incorrect, feed back a target setting frame carrying correct parameters to the device, so that the device performs parameter setting according to the target setting frame.

[0080] It is understandable that for devices that have not been set with an IP address after leaving the factory, the factory default static IP address is used, such as Figure 1 If such devices are subsequently put into use directly, they are likely to conflict with other devices using default static IP addresses, impacting device operation. Alternatively, if a device with a pre-set IP address is relocated to another business location without updating the IP address or checking for IP conflicts, it may also conflict with other devices, impacting normal operation.

[0081] In some embodiments, both the device information frame and the target setting frame may include the MAC address of the device, so that the collector can identify the device corresponding to the device information frame based on the MAC address, and the device can identify the device corresponding to the target setting frame based on the MAC address. In some embodiments, after the collector receives the device information frame, it can obtain the device information of each device from the device information frame, such as the MAC address, IP address and other parameter information of the device mentioned in step 101, and then parse the accuracy of the above device information. It can be understood that the most important concern in the parsing operation is whether there is an IP conflict between the devices. The rationality of other parameter information of the device, such as the overvoltage threshold, overcurrent threshold and other parameters, will also be synchronously parsed to ensure the comprehensiveness of the device information parsing.

[0082] It is understandable that if the collector parses the device information of a certain device incorrectly, it can determine a correct parameter for the device according to the preset rules, such as Figure 1 Assume that the IP addresses of device 1 and device 2 conflict, for example, both use the default static IP address 192.168.0.100, then the preset rule can be set to: assign available IP addresses to the devices in sequence according to the order of the device numbers. For example, the IP address segment that can be assigned by the collector is 10 IP addresses from "192.168.0.160 to 192.168.0.169". Assuming that device 1 and device 2 are the first two devices to be assigned, a new IP address 192.168.0.160 can be assigned to device 1, and a new IP address 192.168.0.161 can be assigned to device 2 in sequence. It should be noted that the preset rules for parameter allocation by the collector are not limited to the above-mentioned rules, and can be flexibly set according to the parameter allocation requirements and business attributes, which is not limited in this embodiment.

[0083] In some embodiments, the collector can put the correct parameter information to be sent into the target setting frame, and then send the target setting frame to each device by broadcasting. For example, it can broadcast to the port with the address 255.255.255.255, so that the device can receive the target setting frame and set the parameters according to the correct parameter information.

[0084] In some embodiments, step 102 may include:

[0085] First, search for the registration result of the device information in the collector;

[0086] Then, the target setting frame is fed back to the device according to the registration result.

[0087] In some embodiments, the collector can maintain a device registration table for registering the device information of each device, which can also be called a "device maintenance registration table" or "registration table". The device registration table can record the device's MAC address, IP address, and other setting parameters such as subnet mask, gateway address, device name, etc. The content of the device registration table is shown in Table 1 below:

[0088]

[0089] Table 1

[0090] In some embodiments, the collector can also update and maintain device information already registered in the device registration table. For example, for a device that has had its device information properly modified, the updated device information can be written into the device registration table as a new maintenance record. For example, if the IP address of device 4 is updated to "192.168.23.164," the collector can record the updated IP address in the device registration table.

[0091] In some embodiments, the device information registration result in the collector can be searched first. Registration can include both registered and unregistered. For example, for device 1, device 1 can be found in the device registration table shown in Table 1 based on the device name or other parameters. Therefore, the registration result of device 1 in the collector is registered. Correspondingly, at this stage, the device information of device 5 cannot be found in the device registration table shown in Table 1, so the registration result of device 5 is unregistered.

[0092] In some embodiments, it is possible to determine whether the device has fed back a setting frame to the target and what type of target setting frame has been fed back based on the registration result of the device information. The specific format of the target setting frame is as follows:

[0093]

[0094] It's understandable that since the device registration table is frequently maintained and updated, there's virtually no chance of incorrect parameter information, such as conflicting IP addresses. Therefore, for devices with registered device information, the collector can compare the device information reported by the device with the information in the device registration table. If the device information reported by the device is incorrect, the correct setting parameters can be issued to the device based on the information registered in the device information table. Similarly, for devices without registered device information, the collector can combine the registered device information of other devices and issue the correct setting parameters from the available parameters.

[0095] Through the above method, the collector of this application can parse the device information reported by the device in combination with the correctly registered device information, judge the accuracy of the device information reported by each device, ensure that the correct device parameters can be issued and synchronized to each device in the future, and achieve the accuracy and reliability of the device parameter settings.

[0096] In some embodiments, the process of feeding back the target setting frame to the device may include:

[0097] If the registration result is that the device information has been registered in the collector, determining whether the current first IP address of the device is the same as the second IP address recorded by the collector;

[0098] If they are different, a first setting frame including the second IP address is fed back to the device.

[0099] The first setting frame is sent as a directional frame, the sn code is the sn code of the device to be set, that is, the device ID. The tag data area contains the frame instruction indicating the device information to be reported, the IP address, the subnet mask, and the gateway address information.

[0100] In specific implementations, the collector determines that the device's registration result is registered, indicating that the correct device information for the device has been recorded in the device registration table. The device's device information can be searched in the device registration table based on the device's MAC address. Since each device has a unique MAC address, the collector can accurately find and compare the second IP address in the device registration table with the first IP address actively reported by the device to ensure that it is the same. Based on the comparison result, the collector determines whether to send a target setting frame and what type of frame to send.

[0101] As an example only, taking the device registration table in Table 1 as an example, assuming that the current first IP address of device 1 is 192.168.23.161, and the second IP address of the device registered in the device registration table is 192.168.23.160, it is determined that the first IP address is different from the second IP address. Since the correct IP address is registered in the device registration table and does not conflict with other devices, in order to ensure the normal operation of the device, the first IP address needs to be updated to the correct second IP address. The collector can broadcast a first setting frame containing the second IP address to the device so that the device can subsequently receive the first setting frame and set parameters according to the second IP address.

[0102] In some embodiments, the method of the present application may further include:

[0103] Determine whether a first setting parameter of the device other than the IP address is the same as a second setting parameter recorded by the collector;

[0104] If the first IP address is the same as the second IP address, and the first setting parameter is the same as the second setting parameter, the collector does not perform any operation;

[0105] If the first IP address is the same as the second IP address, and the first setting parameter is different from the second setting parameter, the device information recorded by the collector is updated to the first device information.

[0106] Among them, the sending type of the second setting frame is a directional frame, the sn code is the sn code of the device that needs to be set, and the tag data area contains the frame instruction indicating that the device information needs to be reported, IP address, subnet mask, gateway address information, and other parameter information that needs to be set.

[0107] It can be understood that since the collector of the present application can maintain multiple parameters of the device, while comparing the first IP address and the second IP address of the device, it can also determine the consistency of the first setting parameter of the device with the second setting parameter recorded in the device registration table, for example, whether the overcurrent threshold and overvoltage threshold of the device are consistent with the range recorded in the device registration table.

[0108] It can be understood that in the case of sending the first setting frame, the first IP address of the device may be different from the second IP address recorded in the device registration table, but the setting parameters of the device are consistent with the records in the device registration table, which is equivalent to the device only having an IP address setting error, and other parameter information does not need to be changed. Therefore, in this case, the collector only needs to send the first setting frame containing the correct IP address.

[0109] Correspondingly, if the first IP address of the device is different from the second IP address recorded in the device registration table, and other first setting parameters are also different from the second setting parameters in the device registration table, not only the IP address of the device needs to be changed, but also other setting parameters need to be changed. Therefore, in this case, the collector needs to send a second setting frame containing the correct IP address and correct setting parameters.

[0110] In some embodiments, the first IP address of the device is the same as the second IP address recorded in the device registration table, but the setting parameters of the device are inconsistent with the records in the device registration table. This is equivalent to the situation where there is no IP conflict for the device in the business scenario. When the device operates normally and other setting parameters are reasonable, the collector can form a new parameter record for the changed setting parameters and register it in the device registration table.

[0111] In some embodiments, the process of feeding back the target setting frame to the device may further include:

[0112] If the registration result is that the device information is not registered in the collector, a second setting frame including a third IP address and a third setting parameter that are not registered in the collector is sent to the device.

[0113] In some embodiments, the collector can check the device registration table it maintains to determine whether the device information, such as the MAC address of the device, already exists in the device registration table. If the collector does not find the device information registration record of the device in the registration table, it means that the device information of the device is not registered. For example, when the device accesses the network for the first time or the device information has been updated, the collector can assign a new IP address and set parameters to the device.

[0114] In some embodiments, the collector can assign a new, unregistered third IP address and a new set of third configuration parameters to the device, ensuring that the third IP address is unique to avoid IP address conflicts on the network. The collector can package the third IP address and the third configuration parameters into a second configuration frame and send the second configuration frame to the device via a UDP module, for example, by broadcasting the second configuration frame to a target port with a destination address of 255.255.255.255, such as port A.

[0115] In some embodiments, the collector may record the MAC address of the device, the newly allocated third IP address, and the third setting parameter in the device registration table to ensure that the device information of each device is correctly registered so that the device can be identified and managed later.

[0116] In some embodiments, the method of the present application may further include:

[0117] Broadcasting a request frame for requesting to obtain device information of each device to the first port, so that each device broadcasts a reply frame containing the device information to the second port;

[0118] receiving and parsing the reply frame to obtain device information of each device, and comparing the first IP address of each device with the second IP address registered in the collector to see whether they are the same;

[0119] For second devices whose first IP address is different from the second IP address registered in the collector, a setting frame is broadcast to the first port, so that each second device performs parameter setting according to the setting frame.

[0120] Assuming that the scenario in which the collector actively receives device information reported by each device and sends a target setting frame is set as scenario one, the following describes scenario two in which the collector actively searches for device information of each device and sends a target setting frame.

[0121] Among them, the sending type of the request frame is a broadcast frame, and the tag data area indicates that a device information frame needs to be reported. In some embodiments, the collector sends a UDP request frame to all devices in the network by broadcasting, for example, broadcasting to the first port with a target address of 255.255.255.255, the first port is port A, and notifying each device to send its own device information so that the collector can identify and record it. After receiving the UDP request frame from the collector, the device can respond with a UDP device information frame containing its own MAC address, IP address, and other setting information, and send it to the second port of 255.255.255.255, the second port is port B.

[0122] Next, after the collector receives the device information frame of each device, it can check whether the MAC address of each device already exists in the collector's device registration table. If the MAC address has been registered, the collector further checks whether the IP address and other setting information of the device are consistent with the records in the maintenance table. If they are consistent, the collector does not perform any operation. Correspondingly, if the IP address or other setting information is inconsistent with the content recorded in the device registration table: the collector can use the unused IP address in the device registration table to update the original device information of the device. If the MAC address of the device is not registered: the collector can assign a new unused IP address to the device and record other setting information of the device, so that the collector can obtain detailed information of each device.

[0123] In some embodiments, the collector can construct a first setting frame containing the new IP address and the device's MAC address and send it to port A of 255.255.255.255. This first setting frame does not contain other setting information, but can require the device to report a device information frame again, update the device's IP address, and trigger the device to report device information again for final confirmation and recording by the collector.

[0124] In some embodiments, after receiving the first setup frame, all devices can parse the MAC address. If the parsed MAC address matches the device's own MAC address, the device can set its own IP address according to the IP address in the first setup frame, while other setup parameters remain unchanged. After the setup is complete, the device can send a UDP device information frame again, for example, a UDP device information frame containing the updated IP address and setup information. This ensures that the IP address of each device is correctly updated and notifies the collector again for final information synchronization.

[0125] In some embodiments, the collector can receive the UDP device information frame sent again by the device, and the collector rechecks and updates the device maintenance table to ensure that the device information of each device is accurately and timely recorded and updated in the collector.

[0126] In another variation of Scenario 2, in Scenario 3, the collector can actively search for devices on the local area network, assign IP addresses to each device, and synchronize pre-set settings for each device. Pre-set settings usually apply to all devices, such as initializing device parameters. This scenario ensures that the IP addresses and other parameters of all devices are correctly configured and synchronized.

[0127] First, the collector can broadcast a UDP request frame to the entire LAN, for example, broadcasting to port A of the first port with a destination address of 255.255.255.255, informing all devices in the LAN to send their device information. After receiving the collector's UDP request frame, the device can respond with a UDP device information frame containing its own MAC address, IP address, and other configuration information, for example, sent to port B of the second port of 255.255.255.255, allowing the collector to obtain detailed information about the device.

[0128] After receiving the device information frame, the collector checks whether the device's MAC address already exists in the collector's device maintenance table. If the MAC address is already registered, the collector checks whether the IP address and other settings are consistent. If they are, the collector does nothing. If they are not, the collector updates the IP address and other settings. Alternatively, if the MAC address is not registered, the collector assigns a new, unused IP address to the device and prepares to update the device information.

[0129] In some embodiments, the collector can construct a second setting frame containing a new IP address, MAC address and other setting parameters, and send it to the first port A of 255.255.255.255. The second setting frame requires the device to update the parameters and triggers the device to report the device information again. After all devices receive the second setting frame, they can parse the MAC address in the frame. If the MAC address is consistent, the device can update its own configuration according to the IP address and other setting information in the setting frame. The device can again send a UDP device information frame containing the updated IP address and setting information to the second port B of the broadcast address 255.255.255.255, thereby ensuring that the device's IP address and setting information are correctly updated, and notifying the collector again for final confirmation and recording. Finally, the UDP device information frame that the device can send again will be received by the collector, and the collector will recheck and update the device maintenance table to ensure that the device information is accurately and timely recorded and updated in the collector.

[0130] To better understand the above process, the following example illustrates the detailed process of the collector managing and setting device parameters in scenario three.

[0131] As an example, assume that the protocol flow between the collector and device 1 is as follows:

[0132] Collector: IP address is 192.168.21.10, its own send and receive ports are 10010, and the remote port is 4999. Device 1: Factory default: 192.168.0.100, subnet mask: 255.255.255.0, gateway address: 192.168.0.1, MAC address: 34:AD:E4:10:03:BE, Modbus TCP port: 502, address: 1, overcurrent threshold: 24, overvoltage threshold: 500, undervoltage threshold: 345, software leakage type: 1, software leakage threshold: 100, undervoltage threshold: 10, device name: REVPDU01.

[0133] After searching for devices and setting parameters through the collector, the parameters of device 1 can be changed to: Factory default: 192.168.0.100, subnet mask: 255.255.255.0, gateway address: 192.168.0.1, MAC address: 34:AD:E4:10:03:BE, Modbus TCP port: 502, address: 1, overcurrent threshold: 24, overvoltage threshold: 500, undervoltage threshold: 345, software leakage type: 1, software leakage threshold: 100, undervoltage threshold: 10, and device name: REVPDU01.

[0134] The specific data interaction process in scenario three is as follows:

[0135] First, the collector uses the UDP protocol and its own port 10010 to send a request frame in the following format to the request device at 255.255.255.255. port 4999:

[0136] 5a 5a 5a 5a : fixed header

[0137] 34: Collector function code

[0138] 01: Sub-function code

[0139] 00: Broadcast

[0140] 20 00 : Data length 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00:

[0142] 0a 16 a8 c0: IP address: 192.168.21.10

[0143] 02 00: Number of tags: 2

[0144] 07 01 00: SSL not encrypted

[0145] 0D 01 A5: Request the device to send an information frame.

[0146] Then, after receiving the request frame from the collector, device 1 sends the following device information frame with the MAC address sn code, IP address, subnet mask, gateway address, ModbusTCP port, etc., using the UDP protocol and its own port 4999 to 255.255.255.255, port 10010:

[0147] The MAC address of device 1 is 34:AD:E4:10:03:BE. The default IP address is 192.168.0.100.

[0148] 5a 5a 5a 5a : Fixed head

[0149] 33: Device function code

[0150] 01: Sub-function code

[0151] 66 00: Data length 102 bytes

[0152] 64 00 a8 c0: Device IP address: 192.168.0.100

[0153] 0e 00: number of tags: 14

[0154] 01 02 f6 01 : Modbus TCP port: 502

[0155] 05 01 01: Modbus address 1

[0156] 06 14 33 34 41 44 45 34 31 30 30 33 42 45 00 00 00 00 00 00 00 00 : Device Sn number: The highest 12 bits are the MAC address 34:AD:E4:10:03:BE, followed by 00

[0157] 07 01 00: SSL not encrypted

[0158] 08 00 64 00 a8 c0: IP address is 192.168.0.100

[0159] 0e 14 52 45 56 50 44 55 30 31 00 00 00 00 00 00 00 00 00 00 00 00 : Device name REVPUD01

[0160] 0f 04 00 ff ff ff: 255.255.255.0 subnet mask

[0161] 10 04 01 00 a8 c0: 192.168.0.1 IP address

[0162] 11 02 18 00: Overcurrent threshold: 24A

[0163] 12 02 f4 01: Overvoltage threshold: 500V

[0164] 13 02 59 01: Undervoltage threshold: 345V

[0165] 14 02 01 00: Software leakage type: Enable and trip

[0166] 15 02 64 00: Software leakage threshold: 100mA

[0167] 16 02 0a 00: Voltage loss threshold: 10V.

[0168] Next, after receiving the UDP information frame sent by device 1 on port 10010, the collector sends a UDP target setting frame using port 10010 to port 4999, as follows:

[0169] 1. Set the MAC address to 34:AD:E4:10:03:BE

[0170] 5a 5a 5a 5a : fixed header

[0171] 34: Collector function code

[0172] 01: Sub-function code

[0173] 01: Directional

[0174] 64 00: Data length 100 bytes

[0175] 33 34 41 44 45 34 31 30 30 33 42 46 00 00 00 00 00 00 00 00: sn code to be set: MAC address is 34:AD:E4:10:03:BE

[0176] 0a 16 a8 c0: IP address: 192.168.21.10

[0177] 0d 00: Number of tags: 13

[0178] 01 02 f6 01 : Modbus TCP port: 502

[0179] 05 01 01: Modbus address 1

[0180] 08 04 a0 15 a8 c0: IP address is 192.168.21.160

[0181] 0D 01 A5: Request device to send information frame

[0182] 0e 14 52 45 56 50 44 55 30 31 00 00 00 00 00 00 00 00 00 00 00 00 : Device name REVPUD01

[0183] 0f 04 00 ff ff ff: 255.255.255.0 subnet mask

[0184] 10 04 01 15 a8 c0: 192.168.21.1 IP address

[0185] 11 02 28 00: Overcurrent threshold: 40A

[0186] 12 02 08 01: Overvoltage threshold: 264V

[0187] 13 02 B0 00: Undervoltage threshold: 176V

[0188] 14 02 00 00: Software leakage type: Off

[0189] 15 02 64 00: Software leakage threshold: 100mA

[0190] 16 02 14 00: Voltage loss threshold: 20V.

[0191] Next, device 1 receives the corresponding target setting frame on port 4999. Because it is a directional frame, it will compare the sn code to see if it is the sn code corresponding to its own MAC address. If so, it will parse the tag group and set its own address. Because the parameter setting frame has a request device information frame, it will send the device information frame again using the UDP protocol and use its own port 4999 to send it to 255.255.255.255, port 10010.

[0192] The MAC address of the first device is 34:AD:E4:10:03:BE. After setting, the IP address is 192.168.21.160.

[0193] 5a 5a 5a 5a : Fixed head

[0194] 33: Device function code

[0195] 01: Sub-function code

[0196] 66 00: Data length 102 bytes

[0197] a0 15 a8 c0: Device IP address: 192.168.21.160

[0198] 0e 00: number of tags: 14

[0199] 01 02 f6 01 : Modbus TCP port: 502

[0200] 05 01 01: Modbus address 1

[0201] 06 14 33 34 41 44 45 34 31 30 30 33 42 45 00 00 00 00 00 00 00 00 : Device Sn number: The highest 12 bits are the MAC address 34:AD:E4:10:03:BE, followed by 00

[0202] 07 01 00: SSL not encrypted

[0203] 08 04 a0 15 a8 c0: IP address is 192.168.21.160

[0204] 0e 14 52 45 56 50 44 55 30 31 00 00 00 00 00 00 00 00 00 00 00 00 : Device name REVPUD01

[0205] 0f 04 00 ff ff ff: 255.255.255.0 subnet mask

[0206] 10 04 01 15 a8 c0: 192.168.21.1 gateway IP address

[0207] 11 02 28 00: Overcurrent threshold: 40A

[0208] 12 02 08 01: Overvoltage threshold: 264V

[0209] 13 02 B0 00: Undervoltage threshold: 176V

[0210] 14 02 00 00: Software leakage type: Off

[0211] 15 02 64 00: Software leakage threshold: 100mA

[0212] 16 02 14 00: Voltage loss threshold: 20V.

[0213] Finally, the collector receives the device information frame from port 10010 and compares it with the parameters to be set. If they match, the device parameter setting is not performed. If not, the corresponding target setting frame is sent again. Since the UDP protocol is an unreliable connection protocol, this method ensures that the parameters of each device are correctly set.

[0214] In some embodiments, the method of the present application may further include:

[0215] acquiring second device information from a device registration table for recording device information, and adding the second device information to the second setting frame;

[0216] broadcasting the second setting frame to the device, so that the device sets parameters according to the second setting frame and then feeds back a device information frame of the device to the collector;

[0217] receiving and parsing the device information frame to obtain third device information of the device, and if the third device information is the same as the second device information, no longer sending the second setting frame to the device having the second device information;

[0218] If the third device information is different from the second device information, the second setting frame is broadcast to the device again, so that the device repeats the operations of parameter setting and feeding back the device information frame.

[0219] This application can also implement scenario 4, in which the collector distributes other setting parameters for registered devices to all devices. In some embodiments, the collector can retrieve a record of device information from its device registration table, for example, which may include the device's MAC address, IP address, and other parameters that need to be set. Based on this record information, the collector constructs a second setting frame containing the MAC address, IP address, and other parameters that need to be set, and broadcasts it to port A of 255.255.255.255, notifying all devices to update their parameters.

[0220] Next, all devices on the LAN receive the second setup frame from port A, parse the frame, and compare the MAC addresses. If the MAC addresses match, the device sets its own IP address based on the IP address in the setup frame and updates other settings. Conversely, if the MAC addresses don't match, the device doesn't perform any actions, ensuring that the matching devices follow the collector's instructions for parameter configuration.

[0221] Through the above method, the collector of the present application can receive the device information frame broadcast by the device in real time, and parse the correctness of the device information of each device in the device information frame. When a device with incorrect device information is found, it can promptly broadcast a target setting frame containing correct parameters to the corresponding device. Compared with the traditional method of dynamically allocating IP addresses through the DHCP protocol, the process of verifying the accuracy of the IP address and other parameters of the device is added to ensure that each device can be assigned a unique and correct IP address and other configuration parameters, avoiding the frequent changes and conflicts of IP addresses caused by dynamic routing allocation. At the same time, other configuration parameters other than the IP address can also be synchronized to the device and checked, thereby improving the accuracy, reliability and comprehensiveness of the parameter settings for the device, enabling new devices to be quickly networked and put into use, and reducing the time it takes for the device to go online.

[0222] like Figure 3 As shown, Figure 3 This is a flow chart of a device parameter setting method in one embodiment of the present application, which is applied to Figure 1 The device in the device is configured to execute the device parameter setting method through the device parameter setting device to improve the accuracy, efficiency and stability of the device parameter setting. The device parameter setting method may include the following steps 201-202.

[0223] Step 201: Broadcast a device information frame to the collector, so that the collector feeds back a corresponding target setting frame to the device according to the device information carried in the device information frame.

[0224] In some embodiments, a device can broadcast a device information frame containing its MAC address, current IP address, and other configuration information to the entire network. For example, the frame can be sent to a predetermined broadcast address (e.g., 255.255.255) and port B to ensure that all devices and collectors connected to the network receive the frame. The collector can then receive the device information frame from the device through port A. The collector can read the device information carried in the frame, such as each device's MAC address, IP address, and other configuration information.

[0225] Next, the collector checks whether the MAC address of each device in the device information frame is registered in the collector's device maintenance table. If the device information is registered, the collector further checks whether the IP address and other parameters in the registered information are consistent with the received information. Based on the check results, the collector takes appropriate actions to determine whether to send the corresponding target setting frame to each device and what type of target setting frame to send. For details on the collector sending target settings after parsing the device information, please refer to step 102 above and will not be repeated here.

[0226] Step 202: Receive the target setting frame, and perform parameter setting information according to the target setting frame.

[0227] In some embodiments, the device can receive a target setting frame sent by the collector through a predetermined receiving port, such as port B. The target setting frame can contain the device's MAC address, IP address and other parameters that need to be set. The target setting frame is generated by the collector based on the device information frame received previously, and is sent through a broadcast address such as 255.255.255.255 to ensure that all devices can receive it. Then, after the device receives the target setting frame, it can parse the content in the frame. For example, it can first check whether the MAC address in the frame is consistent with its own MAC address. If the MAC addresses are consistent, it indicates that the target setting frame is sent to the device by the collector.

[0228] As you can see, if the target setting frame includes a new IP address, the device will update the IP address to the one specified in the target setting frame. This ensures that the device's IP address remains consistent with the record in the collector's maintenance table. In addition to the IP address, the target setting frame can also include other parameters to be configured, such as overvoltage thresholds and overcurrent thresholds. Based on the other settings in the target setting frame, the device can update its configuration to match the information registered in the collector.

[0229] In some embodiments, the method of the present application may further include:

[0230] First, before receiving the target setting frame, receiving the target setting frame with a first delay time as a period;

[0231] Then, after the target setting frame has been received and the second delay time has passed, the device information is broadcast to the collector with the first delay time as a period.

[0232] This application can also implement scenario five, where the collector can synchronize device information in real time when parameters of new or installed devices change.

[0233] It is understood that for new devices in the scenario that have not yet received target setting frames, they can receive target setting frames with a period of the first delay time T1. The device will trigger the synchronization process executed by the collector in Scenario 5 to ensure the synchronization of the setting parameters of each device. Correspondingly, for devices that have already received target setting frames, the operation of receiving target setting frames can be suspended to alleviate bandwidth pressure. For example, it can be suspended for a period of the second delay time T2, and then resume broadcasting device information to the collector with a period of the first delay time T1, triggering the collector to execute the process of Scenario 5. The following is a detailed explanation of the execution process of the collector in Scenario 5.

[0234] In a specific implementation, the collector can retrieve a record from the device maintenance register. For example, this record may contain the MAC address of the device to be distributed. This record may include the device's MAC address, IP address, and other configuration information. The collector then encapsulates the MAC address, IP address, and other configuration information contained in this record into a second configuration frame. All devices can then receive the second configuration frame via port A. Each device can parse the second configuration frame and compare the MAC address in the second configuration frame with its own MAC address. If the MAC addresses match, the device sets its IP address to the IP address in the configuration frame and updates other configuration information. The collector broadcasts UDP configuration frame 2 to 255.255.255.255 via port A to ensure that all devices receive it. After the device configuration is complete, each device can again send a device information frame containing the updated MAC address, IP address, and other configuration information to 255.255.255.255 via port B.

[0235] Finally, the collector receives the device information frame sent back by the device through port B. The collector checks the MAC address, IP address, and other configuration information in the device information frame and compares it with the maintained device information table. If the information matches, the device's parameters are set correctly, and the parameter setting process for this device ends. No further configuration frames will be sent. If the information is inconsistent, the collector can send UDP configuration frame 2 containing the MAC address, IP address, and other parameters to be set to 255.255.255.255 to port A and repeat steps 2 to 4 until the information matches.

[0236] The following is a detailed introduction to the structure of the collector and device, as well as the data interaction mode between the two.

[0237] like Figure 4 As shown, the system can consist of a collector and multiple devices. The collector contains two functional modules: a UDP module and an application. The UDP module sends data through port B and receives data through port A. The devices also contain two functional modules: a UDP module and an application. The UDP module of the device sends data through port A and receives data through port B. In this specific example, the collector's application is a Modbus TCP client, and the device's application is a Modbus TCP server.

[0238] In use, the UDP function module and TCP application of the collector and device can operate simultaneously. When the collector's ModbusTCP client detects a change in the device's IP address, the TCP connection automatically reconnects to the device's ModbusTCP server using the latest IP address. Similarly, when the device's ModbusTCP server detects a change in IP address, it listens using the latest IP address to ensure connection stability.

[0239] It should be noted that each time a data collector goes online, it can proactively send a UDP broadcast requesting device information frames. After receiving UDP device information frames from all devices, the data collector can count device parameters and determine which devices require parameter settings. The data collector then activates the ModbusTCP client service, connects to the set IP addresses and ModbusTCP ports of all devices, and exchanges data via the ModbusTCP protocol. The device can have a built-in timer that resets when ModbusTCP data is exchanged and increments when no data is exchanged. When the timer reaches the preset time, the device's ModbusTCP server will proactively reconnect, and the data collector will need to reconnect to the ModbusTCP server. The data collector can send UDP broadcast request frames at any time during operation. Upon receiving these frames, the device can reply to the frames. This means that the UDP and ModbusTCP modules of the data collector and the device operate independently.

[0240] The following is a detailed example of the format of the data frame corresponding to various setting parameters in this application:

[0241] The network device self-discovery custom data field (Tag=0x1P port description) is used to set the modbus TCP port, as shown below:

[0242]

[0243] The network device self-discovers a custom data field (Tag=0x5, device communication address), which is carried when sending and responding, and is represented as follows:

[0244]

[0245] The network device self-discovery custom data field (Tag = 0x6, device SN) is carried when sending, and is represented as follows:

[0246]

[0247] The network device self-discovers a custom data field (Tag = 0x7, SSL encryption), which is carried when sending and responding, and is represented as follows:

[0248]

[0249] The network device self-discovery custom data field (Tag=0x0C, IP address) is used by the collector or host computer to set the IP address of the remote device, as shown below:

[0250]

[0251] The network device self-discovery custom data field (Tag=0x0D, IP address) is used by the collector or host computer to set the IP address of the remote device, as shown below:

[0252]

[0253] The network device self-discovery custom data field (Tag = 0x0E, Title) is used for collector settings or remote device reporting of Title information, as shown below:

[0254]

[0255] The network device self-discovers a custom data field (Tag=0x11, overcurrent: current limit) used to set the overcurrent threshold, as shown below:

[0256]

[0257] The network device self-discovers a custom data field (Tag=0x12, overvoltage: voltage limit) used to set the overvoltage threshold, as shown below:

[0258]

[0259] The network device self-discovery custom data field (Tag = 0x13, undervoltage: voltage limit) is used to set the undervoltage threshold, which is expressed as follows:

[0260]

[0261] The network device self-discovery custom data field (Tag = 0x14, software leakage type) is used for software leakage type and is represented as follows:

[0262]

[0263] The network device self-discovers a custom data field (Tag = 0x15, software leakage limit) used for software measurement of leakage current values. When the value is greater than the software leakage type, the action corresponding to the type is taken, as shown below:

[0264]

[0265] The network device self-discovers a custom data field (Tag=0x16, voltage loss threshold). When the voltage is lower than this value, it is considered to be voltage loss, as shown below:

[0266]

[0267] In a possible example, in order to better implement the device parameter setting method in the embodiment of the present application, on top of the device parameter setting method, the embodiment of the present application also provides a device parameter setting device, such as Figure 5 As shown, the device parameter setting device is applied to a collector connected to a device, and includes:

[0268] A data receiving unit 201 is configured to receive a device information frame broadcast by the device;

[0269] The parameter parsing unit 202 is used to obtain the device information carried by the device information frame, parse the accuracy of the device information, and if the device information is incorrect, feed back a target setting frame carrying correct parameters to the device so that the device sets parameters according to the target setting frame.

[0270] In an embodiment of the present application, the data receiving unit 201 and the parameter parsing unit 202 can be used to execute steps 101-102 of the aforementioned method embodiment respectively. For more detailed contents or specific implementation methods of each functional module, please refer to the description of the corresponding method steps, which will not be repeated here.

[0271] The device parameter setting apparatus provided in this application first receives a device information frame broadcast by the device through a data receiving unit 201. The parameter parsing unit 202 then obtains the device information carried in the device information frame, parses the device information for accuracy, and, if the device information is incorrect, feeds back a target setting frame carrying the correct parameters to the device, so that the device performs parameter setting according to the target setting frame.

[0272] In a possible example, in order to better implement the device parameter setting method in the embodiment of the present application, on top of the device parameter setting method, the embodiment of the present application also provides a device parameter setting device, such as Figure 6 As shown, the device parameter setting device is applied to a device connected to a collector, and includes:

[0273] The data broadcast unit 301 is configured to broadcast a device information frame to the collector, so that the collector feeds back a corresponding target setting frame to the device according to the device information carried in the device information frame;

[0274] The parameter setting unit 302 is configured to receive the target setting frame and perform parameter setting information according to the target setting frame.

[0275] In an embodiment of the present application, the data broadcast unit 301 and the parameter setting unit 302 can be used to execute steps 201-202 of the aforementioned method embodiment respectively. For more detailed contents or specific implementation methods of each functional module, please refer to the description of the corresponding method steps, which will not be repeated here.

[0276] The device parameter setting apparatus provided herein first broadcasts a device information frame to the collector via a data broadcast unit 301, so that the collector feeds back a corresponding target setting frame to the device based on the device information carried in the device information frame. The parameter setting unit 302 receives the target setting frame and performs parameter setting based on the target setting frame.

[0277] The present application also provides a computer device. Figure 7 , Figure 7 This is a basic structural block diagram of the computer device in this embodiment.

[0278] The computer device includes a memory 510 and a processor 520 that are interconnected and communicate with each other via a system bus. It should be noted that the figure only shows a computer device with components 510-520, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0279] Computer devices can be desktop computers, laptops, PDAs, cloud servers, etc. Computer devices can interact with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0280] The memory 510 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, a hard disk, a multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 510 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card equipped with the computer device. Of course, the memory 510 may also include both an internal storage unit of the computer device and an external storage device thereof. In this embodiment, the memory 510 is generally used to store an operating system and various application software installed on the computer device, such as the program code of the above-mentioned method. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are about to be output. In some embodiments, the memory 510 may also be a register.

[0281] The processor 520 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 510 is used to store program code or instructions, which include computer operating instructions. The processor 520 is used to execute the program code or instructions stored in the memory 510 or process data, such as the program code for running the above method.

[0282] In this article, a bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus system can be divided into address buses, data buses, control buses, and so on. For ease of illustration, the diagram uses only a single thick line, but this does not imply that there is only one bus or only one type of bus.

[0283] Another embodiment of the present application further provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads the computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method, and to generate a device that implements the functional actions specified in each block or combination of blocks in the block diagram.

[0284] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above-mentioned methods stored in the memory.

[0285] For the definitions of memory and processor, please refer to the description of the aforementioned computer device embodiment and will not be repeated here.

[0286] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0287] Each functional unit or module in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The above-mentioned integrated units may be implemented in the form of hardware or software functional units.

[0288] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0289] In the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" described in the present application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented with the aid of hardware comprising several different elements and with the aid of a suitably programmed computer. In a unit claim that lists several means, several units of these means may be embodied by the same hardware item. The use of first, second, and third etc. does not indicate any order and these words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.

[0290] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A device parameter setting method, characterized in that: Applied to a collector connected to a device, the method includes: receiving a device information frame broadcast by the device; Obtain the device information carried by the device information frame, analyze the accuracy of the device information, and if the device information is incorrect, feed back a target setting frame carrying correct parameters to the device, wherein the target setting frame is a first setting frame containing a new IP address and a MAC address of the device, so that the device can parse the MAC address of the first setting frame. If the MAC address is consistent with the MAC address of the device itself, set its own IP address and other setting parameters other than the IP address according to the IP address in the first setting frame; after the setting is completed, if the target setting frame contains an instruction indicating that a device information frame needs to be reported, send a UDP device information frame containing the updated IP address and setting information to the collector again to ensure that the IP address of each device is correctly updated, and notify the collector again to perform final information synchronization; if the target setting frame does not contain the instruction, no longer send the UDP device information frame to the collector; The step of parsing the device information and feeding back a corresponding target setting frame to the device includes: Searching for the registration result of the device information in the collector; Feedback the target setting frame to the device according to the registration result; Feedback of the target setting frame to the device according to the registration result includes: If the registration result is that the device information has been registered in the collector, determining whether the current first IP address of the device is the same as the second IP address recorded by the collector; If they are different, a first setting frame including the second IP address is fed back to the device.

2. The device parameter setting method according to claim 1, characterized in that: The method further comprises: Determine whether the first setting parameter of the device other than the IP address is the same as the second setting parameter recorded by the collector; If the first IP address is the same as the second IP address, and the first setting parameter is the same as the second setting parameter, the collector does not perform any operation; If the first IP address is the same as the second IP address, and the first setting parameter is different from the second setting parameter, the device information recorded by the collector is updated to the first device information.

3. The device parameter setting method according to claim 1, characterized in that: Feedback of the target setting frame to the device according to the registration result includes: If the registration result is that the device information is not registered in the collector, a second setting frame including a third IP address and a third setting parameter that are not registered in the collector is sent to the device.

4. The device parameter setting method according to any one of claims 1 to 3, characterized in that: The device information frame and the target setting frame both include a MAC address of a device, so that the collector identifies the device corresponding to the device information frame according to the MAC address, and the device identifies the device corresponding to the target setting frame according to the MAC address.

5. The device parameter setting method according to claim 1, characterized in that: The method further comprises: Broadcasting a request frame for requesting to obtain device information of each device to the first port, so that each device broadcasts a reply frame containing the device information to the second port; receiving and parsing the reply frame to obtain device information of each device, and comparing the first IP address of each device with the second IP address registered in the collector to see whether they are the same; For second devices whose first IP address is different from the second IP address registered in the collector, a setting frame is broadcast to the first port, so that each second device performs parameter setting according to the setting frame.

6. The device parameter setting method according to claim 1, characterized in that: The method further comprises: acquiring second device information from a device registration table for recording device information, and adding the second device information to a second setting frame; broadcasting the second setting frame to the device, so that the device performs parameter setting according to the second setting frame and then feeds back a device information frame of the device to the collector; receiving and parsing the device information frame to obtain third device information of the device, and if the third device information is the same as the second device information, no longer sending the second setting frame to the device having the second device information; If the third device information is different from the second device information, the second setting frame is broadcast to the device again, so that the device repeats the operations of parameter setting and feeding back the device information frame.

7. A method for setting device parameters, characterized in that: Applied to a device connected to a collector, the method includes: Broadcasting a device information frame to the collector so that the collector searches for a registration result of the device information in the collector based on the device information carried in the device information frame; feeding back a target setting frame to the device based on the registration result; feeding back a target setting frame to the device based on the registration result, including: if the registration result is that the device information has been registered in the collector, determining whether the current first IP address of the device is the same as the second IP address recorded by the collector; if they are different, feeding back a first setting frame including the second IP address to the device; the target setting frame is the first setting frame including the new IP address and the MAC address of the device; Receiving the target setting frame and performing parameter setting information according to the target setting frame, including: parsing a MAC address of the first setting frame, and if the MAC address is consistent with the MAC address of the device itself, setting its own IP address and other setting parameters other than the IP address according to the IP address in the first setting frame; After the setting is completed, if the target setting frame contains an instruction indicating that a device information frame needs to be reported, a UDP device information frame containing the updated IP address and setting information is sent to the collector again to ensure that the IP address of each device is correctly updated, and the collector is notified again to perform final information synchronization; if the target setting frame does not contain the instruction, the UDP device information frame is no longer sent to the collector; Among them, before the target setting frame is received, the target setting frame is received with a first delay time as a period; after the target setting frame has been received, after a second delay time has passed, the device information is broadcast to the collector with the first delay time as a period.

8. A device parameter setting device, characterized in that: Applicable to a collector connected to a device, the device comprising: a data receiving unit, configured to receive a device information frame broadcast by the device; A parameter parsing unit is used to obtain the device information carried by the device information frame, parse the accuracy of the device information, and if the device information is wrong, feed back a target setting frame carrying correct parameters to the device, wherein the target setting frame is a first setting frame containing a new IP address and a MAC address of the device, so that the device can parse the MAC address of the first setting frame. If the MAC address is consistent with the MAC address of the device itself, the device sets its own IP address and other setting parameters other than the IP address according to the IP address in the first setting frame; after the setting is completed, if the target setting frame contains an instruction indicating that a device information frame needs to be reported, a UDP device information frame containing the updated IP address and setting information is sent to the collector again to ensure that the IP address of each device is correctly updated, and the collector is notified again to perform final information synchronization; if the target setting frame does not contain the instruction, the UDP device information frame is no longer sent to the collector; The step of parsing the device information and feeding back a corresponding target setting frame to the device includes: Searching for the registration result of the device information in the collector; Feedback the target setting frame to the device according to the registration result; Feedback of the target setting frame to the device according to the registration result includes: If the registration result is that the device information has been registered in the collector, determining whether the current first IP address of the device is the same as the second IP address recorded by the collector; If they are different, a first setting frame including the second IP address is fed back to the device.

9. A device parameter setting device, characterized in that: Applicable to a device connected to a collector, the device comprises: a data broadcast unit, configured to broadcast a device information frame to the collector, so that the collector searches for a registration result of the device information in the collector based on the device information carried in the device information frame; and feeds back a target setting frame to the device based on the registration result; the feeding back a target setting frame to the device based on the registration result comprises: if the registration result indicates that the device information has been registered in the collector, determining whether the current first IP address of the device is the same as the second IP address recorded by the collector; if they are different, feeding back a first setting frame including the second IP address to the device; the target setting frame is the first setting frame including the new IP address and the MAC address of the device; a parameter setting unit, configured to receive the target setting frame, perform parameter setting information according to the target setting frame, and further configured to parse a MAC address of the first setting frame, and if the MAC address is consistent with the MAC address of the device itself, set its own IP address and other setting parameters other than the IP address according to the IP address in the first setting frame; After the setting is completed, if the target setting frame contains an instruction indicating that a device information frame needs to be reported, a UDP device information frame containing the updated IP address and setting information is sent to the collector again to ensure that the IP address of each device is correctly updated, and the collector is notified again to perform final information synchronization; if the target setting frame does not contain the instruction, the UDP device information frame is no longer sent to the collector; Among them, before the target setting frame is received, the target setting frame is received with a first delay time as a period; after the target setting frame has been received, after a second delay time has passed, the device information is broadcast to the collector with the first delay time as a period.

10. A computer device, characterized in that: The device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the device parameter setting method according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the device parameter setting method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Parameter configuration method and device, communication equipment and storage medium

    CN110662197A

  • Internet protocol address dynamic modification method and device and electronic equipment

    CN111416886A

  • Network equipment management method and related device

    CN114422481A