CN117041363A - Method, device and system for realizing multi-device cascade configuration by custom data packet - Google Patents
Method, device and system for realizing multi-device cascade configuration by custom data packet Download PDFInfo
- Publication number
- CN117041363A CN117041363A CN202311294365.5A CN202311294365A CN117041363A CN 117041363 A CN117041363 A CN 117041363A CN 202311294365 A CN202311294365 A CN 202311294365A CN 117041363 A CN117041363 A CN 117041363A
- Authority
- CN
- China
- Prior art keywords
- data packet
- extension field
- value
- custom
- packet
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a method, a device and a system for realizing multi-device cascade configuration by a custom data packet. The method comprises the following steps: responding to the received data packet from the upper computer, judging whether the data packet is of a custom type; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device; if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet. The application realizes the configuration of multi-device cascade through the self-defined data packet, and the obtained beneficial effects comprise: the method has good flexibility and is used for adapting to various application scenes; the cascade connection of a plurality of devices can be effectively solved, and response return on the configuration and the state of different devices can be rapidly and effectively realized; the traditional network structure is not changed; provides a new scheme for the internal access of the device.
Description
Technical Field
The application relates to the technical fields of communication/internet/industry and the like related to Ethernet, in particular to a method, a device and a system for realizing multi-device cascade configuration by using custom data packets.
Background
With the increasing complexity of communication networks and the diversification of functional requirements, the way of integrating multiple applications through multi-device cascading is becoming increasingly widespread. Therefore, how to provide a scheme for configuring multi-device cascade is an urgent technical problem to be solved at present.
Disclosure of Invention
The application provides a method, a device and a system for realizing multi-device cascade configuration by a custom data packet.
In a first aspect, the present application provides a method for implementing a multi-device cascade configuration by using a custom data packet, which is applied to any device in a multi-device cascade system, and the method includes: responding to a received data packet from an upper computer, and judging whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; and if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
In some optional embodiments, before the determining whether the data packet is of the custom type, the method further includes: judging whether the data packet carries VLAN information or not; the determining whether the data packet is of a custom type includes: judging whether a type field in the data packet represents a custom type; after the determining whether the data packet is of the custom type, the method further includes: if the type field represents a custom type, further judging whether a check field in the data packet meets the requirement.
In some optional embodiments, configuring the device according to the data packet, or generating and returning a response packet includes: identifying and analyzing the data packet, and judging whether the operation type in the data packet is a read operation or a write operation; if the write operation is performed, configuring the address and the data carried in the data packet to corresponding registers in the device; and if the read operation is performed, reading information from a corresponding register in the device to generate a response packet, and returning the response packet to the upper computer.
In a second aspect, the present application provides a method for implementing multi-device cascade configuration by using a custom data packet, which is applied to an upper computer in a multi-device cascade system, and the method includes: generating a data packet of a custom type, wherein the data packet comprises an extension field; transmitting the data packet to a device in the multi-device cascade system, the data packet being used by the device to: if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; and if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
In some optional embodiments, before the generating the data packet of the custom type, the method further includes: the devices are classified and numbered, and each device is assigned with different routes and numbers; the generating the data packet of the custom type comprises the following steps: when a certain device is required to be accessed and configured, a self-defined type data packet is generated according to the route and the number of the device, and the value of the extension field in the data packet is generated according to the number of the device.
In a third aspect, the present application provides an apparatus for implementing a multi-device cascade configuration by using a custom data packet, which is applied to any device in a multi-device cascade system, where the apparatus includes a transceiver module and a data processing module, where: the receiving and transmitting module is configured to respond to receiving a data packet from an upper computer and judge whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; if the value of the extension field is 0, forwarding the data packet to the data processing module; the data processing module is configured to configure the device according to the data packet or generate a response packet; the receiving and transmitting module is also used for returning the response packet to the upper computer.
In a fourth aspect, the present application provides an apparatus for implementing a multi-device cascade configuration by using a custom data packet, which is applied to an upper computer in a multi-device cascade system, where the apparatus includes: the generating module is configured to generate a data packet of a custom type, wherein the data packet comprises an extension field; a transmitting module configured to transmit the data packet to a device in the multi-device cascade system, the data packet being used by the device to: if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet; and the receiving module is configured to receive a response packet returned by the device.
In a fifth aspect, the present application provides a multi-device cascade system, comprising a plurality of devices and an upper computer that are cascade connected, wherein: the upper computer is used for generating a self-defined type data packet, wherein the data packet comprises an extension field, sending the data packet to a device in the multi-device cascade system, and receiving a response packet returned by the device; the device is used for responding to the received data packet from the upper computer and judging whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; and if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
In a sixth aspect, the present application provides a computer device comprising: one or more processors; storage means having stored thereon one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method as described in the first or second aspect.
In a seventh aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by one or more processors, implements the method according to the first or second aspect.
The application provides a method, a device and a system for realizing multi-device cascade configuration by a custom data packet. The application generates the custom data packet through the Ethernet channel transmission by customizing a message format, when reaching a certain node device, the internal processing logic of the device executes the action of identifying the data packet, and uses the logic to execute the corresponding action, thereby finally realizing the configuration of multi-device cascade. Thus, the beneficial effects achieved by the application include, but are not limited to:
(1) The method has good flexibility, and can be used as an Ethernet maintenance packet by self-defining data packets so as to adapt to various application scenes;
(2) By adding an extension field (for example, denoted by hopcount) in the custom data packet, the device action is indicated by using the value of the extension field, so that cascade connection of a plurality of devices can be effectively solved, and response return on configuration and state of different devices can be rapidly and effectively realized;
(3) The method can be realized by only adding message identification processing logic into a device without changing the traditional network structure;
(4) Provides a new scheme for the internal access of the device, and complements the traditional mode.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a schematic diagram of an exemplary system architecture of a multi-device cascade system according to the application;
FIG. 2 is a timing diagram of one embodiment of a method for implementing a multi-device cascade configuration with custom data packets in accordance with the present application;
FIG. 3 is a schematic diagram of a custom data packet according to some embodiments of the present application;
FIG. 4 is a flow diagram of an embodiment in one particular scenario according to the present application;
FIG. 5 is a schematic diagram of an architecture of an embodiment in one particular scenario in accordance with the present application;
FIG. 6 is a flow chart of one embodiment of a method for custom data packet implementation of a multi-device cascade configuration in accordance with the present application;
FIG. 7 is a flow chart of another embodiment of a method for custom data packet implementation of a multi-device cascade configuration in accordance with the present application;
FIG. 8 is a block diagram of one embodiment of an apparatus for custom data packet implementation of a multi-device cascade configuration in accordance with the present application;
FIG. 9 is a block diagram of another embodiment of an apparatus for custom data packet implementation of a multi-device cascade configuration in accordance with the present application;
fig. 10 is a schematic diagram of a hardware composition structure of an embodiment of a computer device according to the present application.
Detailed Description
For a more complete understanding of the nature and the technical content of the embodiments of the present application, reference should be made to the following detailed description of embodiments of the application, taken in conjunction with the accompanying drawings, which are meant to be illustrative only and not limiting of the embodiments of the application.
Referring to fig. 1, fig. 1 illustrates an exemplary system architecture 100 of a multi-device cascade system in accordance with the present application.
As shown in fig. 1, the system architecture 100 may include a host computer 101 and a plurality of devices 102 connected to the host computer 101 in cascade connection.
The upper computer 101 may be a computer device, and deployed with upper computer software, and may generate a data packet that functions as an internet maintenance packet, and send the data packet to the plurality of devices 102, so as to perform configuration access on the plurality of devices 102.
Device 102, including but not limited to various chips or various computer devices or other ethernet devices.
It should be noted that, the method for implementing the multi-device cascade configuration by the custom data packet provided by the present application is generally executed by the device 102, and accordingly, the apparatus for implementing the multi-device cascade configuration by the custom data packet is generally disposed in the device 102. It should be noted that, in some cases, the method for implementing multi-device cascade configuration by using the custom data packet provided by the present application may be executed by the device 102, or may be executed by the host computer 101, or may be executed by the device 102 and the host computer 101 together. Correspondingly, the device for realizing the cascade configuration of the multiple devices by the custom data packet can be arranged in the device 102, can also be arranged in the upper computer 101, and can also be partially arranged in the device 102 and partially arranged in the upper computer 101.
It should be understood that the number of devices 102 in fig. 1 is merely illustrative. There may be any number of devices 102, as desired for implementation.
Referring to fig. 2, fig. 2 is a timing diagram of one embodiment of a method for implementing a multi-device cascade configuration with custom data packets in accordance with the present application. As shown in fig. 2, the method for implementing the multi-device cascade configuration by using the custom data packet of the present application may include the following steps:
21. the upper computer generates a self-defined data packet, wherein the data packet comprises an extension field, and the data packet is sent to devices in the multi-device cascade system.
The method is suitable for the multi-device cascade system shown in fig. 1, wherein each device in the system is a system node, wherein a first node is connected with an upper computer, and other nodes are sequentially cascaded behind the first node. The upper computer can generate the data packet (namely the request data packet) used as the Ethernet maintenance packet, the data packet is accessed at the first node, and can walk to any node of the network, thereby realizing the control access to all node devices.
Here, the data packet may be a custom data packet of a custom type, and an extension field may be added to the data packet. The extension field may be represented by hopcount, for example. Along with the transmission of the data packet in the network, the value of the Hopcount field in the data packet is reduced when passing through each device in turn until the value is 0, and the current device performs identification analysis, so that the control access to a specific device is realized.
In some optional embodiments, the user may separately sort and number the devices on the host side according to his own needs, where each device is assigned a different route and number (i.e., hopcount value); when a certain device is required to be specifically accessed and configured, the upper computer software generates a self-defined type data packet according to the route and the number of the device, and the value of an extension field in the data packet is generated according to the number of the device. That is, the corresponding route and hopcount of the device can be configured in a custom data packet generated by the host software, and then the host software sends the data packet.
In some alternative embodiments, the structure of the custom data packet may be as shown in fig. 3, and includes the following fields: header, destination address (address of device to be accessed), source address (host address), VLAN (Virtual Local Area Network, virtual local area network identification), VLAN, type (packet type, indicating whether it is custom type), check field, hopcount (extension field), address (register address in device), data (data to be written), operation type (write or read), byte stuffing (other information), CRC (cyclic redundancy check code). Some of these fields are not necessary, for example, there may be no VLAN field, only one field, or two fields. The length of the individual fields may be as shown in fig. 3 or may be different from that shown in fig. 3. Illustratively, the total length of the custom data packet includes, but is not limited to, 72 bytes.
22. The device responds to the received data packet from the upper computer to judge whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device; if the value of the extension field is 0, the device is configured according to the data packet, or a response packet (i.e., a response data packet) is generated and returned.
When the ethernet path transmits a data packet to a certain node, the device of the node performs the following processing: firstly, judging whether the type of the data packet is a custom type or not after the receiving and transmitting module of the device receives the data packet, and discarding the data packet if the type of the data packet is not the custom type; if so, continuing to judge whether the value of the extension field hopcount is 0, if so, forwarding the data packet to a corresponding data processing module by a receiving and transmitting module of the device, identifying and analyzing the data packet by the data processing module, and connecting (transmitting) a corresponding operation command (namely a write operation command or a read operation command indicated by an operation type) to a configuration bus in the device so as to realize the access effect on any space of the device; if the value of the extension field hopcount is not 0, the value of hopcount in the data packet is subtracted by 1, and the data packet is continuously sent to the next-stage device. And (3) configuring the bus to execute an operation command (read or write), and if the read operation command is executed, reconstructing the accessed and returned data into a self-defined response packet, transmitting the self-defined response packet to the upper computer through an Ethernet data path, wherein the upper computer software can provide the result to a user through interface display. If the configuration bus executes the write operation command, the device is correspondingly configured according to the address and the data carried in the data packet.
In some optional embodiments, before the step of determining whether the data packet is of a custom type, the method may further include a step of determining whether the data packet carries VLAN information; the step of determining whether the data packet is of a custom type may specifically be: judging whether a type field in the data packet represents a custom type; after the step of determining whether the data packet is of the custom type, the method may further include a step of further determining whether a check field in the data packet meets the requirement.
In some alternative embodiments, if the type field indicates that the data packet is not of a custom type, the data packet may be sent to the next device without further determination of the check field.
In some alternative embodiments, if the data packet is determined to be of a custom type, and the check field is further determined to meet the requirement, the data packet is forwarded to the corresponding data processing module; and if the check field is further judged to not meet the requirement, the data packet is sent to a next-stage device.
In some optional embodiments, the configuring the device according to the data packet, or the generating and returning the response packet may include: the data processing module in the device performs identification analysis on the data packet, judges whether an operation command represented by an operation type in the data packet is a read operation or a write operation, and connects the operation command to the configuration bus; if the write operation is performed, the configuration bus configures the address and the data carried in the data packet to a corresponding register in the device when the write operation command is executed; if the bus is configured for reading operation, when the reading operation command is executed, information is read from a corresponding register in the device to generate a response packet, and the response packet is returned to the upper computer.
The method for realizing multi-device cascade configuration by the custom data packet is explained above. The application generates the custom data packet through the Ethernet channel transmission by customizing a message format, when reaching a certain node device, the internal processing logic of the device executes the action of identifying the data packet, and uses the logic to execute the corresponding action, thereby finally realizing the configuration of multi-device cascade. Thus, the beneficial effects achieved by the application include, but are not limited to:
(1) The method has good flexibility, and can be used as an Ethernet maintenance packet by self-defining data packets so as to adapt to various application scenes;
(2) By adding an extension field (hopcount) in the custom data packet and utilizing the value of the extension field to indicate the device action, the cascade connection of a plurality of devices can be effectively solved, and the response return on the configuration and the state of different devices can be rapidly and effectively realized;
(3) The method can be realized by only adding message identification processing logic into a device without changing the traditional network structure;
(4) Provides a new scheme for the internal access of the device, and complements the traditional mode.
In order to facilitate understanding of the present application, the following describes the technical solution of the present application in connection with an embodiment in a specific application scenario.
Referring to fig. 4, the method for implementing multi-device cascade configuration by using the custom data packet of the present embodiment includes the following steps:
step one: the user respectively classifies and numbers a plurality of devices according to own requirements, and each device is distributed with different routes and hopcount; when a certain device needs to be specifically accessed and configured, configuring a corresponding route and hopcount of the device in an upper computer software custom data packet; and then the upper computer software sends the data packet.
Step two: the receiving and transmitting module of the device receives the data packet sent by the upper computer and judges whether the self-defined data packet carries VLAN information (layer 2 or layer 1 can be self-defined or VLAN is not carried). In some alternative embodiments, each beat of data may be 128 bits (i.e. 16 bytes), if the packet carries two layers of VLAN, when valid of the received data is valid, the first beat of data (128 bits) is sampled, whether the lower 32 bits thereof are VLAN flags (16 'h8100/16' h9100/16'h9200/16' h88a 8) is judged, the condition is satisfied, whether the upper 32 bits of the second 128 bits are VLAN flags (16 'h8100/16' h9100/16'h9200/16' h88a 8) is continuously judged, and if the condition is satisfied, the packet carries two layers of VLAN tags. Wherein said first beat of data starts from the destination address of the data packet, not from the beginning.
Step three: judging whether the type and the check field in the custom data packet meet the requirements, wherein the type can be set by itself, and the second 128bit [95 ] after valid of the received data is detected: 80 bit is custom type, and the second 128bit [79: whether 48 bit is a check field (this check field is the destination address, source address, two layer VLAN, CRC check value of type); if the condition is satisfied, the next judgment is continued.
Step four: judging whether hopcount is 0, if so, forwarding the data packet to a data processing module by a receiving and transmitting module of the device; if hopcount is not 0, the value of hopcount is decremented by 1 and the packet is continued to be sent to the next stage.
Referring to the example shown in fig. 5, assuming that the initial value of hopcount in the packet is 4, the packet reaches device 1 with hopcount being 4, and the action of subtracting 1 is performed; when the data packet arrives at the device 2, hopcount is 3, and the action of subtracting 1 is executed; when the data packet arrives at the device 3, hopcount is 2, and the action of subtracting 1 is executed; when the data packet arrives at the device 4, hopcount is 1, and the action of subtracting 1 is executed; when the packet arrives at the device 5, hopcount is 0, and the transceiver module of the device 5 forwards the packet to its data processing module.
Step five: after receiving the transmitted data packet, the data processing module performs identification analysis on the data packet, and connects a corresponding operation command (i.e., an operation command represented by an operation type field of the data packet, typically, read or write) to a configuration bus inside the device. If the operation command executed by the configuration bus is a write operation command, the received address and data (address and data in the data packet) are configured to corresponding registers in the device through the bus. If the operation command executed by the configuration bus is a read operation command, the corresponding device state may be read from the corresponding register, and a response packet may be formed, where the response packet may include, for example, the following fields: destination address (original source address), source address (original destination address), type (same data packet), check field (need to calculate itself), hopcount (value is larger than sum of all devices), address, data, operation type. And transmitting the response packet returned by the access to the upper computer through the Ethernet data path.
Step six: the upper computer receives the returned response packet carrying the device state and can display the received device state through an upper computer interface.
Referring to fig. 6, a flow 600 of one embodiment of a method for custom data packet implementation of a multi-device cascade configuration in accordance with the present application is shown. As shown in fig. 6, the method for implementing multi-device cascade configuration by using a custom data packet of the present application can be applied to any device in a multi-device cascade system, and includes the following steps:
601. responding to the received data packet from the upper computer, judging whether the data packet is of a custom type;
602. responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0;
603. if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device;
604. if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
In some alternative embodiments, before determining whether the data packet is of the custom type in step 601, the method further includes: judging whether the data packet carries VLAN information or not; the judging whether the data packet is of the custom type comprises the following steps: judging whether a type field in the data packet represents a custom type; after judging whether the data packet is of the custom type, the method further comprises the following steps: if the type field represents a custom type, further judging whether a check field in the data packet meets the requirement.
In some alternative embodiments, the device includes a register, and step 604 specifically includes: identifying and analyzing the data packet, and judging the operation type in the data packet as read operation or write operation; if the write operation is performed, configuring the address and the data carried in the data packet to a corresponding register in the device; and if the read operation is performed, reading information from a corresponding register in the device to generate a response packet, and returning the response packet to the upper computer.
In this embodiment, the specific operations and the technical effects of steps 601 to 604 may refer to the description of step 22 in the embodiment shown in fig. 2, and are not repeated here.
Referring to fig. 7, a flow 700 of one embodiment of a method for custom data packet implementation of a multi-device cascade configuration in accordance with the present application is shown. As shown in fig. 7, the method for implementing multi-device cascade configuration by using a custom data packet of the present application can be applied to an upper computer in a multi-device cascade system, and includes the following steps:
702. generating a data packet of a custom type, wherein the data packet comprises an extension field;
703. transmitting a data packet to a device in the multi-device cascade system, the data packet being used by the device to: if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device; if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
In some alternative embodiments, prior to step 702, the method further comprises:
701. the devices are class numbered, with each device being assigned a different route and number.
In some alternative embodiments, step 702 specifically includes: when a certain device is required to be accessed and configured, a self-defined type data packet is generated according to the route and the number of the device, and the value of an extension field in the data packet is generated according to the number of the device.
In this embodiment, the specific operations and the technical effects of steps 701 to 703 may refer to the description of step 21 in the embodiment shown in fig. 2, and are not repeated here.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an embodiment of an apparatus for implementing a multi-device cascade configuration with custom data packets according to the present application. The device for realizing the multi-device cascade configuration by the custom data packet can be applied to any device in a multi-device cascade system.
As shown in fig. 8, an apparatus 800 for implementing a multi-device cascade configuration by using a custom data packet according to the present application may include a transceiver module 801 and a data processing module 802, where:
a transceiver module 801 configured to determine, in response to receiving a data packet from the host computer, whether the data packet is of a custom type; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device; if the value of the extension field is 0, forwarding the data packet to a data processing module;
a data processing module 802 configured to configure the device according to the data packet, or generate a response packet;
the transceiver module 801 is further configured to return a response packet to the host computer.
In some alternative embodiments, the transceiver module 801 is specifically configured to: judging whether the data packet carries VLAN information or not; judging whether a type field in the data packet represents a custom type; if the type field represents a custom type, further judging whether a check field in the data packet meets the requirement.
In some alternative embodiments, the device includes a register, and the data processing module 802 is specifically configured to: identifying and analyzing the data packet, and judging the operation type in the data packet as read operation or write operation; if the write operation is performed, configuring the address and the data carried in the data packet to a corresponding register in the device; and if the read operation is performed, reading information from a corresponding register in the device to generate a response packet, and returning the response packet to the upper computer.
It should be noted that, the implementation details and technical effects of each module in the apparatus of this embodiment may refer to the descriptions of other embodiments in the present application, which are not described herein. The implementation scheme in each module of the device has a variety, so long as the purpose of the module can be achieved, and the practical deployment is not limited to the specific implementation scheme.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an embodiment of an apparatus for implementing a multi-device cascade configuration with custom data packets according to the present application. The device for realizing the multi-device cascade configuration by the custom data packet can be applied to an upper computer in a multi-device cascade system.
As shown in fig. 9, an apparatus 900 for implementing a multi-device cascade configuration by using a custom data packet according to the present application may include:
the generating module 901 is configured to generate a custom type data packet, where the data packet includes an extension field;
a transmitting module 902 configured to transmit a data packet to a device in the multi-device cascade system, the data packet being used by the device to: if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device; configuring the device according to the data packet, or generating and returning a response packet;
the receiving module 903 is configured to receive a response packet returned by the device.
In some alternative embodiments, the apparatus further comprises: the preprocessing module 904 is configured to categorize and number devices, each device being assigned a different route and number.
In some optional embodiments, the generating module 901 is further configured to generate, when a device needs to be configured, a custom type data packet according to a route and a number of the device, where a value of an extension field in the data packet is generated according to the number of the device.
It should be noted that, the implementation details and technical effects of each module in the apparatus of this embodiment may refer to the descriptions of other embodiments in the present application, which are not described herein. The implementation scheme in each module of the device has a variety, so long as the purpose of the module can be achieved, and the practical deployment is not limited to the specific implementation scheme.
Referring to fig. 1, the application further provides a multi-device cascade system, which comprises a plurality of devices and an upper computer which are cascaded, wherein:
the upper computer is used for generating a self-defined type data packet, wherein the data packet comprises an extension field, sending the data packet to a device in the multi-device cascade system and receiving a response packet returned by the device;
the device is used for responding to the received data packet from the upper computer and judging whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to the next-stage device; if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
Referring to fig. 10, fig. 10 is a schematic structural view of one embodiment of a computer device according to the present application. As shown in fig. 10, the computer device 1000 of the present application may include:
one or more processors 1001;
a memory 1002 on which one or more programs 1003 are stored;
components such as the processor 1001 and the memory 1002 may be coupled together by a bus system 1004; bus system 1004 is used to enable connected communications between these components;
the one or more programs 1003, when executed by the one or more processors 1001, cause the one or more processors 1001 to implement a method for implementing a multi-device cascade configuration from custom data packets as disclosed in the method embodiment shown in fig. 6 or the method embodiment shown in fig. 7.
The bus system 1004 may include a power bus, a control bus, and a status signal bus in addition to a data bus. The memory 1002 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The processor 1001 may be an integrated circuit chip with signal processing capabilities, may be a general purpose processor, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
Embodiments of the present application also provide a computer-readable storage medium having stored thereon a computer program which, when executed by one or more processors, implements a method for implementing a multi-device cascade configuration from custom data packets as disclosed in the method embodiment shown in fig. 6 or the method embodiment shown in fig. 7.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be understood that the terms "system" and "network" are used interchangeably herein. The term "and/or" in the present application is merely an association relation describing the association object, and indicates that three kinds of relations may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. In the present application, the character "/" generally indicates that the front and rear related objects are an or relationship.
The foregoing description of the preferred embodiments of the application is not intended to limit the scope of the application, but is intended to cover any modifications, equivalents, and alternatives falling within the spirit and principles of the application.
Claims (10)
1. A method for implementing a multi-device cascade configuration by a custom data packet, which is applied to any device in a multi-device cascade system, the method comprising:
responding to a received data packet from an upper computer, and judging whether the data packet is of a custom type or not;
responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0;
if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device;
and if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
2. The method of claim 1, wherein prior to determining whether the data packet is of a custom type, further comprising: judging whether the data packet carries VLAN information or not;
the determining whether the data packet is of a custom type includes: judging whether a type field in the data packet represents a custom type;
after the determining whether the data packet is of the custom type, the method further includes: if the type field represents a custom type, further judging whether a check field in the data packet meets the requirement.
3. The method of claim 1, wherein configuring the device according to the data packet, or wherein generating and returning a response packet comprises:
identifying and analyzing the data packet, and judging whether the operation type in the data packet is a read operation or a write operation;
if the write operation is performed, configuring the address and the data carried in the data packet to corresponding registers in the device;
and if the read operation is performed, reading information from a corresponding register in the device to generate a response packet, and returning the response packet to the upper computer.
4. The method for realizing multi-device cascade configuration by using a custom data packet is characterized by being applied to an upper computer in a multi-device cascade system, and comprises the following steps:
generating a data packet of a custom type, wherein the data packet comprises an extension field;
transmitting the data packet to a device in the multi-device cascade system, the data packet being used by the device to: if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; and if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
5. The method of claim 4, wherein prior to generating the custom type data packet, the method further comprises: the devices are classified and numbered, and each device is assigned with different routes and numbers;
the generating the data packet of the custom type comprises the following steps: when a certain device is required to be accessed and configured, a self-defined type data packet is generated according to the route and the number of the device, and the value of the extension field in the data packet is generated according to the number of the device.
6. The device for realizing the multi-device cascade configuration by the custom data packet is characterized by being applied to any device in a multi-device cascade system, and comprises a transceiver module and a data processing module, wherein:
the receiving and transmitting module is configured to respond to receiving a data packet from an upper computer and judge whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; if the value of the extension field is 0, forwarding the data packet to the data processing module;
the data processing module is configured to configure the device according to the data packet or generate a response packet;
the receiving and transmitting module is also used for returning the response packet to the upper computer.
7. The utility model provides a device that custom data package realized multi-device cascade configuration which characterized in that is applied to the host computer in the multi-device cascade system, said device includes:
the generating module is configured to generate a data packet of a custom type, wherein the data packet comprises an extension field;
a transmitting module configured to transmit the data packet to a device in the multi-device cascade system, the data packet being used by the device to: if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet;
and the receiving module is configured to receive a response packet returned by the device.
8. A multi-device cascade system comprising a plurality of devices and an upper computer in cascade, wherein:
the upper computer is used for generating a self-defined type data packet, wherein the data packet comprises an extension field, sending the data packet to a device in the multi-device cascade system, and receiving a response packet returned by the device;
the device is used for responding to the received data packet from the upper computer and judging whether the data packet is of a custom type or not; responding to the data packet being of a custom type, judging whether the value of an extension field in the data packet is 0; if the value of the extension field is not 0, subtracting 1 from the value of the extension field in the data packet, and continuing to send to a next-stage device; and if the value of the extension field is 0, configuring the device according to the data packet, or generating and returning a response packet.
9. A computer device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
the method of custom data package implementation multi-device cascade configuration of any of claims 1-3 or 4-5, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement.
10. A computer readable storage medium having stored thereon a computer program which when executed by one or more processors performs a method of implementing a multi-device cascade configuration from custom data packets as claimed in any of claims 1-3 or 4-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311294365.5A CN117041363A (en) | 2023-10-09 | 2023-10-09 | Method, device and system for realizing multi-device cascade configuration by custom data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311294365.5A CN117041363A (en) | 2023-10-09 | 2023-10-09 | Method, device and system for realizing multi-device cascade configuration by custom data packet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117041363A true CN117041363A (en) | 2023-11-10 |
Family
ID=88641572
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311294365.5A Pending CN117041363A (en) | 2023-10-09 | 2023-10-09 | Method, device and system for realizing multi-device cascade configuration by custom data packet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117041363A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1641685A (en) * | 2004-01-14 | 2005-07-20 | 国际商业机器公司 | Parallel pattern detection engine integrated circuit, relative method and data processing system |
CN104423953A (en) * | 2013-09-04 | 2015-03-18 | 中国石油天然气股份有限公司 | Timing data processing script execution system and method for SCADA system |
CN111988756A (en) * | 2020-09-30 | 2020-11-24 | 奇点新源国际技术开发(北京)有限公司 | Multi-channel cascade wireless data acquisition system and method |
-
2023
- 2023-10-09 CN CN202311294365.5A patent/CN117041363A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1641685A (en) * | 2004-01-14 | 2005-07-20 | 国际商业机器公司 | Parallel pattern detection engine integrated circuit, relative method and data processing system |
CN104423953A (en) * | 2013-09-04 | 2015-03-18 | 中国石油天然气股份有限公司 | Timing data processing script execution system and method for SCADA system |
CN111988756A (en) * | 2020-09-30 | 2020-11-24 | 奇点新源国际技术开发(北京)有限公司 | Multi-channel cascade wireless data acquisition system and method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5805808A (en) | Real time parser for data packets in a communications network | |
US6799220B1 (en) | Tunneling management messages over a channel architecture network | |
US6570884B1 (en) | Receive filtering for communication interface | |
KR102753139B1 (en) | Method, device and system for forwarding packets in SR networks | |
US6438128B1 (en) | Alternate use of data packet fields to convey information | |
JP2003508954A (en) | Network switch, components and operation method | |
CN103004158A (en) | Network device with a programmable core | |
US7328270B1 (en) | Communication protocol processor having multiple microprocessor cores connected in series and dynamically reprogrammed during operation via instructions transmitted along the same data paths used to convey communication data | |
TW526453B (en) | Method and system for frame and protocol classification | |
CN109412922B (en) | Method, forwarding device, controller and system for transmitting message | |
EP0253940B1 (en) | Method and system of routing data blocks in data communication networks | |
JP2003508957A (en) | Network processor processing complex and method | |
US6807183B1 (en) | Arrangement for reading a prescribed location of a FIFO buffer in a network switch port | |
CN115065637A (en) | Method and device for transmitting computing power resource information and electronic equipment | |
CN111614580A (en) | Data forwarding method, device and equipment | |
CN101627580B (en) | Network component, method for the operation of such a network component, automation system comprising such a network component, method for transmitting data in an automation system by means of such a | |
CN117041370A (en) | Communication method and system | |
CN104426762A (en) | Metadata transmitting and receiving method and OFLS (open flow logic switch) | |
CN103746945A (en) | Data transmission device and method | |
CN114079634B (en) | Message forwarding method and device and computer readable storage medium | |
CN114205172A (en) | Table item issuing method and message forwarding method | |
CN109286564B (en) | Message forwarding method and device | |
CN117041363A (en) | Method, device and system for realizing multi-device cascade configuration by custom data packet | |
WO2025044072A1 (en) | Data transmission method, chip, and storage medium | |
CN112543142B (en) | Method and device for realizing RSTP ring network protocol based on FPGA |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20231110 |
|
RJ01 | Rejection of invention patent application after publication |