CN116095019B - Route processing method, device, equipment and storage medium - Google Patents

Route processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN116095019B
CN116095019B CN202211001389.2A CN202211001389A CN116095019B CN 116095019 B CN116095019 B CN 116095019B CN 202211001389 A CN202211001389 A CN 202211001389A CN 116095019 B CN116095019 B CN 116095019B
Authority
CN
China
Prior art keywords
message
priority
forwarding
router
processing function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211001389.2A
Other languages
Chinese (zh)
Other versions
CN116095019A (en
Inventor
施磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211001389.2A priority Critical patent/CN116095019B/en
Publication of CN116095019A publication Critical patent/CN116095019A/en
Application granted granted Critical
Publication of CN116095019B publication Critical patent/CN116095019B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority

Abstract

The application provides a routing processing method, a device, equipment and a storage medium, which are applied to the technical field of terminals. The method can be applied to network layer equipment such as routers and the like, and comprises the following steps: and receiving a first message and a second message from different terminal equipment, and setting priorities for the first message and the second message respectively by calling the first processing function and the second processing function in sequence. The first processing function is used for intercepting the message and setting the service priority of the message according to the service priority, the second processing function is used for intercepting the message and setting the device priority of the message according to the device priority, and the first processing function calls the priority higher than the second processing function, so that the priorities of the first message and the second message are finally the device priority of the message, if the device priority of the first message is higher than the second message, the first message is forwarded preferentially, and the message forwarding of each terminal device is dynamically coordinated, so that the limited network resources of the router are fully utilized, and the processing performance of the router is improved.

Description

Route processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a routing processing method, device, equipment, and storage medium.
Background
In recent years, intelligent home devices are increasingly popular, and users have strong demands on intelligent devices such as intelligent home appliances, intelligent sound boxes, intelligent door locks and the like, so that the intelligent home devices are promoted to be in a high-speed growth situation. At present, in an intelligent home scene, intelligent equipment can be connected with a wireless network through a router, and interconnection and intercommunication among the equipment can be realized through the router.
After a plurality of intelligent devices are connected to the router, if a certain device downloads a large file, normal use of other devices is directly affected, such as game blocking, video cannot be played, pages cannot be opened, and the like, of the devices, and user experience is poor. Thus, improving router performance is a problem that is worth discussing.
Disclosure of Invention
The embodiment of the application provides a routing processing method, a device, equipment and a storage medium, so as to improve router performance.
In a first aspect, an embodiment of the present application provides a routing processing method, where an execution body of the method may be a network layer device such as a router or a chip in the device. In the method, a first message from a first terminal device and a second message from a second terminal device are received, wherein the service priority of the first message is lower than that of the second message, and the device priority of the first terminal device is higher than that of the second terminal device; calling a first processing function to intercept the first message, and determining a first priority of the first message based on the service priority; calling a second processing function to intercept the first message, and updating the first priority of the first message into a second priority based on the equipment priority; calling the first processing function to intercept the second message, and determining a third priority of the second message based on service priority, wherein the first priority is lower than the third priority; calling the second processing function to intercept the second message, and updating the third priority of the second message to a fourth priority based on the equipment priority, wherein the second priority is higher than the fourth priority; forwarding the first message based on the second priority, and forwarding the second message based on the fourth priority after forwarding the first message.
The router, the first terminal device and the second terminal device are located in the same local area network.
The first priority is the service priority of the first message, and the second priority is the equipment priority of the first message. The third priority is the service priority of the second message, and the fourth priority is the equipment priority of the second message.
In this way, although the service priority of the first message is lower than that of the second message, the device priority of the first message is higher than that of the second message, and the router forwards the first message with higher device priority and forwards the second message with lower device priority based on the device priority, so that the message forwarding of each terminal device is dynamically coordinated, limited network resources of the router are fully utilized, the processing performance of the router is improved, and the experience of a user in using a network is improved.
In one possible embodiment, the first processing function has a higher call priority than the second processing function.
The first processing function can be used for intercepting a message and writing a message priority determined according to the service type in a preset field of the message. The second processing function may be configured to intercept the message and write a message priority determined according to the device identifier in a preset field of the message. The message priority written by the second processing function will cover the message priority written by the first processing function.
In this way, the first processing function is called, then the second processing function is called, and finally the message priority written into the preset message field is determined according to the equipment identifier.
In a possible implementation manner, the determining the first priority of the first packet based on the service priority includes: identifying the service type of the first message; and determining the first priority of the first message based on the service type of the first message and the first configuration information of the service priority.
In a possible implementation manner, the determining, based on the service priority, the third priority of the second packet includes: identifying the service type of the second message; determining a third priority of the second message based on the service type of the second message and the first configuration information;
the first configuration information includes a corresponding relation between a service type and a service priority.
Thus, after the service type of the message is obtained, the service priority of the message can be determined by combining the corresponding relation between the service type and the service priority preset in the router, so that the service priority of the message is written in the preset field of the message.
In a possible implementation manner, the identifying the service type of the first packet includes: and acquiring the feature code of the first message from the first message, and acquiring the service type corresponding to the feature code of the first message by querying a feature code knowledge base.
In a possible implementation manner, the identifying the service type of the second packet includes: and acquiring the feature code of the second message from the second message, and acquiring the service type corresponding to the feature code of the second message by inquiring the feature code knowledge base.
The feature code knowledge base comprises a preset corresponding relation between message feature codes and service types.
In this way, by analyzing the feature codes of the message and combining the corresponding relation between the feature codes and the service types preset in the router, the service types of the message can be determined, so that the service priority of the message can be determined later.
In a possible implementation manner, the updating the first priority of the first message to the second priority based on the device priority includes: acquiring the equipment identifier of the first message from the first message; determining a second priority of the first message based on the equipment identifier of the first message and second configuration information of the equipment priority; updating the first priority to a second priority.
In a possible implementation manner, the updating the third priority of the second message to the fourth priority based on the device priority includes: acquiring the equipment identifier of the second message from the second message; determining a fourth priority of the second message based on the equipment identifier of the second message and second configuration information of the equipment priority; updating the third priority to a fourth priority.
The second configuration information comprises a corresponding relation between the equipment identifier and the equipment priority.
Alternatively, the second configuration information may be determined based on user-configured device priority.
In this way, after the device identifier of the message is obtained, the device priority of the message can be determined by combining the corresponding relation between the device identifier and the device priority preset in the router, so that the device priority of the message is written in a coverage mode in the preset field of the message, and the device priority of the message is used as the priority of the final forwarding message.
In one possible implementation manner, forwarding the first packet based on the second priority, after forwarding the first packet, forwarding the second packet based on the fourth priority includes: adding the first message to a first message forwarding queue corresponding to the second priority based on the second priority; adding the second message to a second message forwarding queue corresponding to the fourth priority based on the fourth priority; the message forwarding priority of the first message forwarding queue is higher than that of the second message forwarding queue; forwarding the first message in the first message forwarding queue, and forwarding the second message in the second message forwarding queue after forwarding the first message.
In this way, based on the device priority of the message, the message is added to the message forwarding queue corresponding to the device priority, the router forwards the message in the message forwarding queue corresponding to the higher device priority, and then forwards the message in the message forwarding queue corresponding to the lower device priority, so that the message forwarding of each terminal device is dynamically coordinated, and the limited network resources of the router are fully utilized.
In a second aspect, an embodiment of the present application provides a router processing apparatus, including: the device comprises a receiving module, a receiving module and a sending module, wherein the receiving module is used for receiving a first message from a first terminal device and a second message from a second terminal device, the service priority of the first message is lower than that of the second message, and the device priority of the first terminal device is higher than that of the second terminal device; the processing module is used for calling a first processing function to intercept the first message and determining the first priority of the first message based on the service priority; calling a second processing function to intercept the first message, and updating the first priority of the first message into a second priority based on the equipment priority; calling the first processing function to intercept the second message, and determining a third priority of the second message based on service priority, wherein the first priority is lower than the third priority; calling the second processing function to intercept the second message, and updating the third priority of the second message to a fourth priority based on the equipment priority, wherein the second priority is higher than the fourth priority; and the sending module is used for forwarding the first message based on the second priority, and forwarding the second message based on the fourth priority after forwarding the first message.
In one possible embodiment, the first processing function has a higher call priority than the second processing function.
In a possible implementation manner, the processing module is configured to identify a service type of the first packet; determining a first priority of the first message based on the service type of the first message and first configuration information of the service priority;
in a possible implementation manner, the processing module is configured to identify a service type of the second packet; determining a third priority of the second message based on the service type of the second message and the first configuration information;
the first configuration information includes a corresponding relation between a service type and a service priority.
In a possible implementation manner, the processing module is configured to obtain a feature code of the first packet from the first packet, and obtain, by querying a knowledge base of feature codes, a service type corresponding to the feature code of the first packet;
in a possible implementation manner, the processing module is configured to obtain a feature code of the second packet from the second packet, and obtain a service type corresponding to the feature code of the second packet by querying the feature code knowledge base;
The feature code knowledge base comprises a preset corresponding relation between message feature codes and service types.
In a possible implementation manner, the processing module is configured to obtain, from the first packet, an equipment identifier of the first packet; determining a second priority of the first message based on the equipment identifier of the first message and second configuration information of the equipment priority; updating the first priority to a second priority;
in a possible implementation manner, the processing module is configured to obtain, from the second packet, an equipment identifier of the second packet; determining a fourth priority of the second message based on the equipment identifier of the second message and second configuration information of the equipment priority; updating the third priority to a fourth priority;
the second configuration information comprises a corresponding relation between the equipment identifier and the equipment priority.
In a possible implementation manner, the processing module is configured to add the first packet to a first packet forwarding queue corresponding to the second priority based on the second priority; adding the second message to a second message forwarding queue corresponding to the fourth priority based on the fourth priority; the message forwarding priority of the first message forwarding queue is higher than that of the second message forwarding queue; the sending module is used for forwarding the first message in the first message forwarding queue, and forwarding the second message in the second message forwarding queue after forwarding the first message.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor for invoking a computer program in the memory to perform the method according to any of the first aspects.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing computer instructions that, when run on an electronic device, cause the electronic device to perform the method of any one of the first aspects.
In a fifth aspect, embodiments of the present application provide a chip comprising a processor for invoking a computer program in memory to perform a method according to any of the first aspects.
In a sixth aspect, a computer program product comprising a computer program which, when run, causes a computer to perform the method according to any of the first aspects.
It should be understood that, the second aspect to the sixth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a router according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a network configuration system according to an embodiment of the present application;
fig. 5 is a schematic diagram of a network configuration system according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an internal processing framework of a router according to an embodiment of the present disclosure;
fig. 7 is a flow chart of a routing processing method provided in an embodiment of the present application;
fig. 8 is an interface schematic diagram of a router according to an embodiment of the present application;
fig. 9 is a schematic diagram of a packet forwarding queue of a router interface according to an embodiment of the present application;
fig. 10 is a schematic diagram of a packet forwarding queue of a router interface according to an embodiment of the present application;
fig. 11 is a flow chart of a routing processing method provided in the embodiment of the present application;
fig. 12 is a flow chart of a routing processing method provided in an embodiment of the present application;
FIG. 13 is a schematic diagram of an interface change provided in an embodiment of the present application;
FIG. 14 is a schematic diagram of an interface change provided in an embodiment of the present application;
Fig. 15 is a flow chart of a routing processing method provided in the embodiment of the present application;
fig. 16 is a schematic structural diagram of a routing processing device according to an embodiment of the present application;
fig. 17 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and effect. For example, the first chip and the second chip are merely for distinguishing different chips, and the order of the different chips is not limited. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
A router (router) is a hardware device that connects two or more networks, acting as a gateway between the networks, and is a dedicated intelligent network device that reads the address in each message and determines how to transmit. The router is able to understand different protocols, such as the ethernet protocol used by a certain local area network, the transmission control protocol/internet protocol used by the internet (Transmission Control Protocol/Internet Protocol, TCP/IP). In this way, the router can analyze the destination addresses of the messages transmitted by various different types of networks, and convert the addresses of the non-TCP/IP networks into TCP/IP addresses, or vice versa; and then transmitting each message to the designated position according to the optimal route according to the selected routing algorithm.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application, where the application scenario shown in fig. 1 is an intelligent home scenario, and the scenario includes a router 11 and a plurality of terminal devices, where the terminal devices include, for example, a sound box 12, a mobile phone 13, a refrigerator 14, and a television 15 in fig. 1, and the plurality of terminal devices are respectively in communication connection with the router 11, and the plurality of terminal devices and the router 11 are located in the same local area network.
In some embodiments, the plurality of terminal devices are respectively connected to the internet through the router 11, for example, a user listens to music using the sound box 12, the user plays a game using the mobile phone 13, the user views a recipe picture and text using the refrigerator 14, the user views a network video using the television 15, and the like. It can be imagined that after the home multi-terminal accesses the same router, if the multi-terminal has network traffic demand at the same time and any terminal is downloading large files, the normal use of other devices can be affected. For example, the user a downloads a large file in a mobile phone, occupies a large flow, causes the situation that the video being watched by the user B is blocked, the browsing page is delayed and can not be opened, and the use experience of the user is poor.
For the above case, the user can alleviate by: firstly, the user B informs the user A to pause downloading the large file, and the user A continues to download after the user B finishes using. Secondly, the user B opens a router application program App or a network Web page through the terminal equipment, and the speed limit is manually carried out on the equipment of the user A.
In the first way, the users need to communicate and coordinate, and the user a pauses downloading the large file, so as to influence the service experience. The second mode has the following problems: the common user has unclear concept of network speed limit, is unfamiliar with units such as Kbps, mbps and the like of speed limit, has unclear how to set speed limit values, and has great function use resistance. In addition, the user B manually sets the device network speed of the user a, and after the user B completes the service, the user B needs to manually set the device network speed of the user a to a default value again, otherwise, the device network speed of the user a is still limited under the condition that no other device occupies the router bandwidth, so that the experience of the user a using the network is poor.
Based on this, the embodiment of the application provides a routing processing method, where a terminal device provides a configuration interface of device priority for a user, and generates priority configuration information based on device identification by acquiring configuration of the user on the configuration interface of the priority of the intelligent device in the home environment. The router receives the priority configuration information from the terminal equipment, combines the priority configuration information pre-stored by the terminal equipment and based on the service type, executes twice interception of the message to be forwarded, finally writes the message priority determined based on the equipment identifier in a preset field of the message, and adds the message to be forwarded to a forwarding queue corresponding to the message priority to complete the forwarding task of the message. In the scheme, the router dynamically coordinates message forwarding of each device based on the device priority configured by the user so as to fully utilize limited network resources of the router and improve the processing performance of the router, thereby achieving the following effects:
1) The network resources of the router can be preferentially used by the high-priority devices;
2) When the low-priority device singly uses the network, all the routing network resources can be used;
3) When the devices with different priorities use the network at the same time, the service smoothness of the devices with high priority can be ensured, and the devices with low priority can also be ensured to continuously use the network resources;
4) After the high-priority device finishes using the network, the low-priority device can automatically use more network resources, so that the user experience of using the network is improved.
The following first describes the structure of the device involved in the technical solution provided in the embodiment of the present application.
Fig. 2 is a schematic structural diagram of a router according to an embodiment of the present application, and the router 20 shown in fig. 2 includes a memory 21, a processor 22, a radio frequency device 23, and an antenna 24.
Memory 21 may be used to store computer executable program code that includes instructions. The memory 21 may include a stored program area and a stored data area. Wherein the memory program area may store execution code associated with message forwarding and execution code associated with processing of messages textually. The storage data area may store data related to forwarding and local processing of the message, such as five-tuple information of the message (including source IP address, source port, destination IP address, destination port, and transport layer protocol), configuration information of the router by the user, and the like.
The processor 22 may include one or more processing units, for example, processing modules or processing circuits that may include a central processing unit (centralprocessing unit, CPU), an image processor (graphicsprocessing unit, GPU), a digital signal processor (digital signal processor, DSP), a microprocessor (micro-programmed control unit, MCU), an Artificial Intelligence (AI) processor, or a programmable logic device (field programmablegatearray, FPGA), or the like. Wherein the different processing units may be separate devices or may be integrated in one or more processors. Optionally, a memory unit may be provided in the processor 22 for storing instructions and data. In some embodiments, the storage unit in the processor 22 is a cache memory.
The radio frequency device 23 is a device that can generate high-frequency alternating electromagnetic waves. The radio frequency device 23 includes a wireless fidelity (wireless fidelity, wi-Fi) radio frequency device, a Bluetooth (BT) radio frequency device, a 2G/3G/4G/5G etc. radio frequency device, a frequency modulation (frequency modulation, FM) radio frequency device, a near field communication technology (nearfield communication, NFC) radio frequency device, etc.
Fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present application, and the terminal device 30 shown in fig. 3 includes an antenna 1, an antenna 2, a processor 31, a memory 32, a wireless communication module 33, a power source 34, a mobile communication module 35, an audio processing module 36, a display 37, a sensor module 38, and keys 39.
The processor 31 may include one or more processing units, such as: the processor 31 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processingunit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. A memory may also be provided in the processor 31 for storing instructions and data. In some embodiments, the memory in the processor 31 may be a cache memory, which may hold instructions or data that the processor 31 has just used or recycled. In some embodiments, the processor 31 may include one or more interfaces.
The power supply 34 supplies power to the processor 31, the memory 32, the wireless communication module 33, the mobile communication module 35, the audio processing module 36, the display 37, the sensor module 38, the keys 39, and the like.
The wireless communication function of the terminal device 30 can be realized by the antenna 1, the antenna 2, the mobile communication module 35, the wireless communication module 33, and the like. In some embodiments, the antenna 1 of the terminal device 30 is coupled to the mobile communication module 35 and the antenna 2 is coupled to the wireless communication module 33 so that the terminal device 30 can communicate with the network and other devices through wireless communication technology.
The mobile communication module 35 may provide a solution for wireless communication including 2G/3G/4G/5G etc. applied on the terminal device 30. The mobile communication module 35 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc.
The wireless communication module 33 may provide solutions for wireless communication including wireless local area network (wirelesslocal area networks, WLAN) (e.g., wireless fidelity network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to the terminal device 30.
The terminal device 30 realizes a display function by a GPU, a display screen 37, an application processor, and the like. In some embodiments, the terminal device 30 may include 1 or N displays 37, N being a positive integer greater than 1.
Memory 32 may be used to store computer-executable program code that includes instructions. The memory 32 may include a stored program area and a stored data area. The storage program area may store an application program (such as a sound playing function, an image display function, etc.) required for at least one function of the operating system, and the like.
The audio processing module 36 includes an audio transceiver 361 and an audio codec 362. The sensor module 38 includes a pressure sensor 381 and a touch sensor 382. The keys 39 include a volume key, a switch key, and the like.
It should be noted that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the router 20 and the terminal device 30; it will be appreciated that router 20 and terminal device 30 may include more or fewer components than shown, or may combine certain components, or split certain components, or a different arrangement of components; wherein the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The method provided by the embodiment of the application can be applied to a network configuration system. Fig. 4 and 5 exemplarily present two network configuration systems. The network configuration system includes a router and a terminal device, or the network configuration system includes a router, a terminal device, and a server.
Fig. 4 is a schematic diagram of a network configuration system provided in an embodiment of the present application, where the network configuration system shown in fig. 4 includes a router 20 and a terminal device 30. The terminal device 30 may run a client of the network configuration system, which may be an application program or a Web browser of the network configuration system. The terminal device 30 transmits configuration information indicating the priorities of the plurality of devices configured by the user to the router 20 in response to a configuration operation of the priorities of the plurality of devices connected to the router 20 by the user. Router 20 receives the configuration information and processes forwarding of the device messages based on the configuration information.
Fig. 5 is a schematic diagram of a network configuration system provided in an embodiment of the present application, where the network configuration system shown in fig. 5 includes a router 20, a terminal device 30, and a server 40. The terminal device 30 may operate a client of the network configuration system, and the server 40 may operate a server of the network configuration system. The terminal device 30 acquires configuration information indicating priorities of a plurality of devices configured by a user in response to a configuration operation of the priorities of the plurality of devices connected to the router 20 by the user. The terminal device 30 transmits a configuration request including configuration information to the server 40, the configuration request requesting the server 40 to forward the configuration information to the router 20, so that the router 20 processes forwarding of the respective device messages based on the configuration information.
In the above embodiment, the terminal device 30 may be a mobile phone, a tablet computer, a smart watch, a notebook computer, or the like, and the type of the terminal device is not specifically limited in the embodiment of the present application. The server 40 may be a general server or a cloud server, which is also called a cloud computing server or a cloud host, and is a host product in a cloud computing service architecture. Alternatively, the server 40 may be a server of a distributed system, or a server combined with a blockchain, and the type of the server is not specifically limited in the embodiments of the present application.
Alternatively, the router 20 may use a netfilter framework, where some processing nodes are set in several positions in the whole network flow, and some processing functions are registered on each processing node to perform corresponding processing. The internal processing framework of the router is briefly described below with reference to fig. 6.
Fig. 6 is a schematic diagram of an internal processing framework of a router according to an embodiment of the present application, where the router shown in fig. 6 includes 5 processing nodes, which are a pre-routing node, an input node, an output node, a forwarding node, and a publishing node. The pre-routing node may be configured to determine whether a message needs a message that is processed locally by a router (localhost).
If the pre-routing node determines that the message needs to be processed locally by the router, the message is sent to the input node, and after the message is processed locally, the message sequentially passes through the output node and the issuing routing node to complete message forwarding.
If the pre-routing node determines that the message does not need to be processed locally by the router (i.e. only the message is forwarded), the message is sent to the forwarding node, the forwarding node can be used for setting the priority of the message, and finally the message forwarding is completed by issuing the routing node.
Based on the network configuration system, the router receives the configuration information from the terminal equipment, the configuration information indicates the priorities of a plurality of equipment configured by the user, the router can dynamically adjust the message forwarding priorities of different equipment in the local area network where the router is located according to the configuration information, the messages with high priorities use network resources preferentially, and the experience of the user using the local area network is improved. The following describes a routing processing method provided in the embodiment of the present application in detail with reference to the accompanying drawings.
Fig. 7 is a flow chart of a routing processing method according to an embodiment of the present application. As shown in fig. 7, the routing processing method of the present embodiment may include the steps of:
Step 701, the terminal device sends a first message to the router.
In this embodiment, the terminal device and the router are in the same lan.
Step 702, the router determines whether the first packet needs local processing.
If the first message needs to be processed locally, step 703 is executed; if the first message does not require local processing, step 704 is performed.
As an example, the router obtains the destination IP address of the first message by reading the quintuple information in the first message, and if the destination IP address is the IP address of the router, the first message is a message that needs to be processed locally; if the destination IP address is not the IP address of the router, the first message is a message to be forwarded.
As an example, in connection with the router shown in fig. 6, the determining step may be performed at a pre-routing node of the router.
Step 703, the router performs local processing on the first packet.
The router performs local processing on the first message, including the following two cases:
in the first case, the router performs local processing only according to the first message, and does not send the first message to the outside.
Illustratively, the user performs relevant configuration of the router, such as device priority configuration, through the router application App of the terminal device, and the terminal device sends a first message to the router, where the first message includes configuration information of the router by the user, and the router performs local processing, such as writing relevant configuration, according to the first message.
The user sends an instruction for restarting the router through the router APP of the terminal device, the destination address of the instruction is the router IP address, and the router is locally processed to execute the restarting task.
In the second case, the router forwards the processed first message to the outside after performing local processing on the first message. For example, after the router changes the configuration, if the configuration information needs to be synchronized with the terminal device, the configuration information needs to be forwarded to the outside.
It should be noted that, in the second case, the router generally adds the processed first packet to the packet forwarding queue with the lowest priority, and waits for forwarding the packet. Of course, the priority of the message processed by the router may be adjusted according to the actual application requirement, which is not limited in this embodiment of the present application.
As an example, in connection with the router shown in fig. 6, after the pre-routing node of the router determines that the message needs to be processed locally, the message may be sent to the input node to perform local processing. Optionally, after the message is processed locally, the message can also be sent to the issuing routing node through the output node to wait for forwarding the message.
Step 704, the router invokes a first processing function, determines a first priority of the first message based on the first configuration information, and writes the first priority into a preset field of the first message.
Step 705, the router invokes a second processing function, determines a second priority of the first message based on the second configuration information, and updates (i.e., rewrites) a preset field of the first message.
As an example, in connection with the router shown in fig. 6, after the pre-routing node of the router determines that the packet does not need to be processed locally, the packet may be sent to the forwarding node, where the first processing function and the second processing function are sequentially invoked.
The forwarding node of the router is configured with at least a first processing function and a second processing function. The first processing function may be configured to set a message priority according to a service type of the message, and the second processing function may be configured to set the message priority according to a device identifier of the message.
The first processing function is usually a pre-configured processing function in the router forwarding node, and may be used to intercept a packet, and write a packet priority number determined according to the packet service type in a pre-set field of the packet, for example, write a tos value in an IP header of the packet, where the tos value is the priority number of the packet. The second processing function is a new processing function configured at the forwarding node of the router based on the user's configuration requirements for the priority of the devices in the local area network where the router is located. Similar to the first processing function, the second processing function may also be configured to intercept the message and overlay write the priority number of the message determined according to the message device identifier in a preset field of the message.
Alternatively, the preset field of the message may occupy one byte (i.e., 8 bits), the higher 6 bits (differentiated services codepoint, DSCP field) may be used to indicate the priority number of the message, the range of values for the priority number is [0,64], and the highest priority number may be set to 64.
The second processing function has a lower call priority than the first processing function. Specifically, in connection with the router shown in fig. 6, at least a first processing function and a second processing function are preset at a forwarding node of the router. As an example, the value of a priority field defining a first processing function is smaller than the value of a priority field defining a second processing function, the smaller the value of the priority field of the processing function, the higher the call priority of the processing function. In this embodiment, the first processing function is called first, and then the first processing function is called, so that the message priority finally written into the preset message field is the message priority determined according to the device identifier, thereby meeting the configuration requirement of the user on the network resource priority used by the device, and improving the experience of the user on the local area network where the router is located.
Optionally, the first processing function and the second processing function are hook (hook) functions, and the hook functions are used for intercepting and modifying the content of the message.
Optionally, the first configuration information includes a correspondence between a service type and a priority of the message, and the second configuration information includes a correspondence between a device type and a priority of the message.
As an example, the terminal device generates the second configuration information based on a user's configuration of the device priority in the local area network where the router is located. The terminal equipment directly sends second configuration information to the router, as shown in fig. 4; alternatively, the terminal device sends the second configuration information to the router through the server, as shown in fig. 5.
Optionally, the second configuration information includes identifiers of a plurality of terminal devices, and a priority number (i.e., a priority number of the device) corresponding to the identifier of each terminal device. The identity of the terminal device may be a media access control (media access control, MAC) address of the terminal device. In general, the larger the priority number of the device, the higher the forwarding priority of the device message.
As an example, in connection with the router shown in fig. 6, after receiving the first packet from the pre-routing node, the forwarding node of the router first invokes a first processing function, determines a first priority of the first packet based on the first configuration information, where the first priority is a packet priority determined based on a traffic type of the packet, and writes the first priority into a preset field of the first packet. And then the forwarding node calls a second processing function, determines a second priority of the first message based on the second configuration information, wherein the second priority is a message priority determined based on the equipment type of the message, and replaces the first priority in a preset field of the first message with the second priority.
It should be noted that, before the first packet enters the forwarding node of the router, the preset field of the first packet is empty, that is, the first packet is processed by the forwarding node of the router, and then the priority of the packet is sent to the first packet.
In one possible implementation, the forwarding node of the router determines the first priority of the first message by:
a1, intercepting a first message by calling a first processing function;
step b1, identifying the service type of a first message;
step c1, determining a first priority of the first message according to the service type of the first message and the first configuration information.
Optionally, step b1 may include: and acquiring the feature code of the first message, and acquiring the service type corresponding to the feature code of the first message by inquiring a feature code knowledge base. The feature code knowledge base comprises a preset corresponding relation between the message feature codes and the service types. The feature code knowledge base is a knowledge base local to the router, and the router can update the feature code knowledge base periodically.
Optionally, the service types include, but are not limited to, video, game, social, download, etc., and more service types may be set according to specific actual requirements, which is not specifically limited in this embodiment of the present application.
Optionally, the router locally pre-stores first configuration information, where the first configuration information includes a correspondence between a service type and a message priority number. Step c1 may include: and determining the priority number of the first message, namely the first priority, according to the service type of the first message and the corresponding relation between the locally pre-stored service type and the priority number of the message.
In this embodiment, the forwarding node of the router identifies the message of which service type the message belongs to by reading the feature code in the message, determines the number of the first priority of the message based on the service type of the message, and writes the number (tos value) of the first priority of the message in a preset field (e.g., IP header field) of the message.
In one possible implementation, the forwarding node of the router determines the second priority of the first message by:
a2, intercepting a first message by calling a second processing function;
step b2, acquiring the equipment identifier of the first message;
and c2, determining a second priority of the first message according to the equipment identifier of the first message and the second configuration information.
Optionally, the device identification of the first message includes a MAC address of the device.
In this embodiment, the forwarding node of the router determines the number of the second priority of the message based on the device type of the message by reading the device identifier in the message, and writes the number (tos value) of the second priority of the message in a preset field (e.g., IP header field) of the message.
Based on the above embodiment, the forwarding node of the router calls the first processing function first and then calls the second processing function, when the first processing function is called to intercept the first message, the preset field of the first message is empty, and after determining the first priority number of the first message, the first priority number is written into the preset field. When the second processing function is called to intercept the first message, the preset field is not empty, and the first priority number is written. And when the second priority number of the first message is determined, overwriting the priority number of the preset field, namely replacing the first priority number with the second priority number.
Step 706, the router adds the first message to a message forwarding queue corresponding to the second priority of the first message.
Step 707, the router forwards the first message based on the forwarding rule of the message forwarding queue.
In this embodiment, an interface (driver) of the router provides a plurality of message forwarding queues, and according to priorities of the plurality of message forwarding queues, the interface of the router forwards a message in a forwarding queue with a high priority first, forwards a message in a forwarding queue with a second priority, and forwards a message in a forwarding queue with a lower priority by analogy, where the above process is a forwarding rule of the message forwarding queue. Wherein, each message forwarding queue corresponds to a priority number (i.e. the priority number of the message).
Optionally, the router interface includes a wide area network (wide area network interface, WAN) interface, a wireless local area network (wireless local area network) interface, and the like.
Fig. 8 is an interface schematic diagram of a router according to an embodiment of the present application. As shown in fig. 8, when a plurality of terminal devices (mobile phones, PCs, etc.) are connected to the internet through a router, the router receives uplink messages from each terminal device through a WLAN interface, and forwards the uplink messages through a WAN interface. Correspondingly, the router receives the downlink message from the Internet through the WAN interface, and forwards the downlink message to each terminal device through the WLAN interface. Fig. 9 is a schematic diagram of a message forwarding queue of a router interface according to an embodiment of the present application, as shown in fig. 9, in general, messages of all devices are forwarded on a WLAN interface and a WAN interface according to a first-in first-out queue order.
In order to improve the forwarding efficiency of the device message in some service scenarios, the WLAN interface and the WAN interface of the router provide a plurality of message forwarding queues, and the message to be forwarded can be placed into the message forwarding queues corresponding to different priority numbers according to the message priority numbers of the preset fields of the network message (including the uplink message and the downlink message).
The following illustrates a message forwarding queue of a WAN interface, taking the WAN interface of a router as an example. Fig. 10 is a schematic diagram of a message forwarding queue of a router interface provided in the embodiment of the present application, as shown in fig. 10, a plurality of message forwarding queues, such as queues 1 to 4, are provided at a WAN interface of the router, where the priority numbers of the messages corresponding to the queues 1 to 4 are respectively 64, 63, 62, 61, and the higher the priority number is, the higher the priority of the message forwarding is.
In one possible implementation, the priority number of the message is determined based on the service type of the message, and the WAN interface adds the message of the same service type to the same message forwarding queue. By way of example, the service types include games, videos, downloads, etc., and the game messages, video messages, and download messages may be added to the queues 1, 2, and 3 shown in fig. 10, assuming that the priority numbers of the messages of the games, videos, and downloads are 64, 63, and 62, respectively. The router forwards the game message in the queue 1 preferentially, then the video message and finally the download message.
In one possible implementation, the priority number of the message is determined based on the device identifier of the message, and the WAN interface adds the message from the same device to the same message forwarding queue. For example, the device identifier includes MAC address 1, MAC address 2, and MAC address 3, which correspond to the mobile phone 1, the mobile phone 2, and the PC1, respectively, and the messages from MAC address 1, MAC address 2, and MAC address 3 may be added to the queue 1, the queue 2, and the queue 3 shown in fig. 10, assuming that the priority numbers of the messages from MAC address 1, MAC address 2, and MAC address 3 are 64, 63, and 62, respectively. The router priority forwards the message from the mobile phone 1, then the message from the mobile phone 2 and finally the message from the PC1 in the queue 1.
It should be noted that, the forwarding sequence of multiple messages in the same message forwarding queue is based on the first-in first-out principle.
As an example, in connection with the router shown in fig. 6, the forwarding node of the router sequentially invokes the first processing function and the second processing function, writes the priority number of the message in the preset field of the first message, forwards the first message to the publishing routing node of the router, and then forwards the first message to the router interface. The router interface may determine a message forwarding queue corresponding to the second priority according to the second priority of the first message, and add the first message to the message forwarding queue corresponding to the second priority. The router interface forwards the first message based on the forwarding rule of the message forwarding queue. In this example, since the first packet is an uplink packet sent by the terminal device to the network side, the publishing routing node forwards the first packet to the router WAN interface.
According to the routing processing method shown in the embodiment, a router receives a first message from a certain terminal device, if the first message is a message which does not need to be processed locally by the router, the message flows through a forwarding node of the router, the forwarding node is at least configured with a first processing function and a second processing function, the first processing function is used for writing the message priority according to the service type of the message, and the second processing function is used for writing the message priority according to the device identifier of the message. The forwarding node sequentially calls a first processing function and a second processing function, wherein the first processing function and the second processing function are used for intercepting a first message, and the message priority is written in a preset field of the first message. According to the calling sequence of the processing function, the message priority finally written into the preset field of the first message is determined according to the equipment identifier of the message. And the router interface adds the first message to a forwarding queue corresponding to the message priority according to the message priority of the first message determined by the forwarding node, and waits for forwarding.
The scheme can improve the efficiency of forwarding the router message and the utilization rate of network resources of the local area network where the router is located, and simultaneously, the configuration requirement of a user on the priority of using the network resources by equipment in the local area network is also met, and the following effects are realized: the device message with high priority is forwarded preferentially, so that the device message with high priority smoothly uses network resources; when the equipment with low priority uses the network, the forwarding of the equipment message with high priority is not affected; when the network resource of the router is not used by the device with high priority, the network resource can be fully used by the device with low priority, so that the experience of using the network by the user is improved.
By way of example, the processing of a message after it has entered a router is described below by way of a specific example.
Fig. 11 is a flow chart of a routing processing method provided in the embodiment of the present application. The following describes an example of receiving an uplink packet by the WLAN interface of the router. In connection with the router shown in fig. 6, as shown in fig. 11, the WLAN interface of the router receives the uplink packet, and first enters the pre-routing node of the router. After the pre-routing node judges, if the message is determined to be the message which does not need to be processed locally by the router, the pre-routing node pushes the uplink message to the forwarding node of the router.
The forwarding node first performs a hook1 function (i.e. the first processing function above): and inquiring the message service type corresponding to the message feature code in the feature code knowledge base by analyzing the feature code in the message, and marking a tos value (namely a message priority number) in the message according to the message service type. Subsequently, the forwarding node performs a hook2 function (i.e., the second processing function above): acquiring an equipment MAC address in the message by analyzing the message; inquiring tos values according to the MAC address of the equipment, for example, the tos values corresponding to the equipment 1, the equipment 2 and the equipment 3 are 64, 63 and 62 respectively; the tos value marked in the message is rewritten.
After the message processed by the forwarding node flows through the issuing routing node, the message reaches a WAN interface of the router, the WAN interface (driver) adds the message into a corresponding message forwarding queue according to the tos value marked in the message, and the forwarding task of the message is executed according to the interface message forwarding rule.
The embodiment shows a processing procedure of a message by a plurality of processing nodes in a router, if the message does not need to be processed locally by the router, the message sequentially passes through a pre-routing node, a forwarding node and an issuing routing node in the router, wherein the forwarding node can assign a priority number (such as a priority number of a device) to the message. And finally, the router interface puts the message into a corresponding message forwarding queue according to the priority number of the message, and performs forwarding of the message. The scheme can improve the efficiency of forwarding the router message and the utilization rate of network resources.
Based on the above embodiment, the second configuration information is generated by the terminal device based on the configuration of the device priority in the local area network where the router is located by the user, and the user can use any terminal device in the local area network to configure the device priority. Specifically, the user may generate the second configuration information by running a client of the network configuration system in the terminal device, and adjusting device priorities of a plurality of terminal devices connected to the router based on a configuration interface provided by the client. The process of configuring the device priority by the user is described in detail below with reference to the accompanying drawings.
Fig. 12 is a flow chart of a routing processing method provided in the embodiment of the present application, and as shown in fig. 12, the routing processing method of the embodiment may include the following steps:
step 1201, the terminal device displays a first interface, where the first interface displays a plurality of terminal devices connected to the router.
Step 1202, the terminal device obtains second configuration information in response to a first operation of at least one terminal device of the first interface.
Step 1203, the terminal device sends second configuration information to the router.
In one possible embodiment, the first interface displays a plurality of terminal devices connected to the router in list form. Alternatively, the device priorities of the plurality of terminal devices in the list decrease sequentially from top to bottom, see the list of interfaces shown in fig. 13. Alternatively, the device priorities of the plurality of terminal devices in the list decrease sequentially from left to right, see the list of interfaces shown in fig. 14.
In a possible implementation manner, the terminal device is located in the coverage area of the local area network where the router is located, and the terminal device directly sends the second configuration information to the router.
In a possible implementation manner, the terminal device is located outside the coverage area of the local area network where the router is located, and the terminal device sends the second configuration information to the router through the server.
Optionally, the first operation includes a drag operation.
Exemplary, fig. 13 is a schematic diagram of an interface change provided in an embodiment of the present application. As shown in fig. 13 a, the first interface 1300 is a mobile phone interface for configuring the priority of the device, and the user can customize the priority of the device at the first interface 1300. Assume that a terminal device of a current access router has: the first interface 1300 displays the above 5 terminal devices in list form, including the mobile phone 1, the mobile phone 2, the personal computers PC1, PC2, and the television 1.
Optionally, the plurality of terminal devices may be first ordered according to the time when the terminal device first accesses the router, for example, the terminal device that is first added is located at the top of the list, or the terminal device that is last added is located at the top of the list. The priority order of the plurality of terminal apparatuses shown in fig. 13 a is: handset 1 > handset 2 > PC1 > PC2 > TV 1. In response to a drag operation of the user on the PC1 of the first interface 100, a release position of the drag operation on the screen is acquired, a priority order of the plurality of terminal devices is redetermined, and the second configuration information is generated. The second configuration information includes identifiers of 5 devices in the first interface 1300, and a priority number corresponding to each device identifier. As shown in fig. 13 b, based on the above-described drag operation by the user, the priority order of the plurality of terminal apparatuses is updated as: handset 1 > handset 2 > PC2 > TV 1 > PC1.
Optionally, the user may adjust the positions of the plurality of terminal devices in the list in the first interface 1300 through multiple drag operations, where the terminal devices generate the second configuration information based on the multiple drag operations, and send the second configuration information to the router.
Fig. 14 is an exemplary schematic interface diagram provided in the embodiment of the present application, where the first interface 1400 shown in fig. 14 is a PC-side interface diagram for configuring device priorities, and the first interface 1400 may sequentially display, from left to right, a plurality of terminal devices connected to the router in the form of terminal device icons, and similarly, a user may adjust the device priorities of the plurality of terminal devices through a drag operation on the terminal device icons in the first interface 1400.
According to the routing processing method shown in the embodiment, a user can call a first interface for configuring the device priority through any one of terminal devices connected with the router, and specifically, the user can call the first interface through a client of a running network configuration system. And generating second configuration information by acquiring the position adjustment condition of the user on the plurality of terminal devices at the first interface, and sending the second configuration information to the router, so that the router dynamically coordinates network resources of the plurality of terminal devices based on the second configuration information, and the utilization rate of the routing network resources is improved.
Based on the embodiment shown in fig. 7, the embodiment of the application also provides a routing processing method, which relates to how a router forwards a plurality of messages when receiving the plurality of messages. In order to facilitate understanding, the following embodiments take two messages as examples to describe a scheme, where the two messages are a first message and a second message, and the first message and the second message are both messages that need to be forwarded by a router and are respectively from different terminal devices.
Fig. 15 is a flow chart of a routing processing method according to an embodiment of the present application. The execution body of the routing processing method of the present embodiment may be a network layer device such as a router, as shown in fig. 15, and the routing processing method may include the following steps:
step 1501, a first message from a first terminal device is received.
Step 1502, a second message from a second terminal device is received.
The service priority of the first message is lower than that of the second message, and the equipment priority of the first terminal equipment is higher than that of the second terminal equipment.
In this embodiment, the receiving order of the first message and the second message is not limited. The router may receive the first packet first and then receive the second packet, or may receive the second packet first and then receive the first packet, or may receive the first packet and the second packet simultaneously, which is not limited in this embodiment.
It should be noted that, the preset field of the first message and the second message initially received by the router is null, and the preset field is used for recording the priority of the message.
And 1503, calling a first processing function to intercept the first message, and determining the first priority of the first message based on the service priority.
As an example, in connection with fig. 6, a forwarding node of a router invokes a first processing function to intercept a first message, and determines a first priority of the first message based on traffic priorities.
As an example, determining the first priority of the first message based on the traffic priority specifically includes: identifying the service type of the first message; and determining the first priority of the first message based on the service type of the first message and the first configuration information of the service priority. The first configuration information comprises a corresponding relation between the service type and the service priority. In this example, the first priority is the traffic priority of the first packet.
Optionally, identifying the service type of the first message by: and acquiring the feature code of the first message from the first message, and acquiring the service type corresponding to the feature code of the first message by inquiring a feature code knowledge base. The feature code knowledge base comprises a preset corresponding relation between the message feature codes and the service types.
As an example, after determining the first priority of the first packet, the first priority is written into a preset field of the first packet.
Step 1504, call a second processing function to intercept the first message, and update the first priority of the first message to the second priority based on the device priority.
As an example, in connection with fig. 6, a forwarding node of the router invokes a second processing function to intercept the first message, updating the first priority of the first message to a second priority based on the device priority.
As an example, updating the first priority of the first message to the second priority based on the device priority specifically includes: acquiring a device identifier of a first message from the first message; determining a second priority of the first message based on the device identifier of the first message and second configuration information of the device priority; the first priority is updated to the second priority. The second configuration information comprises a corresponding relation between the device identification and the device priority. In this example, the second priority is the device priority of the first message.
As an example, updating the first priority to the second priority specifically includes: and replacing the first priority in the preset field of the first message with the second priority. Therefore, the router calls the first processing function and the second processing function in sequence, and finally determines the priority of the first message as the equipment priority of the first message.
Step 1505, the first processing function is called to intercept the second message, and the third priority of the second message is determined based on the service priority. Wherein the first priority is lower than the third priority.
As an example, in connection with fig. 6, a forwarding node of the router invokes a first processing function to intercept a second message and determines a third priority of the second message based on traffic priority.
As an example, determining the third priority of the second message based on the service priority specifically includes: identifying the service type of the second message; and determining a third priority of the second message based on the service type of the second message and the first configuration information. The first configuration information comprises a corresponding relation between the service type and the service priority. In this example, the third priority is the traffic priority of the second packet.
Optionally, identifying the service type of the second message by: and acquiring the feature code of the second message from the second message, and acquiring the service type corresponding to the feature code of the second message by inquiring a feature code knowledge base. The feature code knowledge base comprises a preset corresponding relation between the message feature codes and the service types.
As an example, after determining the third priority of the second packet, the third priority is written into a preset field of the second packet.
Step 1506, call the second processing function to intercept the second message, and update the third priority of the second message to the fourth priority based on the device priority. Wherein the second priority is higher than the fourth priority.
As an example, in connection with fig. 6, the forwarding node of the router invokes the second processing function to intercept the second message, and updates the third priority of the second message to the fourth priority based on the device priority.
As an example, updating the third priority of the second message to the fourth priority based on the device priority specifically includes: acquiring the equipment identifier of the second message from the second message; determining a fourth priority of the second message based on the device identifier of the second message and second configuration information of the device priority; the third priority is updated to the fourth priority. The second configuration information comprises a corresponding relation between the device identification and the device priority. In this example, the fourth priority is the device priority of the second message.
Alternatively, the second configuration information may be determined based on user-configured device priority.
As an example, updating the third priority to the fourth priority specifically includes: and replacing the third priority in the preset field of the second message with the fourth priority. Therefore, the router calls the first processing function and the second processing function in sequence, and finally determines the priority of the second message as the equipment priority of the second message.
The steps 1503 and 1504 of the present embodiment are sequentially executed, and the steps 1505 and 1506 are sequentially executed. Step 1503 and step 1504 may be performed first, followed by step 1505 and step 1506; step 1505 and step 1506 may also be performed first, and then step 1503 and step 1504 may be performed, depending on the time when the router receives the first message and the second message, where the router typically sets priority to the preset fields of the messages in sequence according to the order of message reception.
Based on the above steps 1503 to 1506, the calling priority of the first processing function is greater than that of the second processing function, that is, the router calls the first processing function first and then calls the second processing function, and finally completes writing of the message priority, and finally the priority of the message preset field is the device priority.
Step 1507, forwarding the first message based on the second priority.
Step 1508, forwarding the second message based on the fourth priority.
Step 1507 and step 1508 of the present embodiment are performed sequentially.
As an example, the first message is added to a first message forwarding queue corresponding to the second priority based on the second priority; adding the second message Wen Tian to a second message forwarding queue corresponding to the fourth priority based on the fourth priority; forwarding a first message in a first message forwarding queue, and forwarding a second message in a second message forwarding queue after forwarding the first message. The message forwarding priority of the first message forwarding queue is higher than that of the second message forwarding queue.
As an example, in connection with fig. 10, the router interface adds a first message to a first message forwarding queue corresponding to a second priority based on the second priority and adds a second message Wen Tian to a second message forwarding queue corresponding to a fourth priority based on the fourth priority. The router interface forwards the first message in the first message forwarding queue, and forwards the second message in the second message forwarding queue after forwarding the first message.
In this embodiment, although the service priority of the first message is lower than the second message, that is, the first priority of the first message is lower than the third priority of the second message, the device priority of the first message is higher than the second message, that is, the second priority of the first message is higher than the fourth priority of the second message. The router finally forwards the first message with higher equipment priority based on the equipment priority, and forwards the second message with lower equipment priority, so that the message forwarding of each terminal equipment is dynamically coordinated, limited network resources of the router are fully utilized, and the processing performance of the router is improved.
Fig. 16 is a schematic structural diagram of a routing processing apparatus according to an embodiment of the present application. As shown in fig. 16, the route processing device 1600 includes: a receiving unit 1601, a processing unit 1602, and a transmitting unit 1603.
A receiving unit 1601, configured to receive a first packet from a first terminal device and a second packet from a second terminal device, where a service priority of the first packet is lower than that of the second packet, and an equipment priority of the first terminal device is higher than that of the second terminal device;
a processing unit 1602, configured to invoke a first processing function to intercept the first packet, and determine a first priority of the first packet based on a service priority; calling a second processing function to intercept the first message, and updating the first priority of the first message into a second priority based on the equipment priority; calling the first processing function to intercept the second message, and determining a third priority of the second message based on service priority, wherein the first priority is lower than the third priority; calling the second processing function to intercept the second message, and updating the third priority of the second message to a fourth priority based on the equipment priority, wherein the second priority is higher than the fourth priority;
a sending unit 1603, configured to forward the first packet based on the second priority, and forward the second packet based on the fourth priority after forwarding the first packet.
In an alternative embodiment, the first processing function has a higher call priority than the second processing function.
In an alternative embodiment, the processing unit 1602 is configured to:
identifying the service type of the first message;
determining a first priority of the first message based on the service type of the first message and first configuration information of the service priority;
in an alternative embodiment, the processing unit 1602 is configured to:
identifying the service type of the second message; determining a third priority of the second message based on the service type of the second message and the first configuration information;
the first configuration information includes a corresponding relation between a service type and a service priority.
In an alternative embodiment, the processing unit 1602 is configured to:
acquiring a feature code of the first message from the first message;
acquiring a service type corresponding to the feature code of the first message by querying a feature code knowledge base;
in an alternative embodiment, the processing unit 1602 is configured to:
acquiring a feature code of the second message from the second message;
acquiring a service type corresponding to the feature code of the second message by inquiring the feature code knowledge base;
The feature code knowledge base comprises a preset corresponding relation between message feature codes and service types.
In an alternative embodiment, the processing unit 1602 is configured to:
acquiring the equipment identifier of the first message from the first message;
determining a second priority of the first message based on the equipment identifier of the first message and second configuration information of the equipment priority;
updating the first priority to a second priority;
in an alternative embodiment, the processing unit 1602 is configured to:
acquiring the equipment identifier of the second message from the second message;
determining a fourth priority of the second message based on the equipment identifier of the second message and second configuration information of the equipment priority;
updating the third priority to a fourth priority;
the second configuration information comprises a corresponding relation between the equipment identifier and the equipment priority.
In an alternative embodiment, the processing unit 1602 is configured to:
adding the first message to a first message forwarding queue corresponding to the second priority based on the second priority;
adding the second message to a second message forwarding queue corresponding to the fourth priority based on the fourth priority; the message forwarding priority of the first message forwarding queue is higher than that of the second message forwarding queue;
A sending unit 1603, configured to forward the first message in the first message forwarding queue, and forward the second message in the second message forwarding queue after forwarding the first message.
It should be noted that, the route processing apparatus 1600 may be any network layer device, such as a router or a gateway. The route processing device 1600 is embodied in the form of functional units, where "units" may be implemented in software and/or hardware, and the application is not specifically limited thereto.
For example, a "unit" may be a software program, a hardware circuit or a combination of both that implements the functions described above. The hardware circuitry may include application specific integrated circuits (application specific integrated circuit, ASICs), electronic circuits, processors (e.g., shared, proprietary, or group processors, etc.) and memory for executing one or more software or firmware programs, merged logic circuits, and/or other suitable components that support the described functions.
Thus, the elements of the examples described in the embodiments of the present application can be implemented in electronic hardware, or in a combination 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 solution. 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.
Fig. 17 is a schematic hardware structure of an electronic device according to an embodiment of the present application. Referring to fig. 17, the electronic device 1700 includes: memory 1701, processor 1702, and computer programs. The computer program is stored in the memory 1701 and configured to be executed by the processor 1702 to implement the technical solution of any of the method embodiments described above, and the implementation principle and technical effect are similar, and will not be repeated herein.
The memory 1701 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory) or other optical disk storage, a compact disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 1701 may be independent and may be coupled to the processor 1702 via a communication line 1703. The memory 1701 may also be integrated with the processor 1702.
The processor 1702 may be a general purpose central processing unit (central processing unit, CPU), microprocessor, application Specific Integrated Circuit (ASIC), or one or more integrated circuits for controlling the execution of programs in accordance with aspects of the present application.
The embodiment of the present application provides a computer readable storage medium, on which computer instructions are stored, when the computer instructions run on an electronic device, the electronic device is caused to execute the technical scheme of the embodiment, and the implementation principle and the technical effect are similar to those of the related embodiment, and are not repeated herein.
The embodiment of the present application provides a chip, which includes a processor, and the processor is configured to invoke a computer program in a memory to execute the technical solution in the above embodiment, and the implementation principle and technical effects are similar to those of the above related embodiments, which are not described herein again.
The embodiments of the present application provide a computer program product, when the computer program product runs on an electronic device, so that the electronic device executes the technical solution in the foregoing embodiments, and the implementation principle and technical effects are similar to those of the foregoing related embodiments, which are not repeated herein.
The foregoing detailed description of the invention has been presented for purposes of illustration and description, and it should be understood that the foregoing is by way of illustration and description only, and is not intended to limit the scope of the invention.

Claims (9)

1. A method of route processing, the method comprising:
receiving a first message from a first terminal device and a second message from a second terminal device, wherein the service priority of the first message is lower than that of the second message, and the device priority of the first terminal device is higher than that of the second terminal device;
calling a first processing function to intercept the first message, and determining a first priority of the first message based on the service priority;
calling a second processing function to intercept the first message, and updating the first priority of the first message into a second priority based on the equipment priority;
calling the first processing function to intercept the second message, and determining a third priority of the second message based on service priority, wherein the first priority is lower than the third priority;
Calling the second processing function to intercept the second message, and updating the third priority of the second message to a fourth priority based on the equipment priority, wherein the second priority is higher than the fourth priority;
the first processing function is used for setting the message priority according to the service type of the message, and the second processing function is used for setting the message priority according to the equipment identifier of the message;
the calling priority of the first processing function is greater than that of the second processing function;
forwarding the first message based on the second priority, and forwarding the second message based on the fourth priority after forwarding the first message.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the determining the first priority of the first message based on the service priority includes:
identifying the service type of the first message; determining a first priority of the first message based on the service type of the first message and first configuration information of the service priority;
the determining the third priority of the second message based on the service priority includes:
identifying the service type of the second message; determining a third priority of the second message based on the service type of the second message and the first configuration information;
The first configuration information includes a corresponding relation between a service type and a service priority.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the identifying the service type of the first message includes:
acquiring a feature code of the first message from the first message, and acquiring a service type corresponding to the feature code of the first message by querying a feature code knowledge base;
the identifying the service type of the second message includes:
acquiring a feature code of the second message from the second message, and acquiring a service type corresponding to the feature code of the second message by inquiring the feature code knowledge base;
the feature code knowledge base comprises a preset corresponding relation between message feature codes and service types.
4. The method of claim 1, wherein updating the first priority of the first message to the second priority based on the device priority comprises:
acquiring the equipment identifier of the first message from the first message; determining a second priority of the first message based on the equipment identifier of the first message and second configuration information of the equipment priority; updating the first priority to a second priority;
The updating the third priority of the second message to the fourth priority based on the device priority includes:
acquiring the equipment identifier of the second message from the second message; determining a fourth priority of the second message based on the equipment identifier of the second message and second configuration information of the equipment priority; updating the third priority to a fourth priority;
the second configuration information comprises a corresponding relation between the equipment identifier and the equipment priority.
5. The method of claim 1, wherein forwarding the first message based on the second priority, after forwarding the first message, forwarding the second message based on the fourth priority, comprises:
adding the first message to a first message forwarding queue corresponding to the second priority based on the second priority;
adding the second message to a second message forwarding queue corresponding to the fourth priority based on the fourth priority; the message forwarding priority of the first message forwarding queue is higher than that of the second message forwarding queue;
forwarding the first message in the first message forwarding queue, and forwarding the second message in the second message forwarding queue after forwarding the first message.
6. A route processing device, comprising:
the device comprises a receiving module, a receiving module and a sending module, wherein the receiving module is used for receiving a first message from a first terminal device and a second message from a second terminal device, the service priority of the first message is lower than that of the second message, and the device priority of the first terminal device is higher than that of the second terminal device;
the processing module is used for calling a first processing function to intercept the first message and determining the first priority of the first message based on the service priority; calling a second processing function to intercept the first message, and updating the first priority of the first message into a second priority based on the equipment priority; calling the first processing function to intercept the second message, and determining a third priority of the second message based on service priority, wherein the first priority is lower than the third priority; calling the second processing function to intercept the second message, and updating the third priority of the second message to a fourth priority based on the equipment priority, wherein the second priority is higher than the fourth priority;
the first processing function is used for setting the message priority according to the service type of the message, and the second processing function is used for setting the message priority according to the equipment identifier of the message;
The calling priority of the first processing function is greater than that of the second processing function;
and the sending module is used for forwarding the first message based on the second priority, and forwarding the second message based on the fourth priority after forwarding the first message.
7. An electronic device, the electronic device comprising: a memory and a processor for invoking a computer program in the memory to perform the method of any of claims 1-5.
8. A computer readable storage medium storing computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1-5.
9. A chip comprising a processor for invoking a computer program in memory to perform the method of any of claims 1-5.
CN202211001389.2A 2022-08-19 2022-08-19 Route processing method, device, equipment and storage medium Active CN116095019B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211001389.2A CN116095019B (en) 2022-08-19 2022-08-19 Route processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211001389.2A CN116095019B (en) 2022-08-19 2022-08-19 Route processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116095019A CN116095019A (en) 2023-05-09
CN116095019B true CN116095019B (en) 2024-03-26

