Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In the field of communication technology, especially in industrial ethernet, for a device domain or a device group with the same working attribute, a transmission path is often determined, but when the device domain or the device group is built, it is often necessary to configure each device in the device domain or the device group as it is or to transmit an instruction configuring different working attributes by using an inherent transmission method. By adopting the method, waste of network resources or increase of labor cost is often caused, and therefore, a flexible service message transmission method is urgently needed to reduce network operation cost. Based on this, embodiments of the present application provide a method, a system, a device, and a storage medium for transmitting a service packet, which can provide a flexible service packet transmission manner to reduce network operation cost.
The method of the embodiments of the present application will be further explained with reference to the drawings.
Referring to the flowchart shown in fig. 1, an embodiment of the present application further provides a service packet transmission method, which is applied to a first network node, and the method includes:
step S100, acquiring a logic transmission path; wherein the logical transmission path is determined by the first network node from the transmission path list according to the transmission characteristics of the first channel group; the first set of tunnels includes a first network node.
It should be noted that the transmission path list is preset, and includes various supported logical transmission paths. The logical transmission path may be set when initializing a member node of the first channel group according to the configuration parameter of the first channel group loaded in the configuration file, or may be set when initializing the node, and the logical transmission path becomes effective after setting the first channel group. In other embodiments, the logical transmission paths are generated by a user dynamic configuration.
It should be noted that the first network node may be a first master network node or one of a plurality of first slave network nodes of the first channel group, and the first channel group is composed of the first master network node and the plurality of first slave network nodes.
It should be noted that the transmission characteristic represents a service function attribute supporting processing of the first channel group, and if the first channel group is used for acquiring data, the data is acquired as the transmission characteristic, the first channel group is used as a controller to issue a signal instruction, the signal instruction is controlled to be issued by the first master network node, and the first slave network receives the signal instruction to process or process a response as the transmission characteristic. That is, the transmission characteristics include the transmission direction of the signal command of the first channel group and the response parameter.
Step S200, determining the transmission direction and the response parameter of the first service message according to the logic transmission path and the first routing table.
It should be noted that the first routing table may determine the actual transmission path of each first network node according to the logical transmission path. Therefore, the service transmission paths matching different application scenarios can be planned by defining a logical transmission path logically in combination with the first routing table.
It should be noted that each logic transmission path corresponds to a transmission direction of the first service packet and a response mode, and at this time, the first service packet corresponding to each signal instruction in the first channel group is processed and responded according to the transmission direction.
It should be noted that the transmission direction indicates from which the first packet originates, such as from the first master network node or from the first slave network node.
It should be noted that the response parameter indicates two meanings, one of which is whether the member node of the first channel group receiving the signal instruction needs to perform analysis processing, and the other of which is whether the member node needs to respond to the initiator of the signal instruction as the destination address of the signal instruction.
Step S300, according to the transmission direction, transmitting the first service message and processing the first service message according to the response parameter.
Therefore, by setting the transmission characteristics of the logic transmission path and the first channel group in a one-to-one correspondence manner, different first channel groups can select a pre-matched logic transmission path, and then determine the transmission direction and the response parameter of the first service packet.
Exemplarily, referring to the embodiment shown in fig. 2, taking the first channel group G1 as an example, the first master network node is B, and the several slave network nodes are A, C, D, E, respectively. When the transmission direction determined by the logic transmission path is B and is used as the initiating direction A, C, D, E to send the signal command, the response parameter is A, C, D, E, and the analysis processing is performed after the signal command is received, and no response is needed. Then at A, C, D, E, when a signal command from the first master network node B is received, the signal command is parsed and, after the signal command is processed, a next signal command from the first master network node B is awaited. At this time, A, C, D, E does not need to respond, A, C, D, E does not need to issue a signal command to the first master network node B, and A, C, D, E does not have negotiation about signal command processing, so that the bandwidth utilization rate is higher compared with the conventional method that depends on the issuing of the first master network node B and must respond to the first master network node B.
It is understood that the transmission path list includes a single-chain transmission path as well as a star transmission path.
It should be noted that the single-chain transmission path and the star-like transmission path are both logical transmission sequences, the single-chain transmission path indicates that the initiator of the first service packet is the first master network node, and the plurality of first slave network nodes sequentially analyze and process the signal instruction from the first master network node and transmit the signal instruction to the next slave network node, so that after the first master network node sends out the signal instruction, the signal instruction can be received by each first slave network node. And each first slave network node need not respond to whether the signal instruction is received. Or without responding to the completion of execution of the signal instruction.
It should be noted that the star transmission path indicates that the initiator is each first slave network node, and the first master network node does not need to respond to the signaling instruction sent by each first slave network node.
It can be understood that the logic transmission path is a single-chain transmission path, and the step S200 of determining the transmission direction and the response parameter of the first service packet according to the logic transmission path includes: according to the first routing table, carrying out shortest path planning on a first main network node and a plurality of first slave network nodes of the first channel group to obtain a first path; the first network node is a first main network node; the first node of the first path is a first main network node; taking the direction from the head node to the tail end node in the first path as a transmission direction; and analyzing and processing the first service message at the first slave network node as a response parameter.
It should be noted that, for each member node of the first channel group, a corresponding routing table is set. For example, referring to the embodiment shown in fig. 2, the first master network node B is provided with a first routing table, the first slave network node A, C, D, E is provided with a second routing table, and the destination addresses recorded in the routing table entries in the first routing table and the second routing table are the same. Therefore, under the condition that the physical topology is not changed, the obtained first path is overlapped with the shortest path planned by each member node for the next hop according to the first routing table.
It should be noted that, in a single-chain transmission path, the transmission direction is a direction in which the head node sequentially passes through a plurality of intermediate nodes of the first path to reach the end node, and for example, referring to the embodiment shown in fig. 3, the logical transmission path is B- > a- > C- > D- > E. At this time, each of the first slave network nodes A, C, D, E only parses the signaling command and does not transmit response data back to the first master network node B. It should be noted that, since the single-chain transmission path is a logical transmission sequence, in an actual transmission process, there is a first slave network node that is passed through N times, for example, referring to the embodiment shown in fig. 2 and 3, the first slave network node is passed through N times so that D, E can receive all the data, that is, the corresponding actual transmission sequence is B- > a- > C- > a- > D- > a- > B- > E. At this time, according to the set logic transmission path, under the condition that the signal instruction is sensed to be executed, the signal instruction is transmitted and forwarded.
It will be appreciated that the transmission efficiency of the first master network node is higher than the first slave network nodes.
It is understood that the transmission efficiency includes the total number of times of forwarding the first traffic packet to each of the first slave network nodes, and the number of times of passing through the third network node in the first network domain when the first traffic packet arrives at the first slave network node.
It should be noted that, in some embodiments, the first main network node is obtained by automatic election, after the first channel group is created, each first path is planned under the single-chain transmission path, and the number of forwarding times to reach the first path end node is taken as the total number of forwarding times, at this time, each first network node of the first channel group may obtain one total number of forwarding times, and mutually transmit the total number of forwarding times, so that it may be determined that the obtained total number of forwarding times is the highest.
It is noted that in some embodiments, referring to the embodiment shown in fig. 2, the first channel group G1 is located in the first network domain Q1, and in this case, the third network node includes H, F, G, K.
It should be noted that, in some embodiments, weights are set for the total forwarding times and the number of the third network nodes, and a transmission efficiency is obtained by calculating according to the weights and is compared with the transmission efficiency. In other embodiments, the total forwarding times may be sorted in a small to large manner, and the lowest number of the third network nodes in the top-ranked ones is taken as the highest transmission efficiency.
It will be appreciated that the method further comprises: and writing the first path into the first service message so that the second network node receiving the first service message forwards the first service message according to the first path, wherein the first network node is a first main network node.
It should be noted that the first path is stored in the first service message, and it is further ensured that the second network nodes that receive the first service message all can determine the path plan of the next hop according to the node information in the first path, if the destination address of the first service message is C, the second network node that currently receives the first service message is a, and the next hop of a on the first path is B, then the second network node a extracts the information B of the next hop from the first service message, plans the path to B according to the routing table in the second network node, and thus the first service message must sequentially pass through the points on the first path and then reach C.
It should be noted that, in this way, the misjudgment probability of the transmission condition of the node in the network domain where the first channel group is located can be reduced. For example, the member nodes of the first channel group are logical nodes, and at least one member node which does not belong to the first channel group exists between two member nodes.
It can be understood that the logic transmission path is a star transmission path, and the step S200 determines the transmission direction and the response parameter of the first service packet according to the logic transmission path and the first routing table, including: planning a shortest path from the first network node to a first main network node of the first channel group according to the first routing table; wherein the first network node is one of a plurality of slave network nodes of the first channel group; taking the transmission direction from the first node to the end node of the shortest path as the transmission direction; and the first service message is analyzed and processed only at the first main network node as a response parameter.
It should be noted that the star transmission path is, for example, data acquisition. Illustratively, referring to the embodiment shown in fig. 4, the first slave network node A, C, D, E sends signaling instructions to the first master network node B, respectively. At this time, the first master network node B parses the signal command and waits for the next period or event-triggered signal command.
It is understood that the first network node is located in a plurality of first channel groups, and the first channel groups correspond to the logical transmission paths one to one.
It can be understood that, in step S100, the obtaining of the logical transmission path includes: a path selection request is received from a user, the path selection request for input to a logical transmission path.
It should be noted that the path selection request includes information of the logical transmission path, and the application of the first channel group may be more flexible in a manner of dynamic setting by the user. In other embodiments, the path selection request makes the determination of the logical transmission path in a manner that triggers the first network node to read the parameters of the loaded configuration.
It can be understood that the first network node is a slave network node, and processes the first service packet according to the response parameter, including:
and forwarding the first service message and carrying out response processing on the first service message according to the response parameter.
It should be noted that, after receiving the first service packet, each first slave network node first performs response processing after forwarding, so as to reduce the residence time of the first service packet in each first slave network node, and further improve the transmission efficiency of the first service packet in the first channel group.
It is to be understood that the first network node is located in a first network domain, the method further comprising: and saving the first node identification distributed by the second main network node from the first network domain, wherein the second main network node is obtained by self-election.
It should be noted that, referring to the embodiment shown in fig. 2, the first network domain Q1 includes A, B, C, D, E, F, G, H, and after the first network domain Q1 is successfully created, A, B, C, D, E, F, G, H exchanges the address relationship translation tables stored in each other, where the address relationship translation tables are used to establish the mapping relationship between the node identifiers and the physical addresses. At this time, A, B, C, D, E, F, G, H knows the version information of each other node, for example, a compares the version numbers of the address relationship conversion tables A, B, C, D, E, F, G, H to obtain the latest address relationship conversion table of H, at this time, a determines H as the second master network node, and similarly, B, C, D, E, F, G, H determines H as the second master network node, at this time, the second master network node updates the routing table of A, B, C, D, E, F, G or adds new nodes and merges network domains.
It is understood that saving the node identification assigned by the second master network node from the first network domain, wherein the second master network node is obtained by self-election, comprises: storing the first node identifier in a routing table entry of which the first destination address is the first network node in a first routing table; and acquiring a second node identifier corresponding to a second target address in the first routing table and storing the second node identifier in a corresponding routing table item.
It should be noted that, the first node identifier and the second node identifier are stored in the routing table entry, so that when a next hop address of the first service packet is queried, a physical address corresponding to a node identifier filled in a destination address in the first service packet is determined according to the address relationship translation table, and then the routing table is sent according to binary lookup, so as to compare the routing tables with the sequence numbers.
It should be noted that the first channel group and the first main network domain are created in no order.
It is noted that in some embodiments, the first network domain is automatically created. And stopping automatic route updating after the activated nodes are subjected to route addressing to obtain the first network domain. For example, referring to the embodiment shown in fig. 2, A, B, C, D, E, F, G, H is set to be in the activated state, K is set to be in the deactivated state, and at this time, A, B, C, D, E, F, G, H may obtain the routing table with A, B, C, D, E, F, G as the destination address through the routing broadcast. When the automatic update of the route is stopped, the message generated by A, B, C, D, E, F, G can only be transmitted between A, B, C, D, E, F, G, thus automatically forming the first network domain. At this time, after the first network domain is automatically elected by the second master network node, configuration information with the first network domain is generated, and initialization is performed by the second master network node in a neighbor diffusion manner (that is, each initialized member node sends initialization information to uninitialized member nodes so as to realize initialization of the first network domain).
It can be appreciated that the present application also proposes a network system comprising a first network domain; the first network domain is provided with at least one first channel group, the first channel group comprises first network nodes, and the first network nodes are used for realizing the service message transmission method of any one of the above
It is understood that the present application also proposes an electronic device comprising: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the service message transmission method when executing the computer program.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It should be noted that the electronic device in this embodiment may be applied as the method of the first network node in the embodiment shown in fig. 1, and the electronic device in this embodiment and the method shown in fig. 1 have the same inventive concept, so that these embodiments have the same implementation principle and technical effect, and are not described in detail here.
The non-transitory software programs and instructions required to implement the information processing method of the above-described embodiments are stored in the memory, and when executed by the processor, perform the information processing method of the above-described embodiments, for example, implement the method steps described above as applied to the first network node.
It can be understood that the present application also provides a computer-readable storage medium storing computer-executable instructions for implementing the service packet transmission method.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
While the preferred embodiments of the present invention have been described, the present invention is not limited to the above embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and such equivalent modifications or substitutions are included in the scope of the present invention defined by the claims.