CN115051973B - Method and device for establishing equipment internal communication - Google Patents

Method and device for establishing equipment internal communication Download PDF

Info

Publication number
CN115051973B
CN115051973B CN202210439480.6A CN202210439480A CN115051973B CN 115051973 B CN115051973 B CN 115051973B CN 202210439480 A CN202210439480 A CN 202210439480A CN 115051973 B CN115051973 B CN 115051973B
Authority
CN
China
Prior art keywords
subsystem
subsystems
address
message
default
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210439480.6A
Other languages
Chinese (zh)
Other versions
CN115051973A (en
Inventor
李香林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202210439480.6A priority Critical patent/CN115051973B/en
Publication of CN115051973A publication Critical patent/CN115051973A/en
Application granted granted Critical
Publication of CN115051973B publication Critical patent/CN115051973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3005Mechanisms for avoiding name conflicts

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method and a device for establishing equipment internal communication. The method comprises the following steps: after the equipment is powered on, configuring a default IP address for each subsystem, and closing an external network port of the equipment; a first subsystem of the plurality of subsystems sends a broadcast message to other subsystems of the plurality of subsystems through a default IP address, wherein the broadcast message carries information of the first subsystem and receives a reply message returned by the other subsystems; after determining that the first subsystem receives reply messages of all other subsystems, deleting a default IP address configured on each subsystem, and starting an external network port of the device; and the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message. The problem that subsystem cross-device connection and internal IP conflict of devices easily occur in the related technology can be solved.

Description

Method and device for establishing equipment internal communication
Technical Field
The present application relates to the field of communications, and in particular, to a method and an apparatus for establishing internal communications of a device.
Background
The device can be composed of a plurality of processors, and is also provided with a network port, and all the processors of the device can be connected through a network exchange chip.
When the device communicates with the outside through the network, an internet protocol (Internet Protocol, IP) address, which is typically an IP address of a host processor/System on Chip (SoC), must be required. As shown in fig. 1 (a) and 1 (b):
a) The main SoC can support double network cards, wherein one network card is directly outward, and the other network card is connected with other internal processors;
b) The main SoC can only have a single network card, and the external network port is also out of the internal exchange chip.
In a practical device manufacturing process, typically in a modular production, each hardware subsystem is produced independently, and finally assembled in a complete machine, fig. 2 is a possible modular production mode in the related art. As shown in fig. 2, when the hardware subsystem a (master SoC) of the master processor and the hardware subsystem B (slave SoC) are separately produced and assembled together, the cables related to communication are connected through the necessary cables, fig. 2 illustrates the cables related to communication, and in addition, the network switch chip may be on the system a, the system B, or the switch chip may be separately used as a single board card.
The subsystems are interconnected through a network, and each subsystem is provided with an independent network card, so that data exchange can be realized through an intermediate exchange chip. In network communication, a network IP address is used as a network identifier, if the network IP address needs to be linked with a counterpart, the IP address of the counterpart needs to be known, and the simplest mode is that each subsystem is fixed IP, for example, the fixed IP address of a subsystem A is 192.168.1.100, the fixed IP address of a subsystem B is 192.168.1.101, and the fixed IP address of a subsystem C is 192.168.1.102, so that after the device is started, each subsystem can communicate through the already agreed fixed IP address. However, if two identical devices are connected together and powered up at the same time, a cross-device subsystem connection may occur. As shown in fig. 3, when the device #1 and the device #2 are powered on simultaneously, all the systems are interconnected in the network, the subsystem C of the device #1 may be connected to the subsystem B of the device #2, especially when the power-on start speeds of the subsystems are inconsistent, such as when the device #1 is powered on first, and the connection between the subsystems of the device #1 is not problematic, at this time, the device #2 is started, because the start speeds of the subsystems of the device #2 are inconsistent, it is possible to connect the subsystem a of the device #2 to the subsystem C if the subsystem a of the device #2 is first, and the subsystem a is connected to the IP-192.168.1.102, which is possible to connect to the subsystem C of the device # 1. If there may be a plurality of such devices operating in a network environment at a project site, there is a very high probability that interconnections will occur across the device subsystems.
In addition, the external IP of the device may be modified by the user, and since the user does not know the working logic inside the device, when there is a fixed IP inside the device, if the user modifies the IP externally, the risk of collision with the internal IP easily occurs, for example, as shown in fig. 4, the user can see that the IP of the device #1 is 10.30.5.210 and the IP of the device #2 is 10.30.5.211 externally, and if the user modifies the IP of the device #1 and/or the device #2, the IP of the device #1 and/or the device #2 may be changed to 192.168.1.Xxx because the user does not know the implementation logic inside the device, and at this time, the modified IP of the device may collide with the internal IP.
Disclosure of Invention
The embodiment of the application provides a method and a device for establishing equipment internal communication, which are used for at least solving the problems that subsystem cross-equipment connection and equipment internal IP conflict are easy to occur in the related technology.
According to an embodiment of the present application, there is provided an apparatus internal communication establishment method, the apparatus including a plurality of subsystems connected through a network switching subsystem, the method including: after the equipment is powered on, configuring a default IP address for each subsystem, and closing an external network port of the equipment; a first subsystem of the plurality of subsystems sends a broadcast message to other subsystems of the plurality of subsystems through a default IP address, wherein the broadcast message carries information of the first subsystem and receives a reply message returned by the other subsystems; after determining that the first subsystem receives reply messages of all other subsystems, deleting a default IP address configured on each subsystem, and starting an external network port of the device; and the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message.
In an exemplary embodiment, the default IP address configured by each subsystem belongs to the same subnet.
In an exemplary embodiment, closing the external network port of the device includes: the first subsystem sends a first command to the network switching subsystem through the control bus, and the network switching subsystem closes an external network port according to the first command.
In one exemplary embodiment, before the first subsystem sends the first command to the network switching subsystem, the method includes: setting a default state of a power supply system of the network switching subsystem as a power-off state, and triggering power-on through a controller; or setting a working pin of the network switching chip, and switching the power supply system state of the network switching subsystem through an input level.
In an exemplary embodiment, after the first subsystem of the plurality of subsystems broadcasts the broadcast message to other subsystems of the plurality of subsystems through a default IP address, the method further comprises: each subsystem receiving the broadcast message stores the broadcast message and sends a reply message to the first subsystem in a unicast or broadcast mode, wherein the reply message carries information of the subsystem.
In an exemplary embodiment, the first subsystem receives reply messages returned by the other subsystems, including: if the first subsystem receives reply messages of all the second subsystems within a preset time period, the first subsystem finishes sending broadcast messages to the second subsystems; if the first subsystem fails to receive the reply messages of all the second subsystems within the preset duration, the first subsystem judges that the second subsystem which does not return the reply messages is abnormal in starting.
In an exemplary embodiment, after determining that the first subsystem receives reply messages of all other subsystems, the method further includes: and the first subsystem sends a confirmation message to other subsystems in an on-demand mode.
In an exemplary embodiment, after determining that the first subsystem receives reply messages from all other subsystems, deleting a default IP address configured on each subsystem, including: and deleting default IP addresses of other subsystems except the default IP address of the external subsystem, wherein the external subsystem is any subsystem in all subsystems.
Specifically, for example, the first subsystem sends a broadcast message a to other subsystems, the other subsystems reply messages B to the first subsystem after receiving the message a, the first subsystem replies a confirmation message C to the corresponding other subsystems according to the received message, each other subsystem deletes its own default IP after receiving the confirmation message C, and the first subsystem can delete its own default IP after collecting the information of the other subsystems.
In an exemplary embodiment, opening an external network port of the device includes: the first subsystem sends a second command to the network switching subsystem, and the network switching subsystem opens an external network port according to the second command.
In an exemplary embodiment, after the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message, the method further includes: and the application programs on the subsystems perform data interaction through socket communication.
In an exemplary embodiment, at least the broadcast message and the reply message include: message originator identification, message type, MAC address of message originator, or link local address.
According to another embodiment of the present application, there is provided an apparatus for establishing device internal communication, applied to a device including a plurality of subsystems, including: the configuration module is used for configuring a default IP address for each subsystem after the equipment is powered on, and closing an external network port of the equipment; the broadcasting module is used for sending a broadcasting message to other subsystems through a first subsystem in the plurality of subsystems based on a default IP address, wherein the broadcasting message carries information of the first subsystem and receives a reply message returned by the other subsystems; the deleting module is used for deleting the default IP address configured on each subsystem after the first subsystem receives the reply messages of all other subsystems, and opening an external network port of the equipment; and the communication module is used for carrying out internal communication with the other subsystems according to the link layer address carried in the reply message.
In one exemplary embodiment, further comprising: and the sending module is used for sending the confirmation message to the other subsystems in an on-demand mode after the first subsystem receives the reply messages of all the other subsystems.
According to still another embodiment of the present application, there is provided an apparatus for establishing device internal communication, applied to a second subsystem, including:
the reply module is used for continuously replying a reply message to the first subsystem through the default IP address until a second reply message of the first subsystem is received; and also for replying to the second subsystem information to the first subsystem in unicast or broadcast form.
According to a further embodiment of the application, there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In the above embodiment of the present application, each subsystem in the device communicates through a default IP address, and the obtained link layer address is used for internal communication of the device through the link layer address of the default IP address subsystem, so that the problem that the subsystem cross-device connection and the internal IP conflict of the device easily occur in the related art can be solved, and the effect of avoiding the address conflict generated during the internal communication of the device can be achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a schematic diagram showing the internal composition of a device according to the related art;
FIG. 2 is a schematic diagram of a modular production model in the related art;
FIG. 3 is a schematic diagram of a related art subsystem cross-device connection;
FIG. 4 is a schematic diagram of an internal IP collision in a related art device;
fig. 5 is a hardware block diagram of a computer terminal of a device internal communication establishment method according to an embodiment of the present application;
FIG. 6 is a flow chart of device internal communication setup according to an embodiment of the application;
fig. 7 is a block diagram of a structure of an apparatus for establishing internal communication of a device according to an embodiment of the present application;
FIG. 8 is a schematic view of the internal construction of an apparatus according to an embodiment of the present application;
FIG. 9 is a simplified schematic diagram of an internal system of a device according to an embodiment of the application;
FIG. 10 is a schematic diagram of the internal system components of the device according to an embodiment of the present application;
fig. 11 is a flowchart of a device internal communication establishment method according to an embodiment of the present application;
fig. 12 is a schematic diagram of a message structure according to an embodiment of the present application.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method according to the first embodiment of the present application may be implemented in a mobile terminal, a computer terminal or a similar computing device. Taking a computer terminal as an example, fig. 5 is a block diagram of a hardware structure of a computer terminal of a method for establishing internal communication of a device according to an embodiment of the present application. As shown in fig. 5, the computer terminal 50 may include one or more (only one is shown in fig. 5) processors 502 (the processor 502 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 504 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 508. It will be appreciated by those skilled in the art that the configuration shown in fig. 5 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal 50 may also include more or fewer components than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The memory 504 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a device internal communication establishing method in an embodiment of the present application, and the processor 502 executes the computer program stored in the memory 504 to perform various functional applications and data processing, that is, to implement the above-described method. Memory 504 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 504 may further comprise memory located remotely from the processor 502, which may be connected to the computer terminal 50 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.
The transmission means 506 is used to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 50. In one example, the transmission device 506 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 506 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, there is provided a method for establishing device internal communication running on the computer terminal, fig. 6 is a flowchart of device internal communication establishment according to an embodiment of the present application, as shown in fig. 6, the flowchart includes the following steps:
step S602, after the device is powered on, configuring a default IP address for each subsystem, and closing an external network port of the device;
specifically, in this embodiment, the first subsystem sends a first command to the network switching subsystem through the control bus, and the network switching subsystem closes the external network port according to the first command.
Before step S602 of this embodiment, a default state of a power supply system of the network switching subsystem may be set to a power-off state, and power-on is triggered by the controller; or setting a working pin of the network switching chip, and switching the power supply system state of the network switching subsystem through an input level.
In this embodiment, the default IP address configured by each subsystem belongs to the same subnet.
In step S604, a first subsystem in the multiple subsystems sends a broadcast message to other subsystems in the multiple subsystems through a default IP address, where the broadcast message carries information of the first subsystem, and receives a reply message returned by the other subsystems.
Specifically, for example, in step S604 of the present embodiment: the first subsystem continuously sends a broadcast message A to other subsystems until all other subsystem information is collected; each subsystem receiving the broadcast information A stores the broadcast information A and sends reply messages B1 and B2 … … Bn to the first subsystem in a unicast or broadcast mode, wherein the reply messages Bn carry information of each subsystem; after receiving the reply messages B1 and B2 … … Bn, the first subsystem replies a confirmation message C1 and C2 … … Cn to the corresponding other subsystems in an on-demand mode; in this embodiment, the other subsystem will periodically send the reply message Bn before receiving the acknowledgement message Cn, so as to ensure that the first subsystem can receive the reply message Bn.
In this embodiment, if the first subsystem receives reply messages Bn of all other systems within a preset duration, the first subsystem ends sending broadcast messages a to the other subsystems; if the first subsystem fails to receive the reply messages Bn of all other subsystems within the preset duration, the first subsystem judges that other subsystems which do not return the reply messages Bn are abnormal in starting.
Step S606, after determining that the first subsystem receives reply messages of all other subsystems, deleting a default IP address configured on each subsystem, and opening an external network port of the device;
specifically, for example, except for the default IP address that can be reserved for the external subsystem, the other subsystem stops sending Bn messages after receiving Cn messages, and deletes its own default IP; after the first subsystem collects the information, the first subsystem stops sending the broadcast message A and deletes the default IP of the first subsystem, wherein the external subsystem is any subsystem in all subsystems. In step S606 of this embodiment, the method may further include: the first subsystem sends a second command to the network switching subsystem, and the network switching subsystem opens an external network port according to the second command.
In step S608, the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message.
Specifically, after step S608 in this embodiment, it may further include: and the application programs on the subsystems perform data interaction through socket communication.
In an exemplary embodiment, at least the broadcast message and the reply message include: message originator identification, message type, MAC address of message originator, or link local address.
Through the steps, the device subsystems acquire the link layer address through a three-way handshake mechanism, and internal communication is performed according to the link layer address. Therefore, the problems of subsystem cross-device connection and internal IP conflict of the device in the related technology can be solved, and the effect of avoiding address conflict generated during internal communication of the device is achieved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiment also provides a device for establishing internal communication of a device, which is used for implementing the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 7 is a block diagram of a device internal communication establishing apparatus according to an embodiment of the present application, which is applied to a device including a plurality of subsystems, as shown in fig. 7, and which includes: configuration module 10, broadcast module 20, deletion module 30, and communication module 40.
The configuration module 10 is configured to configure a default IP address for each subsystem after the device is powered on, and close an external network port of the device;
a broadcasting module 20, configured to send a broadcast message to other subsystems through a first subsystem of the multiple subsystems based on a default IP address, where the broadcast message carries information of the first subsystem, and receive a reply message returned by the other subsystems;
a deleting module 30, configured to delete a default IP address configured on each subsystem after determining that the first subsystem receives reply messages of all other subsystems, and open an external network port of the device;
and the communication module 40 is configured to perform internal communication with the other subsystems according to the link layer address carried in the reply message.
And the sending module 50 is configured to send a confirmation message to the other subsystems in an on-demand manner after the first subsystem receives the reply messages of all the other subsystems.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
For the purpose of facilitating understanding of the technical solutions provided by the present application, the following detailed description will be made in connection with embodiments of specific scenarios
In the related art, the VLan dividing sub-network mode is generally adopted to solve the IP conflict or isolation between the internal network and the external network, and the method needs to adopt a network switching chip or a router chip to support the VLan function, so that the hardware cost is increased to a certain extent.
The application provides a whole internal communication mode without fixing an IP. Usually, applications communicate with each other by programming with socket, and data communication is performed by using TCP (Transmission Control Protocol ) or UDP (User Datagram Protocol, user packet protocol), while socket performs cross-system communication, and IP address is an identifier of a communication node, and if IP address is not fixed, it is necessary to know the IP addresses of all systems before resolving communication.
In the existing network switch chip, buses are configured, and in the hardware design, in order to enable the network switch chip to work, the network switch chip is connected with a processor chip, and a program on the processor can perform parameter configuration on the network switch chip. Fig. 8 is a schematic diagram illustrating an internal configuration of a device according to an embodiment of the present application, as shown in fig. 8, the subsystem a is connected by a control bus (for example, a two-wire serial (Inter-Integrated Circuit, I2C) bus, a serial peripheral interface (Serial Peripheral Interface, SPI) bus, or a universal asynchronous receiver Transmitter (Universal Asynchronous Receiver/Transmitter, UART) bus) through a cable connection during an assembly process. For simplicity, in this embodiment, two subsystems and an external network Port of a switch chip are illustrated, and an external device performs network communication with a complete device through a Port3 (Port 3), where an IP address of the subsystem a is an IP address of the complete device of the device.
On the selection of the network interaction chip, the enabling switch capable of controlling each Port individually is selected (i.e. most of the main flows are supported and configurable).
Fig. 9 is a simplified schematic diagram of an internal system of a device according to an embodiment of the present application, as shown in fig. 9, where one processor subsystem in the device is selected as a "controller", and the network switching subsystem may set a plurality of ports (for example, 6 ports are illustrated in this embodiment) according to a hardware option in the product, where one Port is used to communicate with the outside as a whole device, i.e., the selected P1 in fig. 9, and the other ports are connected to other processor subsystems in the device.
In the related art, each system participating in network communication needs to have a network card, where the network card has an IP address and an MAC address, the MAC address is globally unique, but IP addresses of all subsystems in the whole device cannot be fixed, and for network communication, it is necessary to sense IP addresses of each other under the condition that the IP addresses are not fixed.
In the network Address system of IPv6, IPv6 addresses are classified into three types, i.e., unicast addresses, anycast addresses (Anycast addresses), and multicast addresses. The IPv6 unicast address is divided into: global unicast addresses (public addresses like IPv 4), link local addresses and site local addresses (private network addresses like IPv 4).
The interface identifier in the IPv6 unicast address is used to identify a unique one of the interfaces on the link. Current IPv6 unicast addresses basically require an interface identifier of 64 bits. The interface identifier in IEEE EUI-64 format is translated from the link layer address (MAC address) of the interface.
Fig. 10 is a schematic diagram of an internal system of a device according to an embodiment of the present application, where the device is formed by a subsystem (e.g., A, B, C … …) and a network switching subsystem, and where a controller is provided on one of the subsystems, and the controller is a software module responsible for configuring parameters or commands to the network switching subsystem through a control bus, as shown in fig. 10. The subsystem including the controller may be any one of A, B, C … …, in this embodiment, subsystem a.
Fig. 11 is a flowchart of a device internal communication establishment method according to an embodiment of the present application, as shown in fig. 11, including the steps of:
step S1101, the whole device is powered on.
Specifically, before the whole equipment is powered on, a network switching subsystem is designed into a default non-working state through a hardware circuit;
a) The power supply system of the network switching subsystem can be designed, and the default is in a power-off state, so that the controller is required to trigger power on;
b) The configuration of the working pins of the network exchange chip can be realized, and the input level of the working signals is defaulted;
after the whole device is powered on, a default IP is configured for each subsystem (for example, A, B, C, … …), such as: 192.168.0.1, 192.168.0.2, 192.168.0.3, … …, wherein the default IP for each subsystem is in the same subnet;
in step S1102, after the device is powered on, the controller sends a command or a configuration parameter to the network switching subsystem through the control bus, so as to close the external network port.
Specifically, if the network switching subsystem is designed to be in a default unpowered state, after the whole equipment is powered on, the network subsystem is powered on through a trigger signal. When the network switching subsystem receives the command or parameter, it closes the external network Port (i.e., port #1 in the above embodiment).
In step S1103, the subsystem a sends a broadcast message and self information, where the self information includes: system number and link address.
Specifically, the subsystem a (i.e., the subsystem in which the controller is located) first performs timing broadcast through IPv 4. In this embodiment, a duration, such as 1 minute for a scheduled broadcast, may be set, with each broadcast sent for 2 seconds, to ensure that there is ample time for other subsystems (i.e., B, C, … …) to receive broadcast information from subsystem a after normal start-up.
In step S1104, the other subsystems reply to the acknowledgement character (Acknowledge character, ACK) message and their own information, where their own information includes: system number and link address.
Specifically, after receiving the broadcast message from the subsystem a, the other subsystems may send their own information in the form of unicast reply or broadcast, in this embodiment, may be selected according to product needs, for example, if the other subsystems need to communicate with each other, a broadcast manner may be adopted, otherwise, unicast reply may be adopted, so as to reduce the number of messages in the network environment, and in this embodiment, since the number of devices is not very large and the frequency is not very high, unicast or multicast reply may be adopted.
In step S1105, the subsystem a transmits an acknowledgement message to the other subsystems.
Specifically, subsystem a starts to accept message replies from other subsystems while sending broadcast messages. In order to enable other subsystems to determine that subsystem a has received its own reply message, subsystem a single-points an acknowledgment message to each other subsystem that has received the reply.
In this embodiment, before the other subsystem does not receive the acknowledgement message from the subsystem a, it needs to continuously reply to the a with the acknowledgement message until it receives the acknowledgement message from the subsystem a, and then exit the link, and delete its default IPv4 address;
in this embodiment, the subsystem a may store the message reply from the other subsystems;
in this embodiment, if the subsystem a receives the message replies from all other subsystems within a preset time (for example, the preset time lasts for 1 minute), the sending of the broadcast message may be finished in advance; if the subsystem fails to collect the information of all other subsystems within the preset time, the subsystem A judges that the other subsystems are abnormal in starting. In this embodiment, whether the current device is started normally or if necessary, a prompt message may be determined according to whether the importance of the subsystem that is not received affects the normal operation of the complete device.
In this embodiment, after the subsystem a collects the information of all the subsystems or if it is confirmed that the information of an individual subsystem is missing and does not affect the normal operation of the device, the subsystem a deletes the Ipv4 address used by itself during broadcasting.
In this embodiment, except for the external subsystem of the complete machine equipment, which may be any one of subsystem a or other subsystems, the external IP address is reserved, and other IPv4 addresses are deleted.
In step S1106, the subsystem a sends a command or a configuration parameter to the network switching subsystem, and opens the external network port, so that the external network path of the complete machine is enabled to be opened.
In this embodiment, the information collected by the subsystem a includes the link layer address (i.e., the interface identifier in IEEE EUI-64 format) of each subsystem, where the link layer address is an IPv6 address, and finally, the subsystems use IPv6 for internal communication through socket communication.
An embodiment of the present application further provides a message structure, and fig. 12 is a schematic diagram of the message structure according to an embodiment of the present application, as shown in fig. 12, where the message structure includes:
Sub-System ID: for identifying which subsystem (A, B, C, … …) is issued;
message Type: for identifying message type
Specifically, 0: a subsystem A initiatively initiates a message; 1: ACK messages replied by other subsystems; 2: the subsystem A receives the confirmation message after replying the message;
message Payload: either directly or MAC addresses (because MAC addresses can be converted to link addresses), or ultimately used or link addresses.
The method for solving the conflict between the internal communication and the external communication of the equipment provided by the embodiment of the application has the following characteristics:
1. the inside adopts a network switch chip or a router chip to connect the multiple systems, and adopts a mode of non-fixed IP address to carry out socket data communication;
and the whole is used for carrying out data interaction with the outside of the equipment by taking one of the processor subsystems as a main system.
2. Under the condition that the IP addresses are not fixed and the IP addresses of all the subsystems are unknown, the information of the subsystems is published by adopting a broadcasting mode.
3. In order to prevent cross-device information from being propagated in the information broadcasting process, thereby causing cross-device information to be collected, in this embodiment, a hardware circuit design scheme is proposed, namely: the network switching subsystem defaults to be inoperative until the network switching subsystem does not receive the command or parameter sent by the control subsystem, at least the network hardware interface of the whole machine is inoperative.
4. In order to ensure that the data can be received during the broadcast process, in this embodiment, it is proposed that each subsystem is required to default to a different IPv4 address of the same network segment each time it is powered on.
5. In order to enable the network switching subsystem to be controlled, a control subsystem is provided to enable the output of control information so that the switching state of the ports of the network switching subsystem can be controlled.
6. In order to ensure that each subsystem starts information broadcasting after the network switching chip closes the external network hardware interface, in this embodiment, it is proposed that the control subsystem is required to be an active initiator, and information broadcasting is initiated after the network switching subsystem closes the external network interface.
7. In order to ensure that the control subsystem can completely collect all other subsystem information to be collected in the whole broadcasting information process, in this embodiment, a "three-way handshake" mechanism of the message is provided: the control subsystem actively initiates the broadcast message, the other subsystems reply the message after receiving the broadcast message, and the control subsystem sends a confirmation message after receiving the reply message of the other subsystems. The three-way handshake adopts a combination mode of broadcasting, unicasting and self-defining message content, and is different from a link establishment process of a TCP/IP bottom layer.
8. In order to enable the information of each subsystem to be perceived in the broadcasting process, a message structure is designed, and the message at least comprises: the identity of the originator of the message, the type of message, the MAC Address of the originator of the message, or the Link-local Address (Link).
9. In order to solve the problem that the use of the IPv4 address may conflict with the IP outside the device, in this embodiment, it is proposed that the IPv4 address used in broadcasting be cleared after the information collection is completed.
10. In order to solve the problem of adopting TCP/IP communication and programming by using a socket mode, in the embodiment, the socket communication is proposed to be carried out by adopting an IPv6 address mode, so that application programs on each subsystem can carry out data interaction through the socket communication.
11. In order to solve the problem that the IPv6 address communication can also face address conflict existing in the IPv4 address communication, in the embodiment, a local Link address (Link-local address) is provided and selected, the address ensures that the globally unique local Link address (Link-local address) can be converted through the MAC address on the premise that the MAC address is globally unique, and data interaction can be carried out by application programs on subsequent subsystems through socket communication.
12. In order to solve the problem of external network communication of the whole machine of the equipment, after each subsystem senses the IPv6 link local addresses of each other in the equipment, a control subsystem sends a command to enable a network switching subsystem to open an external network interface of the whole machine.
An embodiment of the application also provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. A method of establishing internal communication of a device, the device comprising a plurality of subsystems, the plurality of subsystems being connected by a network switching subsystem, the method comprising:
after the equipment is powered on, configuring a default IP address for each subsystem, and closing an external network port of the equipment;
a first subsystem of the plurality of subsystems sends a broadcast message to other subsystems of the plurality of subsystems through the default IP address, wherein the broadcast message carries information of the first subsystem and receives a reply message returned by the other subsystems;
after determining that the first subsystem receives reply messages of all other subsystems, deleting the default IP address configured on each subsystem, and starting an external network port of the device;
and the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message.
2. The method of claim 1, wherein the default IP address for each of the subsystem configurations belongs to the same subnet.
3. The method of claim 1, wherein closing an external network port of the device comprises:
the first subsystem sends a first command to the network switching subsystem through the control bus, and the network switching subsystem closes an external network port according to the first command.
4. A method according to claim 3, wherein before the first subsystem sends the first command to the network switching subsystem, comprising:
setting a default state of a power supply system of the network switching subsystem to be a power-off state, and triggering the power-on of the network switching subsystem through a controller after receiving the first command; or alternatively, the first and second heat exchangers may be,
setting a working pin of a network switching chip, and switching the state of a power supply system of the network switching subsystem through an input level.
5. The method of claim 1, wherein after a first subsystem of the plurality of subsystems sends a broadcast message to other subsystems of the plurality of subsystems via a default IP address, further comprising:
each subsystem receiving the broadcast message stores the broadcast message and sends a reply message to the first subsystem in a unicast or broadcast mode, wherein the reply message carries information of the subsystem.
6. The method of claim 1, the first subsystem receiving a reply message returned by the other subsystem, comprising:
if the first subsystem receives reply messages of all the second subsystems within a preset time period, the first subsystem finishes sending broadcast messages to the second subsystems;
if the first subsystem fails to receive the reply messages of all the second subsystems within the preset duration, the first subsystem judges that the second subsystem which does not return the reply messages is abnormal in starting.
7. The method of claim 1, further comprising, upon determining that the first subsystem received reply messages for all other subsystems:
and the first subsystem sends a confirmation message to other subsystems in an on-demand mode.
8. The method of claim 1, wherein deleting the default IP address configured on each of the subsystems after determining that the first subsystem received reply messages for all other subsystems comprises:
and deleting default IP addresses of other subsystems except the default IP address of the external subsystem, wherein the external subsystem is any subsystem in all subsystems.
9. The method of claim 1, wherein opening an external network port of the device comprises:
the first subsystem sends a second command to the network switching subsystem, and the network switching subsystem opens an external network port according to the second command.
10. The method of claim 1, after the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message, further comprising:
and the application programs on the subsystems perform data interaction through socket communication.
11. The method according to any one of claims 1-10, wherein at least the broadcast message and the reply message include: message originator identification, message type, MAC address of message originator, or link local address.
12. An apparatus for establishing internal communication of a device, which is applied to a device including a plurality of subsystems, comprising:
the configuration module is used for configuring a default IP address for each subsystem after the equipment is powered on, and closing an external network port of the equipment;
the broadcasting module is used for sending a broadcasting message to other subsystems through a first subsystem in the plurality of subsystems based on the default IP address, wherein the broadcasting message carries information of the first subsystem and receives a reply message returned by the other subsystems;
the deleting module is used for deleting the default IP address configured on each subsystem after the first subsystem is determined to receive the reply messages of all other subsystems, and opening an external network port of the device;
and the communication module is used for carrying out internal communication with the other subsystems according to the link layer address carried in the reply message.
13. The apparatus as recited in claim 12, further comprising:
and the sending module is used for sending the confirmation message to the other subsystems in an on-demand mode after the first subsystem receives the reply messages of all the other subsystems.
14. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program, wherein the computer program is arranged to perform the method of any of the claims 1 to 11 when run.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 11.
CN202210439480.6A 2022-04-25 2022-04-25 Method and device for establishing equipment internal communication Active CN115051973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210439480.6A CN115051973B (en) 2022-04-25 2022-04-25 Method and device for establishing equipment internal communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210439480.6A CN115051973B (en) 2022-04-25 2022-04-25 Method and device for establishing equipment internal communication

Publications (2)

Publication Number Publication Date
CN115051973A CN115051973A (en) 2022-09-13
CN115051973B true CN115051973B (en) 2023-10-20

Family

ID=83157478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210439480.6A Active CN115051973B (en) 2022-04-25 2022-04-25 Method and device for establishing equipment internal communication

Country Status (1)

Country Link
CN (1) CN115051973B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1505334A (en) * 2002-12-04 2004-06-16 联想(北京)有限公司 Dynamic resolution method of a single IP address multiple hardware address
KR20040083266A (en) * 2003-03-21 2004-10-01 홍은영 Internet communication system using symbiosis of internet proptocol address
KR20060027576A (en) * 2004-09-23 2006-03-28 주식회사 케이티 Method of constructing the link connection information among network switches
CN101656725A (en) * 2009-09-24 2010-02-24 杭州华三通信技术有限公司 Method for implementing safety access and access equipment
KR101037477B1 (en) * 2009-11-30 2011-05-26 주식회사 케이티 Method of ipv6 address configuration independent of the existence of gateway
CN102546849A (en) * 2010-12-30 2012-07-04 华为技术有限公司 Detection method for IP (Internet Protocol) address conflict and network equipment
JP2013236205A (en) * 2012-05-08 2013-11-21 Toyota Industries Corp Charging control information communication system and method
CN104158917A (en) * 2013-05-14 2014-11-19 杭州华三通信技术有限公司 Method and device for recovering IP (Internet protocol) address of DHCP (dynamic host configuration protocol) client
CN108632198A (en) * 2017-03-15 2018-10-09 杭州海康威视数字技术股份有限公司 A kind of device management method and device
CN108718280A (en) * 2018-08-30 2018-10-30 新华三技术有限公司 A kind of message forwarding method and device
CN111277436A (en) * 2020-01-17 2020-06-12 深信服科技股份有限公司 Equipment state switching method and device, electronic equipment and storage medium
CN111404821A (en) * 2019-01-02 2020-07-10 国家电网公司 IPv4 and IPv6 interconnection system based on SDN

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9438555B2 (en) * 2013-10-31 2016-09-06 Aruba Networks, Inc. Communicating with a distribution system via an uplink access point
RU2019113321A (en) * 2019-04-30 2020-11-02 ИЭмСи АйПи ХОЛДИНГ КОМПАНИ, ЛЛС SYSTEMS AND METHODS FOR AUXILIARY NETWORK DETECTION FOR CLUSTER SYSTEMS BASED ON ZERO CONFIGURATION

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1505334A (en) * 2002-12-04 2004-06-16 联想(北京)有限公司 Dynamic resolution method of a single IP address multiple hardware address
KR20040083266A (en) * 2003-03-21 2004-10-01 홍은영 Internet communication system using symbiosis of internet proptocol address
KR20060027576A (en) * 2004-09-23 2006-03-28 주식회사 케이티 Method of constructing the link connection information among network switches
CN101656725A (en) * 2009-09-24 2010-02-24 杭州华三通信技术有限公司 Method for implementing safety access and access equipment
KR101037477B1 (en) * 2009-11-30 2011-05-26 주식회사 케이티 Method of ipv6 address configuration independent of the existence of gateway
CN102546849A (en) * 2010-12-30 2012-07-04 华为技术有限公司 Detection method for IP (Internet Protocol) address conflict and network equipment
JP2013236205A (en) * 2012-05-08 2013-11-21 Toyota Industries Corp Charging control information communication system and method
CN104158917A (en) * 2013-05-14 2014-11-19 杭州华三通信技术有限公司 Method and device for recovering IP (Internet protocol) address of DHCP (dynamic host configuration protocol) client
CN108632198A (en) * 2017-03-15 2018-10-09 杭州海康威视数字技术股份有限公司 A kind of device management method and device
CN108718280A (en) * 2018-08-30 2018-10-30 新华三技术有限公司 A kind of message forwarding method and device
CN111404821A (en) * 2019-01-02 2020-07-10 国家电网公司 IPv4 and IPv6 interconnection system based on SDN
CN111277436A (en) * 2020-01-17 2020-06-12 深信服科技股份有限公司 Equipment state switching method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
党永娟,王成国.局域网内IP地址盗用和防范技术研究.青海科技.2004,(第03期),全文. *
胡力卫 ; 单冉冉 ; 唐勇 ; 汪文勇 ; .基于SDN的IPv4与IPv6互联技术研究.中国教育网络.2018,(第Z1期),全文. *

Also Published As

Publication number Publication date
CN115051973A (en) 2022-09-13

Similar Documents

Publication Publication Date Title
US20100080206A1 (en) Autoconfiguration system for wireless sensor network and its method, and gateway apparatus for wireless sensor network
US9455866B2 (en) Auto-configuration of network devices
CN1713616A (en) Packet transfer apparatus
CN106878488A (en) A kind of Modbus RTU bus address auto-allocation methods
CN107769939B (en) Network element management method, network management, gateway network element and system in data communication network
CN110505316A (en) The distribution method and wireless routing device of internet protocol address
CN1663221B (en) Architecture for emulating an Ethernet network interface card
CN101485141B (en) Method and system for two-phase mechanism for discovering web services based on management service
CN106506717A (en) A kind of automatic discovering method and equipment
EP1887756A2 (en) Communication system, connection adapter for communication device, and network router
JP2003078535A (en) Mac address managing method in wireless lan, mac address managing program for wireless lan, recording medium with the same program recorded, fixed station for wireless lan and wireless lan system
CN115051973B (en) Method and device for establishing equipment internal communication
CN111163463B (en) Method, device, equipment and storage medium for wireless equipment to access router
CN112995038B (en) Access method of PROFINET protocol in industrial SDN
WO2018006684A1 (en) Message processing method and device, and router
WO2023134338A1 (en) Communication method and apparatuses
CN112055341B (en) Networking method, device and equipment of low-power-consumption Bluetooth Mesh network
CN208015725U (en) Multi-line system
CN104468159A (en) Management method and device of dynamic host configuration protocol server and relay
CN111866856A (en) Mesh device control method and system, storage medium and electronic device
WO2012155571A1 (en) Base station self-configuration method and device
CN112994932B (en) Automatic configuration method and device for network parameters of equipment in local area network and equipment
JP2007096539A (en) Conversion apparatus
CN116018785A (en) Method for operating a network
CN114080002A (en) System and method for realizing batch automatic networking of ZigBee devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant