CN112822087B - Data distinguishing method, data distinguishing device, router and network relay equipment - Google Patents
Data distinguishing method, data distinguishing device, router and network relay equipment Download PDFInfo
- Publication number
- CN112822087B CN112822087B CN202011631360.3A CN202011631360A CN112822087B CN 112822087 B CN112822087 B CN 112822087B CN 202011631360 A CN202011631360 A CN 202011631360A CN 112822087 B CN112822087 B CN 112822087B
- Authority
- CN
- China
- Prior art keywords
- data
- area network
- local area
- interface
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
- H04L12/4641—Virtual LANs, VLANs, e.g. virtual private networks [VPN]
- H04L12/4645—Details on frame tagging
- H04L12/465—Details on frame tagging wherein a single frame includes a plurality of VLAN tags
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application is applicable to the technical field of network communication, and provides a data distinguishing method, a data distinguishing device, a router, network relay equipment and a computer readable storage medium, wherein the method comprises the following steps: configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain first data carrying the first virtual local area network tag; the first virtual local area network label is used for describing the service content corresponding to the first data; determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag; and sending the first data to the server through the data sending path. The data distinguishing method configures a first virtual local area network tag for the first data, and the first virtual local area network tag describes service content corresponding to the first data, so that the method can distinguish data sent by different local area network interfaces through the virtual local area network tag and can distinguish service functions required to be realized by different data.
Description
Technical Field
The present application belongs to the field of network communication technologies, and in particular, to a data distinguishing method, a data distinguishing device, a router, a network relay device, and a computer-readable storage medium.
Background
In existing designs, a router includes multiple Local Area Network (LAN) interfaces. Each lan interface needs to correspond to an Ethernet (eth) interface in the router, so that when different services are required to be performed, only data needs to be sent to the Ethernet interface corresponding to the lan interface through different lan interfaces, and the Ethernet interface is bound to a Bridge (Bridge) corresponding to a service in a Virtual Local Area Network (VLAN), thereby implementing different service functions.
However, in the current design scheme of the router, since data of a plurality of lan interfaces are all received through the same ethernet interface, when each data is sent to a bridge of a corresponding service through the ethernet interface, the router cannot determine the service that each data needs to perform, and thus cannot send each data to the bridge of the corresponding service, and when the router receives response information for a certain data, the router cannot send the response information to the corresponding lan interface, so that a terminal that sends the data to the lan interface cannot implement a corresponding service function. Therefore, the existing router design scheme has the problem that the data sent by different local area network interfaces cannot be distinguished, so that the service functions required to be realized by different data cannot be distinguished.
Disclosure of Invention
The embodiment of the application provides a data distinguishing method, a data distinguishing device, a router, network relay equipment and a computer readable storage medium, which can solve the problem that the existing router design scheme can not distinguish data sent by different local area network interfaces, so that service functions required to be realized by different data can not be distinguished.
In a first aspect, an embodiment of the present application provides a data distinguishing method, including:
configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data;
determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag;
and sending the first data to a server through the data sending path.
Further, after determining the data transmission path including the target virtual interface and the target bridge according to the first vlan tag, the method further includes:
and removing the label of the first data carrying the first virtual local area network label according to a first preset strategy to obtain the first data.
Further, the sending the first data to the server through the data sending path includes:
sending the first data to the target virtual interface, and sending the first data to the target bridge through the target virtual interface;
sending, by the target bridge, the first data to a wide area network interface;
and sending the first data to the server through the wide area network interface.
Further, the data distinguishing method further includes:
when second data sent by the server side is received, configuring a second virtual local area network tag for the second data to obtain first data carrying the second virtual local area network tag; the second virtual local area network tag is used for describing service content corresponding to the second data;
determining a target local area network interface corresponding to the second data according to the second virtual local area network label;
and sending the second data to the target local area network interface.
Further, the second data is data returned by the server according to the first data; or, the second data is data sent by the server to a second preset local area network interface.
Further, after determining the target lan interface corresponding to the second data according to the second virtual lan tag, the method further includes:
and removing the label of the second data carrying the label of the second virtual local area network according to a second preset strategy to obtain the second data.
In a second aspect, an embodiment of the present application provides a data distinguishing apparatus, including:
the first configuration unit is used for configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data;
a first determining unit, configured to determine, according to the first vlan tag, a data transmission path including a target virtual interface and a target bridge;
and the first sending unit is used for sending the first data to a server through the data sending path.
In a third aspect, an embodiment of the present application provides a router, where the router includes a forwarding unit and a processing unit, and includes:
the forwarding unit is used for configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data;
the processing unit is used for determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag;
the processing unit is further configured to send the first data to a server through the data sending path.
In a fourth aspect, an embodiment of the present application provides a network relay device, including:
a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the data discrimination method according to any one of the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the data distinguishing method according to any one of the first aspect.
In a fifth aspect, the present application provides a computer program product, when the computer program product runs on a network relay device, the network relay device may execute the data distinguishing method described in any one of the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that:
in the data distinguishing method provided by the embodiment of the application, a first virtual local area network tag is configured for first data received through a first preset local area network interface, so that the first data carrying the first virtual local area network tag is obtained; the first virtual local area network label is used for describing the service content corresponding to the first data; determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag; and sending the first data to the server through the data sending path. According to the data distinguishing method, the first virtual local area network tag is configured on the first data received by the first preset local area network interface, and the first virtual local area network tag describes the service content corresponding to the first data, so that the data distinguishing device can determine the service corresponding to the first data according to the first virtual local area network tag. The data distinguishing method provided by the application not only can distinguish different data according to the virtual local area network label, but also can distinguish the service functions which need to be realized by different data.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic diagram of an overall scheme provided by an embodiment of the present application;
FIG. 2 is a flowchart of an implementation of a data distinguishing method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of an implementation of a data distinguishing method according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of a data differentiation apparatus provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a network relay device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification refers to any and all possible combinations of one or more of the associated listed items and includes such combinations.
As used in this specification, the term "if" may be interpreted in context as "when" or "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In addition, in the description of the present specification, the terms "first", "second", "third", and the like are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating the overall scheme of the present application. In all embodiments of the present application, the execution subject of the data distinguishing method is a router. As shown in fig. 1, the terminal device 10 is mounted under the router 20, and establishes a communication connection with the server 30 through the router 20. The terminal device 10 may include, but is not limited to, a smart phone, a tablet computer, a desktop computer, or the like. The server 20 may be a server or a processor in the server, and the server may be a tablet computer or a desktop computer.
In implementation, the terminal device 10 may also be an intelligent household appliance such as a television, a set-top box, and the like. However, the data distinguishing method implemented in the router 20 is not changed regardless of the type of the terminal device 10 mounted under the router 20.
Taking the terminal device 10 as a mobile phone as an example, the mobile phone sends first data to the router 20, the router 20 configures a first Virtual Local Area Network Tag (VLAN Tag) for the first data received through the first preset Local Area Network interface, so as to obtain the first data carrying the first Virtual Local Area Network Tag, because the first Virtual Local Area Network Tag is used to describe service content corresponding to the first data, and a data sending path including the target Virtual interface and the target bridge can be determined according to the first Virtual Local Area Network Tag, the router 20 sends the first data to the service end 30 through the data sending path.
As shown in fig. 1, the router 20 includes a forwarding unit 21, a processing unit 22, local Area Network (LAN) interfaces 23 (4 are shown), ethernet interfaces, and Wide Area Network (WAN) interfaces 25. The forwarding Unit 21 may be a Switch chip, and the Processing Unit 22 may be a Central Processing Unit (CPU).
In the embodiment of the present application, the terminal device 10 is communicatively connected to the router 20 through the local area network interface B3, and the server 30 is communicatively connected to the router 20 through the wide area network interface 25.
It should be noted that the terminal device 10 may be communicatively connected to the router 20 through any one of the lan interfaces B3.
In fig. 1, the dotted line portion around the lan interface B3 is only for convenience of understanding.
In practical applications, the lan interface B3 is used for connecting the router 20 to a lan, the ethernet interface 24 is an interface for network data connection, that is, the ethernet interface 24 can transmit data between the forwarding unit 21 and the processing unit 22, and the wan interface 25 is used for connecting the router 20 to a wan.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a data distinguishing method according to an embodiment of the present disclosure. In the embodiment of the present application, the main execution body of the data distinguishing method is a router. As shown in fig. 2, a data distinguishing method provided in the embodiment of the present application may include steps S201 to S203, which are detailed as follows:
in S201, configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data.
In this embodiment of the application, after the router receives first data sent by the terminal device through the first preset local area network interface, the forwarding unit of the router may configure a first virtual local area network tag for the first data, so as to obtain the first data carrying the first virtual local area network tag. The first preset lan interface may be determined according to actual needs, and is not limited herein, and for example, the first preset lan interface may be any one of 4 lan interfaces of the router. The first virtual local area network label is used for describing the service content corresponding to the first data.
It should be noted that, in the embodiment of the present application, the router presets and stores the correspondence between different local area network interfaces and different services. For example, assuming that a router is configured with a lan interface a, a lan interface B, a lan interface C, and a lan interface D, and services that can be implemented by the router include service 1, service 2, service 3, and service 4, the router may set the service corresponding to the lan interface a as service 1, the service corresponding to the lan interface B as service 2, the service corresponding to the lan interface C as service 3, and the service corresponding to the lan interface D as service 4. Therefore, after the router receives the first data sent by the terminal device through the first preset local area network interface, the forwarding unit of the router may configure a first virtual local area network tag for the first data received through the first preset local area network interface based on the correspondence between the local area network interface and the service, so as to obtain the first data carrying the first virtual local area network tag.
In this embodiment, after obtaining the first data carrying the first vlan tag, the forwarding unit of the router may send the first data carrying the first vlan tag to the processing unit of the router through an ethernet interface of the router.
In S202, a data transmission path including the target virtual interface and the target bridge is determined according to the first vlan tag.
In this embodiment, after receiving the first data carrying the first vlan tag, the processing unit of the router may determine, according to the first vlan tag, a data transmission path including the target virtual interface and the target bridge. Here, the data transmission path describes a data transmission path at least including a virtual interface and a bridge in the communication process between the router and the server, where the virtual interface refers to an interface virtualized in advance by the router; the bridges are used for carrying services, and different bridges correspond to different services. The target virtual interface refers to a virtual interface for receiving the first data, and the target bridge refers to a bridge for transmitting the first data.
It should be noted that, in the embodiment of the present application, a corresponding relationship between a virtual interface and a bridge is preset in a router, for example, the virtual interface and the bridge are bound one by one, and services carried by each bridge are different. For example, it is assumed that the bridge includes a bridge a (for carrying service 1), a bridge b (for carrying service 2), a bridge c (for carrying service 3), and a bridge d (for carrying service 4), and the virtual interface includes a virtual interface 1, a virtual interface 2, a virtual interface 3, and a virtual interface 4, and the router may bind the virtual interface 1 with the bridge a, bind the virtual interface 2 with the bridge b, bind the virtual interface 3 with the bridge c, and bind the virtual interface 4 with the bridge d.
Based on this, the processing unit of the router may determine, according to the service content described by the first vlan tag, the virtual interface and the bridge corresponding to the service content, so as to determine the virtual interface and the bridge corresponding to the service content as the data transmission path corresponding to the first data.
For example, in combination with S201, assuming that the service content corresponding to the first data is the content of the service 1, the bridge for carrying the service 1 is a bridge a, and the bridge a is bound to the virtual interface 1, the processing unit of the router may determine the virtual interface 1 as a target virtual interface, and determine the bridge a as a target bridge, so as to determine that the data transmission path corresponding to the first data is a data transmission path including the virtual interface 1 and the bridge a.
In an embodiment of the application, since the first vlan tag may affect subsequent processing of the first data, the processing unit of the router may remove the tag of the first data carrying the first vlan tag according to a first preset policy after determining a data transmission path of the first data according to the first vlan tag, so as to obtain the first data, and the data transmitted by the processing unit of the router in a subsequent data transmission process is only the first data. Wherein the first preset policy may be to execute a vlan ctl command.
In S203, the first data is sent to the server through the data sending path.
In this embodiment of the application, after determining the data transmission path of the first data, the processing unit of the router may transmit the first data to the server through the data transmission path.
It should be noted that the first data sent in this embodiment is the first data that does not carry the first vlan tag.
As an embodiment of the present application, the data transmission path is comprised of a target virtual interface, a target bridge, and a wide area network interface. Therefore, the processing unit of the router may send the first data to the server via the target virtual interface, the target bridge, and the wide area network interface in that order.
Specifically, the first data may be sent to the server through the following steps, which are detailed as follows:
and sending the first data to the target bridge through the target virtual interface.
Sending the first data to a wide area network interface through the target bridge.
And sending the first data to the server through the wide area network interface.
In this embodiment, after determining the data transmission path corresponding to the first data and including the target virtual interface and the target bridge, the processing unit of the router may first send the first data to the target virtual interface, and then send the first data to the target bridge through the target virtual interface.
After the processing unit of the router sends the first data to the target bridge, in order to realize the service function of the first data, the processing unit of the router can send the first data to the wide area network interface of the router through the target bridge, and then send the first data to the server through the wide area network interface.
As can be seen from the above, in the method provided in this embodiment, a first virtual local area network tag is configured for first data received through a first preset local area network interface, so as to obtain the first data carrying the first virtual local area network tag; the first virtual local area network label is used for describing the service content corresponding to the first data; determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag; and sending the first data to the server through the data sending path. According to the data distinguishing method, the first virtual local area network tag is configured on the first data received by the first preset local area network interface, and the first virtual local area network tag describes the service content corresponding to the first data, so that the data distinguishing device can determine the service corresponding to the first data according to the first virtual local area network tag. Therefore, the data distinguishing method provided by the application can distinguish different data according to the virtual local area network label, and further distinguish the service functions which need to be realized by different data.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a data distinguishing method according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 2, the data distinguishing method provided in this embodiment further includes steps S301 to S303, which are detailed as follows:
in S301, when second data sent by the server is received, configuring a second virtual local area network tag for the second data, to obtain second data carrying the second virtual local area network tag; the second virtual local area network tag is used for describing service content corresponding to the second data.
In this embodiment, since the second data is issued by the server, after the processing unit of the router receives the second data sent by the server, the processing unit of the router may determine a service corresponding to the second data, and thus the processing unit of the router may configure a second vlan tag for the second data to obtain the second data carrying the second vlan tag. And the second virtual local area network tag is used for describing service content corresponding to the second data.
Since the second data is sent by the server, the processing unit of the router can determine the service corresponding to the second data
In practical application, the server may actively send data to the router, or may send, after receiving the data sent by the router, return data corresponding to the data sent by the router to the router with respect to the data sent by the router. Based on this, in an embodiment of the present application, the second data sent by the server and received by the router may be data sent by the server to the second preset lan interface, that is, data actively sent by the server to the preset lan interface, or data returned by the server according to the first data. The second predetermined lan interface may be determined according to actual needs, and is not limited herein. It should be noted that the second predetermined lan interface is different from the first predetermined lan interface.
For example, assuming that the first predetermined lan interface is the lan interface a in the router, the second predetermined lan interface may be any one of the lan interface B, the lan interface C, and the lan interface D in the router.
It should be noted that, in this embodiment, the router binds the virtual interfaces and the bridges one by one in advance, that is, each virtual interface is bound to one bridge, and services carried by each bridge are different. For example, it is assumed that the bridge includes a bridge a (for carrying service 1), a bridge b (for carrying service 2), a bridge c (for carrying service 3), and a bridge d (for carrying service 4), and the virtual interface includes a virtual interface 1, a virtual interface 2, a virtual interface 3, and a virtual interface 4, and the router may bind the virtual interface 1 with the bridge a, bind the virtual interface 2 with the bridge b, bind the virtual interface 3 with the bridge c, and bind the virtual interface 4 with the bridge d.
Based on this, the processing unit of the router may determine, according to the service content described by the second vlan tag, the virtual interface and the bridge corresponding to the service content, so as to determine the virtual interface and the bridge corresponding to the service content as the data transmission path corresponding to the second data.
For example, assuming that the service content corresponding to the second data is the content of the service 2, the bridge for carrying the service 2 is a bridge b, and the bridge b is bound to the virtual interface 2, the processing unit of the router may determine the virtual interface 2 as the second virtual interface corresponding to the second data, and determine the bridge b as the second bridge corresponding to the second data, thereby determining that the data transmission path corresponding to the second data is a data transmission path including the virtual interface 2 and the bridge b.
Based on this, after obtaining the second data carrying the second vlan tag, the processing unit of the router may send the second data carrying the second vlan tag to the second virtual interface through the second bridge according to a data sending path corresponding to the second data, and then send the second data carrying the second vlan tag to the ethernet interface through the second virtual interface.
After sending the second data carrying the second vlan tag to the ethernet interface, the processing unit of the router sends the second data carrying the second vlan tag to the forwarding unit of the router through the ethernet interface.
In S302, a target lan interface corresponding to the second data is determined according to the second virtual lan tag.
In this embodiment, after receiving the second data carrying the second virtual local area network tag, the forwarding unit of the router may determine, according to the second virtual local area network tag, a target local area network interface corresponding to the second data.
It should be noted that, in this embodiment, the router presets and stores the correspondence between different local area network interfaces and different services. For example, assuming that a router is configured with a lan interface a, a lan interface B, a lan interface C, and a lan interface D, and services that can be implemented by the router include service 1, service 2, service 3, and service 4, the router may set the service corresponding to the lan interface a as service 1, the service corresponding to the lan interface B as service 2, the service corresponding to the lan interface C as service 3, and the service corresponding to the lan interface D as service 4. Therefore, after the forwarding unit of the router receives the second data carrying the second vlan tag, the forwarding unit may determine, according to the service content of the second data described by the second vlan tag, which service content the service content of the second data is, so as to determine, according to the service, the target vlan interface corresponding to the second data.
In an embodiment of the application, since the second vlan tag may affect subsequent processing of the second data, the forwarding unit of the router may perform tag removal on the second data carrying the second vlan tag according to a second preset policy after determining a target vlan interface corresponding to the second data according to the second vlan tag, so as to obtain the second data, so that the data sent by the forwarding unit of the router in a subsequent data sending process is only the second data. Wherein, the second preset strategy can be to execute a vlan command.
In S303, the second data is sent to the target lan interface.
In this embodiment, after determining the target lan interface, the forwarding unit of the router may send the second data to the target lan interface.
It should be noted that the second data sent in this embodiment is the second data that does not carry the second vlan tag.
As can be seen from the above, in the data distinguishing method provided in this embodiment, when second data sent by a server is received, a second virtual local area network tag is configured for the second data, so as to obtain the second data carrying the second virtual local area network tag; the second virtual local area network tag is used for describing service content corresponding to the second data; determining a target local area network interface corresponding to the second data according to the second virtual local area network label; and the second data is sent to the target local area network interface, so that the second data can be accurately sent to the target local area network interface corresponding to the service, the accuracy of data transmission is improved, and the terminal equipment in communication connection with the router through the target local area network interface can realize the required service function.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 shows a block diagram of a data distinguishing apparatus provided in an embodiment of the present application, which corresponds to a data distinguishing method described in the above embodiment, and only shows portions related to the embodiment of the present application for convenience of description. Referring to fig. 4, the data distinguishing apparatus 400 includes: a first configuration unit 41, a first determination unit 42 and a first sending unit 43. Wherein:
the first configuration unit 41 is configured to configure a first virtual local area network tag for first data received through a first preset local area network interface, so as to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data.
The first determining unit 42 is configured to determine a data transmission path including the target virtual interface and the target bridge according to the first vlan tag.
The first sending unit 43 is configured to send the first data to the server through the data sending path.
In one embodiment of the present application, the data differentiating apparatus 400 further comprises: a first removing unit.
The first removing unit is used for removing the tag of the first data carrying the tag of the first virtual local area network according to a first preset strategy to obtain the first data.
In an embodiment of the present application, the data transmission path includes a target virtual interface, a target bridge, and a wide area network interface, and the first transmission unit specifically includes: and a second transmitting unit.
The second sending unit is configured to send the first data to the server side sequentially through the target virtual interface, the target bridge, and the wide area network interface.
In an embodiment of the present application, the second sending unit specifically includes: a third transmitting unit, a fourth transmitting unit and a fifth transmitting unit. Wherein:
the third sending unit is configured to send the first data to the target virtual interface, and send the first data to the target bridge through the target virtual interface.
The fourth sending unit is configured to send the first data to a wide area network interface through the target bridge.
And the fifth sending unit is used for sending the first data to the server through the wide area network interface.
In one embodiment of the present application, the data differentiating apparatus 400 further comprises: a second configuration unit, a second determination unit and a sixth sending unit. Wherein:
the second configuration unit is configured to configure a second virtual local area network tag for the second data when receiving the second data sent by the server, so as to obtain the second data carrying the second virtual local area network tag; the second virtual local area network tag is used for describing service content corresponding to the second data.
And the second determining unit determines a target local area network interface corresponding to the second data according to the second virtual local area network tag.
And the sixth sending unit is used for sending the second data to the target local area network interface.
In an embodiment of the present application, the second data is data returned by the server according to the first data; or, the second data is data sent by the server to a second preset local area network interface.
In one embodiment of the present application, the data differentiating apparatus 400 further comprises: a second removing unit.
The second removing unit is configured to remove a tag of second data carrying the second virtual local area network tag according to a second preset policy, so as to obtain the second data.
As can be seen from the above, in the data distinguishing device provided in the embodiment of the present application, the first data received through the first preset lan interface is configured with the first virtual lan tag, so as to obtain the first data carrying the first virtual lan tag; the first virtual local area network label is used for describing the service content corresponding to the first data; determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag; and sending the first data to the server through the data sending path. According to the data distinguishing method, the first virtual local area network tag is configured on the first data received by the first preset local area network interface, and the first virtual local area network tag describes the service content corresponding to the first data, so that the data distinguishing device can determine the service corresponding to the first data according to the first virtual local area network tag. The data distinguishing method provided by the application not only can distinguish different data according to the virtual local area network label, but also can distinguish the service functions which need to be realized by different data.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a schematic structural diagram of a network relay device according to an embodiment of the present application. As shown in fig. 5, the network relay apparatus 5 of this embodiment includes: at least one processor 50 (only one shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, wherein the processor 50 implements the steps of any of the various data discrimination method embodiments described above when executing the computer program 52.
The network relay device may include, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is merely an example of the network relay device 5, and does not constitute a limitation of the network relay device 5, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 50 may be a Central Processing Unit (CPU), and the Processor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the network relay device 5 in some embodiments, for example, a memory of the network relay device 5. The memory 51 may also be an external storage device of the network relay device 5 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the network relay device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the network relay device 5. The memory 51 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
Embodiments of the present application provide a computer program product, which when executed on a network relay device, enables the network relay device to implement the steps in the above method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include at least: any entity or apparatus capable of carrying computer program code to a terminal device, recording medium, computer Memory, read-Only Memory (ROM), random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed data distinguishing device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (9)
1. A method for data differentiation, comprising:
configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data;
determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag; the data transmission path at least comprises a data transmission path of a virtual interface and a network bridge in the communication process of a router and a server, wherein the virtual interface is an interface which is virtualized by the router in advance, the network bridge is used for bearing services, different network bridges correspond to different services, the target virtual interface is a virtual interface used for receiving the first data, and the target network bridge is used for transmitting the first data;
sending the first data to a server through the data sending path;
the data transmission path consists of a target virtual interface, a target network bridge and a wide area network interface;
the sending the first data to the server through the data sending path includes:
and sending the first data to the server side sequentially through the target virtual interface, the target network bridge and the wide area network interface.
2. The data differentiation method according to claim 1, wherein after determining the data transmission path comprising the target virtual interface and the target bridge according to said first vlan tag, further comprising:
and removing the label of the first data carrying the first virtual local area network label according to a first preset strategy to obtain the first data.
3. The data discrimination method of claim 1, further comprising:
when second data sent by the server side is received, configuring a second virtual local area network tag for the second data to obtain second data carrying the second virtual local area network tag; the second virtual local area network tag is used for describing service content corresponding to the second data;
determining a target local area network interface corresponding to the second data according to the second virtual local area network label;
and sending the second data to the target local area network interface.
4. The data distinguishing method according to claim 3, wherein the second data is data returned by the server according to the first data; or, the second data is data sent by the server to a second preset local area network interface.
5. The data differentiation method according to claim 3, wherein after determining the target lan interface corresponding to the second data according to the second vlan tag, further comprising:
and removing the label of the second data carrying the label of the second virtual local area network according to a second preset strategy to obtain the second data.
6. A data differentiation apparatus, comprising:
the first configuration unit is used for configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data;
a first determining unit, configured to determine, according to the first vlan tag, a data transmission path including a target virtual interface and a target bridge; the data transmission path at least comprises a data transmission path of a virtual interface and a network bridge in the communication process of a router and a server, wherein the virtual interface is an interface which is virtualized by the router in advance, the network bridge is used for bearing services, different network bridges correspond to different services, the target virtual interface is a virtual interface used for receiving the first data, and the target network bridge is used for transmitting the first data;
the first sending unit is used for sending the first data to a server through the data sending path;
the data transmission path consists of a target virtual interface, a target network bridge and a wide area network interface;
the sending the first data to the server through the data sending path includes:
and sending the first data to the server side sequentially through the target virtual interface, the target network bridge and the wide area network interface.
7. A router comprising a forwarding unit and a processing unit, comprising:
the forwarding unit is used for configuring a first virtual local area network tag for first data received through a first preset local area network interface to obtain the first data carrying the first virtual local area network tag; the first virtual local area network tag is used for describing service content corresponding to the first data;
the processing unit is used for determining a data transmission path comprising a target virtual interface and a target network bridge according to the first virtual local area network tag; the data transmission path at least comprises a data transmission path of a virtual interface and a network bridge in the communication process of the router and the server, wherein the virtual interface is an interface which is virtualized by the router in advance, the network bridge is used for bearing services, different network bridges correspond to different services, the target virtual interface is a virtual interface used for receiving the first data, and the target network bridge is used for transmitting the first data;
the processing unit is further configured to send the first data to a server through the data sending path;
the data transmission path consists of a target virtual interface, a target network bridge and a wide area network interface;
the sending the first data to the server through the data sending path includes:
and sending the first data to the server side sequentially through the target virtual interface, the target network bridge and the wide area network interface.
8. A network relay device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the data discrimination method of any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out a data discrimination method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011631360.3A CN112822087B (en) | 2020-12-30 | 2020-12-30 | Data distinguishing method, data distinguishing device, router and network relay equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011631360.3A CN112822087B (en) | 2020-12-30 | 2020-12-30 | Data distinguishing method, data distinguishing device, router and network relay equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112822087A CN112822087A (en) | 2021-05-18 |
CN112822087B true CN112822087B (en) | 2022-12-20 |
Family
ID=75855176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011631360.3A Active CN112822087B (en) | 2020-12-30 | 2020-12-30 | Data distinguishing method, data distinguishing device, router and network relay equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112822087B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115473835B (en) * | 2022-08-05 | 2023-09-26 | 北京罗克维尔斯科技有限公司 | Flow statistics method and related equipment |
CN117714807B (en) * | 2023-07-05 | 2024-08-20 | 荣耀终端有限公司 | Playing method, device, storage medium and program product of network television service |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN200983596Y (en) * | 2006-06-29 | 2007-11-28 | 中兴通讯股份有限公司 | A digital user line access multiplexer for multi-service distinguishing |
CN102318291B (en) * | 2011-07-14 | 2014-02-19 | 华为技术有限公司 | Business flow processing method, device and system |
CN111614580B (en) * | 2019-02-26 | 2023-06-27 | 迈普通信技术股份有限公司 | Data forwarding method, device and equipment |
CN111800326B (en) * | 2019-04-08 | 2021-08-24 | 中移(苏州)软件技术有限公司 | Message transmission method and device, processing node and storage medium |
-
2020
- 2020-12-30 CN CN202011631360.3A patent/CN112822087B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112822087A (en) | 2021-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112822087B (en) | Data distinguishing method, data distinguishing device, router and network relay equipment | |
CN110991575B (en) | Asset inventory method and device, readable storage medium and robot | |
CN114048164B (en) | Chip interconnection method, system, device and readable storage medium | |
CN110601880A (en) | Cloud platform, service processing method, command interface and computer equipment | |
CN110177010B (en) | Link switching method and device | |
CN112732982B (en) | Fault code storage method and device, terminal equipment and readable storage medium | |
CN113157625A (en) | Data transmission method and device, terminal equipment and computer readable storage medium | |
JP6701377B2 (en) | SIP information analysis method, device, server and medium | |
CN109995548B (en) | Device management method and system, data transmission method and system and terminal device | |
CN112511215A (en) | Data channel switching method and terminal equipment | |
CN112437035B (en) | Distributed denial of service attack protection method and related equipment | |
CN112632619A (en) | Cross-link certificate storage method and device, terminal equipment and storage medium | |
CN109639555B (en) | Link layer message generation method, link layer message generation device and terminal equipment | |
CN112669471B (en) | Gate and ticket checking transaction method, device and storage medium thereof | |
CN114326673A (en) | Vehicle remote diagnosis method and device, connector and storage medium | |
CN114338270A (en) | Data communication method, device, electronic equipment and storage medium | |
CN114553288A (en) | Satellite data sending method and terminal equipment | |
CN109885519B (en) | Connection switching method for serial port of main control board and main control board | |
CN113395264A (en) | Communication connection method, apparatus, server and medium | |
CN112615659A (en) | Data channel switching method and Beidou multichannel antenna | |
CN112566082B (en) | Data transmission method, device, equipment and medium | |
CN109597813B (en) | Vehicle data processing method and device | |
CN105656795A (en) | Flow control method of virtual machine and physical machine | |
CN111050339B (en) | High-speed data updating system and method based on protocol non-perception forwarding | |
CN111866089A (en) | Network communication proxy method, device 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 |