WO2023231899A1 - Communication scheduling method and apparatus, and related device - Google Patents

Communication scheduling method and apparatus, and related device Download PDF

Info

Publication number
WO2023231899A1
WO2023231899A1 PCT/CN2023/096320 CN2023096320W WO2023231899A1 WO 2023231899 A1 WO2023231899 A1 WO 2023231899A1 CN 2023096320 W CN2023096320 W CN 2023096320W WO 2023231899 A1 WO2023231899 A1 WO 2023231899A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
priority
session
communication
network
Prior art date
Application number
PCT/CN2023/096320
Other languages
French (fr)
Chinese (zh)
Inventor
石帅
童笑
付亚臣
周志伟
罗杰
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023231899A1 publication Critical patent/WO2023231899A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/16Central resource management; Negotiation of resources or communication parameters, e.g. negotiating bandwidth or QoS [Quality of Service]
    • H04W28/24Negotiating SLA [Service Level Agreement]; Negotiating QoS [Quality of Service]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/12Wireless traffic scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/20Control channels or signalling for resource management
    • H04W72/21Control channels or signalling for resource management in the uplink direction of a wireless link, i.e. towards the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/56Allocation or scheduling criteria for wireless resources based on priority criteria
    • H04W72/566Allocation or scheduling criteria for wireless resources based on priority criteria of the information or information source or recipient

Definitions

  • the present invention relates to the field of communication, and in particular, to a communication scheduling method, device and related equipment.
  • a network device In a communication network, there is usually a situation where one network device is connected to multiple network devices.
  • the device connected to multiple network devices can be called a master device, and other network devices can be called slave devices.
  • the master device can also set the priority for the slave device. When receiving a message from a slave device with a higher priority, the master device will give priority to the message from the slave device or send a message to the slave device with a higher priority. arts.
  • This application provides a communication scheduling method, device and related equipment. By obtaining the device type and real-time operation status, it updates the priority of the network equipment in real time, and allocates communication resources to the network equipment according to the real-time updated priority, which can better meet the real-time needs. Job requirements.
  • the present application provides a communication scheduling method, applied to a first network device, including: obtaining the device type and operation status of at least one network device connected to the first network device; wherein the at least one network device includes a second network device.
  • Network equipment determine a first priority table according to the equipment type of at least one network equipment.
  • the first priority table includes the initial priority of at least one network equipment, wherein the initial priorities of network equipment with the same equipment type are the same; determine the first priority table. an initial priority of the second network device, and determine a target priority of the second network device based on the job status of the second network device and the initial priority of the second network device in the first priority table.
  • the initial priorities of the network devices are first sorted based on the device types of the connected network devices to obtain the first priority table, and then the initial priorities of the second network devices are adjusted according to the operating status of the network devices. Get the target priority of the second network device.
  • the target priority takes into account both the device type of the second network device and the operating status of the second network device, and can satisfy the needs of the second network device. The need for communication in real-time operations.
  • the communication scheduling method further includes updating the first priority table to the second priority table according to the target priority of the second network device.
  • the initial priority will be adjusted according to the working status of the network device, and finally the second priority table will be obtained.
  • the communication between the first network device and the network device connected to it is in accordance with the second Priority table is used to enable the first network device to communicate with the network device according to the real-time operating status of the network device when the communication requirements of the network device change with the work process, thereby meeting the network device's demand for communication resources. .
  • the second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or , the second priority table is determined by adjusting the initial priority of each network device according to the preset ranking corresponding to the operating status of each network device.
  • the second priority table can be obtained by reordering network devices of the same device type according to the job status, or it can be obtained by adjusting the initial priority to the preset ranking according to the job status, for example, the network devices in operation
  • the initial priority of the device is adjusted forward by several positions. In this way, the priority of the network device in the second priority table is comprehensively obtained based on the device type and operating status of the network device.
  • the first network device communicates with the network device according to the second priority table, which can better meet the needs of the network device for communication. resource requirements.
  • the communication scheduling method further includes: determining whether to communicate with the second network device according to the second priority table; when it is determined to communicate with the second network device, sending a request to the second network device.
  • the network device sends a first request message, the first request message carries a response priority, and the response priority is used by the second network device to determine the time to respond to the first request message.
  • the request message when the first network device sends a request message to the second network device, the request message also carries the response priority.
  • the second network device can also arrange the processing of the request message according to the response priority, so that the two-way communication between the first network device and the second network device can be carried out according to the priority, instead of only the first network device can according to the priority. Prioritize processing of data from other network devices, thereby improving communication efficiency between network devices on both sides.
  • the communication scheduling method further includes: determining whether to communicate with the second network device according to the second priority table; when it is determined to communicate with the second network device, receiving the second The second request message sent by the network device; determine the response priority of the second request message according to the second request message, and the response priority of the second request message is determined according to the session type of the second request message.
  • the first network device determines the time to respond to the request message according to the session type of the request message sent by the second network device. After the first network device determines to communicate with the second network device according to the target priority, it will also determine the time to respond to the request message according to the session type of the request message, so that the session with a higher session type priority can be prioritized, thereby improving Communication efficiency.
  • the communication scheduling method further includes: obtaining the session types of the multiple sessions; according to the session type, from the multiple sessions The target session is determined based on the request priority corresponding to the session type in multiple sessions.
  • the request priority corresponding to the session type is used to indicate the order in which session request messages are sent.
  • the first network device will also prioritize multiple sessions conducted by the second network device by session type. After the first network device determines to communicate with the second network device based on the target priority, it will prioritize the sessions according to the target priority. handle multiple sessions. In this way, sessions that need to be responded to faster can be processed with priority. Furthermore, services with high session priority can be carried out first, and the overall business can be carried out in an orderly manner, which improves the progress of the overall business.
  • the communication scheduling method further includes: determining whether it is in an emergency communication state; determining emergency communication with the second network device based on the emergency state; and, after the emergency state is lifted, according to the second A priority table determines whether to communicate with the second network device.
  • the first network device can also perform emergency communication with other network devices.
  • the peer network device for communication will be determined based on the emergency state.
  • the first network device determines the peer network device for communication according to the second priority table. In this way, the data transmission of emergency communication is performed first, and then the data transmission is performed according to the priority table, which can meet the situation of emergency communication in the actual network.
  • the first port of the first network device is connected to the second port of the second network device, and the communication scheduling method further includes: receiving a start message sent by the second network device, The start message carries an emergency communication start tag, and the start tag is used to indicate the start of the emergency state; according to the start message, emergency communication with the second network device is determined, and communication on other ports except the first port is suppressed.
  • the first network device determines to conduct emergency communication with the second network device. After the second network device initiates the emergency communication, both the first network device and the second network device will suppress the communication of other ports and only retain emergency communication. port, so that the data of other devices will not occupy emergency communication resources, improving the efficiency of emergency communication.
  • the communication scheduling method further includes: receiving a termination message sent by the second network device, the initial message carrying an emergency communication termination mark; and restoring the port except the first port according to the termination message. communication on other ports.
  • the second network device sends a termination message to the first network device to end the emergency communication with the first network device, and then both the first network device and the second network device resume communication on all ports.
  • the second network device sends a termination message to the first network device to end the emergency communication with the first network device, and then both the first network device and the second network device resume communication on all ports.
  • the communication scheduling method further includes: the initial message also carries an emergency communication duration, and the emergency communication duration is used by the first network device to determine the communication suppression duration of other ports except the first port. .
  • the second network device can also carry the emergency communication duration in the initial message. After the emergency communication duration is reached, the first network device and the second network device will end the emergency communication and resume communication on all ports. In this way, the second network device does not need to send additional termination messages, and during emergency communication, data from other devices will not occupy emergency communication resources, which improves the efficiency of emergency communication.
  • the communication scheduling method also includes: device types include: motion control class, status control class and status sensing class, where the device type corresponds to the initial priority of the network device from high to The low ones are: motion control class, status control class, status sensing class; the job status includes: working, preparing to work, and not working. Among them, the priority corresponding to the job status from high to low is: working, preparing to work, No work was done.
  • the motion control network equipment needs a higher priority because it needs to perform action operations.
  • the working network equipment has ongoing operation business data that needs to be sent. Therefore, the corresponding network equipment also has a higher priority. .
  • the first network device can also communicate with the network device according to the real-time operation status of the network device, thereby meeting the network device's demand for communication resources.
  • the communication scheduling method also includes: session types include: control session, query session, subscription session, where the request priority corresponding to the session type from high to low is: Control session, query session, subscription session.
  • the response priority corresponding to the session type from high to low is: query session, control session, subscription session.
  • the first network device will also prioritize multiple sessions conducted by the second network device according to session type, so that sessions that need to be responded to faster can be processed first, and then services with high session priority can be processed first. It can be carried out with priority, and the overall business can be carried out in an orderly manner, which improves the progress of the overall business.
  • the present application provides a communication scheduling device, applied to a first network device, including: an obtaining unit and a determining unit; the obtaining unit is used to obtain the device type and operation of at least one network device connected to the first network device. state; wherein, at least one network device includes a second network device; the determining unit is configured to determine a first priority table according to the device type of the at least one network device, and the first priority table includes an initial priority of at least one network device, wherein , network devices with the same device type have the same initial priority; the determining unit is also used to determine the initial priority of the second network device, and determine the initial priority of the second network device according to the job status of the second network device and the initial priority of the second network device in the first priority table. Priority, which determines the target priority of the secondary network device.
  • the determining unit is further configured to update the first priority table to the second priority table according to the target priority of the second network device.
  • the second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or, the second priority table The table determines the initial priority of each network device according to the preset ranking corresponding to the job status of each network device.
  • the device further includes a sending unit; the determining unit is further configured to determine whether to communicate with the second network device according to the second priority table; the sending unit is configured to determine whether to communicate with the second network device.
  • a first request message is sent to the second network device.
  • the first request message carries a response priority, and the response priority is used by the second network device to determine the time to respond to the first request message.
  • the device further includes a receiving unit; the determining unit is further configured to determine whether to communicate with the second network device according to the second priority table; the receiving unit is configured to determine whether to communicate with the second network device according to the second priority table.
  • the determining unit is also used to determine the response priority of the second request message according to the second request message, and the response priority of the second request message is Determined according to the session type of the second request message.
  • the obtaining unit is also used to obtain the session types of the multiple sessions; the determining unit is also used to obtain the session types from the multiple sessions according to the session types.
  • the target session is determined in each session. The target session is determined based on the request priority corresponding to the session type in multiple sessions. The request priority corresponding to the session type is used to indicate the order in which session request messages are sent.
  • the determining unit is also used to determine whether it is in an emergency communication state; based on the emergency state, determine emergency communication with the second network device; and, after the emergency state is lifted, the determining unit is also used to determine according to The second priority table determines whether to communicate with the second network device.
  • the first port of the first network device is connected to the second port of the second network device; the receiving unit is also used to receive a start message sent by the second network device.
  • the message carries an emergency communication start mark, and the start mark is used to indicate the start of the emergency state; the determination unit is also used to suppress communication on other ports except the first port according to the start message.
  • the receiving unit is also used to receive a termination message sent by the second network device, the termination message carries an emergency communication termination mark, and the termination mark is used to indicate that the emergency state is lifted; the determining unit is also used to According to the termination message, communication on other ports except the first port is restored.
  • the initial message also carries an emergency communication duration
  • the emergency communication duration is used by the first network device to determine the communication suppression duration of other ports except the first port.
  • the device types include: motion control class, status control class and status sensing class, where the device type corresponds to the initial priority of the network device from high to low: motion control class, status Control class, status sensing class; work status includes: working, preparing work and not working, among which, the work status The corresponding priorities from high to low are: working, preparing to work, and not working yet.
  • the session types include: control session, query session, and subscription session, where the request priority corresponding to the session type from high to low is: control session, query session, For subscription sessions, the response priorities corresponding to the session types from high to low are: query session, control session, and subscription session.
  • this application provides a network device, which is characterized by including a processor and a memory.
  • the memory is used to store instructions
  • the processor is used to execute instructions.
  • the execution is as described in the first aspect.
  • this application provides a computer-readable storage medium, which is characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are run on a network device, the method described in the first aspect is executed.
  • the present application provides a computer program product, which is characterized in that the computer program product includes computer instructions, and when executed by a computing device, the computing device performs the method described in the first aspect.
  • the method provided by this application can better meet the needs of real-time operations by obtaining the device type and real-time operation status, updating the priority of the network equipment in real time, and allocating communication resources to the network equipment according to the real-time updated priority. Moreover, by carrying the response priority in the request message, the peer network device can process the request message according to the response priority, so that two-way communication can be carried out according to the priority.
  • the communication scheduling method provided by this application can also suppress communication on the ports connecting network equipment and non-emergency communication equipment during emergency communication, so that communication data of other devices will not occupy communication resources, and ensure that emergency communication data can be prioritized. Send and receive.
  • Figure 1 is a schematic diagram of a communication system architecture provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of the communication system architecture of an industrial equipment network provided by an embodiment of the present application.
  • Figure 3 is a schematic flowchart of a communication scheduling method provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of a first priority table provided by an embodiment of the present application.
  • Figure 5A is a schematic diagram of a second priority table generation process provided by an embodiment of the present application.
  • Figure 5B is a schematic diagram of another second priority table generation process provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of a second priority table provided by an embodiment of the present application.
  • Figure 7 is a schematic flowchart of a network device sending a request message according to an embodiment of the present application
  • Figure 8 is a schematic diagram of inhibiting the first port provided by an embodiment of the present application.
  • Figure 9A is a schematic diagram of session communication between network devices provided by an embodiment of the present application.
  • Figure 9B is a schematic diagram of multiple sessions between network devices provided by an embodiment of the present application.
  • Figure 10 is a schematic flowchart of a network device receiving a request message provided by an embodiment of the present application
  • FIG 11 is a schematic flowchart of an emergency communication method between network devices provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram of suppressing ports other than the second port provided by an embodiment of the present application.
  • FIG. 13 is a schematic flowchart of another emergency communication method between network devices provided by an embodiment of the present application.
  • Figure 14A is a schematic flowchart of an emergency communication method including an intermediate network node provided by an embodiment of the present application
  • Figure 14B is a schematic flowchart of another emergency communication method including an intermediate network node provided by an embodiment of the present application.
  • Figure 15 is a schematic diagram of an intermediate network node suppression port provided by an embodiment of the present application.
  • Figure 16 is a schematic diagram of another network architecture for emergency communication between multiple network devices provided by an embodiment of the present application.
  • Figure 17 is a schematic structural diagram of a communication scheduling device provided by an embodiment of the present application.
  • Figure 18 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • the communication system includes network device 110 , network device 120 , and network device 130 .
  • the transmission medium between network devices can be wired transmission media such as cables, optical fibers, and plastic waveguides, or wireless transmission media such as microwaves and infrared rays.
  • FIG. 1 only shows one possible communication system architecture to which embodiments of the present application can be applied. In other possible scenarios, the above communication system architecture may also include only some devices or other devices.
  • the network device 110 can be a physical server or a cloud device, such as an A virtual machine (VM) implemented in combination with Network Functions Virtualization (NFV) technology.
  • a virtual machine refers to a complete computer system simulated by software with complete hardware system functions and running in a completely isolated environment.
  • virtual machines in cloud servers are not specifically limited in this application.
  • the network device 120 can specifically be a switch, router, gateway, bridge, server, repeater, etc., or can also be an evolved Node B (evolved Node B, eNB), a wireless network controller (radio network controller, RNC), Node B (Node B, NB), base station controller (BSC), base transceiver station (BTS), access point (AP) in the WIFI system, baseband unit (baseband unit , BBU), etc., it can also be the New Radio (NR) in the fifth generation mobile communication technology (5th Generation Mobile Communication Technology, 5G), the next generation Node B (gNodeB), etc.
  • NR New Radio
  • the network device 130 may specifically be a terminal.
  • the application scenario of the embodiments of the present application may be home network communication, and the terminal may be a mobile phone, a tablet, a computer, a smart watch, a virtual reality (VR) terminal device, or an augmented reality (AR) device. ) terminal equipment, as well as sweeping robots, rice cookers and other Internet of Things equipment, etc.
  • This application does not make specific limitations.
  • the network device 110 can forward messages through the network device 120 to control the network device 130 or obtain data of the network device 130, etc.
  • the application scenario of the embodiment of the present application may be an industrial equipment network.
  • the network device 110 in the embodiment of the present application may be a control computer or server, and the network device 130 may be a robotic arm, a surveillance camera, or a temperature sensor. , laser sensor, three-machine controller, crusher, transfer machine, scraper conveyor, fully mechanized mining controller, coal digger, hydraulic support, etc. This application does not make specific limitations.
  • Figure 2 shows another communication system structure of the industrial equipment network, in which the remote controller and the auxiliary collection PC1 are connected to the router 2 and the router 4 through the router 1, and the router 2 is connected to the auxiliary collection PC2 and the router 3.
  • Router 4 is connected to the auxiliary control PC1 and router 5
  • router 3 is connected to robotic arm 1, robotic arm 2 and surveillance cameras
  • router 5 is connected to sensors and laser sensors.
  • the auxiliary collection PC1 and the auxiliary collection PC2 can obtain the data of the robotic arm, surveillance camera, temperature sensor and laser sensor through the router 1-router 5; the auxiliary control PC1 You can obtain data from robotic arms, surveillance cameras, temperature sensors and laser sensors and control the above devices through Routers 1-Router 5; the remote controller can also obtain data from and control other devices through Routers 1-Router 5.
  • the application scenario of the embodiment of the present application may also be an office network.
  • the network device 130 in the embodiment of the present application may be a mobile phone, a computer, a surveillance camera, a printer, a web server, a database server, etc. It should be understood that the above examples are for illustration and do not constitute specific limitations.
  • the device that connects multiple network devices can be called a master device, and other network devices can be called slave devices. equipment.
  • the master device and the slave device can be connected directly or through a router or switch.
  • the master device can also set the priority for the slave device. When receiving a message from a slave device with a high priority, the master device will give priority to the message from the slave device.
  • the demand for communication resources of network equipment will change with the progress of the operation.
  • the robot arm 1 when an item is transmitted to the robot arm 1, the robot arm 1 is required to operate the item. At this time, the communication of the robot arm 1 is more important. At this time, the robot arm 1 is needed. 1 has higher priority than other robot arms.
  • the robot arm 2 when the item is transferred to the robot arm 2, the robot arm 2 is required to operate the item. At this time, the priority of the robot arm 2 is required to be higher than that of other robot arms. During this process, the priority of the slave device changes.
  • the network device 110 when the network device 110 needs to process packets from multiple network devices 130, when the working network device 130 has a lower priority, the packets sent by the network device 130 will be processed later by the network device 110, and further, the packets sent by the network device 130 will be processed later.
  • the response message from the network device 110 is received later.
  • the network device 130 cannot perform the corresponding service, which ultimately affects the overall progress of the service and even causes a major accident.
  • the working robot arm may miss the items on the conveyor belt because it does not receive the response message in time, which may cause the final product to fail; or, when the robot arm is executing an action, the control end detects that the robot arm It will collide with the wall, and a command to stop the robot arm is given.
  • the robot arm has a low priority, when the command reaches the robot arm, the robot arm may have already collided with the wall.
  • this application provides a communication scheduling method that can be based on the equipment type of the network equipment and the network equipment.
  • Real-time job status sets network device priorities and allocates communication resources based on network device priorities.
  • the first network device can obtain the device type and operation status of the connected network device; perform initial priority sorting according to the device type of the network device, and determine the first priority table, in which the device types of the same device type are The initial priorities of the network devices are the same; then the initial priorities are adjusted according to the working status of the network devices to obtain the final priorities of the network devices, and then the second priority table is determined based on the final priorities of all network devices.
  • the first network device communicates with the connected network device based on the second priority list.
  • the priority of the session can also be determined based on the session type, and the response priority of the session is carried in the sent message, so that the peer network device can process the message according to the response priority.
  • emergency communication can also be established between network devices. During the emergency communication process, the ports of network devices participating in emergency communication and other non-emergency communication network devices will be suppressed from communication until the emergency communication ends.
  • Figure 3 is a schematic flow chart of a communication scheduling method provided by this application.
  • the network device 10 and the network device 20 can be in the communication system shown in Figure 1 or Figure 2. Internet equipment.
  • the network device 10 is connected to the network device 20.
  • the network device 10 and the network device 20 may be directly connected, or may be connected through network devices such as routers or switches.
  • Network device 10 can also connect to other network devices. It should be understood that this application does not specifically limit the connection method of the network device 10 and the network device 20 .
  • the network device 10 may also be called a first network device, and the network device 20 may also be called a second network device.
  • the steps of this communication scheduling method are introduced in detail below.
  • the network device 10 obtains the device type of the network device 20.
  • the network device 10 sends a message to obtain the device type of the network device 20 to the network device 20, and the network device 20 replies its device type to the network device 10.
  • Network device 10 may obtain the device type from network device 20 when establishing a network connection with network device 20, or may obtain the device type from network device 20 after network device 20 sends a message to network device 10.
  • the device type may also be that the network device 10 periodically obtains the device type from the network device 20 at a preset time, which is not specifically limited in this application.
  • the device type of the network device 20 is determined according to the job tasks performed by the network device 20 .
  • device types may include: motion control, status control, status sensing, user terminals, smart home appliances, etc. It should be understood that this application does not specifically limit the classification of device types of the network device 20 .
  • the following describes the device types of the network device 20 with examples based on application scenarios.
  • the device types of the network device 20 may include: motion control type, status control type, and status sensing type.
  • the network equipment of the motion control type is used to perform motion tasks
  • the network equipment of the status control type is used to generate specific states, such as heating, cooling, increasing pressure, etc.
  • the network equipment of the status sensing type is used to perform acquisition tasks.
  • Environmental status such as temperature measurement, distance measurement, image collection and other tasks.
  • equipment such as robotic arms, transfer machines, and crushers belong to the motion control category
  • vacuum pumps, heating furnaces, booster pumps and other equipment belong to the status control category
  • equipment such as cameras, temperature sensors, and laser sensors belong to the status sensing category.
  • the device types of the network device 20 may include: user terminals and smart home appliances.
  • Smart home appliances can further include: motion control smart home appliances, status control smart home appliances, and status sensing smart home appliances.
  • mobile phones, smart watches, computers, etc. are user terminals
  • sweeping robots are motion control smart home appliances
  • air conditioners are state control smart home appliances
  • thermometers, cameras, etc. are state sensing smart home appliances.
  • the device types of the network device 20 may include: user terminals, office facilities, etc. Printers, fax machines, etc. are office facilities.
  • a sweeping robot also includes a laser sensor. During its movement, it will move based on the data measured by the laser sensor, but it mainly cleans garbage by moving its position, which is a motion control task.
  • a laser sensor During its movement, it will move based on the data measured by the laser sensor, but it mainly cleans garbage by moving its position, which is a motion control task.
  • the network device 10 determines the initial priority of the network device 20 according to the device type of the network device 20.
  • Each device type corresponds to its own initial priority level.
  • Network devices of the same device type have the same initial priority.
  • the network device 10 will first determine the initial priority of the network device 20 according to the device type.
  • the priority of motion control network equipment is higher than the priority of status control network equipment, and the priority of status control network equipment is higher than the priority of status sensing network equipment.
  • the priority of user terminals is higher than the priority of smart home appliances.
  • the priority of motion control smart home appliances is higher than the priority of status control smart home appliances.
  • the priority of status control smart home appliances is higher than the priority of status transmission smart home appliances.
  • the priority of sensor-type smart home appliances In office network communications, user terminals have higher priority than office facilities. It should be understood that this application does not specifically limit the initial priority level corresponding to the device type.
  • the network device 10 also obtains the device types of all network devices connected to the network device 10 . After the network device 10 obtains the device types of all network devices, it will also establish a first priority table.
  • the first priority table is determined based on the device types of the network devices connected to the network device 10 . That is to say, the priorities of all network devices are sorted according to their device types. For the priority levels corresponding to the device types, refer to the above description and will not be described again here. The following is an example of how the network device 10 establishes the first priority table.
  • network device 10 is also connected to network device 21, network device 22, network device 23 and network device 24, where network device 21 belongs to the motion control category, and network device 20, network device 22 and network device 24 belong to the status control category, Network device 23 belongs to the status sensing category, so the first priority table established by network device 10 can refer to Figure 4.
  • the initial priority of network device 21 is higher than network device 20, network device 22 and network device 23. 24.
  • the initial priorities of network device 20, network device 22 and network device 24 are the same, and the initial priorities of network device 20, network device 22 and network device 24 are higher than that of network device 23.
  • the network device 10 obtains the job status of the network device 20.
  • the network device 10 sends a message to obtain the operation status of the network device 20 to the network device 20, and the network device 20 replies to the network device 10 with its operation status.
  • the network device 10 may obtain the operation status of the network device 20 regularly, or may obtain the current operation status of the network device 20 after the operation status of the network device 20 changes or is triggered by the user.
  • the job status is used to indicate whether the network device 20 is currently working.
  • the job status may include working, about to work, not working, etc., where the priority of the network device that is working is greater than the priority of the network device that is about to work. , that is, the priority of the network device that is being operated is greater than the priority of the network device that is not being operated. It should be understood that this application does not specifically limit the classification of job status. Alternatively, job status can also be divided according to the specific work performed.
  • the manner in which the network device 10 obtains the operation status of the network device 20 will be described in detail below.
  • the network device 10 regularly sends a request to obtain the job status to the network device 20. After receiving the request, the network device 20 replies with the current job status according to the request. Or, the network device 10 sends a request to obtain the job status regularly to the network device 20, and the network device 20 will send the current job status to the network device 10 every fixed time. Alternatively, after the network device 10 obtains the job status request for the first time, the network device 20 then sends the current job status to the network device 10 when the job status of the network device 20 changes. Or, when the network device 10 or the network device 20 receives a user operation instruction, the network device 10 obtains the operation mode from the network device 20 according to the user operation instruction. It should be understood that this application does not specifically limit the manner in which the network device 10 obtains the operation status of the network device 20 .
  • the operating status of the network device 20 is controlled by the network device 10.
  • the network device 10 adjusts the operating status of the network device 20
  • the network device 10 directly updates the adjusted operating status of the network device 20, It is no longer necessary to obtain the job status from the network device 20 .
  • the network device 10 stores the operation time of the network device 20 , and the network device 10 can directly update the operation status of the network device 20 according to the operation time of the network device 20 .
  • the network device 10 determines the target priority of the network device 20 based on the initial priority and job status of the network device 20.
  • the network device 10 adjusts the initial priority of the network device 20 according to the operating status of the network device 20 to obtain the target priority of the network device 20.
  • the higher the target priority the more priority the network device 10 will receive, send or process the network device 20. message.
  • the network device 10 can adjust the initial priority higher or lower the preset ranking according to the job status of the network device 20 to obtain the target priority; or, while retaining the initial priority, perform secondary marking according to the job status to obtain the target.
  • Priority for example, the network device 20 may be a network device with the lowest job status type priority among network devices with a high device type priority.
  • the network device 10 will also obtain the job status of all network devices connected to the network device 10 and establish a second priority table.
  • the second priority table is connected to the network device 10 according to the first priority.
  • To determine the operating status of each network device refer to the confirmation process of the target priority of the network device 20, which will not be described again here.
  • the following is an example of how the network device 10 adjusts the initial priority of the network device 20 according to the job status and establishes a second priority table.
  • the network device 10 can adjust the initial priority higher or lower the preset ranking according to the working status of the network device 20 .
  • N categories of device types that is, there are N levels of initial priority
  • the initial priority of the network device 20 is Mth
  • M is less than or equal to N
  • M and N are positive integers.
  • the priority of the network device 20 is increased by J positions, J is a positive integer; when the network device 20 is about to work, the priority of the network device 20 remains unchanged; when the network device 20 is not in the future
  • K is a positive integer.
  • network device 20, network device 22 and network device 24 have the same initial priority because they are of the same device type.
  • network device 22 is in the non-operating state.
  • other devices are in the waiting state, then the priority of the network device in the operating state is increased by two places, the priority of the network device in the non-operating state is lowered by two places, and the priority of other network devices remains unchanged. Therefore, the priorities in the final second priority table from high to low are: network device 20, network device 21, network device 24, network device 23, and network device 22.
  • the network device 10 can also remark the priority of the network device 20 according to the job status while retaining the initial priority to obtain the network device priority. Specifically: when the network device 20 is working, the target priority of the network device 20 is the highest among network devices of the same device type; when the network device 20 is about to work, the priority of the network device 20 is among the network devices of the same device type. Medium means medium; when the network device 20 is not performing operations, the priority of the network device 20 is the lowest among network devices of the same device type.
  • network device 20, network device 22 and network device 24 have the same initial priority because they are of the same device type. However, because network device 20 is operating and network device 24 is about to operate, the network If the device 22 is not working, the network device priorities in the final second priority table from high to low are: network device 21, network device 20, network device 24, network device 22, and network device 23.
  • this application can set the priority of the slave device connected to the master device, and obtain the priority table as shown in Figure 6, in which the slave device is device 1-device 8 as an example, the device type is Type 1 to Type 4 are taken as an example, and the job status is taken as Job 1 to Job 3.
  • the process of generating the priority table shown in Figure 6 can refer to the above-mentioned descriptions about Figures 4 to 5B.
  • the obtained priority table takes into account both the device type of the slave device and the job status of the slave device, so that when the master device communicates with the slave device, it can proceed based on the real-time job status of the slave device to meet the requirements of the slave device. Communication needs.
  • the initial priority of the network device 20 can also be determined first according to the working status of the network device 20 , and then the initial priority can be adjusted according to the device type of the network device to obtain the target priority of the network device 20 . For example, when the job status includes working, about to be done, and not yet being done, the priority when the job is being done is greater than the priority when the job is about to be done, and the priority when the job is about to be done is greater than the priority when the job is not in progress.
  • the initial priority is adjusted according to the device type of the network device 20. Specifically, the priority of the network device 20 can be adjusted among network devices with the same working status according to the device type. Alternatively, the initial priority may be adjusted higher or lower to a preset ranking according to the device type of the network device 20 .
  • step S310 the network device 10 obtains the device type of the network device 20, first perform step S330: the network device 10 obtains the job status of the network device 20, and then perform step S320: the network device 10 according to The device type of the network device 20 determines the initial priority of the network device 20, and step S340 is performed: the network device 10 determines the target priority of the network device 20 according to the initial priority and job status of the network device 20.
  • step S310 the network device 10 obtains the device type of the network device 20
  • step S330 the network device 10 obtains the operating status of the network device 20, and then based on the operating status of the network device 20, The initial priority of the network device 20 is determined, and finally the initial priority is adjusted according to the device type of the network device 20 to obtain the target priority of the network device 20 .
  • the network device 10 after the network device 10 determines the target priority of the network device 20, it will receive data from the network device 20 and send messages to the network device 20 according to the target priority of the network device 20. When the network device 10 needs to send or receive data from multiple devices, the network device 10 will give priority to sending or receiving messages from the network device with a high target priority.
  • the process of the network device 10 receiving the message sent by the network device 20 will be described in detail below with reference to FIG. 7 .
  • the network device 20 sends a request message to the network device 10.
  • the network device 20 may send a request message of the session to the network device 10 to obtain a response from the network device 10 . It should be understood that multiple sessions may exist between the network device 20 and the network device 10, and the network device 20 may send multiple request messages to the network device 10, and each request message carries a unique identifier of the corresponding session.
  • S720 The network device 10 determines whether to receive data from the network device 20 according to the target priority of the network device 20.
  • the network device 10 first determines whether it is currently receiving data from other network devices. If the network device 10 is not receiving data from other network devices, the network device 10 can currently receive data from the network device 20, and step S740 will be performed.
  • the network device 10 will also determine whether it can receive data from the network device 20 based on the target priority of the network device 20 .
  • the network device 10 may currently receive the data from the network device 20 first, and step S740 will be performed.
  • the network device 10 will receive the priority first. For data of higher-level network devices, step S730 is executed.
  • the network device 10 receives data from a network device with a higher priority.
  • the first port of the network device 10 is connected to the second port of the network device 20.
  • the network device 10 cannot receive the message of the network device 20, it first receives the data of the network device with higher priority.
  • the network device 10 when the network device 10 cannot receive the packet of the network device 20, it will also send a suppression instruction to the first port until the network device 10 has received the network device with a higher target priority than the network device 20. When the data is received, the first port is restored and the data of the network device 20 is received from the first port.
  • the network device 10 may send a MAC control frame to the first port.
  • the MAC control frame carries a PAUSE mark.
  • the PAUSE mark may also carry a time parameter.
  • the time parameter is used to indicate the time to suppress the first port.
  • the network device 10 When the network device 10 has received the data of the network device with a higher target priority than the network device 20, it sends a MAC control frame carrying the PAUSE flag to the first port.
  • the time parameter carried by the PAUSE flag is 0, which is used to indicate stop. Inhibition of the first port.
  • the network device 10 receives and processes the request message and obtains a response message.
  • the network device 10 When the network device 10 can receive the request message from the network device 20, it will receive the request message from the first port, process the request message, and generate a response message.
  • the network device 20 and the network device 10 may also have multiple sessions.
  • the network device 10 When the network device 20 sends a request to the network device 10 based on multiple sessions, the network device 10 will also determine the session type of each session. Prioritize requests.
  • the network device 10 will first receive and process request messages with high request priority.
  • the session type can include control session, query session and subscription session.
  • the request priority corresponding to the session type from high to low is: control session, query session and subscription session. It should be understood that this application does not specifically limit the setting of session type and request priority.
  • Network device 10 replies with a response message to network device 20.
  • the network device 10 After the network device 10 processes the request message, it will reply to the network device 20 with a response message. As shown in FIG. 9A , session 1 exists between network device 10 and network device 21 , session 2 exists between network device 10 and network device 20 , and session 3 exists between network device 10 and network device 24 .
  • the network device 10 determines to communicate with the network device 20, after receiving the request message 1 sent by the network device 20 based on the session 2, it processes the request message 1 according to the response priority of the session 2 and sends it to the network device 20. Reply to the response message 1 obtained after processing the request message.
  • network device 10 when there are multiple ongoing sessions between network device 20 and network device 10, network device 10 will generate multiple response messages based on multiple request messages sent by network device 20, and network device 10 will also generate multiple response messages based on each request message.
  • the session type of each response message determines its response priority, and replies to the response messages in sequence according to the response priority.
  • the priorities of request messages and response messages of the same session type may also be different.
  • the response priorities corresponding to the session type from high to low are: query session, control session, subscription session, where, The query priority of the query session is lower than that of the control session, but the response priority of the query session is higher than that of the control session. That is to say, the network device 10 will receive and process the request message for the control session first, but may reply to the request message for the control session later. It should be understood that this application does not specifically limit the setting of session type and response message priority.
  • session 1 exists between network device 10 and network device 21
  • session 2 and session 4 exist between network device 10 and network device 20
  • session 3 exists between network device 10 and network device 24 .
  • network device 20 sends request message 1 and request message 2 to network device 10
  • network device 10 will receive request message 1 first and then request message 2.
  • request message 1 and request message 2 is completed. Because the response priority of session 4 is high, response message 2 is sent first, and then response message 1 is sent.
  • the network device 10 when the network device 10 receives data, it does so in accordance with the priority order of the peer network device. For network devices with low priority, the network device 10 can also suppress the ports connected to them, so that even if there are a large number of Even if the network device sends data to the network device 10 at the same time, the network device 10 will not be overloaded. Moreover, the network device 10 can also determine the response priority according to the session type. In this way, both the request message and the response message can be prioritized according to the session type, and the two-way communication can be carried out according to the priority, ensuring the two-way communication resources. can be done reasonably.
  • the process of the network device 10 sending a message to the network device 20 will be described in detail below with reference to FIG. 10 .
  • the network device 10 determines whether to send a request message to the network device 20 according to the target priority of the network device 20.
  • the network device 10 first determines whether it is currently sending data of other network devices. If the network device 10 is not sending data of other network devices, the network device 10 can currently send data to the network device 20, and step S1030 is about to be executed.
  • the network device 10 will also determine whether it can send data to the network device 20 based on the target priority of the network device 20 .
  • the network device 10 can currently send data to the network device 20 first, and step S1030 will be performed.
  • the network device 10 is receiving or is about to receive data from a network device with a higher target priority than the network device 20, the network device 10 will first receive data from the network device with a higher priority, that is, step S1020 is performed.
  • S1020 The network device 10 sends data to a higher priority network device.
  • the network device 10 When the priority of the network device 20 is lower than that of other network devices, the network device 10 will first send the data of the network device with a higher priority. When the network device 10 has completed sending the data of the network device with a higher priority, the network device 10 will execute step S1030.
  • S1030 The network device 10 sends a request message to the network device 20, and the request message carries the response priority.
  • the network device 10 can send a request message to the network device 20 , and the request message carries the request message.
  • the response priority of the session corresponding to the message is determined so that the network device 20 can respond to the request message according to the response priority. For details on the response priority, please refer to the relevant description in Figure 7 and will not be repeated here.
  • the network device 10 and the network device 20 may also have multiple sessions.
  • the network device 10 When the network device 10 needs to send multiple request messages to the network device 20, the network device 10 will also determine the request of each request message. Priority, request messages with higher request priority are sent first. For details on the session type and request priority, please refer to the relevant description in Figure 7 and will not be repeated here.
  • the network device 20 receives and processes the request message according to the response priority, and obtains a response message.
  • the network device 20 After receiving the request message, the network device 20 will process the request message and generate a response message.
  • the network device 20 there are multiple sessions between the network device 10 and the network device 20.
  • the network device 20 When the network device 20 receives multiple request messages, the network device 20 will also decide to process the request based on the response priority carried in the request message. The order of the packets, in which the network device 20 will prioritize request packets with high response priority.
  • the network device 20 After the network device 20 processes the request message, it will reply to the network device 10 with a response message.
  • the order of replying the response messages will also be determined based on the response priority.
  • the network device 10 when the network device 10 sends data to other network devices, the network device to send first will be determined according to the priority of the network device. Then, the order in which request messages are sent is determined based on the session type, and the response priority can also be carried in the request message, so that the peer network device can process and reply to the request message according to the response priority. In this way, both the request message and the response message can be prioritized according to the session type, and the two-way communication can be carried out according to the priority, ensuring that the two-way communication resources can be carried out reasonably.
  • emergency communication can also be established between the network device 20 and the network device 10.
  • the network device 20 when the network device 20 needs to establish emergency communication with the network device 10, the network device 20 will initiate an emergency communication with the network device 10. The initial message of the communication, and suppresses the communication of other ports except the second port connected to the network device 10 . After receiving the emergency communication message, the network device 10 will also suppress communication on other ports except the first port to ensure that the communication resources between the network device 10 and the network device 20 are not occupied by other network devices.
  • the emergency communication between the network device 10 and the network device 20 will be described in detail below.
  • the following takes the network device 20 initiating emergency communication to the network device 10 as an example.
  • the network device 10 is connected to the second port of the network device 20 through the first port. It should be understood that the communication scheduling provided by this application In the method, any network device can initiate emergency communication. This application does not specifically limit the network device that initiates emergency communication.
  • the start message sent to the network device 10 may carry a start tag.
  • the start tag is used to indicate that the network device 20 needs to establish emergency communication with the network device 10, where , the initial message can also carry the emergency communication duration.
  • the process of emergency communication between the network device 20 and the network device 10 may refer to the method flow shown in Figure 11 .
  • S1110 The network device 20 suppresses communication on ports other than the second port.
  • the network device 20 may send a MAC control frame to other ports except the second port.
  • the MAC control frame carries a PAUSE flag to indicate that the port is inhibited from receiving and sending data.
  • S1120 The network device 20 sends a start message to the network device 10, and the start message carries a start tag.
  • the start message sent by the network device 20 to the network device 10 carries a start tag, and the start tag is used to indicate to the network device 10 that the network device 20 needs to perform emergency communication.
  • the network device 20 may send an initial message to the network device 10 and then suppress communications on other ports except the first port. That is to say, step S1120 is executed first, and then step S1110 is executed.
  • S1130 The network device 10 suppresses communication of other ports except the first port according to the start mark.
  • the network device 10 may send a MAC control frame to other ports except the first port, and the MAC control frame carries a PAUSE flag to indicate that the port is suppressed from receiving and sending data.
  • the network device 20 sends emergency communication data to the network device 10.
  • the network device 20 When the network device 20 continues to send emergency communication related messages to the network device 10 until the emergency communication data of the network device 20 is sent, the network device 20 will execute step S1150.
  • S1150 The network device 20 resumes communication with the port connected to other devices.
  • the network device 20 may send a MAC control frame to other ports except the first port.
  • the MAC control frame carries a PAUSE mark, and the time parameter of the PAUSE mark is recorded as 0, which is used to end communication suppression on the port.
  • the network device 20 sends a termination message to the network device 10, and the termination message carries a termination mark.
  • the termination message sent by the network device 20 to the network device 10 carries a termination mark, and the termination mark is used to indicate the end of the emergency communication.
  • S1170 The network device 10 resumes communication with the port connected to other devices.
  • the network device 10 After receiving the termination message carrying the termination mark, the network device 10 will send a MAC control frame to other ports except the second port.
  • the MAC control frame carries the PAUSE mark, and the time parameter of the PAUSE mark is recorded as 0, which is used to end the communication. Communication suppression for the port.
  • the network device 10 and the network device 20 are connected through other intermediate network devices, for example, the network device 10 and the network device 20 are connected through a router or a switch.
  • the intermediate network device is used For forwarding messages. When the intermediate device receives the start message, it will also suppress communication except for the port connecting the network device 10 and the network device 20; when the intermediate device receives the termination message, it will resume communication on all ports.
  • the process of emergency communication between the network device 20 and the network device 10 may refer to the method flow shown in Figure 13 .
  • the network device 20 suppresses communication on other ports except the first port.
  • the network device 20 may send a MAC control frame to other ports except the first port.
  • the MAC control frame carries a PAUSE flag and a time parameter used to indicate the suppression port to receive and send data.
  • the time parameter is used to indicate the time to suppress the port.
  • Network device 20 sends a start message to network device 10, where the start message carries a start tag and emergency communication duration.
  • the start message sent by the network device 20 to the network device 10 carries a start tag and an emergency communication duration.
  • the start tag is used to indicate to the network device 10 that the network device 20 needs to perform emergency communication
  • the emergency communication duration is used to indicate this emergency communication. required time.
  • the network device 20 may send an initial message to the network device 10 and then suppress communications on other ports except the first port. That is to say, step S1320 is executed first, and then step S1310 is executed.
  • S1330 The network device 10 suppresses the communication of other ports except the second port according to the start mark.
  • the network device 10 may send a MAC control frame to other ports except the second port.
  • the MAC control frame carries a PAUSE flag and a time parameter to indicate the suppression port to receive and send data.
  • the time parameter is used to indicate the time to suppress the port.
  • the network device 20 sends emergency communication data to the network device 10.
  • the network device 20 continuously sends emergency communication related messages to the network device 10 until the emergency communication duration is reached. After the emergency communication duration is reached, communication on all ports of the network device 10 and the network device 20 will also be restored.
  • network device 10 and network device 20 are connected through other intermediate network devices, for example, network device 10 and network device 20 are connected through routers or switches, and the intermediate network device is used to forward messages. After the intermediate device receives the initial message, it will also suppress communication except for the port connecting the network device 10 and the network device 20; after the emergency communication time is reached, the communication on all ports will be restored.
  • the start message sent by the network device 20 carries a start tag, and the network device 20 suppresses communication on other ports except those connected to the intermediate network device.
  • the intermediate network device will also suppress communications with ports connected to other devices and forward the initial message to the next intermediate network device until network device 10 receives the initial message.
  • the network device 20 sends the emergency communication data to the network device 10 through the intermediate network device.
  • the network device 20 sends a termination message to the network device 10 through the intermediate network node.
  • the network device 20 resumes communication on other ports. After the intermediate network node and network device 10 receive the termination message, they will also resume communications on other ports.
  • the start message sent by the network device 20 may also carry a start tag and emergency communication duration.
  • network device 20 suppresses communication on ports other than those connected to intermediate network devices. After the intermediate network device receives the initial message, it will parse the emergency communication duration, inhibit communication with the port connected to other devices, and forward the initial message to the next intermediate network device until network device 10 receives the initial message. Start message. Then, the network device 20 sends the emergency communication data to the network device 10 through the intermediate network device. When the emergency communication duration is reached, the network device 20 will automatically end the sending of the emergency communication data and resume communication on other ports. The intermediate network device and network device 10 will also automatically resume communication on other ports after receiving the emergency communication duration of the initial message.
  • Figure 15 illustrates a schematic diagram of an intermediate network node suppressing other ports during emergency communication.
  • the intermediate network node will reserve the ports with the emergency communication equipment, that is, the ingress/egress port and the ingress/egress port, and send MAC control frames to other ports.
  • the MAC control frame carries the PAUSE flag.
  • S1601 The surveillance camera sends an initial message to Router 3.
  • the initial message sent by the surveillance camera to the router 3 carries the emergency communication flag, or carries the emergency communication flag and the emergency communication duration.
  • Router 3 forwards the initial message to Router 2 and suppresses communication with the ports of Robot 1 and Robot 2.
  • Router 2 forwards the initial message to Router 1 and suppresses communication with the port of auxiliary collection PC2.
  • Router 1 forwards the initial message to the remote controller and suppresses communication with the port of the auxiliary collection PC1.
  • Router 1 will restore the port of PC1 with secondary collection.
  • the communication scheduling method provided by this application can update the priority of the network device in real time by obtaining the device type and real-time job status, and allocate communication resources to the network device according to the real-time updated priority, which can better meet the needs of real-time jobs. need. Moreover, by carrying the response priority in the request message, the peer network device can process the request message according to the response priority, so that two-way communication can be carried out according to the priority.
  • the communication scheduling method provided by this application can also suppress communication at the ports connecting network equipment and non-emergency communication equipment during emergency communication, so that the communication data of other devices will not occupy communication resources, and ensure that emergency communication data can be prioritized. Send and receive.
  • the present application provides a communication scheduling device 1700, which can be based on the equipment type of the network equipment and the network.
  • the real-time operating status of the device sets the priority of the network device and allocates communication resources according to the priority of the network device.
  • the communication scheduling device 1700 includes: an obtaining unit 1710 and a determining unit 1720.
  • the obtaining unit 1710 is used to obtain the device type and operation status of at least one network device connected to the first network device; wherein the at least one network device includes a second network device; the determining unit 1720 is used to obtain the device type and operation status of at least one network device according to the device type of the at least one network device.
  • Determine the first priority table which includes the initial priority of at least one network device, wherein the initial priorities of network devices with the same device type are the same; the determining unit 1720 is also used to determine the second The initial priority of the network device is determined, and the target priority of the second network device is determined based on the job status of the second network device and the initial priority of the second network device in the first priority table.
  • the determining unit 1720 is further configured to update the first priority table to the second priority table according to the target priority of the second network device.
  • the second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or, the second priority table is determined by sorting each The initial priority of network devices is determined according to the preset ranking corresponding to the job status of each network device.
  • the apparatus further includes a sending unit 1730; the determining unit 1720 is further configured to determine whether to communicate with the second network device according to the second priority table; the sending unit 1730 is configured to determine whether to communicate with the second network device.
  • the first request message When, a first request message is sent to the second network device, the first request message carries a response priority, and the response priority is used by the second network device to determine the time to respond to the first request message.
  • the device further includes a receiving unit 1740; the determining unit 1720 is further configured to determine whether to communicate with the second network device according to the second priority table; the receiving unit 1740 is configured to determine whether to communicate with the second network device when when, receiving the second request message sent by the second network device; the determining unit 1720 is also configured to determine the response priority of the second request message according to the second request message, and the response priority of the second request message is based on The session type of the second request message is determined.
  • the obtaining unit 1710 is also used to obtain the session types of the multiple sessions; the determining unit 1720 is also used to obtain the session types from the multiple sessions according to the session type.
  • the request priority corresponding to the session type is used to indicate the order in which session request messages are sent.
  • the first port of the first network device is connected to the second port of the second network device; the receiving unit 1740 is also configured to receive an initial message sent by the second network device, where the initial message carries emergency communication.
  • the start tag; determination unit 1720 is also configured to suppress communication on other ports except the first port according to the start message.
  • the receiving unit 1740 is also configured to receive a termination message sent by the second network device, where the termination message carries an emergency communication termination flag; the determining unit 1720 is also configured to restore other ports except the first port according to the termination message. Port communication.
  • the initial message also carries an emergency communication duration, and the emergency communication duration is used to indicate the communication suppression duration of other ports except the first port.
  • the device types include: motion control class, status control class and status sensing class, where the initial priority of the device type corresponding to the network device from high to low is: motion control class, status control class, status sensing class Sense type; the job status includes: working, preparing to work, and not working in progress. Among them, the priority corresponding to the job status from high to low is: working in progress, preparing to work, and not working in progress.
  • session types include: control session, query session, and subscription session, where the request priorities corresponding to the session types from high to low are: control session, query session, and subscription session. , the response priority corresponding to the session type from high to low is: query session, control session, subscription session.
  • the communication scheduling device can update the priority of the network equipment in real time by obtaining the device type and real-time operation status, and allocate communication resources to the network equipment according to the real-time updated priority, which can better meet the needs of real-time operations. need.
  • the peer network device can process the request message according to the response priority, so that two-way communication can be carried out according to the priority.
  • the communication scheduling method provided by this application It can also suppress communication at the ports connecting network equipment and non-emergency communication equipment during emergency communications, so that the communication data of other devices will not occupy communication resources, ensuring that emergency communication data can be sent and received first.
  • FIG 18 is a schematic structural diagram of a computing device 1800 provided by this application.
  • the computing device 1800 may be the communication scheduling device 1800 in the aforementioned content.
  • network device 1800 includes: a processor 1810, a communication interface 1820, and a memory 1830.
  • the processor 1810, the communication interface 1820 and the memory 1830 can be connected to each other through the internal bus 1840, or can communicate through other means such as wireless transmission.
  • the embodiment of this application takes the connection through bus 1840 as an example.
  • the bus 1840 can be a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus ( unified bus, Ubus or UB), computer express link (compute express link, CXL), cache coherent interconnect for accelerators (CCIX), etc.
  • PCIe Peripheral Component Interconnect Express
  • EISA extended industry standard architecture
  • unified bus unified bus, Ubus or UB
  • CXL compute express link
  • CXL cache coherent interconnect for accelerators
  • Bus 1840 can be divided into address bus, data bus, control bus, etc.
  • the bus 1840 may also include a power bus, a control bus, a status signal bus, etc.
  • the various buses are labeled bus 1840 in the figure.
  • the processor 1810 may include at least one general-purpose processor, such as a central processing unit (Central Processing Unit, CPU), or a combination of a CPU and a hardware chip.
  • the above-mentioned hardware chip can be an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), a programmable logic device (Programmable Logic Device, PLD), or a combination thereof.
  • the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (Field-Programmable Gate Array, FPGA), a general array logic (Generic Array Logic, GAL), or any combination thereof.
  • Processor 1810 executes various types of digital storage instructions, such as software or firmware programs stored in memory 1830, that enable computing device 900 to provide a variety of services.
  • the memory 1830 is used to store program codes, and is controlled and executed by the processor 1810 to perform the processing steps of the communication scheduling method in the above embodiment.
  • the program code may include one or more software modules.
  • the one or more software modules may be the software modules provided in the embodiment of Figure 17, such as an acquisition unit and a determination unit: the acquisition unit is used to obtain the information connected to the first network device.
  • the device type and working status of at least one network device wherein at least one network device includes a second network device; the determining unit is configured to determine a first priority table according to the device type of at least one network device, and the first priority table includes at least The initial priority of a network device, wherein network devices with the same device type have the same initial priority; the determination unit is also used to determine the initial priority of the second network device, and determine the initial priority of the second network device according to the working status of the second network device and the first priority.
  • the initial priority of the second network device in the level table determines the target priority of the second network device.
  • this embodiment can be implemented by a general-purpose physical server, such as an ARM server or an A complete computer system with complete hardware system functions and running in a completely isolated environment is not specifically limited in this application.
  • the memory 1830 may include volatile memory (Volatile Memory), such as random access memory (Random Access Memory, RAM); the memory 1830 may also include non-volatile memory (Non-Volatile Memory), such as read-only memory (Read-Only Memory). Only Memory (ROM), flash memory (Flash Memory), hard disk (Hard Disk Drive (HDD) or solid-state drive (Solid-State Drive, SSD); the memory 1830 may also include a combination of the above types.
  • the memory 1830 may store program codes to specifically execute steps S310 to S340 and their optional steps in the embodiment of FIG. 3, or execute steps S710 to S750 and their optional steps in the embodiment of FIG. 7, or, FIG.
  • the communication interface 1820 may be a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface), or a wireless interface (such as a cellular network interface or using a wireless LAN interface) for communicating with other devices or modules.
  • a wired interface such as an Ethernet interface
  • PCIe Peripheral Component Interconnect express
  • Figure 18 is only a possible implementation manner of the embodiment of the present application.
  • the network device 1800 may also include more or fewer components, which is not limited here.
  • contents not shown or described in the embodiments of the present application please refer to the relevant explanations in the embodiments of FIG. 3 , FIG. 7 , FIG. 10 , FIG. 11 and FIG. 13 , and will not be described again here.
  • computing device shown in Figure 18 can also be a computer cluster composed of at least one server, which is not specifically limited in this application.
  • Embodiments of the present application also provide a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When it is run on a processor, the instructions shown in Figure 3, Figure 7, Figure 10, Figure 11 and Figure 13 The method flow is realized.
  • Embodiments of the present application also provide a computer program product.
  • the computer program product is run on a processor, the method flows shown in Figures 3, 7, 10, 11 and 13 are implemented.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, Digital Subscriber Line, DSL) or wireless (such as infrared, wireless, microwave, etc.) methods.
  • the computer Readable storage media can be any available media that can be accessed by a computer or data storage devices such as servers and data centers that contain one or more sets of available media.
  • the available media can be magnetic media (for example, floppy disks, hard disks, tapes ), optical media (for example, high-density digital video disc (DVD)), or semiconductor media.
  • the semiconductor media can be SSD.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Computer And Data Communications (AREA)

Abstract

Provided in the present application are a communication scheduling method and apparatus, and a related device. In the method, the priority of a network device can be updated in real time by means of acquiring a device type and a real-time operation state, and a communication resource can be allocated to the network device according to the priority, which is updated in real time, such that a real-time operation requirement can be better met. Moreover, by means of carrying a response priority in a request message, an opposite-end network device can process the request message according to the response priority, such that bidirectional communication can be performed according to the priority. In the communication scheduling method provided in the present application, communication suppression can also be performed, in emergency communication, on a port, which is connected to a non-emergency communication device, of the network device, such that communication data from other devices does not occupy communication resources, thereby ensuring that data of emergency communication can be preferentially sent and received.

Description

一种通信调度方法、装置以及相关设备A communication scheduling method, device and related equipment
本申请要求于2022年05月31日提交中国专利局、申请号为202210615277.X、申请名称为“一种通信调度方法、装置以及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 31, 2022, with the application number 202210615277.X and the application title "A communication scheduling method, device and related equipment", the entire content of which is incorporated by reference incorporated in this application.
技术领域Technical field
本发明涉及通信领域,尤其涉及一种通信调度方法、装置以及相关设备。The present invention relates to the field of communication, and in particular, to a communication scheduling method, device and related equipment.
背景技术Background technique
在通信网络中,通常存在一个网络设备连接多个网络设备的情况,连接多个网络设备的设备可以称为主设备,其他网络设备可以称为从设备。主设备还可以为从设备设定优先级,当接收到优先级高的从设备发送的报文时,主设备将会优先处理该从设备的报文或者优先向优先级高的从设备发送报文。In a communication network, there is usually a situation where one network device is connected to multiple network devices. The device connected to multiple network devices can be called a master device, and other network devices can be called slave devices. The master device can also set the priority for the slave device. When receiving a message from a slave device with a higher priority, the master device will give priority to the message from the slave device or send a message to the slave device with a higher priority. arts.
但是,在网络设备实际作业中,网络设备对通信资源的需求会随着作业进度而变化。往往正在作业或准备作业的网络设备发送的报文需要被尽快处理,以及给正在作业或准备作业的网络设备的报文也需要被优先发送,以便能尽快收到对应的响应报文,使得网络设备的业务能按时执行。但是,为网络设备设定了固定的优先级,则无法满足实际作业需求。However, in the actual operation of network equipment, the demand for communication resources of network equipment will change with the progress of the operation. Often, messages sent by network devices that are operating or preparing to operate need to be processed as soon as possible, and messages to network devices that are operating or preparing to operate also need to be sent with priority, so that the corresponding response messages can be received as soon as possible, making the network Equipment services can be executed on time. However, setting fixed priorities for network devices cannot meet actual operational needs.
因此,如何为实际作业的网络设备合理分配通信资源是亟待解决的问题。Therefore, how to reasonably allocate communication resources for actual operating network equipment is an issue that needs to be solved urgently.
发明内容Contents of the invention
本申请提供了一种通信调度方法、装置以及相关设备,通过获取设备类型和实时作业状态,为网络设备实时更新优先级,并根据实时更新的优先级为网络设备分配通信资源,更能满足实时作业需求。This application provides a communication scheduling method, device and related equipment. By obtaining the device type and real-time operation status, it updates the priority of the network equipment in real time, and allocates communication resources to the network equipment according to the real-time updated priority, which can better meet the real-time needs. Job requirements.
第一方面,本申请提供一种通信调度方法,应用于第一网络设备,包括:获取与第一网络设备连接的至少一个网络设备的设备类型和作业状态;其中,至少一个网络设备包括第二网络设备;根据至少一个网络设备的设备类型,确定第一优先级表,第一优先级表包括至少一个网络设备的初始优先级,其中,设备类型相同的网络设备的初始优先级相同;确定第二网络设备的初始优先级,并根据第二网络设备的作业状态和第一优先级表中第二网络设备的初始优先级,确定第二网络设备的目标优先级。In a first aspect, the present application provides a communication scheduling method, applied to a first network device, including: obtaining the device type and operation status of at least one network device connected to the first network device; wherein the at least one network device includes a second network device. Network equipment; determine a first priority table according to the equipment type of at least one network equipment. The first priority table includes the initial priority of at least one network equipment, wherein the initial priorities of network equipment with the same equipment type are the same; determine the first priority table. an initial priority of the second network device, and determine a target priority of the second network device based on the job status of the second network device and the initial priority of the second network device in the first priority table.
在上述方案中,先基于连接的网络设备的设备类型对网络设备的初始优先级进行排序,得到第一优先级表,再根据网络设备的作业状态对第二网络设备的初始优先级进行调整,得到第二网络设备的目标优先级。这样,第一网络设备能基于目标优先级和第二网络设备进行通信,目标优先级既考虑了第二网络设备的设备类型,又考虑了第二网络设备的作业状态,能满足第二网络设备在实时作业中对通信的需求。In the above solution, the initial priorities of the network devices are first sorted based on the device types of the connected network devices to obtain the first priority table, and then the initial priorities of the second network devices are adjusted according to the operating status of the network devices. Get the target priority of the second network device. In this way, the first network device can communicate with the second network device based on the target priority. The target priority takes into account both the device type of the second network device and the operating status of the second network device, and can satisfy the needs of the second network device. The need for communication in real-time operations.
结合第一方面,在一些实现方式中,该通信调度方法,还包括,根据第二网络设备的目标优先级,将第一优先级表更新为第二优先级表。In conjunction with the first aspect, in some implementations, the communication scheduling method further includes updating the first priority table to the second priority table according to the target priority of the second network device.
在上述方案中,得到第一优先级表后,会再根据网络设备的作业状态将初始优先级进行调整,最终得到第二优先级表。第一网络设备和与其连接的网络设备的通信是按照第二 优先级表进行的,在网络设备对通信需求会随着作业进程而变化时,也能使得第一网络设备能根据网络设备实时作业状态与网络设备进行通信,能满足网络设备对通信资源的需求。In the above solution, after obtaining the first priority table, the initial priority will be adjusted according to the working status of the network device, and finally the second priority table will be obtained. The communication between the first network device and the network device connected to it is in accordance with the second Priority table is used to enable the first network device to communicate with the network device according to the real-time operating status of the network device when the communication requirements of the network device change with the work process, thereby meeting the network device's demand for communication resources. .
结合第一方面,在一些实现方式中,该通信调度方法,第二优先级表是将第一优先级表中相同初始优先级的网络设备按作业状态对应的优先级进行再次排序确定的;或者,第二优先级表是将每个网络设备的初始优先级按照每个网络设备的作业状态调整作业状态对应的预设名次确定的。Combined with the first aspect, in some implementations of the communication scheduling method, the second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or , the second priority table is determined by adjusting the initial priority of each network device according to the preset ranking corresponding to the operating status of each network device.
在上述方案中,第二优先级表可以是将相同设备类型的网络设备根据作业状态再排序得到的,也可以是根据作业状态将初始优先级调整预设名次得到的,例如,正在作业的网络设备初始优先级往前调整若干名次。这样,第二优先级表中的网络设备优先级就是根据网络设备的设备类型和作业状态综合得到的,第一网络设备根据第二优先级表与网络设备进行通信,能更满足网络设备对通信资源的需求。In the above solution, the second priority table can be obtained by reordering network devices of the same device type according to the job status, or it can be obtained by adjusting the initial priority to the preset ranking according to the job status, for example, the network devices in operation The initial priority of the device is adjusted forward by several positions. In this way, the priority of the network device in the second priority table is comprehensively obtained based on the device type and operating status of the network device. The first network device communicates with the network device according to the second priority table, which can better meet the needs of the network device for communication. resource requirements.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:根据第二优先级表,确定是否与第二网络设备进行通信;当确定与第二网络设备进行通信时,向第二网络设备发送第一请求报文,第一请求报文携带响应优先级,响应优先级用于第二网络设备确定响应第一请求报文的时间。In conjunction with the first aspect, in some implementations, the communication scheduling method further includes: determining whether to communicate with the second network device according to the second priority table; when it is determined to communicate with the second network device, sending a request to the second network device. The network device sends a first request message, the first request message carries a response priority, and the response priority is used by the second network device to determine the time to respond to the first request message.
在上述方案中,第一网络设备向第二网络设备发送请求报文时,还会在请求报文中携带响应优先级。第二网络设备也能根据响应优先级安排对请求报文的处理,使得在第一网络设备与第二网络设备的双向通信中,都能按照优先级进行,而不是只有第一网络设备能按优先级处理来自其他网络设备的数据,进而,提高双方网络设备通信效率。In the above solution, when the first network device sends a request message to the second network device, the request message also carries the response priority. The second network device can also arrange the processing of the request message according to the response priority, so that the two-way communication between the first network device and the second network device can be carried out according to the priority, instead of only the first network device can according to the priority. Prioritize processing of data from other network devices, thereby improving communication efficiency between network devices on both sides.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:根据第二优先级表,确定是否与第二网络设备进行通信;当确定与第二网络设备进行通信时,接收第二网络设备发送的第二请求报文;根据第二请求报文,确定第二请求报文的响应优先级,第二请求报文的响应优先级是根据第二请求报文的会话类型确定的。Combined with the first aspect, in some implementations, the communication scheduling method further includes: determining whether to communicate with the second network device according to the second priority table; when it is determined to communicate with the second network device, receiving the second The second request message sent by the network device; determine the response priority of the second request message according to the second request message, and the response priority of the second request message is determined according to the session type of the second request message.
在上述方案中,第一网络设备会根据第二网络设备发送的请求报文的会话类型,确定响应该请求报文的时间。第一网络设备根据目标优先级确定与第二网络设备通信之后,还会根据请求报文的会话类型确定响应请求报文的时间,使得能优先处理会话类型优先级更高的会话,进而,提高通信效率。In the above solution, the first network device determines the time to respond to the request message according to the session type of the request message sent by the second network device. After the first network device determines to communicate with the second network device according to the target priority, it will also determine the time to respond to the request message according to the session type of the request message, so that the session with a higher session type priority can be prioritized, thereby improving Communication efficiency.
结合第一方面,在一些实现方式中,第一网络设备与第二网络设备之前存在多个会话,该通信调度方法,还包括:获取多个会话的会话类型;根据会话类型,从多个会话中确定目标会话,目标会话是根据多个会话中会话类型对应的请求优先级确定的,会话类型对应的请求优先级用于指示发送会话请求报文的顺序。Combined with the first aspect, in some implementations, there are multiple sessions between the first network device and the second network device. The communication scheduling method further includes: obtaining the session types of the multiple sessions; according to the session type, from the multiple sessions The target session is determined based on the request priority corresponding to the session type in multiple sessions. The request priority corresponding to the session type is used to indicate the order in which session request messages are sent.
在上述方案中,第一网络设备还会对于第二网络设备进行的多个会话按会话类型进行优先级排序,第一网络设备根据目标优先级确定与第二网络设备通信之后,将根据会话优先级对多个会话进行处理。这样,使得需要被更快响应的会话能被优先处理,进而,会话优先级高的业务能优先进行,整体业务也能有序进行,提高了整体业务的进度。In the above solution, the first network device will also prioritize multiple sessions conducted by the second network device by session type. After the first network device determines to communicate with the second network device based on the target priority, it will prioritize the sessions according to the target priority. handle multiple sessions. In this way, sessions that need to be responded to faster can be processed with priority. Furthermore, services with high session priority can be carried out first, and the overall business can be carried out in an orderly manner, which improves the progress of the overall business.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:确定是否处于紧急通信状态;基于紧急状态,确定与第二网络设备紧急通信;并且,在紧急状态解除后,根据第二优先级表确定是否与第二网络设备进行通信。With reference to the first aspect, in some implementations, the communication scheduling method further includes: determining whether it is in an emergency communication state; determining emergency communication with the second network device based on the emergency state; and, after the emergency state is lifted, according to the second A priority table determines whether to communicate with the second network device.
在上述方案中,第一网络设备还能与其他网络设备进行紧急通信,当第一网络设备在 紧急状态中,将根据紧急状态判断进行通信的对端网络设备。当紧急状态解除之后,第一网络设备再根据第二优先级表确定进行通信的对端网络设备。这样,先进行紧急通信的数据传输,再根据优先级表进行数据传输,能满足实际网络中存在紧急通信的情况。In the above solution, the first network device can also perform emergency communication with other network devices. When the first network device In an emergency state, the peer network device for communication will be determined based on the emergency state. After the emergency state is lifted, the first network device determines the peer network device for communication according to the second priority table. In this way, the data transmission of emergency communication is performed first, and then the data transmission is performed according to the priority table, which can meet the situation of emergency communication in the actual network.
结合第一方面,在一些实现方式中,第一网络设备的第一端口与第二网络设备的第二端口连接,该通信调度方法,还包括:接收第二网络设备发送的起始报文,起始报文携带紧急通信起始标记,起始标记用于表示紧急状态开始;根据起始报文,确定与第二网络设备紧急通信,并抑制除第一端口的其他端口的通信。With reference to the first aspect, in some implementations, the first port of the first network device is connected to the second port of the second network device, and the communication scheduling method further includes: receiving a start message sent by the second network device, The start message carries an emergency communication start tag, and the start tag is used to indicate the start of the emergency state; according to the start message, emergency communication with the second network device is determined, and communication on other ports except the first port is suppressed.
在上述方案中,第一网络设备确定与第二网络设备进行紧急通信,在第二网络设备发起紧急通信后,第一网络设备和第二网络设备都会抑制其他端口的通信,只保留紧急通信的端口,使得其他设备的数据不会占用紧急通信的资源,提高了紧急通信的效率。In the above solution, the first network device determines to conduct emergency communication with the second network device. After the second network device initiates the emergency communication, both the first network device and the second network device will suppress the communication of other ports and only retain emergency communication. port, so that the data of other devices will not occupy emergency communication resources, improving the efficiency of emergency communication.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:接收第二网络设备发送的终止报文,起始报文携带紧急通信终止标记;根据终止报文,恢复除第一端口的其他端口的通信。Combined with the first aspect, in some implementations, the communication scheduling method further includes: receiving a termination message sent by the second network device, the initial message carrying an emergency communication termination mark; and restoring the port except the first port according to the termination message. communication on other ports.
在上述方案中,第二网络设备向第一网络设备发送终止报文,就能结束与第一网络设备的紧急通信,然后第一网络设备和第二网络设备都恢复所有端口的通信。这样,在紧急通信中,其他设备的数据不会占用紧急通信的资源,提高了紧急通信的效率。In the above solution, the second network device sends a termination message to the first network device to end the emergency communication with the first network device, and then both the first network device and the second network device resume communication on all ports. In this way, during emergency communication, data from other devices will not occupy emergency communication resources, improving the efficiency of emergency communication.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:起始报文还携带紧急通信时长,紧急通信时长用于第一网络设备确定除第一端口的其他端口的通信抑制时长。Combined with the first aspect, in some implementations, the communication scheduling method further includes: the initial message also carries an emergency communication duration, and the emergency communication duration is used by the first network device to determine the communication suppression duration of other ports except the first port. .
在上述方案中,第二网络设备还可以在起始报文中携带紧急通信时长,在达到紧急通信时长后,第一网络设备和第二网络设备会结束紧急通信,恢复所有端口的通信。这样,第二网络设备不用额外发送在终止报文,且在紧急通信中,其他设备的数据不会占用紧急通信的资源,提高了紧急通信的效率。In the above solution, the second network device can also carry the emergency communication duration in the initial message. After the emergency communication duration is reached, the first network device and the second network device will end the emergency communication and resume communication on all ports. In this way, the second network device does not need to send additional termination messages, and during emergency communication, data from other devices will not occupy emergency communication resources, which improves the efficiency of emergency communication.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:设备类型包括:运动控制类,状态控制类以及状态传感类,其中,设备类型对应网络设备的初始优先级从高到低为:运动控制类、状态控制类、状态传感类;作业状态包括:正在作业、准备作业和未进行作业,其中,作业状态对应的优先级从高到低为:正在作业、准备作业、未进行作业。Combined with the first aspect, in some implementations, the communication scheduling method also includes: device types include: motion control class, status control class and status sensing class, where the device type corresponds to the initial priority of the network device from high to The low ones are: motion control class, status control class, status sensing class; the job status includes: working, preparing to work, and not working. Among them, the priority corresponding to the job status from high to low is: working, preparing to work, No work was done.
在上述方案中,运动控制类网络设备因为要进行动作操作,需要更高的优先级,正在作业的网络设备因为有正在进行的作业业务数据需要发送,因此,对应网络设备的优先级也更高。这样,在网络设备对通信需求会随着作业进程而变化时,也能使得第一网络设备能根据网络设备实时作业状态与网络设备进行通信,能满足网络设备对通信资源的需求。In the above solution, the motion control network equipment needs a higher priority because it needs to perform action operations. The working network equipment has ongoing operation business data that needs to be sent. Therefore, the corresponding network equipment also has a higher priority. . In this way, when the communication requirements of the network device change with the operation process, the first network device can also communicate with the network device according to the real-time operation status of the network device, thereby meeting the network device's demand for communication resources.
结合第一方面,在一些实现方式中,该通信调度方法,还包括:会话类型包括:控制类会话、查询类会话、订阅类会话,其中,会话类型对应的请求优先级从高到低为:控制类会话、查询类会话、订阅类会话,会话类型对应的响应优先级从高到低为:查询类会话、控制类会话、订阅类会话。Combined with the first aspect, in some implementations, the communication scheduling method also includes: session types include: control session, query session, subscription session, where the request priority corresponding to the session type from high to low is: Control session, query session, subscription session. The response priority corresponding to the session type from high to low is: query session, control session, subscription session.
在上述方案中,第一网络设备还会对于第二网络设备进行的多个会话按会话类型进行优先级排序,使得需要被更快响应的会话能被优先处理,进而,会话优先级高的业务能优先进行,整体业务也能有序进行,提高了整体业务的进度。In the above solution, the first network device will also prioritize multiple sessions conducted by the second network device according to session type, so that sessions that need to be responded to faster can be processed first, and then services with high session priority can be processed first. It can be carried out with priority, and the overall business can be carried out in an orderly manner, which improves the progress of the overall business.
第二方面,本申请提供了一种通信调度装置,应用于第一网络设备,包括:获取单元、确定单元;获取单元用于获取与第一网络设备连接的至少一个网络设备的设备类型和作业 状态;其中,至少一个网络设备包括第二网络设备;确定单元用于根据至少一个网络设备的设备类型,确定第一优先级表,第一优先级表包括至少一个网络设备的初始优先级,其中,设备类型相同的网络设备的初始优先级相同;确定单元还用于确定第二网络设备的初始优先级,并根据第二网络设备的作业状态和第一优先级表中第二网络设备的初始优先级,确定第二网络设备的目标优先级。In a second aspect, the present application provides a communication scheduling device, applied to a first network device, including: an obtaining unit and a determining unit; the obtaining unit is used to obtain the device type and operation of at least one network device connected to the first network device. state; wherein, at least one network device includes a second network device; the determining unit is configured to determine a first priority table according to the device type of the at least one network device, and the first priority table includes an initial priority of at least one network device, wherein , network devices with the same device type have the same initial priority; the determining unit is also used to determine the initial priority of the second network device, and determine the initial priority of the second network device according to the job status of the second network device and the initial priority of the second network device in the first priority table. Priority, which determines the target priority of the secondary network device.
结合第二方面,在一些实现方式中,确定单元还用于根据第二网络设备的目标优先级,将第一优先级表更新为第二优先级表。In conjunction with the second aspect, in some implementations, the determining unit is further configured to update the first priority table to the second priority table according to the target priority of the second network device.
结合第二方面,在一些实现方式中,第二优先级表是将第一优先级表中相同初始优先级的网络设备按作业状态对应的优先级进行再次排序确定的;或者,第二优先级表是将每个网络设备的初始优先级按照每个网络设备的作业状态调整作业状态对应的预设名次确定的。Combined with the second aspect, in some implementations, the second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or, the second priority table The table determines the initial priority of each network device according to the preset ranking corresponding to the job status of each network device.
结合第二方面,在一些实现方式中,装置还包括发送单元;确定单元还用于根据第二优先级表,确定是否与第二网络设备进行通信;发送单元用于当确定与第二网络设备进行通信时,向第二网络设备发送第一请求报文,第一请求报文携带响应优先级,响应优先级用于第二网络设备确定响应第一请求报文的时间。With reference to the second aspect, in some implementations, the device further includes a sending unit; the determining unit is further configured to determine whether to communicate with the second network device according to the second priority table; the sending unit is configured to determine whether to communicate with the second network device. When communicating, a first request message is sent to the second network device. The first request message carries a response priority, and the response priority is used by the second network device to determine the time to respond to the first request message.
结合第二方面,在一些实现方式中,装置还包括接收单元;确定单元还用于根据第二优先级表,确定是否与第二网络设备进行通信;接收单元用于当确定与第二网络设备进行通信时,接收第二网络设备发送的第二请求报文;确定单元还用于根据第二请求报文,确定第二请求报文的响应优先级,第二请求报文的响应优先级是根据第二请求报文的会话类型确定的。With reference to the second aspect, in some implementations, the device further includes a receiving unit; the determining unit is further configured to determine whether to communicate with the second network device according to the second priority table; the receiving unit is configured to determine whether to communicate with the second network device according to the second priority table. When communicating, receive the second request message sent by the second network device; the determining unit is also used to determine the response priority of the second request message according to the second request message, and the response priority of the second request message is Determined according to the session type of the second request message.
结合第二方面,在一些实现方式中,第一网络设备与第二网络设备之前存在多个会话,获取单元还用于获取多个会话的会话类型;确定单元还用于根据会话类型,从多个会话中确定目标会话,目标会话是根据多个会话中会话类型对应的请求优先级确定的,会话类型对应的请求优先级用于指示发送会话请求报文的顺序。Combined with the second aspect, in some implementations, there are multiple sessions between the first network device and the second network device, and the obtaining unit is also used to obtain the session types of the multiple sessions; the determining unit is also used to obtain the session types from the multiple sessions according to the session types. The target session is determined in each session. The target session is determined based on the request priority corresponding to the session type in multiple sessions. The request priority corresponding to the session type is used to indicate the order in which session request messages are sent.
结合第二方面,在一些实现方式中,确定单元还用于确定是否处于紧急通信状态;基于紧急状态,确定与第二网络设备紧急通信;并且,在紧急状态解除后,确定单元还用于根据第二优先级表确定是否与第二网络设备进行通信。Combined with the second aspect, in some implementations, the determining unit is also used to determine whether it is in an emergency communication state; based on the emergency state, determine emergency communication with the second network device; and, after the emergency state is lifted, the determining unit is also used to determine according to The second priority table determines whether to communicate with the second network device.
结合第二方面,在一些实现方式中,第一网络设备的第一端口与第二网络设备的第二端口连接;接收单元还用于接收第二网络设备发送的起始报文,起始报文携带紧急通信起始标记,起始标记用于表示紧急状态开始;确定单元还用于根据起始报文,抑制除第一端口的其他端口的通信。Combined with the second aspect, in some implementations, the first port of the first network device is connected to the second port of the second network device; the receiving unit is also used to receive a start message sent by the second network device. The message carries an emergency communication start mark, and the start mark is used to indicate the start of the emergency state; the determination unit is also used to suppress communication on other ports except the first port according to the start message.
结合第二方面,在一些实现方式中,接收单元还用于接收第二网络设备发送的终止报文,终止报文携带紧急通信终止标记,终止标记用于表示紧急状态解除;确定单元还用于根据终止报文,恢复除第一端口的其他端口的通信。Combined with the second aspect, in some implementations, the receiving unit is also used to receive a termination message sent by the second network device, the termination message carries an emergency communication termination mark, and the termination mark is used to indicate that the emergency state is lifted; the determining unit is also used to According to the termination message, communication on other ports except the first port is restored.
结合第二方面,在一些实现方式中,起始报文还携带紧急通信时长,紧急通信时长用于第一网络设备确定除第一端口的其他端口的通信抑制时长。Combined with the second aspect, in some implementations, the initial message also carries an emergency communication duration, and the emergency communication duration is used by the first network device to determine the communication suppression duration of other ports except the first port.
结合第二方面,在一些实现方式中,设备类型包括:运动控制类,状态控制类以及状态传感类,其中,设备类型对应网络设备的初始优先级从高到低为:运动控制类、状态控制类、状态传感类;作业状态包括:正在作业、准备作业和未进行作业,其中,作业状态 对应的优先级从高到低为:正在作业、准备作业、未进行作业。Combined with the second aspect, in some implementations, the device types include: motion control class, status control class and status sensing class, where the device type corresponds to the initial priority of the network device from high to low: motion control class, status Control class, status sensing class; work status includes: working, preparing work and not working, among which, the work status The corresponding priorities from high to low are: working, preparing to work, and not working yet.
结合第二方面,在一些实现方式中,会话类型包括:控制类会话、查询类会话、订阅类会话,其中,会话类型对应的请求优先级从高到低为:控制类会话、查询类会话、订阅类会话,会话类型对应的响应优先级从高到低为:查询类会话、控制类会话、订阅类会话。Combined with the second aspect, in some implementations, the session types include: control session, query session, and subscription session, where the request priority corresponding to the session type from high to low is: control session, query session, For subscription sessions, the response priorities corresponding to the session types from high to low are: query session, control session, and subscription session.
第三方面,本申请提供了一种网络设备,其特征在于,包括处理器和存储器,存储器用于存储指令,处理器用于执行指令,当处理器执行该指令时,执行如第一方面所描述的方法。In a third aspect, this application provides a network device, which is characterized by including a processor and a memory. The memory is used to store instructions, and the processor is used to execute instructions. When the processor executes the instructions, the execution is as described in the first aspect. Methods.
第四方面,本申请提供一种计算机可读存储介质,其特征在于,计算机可读存储介质中存储有指令,当指令在网络设备上运行时,执行如第一方面所描述的方法。In a fourth aspect, this application provides a computer-readable storage medium, which is characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are run on a network device, the method described in the first aspect is executed.
第五方面,本申请提供了一种计算机程序产品,其特征在于,计算机程序产品包括计算机指令,在被计算设备执行时,计算设备执行如第一方面所描述的方法。In a fifth aspect, the present application provides a computer program product, which is characterized in that the computer program product includes computer instructions, and when executed by a computing device, the computing device performs the method described in the first aspect.
综上所述,本申请提供的通过获取设备类型和实时作业状态,为网络设备实时更新优先级,并根据实时更新的优先级为网络设备分配通信资源,更能满足实时作业需求。并且,能通过在请求报文中携带响应优先级,使对端网络设备能根据响应优先级处理请求报文,能使双向通信都能按照优先级进行。本申请提供的通信调度方法,还能在紧急通信中对网络设备与非紧急通信设备连接的端口进行通信抑制,使得其他设备的通信数据不会占用通信资源,保障了紧急通信的数据能优先被发送和接收。To sum up, the method provided by this application can better meet the needs of real-time operations by obtaining the device type and real-time operation status, updating the priority of the network equipment in real time, and allocating communication resources to the network equipment according to the real-time updated priority. Moreover, by carrying the response priority in the request message, the peer network device can process the request message according to the response priority, so that two-way communication can be carried out according to the priority. The communication scheduling method provided by this application can also suppress communication on the ports connecting network equipment and non-emergency communication equipment during emergency communication, so that communication data of other devices will not occupy communication resources, and ensure that emergency communication data can be prioritized. Send and receive.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。In order to explain the technical solutions in the embodiments of the present application more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。In order to explain the technical solutions in the embodiments of the present application more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below.
图1是本申请实施例提供的一种通信系统架构示意图;Figure 1 is a schematic diagram of a communication system architecture provided by an embodiment of the present application;
图2是本申请实施例提供的一种工业设备网络的通信系统架构示意图;Figure 2 is a schematic diagram of the communication system architecture of an industrial equipment network provided by an embodiment of the present application;
图3是本申请实施例提供的一种通信调度方法的流程示意图;Figure 3 is a schematic flowchart of a communication scheduling method provided by an embodiment of the present application;
图4是本申请实施例提供的一种第一优先级表的示意图;Figure 4 is a schematic diagram of a first priority table provided by an embodiment of the present application;
图5A是本申请实施例提供的一种第二优先级表生成过程的示意图;Figure 5A is a schematic diagram of a second priority table generation process provided by an embodiment of the present application;
图5B是本申请实施例提供的另一种第二优先级表生成过程的示意图;Figure 5B is a schematic diagram of another second priority table generation process provided by an embodiment of the present application;
图6是本申请实施例提供的一种第二优先级表的示意图;Figure 6 is a schematic diagram of a second priority table provided by an embodiment of the present application;
图7是本申请实施例提供的一种网络设备发送请求报文的流程示意图;Figure 7 is a schematic flowchart of a network device sending a request message according to an embodiment of the present application;
图8是本申请实施例提供的一种抑制第一端口的示意图;Figure 8 is a schematic diagram of inhibiting the first port provided by an embodiment of the present application;
图9A是本申请实施例提供的一种网络设备间会话通信的示意图;Figure 9A is a schematic diagram of session communication between network devices provided by an embodiment of the present application;
图9B是本申请实施例提供的一种网络设备间多个会话的示意图;Figure 9B is a schematic diagram of multiple sessions between network devices provided by an embodiment of the present application;
图10是本申请实施例提供的一种网络设备接收请求报文的流程示意图;Figure 10 is a schematic flowchart of a network device receiving a request message provided by an embodiment of the present application;
图11是本申请实施例提供的一种网络设备间紧急通信的方法流程示意图;Figure 11 is a schematic flowchart of an emergency communication method between network devices provided by an embodiment of the present application;
图12是本申请实施例提供的一种抑制除第二端口的其他端口的示意图;Figure 12 is a schematic diagram of suppressing ports other than the second port provided by an embodiment of the present application;
图13是本申请实施例提供的另一种网络设备间紧急通信的方法流程示意图;Figure 13 is a schematic flowchart of another emergency communication method between network devices provided by an embodiment of the present application;
图14A本申请实施例提供的一种包含中间网络节点的紧急通信的方法流程示意图;Figure 14A is a schematic flowchart of an emergency communication method including an intermediate network node provided by an embodiment of the present application;
图14B本申请实施例提供的另一种包含中间网络节点的紧急通信的方法流程示意图; Figure 14B is a schematic flowchart of another emergency communication method including an intermediate network node provided by an embodiment of the present application;
图15本申请实施例提供的一种中间网络节点抑制端口的示意图;Figure 15 is a schematic diagram of an intermediate network node suppression port provided by an embodiment of the present application;
图16是本申请实施例提供的另一种多个网络设备间紧急通信的网络架构示意图;Figure 16 is a schematic diagram of another network architecture for emergency communication between multiple network devices provided by an embodiment of the present application;
图17是本申请实施例提供的一种通信调度装置的结构示意图;Figure 17 is a schematic structural diagram of a communication scheduling device provided by an embodiment of the present application;
图18是本申请实施例提供的一种网络设备的结构示意图。Figure 18 is a schematic structural diagram of a network device provided by an embodiment of the present application.
具体实施方式Detailed ways
首先,结合图1所示的通信系统结构对本申请实施例涉及的应用场景进行介绍。First, the application scenarios involved in the embodiments of the present application are introduced with reference to the communication system structure shown in Figure 1 .
如图1所示,通信系统包括网络设备110、网络设备120、网络设备130。网络设备间的传输介质可以为电缆、光纤、塑料波导等有线传输介质,也可以是微波、红外线等无线传输介质。通过多个网络设备之间的转发操作,可以实现终端与控制端之间的数据交换,或者实现终端与骨干网之间的数据交换。可以理解的是,图1仅示出了本申请实施例可以应用的一种可能的通信系统架构,在其他可能的场景中,上述通信系统架构中也可以只包括部分设备,或者包括其他设备。As shown in FIG. 1 , the communication system includes network device 110 , network device 120 , and network device 130 . The transmission medium between network devices can be wired transmission media such as cables, optical fibers, and plastic waveguides, or wireless transmission media such as microwaves and infrared rays. Through forwarding operations between multiple network devices, data exchange between the terminal and the control terminal, or data exchange between the terminal and the backbone network, can be realized. It can be understood that FIG. 1 only shows one possible communication system architecture to which embodiments of the present application can be applied. In other possible scenarios, the above communication system architecture may also include only some devices or other devices.
网络设备110具体可以为物理服务器或云端设备等,比如X86服务器、ARM服务器等等,也可以是终端,比如手机终端、平板电脑、笔记本电脑、车载终端等等,也可以是基于通用的物理服务器结合网络功能虚拟化(Network Functions Virtualization,NFV)技术实现的虚拟机(Virtual Machine,VM),虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统,比如云服务器内的虚拟机,本申请不作具体限定。The network device 110 can be a physical server or a cloud device, such as an A virtual machine (VM) implemented in combination with Network Functions Virtualization (NFV) technology. A virtual machine refers to a complete computer system simulated by software with complete hardware system functions and running in a completely isolated environment. For example, virtual machines in cloud servers are not specifically limited in this application.
网络设备120具体可以为交换机、路由器、网关、网桥、服务器、中继器等等,还可以为演进型节点B(evolved Node B,eNB)、无线网络控制器(radio network controller,RNC)、节点B(Node B,NB)、基站控制器(base station controller,BSC)、基站收发台(base transceiver station,BTS)、WIFI系统中的接入点(access point,AP)、基带单元(baseband unit,BBU)等,还可以为第五代移动通信技术(5th Generation Mobile Communication Technology,5G)中的新空口(New Radio,NR),下一代Node B(gNodeB)等,本申请不做具体限定。The network device 120 can specifically be a switch, router, gateway, bridge, server, repeater, etc., or can also be an evolved Node B (evolved Node B, eNB), a wireless network controller (radio network controller, RNC), Node B (Node B, NB), base station controller (BSC), base transceiver station (BTS), access point (AP) in the WIFI system, baseband unit (baseband unit , BBU), etc., it can also be the New Radio (NR) in the fifth generation mobile communication technology (5th Generation Mobile Communication Technology, 5G), the next generation Node B (gNodeB), etc. This application does not make specific limitations.
网络设备130具体可以为终端。在一些实施例中,本申请实施例的应用场景可以为家庭网络通信,终端可以是手机、平板电脑、电脑、智能手表、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备以及扫地机器人、电饭煲等物联网设备等等,本申请不作具体限定。在一些实施例中,网络设备110可以通过网络设备120转发报文,实现对网络设备130的控制或者获取网络设备130的数据等。The network device 130 may specifically be a terminal. In some embodiments, the application scenario of the embodiments of the present application may be home network communication, and the terminal may be a mobile phone, a tablet, a computer, a smart watch, a virtual reality (VR) terminal device, or an augmented reality (AR) device. ) terminal equipment, as well as sweeping robots, rice cookers and other Internet of Things equipment, etc. This application does not make specific limitations. In some embodiments, the network device 110 can forward messages through the network device 120 to control the network device 130 or obtain data of the network device 130, etc.
在一些实施例中,本申请实施例的应用场景可以为工业设备网络,本申请的实施例中的网络设备110可以是控制端电脑或服务器,网络设备130可以是机械臂、监控摄像头、温度传感器、激光传感器、三机控制器、破碎机、转载机、刮板运输机、综采控制器、挖煤机、液压支架等等,本申请不作具体限定。In some embodiments, the application scenario of the embodiment of the present application may be an industrial equipment network. The network device 110 in the embodiment of the present application may be a control computer or server, and the network device 130 may be a robotic arm, a surveillance camera, or a temperature sensor. , laser sensor, three-machine controller, crusher, transfer machine, scraper conveyor, fully mechanized mining controller, coal digger, hydraulic support, etc. This application does not make specific limitations.
如图2所示,图2示出工业设备网络的另一种通信系统结构,其中,远程控制器和辅助采集PC1通过路由器1连接路由器2和路由器4,路由器2连接辅助采集PC2和路由器3,路由器4连接辅助控制PC1和路由器5,路由器3连接机械臂1、机械臂2和监控摄像头,路由器5连接传感器和激光传感器。进而,辅助采集PC1和辅助采集PC2可以通过路由器1-路由器5获取机械臂、监控摄像头、温度传感器和激光传感器的数据;辅助控制PC1 可以通过路由器1-路由器5获取机械臂、监控摄像头、温度传感器和激光传感器的数据以及控制上述设备;远程控制器也能通过路由器1-路由器5获取其他设备的数据以及控制其他设备。As shown in Figure 2, Figure 2 shows another communication system structure of the industrial equipment network, in which the remote controller and the auxiliary collection PC1 are connected to the router 2 and the router 4 through the router 1, and the router 2 is connected to the auxiliary collection PC2 and the router 3. Router 4 is connected to the auxiliary control PC1 and router 5, router 3 is connected to robotic arm 1, robotic arm 2 and surveillance cameras, and router 5 is connected to sensors and laser sensors. Furthermore, the auxiliary collection PC1 and the auxiliary collection PC2 can obtain the data of the robotic arm, surveillance camera, temperature sensor and laser sensor through the router 1-router 5; the auxiliary control PC1 You can obtain data from robotic arms, surveillance cameras, temperature sensors and laser sensors and control the above devices through Routers 1-Router 5; the remote controller can also obtain data from and control other devices through Routers 1-Router 5.
在另一些实施例中,本申请实施例的应用场景还可以为办公网络,本申请的实施例中的网络设备130可以是手机、电脑、监控摄像头、打印机、web服务器、数据库服务器等等。应理解,上述举例用于说明,并不能构成具体限定。In other embodiments, the application scenario of the embodiment of the present application may also be an office network. The network device 130 in the embodiment of the present application may be a mobile phone, a computer, a surveillance camera, a printer, a web server, a database server, etc. It should be understood that the above examples are for illustration and do not constitute specific limitations.
因此,在如图1或如图2所示的通信系统结构中,存在一个网络设备连接多个网络设备的情况,连接多个网络设备的设备可以称为主设备,其他网络设备可以称为从设备。主设备与从设备可以是直接连接,也可以是通过路由器或者交换机进行连接。主设备还可以为从设备设定优先级,当接收到优先级高的从设备发送的报文时,主设备将会优先处理该从设备的报文。Therefore, in the communication system structure as shown in Figure 1 or Figure 2, there is a situation where one network device is connected to multiple network devices. The device that connects multiple network devices can be called a master device, and other network devices can be called slave devices. equipment. The master device and the slave device can be connected directly or through a router or switch. The master device can also set the priority for the slave device. When receiving a message from a slave device with a high priority, the master device will give priority to the message from the slave device.
但是,在网络设备实际作业中,网络设备对通信资源的需求会随着作业进度而变化。例如,在如图2所示的工业设备网络中,当物品传输到机械臂1时,需要机械臂1对物品进行操作,此时,机械臂1的通信是较为重要的,此时需要机械臂1的优先级高于其他机械臂。然而,当物品传输到机械臂2时,需要机械臂2对物品进行操作,此时,又需要机械臂2的优先级高于其他机械臂。在此过程中,从设备的优先级会发生变化。However, in the actual operation of network equipment, the demand for communication resources of network equipment will change with the progress of the operation. For example, in the industrial equipment network shown in Figure 2, when an item is transmitted to the robot arm 1, the robot arm 1 is required to operate the item. At this time, the communication of the robot arm 1 is more important. At this time, the robot arm 1 is needed. 1 has higher priority than other robot arms. However, when the item is transferred to the robot arm 2, the robot arm 2 is required to operate the item. At this time, the priority of the robot arm 2 is required to be higher than that of other robot arms. During this process, the priority of the slave device changes.
因此,在网络设备的实际作业中,网络设备对通信资源的需求会随着作业进度而变化。往往正在作业或准备作业的网络设备发送的报文需要被尽快处理,以使能尽快收到对应的响应报文,使得网络设备的业务能按时执行。但是,为网络设备设定固定的优先级,无法满足实际作业需求。Therefore, in the actual operation of network equipment, the network equipment's demand for communication resources will change with the progress of the operation. Messages sent by network devices that are working or preparing to work often need to be processed as soon as possible so that corresponding response messages can be received as soon as possible so that the services of the network device can be executed on time. However, setting fixed priorities for network devices cannot meet actual operational needs.
例如,网络设备110需要处理多个网络设备130的报文时,当正在工作的网络设备130优先级较低时,该网络设备130发送的报文会较晚被网络设备110处理,进而,会较晚接收到来自网络设备110的响应报文。在没有接收到响应报文时,网络设备130无法执行对应的业务,最终影响业务整体进度,甚至出现重大事故。再比如,正在处于工作状态的机械臂因为没有及时收到响应报文,可能会错过传送带的物品,可能会导致物品最终制作不合格;或者,机械臂在执行动作中,控制端监测到机械臂会碰撞到墙体,下达了机械臂停止动作的指令,但由于机械臂优先级较低,该指令到达机械臂时,机械臂可能已经碰撞到了墙体。For example, when the network device 110 needs to process packets from multiple network devices 130, when the working network device 130 has a lower priority, the packets sent by the network device 130 will be processed later by the network device 110, and further, the packets sent by the network device 130 will be processed later. The response message from the network device 110 is received later. When no response message is received, the network device 130 cannot perform the corresponding service, which ultimately affects the overall progress of the service and even causes a major accident. For another example, the working robot arm may miss the items on the conveyor belt because it does not receive the response message in time, which may cause the final product to fail; or, when the robot arm is executing an action, the control end detects that the robot arm It will collide with the wall, and a command to stop the robot arm is given. However, because the robot arm has a low priority, when the command reaches the robot arm, the robot arm may have already collided with the wall.
综上所述,网络设备对于通信资源的需求会随着实际作业情况而变化,而为网络设备设定固定的优先级,通信资源不能得到合理的分配,会导致网络设备的业务无法正常进行。To sum up, the demand for communication resources of network equipment will change with the actual operating conditions. If fixed priorities are set for network equipment, communication resources cannot be reasonably allocated, which will lead to the failure of the network equipment's business to proceed normally.
为了解决上述网络设备对于通信资源的需求会随着实际作业情况而变化,导致通信资源不能得到合理的分配的问题,本申请提供了一种通信调度方法,可以根据网络设备的设备类型和网络设备实时作业状态设定网络设备优先级,并根据网络设备优先级分配通信资源。In order to solve the problem that the above-mentioned network equipment's demand for communication resources will change with the actual operating conditions, resulting in the communication resources not being reasonably allocated, this application provides a communication scheduling method that can be based on the equipment type of the network equipment and the network equipment. Real-time job status sets network device priorities and allocates communication resources based on network device priorities.
本申请提供的通信调度方法,第一网络设备能获取连接的网络设备的设备类型和作业状态;根据网络设备的设备类型进行初始优先级排序,确定第一优先级表,其中,设备类型相同的网络设备的初始优先级相同;再根据网络设备的作业状态调整初始优先级,得到网络设备最终的优先级,进而根据所有网络设备最终的优先级,确定第二优先级表。第一网络设备与连接的网络设备基于第二优先级表进行通信。当第一网络设备与其他网络设备 通信时,还可以再根据会话类型确定会话的优先级,并在发送的报文中携带会话的响应优先级,使对端网络设备能根据响应优先级对报文进行处理。并且,网络设备间还能建立紧急通信,在紧急通信过程中,参与紧急通信的网络设备与其他非紧急通信的网络设备的端口将被进行通信抑制,直到紧急通信结束。In the communication scheduling method provided by this application, the first network device can obtain the device type and operation status of the connected network device; perform initial priority sorting according to the device type of the network device, and determine the first priority table, in which the device types of the same device type are The initial priorities of the network devices are the same; then the initial priorities are adjusted according to the working status of the network devices to obtain the final priorities of the network devices, and then the second priority table is determined based on the final priorities of all network devices. The first network device communicates with the connected network device based on the second priority list. When the first network device communicates with other network devices During communication, the priority of the session can also be determined based on the session type, and the response priority of the session is carried in the sent message, so that the peer network device can process the message according to the response priority. In addition, emergency communication can also be established between network devices. During the emergency communication process, the ports of network devices participating in emergency communication and other non-emergency communication network devices will be suppressed from communication until the emergency communication ends.
如图3所示,图3为本申请提供的一种通信调度方法的流程示意图,在该通信调度方法中,网络设备10和网络设备20可以是上述图1或图2所示通信系统中的网络设备。网络设备10连接网络设备20,网络设备10和网络设备20可以是直接连接的,也可以是通过路由器或者交换机等网络设备连接的。网络设备10还可以连接其他网络设备。应理解,本申请对网络设备10和网络设备20的连接方式不作具体限定。其中,网络设备10也可称为第一网络设备,网络设备20也可称为第二网络设备。下面对该通信调度方法的步骤进行详细介绍。As shown in Figure 3, Figure 3 is a schematic flow chart of a communication scheduling method provided by this application. In this communication scheduling method, the network device 10 and the network device 20 can be in the communication system shown in Figure 1 or Figure 2. Internet equipment. The network device 10 is connected to the network device 20. The network device 10 and the network device 20 may be directly connected, or may be connected through network devices such as routers or switches. Network device 10 can also connect to other network devices. It should be understood that this application does not specifically limit the connection method of the network device 10 and the network device 20 . The network device 10 may also be called a first network device, and the network device 20 may also be called a second network device. The steps of this communication scheduling method are introduced in detail below.
S310:网络设备10获取网络设备20的设备类型。S310: The network device 10 obtains the device type of the network device 20.
网络设备10向网络设备20发送获取网络设备20的设备类型的报文,网络设备20向网络设备10回复其设备类型。网络设备10可以是在与网络设备20建立网络连接时,就向网络设备20获取设备类型,也可以是在网络设备20向网络设备10发送了报文之后,网络设备10再向网络设备20获取设备类型,还可以是网络设备10按预设时间定期向网络设备20获取设备类型,本申请不作具体限定。The network device 10 sends a message to obtain the device type of the network device 20 to the network device 20, and the network device 20 replies its device type to the network device 10. Network device 10 may obtain the device type from network device 20 when establishing a network connection with network device 20, or may obtain the device type from network device 20 after network device 20 sends a message to network device 10. The device type may also be that the network device 10 periodically obtains the device type from the network device 20 at a preset time, which is not specifically limited in this application.
其中,网络设备20的设备类型是根据网络设备20执行的作业任务确定的。举例来说,设备类型可以包括:运动控制类、状态控制类、状态传感类、用户终端、智能家电类等。应理解,本申请对网络设备20设备类型的划分不作具体限定。The device type of the network device 20 is determined according to the job tasks performed by the network device 20 . For example, device types may include: motion control, status control, status sensing, user terminals, smart home appliances, etc. It should be understood that this application does not specifically limit the classification of device types of the network device 20 .
下面结合应用场景对网络设备20的设备类型进行举例说明。The following describes the device types of the network device 20 with examples based on application scenarios.
在工业设备网络中,网络设备20的设备类型可以包括:运动控制类、状态控制类、状态传感类。其中,运动控制类的网络设备用于执行运动类任务;状态控制类的网络设备用于产生特定状态,例如,加热、制冷、增加压强等作业任务;状态传感类的网络设备用于执行获取环境状态,例如,测温、测距以及采集图像等作业任务。举例来说,机械臂、转载机以及破碎机等设备属于运动控制类,真空泵、加热炉、增压泵等设备属于状态控制类,摄像头、温度传感器、激光传感器等设备属于状态传感类。In an industrial equipment network, the device types of the network device 20 may include: motion control type, status control type, and status sensing type. Among them, the network equipment of the motion control type is used to perform motion tasks; the network equipment of the status control type is used to generate specific states, such as heating, cooling, increasing pressure, etc.; the network equipment of the status sensing type is used to perform acquisition tasks. Environmental status, such as temperature measurement, distance measurement, image collection and other tasks. For example, equipment such as robotic arms, transfer machines, and crushers belong to the motion control category, vacuum pumps, heating furnaces, booster pumps and other equipment belong to the status control category, and equipment such as cameras, temperature sensors, and laser sensors belong to the status sensing category.
在家庭网络通信中,网络设备20的设备类型可以包括:用户终端、智能家电类。智能家电类进一步可以包括:运动控制类智能家电、状态控制类智能家电、状态传感类智能家电。举例来说,手机、智能手表、电脑等属于用户终端,扫地机器人属于运动控制类智能家电,冰箱、电饭煲以及空调等属于状态控制类智能家电,温度计、摄像头等属于状态传感类智能家电。In home network communication, the device types of the network device 20 may include: user terminals and smart home appliances. Smart home appliances can further include: motion control smart home appliances, status control smart home appliances, and status sensing smart home appliances. For example, mobile phones, smart watches, computers, etc. are user terminals, sweeping robots are motion control smart home appliances, refrigerators, rice cookers, and air conditioners are state control smart home appliances, and thermometers, cameras, etc. are state sensing smart home appliances.
在办公网络通信中,网络设备20的设备类型可以包括:用户终端、办公设施等。打印机、传真机等属于办公设施。In office network communication, the device types of the network device 20 may include: user terminals, office facilities, etc. Printers, fax machines, etc. are office facilities.
应理解,设备类型的划分是根据设备主要执行的任务进行确定的。例如,扫地机器人也包括激光传感器,在运动过程中,会根据激光传感器测量得到的数据进行运动,但其主要是通过移动位置来清扫垃圾,属于运动控制类的作业任务。并且,上述举例仅用于说明,并不能构成具体限定。It should be understood that the classification of equipment types is determined based on the tasks that the equipment mainly performs. For example, a sweeping robot also includes a laser sensor. During its movement, it will move based on the data measured by the laser sensor, but it mainly cleans garbage by moving its position, which is a motion control task. Furthermore, the above examples are only for illustration and do not constitute specific limitations.
S320:网络设备10根据网络设备20的设备类型确定网络设备20的初始优先级。 S320: The network device 10 determines the initial priority of the network device 20 according to the device type of the network device 20.
每个设备类型都对应各自的初始优先级等级,相同设备类型的网络设备初始优先级相同,网络设备10将先根据设备类型确定网络设备20的初始优先级。Each device type corresponds to its own initial priority level. Network devices of the same device type have the same initial priority. The network device 10 will first determine the initial priority of the network device 20 according to the device type.
下面对设备类型和初始优先级等级的对应关系进行举例说明。The following is an example of the corresponding relationship between device type and initial priority level.
举例来说,在工业设备网络中,运动控制类网络设备的优先级高于状态控制类网络设备的优先级,状态控制类网络设备的优先级高于状态传感类网络设备的优先级。在家庭网络通信中,用户终端的优先级高于智能家电的优先级,运动控制类智能家电的优先级高于状态控制类智能家电的优先级,状态控制类智能家电的优先级高于状态传感类智能家电的优先级。在办公网络通信中,用户终端的优先级高于办公设施的优先级。应理解,本申请对设备类型对应的初始优先级等级不作具体限定。For example, in an industrial equipment network, the priority of motion control network equipment is higher than the priority of status control network equipment, and the priority of status control network equipment is higher than the priority of status sensing network equipment. In home network communication, the priority of user terminals is higher than the priority of smart home appliances. The priority of motion control smart home appliances is higher than the priority of status control smart home appliances. The priority of status control smart home appliances is higher than the priority of status transmission smart home appliances. The priority of sensor-type smart home appliances. In office network communications, user terminals have higher priority than office facilities. It should be understood that this application does not specifically limit the initial priority level corresponding to the device type.
在一些实施例中,网络设备10还会获取与网络设备10连接的所有网络设备的设备类型。在网络设备10获取所有网络设备的设备类型后,还会建立第一优先级表,第一优先级表是根据与网络设备10连接的网络设备各自的设备类型确定的。也即是说,根据所有网络设备的设备类型,对所有网络设备的优先级进行排序,其中,设备类型对应的优先级等级参考上述描述,此处不再赘述。下面对网络设备10建立第一优先级表进行举例说明。In some embodiments, the network device 10 also obtains the device types of all network devices connected to the network device 10 . After the network device 10 obtains the device types of all network devices, it will also establish a first priority table. The first priority table is determined based on the device types of the network devices connected to the network device 10 . That is to say, the priorities of all network devices are sorted according to their device types. For the priority levels corresponding to the device types, refer to the above description and will not be described again here. The following is an example of how the network device 10 establishes the first priority table.
举例来说,网络设备10还连接网络设备21、网络设备22、网络设备23以及网络设备24,其中网络设备21属于运动控制类,网络设备20、网络设备22和网络设备24属于状态控制类,网络设备23属于状态传感类,则网络设备10建立的第一优先级表可以参考图4,如图4所示,网络设备21的初始优先级高于网络设备20、网络设备22和网络设备24,网络设备20、网络设备22和网络设备24初始优先级相同,网络设备20、网络设备22和网络设备24的初始优先级高于网络设备23。For example, network device 10 is also connected to network device 21, network device 22, network device 23 and network device 24, where network device 21 belongs to the motion control category, and network device 20, network device 22 and network device 24 belong to the status control category, Network device 23 belongs to the status sensing category, so the first priority table established by network device 10 can refer to Figure 4. As shown in Figure 4, the initial priority of network device 21 is higher than network device 20, network device 22 and network device 23. 24. The initial priorities of network device 20, network device 22 and network device 24 are the same, and the initial priorities of network device 20, network device 22 and network device 24 are higher than that of network device 23.
S330:网络设备10获取网络设备20的作业状态。S330: The network device 10 obtains the job status of the network device 20.
网络设备10向网络设备20发送获取网络设备20的作业状态的报文,网络设备20向网络设备10回复其作业状态。网络设备10可以是定时获取网络设备20的作业状态,也可以是在网络设备20作业状态发生变化后或者用户触发后,再获取网络设备20当前的作业状态。作业状态用于表示网络设备20当前是否正在作业,举例来说,作业状态可以包括正在作业、即将作业、未进行作业等等,其中,正在作业的网络设备优先级大于即将作业的网络设备优先级,即将作业的网络设备优先级大于未进行作业的网络设备优先级。应理解,本申请对作业状态的划分不作具体限定。或者,作业状态还可以根据具体执行的工作来进行划分。The network device 10 sends a message to obtain the operation status of the network device 20 to the network device 20, and the network device 20 replies to the network device 10 with its operation status. The network device 10 may obtain the operation status of the network device 20 regularly, or may obtain the current operation status of the network device 20 after the operation status of the network device 20 changes or is triggered by the user. The job status is used to indicate whether the network device 20 is currently working. For example, the job status may include working, about to work, not working, etc., where the priority of the network device that is working is greater than the priority of the network device that is about to work. , that is, the priority of the network device that is being operated is greater than the priority of the network device that is not being operated. It should be understood that this application does not specifically limit the classification of job status. Alternatively, job status can also be divided according to the specific work performed.
下面对网络设备10获取网络设备20的作业状态的方式进行详细说明。The manner in which the network device 10 obtains the operation status of the network device 20 will be described in detail below.
具体包括,网络设备10定时向网络设备20发送获取作业状态的请求,网络设备20接收到请求后,根据请求回复当前作业状态。或者,网络设备10向网络设备20发送了定时获取作业状态的请求,网络设备20将每隔固定时间就向网络设备10发送当前作业状态。或者,网络设备20在网络设备10第一次获取过作业状态请求后,当网络设备20作业状态发生变化后,再向网络设备10发送当前作业状态。或者,当网络设备10或者网络设备20接收到用户操作指令,根据用户操作指令网络设备10向网络设备20获取作业方式。应理解,本申请对网络设备10获取网络设备20的作业状态的方式不作具体限定。Specifically, the network device 10 regularly sends a request to obtain the job status to the network device 20. After receiving the request, the network device 20 replies with the current job status according to the request. Or, the network device 10 sends a request to obtain the job status regularly to the network device 20, and the network device 20 will send the current job status to the network device 10 every fixed time. Alternatively, after the network device 10 obtains the job status request for the first time, the network device 20 then sends the current job status to the network device 10 when the job status of the network device 20 changes. Or, when the network device 10 or the network device 20 receives a user operation instruction, the network device 10 obtains the operation mode from the network device 20 according to the user operation instruction. It should be understood that this application does not specifically limit the manner in which the network device 10 obtains the operation status of the network device 20 .
在一些实施例中,网络设备20的作业状态是通过网络设备10控制的,当网络设备10调整网络设备20的作业状态时,网络设备10直接更新调整后的网络设备20作业状态, 可以不用再向网络设备20获取作业状态。或者,网络设备10中存储有网络设备20的作业时刻,网络设备10能根据网络设备20的作业时刻直接更新网络设备20的作业状态。In some embodiments, the operating status of the network device 20 is controlled by the network device 10. When the network device 10 adjusts the operating status of the network device 20, the network device 10 directly updates the adjusted operating status of the network device 20, It is no longer necessary to obtain the job status from the network device 20 . Alternatively, the network device 10 stores the operation time of the network device 20 , and the network device 10 can directly update the operation status of the network device 20 according to the operation time of the network device 20 .
S340:网络设备10根据网络设备20的初始优先级和作业状态,确定网络设备20的目标优先级。S340: The network device 10 determines the target priority of the network device 20 based on the initial priority and job status of the network device 20.
网络设备10根据网络设备20作业状态调整网络设备20的初始优先级,得到网络设备20的目标优先级,其中,目标优先级越高表示网络设备10越将优先接收、发送或者处理网络设备20的报文。网络设备10可以根据网络设备20的作业状态将初始优先级调高或调低预设名次,得到目标优先级;或者,在保留初始优先级的情况下,根据作业状态进行二次标记,得到目标优先级,举例来说,网络设备20可以为设备类型优先级高的网络设备中作业状态类型优先级最低的网络设备。The network device 10 adjusts the initial priority of the network device 20 according to the operating status of the network device 20 to obtain the target priority of the network device 20. The higher the target priority, the more priority the network device 10 will receive, send or process the network device 20. message. The network device 10 can adjust the initial priority higher or lower the preset ranking according to the job status of the network device 20 to obtain the target priority; or, while retaining the initial priority, perform secondary marking according to the job status to obtain the target. Priority, for example, the network device 20 may be a network device with the lowest job status type priority among network devices with a high device type priority.
在一些实施例中,网络设备10还会获取与网络设备10连接的所有网络设备的作业状态,并建立第二优先级表,第二优先级表是根据第一优先级与网络设备10连接的网络设备各自的作业状态确定的,可以参考网络设备20的目标优先级的确认过程,此处不再赘述。In some embodiments, the network device 10 will also obtain the job status of all network devices connected to the network device 10 and establish a second priority table. The second priority table is connected to the network device 10 according to the first priority. To determine the operating status of each network device, refer to the confirmation process of the target priority of the network device 20, which will not be described again here.
下面对网络设备10根据作业状态调整网络设备20的初始优先级以及建立第二优先级表进行举例说明。The following is an example of how the network device 10 adjusts the initial priority of the network device 20 according to the job status and establishes a second priority table.
网络设备10可以根据网络设备20的作业状态将初始优先级调高或调低预设名次。举例来说,若设备类型共有N类,即初始优先级共有N个等级,网络设备20的初始优先级为第M名时,M小于等于N,M和N为正整数。当网络设备20正在作业时,将网络设备20的优先级调高J个名次,J为正整数;当网络设备20处于即将作业时,网络设备20的优先级不变;当网络设备20处于未进行作业时,将网络设备20的优先级调低K个名次,K为正整数。其中,J大于M时,目标优先级为最高,K大于N-M时,目标优先级为最低。The network device 10 can adjust the initial priority higher or lower the preset ranking according to the working status of the network device 20 . For example, if there are N categories of device types, that is, there are N levels of initial priority, and the initial priority of the network device 20 is Mth, M is less than or equal to N, and M and N are positive integers. When the network device 20 is working, the priority of the network device 20 is increased by J positions, J is a positive integer; when the network device 20 is about to work, the priority of the network device 20 remains unchanged; when the network device 20 is not in the future When performing the operation, lower the priority of the network device 20 by K positions, where K is a positive integer. Among them, when J is greater than M, the target priority is the highest, and when K is greater than N-M, the target priority is the lowest.
举例来说,如图5A所示,网络设备20、网络设备22和网络设备24因为设备类型相同,三者的初始优先级相同,但是因为网络设备20正在作业状态,网络设备22处于未作业状态,其他设备都是待作业状态,则正在作业状态的网络设备优先级调高两个名次,未作业状态的网络设备优先级调低两个名次,其他网络设备的优先级不变。因此,最终得到的第二优先级表中优先级从高到低为:网络设备20、网络设备21、网络设备24、网络设备23、网络设备22。For example, as shown in Figure 5A, network device 20, network device 22 and network device 24 have the same initial priority because they are of the same device type. However, because network device 20 is in the operating state, network device 22 is in the non-operating state. , other devices are in the waiting state, then the priority of the network device in the operating state is increased by two places, the priority of the network device in the non-operating state is lowered by two places, and the priority of other network devices remains unchanged. Therefore, the priorities in the final second priority table from high to low are: network device 20, network device 21, network device 24, network device 23, and network device 22.
网络设备10还可以在保留初始优先级的情况下,根据作业状态对网络设备20的优先级进行二次标记,得到网络设备优先级。具体包括:当网络设备20正在作业时,网络设备20的目标优先级在相同设备类型的网络设备中为最高;当网络设备20即将作业时,网络设备20的优先级在相同设备类型的网络设备中为中等;当网络设备20处于未进行作业时,网络设备20的优先级在相同设备类型的网络设备中为最低。The network device 10 can also remark the priority of the network device 20 according to the job status while retaining the initial priority to obtain the network device priority. Specifically: when the network device 20 is working, the target priority of the network device 20 is the highest among network devices of the same device type; when the network device 20 is about to work, the priority of the network device 20 is among the network devices of the same device type. Medium means medium; when the network device 20 is not performing operations, the priority of the network device 20 is the lowest among network devices of the same device type.
举例来说,如图5B所示,网络设备20、网络设备22和网络设备24因为设备类型相同,三者的初始优先级相同,但是因为网络设备20正在作业状态,网络设备24即将作业,网络设备22处于未作业状态,则最终得到的第二优先级表中网络设备优先级从高到低为:网络设备21、网络设备20、网络设备24、网络设备22、网络设备23。For example, as shown in Figure 5B, network device 20, network device 22 and network device 24 have the same initial priority because they are of the same device type. However, because network device 20 is operating and network device 24 is about to operate, the network If the device 22 is not working, the network device priorities in the final second priority table from high to low are: network device 21, network device 20, network device 24, network device 22, and network device 23.
综上所述,本申请通过获取设备类型和作业状态,能为与主设备连接的从设备设定优先级,并获得如图6所示的优先级表,其中,从设备以设备1-设备8为例,设备类型以类 型1-类型4为例,作业状态以作业1-作业3为例,生成图6所示的优先级表的过程可以参考上述关于图4-图5B相关描述。这样,得到的优先级表既考虑了从设备的设备类型,又考虑了从设备的作业状态,使得主设备在与从设备进行通信时,能根据从设备的实时作业状态进行,满足从设备的通信需求。In summary, by obtaining the device type and job status, this application can set the priority of the slave device connected to the master device, and obtain the priority table as shown in Figure 6, in which the slave device is device 1-device 8 as an example, the device type is Type 1 to Type 4 are taken as an example, and the job status is taken as Job 1 to Job 3. The process of generating the priority table shown in Figure 6 can refer to the above-mentioned descriptions about Figures 4 to 5B. In this way, the obtained priority table takes into account both the device type of the slave device and the job status of the slave device, so that when the master device communicates with the slave device, it can proceed based on the real-time job status of the slave device to meet the requirements of the slave device. Communication needs.
在另一些实施例中,还可以先根据网络设备20的作业状态,确定网络设备20的初始优先级,再根据网络设备的设备类型调整初始优先级,得到网络设备20的目标优先级。举例来说,当作业状态包括正在作业、即将作业以及未进行作业时,正在作业时的优先级大于即将作业时的优先级,即将作业时的优先级大于未进行作业时的优先级。根据网络设备20的作业状态确定初始优先级后,再根据网络设备20的设备类型调整初始优先级,具体可以是根据设备类型将网络设备20的优先级在相同作业状态的网络设备中进行调整,也可以是,根据网络设备20的设备类型将初始优先级调高或调低预设名次。In other embodiments, the initial priority of the network device 20 can also be determined first according to the working status of the network device 20 , and then the initial priority can be adjusted according to the device type of the network device to obtain the target priority of the network device 20 . For example, when the job status includes working, about to be done, and not yet being done, the priority when the job is being done is greater than the priority when the job is about to be done, and the priority when the job is about to be done is greater than the priority when the job is not in progress. After determining the initial priority according to the working status of the network device 20, the initial priority is adjusted according to the device type of the network device 20. Specifically, the priority of the network device 20 can be adjusted among network devices with the same working status according to the device type. Alternatively, the initial priority may be adjusted higher or lower to a preset ranking according to the device type of the network device 20 .
在另一些实施例中,可以在执行步骤S310:网络设备10获取网络设备20的设备类型之后,先执行步骤S330:网络设备10获取网络设备20的作业状态,再执行步骤S320:网络设备10根据网络设备20的设备类型确定网络设备20的初始优先级,以及执行步骤S340:网络设备10根据网络设备20的初始优先级和作业状态,确定网络设备20的目标优先级。In other embodiments, after performing step S310: the network device 10 obtains the device type of the network device 20, first perform step S330: the network device 10 obtains the job status of the network device 20, and then perform step S320: the network device 10 according to The device type of the network device 20 determines the initial priority of the network device 20, and step S340 is performed: the network device 10 determines the target priority of the network device 20 according to the initial priority and job status of the network device 20.
在另一些实施例中,可以在执行步骤S310:网络设备10获取网络设备20的设备类型之后,先执行步骤S330:网络设备10获取网络设备20的作业状态,再根据网络设备20的作业状态,确定网络设备20的初始优先级,最后根据网络设备20的设备类型调整初始优先级,得到网络设备20的目标优先级。In other embodiments, after performing step S310: the network device 10 obtains the device type of the network device 20, step S330: the network device 10 obtains the operating status of the network device 20, and then based on the operating status of the network device 20, The initial priority of the network device 20 is determined, and finally the initial priority is adjusted according to the device type of the network device 20 to obtain the target priority of the network device 20 .
在另一些实施例中,在网络设备10确定网络设备20的目标优先级后,将根据网络设备20的目标优先级接收来自网络设备20的数据以及发送报文给网络设备20。其中,当网络设备10有多个设备的数据需要发送或接收时,网络设备10将优先发送或接收目标优先级高的网络设备的报文。In other embodiments, after the network device 10 determines the target priority of the network device 20, it will receive data from the network device 20 and send messages to the network device 20 according to the target priority of the network device 20. When the network device 10 needs to send or receive data from multiple devices, the network device 10 will give priority to sending or receiving messages from the network device with a high target priority.
下面结合图7对网络设备10接收网络设备20发送报文的过程进行详细说明。The process of the network device 10 receiving the message sent by the network device 20 will be described in detail below with reference to FIG. 7 .
S710:网络设备20向网络设备10发送请求报文。S710: The network device 20 sends a request message to the network device 10.
网络设备20与网络设备10存在会话时,可以向网络设备10发送该会话的请求报文,以获取来自网络设备10的响应。应理解,网络设备20与网络设备10还可以存在多个会话,网络设备20可以给网络设备10发送多个请求报文,每个请求报文携带了对应会话的唯一标识。When a session exists between the network device 20 and the network device 10 , the network device 20 may send a request message of the session to the network device 10 to obtain a response from the network device 10 . It should be understood that multiple sessions may exist between the network device 20 and the network device 10, and the network device 20 may send multiple request messages to the network device 10, and each request message carries a unique identifier of the corresponding session.
S720:网络设备10根据网络设备20的目标优先级判断是否接收网络设备20的数据。S720: The network device 10 determines whether to receive data from the network device 20 according to the target priority of the network device 20.
网络设备10先判断当前是否正在接收其他网络设备的数据,如果网络设备10没有在接收其他网络设备的数据,则网络设备10当前可以接收来自网络设备20的数据,即将执行步骤S740。The network device 10 first determines whether it is currently receiving data from other network devices. If the network device 10 is not receiving data from other network devices, the network device 10 can currently receive data from the network device 20, and step S740 will be performed.
如果网络设备10正在接收或即将接收来自其他网络设备的数据,网络设备10还将根据网络设备20的目标优先级判断能否接收来自网络设备20的数据。其中,当网络设备10正在接收或即将接收比网络设备20目标优先级更低的网络设备的数据时,则网络设备10当前可以先接收来自网络设备20的数据,即将执行步骤S740。当网络设备10正在接收或即将接收比网络设备20目标优先级更高的网络设备的数据时,网络设备10将先接收优先 级较高的网络设备的数据,即执行步骤S730。If the network device 10 is receiving or is about to receive data from other network devices, the network device 10 will also determine whether it can receive data from the network device 20 based on the target priority of the network device 20 . When the network device 10 is receiving or is about to receive data from a network device with a lower target priority than the network device 20, the network device 10 may currently receive the data from the network device 20 first, and step S740 will be performed. When the network device 10 is receiving or is about to receive data from a network device with a higher target priority than the network device 20, the network device 10 will receive the priority first. For data of higher-level network devices, step S730 is executed.
S730:网络设备10接收优先级更高的网络设备的数据。S730: The network device 10 receives data from a network device with a higher priority.
网络设备10的第一端口与网络设备20第二端口连接,网络设备10在不能接收网络设备20的报文时,先接收优先级更高的网络设备的数据。The first port of the network device 10 is connected to the second port of the network device 20. When the network device 10 cannot receive the message of the network device 20, it first receives the data of the network device with higher priority.
在一些实施例中,在网络设备10在不能接收网络设备20的报文时,还将向第一端口发送抑制指令,直到网络设备10已经接收完比网络设备20目标优先级更高的网络设备的数据时,再恢复第一端口,从第一端口接收网络设备20的数据。In some embodiments, when the network device 10 cannot receive the packet of the network device 20, it will also send a suppression instruction to the first port until the network device 10 has received the network device with a higher target priority than the network device 20. When the data is received, the first port is restored and the data of the network device 20 is received from the first port.
举例来说,如图8所示,网络设备10可以是向第一端口发送MAC控制帧,MAC控制帧携带PAUSE标记,PAUSE标记还可以携带时间参数,时间参数用于指示抑制第一端口的时间。当网络设备10已经接收完比网络设备20目标优先级更高的网络设备的数据时,再向第一端口发送携带PAUSE标记的MAC控制帧,PAUSE标记携带的时间参数为0,用于指示停止对第一端口的抑制。For example, as shown in Figure 8, the network device 10 may send a MAC control frame to the first port. The MAC control frame carries a PAUSE mark. The PAUSE mark may also carry a time parameter. The time parameter is used to indicate the time to suppress the first port. . When the network device 10 has received the data of the network device with a higher target priority than the network device 20, it sends a MAC control frame carrying the PAUSE flag to the first port. The time parameter carried by the PAUSE flag is 0, which is used to indicate stop. Inhibition of the first port.
S740:网络设备10接收并处理请求报文,得到响应报文。S740: The network device 10 receives and processes the request message and obtains a response message.
当网络设备10可以接收网络设备20的请求报文时,将从第一端口接收请求报文,并对请求报文进行处理,生成得到响应报文。When the network device 10 can receive the request message from the network device 20, it will receive the request message from the first port, process the request message, and generate a response message.
在一些实施例中,网络设备20和网络设备10还可以存在多个会话,当网络设备20基于多个会话都向网络设备10发送了请求时,网络设备10还将根据每个会话的会话类型确定请求优先级。网络设备10将先接收和处理请求优先级高的请求报文。其中,会话类型可以包括控制类会话、查询类会话以及订阅类会话,会话类型对应的请求优先级从高到低为:控制类会话、查询类会话、订阅类会话。应理解,本申请对会话类型和请求优先级的设定不做具体限定。In some embodiments, the network device 20 and the network device 10 may also have multiple sessions. When the network device 20 sends a request to the network device 10 based on multiple sessions, the network device 10 will also determine the session type of each session. Prioritize requests. The network device 10 will first receive and process request messages with high request priority. Among them, the session type can include control session, query session and subscription session. The request priority corresponding to the session type from high to low is: control session, query session and subscription session. It should be understood that this application does not specifically limit the setting of session type and request priority.
S750:网络设备10向网络设备20回复响应报文。S750: Network device 10 replies with a response message to network device 20.
网络设备10处理完请求报文后,将向网络设备20回复响应报文。如图9A所示,网络设备10和网络设备21存在会话1,网络设备10和网络设备20之间存在会话2,网络设备10与网络设备24之间存在会话3。当网络设备10确定与网络设备20进行通信时,接收到网络设备20基于会话2发送的请求报文1后,再根据会话2的响应优先级对请求报文1进行处理,并向网络设备20回复处理请求报文处理后得到的响应报文1。After the network device 10 processes the request message, it will reply to the network device 20 with a response message. As shown in FIG. 9A , session 1 exists between network device 10 and network device 21 , session 2 exists between network device 10 and network device 20 , and session 3 exists between network device 10 and network device 24 . When the network device 10 determines to communicate with the network device 20, after receiving the request message 1 sent by the network device 20 based on the session 2, it processes the request message 1 according to the response priority of the session 2 and sends it to the network device 20. Reply to the response message 1 obtained after processing the request message.
在一些实施例中,网络设备20与网络设备10存在多个会话正在进行时,网络设备10基于网络设备20发送的多个请求报文会生成多个响应报文,网络设备10还将根据每个响应报文的会话类型,确定其响应优先级,并按响应优先级来依次回复响应报文。其中,同一会话类型的请求报文和响应报文的优先级还可以不相同,例如,会话类型对应的响应优先级从高到低为:查询类会话、控制类会话、订阅类会话,其中,查询类会话请求优先级低于控制类会话,但是查询类会话的响应优先级就高于控制类会话。也即是说,网络设备10将优先接收并处理控制类会话的请求报文,但对控制类会话的请求报文可以较晚进行回复。应理解,本申请对会话类型和响应报文优先级的设定不做具体限定。In some embodiments, when there are multiple ongoing sessions between network device 20 and network device 10, network device 10 will generate multiple response messages based on multiple request messages sent by network device 20, and network device 10 will also generate multiple response messages based on each request message. The session type of each response message, determines its response priority, and replies to the response messages in sequence according to the response priority. Among them, the priorities of request messages and response messages of the same session type may also be different. For example, the response priorities corresponding to the session type from high to low are: query session, control session, subscription session, where, The query priority of the query session is lower than that of the control session, but the response priority of the query session is higher than that of the control session. That is to say, the network device 10 will receive and process the request message for the control session first, but may reply to the request message for the control session later. It should be understood that this application does not specifically limit the setting of session type and response message priority.
举例来说,如图9B所示,网络设备10和网络设备21存在会话1,网络设备10和网络设备20之间存在会话2和会话4,网络设备10与网络设备24之间存在会话3。当网络设备20向网络设备10发送请求报文1和请求报文2时,因为会话2请求优先级高,则网络设备10将先接收请求报文1,然后再接收请求报文2。然后,网络设备10在同一时间 内对请求报文1和请求报文2处理完毕,因为会话4响应优先级高,因此先发送响应报文2,再发送响应报文1。For example, as shown in FIG. 9B , session 1 exists between network device 10 and network device 21 , session 2 and session 4 exist between network device 10 and network device 20 , and session 3 exists between network device 10 and network device 24 . When network device 20 sends request message 1 and request message 2 to network device 10, because session 2 has a higher request priority, network device 10 will receive request message 1 first and then request message 2. Then, at the same time, network device 10 The internal processing of request message 1 and request message 2 is completed. Because the response priority of session 4 is high, response message 2 is sent first, and then response message 1 is sent.
综上所述,当网络设备10接收数据时,是按照对端网络设备优先级顺序进行的,对于网络设备优先级低的网络设备,网络设备10还可以抑制与其连接的端口,这样即使有大量网络设备同时向网络设备10发送数据,也不会造成网络设备10过载。并且,网络设备10还能根据会话类型确定响应优先级,这样,能使请求报文和响应报文都能按会话类型确定优先级,能使双向通信都按照优先级进行,保障了双向通信资源都能合理进行。To sum up, when the network device 10 receives data, it does so in accordance with the priority order of the peer network device. For network devices with low priority, the network device 10 can also suppress the ports connected to them, so that even if there are a large number of Even if the network device sends data to the network device 10 at the same time, the network device 10 will not be overloaded. Moreover, the network device 10 can also determine the response priority according to the session type. In this way, both the request message and the response message can be prioritized according to the session type, and the two-way communication can be carried out according to the priority, ensuring the two-way communication resources. can be done reasonably.
下面结合图10对网络设备10向网络设备20发送报文的过程进行详细说明。The process of the network device 10 sending a message to the network device 20 will be described in detail below with reference to FIG. 10 .
S1010:网络设备10根据网络设备20的目标优先级判断是否向网络设备20发送请求报文。S1010: The network device 10 determines whether to send a request message to the network device 20 according to the target priority of the network device 20.
网络设备10先判断当前是否正在发送其他网络设备的数据,如果网络设备10没有在发送其他网络设备的数据,则网络设备10当前可以向网络设备20发送数据,即将执行步骤S1030。The network device 10 first determines whether it is currently sending data of other network devices. If the network device 10 is not sending data of other network devices, the network device 10 can currently send data to the network device 20, and step S1030 is about to be executed.
如果网络设备10正在发送或即将发送其他网络设备的数据,网络设备10还将根据网络设备20的目标优先级判断能否向网络设备20发送数据。其中,当网络设备10正在发送或即将发送比网络设备20目标优先级更低的网络设备的数据时,则网络设备10当前可以先向网络设备20发送数据,即将执行步骤S1030。当网络设备10正在接收或即将接收比网络设备20目标优先级更高的网络设备的数据时,网络设备10将先接收优先级较高的网络设备的数据,即执行步骤S1020。If the network device 10 is sending or is about to send data of other network devices, the network device 10 will also determine whether it can send data to the network device 20 based on the target priority of the network device 20 . When the network device 10 is sending or is about to send data of a network device with a lower target priority than the network device 20, the network device 10 can currently send data to the network device 20 first, and step S1030 will be performed. When the network device 10 is receiving or is about to receive data from a network device with a higher target priority than the network device 20, the network device 10 will first receive data from the network device with a higher priority, that is, step S1020 is performed.
S1020:网络设备10向优先级更高的网络设备发送数据。S1020: The network device 10 sends data to a higher priority network device.
当网络设备20的优先级比其他网络设备的优先级低时,网络设备10将先发送优先级更高的网络设备的数据。在网络设备10已经将优先级更高的网络设备的数据发送完毕时,网络设备10将执行步骤S1030。When the priority of the network device 20 is lower than that of other network devices, the network device 10 will first send the data of the network device with a higher priority. When the network device 10 has completed sending the data of the network device with a higher priority, the network device 10 will execute step S1030.
S1030:网络设备10向网络设备20发送请求报文,请求报文携带响应优先级。S1030: The network device 10 sends a request message to the network device 20, and the request message carries the response priority.
当网络设备20没有在发送其他网络设备的数据,或者已经发送完优先级更高的网络设备的数据后,网络设备10可以向网络设备20发送请求报文,所述请求报文携带了请求报文对应的会话的响应优先级,以使网络设备20能根据响应优先级对请求报文进行响应。响应优先级的详细内容可以参考图7中的相关描述,此处不再赘述。When the network device 20 is not sending data of other network devices, or has finished sending data of a network device with a higher priority, the network device 10 can send a request message to the network device 20 , and the request message carries the request message. The response priority of the session corresponding to the message is determined so that the network device 20 can respond to the request message according to the response priority. For details on the response priority, please refer to the relevant description in Figure 7 and will not be repeated here.
在一些实施例中,网络设备10与网络设备20还可以存在多个会话,当网络设备10需要向网络设备20发送多个请求报文时,网络设备10还将判断每个请求报文的请求优先级,优先发送请求优先级高的请求报文。会话类型和请求优先级的详细内容可以参考图7中的相关描述,此处不再赘述。In some embodiments, the network device 10 and the network device 20 may also have multiple sessions. When the network device 10 needs to send multiple request messages to the network device 20, the network device 10 will also determine the request of each request message. Priority, request messages with higher request priority are sent first. For details on the session type and request priority, please refer to the relevant description in Figure 7 and will not be repeated here.
S1040:网络设备20根据响应优先级接收并处理请求报文,得到响应报文。S1040: The network device 20 receives and processes the request message according to the response priority, and obtains a response message.
网络设备20接收请求报文后,将处理请求报文,生成响应报文。After receiving the request message, the network device 20 will process the request message and generate a response message.
在一些实施例中,网络设备10与网络设备20存在多个会话,当网络设备20接收到多个请求报文时,网络设备20还将根据请求报文上携带的响应优先级,决定处理请求报文的顺序,其中,网络设备20将优先处理响应优先级高的请求报文。In some embodiments, there are multiple sessions between the network device 10 and the network device 20. When the network device 20 receives multiple request messages, the network device 20 will also decide to process the request based on the response priority carried in the request message. The order of the packets, in which the network device 20 will prioritize request packets with high response priority.
S1050:网络设备20向网络设备10回复响应报文。S1050: The network device 20 replies with a response message to the network device 10.
网络设备20处理完请求报文后,将向网络设备10回复响应报文。 After the network device 20 processes the request message, it will reply to the network device 10 with a response message.
在一些实施例中,当网络设备10与网络设备20存在多个会话,网络设备20需要回复多个响应报文时,还会根据响应优先级,确定回复响应报文的顺序。In some embodiments, when there are multiple sessions between the network device 10 and the network device 20 and the network device 20 needs to reply to multiple response messages, the order of replying the response messages will also be determined based on the response priority.
综上所述,当网络设备10发送数据给其他网络设备时,将根据网络设备优先级确定先发送的网络设备。然后,再根据会话类型确定发送请求报文的顺序,还可以在请求报文中携带响应优先级,以使对端网络设备能根据响应优先级对请求报文进行处理和回复。这样,能使请求报文和响应报文都能按会话类型确定优先级,能使双向通信都按照优先级进行,保障了双向通信资源都能合理进行。In summary, when the network device 10 sends data to other network devices, the network device to send first will be determined according to the priority of the network device. Then, the order in which request messages are sent is determined based on the session type, and the response priority can also be carried in the request message, so that the peer network device can process and reply to the request message according to the response priority. In this way, both the request message and the response message can be prioritized according to the session type, and the two-way communication can be carried out according to the priority, ensuring that the two-way communication resources can be carried out reasonably.
在另一些实施例中,网络设备20和网络设备10之间还能建立紧急通信,举例来说,当网络设备20需要向网络设备10建立紧急通信时,网络设备20将向网络设备10发起紧急通信的起始报文,并抑制除了与网络设备10连接的第二端口之外的其他端口的通信。网络设备10接收到紧急通信报文后,也将抑制除了第一端口之外的其他端口的通信,保障网络设备10与网络设备20之间通信资源不被其他网络设备占用。In other embodiments, emergency communication can also be established between the network device 20 and the network device 10. For example, when the network device 20 needs to establish emergency communication with the network device 10, the network device 20 will initiate an emergency communication with the network device 10. The initial message of the communication, and suppresses the communication of other ports except the second port connected to the network device 10 . After receiving the emergency communication message, the network device 10 will also suppress communication on other ports except the first port to ensure that the communication resources between the network device 10 and the network device 20 are not occupied by other network devices.
下面对网络设备10与网络设备20进行紧急通信进行详细说明。其中,为了便于说明,下面以网络设备20向网络设备10发起紧急通信为例进行举例说明,网络设备10通过第一端口与网络设备20的第二端口连接,应理解,本申请提供的通信调度方法中任意网络设备都可以发起紧急通信,本申请对发起紧急通信的网络设备不作具体限定。The emergency communication between the network device 10 and the network device 20 will be described in detail below. For ease of explanation, the following takes the network device 20 initiating emergency communication to the network device 10 as an example. The network device 10 is connected to the second port of the network device 20 through the first port. It should be understood that the communication scheduling provided by this application In the method, any network device can initiate emergency communication. This application does not specifically limit the network device that initiates emergency communication.
网络设备20需要向网络设备10建立紧急通信时,可以在向网络设备10发送的起始报文上携带起始标记,起始标记用于指示网络设备20需要与网络设备10建立紧急通信,其中,起始报文上还可以携带紧急通信时长。When the network device 20 needs to establish emergency communication with the network device 10, the start message sent to the network device 10 may carry a start tag. The start tag is used to indicate that the network device 20 needs to establish emergency communication with the network device 10, where , the initial message can also carry the emergency communication duration.
当起始报文上只携带起始标记时,网络设备20与网络设备10紧急通信的过程可参考如图11所示方法流程。When the initial packet carries only the initial mark, the process of emergency communication between the network device 20 and the network device 10 may refer to the method flow shown in Figure 11 .
S1110:网络设备20抑制除第二端口之外的其他端口的通信。S1110: The network device 20 suppresses communication on ports other than the second port.
如图12所示,网络设备20可以是向除第二端口之外的其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记,用于指示抑制端口接收和发送数据。As shown in FIG. 12 , the network device 20 may send a MAC control frame to other ports except the second port. The MAC control frame carries a PAUSE flag to indicate that the port is inhibited from receiving and sending data.
S1120:网络设备20向网络设备10发送起始报文,起始报文携带起始标记。S1120: The network device 20 sends a start message to the network device 10, and the start message carries a start tag.
网络设备20向网络设备10发送的起始报文携带起始标记,起始标记用于向网络设备10指示网络设备20需要进行紧急通信。The start message sent by the network device 20 to the network device 10 carries a start tag, and the start tag is used to indicate to the network device 10 that the network device 20 needs to perform emergency communication.
在一些实施例中,网络设备20可以向网络设备10发送起始报文,再抑制除第一端口之外的其他端口的通信。也即是说,先执行步骤S1120,再执行步骤S1110。In some embodiments, the network device 20 may send an initial message to the network device 10 and then suppress communications on other ports except the first port. That is to say, step S1120 is executed first, and then step S1110 is executed.
S1130:网络设备10根据起始标记抑制除第一端口之外的其他端口的通信。S1130: The network device 10 suppresses communication of other ports except the first port according to the start mark.
网络设备10可以是向除第一端口之外的其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记,用于指示抑制端口接收和发送数据。The network device 10 may send a MAC control frame to other ports except the first port, and the MAC control frame carries a PAUSE flag to indicate that the port is suppressed from receiving and sending data.
S1140:网络设备20向网络设备10发送紧急通信数据。S1140: The network device 20 sends emergency communication data to the network device 10.
在网络设备20不断向网络设备10发送紧急通信相关报文,直到网络设备20的紧急通信数据发送完毕,网络设备20将执行步骤S1150。When the network device 20 continues to send emergency communication related messages to the network device 10 until the emergency communication data of the network device 20 is sent, the network device 20 will execute step S1150.
S1150:网络设备20恢复与其他设备连接的端口的通信。S1150: The network device 20 resumes communication with the port connected to other devices.
网络设备20可以向除第一端口之外的其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记,PAUSE标记的时间参数记为0,用于结束对端口的通信抑制。The network device 20 may send a MAC control frame to other ports except the first port. The MAC control frame carries a PAUSE mark, and the time parameter of the PAUSE mark is recorded as 0, which is used to end communication suppression on the port.
S1160:网络设备20向网络设备10发送终止报文,终止报文携带终止标记。 S1160: The network device 20 sends a termination message to the network device 10, and the termination message carries a termination mark.
网络设备20向网络设备10发送的终止报文携带终止标记,终止标记用于指示结束紧急通信。The termination message sent by the network device 20 to the network device 10 carries a termination mark, and the termination mark is used to indicate the end of the emergency communication.
S1170:网络设备10恢复与其他设备连接的端口的通信。S1170: The network device 10 resumes communication with the port connected to other devices.
网络设备10接收到携带终止标记的终止报文后,将向除第二端口之外的其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记,PAUSE标记的时间参数记为0,用于结束对端口的通信抑制。After receiving the termination message carrying the termination mark, the network device 10 will send a MAC control frame to other ports except the second port. The MAC control frame carries the PAUSE mark, and the time parameter of the PAUSE mark is recorded as 0, which is used to end the communication. Communication suppression for the port.
在一些实施例中,网络设备10和网络设备20之间是通过其他中间网络设备连接的,例如网络设备10与网络设备20之间通过路由器或交换机连接,中间网络设备在上述步骤方法中,用于转发报文。当中间设备接收到起始报文后,也将抑制除连接网络设备10和网络设备20的端口的通信;当中间设备接收到终止报文后,将恢复所有端口的通信。In some embodiments, the network device 10 and the network device 20 are connected through other intermediate network devices, for example, the network device 10 and the network device 20 are connected through a router or a switch. In the above steps and methods, the intermediate network device is used For forwarding messages. When the intermediate device receives the start message, it will also suppress communication except for the port connecting the network device 10 and the network device 20; when the intermediate device receives the termination message, it will resume communication on all ports.
当起始报文上携带起始标记和紧急通信时长时,网络设备20与网络设备10紧急通信的过程可参考如图13所示方法流程。When the initial message carries the initial mark and the emergency communication duration, the process of emergency communication between the network device 20 and the network device 10 may refer to the method flow shown in Figure 13 .
S1310:网络设备20抑制除第一端口之外的其他端口的通信。S1310: The network device 20 suppresses communication on other ports except the first port.
网络设备20可以向除第一端口之外的其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记和时间参数,用于指示抑制端口接收和发送数据,时间参数用于指示抑制端口的时间。The network device 20 may send a MAC control frame to other ports except the first port. The MAC control frame carries a PAUSE flag and a time parameter used to indicate the suppression port to receive and send data. The time parameter is used to indicate the time to suppress the port.
S1320:网络设备20向网络设备10发送起始报文,起始报文携带起始标记和紧急通信时长。S1320: Network device 20 sends a start message to network device 10, where the start message carries a start tag and emergency communication duration.
网络设备20向网络设备10发送的起始报文携带起始标记和紧急通信时长,起始标记用于向网络设备10指示网络设备20需要进行紧急通信,紧急通信时长用于指示本次紧急通信所需时间。The start message sent by the network device 20 to the network device 10 carries a start tag and an emergency communication duration. The start tag is used to indicate to the network device 10 that the network device 20 needs to perform emergency communication, and the emergency communication duration is used to indicate this emergency communication. required time.
在一些实施例中,网络设备20可以向网络设备10发送起始报文,再抑制除第一端口之外的其他端口的通信。也即是说,先执行步骤S1320,再执行步骤S1310。In some embodiments, the network device 20 may send an initial message to the network device 10 and then suppress communications on other ports except the first port. That is to say, step S1320 is executed first, and then step S1310 is executed.
S1330:网络设备10根据起始标记抑制除第二端口之外的其他端口的通信。S1330: The network device 10 suppresses the communication of other ports except the second port according to the start mark.
网络设备10可以是向除第二端口之外的其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记和时间参数,用于指示抑制端口接收和发送数据,时间参数用于指示抑制端口的时间。The network device 10 may send a MAC control frame to other ports except the second port. The MAC control frame carries a PAUSE flag and a time parameter to indicate the suppression port to receive and send data. The time parameter is used to indicate the time to suppress the port.
S1340:网络设备20向网络设备10发送紧急通信数据。S1340: The network device 20 sends emergency communication data to the network device 10.
在网络设备20不断向网络设备10发送紧急通信相关报文,直到达到紧急通信时长。达到紧急通信时长后,网络设备10和网络设备20所有端口的通信也将恢复。The network device 20 continuously sends emergency communication related messages to the network device 10 until the emergency communication duration is reached. After the emergency communication duration is reached, communication on all ports of the network device 10 and the network device 20 will also be restored.
在一些实施例中,网络设备10和网络设备20之间是通过其他中间网络设备连接的,例如网络设备10与网络设备20之间通过路由器或交换机连接,中间网络设备用于转发报文。当中间设备接收到起始报文后,也将抑制除连接网络设备10和网络设备20的端口的通信;达到紧急通信时长后,将恢复所有端口的通信。In some embodiments, network device 10 and network device 20 are connected through other intermediate network devices, for example, network device 10 and network device 20 are connected through routers or switches, and the intermediate network device is used to forward messages. After the intermediate device receives the initial message, it will also suppress communication except for the port connecting the network device 10 and the network device 20; after the emergency communication time is reached, the communication on all ports will be restored.
如图14A所示,网络设备20发送的起始报文携带起始标记,网络设备20抑制除与中间网络设备连接的其他端口的通信。中间网络设备接收到起始报文后,也将抑制与其他设备连接的端口的通信,并向下一个中间网络设备转发起始报文,直到网络设备10接收到起始报文。然后,网络设备20通过中间网络设备向网络设备10发送紧急通信数据。直到紧急通信数据发送完毕,网络设备20通过中间网络节点向网络设备10发送终止报文,网 络设备20恢复其他端口的通信,中间网络节点和网络设备10接收到终止报文后,也将恢复其他端口的通信。As shown in Figure 14A, the start message sent by the network device 20 carries a start tag, and the network device 20 suppresses communication on other ports except those connected to the intermediate network device. After receiving the initial message, the intermediate network device will also suppress communications with ports connected to other devices and forward the initial message to the next intermediate network device until network device 10 receives the initial message. Then, the network device 20 sends the emergency communication data to the network device 10 through the intermediate network device. Until the emergency communication data is sent, the network device 20 sends a termination message to the network device 10 through the intermediate network node. The network device 20 resumes communication on other ports. After the intermediate network node and network device 10 receive the termination message, they will also resume communications on other ports.
如图14B所示,网络设备20发送的起始报文还可以是携带起始标记和紧急通信时长。同样地,网络设备20抑制除与中间网络设备连接的其他端口的通信。中间网络设备接收到起始报文后,将解析得到紧急通信时长,也将抑制与其他设备连接的端口的通信,并向下一个中间网络设备转发起始报文,直到网络设备10接收到起始报文。然后,网络设备20通过中间网络设备向网络设备10发送紧急通信数据。当达到紧急通信时长后,网络设备20将自动结束紧急通信数据的发送,并恢复其他端口的通信。中间网络设备和网络设备10也将在接收到起始报文的紧急通信时长后,自动恢复其他端口的通信。As shown in Figure 14B, the start message sent by the network device 20 may also carry a start tag and emergency communication duration. Likewise, network device 20 suppresses communication on ports other than those connected to intermediate network devices. After the intermediate network device receives the initial message, it will parse the emergency communication duration, inhibit communication with the port connected to other devices, and forward the initial message to the next intermediate network device until network device 10 receives the initial message. Start message. Then, the network device 20 sends the emergency communication data to the network device 10 through the intermediate network device. When the emergency communication duration is reached, the network device 20 will automatically end the sending of the emergency communication data and resume communication on other ports. The intermediate network device and network device 10 will also automatically resume communication on other ports after receiving the emergency communication duration of the initial message.
图15示例性展示了中间网络节点在紧急通信时抑制其他端口的示意图。中间网络节点将保留与紧急通信设备的端口,即出/入端口和入/出端口,向其他端口发送MAC控制帧,MAC控制帧携带PAUSE标记。Figure 15 illustrates a schematic diagram of an intermediate network node suppressing other ports during emergency communication. The intermediate network node will reserve the ports with the emergency communication equipment, that is, the ingress/egress port and the ingress/egress port, and send MAC control frames to other ports. The MAC control frame carries the PAUSE flag.
下面结合图16对紧急通信进行举例说明,当监控摄像头与远程控制器需要进行紧急通信时,监控摄像头向远程控制器发起紧急通信时将执行如下所示步骤:The following is an example of emergency communication with reference to Figure 16. When the surveillance camera and the remote controller need to communicate in an emergency, the surveillance camera will perform the following steps when initiating emergency communication to the remote controller:
S1601:监控摄像头向路由器3发送起始报文。S1601: The surveillance camera sends an initial message to Router 3.
其中,监控摄像头向路由器3发送的起始报文携带紧急通信标志,或者,携带紧急通信标志和紧急通信时长。Among them, the initial message sent by the surveillance camera to the router 3 carries the emergency communication flag, or carries the emergency communication flag and the emergency communication duration.
S1602:路由器3向路由器2转发起始报文并抑制与机械臂1和机械臂2的端口的通信。S1602: Router 3 forwards the initial message to Router 2 and suppresses communication with the ports of Robot 1 and Robot 2.
S1603:路由器2向路由器1转发起始报文并抑制与辅助采集PC2的端口的通信。S1603: Router 2 forwards the initial message to Router 1 and suppresses communication with the port of auxiliary collection PC2.
S1604:路由器1向远程控制器转发起始报文并抑制与辅助采集PC1的端口的通信。S1604: Router 1 forwards the initial message to the remote controller and suppresses communication with the port of the auxiliary collection PC1.
然后,监控摄像头和向远程控制器通过路由器1、路由器2和路由器3进行紧急通信。直到监控摄像头向远程控制器发送终止报文,或者达到紧急通信时长后,紧急通信才结束,此时路由器3将恢复与机械臂1和机械臂2的端口,路由器2将恢复与辅助采集PC2的端口,路由器1将恢复与辅助采集PC1的端口。Then, the surveillance camera and the remote controller conduct emergency communication through Router 1, Router 2, and Router 3. The emergency communication will not end until the surveillance camera sends a termination message to the remote controller, or the emergency communication duration is reached. At this time, Router 3 will resume its ports with Robot Arm 1 and Robot Arm 2, and Router 2 will resume its connection with the auxiliary collection PC2. Port, Router 1 will restore the port of PC1 with secondary collection.
综上所述,本申请提供的通信调度方法,可以通过获取设备类型和实时作业状态,为网络设备实时更新优先级,并根据实时更新的优先级为网络设备分配通信资源,更能满足实时作业需求。并且,能通过在请求报文中携带响应优先级,使对端网络设备能根据响应优先级处理请求报文,能使双向通信都能按照优先级进行。本申请提供的通信调度方法,还能在紧急通信中将网络设备与非紧急通信设备连接的端口进行通信抑制,使得其他设备的通信数据不会占用通信资源,保障了紧急通信的数据能优先被发送和接收。In summary, the communication scheduling method provided by this application can update the priority of the network device in real time by obtaining the device type and real-time job status, and allocate communication resources to the network device according to the real-time updated priority, which can better meet the needs of real-time jobs. need. Moreover, by carrying the response priority in the request message, the peer network device can process the request message according to the response priority, so that two-way communication can be carried out according to the priority. The communication scheduling method provided by this application can also suppress communication at the ports connecting network equipment and non-emergency communication equipment during emergency communication, so that the communication data of other devices will not occupy communication resources, and ensure that emergency communication data can be prioritized. Send and receive.
为了解决上述网络设备对于通信资源的需求会随着实际作业情况而变化,导致通信资源不能得到合理的分配的问题,本申请提供了一种通信调度装置1700,可以根据网络设备的设备类型和网络设备实时作业状态设定网络设备优先级,并根据网络设备优先级分配通信资源。如图17所示,该通信调度装置1700包括:获取单元1710、确定单元1720。In order to solve the problem that the demand for communication resources of the above-mentioned network equipment changes with the actual operating conditions, resulting in the communication resources not being reasonably allocated, the present application provides a communication scheduling device 1700, which can be based on the equipment type of the network equipment and the network. The real-time operating status of the device sets the priority of the network device and allocates communication resources according to the priority of the network device. As shown in Figure 17, the communication scheduling device 1700 includes: an obtaining unit 1710 and a determining unit 1720.
获取单元1710用于获取与第一网络设备连接的至少一个网络设备的设备类型和作业状态;其中,至少一个网络设备包括第二网络设备;确定单元1720用于根据至少一个网络设备的设备类型,确定第一优先级表,第一优先级表包括至少一个网络设备的初始优先级,其中,设备类型相同的网络设备的初始优先级相同;确定单元1720还用于确定第二 网络设备的初始优先级,并根据第二网络设备的作业状态和第一优先级表中第二网络设备的初始优先级,确定第二网络设备的目标优先级。The obtaining unit 1710 is used to obtain the device type and operation status of at least one network device connected to the first network device; wherein the at least one network device includes a second network device; the determining unit 1720 is used to obtain the device type and operation status of at least one network device according to the device type of the at least one network device. Determine the first priority table, which includes the initial priority of at least one network device, wherein the initial priorities of network devices with the same device type are the same; the determining unit 1720 is also used to determine the second The initial priority of the network device is determined, and the target priority of the second network device is determined based on the job status of the second network device and the initial priority of the second network device in the first priority table.
在一些实施例中,确定单元1720还用于根据第二网络设备的目标优先级,将第一优先级表更新为第二优先级表。In some embodiments, the determining unit 1720 is further configured to update the first priority table to the second priority table according to the target priority of the second network device.
在一些实施例中,第二优先级表是将第一优先级表中相同初始优先级的网络设备按作业状态对应的优先级进行再次排序确定的;或者,第二优先级表是将每个网络设备的初始优先级按照每个网络设备的作业状态调整作业状态对应的预设名次确定的。In some embodiments, the second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or, the second priority table is determined by sorting each The initial priority of network devices is determined according to the preset ranking corresponding to the job status of each network device.
在一些实施例中,装置还包括发送单元1730;确定单元1720还用于根据第二优先级表,确定是否与第二网络设备进行通信;发送单元1730用于当确定与第二网络设备进行通信时,向第二网络设备发送第一请求报文,第一请求报文携带响应优先级,响应优先级用于第二网络设备确定响应第一请求报文的时间。In some embodiments, the apparatus further includes a sending unit 1730; the determining unit 1720 is further configured to determine whether to communicate with the second network device according to the second priority table; the sending unit 1730 is configured to determine whether to communicate with the second network device. When, a first request message is sent to the second network device, the first request message carries a response priority, and the response priority is used by the second network device to determine the time to respond to the first request message.
在一些实施例中,装置还包括接收单元1740;确定单元1720还用于根据第二优先级表,确定是否与第二网络设备进行通信;接收单元1740用于当确定与第二网络设备进行通信时,接收第二网络设备发送的第二请求报文;确定单元1720还用于根据第二请求报文,确定第二请求报文的响应优先级,第二请求报文的响应优先级是根据第二请求报文的会话类型确定的。In some embodiments, the device further includes a receiving unit 1740; the determining unit 1720 is further configured to determine whether to communicate with the second network device according to the second priority table; the receiving unit 1740 is configured to determine whether to communicate with the second network device when when, receiving the second request message sent by the second network device; the determining unit 1720 is also configured to determine the response priority of the second request message according to the second request message, and the response priority of the second request message is based on The session type of the second request message is determined.
在一些实施例中,第一网络设备与第二网络设备之前存在多个会话,获取单元1710还用于获取多个会话的会话类型;确定单元1720还用于根据会话类型,从多个会话中确定目标会话,目标会话是根据多个会话中会话类型对应的请求优先级确定的,会话类型对应的请求优先级用于指示发送会话请求报文的顺序。In some embodiments, there are multiple sessions before the first network device and the second network device. The obtaining unit 1710 is also used to obtain the session types of the multiple sessions; the determining unit 1720 is also used to obtain the session types from the multiple sessions according to the session type. Determine the target session. The target session is determined based on the request priority corresponding to the session type in multiple sessions. The request priority corresponding to the session type is used to indicate the order in which session request messages are sent.
在一些实施例中,第一网络设备的第一端口与第二网络设备的第二端口连接;接收单元1740还用于接收第二网络设备发送的起始报文,起始报文携带紧急通信起始标记;确定单元1720还用于根据起始报文,抑制除第一端口的其他端口的通信。In some embodiments, the first port of the first network device is connected to the second port of the second network device; the receiving unit 1740 is also configured to receive an initial message sent by the second network device, where the initial message carries emergency communication. The start tag; determination unit 1720 is also configured to suppress communication on other ports except the first port according to the start message.
在一些实施例中,接收单元1740还用于接收第二网络设备发送的终止报文,终止报文携带紧急通信终止标记;确定单元1720还用于根据终止报文,恢复除第一端口的其他端口的通信。In some embodiments, the receiving unit 1740 is also configured to receive a termination message sent by the second network device, where the termination message carries an emergency communication termination flag; the determining unit 1720 is also configured to restore other ports except the first port according to the termination message. Port communication.
在一些实施例中,起始报文还携带紧急通信时长,紧急通信时长用于指示除第一端口的其他端口的通信抑制时长。In some embodiments, the initial message also carries an emergency communication duration, and the emergency communication duration is used to indicate the communication suppression duration of other ports except the first port.
在一些实施例中,设备类型包括:运动控制类,状态控制类以及状态传感类,其中,设备类型对应网络设备的初始优先级从高到低为:运动控制类、状态控制类、状态传感类;作业状态包括:正在作业、准备作业和未进行作业,其中,作业状态对应的优先级从高到低为:正在作业、准备作业、未进行作业。In some embodiments, the device types include: motion control class, status control class and status sensing class, where the initial priority of the device type corresponding to the network device from high to low is: motion control class, status control class, status sensing class Sense type; the job status includes: working, preparing to work, and not working in progress. Among them, the priority corresponding to the job status from high to low is: working in progress, preparing to work, and not working in progress.
在一些实施例中,会话类型包括:控制类会话、查询类会话、订阅类会话,其中,所述会话类型对应的请求优先级从高到低为:控制类会话、查询类会话、订阅类会话,所述会话类型对应的响应优先级从高到低为:查询类会话、控制类会话、订阅类会话。In some embodiments, session types include: control session, query session, and subscription session, where the request priorities corresponding to the session types from high to low are: control session, query session, and subscription session. , the response priority corresponding to the session type from high to low is: query session, control session, subscription session.
综上所述,本申请提供的通信调度装置,可以通过获取设备类型和实时作业状态,为网络设备实时更新优先级,并根据实时更新的优先级为网络设备分配通信资源,更能满足实时作业需求。并且,能通过在请求报文中携带响应优先级,使对端网络设备能根据响应优先级处理请求报文,能使双向通信都能按照优先级进行。本申请提供的通信调度方法, 还能在紧急通信中将网络设备与非紧急通信设备连接的端口进行通信抑制,使得其他设备的通信数据不会占用通信资源,保障了紧急通信的数据能优先被发送和接收。In summary, the communication scheduling device provided by this application can update the priority of the network equipment in real time by obtaining the device type and real-time operation status, and allocate communication resources to the network equipment according to the real-time updated priority, which can better meet the needs of real-time operations. need. Moreover, by carrying the response priority in the request message, the peer network device can process the request message according to the response priority, so that two-way communication can be carried out according to the priority. The communication scheduling method provided by this application, It can also suppress communication at the ports connecting network equipment and non-emergency communication equipment during emergency communications, so that the communication data of other devices will not occupy communication resources, ensuring that emergency communication data can be sent and received first.
上述详细阐述了本申请实施例的方法,为了便于更好的实施本申请实施例上述方案,相应地,下面还提供用于配合实施上述方案的相关设备。The methods of the embodiments of the present application are described in detail above. In order to facilitate better implementation of the above solutions of the embodiments of the present application, correspondingly, the following also provides relevant equipment for cooperating with the implementation of the above solutions.
图18是本申请提供的一种计算设备1800的结构示意图,该计算设备1800可以是前述内容中的通信调度装置1800。如图9所示,网络设备1800包括:处理器1810、通信接口1820以及存储器1830。其中,处理器1810、通信接口1820以及存储器1830可以通过内部总线1840相互连接,也可通过无线传输等其他手段实现通信。本申请实施例以通过总线1840连接为例,总线1840可以是快捷外围部件互连标准(Peripheral Component Interconnect Express,PCIe)总线,或扩展工业标准结构(extended industry standard architecture,EISA)总线、统一总线(unified bus,Ubus或UB)、计算机快速链接(compute express link,CXL)、缓存一致互联协议(cache coherent interconnect for accelerators,CCIX)等。总线1840可以分为地址总线、数据总线、控制总线等。总线1840除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线1840。Figure 18 is a schematic structural diagram of a computing device 1800 provided by this application. The computing device 1800 may be the communication scheduling device 1800 in the aforementioned content. As shown in Figure 9, network device 1800 includes: a processor 1810, a communication interface 1820, and a memory 1830. Among them, the processor 1810, the communication interface 1820 and the memory 1830 can be connected to each other through the internal bus 1840, or can communicate through other means such as wireless transmission. The embodiment of this application takes the connection through bus 1840 as an example. The bus 1840 can be a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus ( unified bus, Ubus or UB), computer express link (compute express link, CXL), cache coherent interconnect for accelerators (CCIX), etc. Bus 1840 can be divided into address bus, data bus, control bus, etc. In addition to the data bus, the bus 1840 may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, the various buses are labeled bus 1840 in the figure.
处理器1810可以包括至少一个通用处理器,例如中央处理器(Central Processing Unit,CPU),或者CPU和硬件芯片的组合。上述硬件芯片可以是专用集成电路(Application-Specific Integrated Circuit,ASIC)、可编程逻辑器件(Programmable Logic Device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用阵列逻辑(Generic Array Logic,GAL)或其任意组合。处理器1810执行各种类型的数字存储指令,例如存储在存储器1830中的软件或者固件程序,它能使计算设备900提供多种服务。The processor 1810 may include at least one general-purpose processor, such as a central processing unit (Central Processing Unit, CPU), or a combination of a CPU and a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), a programmable logic device (Programmable Logic Device, PLD), or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (Field-Programmable Gate Array, FPGA), a general array logic (Generic Array Logic, GAL), or any combination thereof. Processor 1810 executes various types of digital storage instructions, such as software or firmware programs stored in memory 1830, that enable computing device 900 to provide a variety of services.
存储器1830用于存储程序代码,并由处理器1810来控制执行,以执行上述实施例中通信调度方法的处理步骤。程序代码中可以包括一个或多个软件模块,这一个或多个软件模块可以为图17实施例中提供的软件模块,如获取单元、确定单元:获取单元用于获取与第一网络设备连接的至少一个网络设备的设备类型和作业状态;其中,至少一个网络设备包括第二网络设备;确定单元用于根据至少一个网络设备的设备类型,确定第一优先级表,第一优先级表包括至少一个网络设备的初始优先级,其中,设备类型相同的网络设备的初始优先级相同;确定单元还用于确定第二网络设备的初始优先级,并根据第二网络设备的作业状态和第一优先级表中第二网络设备的初始优先级,确定第二网络设备的目标优先级。The memory 1830 is used to store program codes, and is controlled and executed by the processor 1810 to perform the processing steps of the communication scheduling method in the above embodiment. The program code may include one or more software modules. The one or more software modules may be the software modules provided in the embodiment of Figure 17, such as an acquisition unit and a determination unit: the acquisition unit is used to obtain the information connected to the first network device. The device type and working status of at least one network device; wherein at least one network device includes a second network device; the determining unit is configured to determine a first priority table according to the device type of at least one network device, and the first priority table includes at least The initial priority of a network device, wherein network devices with the same device type have the same initial priority; the determination unit is also used to determine the initial priority of the second network device, and determine the initial priority of the second network device according to the working status of the second network device and the first priority. The initial priority of the second network device in the level table determines the target priority of the second network device.
需要说明的是,本实施例可以是通用的物理服务器实现的,例如,ARM服务器或者X86服务器,也可以是基于通用的物理服务器结合NFV技术实现的虚拟机实现的,虚拟机指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统,本申请不作具体限定。It should be noted that this embodiment can be implemented by a general-purpose physical server, such as an ARM server or an A complete computer system with complete hardware system functions and running in a completely isolated environment is not specifically limited in this application.
存储器1830可以包括易失性存储器(Volatile Memory),例如随机存取存储器(Random Access Memory,RAM);存储器1830也可以包括非易失性存储器(Non-Volatile Memory),例如只读存储器(Read-Only Memory,ROM)、快闪存储器(Flash Memory)、硬盘(Hard  Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);存储器1830还可以包括上述种类的组合。存储器1830可以存储有程序代码,具体执行图3实施例中的步骤S310-步骤S340及其可选步骤,或者,执行图7实施例中的步骤S710-步骤S750及其可选步骤,或者,图10实施例中的步骤S1010-步骤S1050及其可选步骤,或者,图11实施例中的步骤S1110-步骤S1170及其可选步骤,或者,图13实施例中的步骤S1310-步骤S1340及其可选步骤,这里不再进行赘述。The memory 1830 may include volatile memory (Volatile Memory), such as random access memory (Random Access Memory, RAM); the memory 1830 may also include non-volatile memory (Non-Volatile Memory), such as read-only memory (Read-Only Memory). Only Memory (ROM), flash memory (Flash Memory), hard disk (Hard Disk Drive (HDD) or solid-state drive (Solid-State Drive, SSD); the memory 1830 may also include a combination of the above types. The memory 1830 may store program codes to specifically execute steps S310 to S340 and their optional steps in the embodiment of FIG. 3, or execute steps S710 to S750 and their optional steps in the embodiment of FIG. 7, or, FIG. Step S1010 to step S1050 and their optional steps in the embodiment of 10, or step S1110 to step S1170 and their optional steps in the embodiment of Fig. 11, or step S1310 to step S1340 and their optional steps in the embodiment of Fig. 13 Optional steps will not be described here.
通信接口1820可以为有线接口(例如以太网接口),可以为内部接口(例如高速串行计算机扩展总线(Peripheral Component Interconnect express,PCIe)总线接口)、有线接口(例如以太网接口)或无线接口(例如蜂窝网络接口或使用无线局域网接口),用于与其他设备或模块进行通信。The communication interface 1820 may be a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface), or a wireless interface ( such as a cellular network interface or using a wireless LAN interface) for communicating with other devices or modules.
需要说明的,图18仅仅是本申请实施例的一种可能的实现方式,实际应用中,网络设备1800还可以包括更多或更少的部件,这里不作限制。关于本申请实施例中未示出或未描述的内容,可参见前述图3、图7、图10、图11以及图13实施例中的相关阐述,这里不再赘述。It should be noted that Figure 18 is only a possible implementation manner of the embodiment of the present application. In actual applications, the network device 1800 may also include more or fewer components, which is not limited here. For contents not shown or described in the embodiments of the present application, please refer to the relevant explanations in the embodiments of FIG. 3 , FIG. 7 , FIG. 10 , FIG. 11 and FIG. 13 , and will not be described again here.
应理解,图18所示的计算设备还可以是至少一个服务器构成的计算机集群,本申请不作具体限定。It should be understood that the computing device shown in Figure 18 can also be a computer cluster composed of at least one server, which is not specifically limited in this application.
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在处理器上运行时,图3、图7、图10、图11以及图13所示的方法流程得以实现。Embodiments of the present application also provide a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When it is run on a processor, the instructions shown in Figure 3, Figure 7, Figure 10, Figure 11 and Figure 13 The method flow is realized.
本申请实施例还提供一种计算机程序产品,当计算机程序产品在处理器上运行时,图3、图7、图10、图11以及图13所示的方法流程得以实现。Embodiments of the present application also provide a computer program product. When the computer program product is run on a processor, the method flows shown in Figures 3, 7, 10, 11 and 13 are implemented.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,高密度数字视频光盘(Digital Video Disc,DVD)、或者半导体介质。半导体介质可以是SSD。The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, Digital Subscriber Line, DSL) or wireless (such as infrared, wireless, microwave, etc.) methods. The computer Readable storage media can be any available media that can be accessed by a computer or data storage devices such as servers and data centers that contain one or more sets of available media. The available media can be magnetic media (for example, floppy disks, hard disks, tapes ), optical media (for example, high-density digital video disc (DVD)), or semiconductor media. The semiconductor media can be SSD.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。 The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of various equivalent methods within the technical scope disclosed in the present invention. Modifications or substitutions shall be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (16)

  1. 一种通信调度方法,其特征在于,应用于第一网络设备,包括:A communication scheduling method, characterized in that it is applied to a first network device and includes:
    获取与所述第一网络设备连接的至少一个网络设备的设备类型和作业状态;其中,所述至少一个网络设备包括第二网络设备;Obtain the device type and operating status of at least one network device connected to the first network device; wherein the at least one network device includes a second network device;
    根据所述至少一个网络设备的设备类型,确定第一优先级表,所述第一优先级表包括所述至少一个网络设备的初始优先级,其中,设备类型相同的网络设备的初始优先级相同;Determine a first priority table according to the device type of the at least one network device. The first priority table includes the initial priority of the at least one network device, wherein the initial priorities of network devices with the same device type are the same. ;
    确定所述第二网络设备的初始优先级,并根据所述第二网络设备的作业状态和第一优先级表中所述第二网络设备的初始优先级,确定所述第二网络设备的目标优先级。Determine the initial priority of the second network device, and determine the target of the second network device according to the job status of the second network device and the initial priority of the second network device in the first priority table priority.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    根据所述第二网络设备的所述目标优先级,将所述第一优先级表更新为第二优先级表。The first priority table is updated to a second priority table according to the target priority of the second network device.
  3. 根据权利要求2所述的方法,其特征在于,The method according to claim 2, characterized in that:
    所述第二优先级表是将所述第一优先级表中相同初始优先级的网络设备按作业状态对应的优先级进行再次排序确定的;或者,The second priority table is determined by re-sorting the network devices with the same initial priority in the first priority table according to the priority corresponding to the job status; or,
    所述第二优先级表是将每个网络设备的初始优先级按照所述每个网络设备的作业状态调整作业状态对应的预设名次确定的。The second priority table determines the initial priority of each network device according to the preset ranking corresponding to the operating status of each network device.
  4. 根据权利要求2或3任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 2 or 3, characterized in that, the method further includes:
    根据所述第二优先级表,确定是否与所述第二网络设备进行通信;Determine whether to communicate with the second network device according to the second priority table;
    当确定与所述第二网络设备进行通信时,向所述第二网络设备发送第一请求报文,所述第一请求报文携带响应优先级,所述响应优先级用于所述第二网络设备确定响应所述第一请求报文的时间。When it is determined to communicate with the second network device, a first request message is sent to the second network device. The first request message carries a response priority, and the response priority is used for the second network device. The network device determines the time to respond to the first request message.
  5. 根据权利要求2或3任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 2 or 3, characterized in that, the method further includes:
    根据所述第二优先级表,确定是否与所述第二网络设备进行通信;Determine whether to communicate with the second network device according to the second priority table;
    当确定与所述第二网络设备进行通信时,接收所述第二网络设备发送的第二请求报文;When it is determined to communicate with the second network device, receive a second request message sent by the second network device;
    根据所述第二请求报文,确定所述第二请求报文的响应优先级,所述第二请求报文的响应优先级是根据所述第二请求报文的会话类型确定的。The response priority of the second request message is determined according to the second request message, and the response priority of the second request message is determined according to the session type of the second request message.
  6. 根据权利要求4或5任一所述的方法,其特征在于,所述第一网络设备与所述第二网络设备之前存在多个会话,所述确定与所述第二网络设备进行通信,包括:The method according to claim 4 or 5, characterized in that there have been multiple sessions between the first network device and the second network device, and the determining to communicate with the second network device includes: :
    获取所述多个会话的会话类型;Obtain the session types of the multiple sessions;
    根据所述会话类型,从所述多个会话中确定目标会话,所述目标会话是根据所述多个会话中会话类型对应的请求优先级确定的,所述会话类型对应的请求优先级用于指示发送 会话请求报文的顺序。According to the session type, a target session is determined from the plurality of sessions, the target session is determined according to the request priority corresponding to the session type in the multiple sessions, and the request priority corresponding to the session type is used to Instructions to send The sequence of session request messages.
  7. 根据权利要求2或6任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 2 or 6, characterized in that the method further includes:
    确定是否处于紧急通信状态;Determine whether there is an emergency communication status;
    基于所述紧急状态,确定与所述第二网络设备紧急通信;Based on the emergency state, determining emergency communication with the second network device;
    并且,在所述紧急状态解除后,根据所述第二优先级表确定是否与所述第二网络设备进行通信。And, after the emergency state is lifted, it is determined according to the second priority table whether to communicate with the second network device.
  8. 根据权利要求7所述的方法,其特征在于,所述第一网络设备的第一端口与所述第二网络设备的第二端口连接,所述方法还包括:The method according to claim 7, characterized in that the first port of the first network device is connected to the second port of the second network device, and the method further includes:
    接收所述第二网络设备发送的起始报文,所述起始报文携带紧急通信起始标记,所述起始标记用于表示紧急状态开始;Receive a start message sent by the second network device, where the start message carries an emergency communication start tag, and the start tag is used to indicate the start of the emergency state;
    根据所述起始报文,抑制除第一端口的其他端口的通信。According to the initial message, communication on other ports except the first port is suppressed.
  9. 根据权利要求7所述的方法,其特征在于,还包括:The method according to claim 7, further comprising:
    接收所述第二网络设备发送的终止报文,所述终止报文携带紧急通信终止标记,所述终止标记用于表示紧急状态解除;Receive a termination message sent by the second network device, the termination message carries an emergency communication termination mark, and the termination mark is used to indicate that the emergency state is lifted;
    根据所述终止报文,恢复所述除第一端口的其他端口的通信。According to the termination message, communication on the other ports except the first port is restored.
  10. 根据权利要求8所述的方法,其特征在于,所述起始报文还携带紧急通信时长,所述紧急通信时长用于所述第一网络设备确定所述除第一端口的其他端口的通信抑制时长。The method according to claim 8, characterized in that the initial message also carries an emergency communication duration, and the emergency communication duration is used by the first network device to determine the communication of other ports except the first port. Inhibition duration.
  11. 根据权利要求1至10任一项所述的方法,其特征在于,The method according to any one of claims 1 to 10, characterized in that,
    所述设备类型包括:运动控制类,状态控制类以及状态传感类,其中,所述设备类型对应网络设备的初始优先级从高到低为:运动控制类、状态控制类、状态传感类;The device types include: motion control class, status control class and status sensing class, where the initial priorities of the network devices corresponding to the device types from high to low are: motion control class, status control class, status sensing class ;
    所述作业状态包括:正在作业、准备作业和未进行作业,其中,所述作业状态对应的优先级从高到低为:正在作业、准备作业、未进行作业。The job status includes: working in progress, preparing to work, and not working in progress, wherein the priority corresponding to the job status from high to low is: working in progress, preparing to work, and not working in progress.
  12. 根据权利要求5至11任一项所述的方法,其特征在于,The method according to any one of claims 5 to 11, characterized in that,
    所述会话类型包括:控制类会话、查询类会话、订阅类会话,其中,所述会话类型对应的请求优先级从高到低为:控制类会话、查询类会话、订阅类会话,所述会话类型对应的响应优先级从高到低为:查询类会话、控制类会话、订阅类会话。The session types include: control session, query session, and subscription session. The request priority corresponding to the session type from high to low is: control session, query session, and subscription session. The session The response priorities corresponding to the types from high to low are: query session, control session, and subscription session.
  13. 一种通信调度装置,其特征在于,应用于第一网络设备,包括:获取单元、确定单元;A communication scheduling device, characterized in that it is applied to a first network device and includes: an acquisition unit and a determination unit;
    所述获取单元用于获取与所述第一网络设备连接的至少一个网络设备的设备类型和作业状态;其中,所述至少一个网络设备包括第二网络设备;The obtaining unit is used to obtain the device type and operating status of at least one network device connected to the first network device; wherein the at least one network device includes a second network device;
    所述确定单元用于根据所述至少一个网络设备的设备类型,确定第一优先级表,所述 第一优先级表包括所述至少一个网络设备的初始优先级,其中,设备类型相同的网络设备的初始优先级相同;The determining unit is configured to determine a first priority table according to the device type of the at least one network device, the The first priority table includes the initial priority of the at least one network device, wherein network devices with the same device type have the same initial priority;
    所述确定单元还用于确定所述第二网络设备的初始优先级,并根据所述第二网络设备的作业状态和第一优先级表中所述第二网络设备的初始优先级,确定所述第二网络设备的目标优先级。The determining unit is also configured to determine the initial priority of the second network device, and determine the initial priority of the second network device based on the job status of the second network device and the initial priority of the second network device in the first priority table. The target priority of the second network device.
  14. 一种网络设备,其特征在于,包括处理器和存储器,所述存储器用于存储指令,所述处理器用于执行所述指令,当所述处理器执行所述指令时,执行如权利要求1至12中任一项所述的方法。A network device, characterized in that it includes a processor and a memory, the memory is used to store instructions, the processor is used to execute the instructions, and when the processor executes the instructions, the instructions from claims 1 to 1 are executed. The method described in any one of 12.
  15. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机指令,在被网络设备执行时,计算设备执行如权利要求1至12中任一项所述的方法。A computer program product, characterized in that the computer program product includes computer instructions, and when executed by a network device, the computing device executes the method according to any one of claims 1 to 12.
  16. 一种计算机可读存储介质,其特征在于,包括指令,当所述指令在网络设备上运行时,使得所述网络设备执行如权利要求1至12中任一项所述的方法。 A computer-readable storage medium, characterized by comprising instructions that, when the instructions are run on a network device, cause the network device to perform the method according to any one of claims 1 to 12.
PCT/CN2023/096320 2022-05-31 2023-05-25 Communication scheduling method and apparatus, and related device WO2023231899A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210615277.XA CN117221955A (en) 2022-05-31 2022-05-31 Communication scheduling method and device and related equipment
CN202210615277.X 2022-05-31

Publications (1)

Publication Number Publication Date
WO2023231899A1 true WO2023231899A1 (en) 2023-12-07

Family

ID=89026894

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/096320 WO2023231899A1 (en) 2022-05-31 2023-05-25 Communication scheduling method and apparatus, and related device

Country Status (2)

Country Link
CN (1) CN117221955A (en)
WO (1) WO2023231899A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107580340A (en) * 2016-07-05 2018-01-12 普天信息技术有限公司 A kind of resource regulating method in V2X networks
US20180027444A1 (en) * 2016-07-21 2018-01-25 At&T Mobility Ii Llc Traffic priority for long term evolution networks
CN113626164A (en) * 2021-07-23 2021-11-09 济南浪潮数据技术有限公司 Monitoring platform job scheduling method, device, terminal and storage medium
CN113760473A (en) * 2020-06-03 2021-12-07 Oppo广东移动通信有限公司 Priority processing method, processor, processing chip, circuit board and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107580340A (en) * 2016-07-05 2018-01-12 普天信息技术有限公司 A kind of resource regulating method in V2X networks
US20180027444A1 (en) * 2016-07-21 2018-01-25 At&T Mobility Ii Llc Traffic priority for long term evolution networks
CN113760473A (en) * 2020-06-03 2021-12-07 Oppo广东移动通信有限公司 Priority processing method, processor, processing chip, circuit board and electronic equipment
CN113626164A (en) * 2021-07-23 2021-11-09 济南浪潮数据技术有限公司 Monitoring platform job scheduling method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN117221955A (en) 2023-12-12