Family

ID=86210856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211001389.2A Active CN116095019B (en) 2022-08-19 2022-08-19 Route processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116095019B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007095854A1 (en) * 2006-02-21 2007-08-30 Huawei Technologies Co., Ltd. Method and system for providing qos service
CN101827021A (en) * 2010-03-16 2010-09-08 杭州华三通信技术有限公司 Method, device and system for classifying and marking QoS
CN106878165A (en) * 2017-01-22 2017-06-20 新华三技术有限公司 Data transmission method and device
CN109286575A (en) * 2018-09-29 2019-01-29 迈普通信技术股份有限公司 Message priority configuration method, device and the network equipment
CN110913439A (en) * 2018-09-17 2020-03-24 华为技术有限公司 Network element selection method and device
CN112153745A (en) * 2019-06-10 2020-12-29 海能达通信股份有限公司 Priority adjustment method and equipment, base station and device with storage function
WO2021197253A1 (en) * 2020-04-03 2021-10-07 华为技术有限公司 Service message transmission method and related device
WO2021207269A1 (en) * 2020-04-07 2021-10-14 Assia Spe, Llc Systems and methods for remote collaboration
CN114363097A (en) * 2020-10-14 2022-04-15 瞻博网络公司 Cooperative power management
WO2022078192A1 (en) * 2020-10-14 2022-04-21 华为技术有限公司 Wifi chip, wifi device and queue scheduling method
CN114430591A (en) * 2020-10-14 2022-05-03 华为技术有限公司 Wi-Fi chip, Wi-Fi equipment and queue scheduling method
WO2022151431A1 (en) * 2021-01-15 2022-07-21 华为技术有限公司 Communication method and apparatus

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716761B (en) * 2012-09-29 2018-05-11 华为终端有限公司 Control the method and mobile management device of user equipment and network connection
CN108476427B (en) * 2015-12-31 2021-09-03 英国电讯有限公司 Wireless access point, method of operating wireless access point, computer-readable storage medium
US10536345B2 (en) * 2016-12-28 2020-01-14 Google Llc Auto-prioritization of device traffic across local network
US11455196B2 (en) * 2020-09-01 2022-09-27 Dell Products L.P. Adaptive prioritization of USB traffic

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007095854A1 (en) * 2006-02-21 2007-08-30 Huawei Technologies Co., Ltd. Method and system for providing qos service
CN101827021A (en) * 2010-03-16 2010-09-08 杭州华三通信技术有限公司 Method, device and system for classifying and marking QoS
CN106878165A (en) * 2017-01-22 2017-06-20 新华三技术有限公司 Data transmission method and device
CN110913439A (en) * 2018-09-17 2020-03-24 华为技术有限公司 Network element selection method and device
CN109286575A (en) * 2018-09-29 2019-01-29 迈普通信技术股份有限公司 Message priority configuration method, device and the network equipment
CN112153745A (en) * 2019-06-10 2020-12-29 海能达通信股份有限公司 Priority adjustment method and equipment, base station and device with storage function
WO2021197253A1 (en) * 2020-04-03 2021-10-07 华为技术有限公司 Service message transmission method and related device
WO2021207269A1 (en) * 2020-04-07 2021-10-14 Assia Spe, Llc Systems and methods for remote collaboration
CN114363097A (en) * 2020-10-14 2022-04-15 瞻博网络公司 Cooperative power management
WO2022078192A1 (en) * 2020-10-14 2022-04-21 华为技术有限公司 Wifi chip, wifi device and queue scheduling method
CN114430591A (en) * 2020-10-14 2022-05-03 华为技术有限公司 Wi-Fi chip, Wi-Fi equipment and queue scheduling method
WO2022151431A1 (en) * 2021-01-15 2022-07-21 华为技术有限公司 Communication method and apparatus

