CN115051973A - Method and device for establishing internal communication of equipment - Google Patents

Method and device for establishing internal communication of equipment Download PDF

Info

Publication number
CN115051973A
CN115051973A CN202210439480.6A CN202210439480A CN115051973A CN 115051973 A CN115051973 A CN 115051973A CN 202210439480 A CN202210439480 A CN 202210439480A CN 115051973 A CN115051973 A CN 115051973A
Authority
CN
China
Prior art keywords
subsystem
subsystems
address
default
message
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.)
Granted
Application number
CN202210439480.6A
Other languages
Chinese (zh)
Other versions
CN115051973B (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

Images

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 invention provides a method and a device for establishing internal communication of equipment. 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 in the subsystems sends a broadcast message to other subsystems in the subsystems through a default IP address, wherein the broadcast message carries the information of the first subsystem, and receives reply messages returned by the other subsystems; after determining that the first subsystem receives the reply messages of all other subsystems, deleting the default IP address configured on each subsystem, and opening an external network port of the equipment; and the first subsystem carries out internal communication with the other subsystems according to the link layer address carried in the received reply message. The problem that cross-device connection of subsystems and IP conflict inside devices are easy to occur in the related technology can be solved.

Description

Method and device for establishing internal communication of equipment
Technical Field
The invention relates to the field of communication, in particular to a method and a device for establishing internal communication of equipment.
Background
One 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 switching chip.
When a device communicates with the outside through a network, an Internet Protocol (IP) address, which is generally an IP address of a main processor/main System on Chip (SoC), is necessarily 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 processors inside;
b) the main SoC can only have a single network card, and the external network port is also led out from the internal exchange chip.
In the actual device manufacturing process, which is usually a modular production process, each hardware subsystem is produced independently, and finally, the complete machine assembly is performed, and fig. 2 is a possible modular production mode in the related art. As shown in fig. 2, a hardware subsystem a (master SoC) for separately producing a master processor and a hardware subsystem B (slave SoC) for separately producing a master processor are connected to each other through necessary cables during assembly of the whole device, and fig. 2 illustrates cables related to communication, and in addition, a network switching chip may be on the system a, or on the system B, or the switching chip may be separately provided as a single board.
The subsystems are interconnected through a network, and each subsystem is provided with an independent network card which can realize data exchange through an intermediate exchange chip. In network communication, a network IP address is used as a network identifier, if the network identifier needs to be linked with an opposite party, the IP address of the opposite party needs to be known, and the simplest way is that each subsystem fixes an IP, for example, the fixed IP address of the subsystem a is 192.168.1.100, the fixed IP of the subsystem B is 192.168.1.101, and the fixed IP of the subsystem C is 192.168.1.102, so that after the device is started, each subsystem can communicate through the fixed IP address which has been agreed. However, if two identical devices are brought together and powered up at the same time, a cross-device subsystem connection may occur. As shown in fig. 3, the device #1 and the device #2 are powered on simultaneously, 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 starting speeds of the subsystems are not consistent, for example, the device #1 is powered on first, it is not problematic to establish a connection between the subsystems of the device #1, at this time, the device #2 is started, and since the power-on starting speeds of the subsystems of the device #2 are not consistent, it is possible to connect the subsystem a to the IP-192.168.1.102, assuming that the subsystem a of the device #2 is powered on first and the subsystem C is not yet. If multiple such devices are likely to operate in a network environment at a project site, there is a very high probability that interconnection across device subsystems will occur.
In addition, the external IP of the device can be modified by the user, and since the user does not know the working logic inside the device, when the device has a fixed IP inside, if the user modifies the IP externally, the risk of collision with the internal IP is likely to occur, 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 or/and the device #2, since the implementation logic inside the device is not known, the IP of the device #1 or/and the device #2 may be modified to 192.168.1.xxx, and at this time, the modified IP of the device will collide with the internal IP.
Disclosure of Invention
The embodiment of the invention provides a method and a device for establishing equipment internal communication, which are used for at least solving the problems that cross-equipment connection of subsystems and IP conflict inside equipment are easy to occur in the related technology.
According to an embodiment of the present invention, there is provided an intra-device communication establishment method, the device 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 in the subsystems sends a broadcast message to other subsystems in the subsystems through a default IP address, wherein the broadcast message carries the information of the first subsystem, and receives reply messages returned by the other subsystems; after determining that the first subsystem receives the reply messages of all other subsystems, deleting the default IP address configured on each subsystem, and opening an external network port of the equipment; and the first subsystem carries out 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 an external network port of the device includes: the first subsystem sends a first command to a network switching subsystem through a 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 and powering on through a controller; or, setting a working pin of the network switching chip, and switching the state of the power supply system of the network switching subsystem through the 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 includes: and 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 the information of the subsystem.
In an exemplary embodiment, the receiving, by the first subsystem, the reply message returned by the other subsystem includes: if the first subsystem receives the reply messages of all the second subsystems within the preset time length, the first subsystem finishes sending the broadcast message to the second subsystems; and if the first subsystem fails to receive the reply messages of all the second subsystems within the preset time length, 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 the 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, deleting the default IP address configured on each subsystem after determining that the first subsystem receives the reply messages of all other subsystems includes: and except the default IP address of the external subsystem is reserved, deleting the default IP addresses of the other subsystems, wherein the external subsystem is any subsystem in all the subsystems.
Specifically, for example, the first subsystem sends a broadcast message a to other subsystems, the other subsystems respectively reply a message 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 information of the other subsystems.
In an exemplary embodiment, opening an external network port of the device includes: and 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 internally communicates 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 carry out data interaction through socket communication.
In an exemplary embodiment, the broadcast message and the reply message at least include: a message originator identification, a message type, a message originator's MAC address, or a link local address.
According to another embodiment of the present invention, there is provided an intra-device communication establishing apparatus applied to a device including a plurality of subsystems, including: a configuration module, 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; the broadcast module is used for sending broadcast messages to other subsystems through a first subsystem in the subsystems based on a default IP address, wherein the broadcast messages carry the information of the first subsystem, and receiving reply messages returned by the other subsystems; a deleting module, configured to delete the default IP address configured on each subsystem and open an external network port of the device after the first subsystem receives the reply messages of all other subsystems; 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 confirmation messages to other subsystems in an on-demand mode after the first subsystem receives the reply messages of all other subsystems.
According to another embodiment of the present invention, there is provided an intra-device communication establishing apparatus, 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 second subsystem information to the first subsystem in unicast or broadcast form.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, comprising a memory in which a computer program is stored and a processor configured to run the computer program to perform the steps of any of the method embodiments described above.
In the above embodiment of the present invention, each subsystem in the device communicates through the 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 problems of inter-device connection of the subsystems and IP collision inside the device in the related art are solved, and an effect of avoiding address collision generated during internal communication of the device is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic view showing the internal components of an apparatus according to the related art;
FIG. 2 is a schematic view of a modular production model in the related art;
FIG. 3 is a schematic diagram of a subsystem cross-device connection in the related art;
FIG. 4 is a diagram illustrating intra-device IP collision in the related art;
fig. 5 is a block diagram of a hardware configuration of a computer terminal of a device internal communication establishment method according to an embodiment of the present invention;
FIG. 6 is a flow chart of device internal communication establishment according to an embodiment of the present invention;
fig. 7 is a block diagram of a configuration of an apparatus internal communication establishing device according to an embodiment of the present invention;
FIG. 8 is a schematic view of the internal construction of an apparatus according to an embodiment of the present invention;
FIG. 9 is a simplified schematic diagram of a system within a device according to an embodiment of the invention;
FIG. 10 is a schematic diagram of the system components within the apparatus according to an embodiment of the invention;
fig. 11 is a flowchart of a device internal communication establishment method according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a message structure according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the drawings and embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of running on a computer terminal, fig. 5 is a hardware structure block diagram of a computer terminal of a device internal communication establishing method according to an embodiment of the present invention. As shown in fig. 5, the computer terminal 50 may include one or more processors 502 (only one is shown in fig. 5) (the processor 502 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 504 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 508. It will be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration and is not intended to limit the structure of the computer terminal. For example, 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 for storing computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the device internal communication establishing method in the embodiment of the present invention, and the processor 502 executes various functional applications and data processing by running the computer programs stored in the memory 504, so as to implement the method described above. The 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 include 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 device 506 is used for receiving or transmitting data via a network. 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 (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 506 can be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a device internal communication establishing method operating in the computer terminal is provided, and fig. 6 is a flowchart of device internal communication establishing according to an embodiment of the present invention, 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 in this embodiment, a default state of a power supply system of the network switching subsystem may be set to be a power-off state, and power-on is triggered by a controller; or, setting a working pin of the network switching chip, and switching the state of the power supply system of the network switching subsystem through the input level.
In this embodiment, the default IP address configured by each subsystem belongs to the same subnet.
Step S604, a first subsystem of the multiple subsystems sends a broadcast message to other subsystems of 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 broadcast messages A to other subsystems until all other subsystem information is collected; each subsystem receiving the broadcast information A stores the broadcast information A and respectively sends reply messages B1 and B2 … … Bn to the first subsystem in a unicast or broadcast mode, wherein the reply messages Bn carry the information of each subsystem; after receiving the reply messages B1 and B2 … … Bn, the first subsystem replies confirmation messages C1 and C2 … … Cn to the corresponding other subsystems in an on-demand mode; in this embodiment, the other subsystems send the reply message Bn periodically before the acknowledgement message Cn is not received to ensure that the first subsystem can receive the reply message Bn.
In this embodiment, if the first subsystem receives the reply messages Bn of all other systems within the preset time period, the first subsystem ends sending the broadcast message a to the other subsystems; if the first subsystem fails to receive the reply messages Bn of all other subsystems within the preset time length, the first subsystem judges that the other subsystems which do not return the reply messages Bn are abnormal in starting.
Step S606, after determining that the first subsystem receives the reply messages of all other subsystems, deleting the default IP address configured on each subsystem, and opening the external network port of the equipment;
specifically, for example, except for the external subsystem, the default IP address may be reserved, and after receiving the Cn message, the other subsystems stop sending the Bn message and delete their default IP; after the first subsystem collects all 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 one of all the subsystems. In step S606 of this embodiment, the method may further include: and 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.
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, the method may further include: and the application programs on the subsystems carry out data interaction through socket communication.
In an exemplary embodiment, the broadcast message and the reply message at least include: a message originator identification, a message type, a message originator's MAC address, or a link local address.
Through the steps, the link layer address is obtained among the equipment subsystems through a three-way handshake mechanism, and internal communication is carried out according to the link layer address. Therefore, the problem that cross-device connection of subsystems and IP conflict inside the device are easy to occur in the related technology can be solved, and the effect of avoiding address conflict generated during internal communication of the device can be achieved.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, an apparatus for establishing communication inside a device is further provided, where the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of the foregoing description are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an 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 invention, which is applied to a device including a plurality of subsystems, as shown in fig. 7, and includes: a configuration module 10, a broadcast module 20, a deletion module 30 and a communication module 40.
A configuration module 10, 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 broadcast 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 receives a reply message returned by the other subsystems;
a deleting module 30, configured to delete the default IP address configured on each subsystem and open an external network port of the device after determining that the first subsystem receives the reply messages of all other subsystems;
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.
A sending module 50, 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, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
In order to facilitate understanding of the technical solutions provided by the present invention, the following detailed description will be made with reference to embodiments of specific scenarios
In the related art, IP conflicts or isolations between the internal network and the external network are usually solved by dividing subnets by vlans, and in the method, a network switching chip or a router chip is required to support a VLan function, so that the hardware cost is increased to a certain extent.
The invention provides a complete machine internal communication mode without fixing an IP. Generally, the inter-communication of the application programs is implemented by programming using a socket, and data communication is implemented in a TCP (Transmission Control Protocol) or UDP (User Datagram Protocol) manner, while the socket performs cross-system communication, and an IP address is an identifier of a communication node.
The existing network switching chips are all configured with buses, in the hardware design, in order to enable the network switching chips to work, the network switching chips are connected with a processor chip, and a program on the processor configures parameters of the network switching chips. Fig. 8 is a schematic diagram of an internal structure of the device according to the embodiment of the present invention, and as shown in fig. 8, the subsystem a is connected by a cable plug in an assembling process through a control bus (e.g., a two-wire Serial (I2C) bus, a Serial Peripheral Interface (SPI) bus, or a Universal Asynchronous Receiver/Transmitter (UART) bus). For simplicity, in this embodiment, two subsystems and an external network Port of a switch chip are illustrated, and the external device performs network communication with the whole device through Port 3(Port3), where the IP address of the subsystem a is the IP address of the whole device.
In the network interaction chip, the selection can control the enabling switch of each Port individually (namely, most of the main stream supports the configurable).
Fig. 9 is a simplified schematic diagram of an internal system of a device according to an embodiment of the present invention, as shown in fig. 9, one processor subsystem in the selected device is used 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 hardware selection in a product, where one Port is used for communication with the outside as a whole device, i.e., P1 selected in fig. 9, and the other ports are used for connection with other processor subsystems inside the device.
In the related art, each system participating in network communication needs to have a network card, the network card has an IP address and a MAC address, the MAC address is globally unique, the IP addresses of subsystems in the whole device cannot be fixed, and when network communication is to be performed, the IP addresses of each subsystem must be sensed under the condition that the IP addresses are not fixed.
In the network Address system of IPv6, IPv6 addresses are divided into three types, namely unicast addresses, Anycast addresses (Anycast addresses), and multicast addresses. The IPv6 unicast address is divided into: a global unicast address (public address like IPv 4), a link local address, and a site local address (private network address like IPv 4).
The interface identifier in the IPv6 unicast address is used to identify a unique one of the interfaces on the link. The IPv6 unicast addresses currently require an interface identifier of essentially 64 bits. The interface identifier in the IEEE EUI-64 format is converted from the link layer address (MAC address) of the interface.
Fig. 10 is a schematic diagram of the system configuration inside the device according to the embodiment of the present invention, and as shown in fig. 10, the device is composed of a subsystem (e.g., A, B, C … …) and a network switching subsystem, wherein one of the subsystems has a controller, which is a software module and is responsible for configuring parameters or commands to the network switching subsystem through a control bus. The subsystem including the controller may be any one of the subsystems A, B, C … …, and in this embodiment, the subsystem a.
Fig. 11 is a flowchart of a device internal communication establishment method according to an embodiment of the present invention, as shown in fig. 11, the method includes the following steps:
step S1101, the whole device is powered on.
Specifically, before the whole equipment is powered on, the 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, the default is a power-off state, and the controller is required to be triggered and powered on;
b) or the configuration of the working pin of the network exchange chip and the default input level of the working signal;
after the complete device is powered on, a default IP is configured for each subsystem (e.g., A, B, C, … …), such as: 192.168.0.1, 192.168.0.2, 192.168.0.3, … …, wherein the default IP of each subsystem is in the same subnet;
step S1102, after the entire device is powered on, the controller sends a command or configuration parameters 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 non-powered state, the network subsystem is powered on through a trigger signal after the complete equipment is powered on. When the network switching subsystem receives the command or parameter, the external network Port (i.e. Port #1 in the above embodiment) is closed.
Step S1103, the subsystem a sends the broadcast message and its own information, where the own information includes: system number and link address.
Specifically, the subsystem a (i.e. the subsystem where the controller is located) performs timed broadcast first through IPv 4. In this embodiment, a duration, such as 1 minute of timed broadcast, may be set, with 2 seconds between each transmission, to ensure that the other subsystems (i.e., B, C, … …) have sufficient time to receive broadcast information from subsystem a after normal startup.
Step S1104, the other subsystems reply an Acknowledgement Character (ACK) message and their own information, where the own information of the other subsystems 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 a unicast reply or broadcast manner, in this embodiment, a selection may be made according to product needs, for example, if the other subsystems need to communicate with each other, a broadcast manner may be adopted, otherwise, a unicast reply may be adopted, so as to reduce the number of messages in the network environment.
In step S1105, the subsystem a sends a confirmation message to the other subsystems.
Specifically, subsystem a sends the broadcast message and also starts accepting message replies from other subsystems. In order to enable the other subsystems to determine that subsystem a has received its reply message, subsystem a single-points an acknowledgement message to each of the other subsystems that have received the reply.
In this embodiment, before not receiving the acknowledgement message from the subsystem a, the other subsystems need to continuously reply the acknowledgement message to the subsystem a until receiving the acknowledgement message of the subsystem a, and then exit from this link, and delete their own default IPv4 addresses at the same time;
in this embodiment, the subsystem a may store the message reply received from the other subsystem;
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 transmission of the broadcast message may be terminated in advance; and if the subsystem fails to finish collecting the information of all other subsystems within the preset time, the subsystem A judges that the other subsystems are abnormally started. In this embodiment, whether the current device is normally started or not can be determined according to whether the normal operation of the whole device is affected or not or whether the normal operation of the whole device is affected or not according to the importance of the unreceived subsystem, or prompt information can be given if necessary.
In this embodiment, after the subsystem a collects information of all subsystems or when it is confirmed that the absence of information of individual subsystems does not affect normal operation of the device, the subsystem a deletes the Ipv4 address used by itself at the time of broadcasting.
In this embodiment, except that the external subsystem of the whole device retains the external IP address, other IPv4 addresses are deleted, where the external subsystem may be subsystem a or any one of the other subsystems.
Step S1106, the subsystem a sends a command or configuration parameters to the network switching subsystem, and opens the external network port, so that the external network access of the whole device is enabled to be opened.
In this embodiment, the information collected by the subsystem a includes a link layer address (i.e., an interface identifier in IEEE EUI-64 format) of each subsystem, where the link layer address is an IPv6 address, and finally, the subsystems perform internal communication using IPv6 through socket communication.
Fig. 12 is a schematic diagram of a message structure according to an embodiment of the present invention, and as shown in fig. 12, the message structure includes:
Sub-System ID: for identifying which subsystem (A, B, C, … …) originated;
message Type: for identifying message type
Specifically, 0: a message actively initiated by the subsystem A; 1: ACK messages replied by other subsystems; 2: the subsystem A receives the confirmation message after the reply message;
message Payload: it may be the link address directly, or it may be a MAC address (since a MAC address may be translated into a link address), an end use or a link address.
The method for solving the conflict between the internal communication and the external communication of the equipment provided by the embodiment of the invention has the following characteristics:
1. the inside adopts a network switch chip or a router chip to connect multiple systems, and adopts a non-fixed IP address mode to carry out socket data communication;
and one processor subsystem is used as a main system to perform data interaction with the outside of the equipment.
2. And under the condition that the IP address is not fixed and the IP addresses of the subsystems are unknown, the information of the subsystems is published in a broadcasting mode.
3. In order to prevent cross-device information propagation during information broadcasting, which results in collecting cross-device information, a hardware circuit design scheme is proposed in this embodiment, that is: before the network switching subsystem does not receive the command or the parameter sent by the control subsystem, the network switching subsystem does not work by default, and at least the external network hardware interface of the whole machine does not work.
4. In order to ensure that data can be received mutually in the broadcasting process, in this embodiment, it is proposed that each subsystem is required to configure a different IPv4 address in the same network segment by default 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 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 switch chip closes the external network hardware interface, in this embodiment, the control subsystem is required to be an active initiator, and information broadcasting is initiated after the external network interface of the network switch subsystem is closed.
7. In order to ensure that the control subsystem can completely collect all other subsystem information that needs to be collected in the whole process of broadcasting information, in this embodiment, a "three-way handshake" mechanism of messages is proposed: the control subsystem actively initiates a broadcast message, other subsystems reply the message after receiving the broadcast message, and the control subsystem sends a confirmation message after receiving the reply message of other subsystems. The three-way handshake adopts a combined mode of broadcast, unicast and self-defined message content, and is different from the link establishment process of a TCP/IP bottom layer.
8. In order to make the information of each subsystem perceived in the broadcasting process, a message structure is designed, and the message at least comprises: an originator identity of the message, a message type, a MAC Address or a Link-local Address of the originator of the message.
9. In order to solve the problem that 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 using socket mode programming, in this embodiment, it is proposed to adopt an IPv6 address mode for socket communication, so that applications on each subsystem can perform data interaction through socket communication.
11. In order to solve the problem that communication using an IPv6 address may also face address collision in communication using an IPv4 address, in this embodiment, a Link-local address (Link-local address) is provided, which ensures that, on the premise that a MAC address is globally unique, a globally unique local Link address (Link-local address) can be converted by the MAC address, and applications on subsequent subsystems can perform data interaction through socket communication.
12. In order to solve the problem of external network communication of the whole equipment, after the internal subsystems sense the IPv6 link local addresses of each other, the control subsystem sends a command to enable the network switching subsystem to open an external network interface of the whole equipment.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention further provide an electronic device, comprising a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized in a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a memory device and executed by a computing device, and in some cases, the steps shown or described may be executed out of order, or separately as individual integrated circuit modules, or multiple modules or steps thereof may be implemented as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (15)

1. A method for establishing communication within a device, the device comprising a plurality of subsystems 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 in the subsystems sends a broadcast message to other subsystems in the subsystems through the default IP address, wherein the broadcast message carries the information of the first subsystem, and receives reply messages returned by the other subsystems;
after determining that the first subsystem receives the reply messages of all other subsystems, deleting the default IP address configured on each subsystem, and opening an external network port of the equipment;
and the first subsystem carries out 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 configured for each subsystem belongs to the same subnet.
3. The method of claim 1, wherein closing an outward network port of the device comprises:
the first subsystem sends a first command to a network switching subsystem through a control bus, and the network switching subsystem closes an external network port according to the first command.
4. The method of claim 3, wherein prior to the first subsystem sending the first command to the network switching subsystem, comprising:
setting a power supply system default state of the network switching subsystem to be a power-off state, and triggering the network switching subsystem to be powered on through a controller after the first command is received; or the like, or, alternatively,
and 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 the first subsystem of the plurality of subsystems sends the broadcast message to the other subsystems of the plurality of subsystems via the default IP address, further comprising:
and 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 the information of the subsystem.
6. The method of claim 1, the first subsystem receiving reply messages returned by the other subsystems, comprising:
if the first subsystem receives the reply messages of all the second subsystems within the preset time length, the first subsystem finishes sending the broadcast message to the second subsystems;
if the first subsystem fails to receive the reply messages of all the second subsystems within the preset time length, 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, wherein after determining that the first subsystem received reply messages from all other subsystems, further comprising:
and the first subsystem sends confirmation messages to other subsystems in an on-demand mode.
8. The method of claim 1, wherein deleting the default IP address configured on each subsystem after determining that the first subsystem receives the reply messages from all other subsystems comprises:
and except the default IP address of the external subsystem is reserved, deleting the default IP addresses of the other subsystems, wherein the external subsystem is any subsystem in all the subsystems.
9. The method of claim 1, wherein opening an outward network port of the device comprises:
and 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, further comprising, after the first subsystem performs internal communication with the other subsystems according to the link layer address carried in the received reply message:
and the application programs on the subsystems carry out data interaction through socket communication.
11. The method of any one of claims 1-10, wherein the broadcast message and the reply message comprise at least: a message originator identification, a message type, a message originator's MAC address, or a link local address.
12. An apparatus for establishing communication inside a device, applied to a device including a plurality of subsystems, comprising:
a configuration module, 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 broadcast module, configured to send a broadcast message to other subsystems through a first subsystem of the multiple subsystems based on the default IP address, where the broadcast message carries information of the first subsystem, and receives a reply message returned by the other subsystems;
a deleting module, configured to delete the default IP address configured on each subsystem and open an external network port of the device after determining that the first subsystem receives the reply messages of all other subsystems;
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 of claim 12, further comprising:
and the sending module is used for sending confirmation messages to other subsystems in an on-demand mode after the first subsystem receives the reply messages of all other subsystems.
14. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 11 when executed.
15. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of 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 true CN115051973A (en) 2022-09-13
CN115051973B 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 (14)

* 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
US20150117420A1 (en) * 2013-10-31 2015-04-30 Aruba Networks, Inc. Communicating with a Distribution System via an Uplink Access Point
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
US20200351158A1 (en) * 2019-04-30 2020-11-05 EMC IP Holding Company, LLC Systems and methods for network discovery for zero configuration based-clustered systems

Patent Citations (14)

* 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
US20150117420A1 (en) * 2013-10-31 2015-04-30 Aruba Networks, Inc. Communicating with a Distribution System via an Uplink Access Point
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
US20200351158A1 (en) * 2019-04-30 2020-11-05 EMC IP Holding Company, LLC Systems and methods for network discovery for zero configuration based-clustered systems
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地址盗用和防范技术研究", 青海科技, no. 03 *
胡力卫;单冉冉;唐勇;汪文勇;: "基于SDN的IPv4与IPv6互联技术研究", 中国教育网络, no. 1 *

Also Published As

Publication number Publication date
CN115051973B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
DE69838095T2 (en) Nomadic Translator
JP4081472B2 (en) Cluster management method and apparatus for network device
US8103784B2 (en) Communication device and communication control method using efficient echonet address determination scheme
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
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
CN106506717A (en) A kind of automatic discovering method and equipment
JP4890989B2 (en) Communication system and network router
EP3675465B1 (en) Faster duplicate address detection for ranges of link local addresses
CN115150327A (en) Interface setting method, device, equipment and medium
CN115051973B (en) Method and device for establishing equipment internal communication
CN112995038B (en) Access method of PROFINET protocol in industrial SDN
WO2023134338A1 (en) Communication method and apparatuses
CN111163463A (en) Method, device, equipment and storage medium for accessing wireless equipment to router
CN208015725U (en) Multi-line system
CN112994932B (en) Automatic configuration method and device for network parameters of equipment in local area network and equipment
CN116018785A (en) Method for operating a network
JP2007096539A (en) Conversion apparatus
CN112462647B (en) Radio station network control system and method
CN113285780B (en) Method, device and system for configuring transmission pipeline
EP1111861A1 (en) Methods and devices providing wireless access to computer networks
CN213403038U (en) Data transfer unit DTU device
CN111355822B (en) Method for identifying a communication node
CN111526224B (en) Emergency network communication method, gateway and computer readable storage medium

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