Similar Documents

Publication Publication Date Title
EP3879879B1 (en) Time sensitive networking communication method and apparatus thereof
US20200187144A1 (en) Communication method, apparatus, and system
RU2695990C1 (en) Communication system, a base station, a communication method and a non-volatile computer-readable medium storing a program
EP3557818A1 (en) Method, device and system for managing network slice instance
WO2019062836A1 (en) Network slice management method, and device for same
WO2021029649A1 (en) Method and apparatus for handling conditional handover (cho) in a wireless communication network
EP3133784A1 (en) Data transmission control node, communication system and data transmission management method
WO2022019676A1 (en) Method and apparatus for selecting a target edge application server in an edge computing environment
Chowdhury et al. Context-aware task migration for HART-centric collaboration over FiWi based tactile internet infrastructures
US10051561B2 (en) Methods and nodes for M2M communication
CN105814922A (en) Address identifier allocation method, and related device and system
CN109548174B (en) Coupling management method and network node
WO2019041371A1 (en) Internet of things number-of-connections-based router switching method and device
US20230262478A1 (en) Model configuration method and apparatus
US11811635B2 (en) Network traffic migration method and apparatus
US10594613B2 (en) Systems and methods for enhanced autonegotiation
WO2023231899A1 (en) Communication scheduling method and apparatus, and related device
WO2019015036A1 (en) Repeater bridging method and gateway
CN111684837B (en) Radio communication system for an industrial automation system and method for operating a radio communication system
WO2019010799A1 (en) Internet of things terminal migration method and gateway
WO2022005037A1 (en) Method and device for providing network analytics information in wireless communication network
WO2018104273A1 (en) Method and device for obtaining resources and information of sdn networks of different operators
JP2019022057A (en) Virtual server configuration changing method and virtual server configuration changing system
CN112866133A (en) Method and device for acquiring MSS (maximum segment size) in common
WO2022252859A1 (en) Computing power resource scheduling method and related apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23815082

Country of ref document: EP

Kind code of ref document: A1