Also Published As

Publication number Publication date
CN116095019A (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN108270813B (en) Heterogeneous multi-protocol stack method, device and system
US9094482B2 (en) Apparatus and method for controlling data transmission/reception path between server and mobile terminal in heterogeneous network environment
CN108777633B (en) Intention pattern type industrial SDN northbound interface system supporting data scheduling and interaction method
US20050010925A1 (en) Interprocessor communication protocol with smart streaming port
KR20180123379A (en) Method and apparatus for allocating resource in software defined network
US8326918B2 (en) Interprocessor communication protocol
CN113574836B (en) Electronic device and method for controlling data transmission
US8233390B2 (en) Priority and source aware packet memory reservation and flow control in forwarding planes
WO2016019291A1 (en) Efficient centralized resource and schedule management in time slotted channel hopping networks
US20110105024A1 (en) Transport independent service discovery
US20190223192A1 (en) Time slot reassignment mechanism for radio access technology coexistence improvement
CN114745255B (en) Hardware chip, DPU, server, communication method and related device
CN113676741A (en) Data transmission method, device, storage medium and electronic equipment
CN114500176B (en) Multi-flow load balancing method, device and system for VPN and storage medium
CN111315038B (en) Data transmission method and device, electronic equipment and storage medium
Pirmagomedov et al. Augmented computing at the edge using named data networking
WO2022143508A1 (en) Method for transmitting data in near field, device and system
CN116095019B (en) Route processing method, device, equipment and storage medium
WO2023116311A1 (en) Data interaction method and apparatus, and device and storage medium
KR20210127564A (en) Method and apparatus for dynamic and efficient load balancing in mobile communication network
CN113726915A (en) Network system, message transmission method therein and related device
CN112953992A (en) Network system, communication and networking method, device and storage medium
CN114173314B (en) Data transmission method and device
CN112333690B (en) Data transmission method, device, storage medium, terminal and network access point equipment
US20050027824A1 (en) Interprocessor communication protocol providing guaranteed quality of service and selective broadcasting

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