A protocol configuration method and device for a dual-network port device, a medium, and an electronic device
By using a daisy-chain networking approach and employing notification messages to configure the IP addresses of dual-port devices, the problem of discontinuous IP configurations for devices in underground parking lots of shopping malls was solved, reducing manpower waste and ensuring the continuity of IP addresses.
Patent Information
- Application Number
- CN202111611933.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In the underground parking lots of shopping malls, dual-port devices have the same default IP address at the factory, which means that the IP address needs to be configured separately after the environment is deployed. This makes it impossible to ensure that the IP addresses of adjacent devices are continuous, which increases manpower consumption.
Using a daisy-chain networking approach, the protocol address to be configured is sent to the first network port of the current device through the second network port of the preceding dual-port device. The first and second network port addresses of the current device are configured in sequence, and the IP continuous configuration of adjacent devices is achieved by using notification messages.
It enables the sequential and required configuration of protocols for multiple dual-port devices, reducing significant manpower waste and ensuring the continuity of IP addresses for adjacent devices.
Smart Images

Figure CN116366602B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of monitoring technology, and in particular to a protocol configuration method, apparatus, medium and electronic device for a dual-port device. Background Technology
[0002] Almost all supermarkets and shopping malls now have underground parking lots for charging reasonable fees for parked vehicles. However, during project deployment, due to the fact that all dual-port devices have the same default IP address, after the environment is deployed and the devices are powered on, each device still needs to be individually connected for IP configuration. Furthermore, the configuration process requires that the IP addresses and parking space numbers of adjacent parking spaces be identical (adjacent parking space IP addresses must be consecutive). To address this issue, parking lot project implementation urgently needs a solution that can automatically configure IP addresses to reduce unnecessary manpower costs.
[0003] Currently, the common method is to use DHCP (Dynamic Host Configuration Protocol) to automatically assign camera IPs.
[0004] Because the IP addresses are assigned randomly, it is impossible to ensure that adjacent devices have consecutive IP addresses, and the location of a device cannot be determined by its IP address. Summary of the Invention
[0005] This application provides a protocol configuration method, apparatus, medium, and electronic device for dual-port devices, which can configure the protocols of multiple dual-port devices sequentially and as required, reducing a significant amount of manpower waste.
[0006] In a first aspect, embodiments of this application provide a protocol configuration method for dual-port devices, wherein each dual-port device is connected via a daisy-chain networking method; the method includes:
[0007] Get the address of the protocol to be configured;
[0008] Based on the protocol address to be configured, the first network port address of the current dual-port device is configured to obtain the first network port configuration address of the current dual-port device;
[0009] If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device to obtain the second network port configuration address of the current dual-network port device; wherein, the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified protocol address to be configured.
[0010] Secondly, embodiments of this application provide a protocol configuration device for dual-port devices, wherein each dual-port device is connected via a daisy-chain networking method; the device includes:
[0011] The module for obtaining the address of the protocol to be configured is used to obtain the address of the protocol to be configured.
[0012] The module for obtaining the first network port configuration address of the current dual-port device is used to configure the first network port address of the current dual-port device according to the protocol address to be configured, so as to obtain the first network port configuration address of the current dual-port device.
[0013] The module for obtaining the second network port configuration address of the current dual-network port device is used to configure the second network port address of the current dual-network port device based on the first network port configuration address of the current dual-network port device if a notification message is received, thereby obtaining the second network port configuration address of the current dual-network port device; wherein, the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified protocol address to be configured.
[0014] Thirdly, embodiments of this application provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the protocol configuration method for a dual-port device as described in embodiments of this application.
[0015] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the protocol configuration method for a dual-port device as described in embodiments of this application.
[0016] The technical solution provided in this application obtains the address of the protocol to be configured, and then configures the first network port address of the current dual-network port device based on the address of the protocol to be configured, thereby obtaining the first network port configuration address of the current dual-network port device. If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device, thereby obtaining the second network port configuration address of the current dual-network port device. This technical solution can configure the protocols of multiple dual-network port devices sequentially and as required, reducing a significant amount of manpower waste. Attached Figure Description
[0017] Figure 1 This is a flowchart of the protocol configuration method for a dual-port device provided in Embodiment 1 of this application;
[0018] Figure 2 This is a schematic diagram of the dual-port device connection provided in Embodiment 1 of this application;
[0019] Figure 3 This is a schematic diagram of the protocol configuration process of the dual-port device provided in Embodiment 2 of this application;
[0020] Figure 4This is a schematic diagram of the protocol configuration device for the dual-port device provided in Embodiment 3 of this application;
[0021] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application. Detailed Implementation
[0022] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present application, not the entire structure.
[0023] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. The process can be terminated when its operation is complete, but may also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0024] Example 1
[0025] Figure 1 This is a flowchart of a protocol configuration method for a dual-port device provided in Embodiment 1 of this application. This embodiment can be applied to the situation where multiple dual-port devices are configured with protocols in sequence. This method can be executed by the protocol configuration device for the dual-port device provided in this embodiment. The device can be implemented by software and / or hardware and can be integrated into devices such as smart terminals used for protocol configuration.
[0026] like Figure 1 As shown, the protocol configuration method for the dual-port device includes:
[0027] S110, Obtain the address of the protocol to be configured;
[0028] Among them, dual-network port devices can be dual-network port cameras. Internally, they have a single network card, but can achieve dual-network port functionality through a switch chip. They support dual-network port connection and isolation operations. When connected, the two network ports share the same IP and can communicate with each other. When isolated, the two network ports have independent IPs and cannot communicate with each other.
[0029] In this solution, in dual-port device scenarios, the dual-port devices are connected via a daisy-chain networking method. Dual-port devices are enabled for dual-network isolation by default at the factory, and each dual-port device has a default IP address (Internet Protocol Address).
[0030] For example, Figure 2 This is a schematic diagram of the dual-port device connection provided in Embodiment 1 of this application, as shown below. Figure 2 As shown, port 1 of the first dual-port device is connected to the switch, port 2 is connected to port 1 of the second dual-port device, port 2 of the second dual-port device is then connected to port 1 of the third dual-port device, and so on.
[0031] In this embodiment, the protocol to be configured can refer to the IP address used to configure the dual-port device. The protocol address to be configured is different for each dual-port device.
[0032] In this solution, the protocol address to be configured can be obtained through the transmission of the previous dual-port device, or it can be obtained through the configuration interface.
[0033] In this technical solution, optionally, obtaining the address of the protocol to be configured includes:
[0034] If the current dual-port device is not the first device, the protocol address to be configured is obtained from the second port of the previous dual-port device through the first port of the current dual-port device.
[0035] The protocol address to be configured is determined by the preceding dual-port device based on the first port configuration address of the preceding dual-port device.
[0036] In this solution, the protocol address can be automatically configured based on the first network port configuration address of the previous dual-port device, resulting in a protocol address to be configured that is in the same network segment as the first network port configuration address of the previous dual-port device.
[0037] Specifically, the configuration address of the first network port of the previous dual-port device consists of a host portion and a data portion. The data portion of the configuration address of the first network port of the previous dual-port device can be adjusted according to the protocol order to obtain the address of the protocol to be configured. For example, if the configuration address of the first network port of the previous dual-port device is IP2 (204.1.1.10), then the data portion of the configuration address of the first network port of the previous dual-port device can be adjusted to set IP3 (204.1.1.11) as the address of the protocol to be configured.
[0038] In this embodiment, the second network port of the previous dual-port device is connected to the first network port of the current dual-port device via a network cable, so that the protocol address to be configured can be sent to the first network port of the current dual-port device based on the second network port of the previous dual-port device.
[0039] In this embodiment, the virtual address of the second network port of the previous dual-port device can be set to be in the same network segment as the default address of the second network port of the previous dual-port device. For example, if the default address of the second network port of the previous dual-port device is IP1 (192.168.1.13), then the default address of the second network port of the previous dual-port device can be adjusted according to the preset address to obtain the virtual address of the second network port of the previous dual-port device, IP5 (192.168.1.12).
[0040] In this solution, when the first network port address of the current dual-port device is not configured, the first network port address of the current dual-port device is the default address, which is also IP1 (192.168.1.13). At this time, the virtual address IP5 (192.168.1.12) of the second network port of the previous dual-port device and the default address IP1 (192.168.1.13) of the first network port of the current dual-port device are in the same network segment. Therefore, the second network port of the previous dual-port device can be used to send the protocol address to be configured to the first network port of the current dual-port device.
[0041] By utilizing the second network port of the previous dual-port device, the protocol address to be configured is sent to the first network port of the current dual-port device, enabling the protocol of the current dual-port device to be configured sequentially and as required, reducing a significant amount of manpower waste.
[0042] In this technical solution, optionally, obtaining the address of the protocol to be configured also includes:
[0043] If the current dual-port device is the first device, obtain the protocol address to be configured through the first port of the current dual-port device;
[0044] The protocol address to be configured is determined by a preset starting protocol address.
[0045] In this solution, the preset starting protocol address can be set according to configuration requirements. For example, the preset starting protocol address can be set to IP2 (204.1.1.10).
[0046] In this embodiment, the starting protocol address can be set through the configuration interface and sent to the first network port of the current dual-port device.
[0047] By determining the protocol address to be configured, the protocols of dual-port devices can be configured sequentially and as required, reducing a significant amount of manpower wastage.
[0048] S120. Configure the first network port address of the current dual-port device according to the protocol address to be configured, and obtain the first network port configuration address of the current dual-port device.
[0049] In this embodiment, after obtaining the protocol address to be configured, the first network port address of the current dual-port device can be configured based on the protocol address to be configured. For example, if the obtained protocol address to be configured is IP3 (204.1.1.11), then the first network port configuration address of the current dual-port device can be configured as IP3 (204.1.1.11).
[0050] S130. If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device to obtain the second network port configuration address of the current dual-network port device; wherein, the notification message is used to indicate that the next dual-network port device generates and sends the modified protocol address to be configured to the current dual-network port device after receiving it.
[0051] The notification message can be composed of letters, numbers, or strings. Once the next dual-port device receives the modified protocol address to be configured, it sends a notification message to the current dual-port device.
[0052] In this solution, after the dual-port device receives the notification message, it configures the address of the second port of the dual-port device. The configuration address of the second port of the dual-port device can be set to be the same as the configuration address of the first port of the dual-port device, that is, the two ports share the same IP.
[0053] In this embodiment, subsequent devices automatically repeat the above steps to complete the automatic IP configuration in sequence until the IP allocation or device configuration is complete.
[0054] In this solution, after each dual-port device is configured, its specific installation location can be obtained through consecutive IP addresses.
[0055] The technical solution provided in this application embodiment obtains the address of the protocol to be configured, and then configures the first network port address of the current dual-network port device according to the address of the protocol to be configured, to obtain the first network port configuration address of the current dual-network port device. If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device, to obtain the second network port configuration address of the current dual-network port device. By executing this technical solution, the protocols of multiple dual-network port devices can be configured sequentially and as required, reducing a significant amount of manpower waste.
[0056] Example 2
[0057] Figure 3This is a schematic diagram of the protocol configuration process for a dual-port device provided in Embodiment 2 of this application. Embodiment 2 further optimizes Embodiment 1. Specifically, after configuring the first port address of the current dual-port device to obtain the first port configuration address, the method further includes: determining the modified protocol address to be configured for the next dual-port device based on the first port configuration address of the current dual-port device; and sending the modified protocol address to be configured for the next dual-port device to the first port of the next dual-port device through the second port of the current dual-port device. For details not described in this embodiment, please refer to Embodiment 1. Figure 3 As shown, the method includes the following steps:
[0058] S310, Obtain the address of the protocol to be configured;
[0059] S320. Configure the first network port address of the current dual-port device according to the protocol address to be configured, and obtain the first network port configuration address of the current dual-port device;
[0060] S330. Based on the configuration address of the first network port of the current dual-port device, determine the modified protocol address to be configured for the next dual-port device.
[0061] In this solution, the protocol address can be automatically configured based on the first network port configuration address of the current dual-port device, so as to obtain the protocol address to be configured for the next dual-port device that is in the same network segment as the first network port configuration address of the current dual-port device.
[0062] In this technical solution, optionally, the modified protocol address to be configured for the next dual-port device is determined based on the configuration address of the first port of the current dual-port device, including:
[0063] According to the preset protocol address order, adjust the data part of the configuration address of the first network port of the current dual-port device to obtain the modified protocol address to be configured for the next dual-port device.
[0064] The preset protocol address order is used to characterize the order of protocol configuration and can be set according to IP ranges. For example, the protocol address order can be 204.1.1.10-204.1.1.109.
[0065] In this embodiment, the configuration address of the first network port of the current dual-port device consists of a host portion and a data portion. The data portion of the first network port configuration address of the current dual-port device can be adjusted according to a preset protocol address order to obtain the modified protocol address to be configured for the next dual-port device. For example, if the configuration address of the first network port of the current dual-port device is IP3 (204.1.1.11), then the data portion of the first network port configuration address of the current dual-port device can be adjusted, setting IP4 (204.1.1.12) as the protocol address to be configured for the next dual-port device.
[0066] By adjusting the data portion of the configuration address of the first network port of the current dual-port device, the addresses of the protocols to be configured can be obtained in sequence. This enables the protocols of multi-port devices to be configured in sequence and as required, reducing a lot of manpower waste.
[0067] S340. Send the modified protocol address to be configured for the next dual-port device to the first port of the next dual-port device through the second port of the current dual-port device.
[0068] In this embodiment, the second network port of the current dual-port device is connected to the first network port of the next dual-port device via a network cable. The modified protocol address to be configured for the next dual-port device can be sent to the first network port of the next dual-port device based on the second network port of the current dual-port device.
[0069] In this technical solution, optionally, the modified protocol address to be configured for the next dual-port device is sent to the first port of the next dual-port device via the second port of the current dual-port device, including:
[0070] Adjust the default address of the second network port of the current dual-port device to obtain the virtual address of the second network port of the current dual-port device; wherein, the virtual address of the second network port of the current dual-port device and the default address of the second network port of the current dual-port device belong to the same network segment;
[0071] Using the virtual address of the second network port of the current dual-port device, the modified protocol address to be configured for the next dual-port device is sent to the first network port of the next dual-port device.
[0072] In this embodiment, the virtual address of the second network port of the current dual-port device can be set to be in the same network segment as the default address of the second network port of the current dual-port device. For example, if the default address of the second network port of the current dual-port device is IP1 (192.168.1.13), the default address of the second network port of the current dual-port device can be modified according to the preset address to obtain the virtual address of the second network port of the current dual-port device. Similarly, the virtual address of the second network port of the current dual-port device can be set to IP5 (192.168.1.12).
[0073] In this solution, when the first network port address of the second dual-port device is not configured, the first network port address of the second dual-port device is the default address, which is also IP1 (192.168.1.13). At this time, the virtual address of the second network port of the current dual-port device is IP5 (192.168.1.12), and the default address of the first network port of the second dual-port device is IP1 (192.168.1.13). Since they are in the same network segment, the modified protocol address to be configured for the second dual-port device can be sent to the first network port of the second dual-port device using the second network port of the current dual-port device.
[0074] In this embodiment, when the first network port of the next dual-port device receives the modified protocol address to be configured, it will send a notification message to the second network port of the current dual-port device.
[0075] Sending the modified protocol address to be configured to the first network port of the next dual-port device enables the sequential and required configuration of protocols for adjacent dual-port devices.
[0076] S350. If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device to obtain the second network port configuration address of the current dual-network port device; wherein, the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified protocol address to be configured.
[0077] In this solution, if the current dual-port device receives a notification message, the address of the second port of the current dual-port device will be configured. The configuration address of the second port of the current dual-port device can be set to be the same as the configuration address of the first port of the current dual-port device, that is, the two ports share the same IP.
[0078] In this technical solution, optionally, the second network port address of the current dual-port device is configured based on the first network port configuration address of the current dual-port device, to obtain the second network port configuration address of the current dual-port device, including:
[0079] Clear the virtual address of the second network port of the current dual-port device, control the first and second network ports of the current dual-port device to be in the on state, and configure the address of the second network port of the current dual-port device based on the configuration address of the first network port of the current dual-port device, and determine the configuration address of the second network port of the current dual-port device.
[0080] In this solution, when the two network ports of a dual-port device are isolated, the default address of the second network port of the current dual-port device can be adjusted to obtain the virtual address of the second network port. Information is then transmitted using the virtual address of the second network port of the current dual-port device and the default address of the first network port of the next dual-port device. Upon receiving a notification message from the next dual-port device, the virtual address of the second network port of the current dual-port device can be cleared based on the built-in chip of the current dual-port device, and the first and second network ports of the current dual-port device can be kept in a connected state. When the first and second network ports are connected, the two ports can share the same IP address and communicate with each other. At this time, the configuration address of the first and second network ports of the current dual-port device can be set to the same address.
[0081] In this embodiment, the dual-port devices are connected in a daisy-chain configuration, with the first port of the first dual-port device connected to the switch. After the dual-network connection of the dual-port devices is established, each dual-port device can transmit its IP address to the switch via its network port, allowing the switch to locate the dual-port device based on the IP address.
[0082] In multiple dual-port device scenarios, by utilizing the factory default dual-network isolation and the daisy-chain networking method, dual networks can be connected after automatic IP configuration. This ensures that the IPs of adjacent dual-port devices that have completed automatic configuration are continuous, and the range of continuous IP addresses can be customized, reducing a significant amount of manpower wastage.
[0083] The technical solution provided in this application embodiment obtains the address of the protocol to be configured, then configures the first network port address of the current dual-port device based on the address of the protocol to be configured, obtaining the first network port configuration address of the current dual-port device. Next, the first network port configuration address of the current dual-port device is modified to obtain the modified address of the protocol to be configured. Based on the first network port configuration address of the current dual-port device, the modified address of the protocol to be configured for the next dual-port device is determined. The modified address of the protocol to be configured for the next dual-port device is then sent to the first network port of the next dual-port device through the second network port of the current dual-port device. If a notification message is received from the next dual-port device, the second network port address of the current dual-port device is configured based on the first network port configuration address of the current dual-port device, obtaining the second network port configuration address of the current dual-port device. By implementing this technical solution, the protocols of multiple dual-port devices can be configured sequentially and as required, reducing a significant amount of manpower wastage.
[0084] Example 3
[0085] Figure 4 This is a schematic diagram of the protocol configuration device for the dual-port device provided in Embodiment 3 of this application, as shown below. Figure 4 As shown, the protocol configuration device for a dual-port network device includes:
[0086] The module 410 for obtaining the address of the protocol to be configured is used to obtain the address of the protocol to be configured.
[0087] The module 420 for obtaining the first network port configuration address of the current dual-port device is used to configure the first network port address of the current dual-port device according to the protocol address to be configured, so as to obtain the first network port configuration address of the current dual-port device.
[0088] The module 430 for obtaining the second network port configuration address of the current dual-network port device is used to configure the second network port address of the current dual-network port device based on the first network port configuration address of the current dual-network port device if a notification message is received, so as to obtain the second network port configuration address of the current dual-network port device; wherein, the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified protocol address to be configured.
[0089] In this technical solution, optionally, the protocol address acquisition module 410 to be configured includes:
[0090] The protocol address to be configured unit is used to obtain the protocol address to be configured from the second network port of the previous dual-network port device through the first network port of the current dual-network port device.
[0091] The protocol address to be configured is determined by the preceding dual-port device based on the first port configuration address of the preceding dual-port device.
[0092] Optionally, in this technical solution, the device further includes:
[0093] The module for obtaining the modified protocol address to be configured is used to determine the modified protocol address to be configured for the next dual-port device based on the configuration address of the first port of the current dual-port device.
[0094] The modified protocol address sending module is used to send the modified protocol address to be configured of the next dual-port device to the first port of the next dual-port device through the second port of the current dual-port device.
[0095] In this technical solution, optionally, the module for obtaining the modified protocol address to be configured is specifically used for:
[0096] According to the preset protocol address order, adjust the data part of the configuration address of the first network port of the current dual-port device to obtain the modified protocol address to be configured for the next dual-port device.
[0097] In this technical solution, the optional modified protocol address sending module is specifically used for:
[0098] Adjust the default address of the second network port of the current dual-port device to obtain the virtual address of the second network port of the current dual-port device; wherein, the virtual address of the second network port of the current dual-port device and the default address of the second network port of the current dual-port device belong to the same network segment;
[0099] Using the virtual address of the second network port of the current dual-port device, the modified protocol address to be configured for the next dual-port device is sent to the first network port of the next dual-port device.
[0100] In this technical solution, optionally, the second network port configuration address of the current dual-port device is obtained by module 430, specifically for:
[0101] Clear the virtual address of the second network port of the current dual-port device, control the first and second network ports of the current dual-port device to be in the on state, and configure the address of the second network port of the current dual-port device based on the configuration address of the first network port of the current dual-port device, and determine the configuration address of the second network port of the current dual-port device.
[0102] In this technical solution, optionally, the protocol address acquisition module 410 to be configured also includes:
[0103] The unit for obtaining the protocol address to be configured is used to obtain the protocol address to be configured through the first network port of the current dual-port device when the current dual-port device is the first device.
[0104] The protocol address to be configured is determined by a preset starting protocol address.
[0105] The above-mentioned products can perform the methods provided in the embodiments of this application, and have the corresponding functional modules and beneficial effects of performing the methods.
[0106] Example 4
[0107] This application also provides a medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a protocol configuration method for a dual-port device, the method comprising:
[0108] Get the address of the protocol to be configured;
[0109] Based on the protocol address to be configured, the first network port address of the current dual-port device is configured to obtain the first network port configuration address of the current dual-port device;
[0110] If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device to obtain the second network port configuration address of the current dual-network port device; wherein, the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified protocol address to be configured.
[0111] Media – any type of memory device or storage device. The term “media” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Media may also include other types of memory or combinations thereof. Additionally, media may reside in the computer system in which the program is executed, or may reside in a different second computer system connected to the computer system via a network (such as the Internet). The second computer system may provide program instructions to the computer for execution. The term “media” may include two or more media that may reside in different locations (e.g., in different computer systems connected via a network). Media may store program instructions (e.g., specifically implemented as a computer program) that can be executed by one or more processors.
[0112] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the protocol configuration operations of the dual-port device as described above, but can also execute related operations in the protocol configuration method of the dual-port device provided in any embodiment of this application.
[0113] Example 5
[0114] This application provides an electronic device that can integrate the protocol configuration device of the dual-port device provided in this application. Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of this application. Figure 5 As shown, this embodiment provides an electronic device 500, which includes: one or more processors 520; and a storage device 510 for storing one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the protocol configuration method for the dual-port device provided in this application embodiment. The method includes:
[0115] Get the address of the protocol to be configured;
[0116] Based on the protocol address to be configured, the first network port address of the current dual-port device is configured to obtain the first network port configuration address of the current dual-port device;
[0117] If a notification message is received, the second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device to obtain the second network port configuration address of the current dual-network port device; wherein, the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified protocol address to be configured.
[0118] Of course, those skilled in the art will understand that the processor 520 also implements the technical solution of the protocol configuration method for dual-port devices provided in any embodiment of this application.
[0119] Figure 5 The electronic device 500 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0120] like Figure 5 As shown, the electronic device 500 includes a processor 520, a storage device 510, an input device 530, and an output device 540; the number of processors 520 in the electronic device can be one or more. Figure 5 Taking a processor 520 as an example; the processor 520, storage device 510, input device 530, and output device 540 in the electronic device can be connected via a bus or other means. Figure 5 Taking the connection via bus 550 as an example.
[0121] The storage device 510, as a computer-readable medium, can be used to store software programs, computer-executable programs, and module units, such as the program instructions corresponding to the protocol configuration method of the dual-port device in the embodiments of this application.
[0122] Storage device 510 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on terminal usage. Furthermore, storage device 510 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, storage device 510 may further include memory remotely located relative to processor 520, and these remote memories can be connected via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0123] Input device 530 can be used to receive input digital, character, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 540 may include electronic devices such as a display screen and a speaker.
[0124] The electronic device provided in this application embodiment can achieve the goal of configuring protocols of multiple devices in sequence and as required, thereby reducing a lot of manpower waste.
[0125] The protocol configuration device, medium, and electronic device for dual-port devices provided in the above embodiments can execute the protocol configuration method for dual-port devices provided in any embodiment of this application, and have the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in the above embodiments can be found in the protocol configuration method for dual-port devices provided in any embodiment of this application.
[0126] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. A protocol configuration method of a dual-homed device, characterized by, Each dual-network port device is connected through a hand-in-hand networking mode; the method comprises: Obtaining a to-be-configured protocol address; According to the to-be-configured protocol address, a first network port address of the current dual-network port device is configured to obtain a first network port configuration address of the current dual-network port device; If a notification message is received, a second network port address of the current dual-network port device is configured based on the first network port configuration address of the current dual-network port device to obtain a second network port configuration address of the current dual-network port device; wherein the notification message is generated and sent to the current dual-network port device by the next dual-network port device after receiving the modified to-be-configured protocol address.
2. The method of claim 1, wherein, Obtaining a to-be-configured protocol address comprises: In the case that the current dual-network port device is not the first device, the to-be-configured protocol address is obtained from the second network port of the previous dual-network port device through the first network port of the current dual-network port device; Wherein, the to-be-configured protocol address is determined by the previous dual-network port device according to the first network port configuration address of the previous dual-network port device.
3. The method of claim 1, wherein, After configuring the first network port address of the current dual-network port device to obtain the first network port configuration address of the current dual-network port device, the method further comprises: According to the first network port configuration address of the current dual-network port device, the modified to-be-configured protocol address of the next dual-network port device is determined; The modified to-be-configured protocol address of the next dual-network port device is sent to the first network port of the next dual-network port device through the second network port of the current dual-network port device.
4. The method of claim 3, wherein, According to the first network port configuration address of the current dual-network port device, the modified to-be-configured protocol address of the next dual-network port device is determined, comprising: According to the preset protocol address order, the data part of the first network port configuration address of the current dual-network port device is adjusted to obtain the modified to-be-configured protocol address of the next dual-network port device.
5. The method of claim 3, wherein, The modified to-be-configured protocol address of the next dual-network port device is sent to the first network port of the next dual-network port device through the second network port of the current dual-network port device, comprising: Adjusting the default address of the second network port of the current dual-network port device to obtain the virtual address of the second network port of the current dual-network port device; wherein the virtual address of the second network port of the current dual-network port device and the default address of the second network port of the current dual-network port device belong to the same network segment; The modified to-be-configured protocol address of the next dual-network port device is sent to the first network port of the next dual-network port device through the virtual address of the second network port of the current dual-network port device.
6. The method of claim 5, wherein, Based on the first network port configuration address of the current dual-network port device, the second network port address of the current dual-network port device is configured to obtain the second network port configuration address of the current dual-network port device, comprising: Clearing the virtual address of the second network port of the current dual-network port device, controlling the first network port and the second network port of the current dual-network port device to be in a conducting state, and configuring the second network port address of the current dual-network port device based on the first network port configuration address of the current dual-network port device to determine the second network port configuration address of the current dual-network port device.
7. The method of claim 1, wherein, Obtaining a to-be-configured protocol address further comprises: In the case that the current dual-network port device is the first device, the to-be-configured protocol address is obtained through the first network port of the current dual-network port device. The to-be-configured protocol address is determined by a preset starting protocol address.
8. A protocol configuration apparatus of a dual-homed device, characterized by comprising: Each dual-network port device is connected through a hand-in-hand networking mode; the device comprises: a to-be-configured protocol address obtaining module, configured to obtain a to-be-configured protocol address; a first network port configuration address obtaining module of the current dual-network port device, configured to configure a first network port address of the current dual-network port device according to the to-be-configured protocol address, and obtain a first network port configuration address of the current dual-network port device; a second network port configuration address obtaining module of the current dual-network port device, configured to, if a notification message is received, configure a second network port address of the current dual-network port device based on the first network port configuration address of the current dual-network port device, and obtain a second network port configuration address of the current dual-network port device; wherein the notification message is generated and sent to the current dual-network port device after the next dual-network port device receives the modified to-be-configured protocol address.
9. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the protocol configuration method of the dual-network port device according to any one of claims 1-7.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the protocol configuration method of the dual-network port device according to any one of claims 1-7.
Citation Information
Patent Citations
Ethernet switchboard high temperature ageing real-time monitoring method and system
CN101247290A
Self-organized network system composed of two-stage IP of parking lot
CN109102576A