WO2015157913A1 - Method and device for resource allocation - Google Patents

Method and device for resource allocation Download PDF

Info

Publication number
WO2015157913A1
WO2015157913A1 PCT/CN2014/075408 CN2014075408W WO2015157913A1 WO 2015157913 A1 WO2015157913 A1 WO 2015157913A1 CN 2014075408 W CN2014075408 W CN 2014075408W WO 2015157913 A1 WO2015157913 A1 WO 2015157913A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
sub
type
link
detection
Prior art date
Application number
PCT/CN2014/075408
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 华为技术有限公司
Priority to PCT/CN2014/075408 priority Critical patent/WO2015157913A1/en
Priority to CN201480000853.3A priority patent/CN104221340A/en
Publication of WO2015157913A1 publication Critical patent/WO2015157913A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/50Allocation or scheduling criteria for wireless resources
    • H04W72/54Allocation or scheduling criteria for wireless resources based on quality criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements

Definitions

  • the present invention relates to the field of communications, and in particular, to a resource allocation method and device. Background technique
  • IP Internet Protocol
  • the link resource is taken as an example.
  • the resource allocation device detects TCP/IP (Transmission Control Protocol/Internet Protocol, TCP/) for the error level. IP link), until the link resource with the problem is detected, because the link connection between the link resources is more complicated, the link resource that is faulty through the detection is not necessarily accurate, and the link resource with the problem may still be The service will continue to be transmitted, resulting in the user being affected by the service and reducing the user experience.
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • the embodiments of the present invention provide a resource allocation method and device, which can detect a failure of a resource before the resource is allocated for the service, so that the service transmission is normal, thereby improving the user experience.
  • a resource allocation method which is applied to a resource allocation device, and includes:
  • Detecting each candidate resource to obtain a detection result of each of the candidate resources determining a type of each of the candidate resources according to a detection result of each of the candidate resources and a predetermined n types of determination conditions, where The n is an integer greater than 1; the first service is allocated and the first service according to the type of each candidate resource The first resource of the corresponding type.
  • the candidate resource is a link resource
  • the detection result is a packet loss rate
  • the detecting each candidate resource, and obtaining the detection result of each of the candidate resources includes:
  • the packet loss rate of the link resource is obtained, including:
  • n is a positive integer less than or equal to m
  • the n is 3, and for the first candidate resource, the determining condition according to the quality of the first candidate resource and the preset n types Determining the type of the first candidate resource, if: the packet loss rate is less than or equal to a first threshold of the determining condition, determining that the type of the first link resource is a high priority, The determining condition includes the first threshold and the second threshold;
  • the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low.
  • the high priority link resource If the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, and the low priority link resource priority is lower than the medium priority Link resources.
  • the detecting of the link resource is a PING detection defined by the transmission control protocol/Internet interconnection protocol, and the type according to each candidate resource Allocating, for the first service, the first resource of the type corresponding to the first service, including:
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the detection of the link resource is a PING detection of the other protocol defined by the other protocol.
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the candidate resource is a sub-gap resource in a TDM switching mode
  • the detection result is a second code stream
  • the detecting the first sub-gap resource to obtain the detection result of the first sub-gap resource includes:
  • the n is 3, and for the first candidate resource, the determining result according to the first candidate resource and the preset n types of determining The determining the type of the first candidate resource includes: determining whether the first code stream and the second code stream are the same;
  • first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
  • the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
  • the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource.
  • the resource allocation method further includes:
  • the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource, and the type of the first sub-slot resource is the occlusion resource Time of experience;
  • the occlusion time is greater than or equal to the first preset time, change the type of the first sub-gap resource from the occlusion resource to the to-be-checked resource, so that the resource allocation device again
  • the gap resource performs the loopback detection.
  • the type of the first sub-slot resource is the healthy resource
  • the resource allocation method also includes:
  • the health time is the time when the type of the sub-slot resource becomes a health resource, and the type of the sub-slot resource is the time experienced by the health resource ;
  • the type of the first sub-slot resource is changed from the healthy resource to the to-be-checked resource, so that the resource allocation device performs the first sub-gap resource again.
  • the loopback detection is
  • the first resource that is associated with the first service type according to the type of each of the candidate resources includes:
  • a resource allocation device including:
  • a detecting unit configured to detect each candidate resource, and obtain a detection result of each of the candidate resources
  • a first determining unit configured to determine a type of each of the candidate resources according to a detection result of each of the candidate resources obtained by the detecting unit and a preset n types of determining conditions, where the n is An integer greater than one;
  • an allocating unit configured to allocate, according to the type of each of the candidate resources determined by the first determining unit, a first resource of a type corresponding to the first service for the first service.
  • the candidate resource is a link resource
  • the detection result is a packet loss rate
  • the detecting unit is specifically configured to:
  • the detecting unit is specifically configured to:
  • n is a positive integer less than or equal to m
  • the n is 3, and for the first candidate resource, the first determining unit is specifically configured to:
  • the packet loss rate is less than or equal to the first threshold of the determining condition, determining that the type of the first link resource is a high priority, and the determining condition includes the first threshold and the second threshold Value
  • the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low.
  • the high priority link resource
  • the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, and the low priority link resource priority is lower than the medium priority Link resources.
  • the detection of the link resource is a PING detection defined by the Transmission Control Protocol/Internet Protocol, and the allocation unit is specifically configured to:
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the detecting of the link resource is a PING detection of the other protocol defined by the other protocol.
  • the allocation unit is specifically configured to:
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the candidate resource is a sub-gap resource in a TDM switching mode
  • the detection result is a second code stream
  • the detecting unit is specifically configured to:
  • the n is 3, and for the first candidate resource, the first determining unit is specifically configured to:
  • first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
  • the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
  • the resource allocation device further includes:
  • a second determining unit configured to determine whether an occlusion time is greater than or equal to a first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource start timing, and the first sub-slot resource The type is the time elapsed by the occlusion resource; the processing unit is configured to: when the second determining unit determines that the occlusion time is greater than or equal to the first preset time, The type is changed from the occlusion resource to the resource to be tested, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
  • the type of the first sub-slot resource is the healthy resource
  • the resource allocation device further includes:
  • the second determining unit is further configured to determine whether the health time is greater than or equal to a second preset time, where the health time is that the type of the sub-slot resource becomes a start time of a healthy resource, and the sub-timeslot resource The type is the time that the health resource is experienced; the third determining unit is configured to determine, when the second determining unit determines that the health time is greater than or equal to the second preset time, determining whether the first service is The processing unit is further configured to: when the third determining unit determines that the first service is not busy, change the type of the first sub-slot resource from the healthy resource to the to-be-checked And causing the resource allocation device to perform the loopback detection on the first sub-gap resource again.
  • the allocation unit is specifically configured to:
  • a resource allocation device including:
  • a processor configured to detect each candidate resource, and obtain a detection result of each of the candidate resources
  • the processor is further configured to: each of the candidate resources obtained according to the processor Determining a type of each of the candidate resources, wherein the n is an integer greater than 1;
  • the processor is further configured to allocate a first resource of a type corresponding to the first service to the first service according to a type of each of the candidate resources.
  • the candidate resource is a link resource
  • the detection result is a packet loss rate
  • the processor is specifically configured to:
  • the processor is specifically configured to:
  • n is a positive integer less than or equal to m
  • n 3
  • the processor is specifically configured to:
  • the packet loss rate is less than or equal to the first threshold of the determining condition, determining that the type of the first link resource is a high priority, and the determining condition includes the first threshold and the second threshold Value
  • the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low.
  • the high priority link resource
  • the type of the resource is a low priority, and the low priority link resource has a lower priority than the medium priority link resource.
  • the detection of the link resource is a PING detection defined by the Transmission Control Protocol/Internet Protocol, and the processor is specifically configured to:
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the detection of the link resource is a PING detection of the other protocol defined by the other protocol.
  • the processor is specifically configured to:
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the candidate resource is a sub-gap resource in a TDM switching mode
  • the detection result is a second code stream.
  • the processor is specifically configured to:
  • the processor is specifically configured to: Determining whether the first code stream and the second code stream are the same;
  • first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
  • the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
  • the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource.
  • the resource allocation device further includes:
  • the processor is further configured to determine whether an occlusion time is greater than or equal to a first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource start timing, and the first sub-slot resource The type is the time elapsed by the occlusion resource; the processor is further configured to: when the processor determines that the occlusion time is greater than or equal to the first preset time, the first sub-gap The type of the resource is changed from the occlusion resource to the resource to be tested, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
  • the type of the first sub-slot resource is the healthy resource
  • the resource allocation device further includes:
  • the processor is further configured to determine whether a health time is greater than or equal to a second preset time, where the health time is a time when the type of the sub-slot resource becomes a healthy resource, and the type of the sub-slot resource is The time experienced by the health resource;
  • the processor is further configured to: determine, when the processor determines that the health time is greater than or equal to the second preset time, whether the first service is busy;
  • the processor is further configured to: when the processor determines that the first service is not busy, And the type of the first sub-slot resource is changed from the healthy resource to the to-be-detected resource, so that the resource allocation device performs the loopback detection on the first sub-gap resource again.
  • the processor is specifically configured to:
  • the present invention provides a resource allocation method and device, including: detecting each candidate resource to obtain a detection result of each candidate resource; and determining a detection condition according to each of the candidate resources and a preset n types of determination conditions Determining a type of each of the candidate resources, where the n is an integer greater than 1; and assigning, according to the type of each candidate resource, a first resource of a type corresponding to the first service to the first service.
  • the resource allocation device is no longer a problem in the upper layer application, it is checked step by step, but after the resource allocation device detects each candidate resource, the candidate resource is allocated for the first service, and therefore, the allocated candidate resource is in error. The probability of this will be greatly reduced, so that the probability of problems in the upper application will be greatly reduced, and the user experience will be improved accordingly.
  • FIG. 1 is a flowchart of a resource allocation method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another resource allocation method according to an embodiment of the present invention
  • FIG. 3 is still another resource according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a resource allocation method according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a resource allocation device according to an embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of still another resource allocation device according to an embodiment of the present invention.
  • An embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device, as shown in FIG. 1 , and includes:
  • Step 101 Detect each candidate resource, and obtain a detection result of each candidate resource.
  • Step 102 Determine, according to the detection result of each candidate resource and the preset condition of the n types, the type of each candidate resource, where n is an integer greater than 1.
  • Step 103 Allocate a first resource of a type corresponding to the first service according to a type of each candidate resource.
  • the lower layer checks step by step, but the resource allocation device detects each candidate resource first, and then allocates candidate resources for the first service, and therefore, allocates the first resource.
  • the probability of an error is greatly reduced, so that the probability of problems in the upper application is greatly reduced, and the user experience is correspondingly improved.
  • the method of detecting link resources is different due to different protocols, for example, PING (Packet Internet Grope) detection by TCP/IP protocol, except
  • the present invention provides an embodiment including two implementable modes, which are a first implementable manner and a second implementable manner, respectively.
  • step 101 detects each candidate resource, and the method for obtaining the detection result of each candidate resource may include a plurality of types.
  • the PING detection method and the PING-like detection method includes: the resource allocation device can perform the link resource
  • the PING detection defined by the TCP/IP protocol obtains a packet loss rate of the link resource
  • the PING detection method may include: the resource allocation device may perform each of the link resources except the definition of the TCP/IP protocol. The other protocol definition or the customized PING detection, the packet loss rate of the link resource is obtained.
  • the resource allocation device can obtain the local node through the first link within a preset time.
  • the n is a positive integer less than or equal to m, and ( mn ) /m is used as a packet loss rate of the first link resource;
  • the step 102 determines the type of each candidate resource according to the detection result of the first candidate resource and the preset n types of determination conditions, including: for the first link resource, if the packet loss rate If the first threshold is less than or equal to the first threshold, the type of the first link resource is determined to be a high priority, and the determining condition includes the first threshold and the second threshold; If the value of the first link resource is a medium priority, the priority of the link resource of the medium priority is lower than the high priority. a link resource, where ⁇ is equal to 3; if the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, the low priority chain The path resource priority is lower than the medium priority link resource;
  • Step 103 The method for allocating the first resource corresponding to the first service type to the first service according to the type of each candidate resource is further divided into two according to the detected method, and one is a PING allocation method; It is a class PING allocation method.
  • the PING allocation method includes: when the detection of the link resource is the PING detection defined by the TCP/IP protocol, the resource allocation device may acquire the correspondence between all services and the n types, where all the services are Include the first service, and obtain, according to the corresponding relationship, a link resource of a high priority or a medium priority corresponding to the first service, and select a priority from all unoccupied link resources corresponding to the type The highest-level link resource acts as the first resource;
  • the class PING allocation method includes: when the detection of the link resource is the PING detection of the other protocol defined by the other protocol, the resource allocation device can acquire all Corresponding relationship between the service and the n types, the all services include the first service; and obtaining, according to the corresponding relationship, a chain of the first
  • the server that establishes the service may send a detection start instruction to the resource allocation device, where the detection start instruction is used to instruct the resource allocation device to detect each The candidate resource is started, and the resource allocation device starts detecting.
  • the first achievable detection is periodic detection, and the detection period is related to the detected environment and the measured object.
  • the local node and the opposite end node of the method provided by the present invention may be not only two nodes of the same device, but also an interface between the local device and the peer device in the same system, that is, the present invention provides
  • the method can not only detect the link resources in the same device, but also detect the link resources in the same system, but for the detection of such physical links in the system, the purpose is to make the detection cover the system.
  • the physical link segment ensures the quality of the physical link in the system.
  • the peer port and the intermediate device cannot be detected effectively.
  • the local device and the peer device are the same private protocol, for example, MAC (Medium Access Control, The media access control layer) PING detection of the protocol and PING detection of the UDP (User Data Protocol) protocol can cover the entire physical link through the private protocol detection; if the private protocol of the local device and the peer device are different, The detection cannot detect the link that covers the peer device, and only covers the local device.
  • Link for TCP/IP-like detection, if TCP/IP PING detection is used, it can be compatible with devices with proprietary protocols. If PING-like detection is used, both devices need to perform private protocol interaction, among which, PING detection This type of detection includes proprietary protocols.
  • the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
  • step 101 detects each candidate resource, and obtains the detection result of each candidate resource, including: For the first sub-gap resource, The resource allocation device may insert the first code stream in the first sub-gap resource, the type of the first sub-gap resource is a resource to be tested, and the first sub-slot resource is used according to the first code stream. Performing a loopback test on the transmission channel to obtain the second code stream;
  • the step 102 determines the type of each candidate resource according to the detection result of the first candidate resource and the preset n types of determination conditions, including: for the first sub-gap resource, the resource allocation device can determine the location Whether the first code stream and the second code stream are the same, if the first code stream and the second code stream are the same, changing the type of the first sub-gap resource from the check resource a health resource, if the first code stream and the second code stream are different, determining whether the first sub-gap resource is the first time after the first sub-gap resource becomes a resource to be tested Loopback detection, if the first sub-gap resource is performing the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the Loopback detection, if the first sub-gap resource is not the first time to perform the loopback detection, the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource, where
  • the first resource that is associated with the first service type is allocated to the first service according to the type of the candidate resource, and the method includes:
  • the resource allocation method further includes: the resource allocation device may determine whether the occlusion time is greater than or equal to the first preset time, the occlusion The time is the time when the type of the first sub-gap resource becomes the occlusion resource, and the type of the first sub-slot resource is the time elapsed by the occlusion resource; if the occlusion time is greater than or equal to the first Presetting time, changing the type of the first sub-gap resource from the occlusion resource to the waiting Detecting the resource, causing the resource allocation device to perform the loopback detection on the sub-gap resource again.
  • the resource allocation The method further includes: the resource allocation device may determine whether the health time is greater than or equal to a second preset time, where the health time is a time when the type of the sub-slot resource becomes a health resource, and the type of the sub-slot resource is The time that the health resource is experienced; if the health time is greater than or equal to the second preset time, determining whether the first service is busy; if the first service is not busy, then the first child The type of the time slot resource is changed from the health resource to the resource to be tested, so that the resource allocation device performs the loopback detection on the first child gap resource again.
  • the resource allocation method includes: For the first sub-gap resource, in an initial state, changing a type of the first sub-slot resource to the healthy resource.
  • the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource.
  • the quality of the resources thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
  • the method provided by the embodiment of the present invention not only detects and allocates sub-gap resources and link resources, but also detects and allocates specific memory.
  • the resource allocation method is used for feature block read/write consistency detection, etc.
  • the resource allocation method is mainly for a scenario where resource reliability requirements are relatively high.
  • An embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device. It is assumed that the resource allocation device is configured to detect link resources between a local node and a peer node of the device under test.
  • the IP protocol includes: Step 201: Receive a resource detection request.
  • the resource detection request is used to instruct the resource allocation device to start detecting link resources.
  • Step 202 Perform PING detection by using a TCP/IP protocol for each link resource, and obtain a packet loss rate of each link resource.
  • the resource allocation device performs the PING detection defined by the TCP/IP protocol for each link resource, and the PING detection defined by the TCP/IP protocol is implemented by the PING command defined by the TCP/IP protocol.
  • the PING command run by the resource allocation device sends four ICMP (Internet Control Message Protocol) echo requests to each link resource, where the ICMP is a TCP/IP protocol.
  • ICMP Internet Control Message Protocol
  • the resource allocation device acquires the number of the first link resources that do not receive the four ICMP echo reply responses and the number of the first link resources that receive the loopback request within the preset time, and sends the first link resources that have not sent back the response.
  • the quotient of the number of the first link resources that receives the loopback request is used as the packet loss rate of the first link resource, and the packet loss rate of each link resource is the same as the packet loss rate acquisition method of the first link resource.
  • PING can display the amount of time between sending a loopback request and returning a loopback response in milliseconds. If the response time is short, it means that the datagram does not have to go through too many routers or networks, and the connection speed is faster.
  • Step 203 Determine a type of each link resource according to a packet loss rate of each link resource and a preset condition of the n types.
  • the pre-set n types of determination conditions include a first threshold and a second threshold, and the first threshold is used to divide a link resource of a medium priority and a high priority, and the second threshold is used.
  • the resource allocation device can determine whether the packet loss rate of the first link resource is greater than the first threshold, and if the first link resource is lost, the resource allocation device can determine whether the packet loss rate of the first link resource is greater than the first threshold.
  • the resource allocation device may determine that the type of the first link resource is a high priority; if the packet loss rate of the first link resource is greater than the first threshold, the resource allocation device may determine If the packet loss rate of the first link resource is less than the second threshold, the resource allocation device may determine that the type of the first link resource is a medium priority. If the packet loss rate of the first link resource is greater than or equal to the second threshold, the resource allocation device may determine that the type of the first link resource is a low priority. It is worth noting that high priority A resource has a higher priority than a medium priority resource and a lower priority resource, and a medium priority resource has a higher priority than a lower priority resource.
  • sets the first threshold to be 40%, and the second threshold is 100%.
  • sets the type of the first link resource to be identified by the type identifier, as shown in Table 1, where the high priority type The identifier is 100, the medium priority type is 010, and the low priority type is 001.
  • the resource allocation device may determine whether the packet loss rate of the first link resource is greater than 40%. If the packet loss of the first link resource is less than or equal to 40%, the resource allocation device may determine that the type of the first link resource is high. The priority of the first link resource is 100. If the packet loss rate of the first link resource is greater than 40%, the resource allocation device can determine whether the packet loss rate of the first link resource is less than 100%.
  • the resource allocation device may determine that the type of the first link resource is a medium priority, and the type identifier of the first link resource is 010; The packet loss rate is equal to 100%, and the resource allocation device may determine that the type of the first link resource is a low priority, and the type of the first link resource is 001.
  • Step 204 Allocate a first resource of a type corresponding to the first service according to a type of each candidate resource.
  • the PING detection is reliable detection, and the link resources allocated to the first service may be link resources of a type of high priority and medium priority. Assume that the first service corresponds to a medium-priority link resource, and the resource allocation device selects an unoccupied resource as the first resource among the medium-priority link resources; If the priority or high-priority link resource has an unoccupied resource in the high-priority link resource, the first resource is selected in the unoccupied resource in the link resource of the high priority type. .
  • steps 202 and 203 are performed by the PING detection defined by the TCP/IP protocol according to a preset period, and the type of the link resource is updated to ensure In the entire allocation process, the link resources are allocated link resources of the type of high priority or medium priority.
  • An embodiment of the present invention provides a resource allocation method, including: receiving a resource detection request; performing PING detection on each link resource to obtain a packet loss rate of each link resource; and determining a packet loss rate according to each link resource Predetermining the n types of the determination conditions, determining the type of each link resource; assigning the first resource of the first service type to the first service according to the type of each candidate resource.
  • the resource allocation device performs PING detection on each link resource, and obtains a packet loss rate of each link, according to a packet loss rate of each link resource and a preset n.
  • the type of the determining condition determines the type of each link resource, and finally allocates the first resource of the first service type to the first service according to the type of each of the candidate resources.
  • the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
  • the embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device, and is assumed to be used to detect multiple link resources between a local node and a peer node of the device.
  • the PING detection class as shown in Figure 3, includes:
  • Step 301 Receive a resource detection request.
  • the resource detection request is used to instruct the resource allocation device to start detecting link resources.
  • Step 302 Perform a custom PING detection on each link resource to obtain a packet loss rate of each link resource.
  • the resource allocation device uses the same type of PING detection.
  • the principle of the PING detection and the PING detection are the same.
  • the PING can include:
  • the resource allocation device can obtain the first link resource of the local node in the preset time.
  • the n is a positive integer less than or equal to m
  • ( mn ) /m is used as the chain
  • Step 303 Determine a type of each link resource according to a packet loss rate of each link resource and a preset condition of the n types.
  • the preset n types of the determining conditions include the first threshold and the second threshold, and the resource allocation device may determine whether the packet loss rate of the first link resource is greater than the first threshold, if the first link resource If the packet loss rate is less than or equal to the first threshold, the resource allocation device may determine that the type of the first link resource is a high priority; if the packet loss rate of the first link resource is greater than the first threshold, the resource allocation device The device may determine whether the packet loss rate of the first link resource is less than a second threshold.
  • the resource allocation device may determine that the type of the first link resource is Priority: If the packet loss rate of the first link resource is greater than or equal to the second threshold, the resource allocation device may determine that the type of the first link resource is a low priority. It is worth noting that the high priority resources have higher priority than the medium priority resources and the lower priority resources, and the medium priority resources have higher priority than the lower priority resources.
  • Step 304 Allocate a first resource of a type corresponding to the first service according to a type of each candidate resource.
  • the link resources allocated to the service may be link resources with high priority and medium priority and low priority chains. Road resources. For example, it is assumed that the first service corresponds to a link resource of the medium priority, and the resource allocation device selects the unoccupied resource as the first resource among the medium priority link resources; If the link resource of the type of the high-priority link resource has unoccupied resources, the resource with the highest priority is selected among the unoccupied link resources. As the first resource.
  • An embodiment of the present invention provides a resource allocation method, including: receiving a resource detection request; performing a PING-like detection on each link resource to obtain a packet loss rate of each link resource; and a packet loss rate according to each link resource And determining a type of each link resource according to the preset n types of determining conditions; and assigning, according to the type of each candidate resource, a first resource of a type corresponding to the first service to the first service.
  • a custom class in the embodiment of the present invention the resource allocation device performs a PING-like detection on each link resource to obtain a packet loss rate of each link, and determines according to the packet loss rate of each link resource and the preset n types of determination conditions.
  • a type of each link resource and finally assigning, according to the type of each candidate resource, a first resource of a type corresponding to the first service to the first service.
  • the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
  • the embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device, and is assumed to be used for multiple sub-gap resources between a local port and a peer port of a hardware device under test, and the candidate resource is TDM.
  • the sub-gap resources in the exchange mode include:
  • Step 401 Allocate a first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the health resource, and step 402 is performed.
  • the types of gap resources include health resources, resources to be inspected, and occlusion resources.
  • the type of the gap resource is represented by the type identifier as shown in Table 2, where the type identifier of the health resource is 100, the resource to be checked is 010, and the resource blocked is 001.
  • the second sub-gap resource is one or more of the sub-gap resources of the type of healthy resources.
  • Step 402 Determine whether the health time is greater than or equal to the second preset time, and perform step 403.
  • step 403 is performed.
  • the resource allocation device acquires the current health time, and the health time is that the type of the sub-slot resource becomes the start time of the healthy resource, and the type of the sub-slot resource is the health resource. The time of the experience.
  • Step 403 Determine whether the first service is busy. Specifically, the resource allocation device obtains the proportion of the first service occupying the sub-gap resource, where the ratio is referred to as the occupancy rate; determining whether the occupancy rate is less than a preset threshold, and if the occupancy rate is less than the preset threshold, the first service is considered If the busyness is greater than or equal to the preset threshold, the first service is considered busy, and then waits until the first service is not busy.
  • Step 404 Perform loopback detection on the sub-gap resources, and perform step 405.
  • the type of the gap resource is changed from the health resource to the resource to be tested.
  • the resource allocation device may insert the first code stream in the first sub-gap resource, and the type of the first sub-gap resource is the resource to be tested;
  • the first code stream performs a loopback test on the transmission channel of the first sub-slot resource to obtain a second code stream.
  • the detection method of all the sub-gap resources is the same as the detection method of the first sub-gap resource.
  • the loopback test is to short-circuit the transceiver end of the device under test or the line to receive the signal sent by the local port to determine whether the line or port has a breakpoint; or to hang on the shorted line. Test the instrument to test the quality of the transmission on the shorted line.
  • the above method can be used to determine the line problem, it is usually looped back from the nearest node of the local port to the local port, and gradually extended to the node of the farther level and the node of the first level. Different nodes loop back to the same device to determine which two nodes have problems. This method is called segmented loopback test.
  • the loopback test can be implemented in two ways, namely, soft loopback and hard loopback.
  • the software loopback uses the network management software to control the local node of the device under test to send information to the peer node, so that the loopback detection pair End device; hardware loopback is to short the Tx and Rx of a node or device port on the line of the hardware device to achieve the purpose of loopback to the shorted end. It is worth noting that the loopback detection can also be used for the detection port or node of the local port or node of one hardware device and the opposite end of another hardware device.
  • Step 405 Determine whether the first code stream and the second code stream are the same. If yes, go to step 406; if no, go to step 407.
  • Step 406 Change the type of the first sub-gap resource from the verification resource to the health resource, and perform step 401.
  • the type identification should change from 010 to 100.
  • Step 407 Determine whether the first sub-gap resource is the first time to perform loopback detection. If yes, go to step 408; if no, go to step 409.
  • Step 408 Reset the first sub-timeslot resource, and perform step 404.
  • the resource allocation device may reset the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again, so that the resource allocation device can avoid false detection during the detection process.
  • Step 409 Change the type of the first sub-gap resource from the resource to be tested to the occlusion resource, and perform step 410.
  • the corresponding type identifier is changed from 010 to 001, and an alarm instruction is generated. If the resource allocation device can display all the sub-gap resources on the display screen, then After the type of the first sub-gap resource is changed to the occlusion resource, the alarm instruction is used to indicate that the first sub-gap resource corresponding position displays an alarm color on the display screen to distinguish it from other sub-gap resources.
  • Step 410 Determine whether the occlusion time is greater than or equal to the first preset time.
  • step 404 is performed.
  • the occlusion time is a time when the type of the first sub-gap resource becomes the occlusion resource, and the type of the first sub-slot resource is the time elapsed by the occlusion resource.
  • the embodiment of the present invention includes the resource allocation device performing a comparison judgment according to the first code stream before the detection and the second code stream after the detection, and determining the type of each sub-gap resource, thereby allocating the first resource, the first resource, for the first service.
  • the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource.
  • the quality of the resources thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
  • the embodiment of the present invention provides a resource allocation device 50.
  • the method includes: a detecting unit 501, configured to detect each candidate resource, and obtain a detection result of each candidate resource.
  • a first determining unit 502 configured to determine, according to a detection result of each candidate resource obtained by the detecting unit 501 and a preset n types of determining conditions, a type of each candidate resource, where n is an integer greater than 1.
  • the allocating unit 503 is configured to allocate, according to the type of each candidate resource determined by the first determining unit 502, a first resource of a type corresponding to the first service for the first service.
  • the lower layer checks step by step, but the resource allocation device detects each candidate resource first, and then allocates candidate resources for the first service, and therefore, allocates the first resource.
  • the probability of an error is greatly reduced, so that the probability of problems in the upper application is greatly reduced, and the user experience is correspondingly improved.
  • the candidate resource may be a link resource or a sub-gap resource in a TDM exchange mode.
  • the detecting unit 501 is specifically configured to:
  • the TCP/IP protocol defines that the PING detection is implemented by the TCP/IP protocol defining the PING command.
  • the PING command run by the resource allocation device sends four ICMP (Internet Control Message Protocol) echo requests to each link resource, where the ICMP is a TCP/IP protocol.
  • ICMP Internet Control Message Protocol
  • a sub-protocol if everything is ok, each link resource can get 4 ICMP echo responses.
  • the resource allocation device acquires the number of the first link resources that do not receive the four ICMP echo reply responses and the number of the first link resources that receive the loopback request within the preset time, and sends the first link resources that have not sent back the response.
  • the quotient of the number of the first link resources that receives the loopback request is used as the packet loss rate of the first link resource, and the packet loss rate of each link resource is the same as the packet loss rate acquisition method of the first link resource.
  • PING can be in milliseconds
  • the unit shows the amount of time between sending a loopback request and returning a loopback response. If the response time is short, it means that the datagram does not have to go through too many routers or networks, and the connection speed is faster.
  • the implementation process of PING is very simple.
  • the command will cause the IP layer to send a simple IP packet.
  • the destination After receiving the packet, the destination will exchange the source and destination addresses and re-issue the packet. Of course, some timeouts can be added. Mechanisms.
  • the detecting unit 501 is specifically configured to:
  • n is a positive integer less than or equal to m
  • the first determining unit 502 is specifically configured to:
  • the packet loss rate is less than or equal to the first threshold of the determining condition, determining that the type of the first link resource is a high priority, and the determining condition includes the first threshold and the second threshold Value
  • the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low.
  • the high priority link resource
  • the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, and the low priority link resource priority is lower than the medium priority Link resources.
  • the detecting of the link resource is the PING detection defined by the TCP/IP protocol, and the allocating unit 503 is specifically configured to:
  • a link resource of a type of the first service corresponding to a high priority or a medium priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the PING detection is reliable detection, and the link resources allocated to the service may be link resources of a high priority and a medium priority. Assume that the first service corresponds to a medium-priority link resource, and the resource allocation device selects an unoccupied resource as the first resource among the medium-priority link resources; If the priority or high-priority link resource has an unoccupied resource in the high-priority link resource, the first resource is selected in the unoccupied resource in the link resource of the high priority type. .
  • the detecting of the link resource is a class PING detection defined by the other protocol, and the allocating unit 503 is specifically configured to:
  • the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the PING detection is not reliable detection, so the link resources allocated to the service may be of a high priority and a medium priority.
  • Level link resources and low priority link resources For example, it is assumed that the first service corresponds to a link resource of the medium priority, and the resource allocation device selects the unoccupied resource as the first resource among the medium priority link resources; If the link resource of the type of the high-priority link resource has unoccupied resources, the resource with the highest priority is selected among the unoccupied link resources. As the first resource.
  • the server that establishes the service may send a detection start instruction to the resource allocation device, where the detection start instruction is used to indicate resource allocation.
  • the device detects each candidate resource, and the resource allocation device starts detecting.
  • the first achievable detection is periodic detection, and the detection period and the detected environment are related to the measured object.
  • the local node and the peer node can be not only the two nodes of the same device, but also the interface of the local device and the interface of the peer device in the same system, that is, the device provided by the present invention can not only detect the same
  • the link resources in the device can also detect the link resources in the same system.
  • the purpose is to make the detection cover the physical link segments in the system.
  • the physical link quality of the system is guaranteed.
  • the peer port and the intermediate transmission device cannot be detected effectively. If the local device and the peer device are the same private protocol, for example, the MAC (Medium Access Control) protocol.
  • the PING detection and the PING detection of the UDP (User Data Protocol) protocol can cover the entire physical link through the detection of the private protocol. If the private protocol of the local device and the peer device are different, the detection cannot detect the coverage. The link to the peer device can only cover the link to the local device.
  • the detection of the definition of the IP protocol is also the same. If the PING detection defined by the TCP/IP protocol is used, the device can be compatible with the proprietary protocol. If the PING-based detection is used, the two devices need to perform private protocol interaction. This type of detection of the agreement.
  • the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
  • the detection result is a second code stream.
  • the detecting unit 501 is specifically configured to:
  • the first determining unit is specifically configured to: Determining whether the first code stream and the second code stream are the same;
  • first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
  • the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
  • the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource.
  • the resource allocation device 50 further includes: a second determining unit 504, configured to determine whether an occlusion time is greater than or equal to a first preset time, where the occlusion time is the first sub-gap
  • the type of the resource becomes a timing of the occlusion resource, and the type of the first sub-slot resource is the time elapsed by the occlusion resource;
  • the processing unit 505 is configured to change, when the second determining unit 504 determines that the blocking time is greater than or equal to the first preset time, the type of the first sub-gap resource from the occlusion resource Determining the resource to be checked, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
  • the type of the first sub-slot resource is the health resource
  • the resource allocation device 50 further includes:
  • the second determining unit 504 is further configured to determine whether the health time is greater than or equal to a second preset time, where the health time is that the type of the sub-slot resource becomes a healthy resource start timing, and the sub-slot resource The type is the time that the health resource is experienced; the third determining unit 506 is configured to determine the first when the second determining unit determines that the health time is greater than or equal to the second preset time Whether the service is busy; the processing unit 505 is further configured to: when the third determining unit determines the first If the service is not busy, the type of the first sub-slot resource is changed from the healthy resource to the to-be-checked resource, so that the resource allocation device performs the loopback on the first sub-gap resource again. Detection.
  • the allocating unit 503 is specifically configured to:
  • the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource.
  • the quality of the resources thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
  • the device provided by the embodiment of the present invention not only detects and allocates sub-gap resources and link resources, but also detects and allocates specific memory.
  • the resource allocation device is used for feature block read/write consistency detection, etc.
  • the resource allocation device is mainly for a scenario where resource reliability requirements are relatively high.
  • FIG. 7 is a schematic structural diagram of another resource allocation device according to an embodiment of the present invention.
  • the resource allocation device 60 may include a processor 601, and a memory 602, configured to perform internal At least one communication bus 603 for the connection between the devices is used to implement connections and mutual communication between the devices.
  • the communication bus 603 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Wait.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component
  • EISA Extended Industry Standard Architecture
  • the bus 605 can be divided into an address bus, a data bus, a control bus, and the like.
  • Memory 602 can include read only memory and random access memory and provides instructions and data to processor 601603.
  • the processor 601 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more configured to implement the embodiments of the present invention. Integrated circuits.
  • the processor 601 is configured to detect each candidate resource, and obtain a detection result of each of the candidate resources. Determine each of the candidate resources according to a detection result of each candidate resource and a preset n types of determination conditions. a type of the candidate resource, where the n is an integer greater than 1; the first resource corresponding to the first service is allocated to the first service according to the type of each candidate resource.
  • the lower layer checks step by step, but the resource allocation device detects each candidate resource first, and then allocates candidate resources for the first service, and therefore, allocates the first resource.
  • the probability of an error is greatly reduced, so that the probability of problems in the upper application is greatly reduced, and the user experience is correspondingly improved.
  • the candidate resource may include a link resource or a TDM-transformed sub-gap resource.
  • the corresponding detection result is a packet loss rate.
  • the processor 601 is specifically configured to: Performing PING detection on the link resource by using the TCP/IP protocol to obtain a packet loss rate of the link resource; or, performing, for each link resource, other than the TCP/IP protocol definition.
  • the protocol definition or the customized class PING detection obtains the packet loss rate of the link resource.
  • the processor 601 is specifically configured to: acquire the number m of detection packets sent by the local end node to the opposite node by using the first link resource in a preset time, where the m is a positive integer; Acquiring the number n of the detection packets sent by the local node to the peer node by using the first link resource in the preset time, where n is a positive integer less than or equal to m; ( mn ) /m is the packet loss rate of the first link resource.
  • the processor 601 is specifically configured to determine the type of the first link resource if the packet loss rate is less than or equal to a first threshold of the determining condition. Is a high priority, the determining condition includes the first threshold and the second threshold; if the packet loss rate is greater than the first threshold and less than the second threshold, determining the first The link resource type is a medium priority, and the medium priority link resource priority is lower than the high priority link resource; if the packet loss rate is greater than or equal to the second threshold, Determining that the type of the first link resource is a low priority, the low The priority link resource priority is lower than the medium priority link resource.
  • the processor 601 is specifically configured to obtain a correspondence between all the services and the n types, where all the services include the first service, and the type corresponding to the first service is obtained according to the corresponding relationship as a high priority and/or The medium-priority link resource; the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
  • the processor 601 is specifically configured to acquire a correspondence between all services and the n types, where the detection of the link resource is a PING detection of the other protocol. Obtaining, according to the corresponding relationship, at least one type of link resources of the highest priority, medium priority, and low priority corresponding to the first service; and all unoccupied link resources corresponding to the type The link resource with the highest priority is selected as the first resource.
  • the server that establishes the service may send a detection start instruction to the resource allocation device, where the detection start instruction is used to instruct the resource allocation device to detect each candidate resource, and the resource allocation device starts detecting, the first achievable manner
  • the detection is periodic detection, and the detection period and the detected environment are related to the measured object.
  • the local node and the peer node can be not only the two nodes of the same device, but also the interface of the local device and the interface of the peer device in the same system, that is, the device provided by the present invention can not only detect the same
  • the link resources in the device can also detect the link resources in the same system.
  • the purpose is to make the detection cover the physical link segments in the system.
  • the physical link quality of the system is guaranteed.
  • the peer port and the intermediate transmission device cannot be detected effectively. If the local device and the peer device are the same private protocol, for example, the MAC (Medium Access Control) protocol.
  • the PING detection and the PING detection of the UDP (User Data Protocol) protocol can cover the entire physical link through the detection of the private protocol. If the private protocol of the local device and the peer device are different, the detection cannot detect the coverage. The link to the peer device can only be overwritten The link to the local device is the same for TCP/IP-like detection. If the PING detection defined by the TCP/IP protocol is used, the device can be compatible with the proprietary protocol. If the PING-based detection is used, the devices at both ends need to be private. Protocol interaction, where class PING detection includes such detection of proprietary protocols.
  • the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
  • the detection result is a second code stream
  • the processor 601 is specifically configured to: insert, in the first sub-gap resource, a first code stream, where the type of the first sub-gap resource is a resource to be tested; The code stream performs a loopback test on the transmission channel of the first subslot resource to obtain the second code stream.
  • the processor 601 is specifically configured to determine whether the first code stream and the second code stream are the same; if the first code stream and the second code stream are the same, The type of the first sub-gap resource is changed from the check-in resource to the health resource; if the first code stream and the second code stream are different, it is determined that after the first sub-gap resource becomes the resource to be tested Whether the first sub-gap resource is the first time to perform the loopback detection; if the first sub-gap resource is the first time performing the loopback detection, resetting the first sub-slot resource, And causing the resource allocation device to perform the loopback detection on the sub-gap resource again; if the first sub-gap resource is not performing the loopback detection for the first time, the type of the first sub-gap resource is From the resource to be tested to the occlusion resource.
  • the processing unit is further configured to determine whether the occlusion time is greater than or equal to a first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource start timing, and the first sub-slot resource Type is the time elapsed by the occlusion resource; when the processor 601 determines that the occlusion time is greater than or equal to the first preset During the time interval, the type of the first sub-gap resource is changed from the occlusion resource to the to-be-detected resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
  • the type of the first sub-slot resource is the healthy resource
  • the processor 601 is further configured to determine whether the health time is greater than or equal to a second preset time, where the health time is a time when the type of the sub-slot resource becomes a health resource, and the type of the sub-slot resource is The time elapsed by the health resource; when the processor 601 determines that the health time is greater than or equal to the second preset time, determining whether the first service is busy; when the processor 601 determines If the first service is not busy, the type of the first sub-slot resource is changed from the healthy resource to the to-be-checked resource, so that the resource allocation device performs the first sub-gap resource again. Loopback detection.
  • the processor 601 is specifically configured to allocate the first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
  • the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource.
  • the quality of the resources thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
  • the device provided by the embodiment of the present invention not only detects and allocates sub-gap resources and link resources, but also detects and allocates specific memory.
  • the resource allocation device is used for feature block read/write consistency detection, etc.
  • the resource allocation device is mainly for a scenario where resource reliability requirements are relatively high.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, It can be in electrical or other form.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a disk or an optical disk, and the like, which can store program codes.

Abstract

Provided are a method and device for resource allocation, which relate to the field of communications and are able to detect resource failure before a resource is allocated to services, so that service transmission is normal and thus user experience is enhanced. The method comprises: detecting each candidate resource and obtaining a detection result of each candidate resource; determining the type of each candidate resource according to the detection result of each candidate resource and n types of preset decision conditions, where n is an integer greater than 1; and allocating for a first service a first resource of a type corresponding to the first service according to the type of each candidate resource. The present invention applies to resource detection and allocation.

Description

一种资源分配方法和设备 技术领域  Resource allocation method and device
本发明涉及通信领域, 尤其涉及一种资源分配方法和设备。 背景技术  The present invention relates to the field of communications, and in particular, to a resource allocation method and device. Background technique
随着移动网络的大规模普及, 基于 IP ( Internet Protocol , 因特 网互联协议) 的传输方式成为了主流, 移动语音和数据业务已经成 为我们生活不可或缺的部分, 用户对于语音质量和数据传输稳定性 问题要求也越来越高, 对于传输过程中资源的检测和及时恢复也成 为移动网络运营商重点关注的功能。  With the large-scale popularization of mobile networks, the transmission method based on IP (Internet Protocol) has become the mainstream. Mobile voice and data services have become an indispensable part of our life, and users have stability in voice quality and data transmission. The problem requirements are also getting higher and higher. The detection and timely recovery of resources during the transmission process has also become a key concern of mobile network operators.
现有技术中, 以链路资源为例, 在业务建立之后, 若业务在上 层应用中发现错误, 资源分配设备会针对该错误一级级检测 TCP/IP ( Transmission Control Protocol/Internet Protocol , TCP/IP协议 ) , 直 到检测出出现问题的链路资源, 由于链路资源之间的链路连接比较 复杂, 通过检测得到的出现问题的链路资源并不一定准确, 出现问 题的链路资源可能还会继续传输业务, 导致用户使用该业务受到影 响, 降低了用户体验。  In the prior art, the link resource is taken as an example. After the service is established, if the service finds an error in the upper layer application, the resource allocation device detects TCP/IP (Transmission Control Protocol/Internet Protocol, TCP/) for the error level. IP link), until the link resource with the problem is detected, because the link connection between the link resources is more complicated, the link resource that is faulty through the detection is not necessarily accurate, and the link resource with the problem may still be The service will continue to be transmitted, resulting in the user being affected by the service and reducing the user experience.
发明内容 Summary of the invention
本发明的实施例提供一种资源分配方法和设备, 能够在为业务 分配资源之前检测资源的故障, 使得业务传输正常, 从而提高用户 的体验。  The embodiments of the present invention provide a resource allocation method and device, which can detect a failure of a resource before the resource is allocated for the service, so that the service transmission is normal, thereby improving the user experience.
为达到上述目的, 本发明的实施例采用如下技术方案:  In order to achieve the above object, the embodiment of the present invention adopts the following technical solutions:
第一方面, 提供一种资源分配方法, 应用于资源分配设备, 包 括:  In a first aspect, a resource allocation method is provided, which is applied to a resource allocation device, and includes:
检测每个候选资源, 得到每个所述候选资源的检测结果; 根据每个所述候选资源的检测结果和预设的 n个类型的判定条 件, 确定每个所述候选资源的类型, 其中, 所述 n为大于 1 的整数; 根据每个所述候选资源的类型为第一业务分配与所述第一业务 对应类型的第一资源。 Detecting each candidate resource to obtain a detection result of each of the candidate resources; determining a type of each of the candidate resources according to a detection result of each of the candidate resources and a predetermined n types of determination conditions, where The n is an integer greater than 1; the first service is allocated and the first service according to the type of each candidate resource The first resource of the corresponding type.
结合第一方面, 在第一种可实现方式中, 所述候选资源是链路 资源, 所述检测结果是丟包率,  With reference to the first aspect, in a first implementation manner, the candidate resource is a link resource, and the detection result is a packet loss rate.
相应的, 所述检测每个候选资源, 得到每个所述候选资源的检 测结果, 包括:  Correspondingly, the detecting each candidate resource, and obtaining the detection result of each of the candidate resources, includes:
对所述链路资源进行传输控制协议 /因特网互联协议定义的因 特网包探索器 PING检测, 得到所述链路资源的丟包率;  And performing, by the Internet packet explorer PING detection defined by the transmission control protocol/Internet interconnection protocol, the link resource, and obtaining a packet loss rate of the link resource;
或, 对每个所述链路资源进行除所述传输控制协议 /因特网互联 协议定义之外的其他协议定义或自定义的类 PING 检测, 得到所述 链路资源的丟包率。  Or, performing, for each of the link resources, a protocol definition other than the definition of the Transmission Control Protocol/Internet Protocol, or a customized PING detection, to obtain a packet loss rate of the link resource.
结合第一种可实现方式, 在第二种可实现方式中, 对于第一链 路资源, 所述对所述第一链路资源进行除所述传输控制协议 /因特网 互联协议定义之外的其他协议定义或自定义的类 PING 检测, 得到 所述链路资源的丟包率, 包括:  With reference to the first implementation manner, in a second implementation manner, for the first link resource, the performing the first link resource except the definition of the transmission control protocol/Internet interconnection protocol The protocol definition or the customized PING detection, the packet loss rate of the link resource is obtained, including:
获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数;  Acquiring the number m of detection packets sent by the local end node to the opposite end node by using the first link resource in a preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 n ,所述 n是小于或等于 m 的正整数;  Acquiring the number n of the detection packets sent by the local node to the peer node by using the first link resource in the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。  (m-n) / m is used as the packet loss rate of the first link resource.
结合第二种可实现方式, 在第三种可实现方式中, 所述 n是 3 , 对于第一候选资源, 所述根据所述第一候选资源的质量和预设 的 n个类型的判定条件, 确定所述第一候选资源的类型, 包括: 若所述丟包率小于或等于所述判定条件的第一阔值, 则确定所 述第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔 值和第二阔值;  With reference to the second implementation manner, in a third implementation manner, the n is 3, and for the first candidate resource, the determining condition according to the quality of the first candidate resource and the preset n types Determining the type of the first candidate resource, if: the packet loss rate is less than or equal to a first threshold of the determining condition, determining that the type of the first link resource is a high priority, The determining condition includes the first threshold and the second threshold;
若所述丟包率大于所述第一阔值且小于所述第二阔值, 则确定 所述第一链路资源的类型是中优先级, 所述中优先级的链路资源优 先级低于所述高优先级的链路资源; 若所述丟包率大于或等于所述第二阔值, 则确定所述第一链路 资源的类型是低优先级, 所述低优先级的链路资源优先级低于所述 中优先级的链路资源。 If the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low. The high priority link resource; If the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, and the low priority link resource priority is lower than the medium priority Link resources.
结合第三种可实现方式, 在第四种可实现方式中, 所述链路资 源的检测是所述传输控制协议 /因特网互联协议定义的 PING检测, 所述根据每个所述候选资源的类型为第一业务分配与所述第一 业务对应类型的第一资源, 包括:  With reference to the third implementation manner, in a fourth implementable manner, the detecting of the link resource is a PING detection defined by the transmission control protocol/Internet interconnection protocol, and the type according to each candidate resource Allocating, for the first service, the first resource of the type corresponding to the first service, including:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 第一业务;  Acquiring a correspondence between all services and the n types, where all services include a first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源;  Obtaining, according to the corresponding relationship, a link resource of a type of the first service corresponding to a high priority and a medium priority;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。  The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
结合第三种可实现方式, 在第五种可实现方式中, 所述链路资 源的检测是所述其他协议定义的类 PING检测,  In combination with the third achievable manner, in a fifth implementation manner, the detection of the link resource is a PING detection of the other protocol defined by the other protocol.
所述根据每个所述候选资源的类型为第一业务分配与所述第一 业务对应类型的第一资源, 包括:  And allocating the first resource of the type corresponding to the first service to the first service according to the type of each of the candidate resources, including:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 所述第一业务;  Acquiring a correspondence between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、 中优先级和低优先级的链路资源至少一种;  Acquiring at least one type of link resources of the high priority, medium priority, and low priority corresponding to the first service according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。  The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
结合第一方面, 在第六种可实现方式中, 所述候选资源是 TDM 交换方式下的子间隙资源, 所述检测结果是第二码流,  With reference to the first aspect, in a sixth implementation manner, the candidate resource is a sub-gap resource in a TDM switching mode, and the detection result is a second code stream,
对于第一子间隙资源, 所述检测所述第一子间隙资源, 得到所 述第一子间隙资源的检测结果, 包括:  For the first sub-gap resource, the detecting the first sub-gap resource to obtain the detection result of the first sub-gap resource includes:
在所述第一子间隙资源中插入第一码流, 所述第一子间隙资源 的类型是待检资源; 根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。 Inserting, in the first sub-gap resource, a first code stream, where the type of the first sub-gap resource is a resource to be tested; Performing a loopback test on the transmission channel of the first sub-slot resource according to the first code stream, to obtain the second code stream.
结合第六种可实现方式, 在第七种可实现方式中, 所述 n是 3 , 对于第一候选资源, 所述根据所述第一候选资源的检测结果和 预设的 n个类型的判定条件, 确定所述第一候选资源的类型, 包括: 判断所述第一码流和所述第二码流是否相同;  With reference to the sixth implementation manner, in a seventh implementation manner, the n is 3, and for the first candidate resource, the determining result according to the first candidate resource and the preset n types of determining The determining the type of the first candidate resource includes: determining whether the first code stream and the second code stream are the same;
若所述第一码流和所述第二码流相同, 则将所述第一子间隙资 源的类型由所述检待资源变为健康资源;  And if the first code stream and the second code stream are the same, changing the type of the first sub-gap resource from the check resource to a health resource;
若所述第一码流和所述第二码流不相同, 判断在所述第一子间 隙资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行 所述环回检测;  If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
若所述第一子间隙资源是第一次进行所述环回检测, 则复位所 述第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源 进行所述环回检测;  And if the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
若所述第一子间隙资源不是第一次进行所述环回检测, 则将所 述第一子间隙资源的类型由待检资源变为闭塞资源。  If the first sub-gap resource is not the first time to perform the loopback detection, the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource.
结合第七种可实现方式, 在第八种可实现方式中, 所述第一子 间隙资源的类型由所述待检资源变为闭塞资源之后, 所述资源分配 方法还包括:  With reference to the seventh implementation manner, in the eighth implementation manner, after the type of the first sub-gap resource is changed from the to-be-detected resource to the occlusion resource, the resource allocation method further includes:
确定闭塞时间是否大于或等于第一预设时间, 所述闭塞时间是 所述第一子间隙资源的类型变为闭塞资源开始计时, 所述第一子时 隙资源的类型是所述闭塞资源所经历的时间;  Determining whether the occlusion time is greater than or equal to the first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource, and the type of the first sub-slot resource is the occlusion resource Time of experience;
若所述闭塞时间大于或等于所述第一预设时间, 将所述第一子 间隙资源的类型由所述闭塞资源变为所述待检资源, 使得所述资源 分配设备再次对所述子间隙资源进行所述环回检测。  If the occlusion time is greater than or equal to the first preset time, change the type of the first sub-gap resource from the occlusion resource to the to-be-checked resource, so that the resource allocation device again The gap resource performs the loopback detection.
结合第八种可实现方式, 在第九种可实现方式中, 初始状态下, 第一子时隙资源的类型是所述健康资源,  With reference to the eighth achievable manner, in the ninth implementation manner, in an initial state, the type of the first sub-slot resource is the healthy resource,
在所述将第一子时隙资源的类型变为所述健康资源或所述将所 述第一子间隙资源的类型由所述检待资源变为健康资源之后, 所述 资源分配方法还包括: After the type of the first sub-slot resource is changed to the health resource or the type of the first sub-gap resource is changed from the check resource to the health resource, The resource allocation method also includes:
确定健康时间是否大于或等于第二预设时间, 所述健康时间是 所述子时隙资源的类型变为健康资源开始计时, 所述子时隙资源的 类型是所述健康资源所经历的时间;  Determining whether the health time is greater than or equal to a second preset time, where the health time is the time when the type of the sub-slot resource becomes a health resource, and the type of the sub-slot resource is the time experienced by the health resource ;
若所述健康时间大于或等于所述第二预设时间, 确定所述第一 业务是否繁忙;  Determining whether the first service is busy if the health time is greater than or equal to the second preset time;
若所述第一业务不繁忙, 则将所述第一子时隙资源的类型由所 述健康资源变为所述待检资源, 使得所述资源分配设备再次对所述 第一子间隙资源进行所述环回检测。  If the first service is not busy, the type of the first sub-slot resource is changed from the healthy resource to the to-be-checked resource, so that the resource allocation device performs the first sub-gap resource again. The loopback detection.
结合第九种可实现方式, 在第十种可实现方式中, 所述根据每 个所述候选资源的类型为第一业务分配与所述第一业务对应类型的 第一资源, 包括:  With reference to the ninth implementation manner, in the tenth implementation manner, the first resource that is associated with the first service type according to the type of each of the candidate resources, includes:
为所述第一业务分配所述第一资源, 所述第一资源是类型为所 述健康资源的未占用的子间隙资源。  Allocating the first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
第二方面, 提供一种资源分配设备, 包括:  In a second aspect, a resource allocation device is provided, including:
检测单元, 用于检测每个候选资源, 得到每个所述候选资源的 检测结果;  a detecting unit, configured to detect each candidate resource, and obtain a detection result of each of the candidate resources;
第一确定单元, 用于根据所述检测单元得到的每个所述候选资 源的检测结果和预设的 n个类型的判定条件, 确定每个所述候选资 源的类型, 其中, 所述 n为大于 1 的整数;  a first determining unit, configured to determine a type of each of the candidate resources according to a detection result of each of the candidate resources obtained by the detecting unit and a preset n types of determining conditions, where the n is An integer greater than one;
分配单元, 用于根据所述第一确定单元确定的每个所述候选资 源的类型为第一业务分配与所述第一业务对应类型的第一资源。  And an allocating unit, configured to allocate, according to the type of each of the candidate resources determined by the first determining unit, a first resource of a type corresponding to the first service for the first service.
结合第二方面, 在第一种可实现方式中, 所述候选资源是链路 资源, 所述检测结果是丟包率,  With reference to the second aspect, in the first implementation manner, the candidate resource is a link resource, and the detection result is a packet loss rate.
相应的, 所述检测单元具体用于:  Correspondingly, the detecting unit is specifically configured to:
对所述链路资源进行传输控制协议 /因特网互联协议定义的 PING检测, 得到所述链路资源的丟包率;  Performing PING detection on the link resource by using a transmission control protocol/Internet interconnection protocol, and obtaining a packet loss rate of the link resource;
或, 对每个所述链路资源进行除所述传输控制协议 /因特网互联 协议定义之外的其他协议定义或自定义的类 PING 检测, 得到所述 链路资源的丟包率。 Or performing, for each of the link resources, a protocol definition other than the definition of the Transmission Control Protocol/Internet Protocol, or a customized class PING detection, Packet loss rate of link resources.
结合第一种可实现方式, 在第二种可实现方式中, 对于第一链 路资源, 所述检测单元具体用于:  In combination with the first implementation manner, in the second implementation manner, for the first link resource, the detecting unit is specifically configured to:
获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数;  Acquiring the number m of detection packets sent by the local end node to the opposite end node by using the first link resource in a preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 n ,所述 n是小于或等于 m 的正整数;  Acquiring the number n of the detection packets sent by the local node to the peer node by using the first link resource in the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。  (m-n) / m is used as the packet loss rate of the first link resource.
结合第二种可实现方式, 在第三种可实现方式中, 所述 n是 3 , 对于第一候选资源, 所述第一确定单元具体用于:  With reference to the second achievable manner, in a third implementation manner, the n is 3, and for the first candidate resource, the first determining unit is specifically configured to:
若所述丟包率小于或等于所述判定条件的第一阔值, 则确定所 述第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔 值和第二阔值;  If the packet loss rate is less than or equal to the first threshold of the determining condition, determining that the type of the first link resource is a high priority, and the determining condition includes the first threshold and the second threshold Value
若所述丟包率大于所述第一阔值且小于所述第二阔值, 则确定 所述第一链路资源的类型是中优先级, 所述中优先级的链路资源优 先级低于所述高优先级的链路资源;  If the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low. The high priority link resource;
若所述丟包率大于或等于所述第二阔值, 则确定所述第一链路 资源的类型是低优先级, 所述低优先级的链路资源优先级低于所述 中优先级的链路资源。  If the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, and the low priority link resource priority is lower than the medium priority Link resources.
结合第三种可实现方式, 在第四种可实现方式中, 所述链路资 源的检测是所述传输控制协议 /因特网互联协议定义的 PING检测, 所述分配单元具体用于:  In conjunction with the third implementation, in a fourth implementation, the detection of the link resource is a PING detection defined by the Transmission Control Protocol/Internet Protocol, and the allocation unit is specifically configured to:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 第一业务;  Acquiring a correspondence between all services and the n types, where all services include a first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源;  Obtaining, according to the corresponding relationship, a link resource of a type of the first service corresponding to a high priority and a medium priority;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 结合第三种可实现方式, 在第五种可实现方式中, 所述链路资 源的检测是所述其他协议定义的类 PING检测, The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type. In combination with the third achievable manner, in the fifth implementation manner, the detecting of the link resource is a PING detection of the other protocol defined by the other protocol.
所述分配单元具体用于:  The allocation unit is specifically configured to:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 所述第一业务;  Acquiring a correspondence between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、 中优先级和低优先级的链路资源至少一种;  Acquiring at least one type of link resources of the high priority, medium priority, and low priority corresponding to the first service according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。  The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
结合第二方面, 在第六种可实现方式中, 所述候选资源是 TDM 交换方式下的子间隙资源, 所述检测结果是第二码流,  With reference to the second aspect, in a sixth implementation manner, the candidate resource is a sub-gap resource in a TDM switching mode, and the detection result is a second code stream,
对于第一子间隙资源, 所述检测单元具体用于:  For the first sub-gap resource, the detecting unit is specifically configured to:
在所述第一子间隙资源中插入第一码流, 所述第一子间隙资源 的类型是待检资源;  Inserting, in the first sub-gap resource, a first code stream, where the type of the first sub-gap resource is a resource to be tested;
根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。  Performing a loopback test on the transmission channel of the first sub-slot resource according to the first code stream, to obtain the second code stream.
结合第六种可实现方式, 在第七种可实现方式中, 所述 n是 3 , 对于第一候选资源, 所述第一确定单元具体用于:  With reference to the sixth implementation manner, in a seventh implementation manner, the n is 3, and for the first candidate resource, the first determining unit is specifically configured to:
判断所述第一码流和所述第二码流是否相同;  Determining whether the first code stream and the second code stream are the same;
若所述第一码流和所述第二码流相同, 则将所述第一子间隙资 源的类型由所述检待资源变为健康资源;  And if the first code stream and the second code stream are the same, changing the type of the first sub-gap resource from the check resource to a health resource;
若所述第一码流和所述第二码流不相同, 判断在所述第一子间 隙资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行 所述环回检测;  If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
若所述第一子间隙资源是第一次进行所述环回检测, 则复位所 述第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源 进行所述环回检测;  And if the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
若所述第一子间隙资源不是第一次进行所述环回检测, 则将所 述第一子间隙资源的类型由待检资源变为闭塞资源。 结合第七种可实现方式, 在第八种可实现方式中, 所述资源分 配设备还包括: If the first sub-gap resource is not the first time to perform the loopback detection, the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource. With reference to the seventh achievable manner, in the eighth implementation manner, the resource allocation device further includes:
第二确定单元, 用于确定闭塞时间是否大于或等于第一预设时 间, 所述闭塞时间是所述第一子间隙资源的类型变为闭塞资源开始 计时, 所述第一子时隙资源的类型是所述闭塞资源所经历的时间; 处理单元, 用于当所述第二确定单元确定出所述闭塞时间大于 或等于所述第一预设时间时, 将所述第一子间隙资源的类型由所述 闭塞资源变为所述待检资源, 使得所述资源分配设备再次对所述子 间隙资源进行所述环回检测。  a second determining unit, configured to determine whether an occlusion time is greater than or equal to a first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource start timing, and the first sub-slot resource The type is the time elapsed by the occlusion resource; the processing unit is configured to: when the second determining unit determines that the occlusion time is greater than or equal to the first preset time, The type is changed from the occlusion resource to the resource to be tested, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
结合第八种可实现方式, 在第九种可实现方式中, 初始状态下, 第一子时隙资源的类型是所述健康资源,  With reference to the eighth achievable manner, in the ninth implementation manner, in an initial state, the type of the first sub-slot resource is the healthy resource,
所述资源分配设备还包括:  The resource allocation device further includes:
所述第二确定单元, 还用于确定健康时间是否大于或等于第二 预设时间, 所述健康时间是所述子时隙资源的类型变为健康资源开 始计时, 所述子时隙资源的类型是所述健康资源所经历的时间; 第三确定单元, 用于当所述第二确定单元确定出所述健康时间 大于或等于所述第二预设时间时, 确定所述第一业务是否繁忙; 所述处理单元, 还用于当所述第三确定单元确定出所述第一业 务不繁忙, 则将所述第一子时隙资源的类型由所述健康资源变为所 述待检资源, 使得所述资源分配设备再次对所述第一子间隙资源进 行所述环回检测。  The second determining unit is further configured to determine whether the health time is greater than or equal to a second preset time, where the health time is that the type of the sub-slot resource becomes a start time of a healthy resource, and the sub-timeslot resource The type is the time that the health resource is experienced; the third determining unit is configured to determine, when the second determining unit determines that the health time is greater than or equal to the second preset time, determining whether the first service is The processing unit is further configured to: when the third determining unit determines that the first service is not busy, change the type of the first sub-slot resource from the healthy resource to the to-be-checked And causing the resource allocation device to perform the loopback detection on the first sub-gap resource again.
结合第九种可实现方式, 在第十种可实现方式中, 所述分配单 元具体用于:  In conjunction with the ninth implementation manner, in the tenth implementation manner, the allocation unit is specifically configured to:
为所述第一业务分配所述第一资源, 所述第一资源是类型为所 述健康资源的未占用的子间隙资源。  Allocating the first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
第三方面, 提供一种资源分配设备, 包括:  In a third aspect, a resource allocation device is provided, including:
处理器, 用于检测每个候选资源, 得到每个所述候选资源的检 测结果;  a processor, configured to detect each candidate resource, and obtain a detection result of each of the candidate resources;
所述处理器, 还用于根据所述处理器得到的每个所述候选资源 的检测结果和预设的 n个类型的判定条件, 确定每个所述候选资源 的类型, 其中, 所述 n为大于 1 的整数; The processor is further configured to: each of the candidate resources obtained according to the processor Determining a type of each of the candidate resources, wherein the n is an integer greater than 1;
所述处理器, 还用于根据每个所述候选资源的类型为第一业务 分配与所述第一业务对应类型的第一资源。  The processor is further configured to allocate a first resource of a type corresponding to the first service to the first service according to a type of each of the candidate resources.
结合第三方面, 在第一种可实现方式中, 所述候选资源是链路 资源, 所述检测结果是丟包率,  With reference to the third aspect, in a first implementation manner, the candidate resource is a link resource, and the detection result is a packet loss rate,
相应的, 所述处理器具体用于:  Correspondingly, the processor is specifically configured to:
对所述链路资源进行传输控制协议 /因特网互联协议定义的 PING检测, 得到所述链路资源的丟包率;  Performing PING detection on the link resource by using a transmission control protocol/Internet interconnection protocol, and obtaining a packet loss rate of the link resource;
或, 对每个所述链路资源进行除所述传输控制协议 /因特网互联 协议定义之外的其他协议定义或自定义的类 PING 检测, 得到所述 链路资源的丟包率。  Or, performing, for each of the link resources, a protocol definition other than the definition of the Transmission Control Protocol/Internet Protocol, or a customized PING detection, to obtain a packet loss rate of the link resource.
结合第一种可实现方式, 在第二种可实现方式中, 对于第一链 路资源, 所述处理器具体用于:  In combination with the first implementation manner, in the second implementation manner, for the first link resource, the processor is specifically configured to:
获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数;  Acquiring the number m of detection packets sent by the local end node to the opposite end node by using the first link resource in a preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 n ,所述 n是小于或等于 m 的正整数;  Acquiring the number n of the detection packets sent by the local node to the peer node by using the first link resource in the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。  (m-n) / m is used as the packet loss rate of the first link resource.
结合第二种可实现方式, 在第三种可实现方式中, 所述 n是 3 , 对于第一候选资源, 所述处理器具体用于:  In combination with the second achievable manner, in a third implementation manner, the n is 3, and for the first candidate resource, the processor is specifically configured to:
若所述丟包率小于或等于所述判定条件的第一阔值, 则确定所 述第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔 值和第二阔值;  If the packet loss rate is less than or equal to the first threshold of the determining condition, determining that the type of the first link resource is a high priority, and the determining condition includes the first threshold and the second threshold Value
若所述丟包率大于所述第一阔值且小于所述第二阔值, 则确定 所述第一链路资源的类型是中优先级, 所述中优先级的链路资源优 先级低于所述高优先级的链路资源;  If the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low. The high priority link resource;
若所述丟包率大于或等于所述第二阔值, 则确定所述第一链路 资源的类型是低优先级, 所述低优先级的链路资源优先级低于所述 中优先级的链路资源。 Determining the first link if the packet loss rate is greater than or equal to the second threshold The type of the resource is a low priority, and the low priority link resource has a lower priority than the medium priority link resource.
结合第三种可实现方式, 在第四种可实现方式中, 所述链路资 源的检测是所述传输控制协议 /因特网互联协议定义的 PING检测, 所述处理器具体用于:  In combination with the third implementation, in a fourth implementation, the detection of the link resource is a PING detection defined by the Transmission Control Protocol/Internet Protocol, and the processor is specifically configured to:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 第一业务;  Acquiring a correspondence between all services and the n types, where all services include a first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源;  Obtaining, according to the corresponding relationship, a link resource of a type of the first service corresponding to a high priority and a medium priority;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。  The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
结合第三种可实现方式, 在第五种可实现方式中, 所述链路资 源的检测是所述其他协议定义的类 PING检测,  In combination with the third achievable manner, in a fifth implementation manner, the detection of the link resource is a PING detection of the other protocol defined by the other protocol.
所述处理器具体用于:  The processor is specifically configured to:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 所述第一业务;  Acquiring a correspondence between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、 中优先级和低优先级的链路资源至少一种;  Acquiring at least one type of link resources of the high priority, medium priority, and low priority corresponding to the first service according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。  The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
结合第三方面, 在第六种可实现方式中, 所述候选资源是 TDM 交换方式下的子间隙资源, 所述检测结果是第二码流,  With reference to the third aspect, in a sixth implementation manner, the candidate resource is a sub-gap resource in a TDM switching mode, and the detection result is a second code stream.
对于第一子间隙资源, 所述处理器具体用于:  For the first sub-gap resource, the processor is specifically configured to:
在所述第一子间隙资源中插入第一码流, 所述第一子间隙资源 的类型是待检资源;  Inserting, in the first sub-gap resource, a first code stream, where the type of the first sub-gap resource is a resource to be tested;
根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。  Performing a loopback test on the transmission channel of the first sub-slot resource according to the first code stream, to obtain the second code stream.
结合第六种可实现方式, 在第七种可实现方式中, 所述 n是 3 , 对于第一候选资源, 所述处理器具体用于: 判断所述第一码流和所述第二码流是否相同; With reference to the sixth implementation manner, in a seventh implementation manner, the n is 3, and for the first candidate resource, the processor is specifically configured to: Determining whether the first code stream and the second code stream are the same;
若所述第一码流和所述第二码流相同, 则将所述第一子间隙资 源的类型由所述检待资源变为健康资源;  And if the first code stream and the second code stream are the same, changing the type of the first sub-gap resource from the check resource to a health resource;
若所述第一码流和所述第二码流不相同, 判断在所述第一子间 隙资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行 所述环回检测;  If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
若所述第一子间隙资源是第一次进行所述环回检测, 则复位所 述第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源 进行所述环回检测;  And if the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
若所述第一子间隙资源不是第一次进行所述环回检测, 则将所 述第一子间隙资源的类型由待检资源变为闭塞资源。  If the first sub-gap resource is not the first time to perform the loopback detection, the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource.
结合第七种可实现方式, 在第八种可实现方式中, 所述资源分 配设备还包括:  In combination with the seventh achievable manner, in the eighth implementation manner, the resource allocation device further includes:
所述处理器, 还用于确定闭塞时间是否大于或等于第一预设时 间, 所述闭塞时间是所述第一子间隙资源的类型变为闭塞资源开始 计时, 所述第一子时隙资源的类型是所述闭塞资源所经历的时间; 所述处理器, 还用于当所述处理器确定出所述闭塞时间大于或 等于所述第一预设时间时, 将所述第一子间隙资源的类型由所述闭 塞资源变为所述待检资源, 使得所述资源分配设备再次对所述子间 隙资源进行所述环回检测。  The processor is further configured to determine whether an occlusion time is greater than or equal to a first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource start timing, and the first sub-slot resource The type is the time elapsed by the occlusion resource; the processor is further configured to: when the processor determines that the occlusion time is greater than or equal to the first preset time, the first sub-gap The type of the resource is changed from the occlusion resource to the resource to be tested, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
结合第八种可实现方式, 在第九种可实现方式中, 初始状态下, 第一子时隙资源的类型是所述健康资源,  With reference to the eighth achievable manner, in the ninth implementation manner, in an initial state, the type of the first sub-slot resource is the healthy resource,
所述资源分配设备还包括:  The resource allocation device further includes:
所述处理器, 还用于确定健康时间是否大于或等于第二预设时 间, 所述健康时间是所述子时隙资源的类型变为健康资源开始计时, 所述子时隙资源的类型是所述健康资源所经历的时间;  The processor is further configured to determine whether a health time is greater than or equal to a second preset time, where the health time is a time when the type of the sub-slot resource becomes a healthy resource, and the type of the sub-slot resource is The time experienced by the health resource;
所述处理器, 还用于当所述处理器确定出所述健康时间大于或 等于所述第二预设时间时, 确定所述第一业务是否繁忙;  The processor is further configured to: determine, when the processor determines that the health time is greater than or equal to the second preset time, whether the first service is busy;
所述处理器,还用于当所述处理器确定出所述第一业务不繁忙, 则将所述第一子时隙资源的类型由所述健康资源变为所述待检资 源, 使得所述资源分配设备再次对所述第一子间隙资源进行所述环 回检测。 The processor is further configured to: when the processor determines that the first service is not busy, And the type of the first sub-slot resource is changed from the healthy resource to the to-be-detected resource, so that the resource allocation device performs the loopback detection on the first sub-gap resource again.
结合第九种可实现方式, 在第十种可实现方式中, 所述处理器 具体用于:  In conjunction with the ninth implementation manner, in the tenth implementation manner, the processor is specifically configured to:
为所述第一业务分配所述第一资源, 所述第一资源是类型为所 述健康资源的未占用的子间隙资源。  Allocating the first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
本发明提供一种资源分配方法和设备, 包括: 检测每个候选资 源, 得到每个所述候选资源的检测结果; 根据每个所述候选资源的 检测结果和预设的 n 个类型的判定条件, 确定每个所述候选资源的 类型, 其中, 所述 n为大于 1 的整数; 根据每个所述候选资源的类 型为第一业务分配与所述第一业务对应类型的第一资源。 这样一来, 资源分配设备不再是上层应用出现问题后, 逐级检查, 而是在资源 分配设备检测每个候选资源之后, 再为第一业务分配候选资源, 因 此, 分配的候选资源出现错误的概率就会大大降低, 从而上层应用 出现问题的概率也会大大降低, 用户体验也相应提升。  The present invention provides a resource allocation method and device, including: detecting each candidate resource to obtain a detection result of each candidate resource; and determining a detection condition according to each of the candidate resources and a preset n types of determination conditions Determining a type of each of the candidate resources, where the n is an integer greater than 1; and assigning, according to the type of each candidate resource, a first resource of a type corresponding to the first service to the first service. In this way, after the resource allocation device is no longer a problem in the upper layer application, it is checked step by step, but after the resource allocation device detects each candidate resource, the candidate resource is allocated for the first service, and therefore, the allocated candidate resource is in error. The probability of this will be greatly reduced, so that the probability of problems in the upper application will be greatly reduced, and the user experience will be improved accordingly.
附图说明 DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1为本发明实施例提供的一种资源分配方法的流程图; 图 2为本发明实施例提供的另一种资源分配方法的流程图; 图 3为本发明实施例提供的又一种资源分配方法的流程图; 图 4为本发明实施例提供的再一种资源分配方法的流程图; 图 5为本发明实施例提供的一种资源分配设备的结构示意图; 图 6 为本发明实施例提供的另一种资源分配设备的结构示意 图; 图 7为为本发明实施例提供的又一种资源分配设备的结构示意 图。 1 is a flowchart of a resource allocation method according to an embodiment of the present invention; FIG. 2 is a flowchart of another resource allocation method according to an embodiment of the present invention; FIG. 3 is still another resource according to an embodiment of the present invention; FIG. 4 is a flowchart of a resource allocation method according to an embodiment of the present invention; FIG. 5 is a schematic structural diagram of a resource allocation device according to an embodiment of the present invention; A schematic diagram of the structure of another resource allocation device provided; FIG. 7 is a schematic structural diagram of still another resource allocation device according to an embodiment of the present invention.
具体实施方式 detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供一种资源分配方法, 应用于资源分配设备, 如图 1所示, 包括:  An embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device, as shown in FIG. 1 , and includes:
步骤 101、 检测每个候选资源, 得到每个候选资源的检测结果。 步骤 102、 根据每个候选资源的检测结果和预设的 n 个类型的 判定条件, 确定每个候选资源的类型, 其中, n为大于 1 的整数。  Step 101: Detect each candidate resource, and obtain a detection result of each candidate resource. Step 102: Determine, according to the detection result of each candidate resource and the preset condition of the n types, the type of each candidate resource, where n is an integer greater than 1.
步骤 103、 根据每个候选资源的类型为第一业务分配与所述第 一业务对应类型的第一资源。  Step 103: Allocate a first resource of a type corresponding to the first service according to a type of each candidate resource.
这样一来, 资源分配设备不再是上层应用出现问题后, 下层逐 级检查, 而是在资源分配设备先检测每个候选资源, 再为第一业务 分配候选资源, 因此, 分配的第一资源出现错误的概率就会大大降 低, 从而上层应用出现问题的概率也会大大降低, 用户体验也相应 提升。  In this way, after the resource allocation device is no longer a problem in the upper layer application, the lower layer checks step by step, but the resource allocation device detects each candidate resource first, and then allocates candidate resources for the first service, and therefore, allocates the first resource. The probability of an error is greatly reduced, so that the probability of problems in the upper application is greatly reduced, and the user experience is correspondingly improved.
由于协议不同, 检测链路资源的方法也不同, 例如, TCP/IP协 议定义的 PING ( Packet Internet Grope , 因特网包探索器) 检测, 除 The method of detecting link resources is different due to different protocols, for example, PING (Packet Internet Grope) detection by TCP/IP protocol, except
TCP/IP协议之外的其他协议定义或自定义的类 PING检测。 因此, 本发明提供实施例包括两种可实现方式, 分别是第一种可实现方式 和第二种可实现方式。 Other protocol definitions than the TCP/IP protocol or custom class PING detection. Therefore, the present invention provides an embodiment including two implementable modes, which are a first implementable manner and a second implementable manner, respectively.
在第一种可实现方式中, 当候选资源是链路资源, 检测结果是 丟包率时, 步骤 101 检测每个候选资源, 得到每个所述候选资源的 检测结果的方法可以包括很多种, 例如 PING检测法、 类 PING检测 法; PING 检测法包括: 资源分配设备可以对所述链路资源进行 TCP/IP协议定义的 PING检测,得到所述链路资源的丟包率;类 PING 检测法可以包括: 资源分配设备可以对每个所述链路资源进行除所 述 TCP/IP协议定义之外的其他协议定义或自定义的类 PING检测, 得到所述链路资源的丟包率, 具体的, 对于第一链路资源, 资源分 配设备可以获取预设时间内本端节点通过第一链路资源向对端节点 发送的检测包的次数 m , 所述 m是正整数, 获取所述预设时间内本 端节点通过第一链路资源接收到对端节点发送的所述检测包的次数 n , 所述 n是小于或等于 m的正整数, 将 ( m-n ) /m作为所述第一链 路资源的丟包率; In the first implementation manner, when the candidate resource is a link resource, and the detection result is a packet loss rate, step 101 detects each candidate resource, and the method for obtaining the detection result of each candidate resource may include a plurality of types. For example, the PING detection method and the PING-like detection method; the PING detection method includes: the resource allocation device can perform the link resource The PING detection defined by the TCP/IP protocol obtains a packet loss rate of the link resource; the PING detection method may include: the resource allocation device may perform each of the link resources except the definition of the TCP/IP protocol. The other protocol definition or the customized PING detection, the packet loss rate of the link resource is obtained. Specifically, for the first link resource, the resource allocation device can obtain the local node through the first link within a preset time. The number m of detection packets sent by the resource to the peer node, where m is a positive integer, and the number n of times the local node receives the detection packet sent by the peer node through the first link resource in the preset time period, The n is a positive integer less than or equal to m, and ( mn ) /m is used as a packet loss rate of the first link resource;
对于第一候选资源, 步骤 102根据所述第一候选资源的检测结 果和预设的 n个类型的判定条件, 确定每个候选资源的类型, 包括: 对于第一链路资源, 若丟包率小于或等于所述判定条件的第一阔值, 则确定所述第一链路资源的类型是高优先级, 所述判定条件包括所 述第一阔值和第二阔值; 若丟包率大于所述第一阔值且小于所述第 二阔值, 则确定所述第一链路资源的类型是中优先级, 所述中优先 级的链路资源优先级低于所述高优先级的链路资源,其中, η等于 3 ; 若所述丟包率大于或等于所述第二阔值, 则确定所述第一链路资源 的类型是低优先级, 所述低优先级的链路资源优先级低于所述中优 先级的链路资源;  For the first candidate resource, the step 102 determines the type of each candidate resource according to the detection result of the first candidate resource and the preset n types of determination conditions, including: for the first link resource, if the packet loss rate If the first threshold is less than or equal to the first threshold, the type of the first link resource is determined to be a high priority, and the determining condition includes the first threshold and the second threshold; If the value of the first link resource is a medium priority, the priority of the link resource of the medium priority is lower than the high priority. a link resource, where η is equal to 3; if the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, the low priority chain The path resource priority is lower than the medium priority link resource;
步骤 103根据每个所述候选资源的类型为第一业务分配与所述 第一业务对应类型的第一资源的方法根据检测的方法不同又分为两 种, 一种是 PING分配法; 一种是类 PING分配法。 具体的, PING 分配法包括:当所述链路资源的检测是所述 TCP/IP协议定义的 PING 检测时, 资源分配设备可以获取所有业务和所述 n个类型的对应关 系, 所述所有业务包括第一业务, 根据所述对应关系获取所述第一 业务对应的类型为高优先级和或中优先级的链路资源, 从所述类型 对应的所有的未占用的链路资源中选择优先级最高的链路资源作为 与所述第一资源; 类 PING 分配法包括: 当所述链路资源的检测是 所述其他协议定义的类 PING 检测时, 资源分配设备可以获取所有 业务和所述 n个类型的对应关系, 所述所有业务包括所述第一业务; 根据所述对应关系获取所述第一业务对应的类型为高优先级、 中优 先级和低优先级的链路资源至少一种; 从所述类型对应的所有的未 占用的链路资源中选择优先级最高的链路资源作为第一资源。 Step 103: The method for allocating the first resource corresponding to the first service type to the first service according to the type of each candidate resource is further divided into two according to the detected method, and one is a PING allocation method; It is a class PING allocation method. Specifically, the PING allocation method includes: when the detection of the link resource is the PING detection defined by the TCP/IP protocol, the resource allocation device may acquire the correspondence between all services and the n types, where all the services are Include the first service, and obtain, according to the corresponding relationship, a link resource of a high priority or a medium priority corresponding to the first service, and select a priority from all unoccupied link resources corresponding to the type The highest-level link resource acts as the first resource; the class PING allocation method includes: when the detection of the link resource is the PING detection of the other protocol defined by the other protocol, the resource allocation device can acquire all Corresponding relationship between the service and the n types, the all services include the first service; and obtaining, according to the corresponding relationship, a chain of the first service corresponding to a high priority, a medium priority, and a low priority At least one of the path resources; the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
值得说明的是, 在第一种可实现方式的步骤 101 之前, 在业务 建立时, 建立该业务的服务器可以向资源分配设备发送检测启动指 令, 该检测启动指令用于指示资源分配设备检测每个待选资源, 资 源分配设备开始检测, 第一种可实现方式的检测是周期性检测, 检 测周期与检测的环境和被测对象有关。  It should be noted that, before the step 101 of the first implementation manner, when the service is established, the server that establishes the service may send a detection start instruction to the resource allocation device, where the detection start instruction is used to instruct the resource allocation device to detect each The candidate resource is started, and the resource allocation device starts detecting. The first achievable detection is periodic detection, and the detection period is related to the detected environment and the measured object.
特别说明的是, 本发明提供的方法的本端节点和对端节点不仅 可以是同一设备的两个节点, 也可以是同一系统中本端设备的接口 和对端设备的接口, 即本发明提供的方法不仅可以检测同一设备内 的链路资源, 也可以检测同一系统中的链路资源, 但是对于这类能 够以系统中的物理链路的检测, 其目 的是要使得检测覆盖到本系统 内的物理链路段, 保障本系统内的物理链路质量, 对于对端端口和 中间传输设备, 无法有效进行检测; 如果本端和对端设备是同一私 有协议的 , 例如 MAC ( Medium Access Control , 介质访问控制层) 协议的 PING检测和 UDP ( User Data Protocol , 用户数据报协议) 协议的 PING 检测, 可以通过私有协议检测覆盖整个物理链路; 如 果本端设备和对端设备的私有协议不同, 检测就没法检测覆盖到对 端设备的链路, 只能覆盖到本端设备的链路, 对于类似 TCP/IP的检 测也是如此, 如果采用 TCP/IP的 PING检测, 可以兼容私有协议的 设备, 如果采用类 PING 检测, 则需要两端设备做私有协议交互, 其中, 类 PING检测包括私有协议的这类检测。  Specifically, the local node and the opposite end node of the method provided by the present invention may be not only two nodes of the same device, but also an interface between the local device and the peer device in the same system, that is, the present invention provides The method can not only detect the link resources in the same device, but also detect the link resources in the same system, but for the detection of such physical links in the system, the purpose is to make the detection cover the system. The physical link segment ensures the quality of the physical link in the system. The peer port and the intermediate device cannot be detected effectively. If the local device and the peer device are the same private protocol, for example, MAC (Medium Access Control, The media access control layer) PING detection of the protocol and PING detection of the UDP (User Data Protocol) protocol can cover the entire physical link through the private protocol detection; if the private protocol of the local device and the peer device are different, The detection cannot detect the link that covers the peer device, and only covers the local device. Link, for TCP/IP-like detection, if TCP/IP PING detection is used, it can be compatible with devices with proprietary protocols. If PING-like detection is used, both devices need to perform private protocol interaction, among which, PING detection This type of detection includes proprietary protocols.
这样一来, 资源分配设备对链路资源进行检测之后, 为第一业 务分配第一业务对应链路资源中优先级最高的链路资源, 保证了为 第一检测资源分配的第一资源的质量, 从而避免了由于链路资源导 致的第一业务的传输中断, 提高了用户体验。  In this way, after the resource allocation device detects the link resource, the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
在第二种可实现方式中, 当候选资源是 TDM ( Technical Data Management , 时分复用模式) 交换方式下的子间隙资源, 检测结果 是第二码流时, 步骤 101 检测每个候选资源, 得到每个候选资源的 检测结果, 包括: 对于第一子间隙资源, 资源分配设备可以在所述 第一子间隙资源中插入第一码流, 所述第一子间隙资源的类型是待 检资源, 根据所述第一码流对所述第一子时隙资源的传输通道进行 环回测试, 得到所述第二码流; In the second implementation, when the candidate resource is TDM (Technical Data Management, time division multiplexing mode) The sub-gap resource in the switching mode, when the detection result is the second code stream, step 101 detects each candidate resource, and obtains the detection result of each candidate resource, including: For the first sub-gap resource, The resource allocation device may insert the first code stream in the first sub-gap resource, the type of the first sub-gap resource is a resource to be tested, and the first sub-slot resource is used according to the first code stream. Performing a loopback test on the transmission channel to obtain the second code stream;
对于第一候选资源, 步骤 102根据第一候选资源的检测结果和 预设的 n个类型的判定条件, 确定每个候选资源的类型, 包括: 对 于第一子间隙资源, 资源分配设备可以判断所述第一码流和所述第 二码流是否相同, 若所述第一码流和所述第二码流相同, 则将所述 第一子间隙资源的类型由所述检待资源变为健康资源, 若所述第一 码流和所述第二码流不相同, 判断在所述第一子间隙资源成为待检 资源之后, 所述第一子间隙资源是否是第一次进行所述环回检测, 若所述第一子间隙资源是第一次进行所述环回检测, 则复位所述第 一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源进行 所述环回检测, 若所述第一子间隙资源不是第一次进行所述环回检 测, 则将所述第一子间隙资源的类型由待检资源变为闭塞资源, 其 中, 类型为闭塞资源的子间隙资源是该第一业务不可用但设备层仍 然可用的子间隙资源。  For the first candidate resource, the step 102 determines the type of each candidate resource according to the detection result of the first candidate resource and the preset n types of determination conditions, including: for the first sub-gap resource, the resource allocation device can determine the location Whether the first code stream and the second code stream are the same, if the first code stream and the second code stream are the same, changing the type of the first sub-gap resource from the check resource a health resource, if the first code stream and the second code stream are different, determining whether the first sub-gap resource is the first time after the first sub-gap resource becomes a resource to be tested Loopback detection, if the first sub-gap resource is performing the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the Loopback detection, if the first sub-gap resource is not the first time to perform the loopback detection, the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource, where the type is occlusion Resources sub-interval of the first service is not a gap but with the device resources still available sub-layer.
在步骤 103 中根据每个所述候选资源的类型为第一业务分配与 所述第一业务对应类型的第一资源, 包括:  The first resource that is associated with the first service type is allocated to the first service according to the type of the candidate resource, and the method includes:
为所述第一业务分配第一资源, 所述第一资源是类型为所述健 康资源的未占用的子间隙资源。  Allocating a first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
进一步的, 所述第一子间隙资源由所述待检资源变为闭塞资源 之后, 所述资源分配方法还包括: 资源分配设备可以确定闭塞时间 是否大于或等于第一预设时间, 所述闭塞时间是所述第一子间隙资 源的类型变为闭塞资源开始计时, 所述第一子时隙资源的类型是所 述闭塞资源所经历的时间; 若所述闭塞时间大于或等于所述第一预 设时间, 将所述第一子间隙资源的类型由所述闭塞资源变为所述待 检资源, 使得所述资源分配设备再次对所述子间隙资源进行所述环 回检测。 Further, after the first sub-gap resource is changed from the to-be-detected resource to the occlusion resource, the resource allocation method further includes: the resource allocation device may determine whether the occlusion time is greater than or equal to the first preset time, the occlusion The time is the time when the type of the first sub-gap resource becomes the occlusion resource, and the type of the first sub-slot resource is the time elapsed by the occlusion resource; if the occlusion time is greater than or equal to the first Presetting time, changing the type of the first sub-gap resource from the occlusion resource to the waiting Detecting the resource, causing the resource allocation device to perform the loopback detection on the sub-gap resource again.
进一步的, 在所述将第一子时隙资源的类型变为所述健康资源 或所述将所述第一子间隙资源的类型由所述检待资源变为健康资源 之后, 所述资源分配方法还包括: 资源分配设备可以确定健康时间 是否大于或等于第二预设时间, 所述健康时间是所述子时隙资源的 类型变为健康资源开始计时, 所述子时隙资源的类型是所述健康资 源所经历的时间; 若所述健康时间大于或等于所述第二预设时间, 确定所述第一业务是否繁忙; 若所述第一业务不繁忙, 则将所述第 一子时隙资源的类型由所述健康资源变为所述待检资源, 使得所述 资源分配设备再次对所述第一子间隙资源进行所述环回检测。  Further, after the changing the type of the first sub-slot resource into the healthy resource or the type of the first sub-gap resource from the detected resource to the healthy resource, the resource allocation The method further includes: the resource allocation device may determine whether the health time is greater than or equal to a second preset time, where the health time is a time when the type of the sub-slot resource becomes a health resource, and the type of the sub-slot resource is The time that the health resource is experienced; if the health time is greater than or equal to the second preset time, determining whether the first service is busy; if the first service is not busy, then the first child The type of the time slot resource is changed from the health resource to the resource to be tested, so that the resource allocation device performs the loopback detection on the first child gap resource again.
值得说明的是, 在步骤 101检测每个候选资源之前, 所述资源 分配方法包括: 对于第一子间隙资源, 初始状态下, 将第一子时隙 资源的类型变为所述健康资源。  It is to be noted that, before detecting each candidate resource in step 101, the resource allocation method includes: For the first sub-gap resource, in an initial state, changing a type of the first sub-slot resource to the healthy resource.
这样一来,资源分配设备在为第一用户设备分配第一资源之前, 检测类型为待检资源的子间隙资源, 不仅节省了检测的工作量, 也 保证了为第一检测资源分配的第一资源的质量, 从而避免了由于子 间隙资源导致的业务传输中断, 提高了用户体验。  In this way, the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource. The quality of the resources, thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
特别说明的是, 本发明实施例提供的方法不仅仅检测和分配子 间隙资源和链路资源, 还可以检测和分配特定内存。 例如采用该资 源分配方法用于特征块读写一致性检测等等, 总而言之, 该资源分 配方法主要针对资源的可靠性要求比较高的场景。  It is specifically noted that the method provided by the embodiment of the present invention not only detects and allocates sub-gap resources and link resources, but also detects and allocates specific memory. For example, the resource allocation method is used for feature block read/write consistency detection, etc. In summary, the resource allocation method is mainly for a scenario where resource reliability requirements are relatively high.
本发明实施例提供一种资源分配方法, 应用于资源分配设备, 假设该资源分配设备用于检测被测设备的本端节点到对端节点之间 的链路资源, 本实施例以采用 TCP/IP协议为例, 如图 2所示, 包括: 步骤 201、 接收资源检测请求。  An embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device. It is assumed that the resource allocation device is configured to detect link resources between a local node and a peer node of the device under test. As shown in FIG. 2, the IP protocol includes: Step 201: Receive a resource detection request.
资源检测请求用于指示资源分配设备开始检测链路资源。  The resource detection request is used to instruct the resource allocation device to start detecting link resources.
步骤 202、对每个链路资源进行 TCP/IP协议定义的 PING检测 , 得到每个链路资源的丟包率。 资源分配设备对每个链路资源进行 TCP/IP协议定义的 PING检 测 , TCP/IP协议定义的 PING检测是通过 TCP/IP协议定义的 PING 命令实现的。具体的,对于第一链路资源,资源分配设备运行的 PING 命令向每个链路资源发送 4 个 ICMP ( Internet Control Message Protocol , 网间控制报文协议 ) 回送请求, 该 ICMP是 TCP/IP协议 的一个子协议, 如果一切正常, 每个链路资源就能得到 4 个 ICMP 回送应答。 资源分配设备获取预设时间内未得到 4 个 ICMP发送回 送应答的第一链路资源个数和接收回送请求的第一链路资源的个 数, 将发送未回送应答的第一链路资源个数和接收回送请求的第一 链路资源的个数的商作为第一链路资源的丟包率, 每个链路资源的 丟包率和第一链路资源的丟包率获取方法相同。 PING能够以毫秒为 单位显示发送回送请求到返回回送应答之间的时间量。 如果应答时 间短, 表示数据报不必通过太多的路由器或网络, 连接速度比较快。 TCP/IP协议定义的 PING的实现过程很简单, 命令将引发 IP层发送 一个简单的 IP包, 而目的方收到这个包之后, 将源和目 的地址做一 下交换, 重新发出这个包即可, 当然还可以增加一些超时的机制。 Step 202: Perform PING detection by using a TCP/IP protocol for each link resource, and obtain a packet loss rate of each link resource. The resource allocation device performs the PING detection defined by the TCP/IP protocol for each link resource, and the PING detection defined by the TCP/IP protocol is implemented by the PING command defined by the TCP/IP protocol. Specifically, for the first link resource, the PING command run by the resource allocation device sends four ICMP (Internet Control Message Protocol) echo requests to each link resource, where the ICMP is a TCP/IP protocol. A sub-protocol, if everything is ok, each link resource can get 4 ICMP echo responses. The resource allocation device acquires the number of the first link resources that do not receive the four ICMP echo reply responses and the number of the first link resources that receive the loopback request within the preset time, and sends the first link resources that have not sent back the response. The quotient of the number of the first link resources that receives the loopback request is used as the packet loss rate of the first link resource, and the packet loss rate of each link resource is the same as the packet loss rate acquisition method of the first link resource. PING can display the amount of time between sending a loopback request and returning a loopback response in milliseconds. If the response time is short, it means that the datagram does not have to go through too many routers or networks, and the connection speed is faster. The implementation process of PING defined by TCP/IP protocol is very simple. The command will cause the IP layer to send a simple IP packet. After the destination party receives the packet, exchange the source and destination addresses and re-issue the packet. Of course, you can also add some timeout mechanisms.
步骤 203、 根据每个链路资源的丟包率和预设的 n个类型的判 定条件, 确定每个链路资源的类型。  Step 203: Determine a type of each link resource according to a packet loss rate of each link resource and a preset condition of the n types.
预设的 n个类型的判定条件包括第一阔值和第二阔值, 该第一 阔值用于划分类型为中优先级和类型为高优先级的链路资源, 该第 二阔值用于划分类型为低优先级和类型为中优先级的链路资源, 具 体的, 资源分配设备可以判断第一链路资源的丟包率是否大于第一 阔值, 若第一链路资源的丟包小于或等于第一阔值, 则资源分配设 备可以确定该第一链路资源的类型是高优先级; 若第一链路资源的 丟包率大于第一阔值, 则资源分配设备可以判断第一链路资源的丟 包率是否小于第二阔值, 若第一链路资源的丟包率小于第二阔值, 则资源分配设备可以确定该第一链路资源的类型是中优先级; 若第 一链路资源的丟包率大于或等于第二阔值, 则资源分配设备可以确 定该第一链路资源的类型是低优先级。 值得说明的是, 高优先级的 资源的优先级高于中优先级的资源和低优先级的资源, 中优先级的 资源的优先级高于低优先级的资源。 The pre-set n types of determination conditions include a first threshold and a second threshold, and the first threshold is used to divide a link resource of a medium priority and a high priority, and the second threshold is used. The resource allocation device can determine whether the packet loss rate of the first link resource is greater than the first threshold, and if the first link resource is lost, the resource allocation device can determine whether the packet loss rate of the first link resource is greater than the first threshold. If the packet is less than or equal to the first threshold, the resource allocation device may determine that the type of the first link resource is a high priority; if the packet loss rate of the first link resource is greater than the first threshold, the resource allocation device may determine If the packet loss rate of the first link resource is less than the second threshold, the resource allocation device may determine that the type of the first link resource is a medium priority. If the packet loss rate of the first link resource is greater than or equal to the second threshold, the resource allocation device may determine that the type of the first link resource is a low priority. It is worth noting that high priority A resource has a higher priority than a medium priority resource and a lower priority resource, and a medium priority resource has a higher priority than a lower priority resource.
示例的, ^^设第一阔值是 40% , 第二阔值是 100% , ^^设第一链 路资源的类型由类型标识标识, 如表 1 所示, 其中, 高优先级的类 型标识为 100 , 中优先级的类型标识为 010 , 低优先级的类型标识为 001。 资源分配设备可以判断第一链路资源的丟包率是否大于 40% , 若第一链路资源的丟包小于或等于 40% , 则资源分配设备可以确定 该第一链路资源的类型是高优先级, 该第一链路资源的类型标识为 100 ; 若第一链路资源的丟包率大于 40% , 则资源分配设备可以判断 第一链路资源的丟包率是否小于 100%, 若第一链路资源的丟包率小 于 100% , 则资源分配设备可以确定该第一链路资源的类型是中优先 级, 该第一链路资源的类型标识为 010 ; 若第一链路资源的丟包率 等于 100% , 则资源分配设备可以确定该第一链路资源的类型是低优 先级, 该第一链路资源的类型标识为 001。  For example, ^^ sets the first threshold to be 40%, and the second threshold is 100%. ^^ sets the type of the first link resource to be identified by the type identifier, as shown in Table 1, where the high priority type The identifier is 100, the medium priority type is 010, and the low priority type is 001. The resource allocation device may determine whether the packet loss rate of the first link resource is greater than 40%. If the packet loss of the first link resource is less than or equal to 40%, the resource allocation device may determine that the type of the first link resource is high. The priority of the first link resource is 100. If the packet loss rate of the first link resource is greater than 40%, the resource allocation device can determine whether the packet loss rate of the first link resource is less than 100%. If the packet loss rate of the first link resource is less than 100%, the resource allocation device may determine that the type of the first link resource is a medium priority, and the type identifier of the first link resource is 010; The packet loss rate is equal to 100%, and the resource allocation device may determine that the type of the first link resource is a low priority, and the type of the first link resource is 001.
表 1
Figure imgf000020_0001
Table 1
Figure imgf000020_0001
步骤 204、根据每个候选资源的类型为第一业务分配与第一业务 对应类型的第一资源。  Step 204: Allocate a first resource of a type corresponding to the first service according to a type of each candidate resource.
由于本实施例采用的 TCP/IP协议定义的 PING检测 , 该 PING 检测是可靠的检测, 给第一业务分配的链路资源可以是类型为高优 先级和中优先级的链路资源。 假设第一业务对应的是类型为中优先 级的链路资源, 资源分配设备在中优先级的链路资源中选择未占用 的资源的作为第一资源; 假设第一业务对应的是类型为中优先级或 高优先级的链路资源, 若类型为高优先级的链路资源中有未占用的 资源, 则在类型为高优先级的链路资源中的未占用的资源选择出第 一资源。  Due to the PING detection defined by the TCP/IP protocol in this embodiment, the PING detection is reliable detection, and the link resources allocated to the first service may be link resources of a type of high priority and medium priority. Assume that the first service corresponds to a medium-priority link resource, and the resource allocation device selects an unoccupied resource as the first resource among the medium-priority link resources; If the priority or high-priority link resource has an unoccupied resource in the high-priority link resource, the first resource is selected in the unoccupied resource in the link resource of the high priority type. .
值得说明, 上述步骤 202 和步骤 203 是按照预设周期进行 TCP/IP协议定义的 PING检测的, 并更新链路资源的类型, 以保证 在整个分配过程中, 链路资源分配的都是类型为高优先级或中优先 级的链路资源。 It is worthwhile to note that the above steps 202 and 203 are performed by the PING detection defined by the TCP/IP protocol according to a preset period, and the type of the link resource is updated to ensure In the entire allocation process, the link resources are allocated link resources of the type of high priority or medium priority.
本发明实施例提供一种资源分配方法, 包括: 接收资源检测请 求; 对每个链路资源进行 PING检测, 得到每个链路资源的丟包率; 根据每个链路资源的丟包率和预设的 n个类型的判定条件, 确定每 个链路资源的类型; 根据每个候选资源的类型为第一业务分配与第 一业务对应类型的第一资源。 在本发明实施例采用 TCP/IP协议时, 资源分配设备对每个链路资源进行 PING 检测, 得到每个链路的丟 包率, 根据每个链路资源的丟包率和预设的 n个类型的判定条件, 确定每个链路资源的类型, 最后根据每个所述候选资源的类型为第 一业务分配与第一业务对应类型的第一资源。 这样一来, 资源分配 设备对链路资源进行检测之后, 为第一业务分配第一业务对应链路 资源中优先级最高的链路资源, 保证了为第一检测资源分配的第一 资源的质量, 从而避免了由于链路资源导致的第一业务的传输中断, 提高了用户体验。  An embodiment of the present invention provides a resource allocation method, including: receiving a resource detection request; performing PING detection on each link resource to obtain a packet loss rate of each link resource; and determining a packet loss rate according to each link resource Predetermining the n types of the determination conditions, determining the type of each link resource; assigning the first resource of the first service type to the first service according to the type of each candidate resource. When the TCP/IP protocol is used in the embodiment of the present invention, the resource allocation device performs PING detection on each link resource, and obtains a packet loss rate of each link, according to a packet loss rate of each link resource and a preset n. The type of the determining condition determines the type of each link resource, and finally allocates the first resource of the first service type to the first service according to the type of each of the candidate resources. In this way, after the resource allocation device detects the link resource, the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
本发明实施例提供一种资源分配方法, 应用于资源分配设备, 假设该资源分配设备用于检测设备的本端节点到对端节点之间的多 个链路资源, 本实施例以采用 自定义的类 PING 检测为例, 如图 3 所示, 包括:  The embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device, and is assumed to be used to detect multiple link resources between a local node and a peer node of the device. For example, the PING detection class, as shown in Figure 3, includes:
步骤 301、 接收资源检测请求。  Step 301: Receive a resource detection request.
资源检测请求用于指示资源分配设备开始检测链路资源。  The resource detection request is used to instruct the resource allocation device to start detecting link resources.
步骤 302、 对每个链路资源进行自定义的类 PING检测, 得到每 个链路资源的丟包率。  Step 302: Perform a custom PING detection on each link resource to obtain a packet loss rate of each link resource.
资源分配设备使用 自定义的类 PING 检测, 自定义的类 PING 检测和 PING检测的原理相同, 具体的, 类 PING可以包括: 资源分 配设备可以获取预设时间内本端节点通过第一链路资源向对端节点 发送的检测包的次数 m , 所述 m是正整数, 获取所述预设时间内本 端节点通过第一链路资源接收到所述对端节点发送的所述检测包的 次数 n , 所述 n是小于或等于 m的正整数, 将 ( m-n ) /m作为该链 路资源的丟包率, The resource allocation device uses the same type of PING detection. The principle of the PING detection and the PING detection are the same. Specifically, the PING can include: The resource allocation device can obtain the first link resource of the local node in the preset time. The number m of detection packets sent to the peer node, where m is a positive integer, and the number of times the local node receives the detection packet sent by the peer node through the first link resource in the preset time period. , the n is a positive integer less than or equal to m, and ( mn ) /m is used as the chain The packet loss rate of the road resource,
步骤 303、 根据每个链路资源的丟包率和预设的 n个类型的判 定条件, 确定每个链路资源的类型。  Step 303: Determine a type of each link resource according to a packet loss rate of each link resource and a preset condition of the n types.
具体的,预设的 n个类型的判定条件包括第一阔值和第二阔值, 资源分配设备可以判断第一链路资源的丟包率是否大于第一阔值, 若第一链路资源的丟包小于或等于第一阔值, 则资源分配设备可以 确定该第一链路资源的类型是高优先级; 若第一链路资源的丟包率 大于第一阔值, 则资源分配设备可以判断第一链路资源的丟包率是 否小于第二阔值, 若第一链路资源的丟包率小于第二阔值, 则资源 分配设备可以确定该第一链路资源的类型是中优先级; 若第一链路 资源的丟包率大于或等于第二阔值, 则资源分配设备可以确定该第 一链路资源的类型是低优先级。 值得说明的是, 高优先级的资源的 优先级高于中优先级的资源和低优先级的资源, 中优先级的资源的 优先级高于低优先级的资源。  Specifically, the preset n types of the determining conditions include the first threshold and the second threshold, and the resource allocation device may determine whether the packet loss rate of the first link resource is greater than the first threshold, if the first link resource If the packet loss rate is less than or equal to the first threshold, the resource allocation device may determine that the type of the first link resource is a high priority; if the packet loss rate of the first link resource is greater than the first threshold, the resource allocation device The device may determine whether the packet loss rate of the first link resource is less than a second threshold. If the packet loss rate of the first link resource is less than the second threshold, the resource allocation device may determine that the type of the first link resource is Priority: If the packet loss rate of the first link resource is greater than or equal to the second threshold, the resource allocation device may determine that the type of the first link resource is a low priority. It is worth noting that the high priority resources have higher priority than the medium priority resources and the lower priority resources, and the medium priority resources have higher priority than the lower priority resources.
步骤 304、根据每个候选资源的类型为第一业务分配与第一业务 对应类型的第一资源。  Step 304: Allocate a first resource of a type corresponding to the first service according to a type of each candidate resource.
由于本实施例采用 自定义的类 PING检测,该类 PING检测不是 可靠的检测, 所以给业务分配的链路资源可以是类型为高优先级、 中优先级的链路资源和低优先级的链路资源。 示例的, 假设第一业 务对应的是类型为中优先级的链路资源, 资源分配设备在中优先级 的链路资源中选择未占用的资源的作为第一资源; 假设第一业务对 应的是类型为低优先级、 中优先级或高优先级的链路资源, 若类型 为高优先级的链路资源中有未占用的资源, 则在未占用的链路资源 中选择优先级最高的资源作为第一资源。  Since the PING detection is not reliable detection, the link resources allocated to the service may be link resources with high priority and medium priority and low priority chains. Road resources. For example, it is assumed that the first service corresponds to a link resource of the medium priority, and the resource allocation device selects the unoccupied resource as the first resource among the medium priority link resources; If the link resource of the type of the high-priority link resource has unoccupied resources, the resource with the highest priority is selected among the unoccupied link resources. As the first resource.
本发明实施例提供一种资源分配方法, 包括: 接收资源检测请 求; 对每个链路资源进行类 PING 检测, 得到每个链路资源的丟包 率; 根据每个链路资源的丟包率和预设的 n个类型的判定条件, 确 定每个链路资源的类型; 根据每个所述候选资源的类型为第一业务 分配与第一业务对应类型的第一资源。 在本发明实施例自定义的类 PING检测时 , 资源分配设备对每个链路资源进行类 PING检测 , 得 到每个链路的丟包率, 根据每个链路资源的丟包率和预设的 n 个类 型的判定条件, 确定每个链路资源的类型, 最后根据每个所述候选 资源的类型为第一业务分配与第一业务对应类型的第一资源。 这样 一来, 资源分配设备对链路资源进行检测之后, 为第一业务分配第 一业务对应链路资源中优先级最高的链路资源, 保证了为第一检测 资源分配的第一资源的质量, 从而避免了由于链路资源导致的第一 业务的传输中断, 提高了用户体验。 An embodiment of the present invention provides a resource allocation method, including: receiving a resource detection request; performing a PING-like detection on each link resource to obtain a packet loss rate of each link resource; and a packet loss rate according to each link resource And determining a type of each link resource according to the preset n types of determining conditions; and assigning, according to the type of each candidate resource, a first resource of a type corresponding to the first service to the first service. a custom class in the embodiment of the present invention During the PING detection, the resource allocation device performs a PING-like detection on each link resource to obtain a packet loss rate of each link, and determines according to the packet loss rate of each link resource and the preset n types of determination conditions. A type of each link resource, and finally assigning, according to the type of each candidate resource, a first resource of a type corresponding to the first service to the first service. In this way, after the resource allocation device detects the link resource, the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
本发明实施例提供一种资源分配方法, 应用于资源分配设备, 假设该资源分配设备用于被测的硬件设备的本端端口到对端端口之 间的多个子间隙资源,假设候选资源是 TDM交换方式下的子间隙资 源, 如图 4所示, 包括:  The embodiment of the present invention provides a resource allocation method, which is applied to a resource allocation device, and is assumed to be used for multiple sub-gap resources between a local port and a peer port of a hardware device under test, and the candidate resource is TDM. The sub-gap resources in the exchange mode, as shown in Figure 4, include:
步骤 401、 为第一业务分配第一资源, 该第一资源是类型为健 康资源的未占用的子间隙资源, 执行步骤 402。  Step 401: Allocate a first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the health resource, and step 402 is performed.
本实施例假设初始状态下,所有的间隙资的类型都是健康资源, 值得说明的是间隙资源的类型包括健康资源、待检资源和闭塞资源。 假设间隙资源的类型由类型标识表示如表 2 所示, 其中, 健康资源 的类型标识是 100 , 待检资源是 010 , 闭塞资源是 001。 该第二子间 隙资源是类型为健康资源的子间隙资源中一个或多个。  This example assumes that all types of clearance resources are healthy resources in the initial state. It is worth noting that the types of gap resources include health resources, resources to be inspected, and occlusion resources. Assume that the type of the gap resource is represented by the type identifier as shown in Table 2, where the type identifier of the health resource is 100, the resource to be checked is 010, and the resource blocked is 001. The second sub-gap resource is one or more of the sub-gap resources of the type of healthy resources.
表 2
Figure imgf000023_0001
Table 2
Figure imgf000023_0001
步骤 402、 确定健康时间是否大于或等于第二预设时间, 执行 步骤 403。  Step 402: Determine whether the health time is greater than or equal to the second preset time, and perform step 403.
若健康时间大于或等于第二预设时间, 则执行步骤 403。 在确 定健康时间是否大于或等于第二预设时间之前, 资源分配设备获取 当前的健康时间, 健康时间是子时隙资源的类型变为健康资源开始 计时, 子时隙资源的类型是健康资源所经历的时间。  If the health time is greater than or equal to the second preset time, step 403 is performed. Before determining whether the health time is greater than or equal to the second preset time, the resource allocation device acquires the current health time, and the health time is that the type of the sub-slot resource becomes the start time of the healthy resource, and the type of the sub-slot resource is the health resource. The time of the experience.
步骤 403、 确定第一业务是否繁忙。 具体的, 资源分配设备获取第一业务占用子间隙资源的比例, 这里将该比例称作占用率; 判断该占用率是否小于预设门限, 若该 占用率小于预设门限, 则认为第一业务不繁忙, 执行步骤 404 , 若 占用率大于或等于预设门限, 则认为第一业务繁忙, 则进行等待, 直到第一业务不繁忙为止。 Step 403: Determine whether the first service is busy. Specifically, the resource allocation device obtains the proportion of the first service occupying the sub-gap resource, where the ratio is referred to as the occupancy rate; determining whether the occupancy rate is less than a preset threshold, and if the occupancy rate is less than the preset threshold, the first service is considered If the busyness is greater than or equal to the preset threshold, the first service is considered busy, and then waits until the first service is not busy.
步骤 404、 对子间隙资源进行环回检测, 执行步骤 405。  Step 404: Perform loopback detection on the sub-gap resources, and perform step 405.
间隙资源的类型由健康资源变为待检资源, 对于第一子间隙资 源, 资源分配设备可以在第一子间隙资源中插入第一码流, 第一子 间隙资源的类型是待检资源; 根据第一码流对第一子时隙资源的传 输通道进行环回测试, 得到第二码流, 所有的子间隙资源的检测方 法与第一子间隙资源的检测方法相同。  The type of the gap resource is changed from the health resource to the resource to be tested. For the first sub-gap resource, the resource allocation device may insert the first code stream in the first sub-gap resource, and the type of the first sub-gap resource is the resource to be tested; The first code stream performs a loopback test on the transmission channel of the first sub-slot resource to obtain a second code stream. The detection method of all the sub-gap resources is the same as the detection method of the first sub-gap resource.
该环回测试就是通过将被测设备或线路的收发端进行短接, 用 被测的设备接收本端端口发送的信号来判断线路或端口是否存在断 点; 也可以在短接的线路上挂测试仪器来测试短接的线路上的传输 质量。 当通过上述方法可以初步判断是线路问题时, 通常从本端端 口最近的结点向本端端口环回, 逐步扩展到再远一级的结点、 更远 一级的结点, 用多次不同的结点向同一个设备环回, 以判断到底是 哪两个结点之间存在问题, 这样的方法叫做分段环回测试。 环回测 试可以通过两种方式实现, 分为软环回和硬环回, 其中, 软件环回 是用 网络管理软件控制被测设备的本端节点向对端节点发送信息, 从而环回检测对端设备; 硬件环回是将硬件设备的线路上某结点或 设备端口的 Tx和 Rx进行短接 , 以达到向被短接端环回的目 的。 值得 说明的是, 该回环检测也可以用于一个硬件设备的本端端口或结点 和另一硬件设备的对端进行检测端或结点。  The loopback test is to short-circuit the transceiver end of the device under test or the line to receive the signal sent by the local port to determine whether the line or port has a breakpoint; or to hang on the shorted line. Test the instrument to test the quality of the transmission on the shorted line. When the above method can be used to determine the line problem, it is usually looped back from the nearest node of the local port to the local port, and gradually extended to the node of the farther level and the node of the first level. Different nodes loop back to the same device to determine which two nodes have problems. This method is called segmented loopback test. The loopback test can be implemented in two ways, namely, soft loopback and hard loopback. The software loopback uses the network management software to control the local node of the device under test to send information to the peer node, so that the loopback detection pair End device; hardware loopback is to short the Tx and Rx of a node or device port on the line of the hardware device to achieve the purpose of loopback to the shorted end. It is worth noting that the loopback detection can also be used for the detection port or node of the local port or node of one hardware device and the opposite end of another hardware device.
步骤 405、 判断第一码流和第二码流是否相同。 若是, 则执行 步骤 406 ; 若否, 则执行步骤 407。  Step 405: Determine whether the first code stream and the second code stream are the same. If yes, go to step 406; if no, go to step 407.
步骤 406、 将第一子间隙资源的类型由所述检待资源变为健康 资源, 执行步骤 401。  Step 406: Change the type of the first sub-gap resource from the verification resource to the health resource, and perform step 401.
当第一子间隙资源的类型由所述检待资源变为健康资源时, 对 应的类型标识由 010变为 100。 When the type of the first sub-gap resource is changed from the inspection resource to the health resource, The type identification should change from 010 to 100.
步骤 407、 判断第一子间隙资源是否是第一次进行环回检测。 若是, 则执行步骤 408 ; 若否, 则执行步骤 409。  Step 407: Determine whether the first sub-gap resource is the first time to perform loopback detection. If yes, go to step 408; if no, go to step 409.
步骤 408、 复位第一子时隙资源, 执行步骤 404。  Step 408: Reset the first sub-timeslot resource, and perform step 404.
资源分配设备可以复位第一子时隙资源, 使得资源分配设备再 次对所述子间隙资源进行所述环回检测, 这样, 资源分配设备可以 避免检测过程中的误检。  The resource allocation device may reset the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again, so that the resource allocation device can avoid false detection during the detection process.
步骤 409、 将第一子间隙资源的类型由待检资源变为闭塞资源 , 执行步骤 410。  Step 409: Change the type of the first sub-gap resource from the resource to be tested to the occlusion resource, and perform step 410.
当第一子间隙资源的类型由待检资源变为闭塞资源时, 对应的 类型标识由 010 变为 001 , 并生成告警指令, 如果资源分配设备能 够在显示屏上显示所有子间隙资源, 那么当第一子间隙资源的类型 变为闭塞资源后, 该告警指令, 该告警指令用于指示在显示屏上使 得该第一子间隙资源对应位置显示告警颜色, 以区别于其他子间隙 资源。  When the type of the first sub-gap resource is changed from the resource to be tested to the occlusion resource, the corresponding type identifier is changed from 010 to 001, and an alarm instruction is generated. If the resource allocation device can display all the sub-gap resources on the display screen, then After the type of the first sub-gap resource is changed to the occlusion resource, the alarm instruction is used to indicate that the first sub-gap resource corresponding position displays an alarm color on the display screen to distinguish it from other sub-gap resources.
步骤 410、 确定闭塞时间是否大于或等于第一预设时间。  Step 410: Determine whether the occlusion time is greater than or equal to the first preset time.
若闭塞时间大于或等于第一预设时间闭塞时间, 则执行步骤 404。 闭塞时间是第一子间隙资源的类型变为闭塞资源开始计时, 所 述第一子时隙资源的类型是所述闭塞资源所经历的时间。  If the occlusion time is greater than or equal to the first preset time occlusion time, step 404 is performed. The occlusion time is a time when the type of the first sub-gap resource becomes the occlusion resource, and the type of the first sub-slot resource is the time elapsed by the occlusion resource.
本发明实施例包括资源分配设备根据检测之前的第一码流和检 测后的第二码流进行对比判断, 确定每个子间隙资源的类型, 从而 为第一业务分配第一资源, 该第一资源是类型为健康资源的未占用 的子间隙资源。 这样一来, 资源分配设备在为第一用户设备分配第 一资源之前, 检测类型为待检资源的子间隙资源, 不仅节省了检测 的工作量, 也保证了为第一检测资源分配的第一资源的质量, 从而 避免了由于子间隙资源导致的业务传输中断, 提高了用户体验。  The embodiment of the present invention includes the resource allocation device performing a comparison judgment according to the first code stream before the detection and the second code stream after the detection, and determining the type of each sub-gap resource, thereby allocating the first resource, the first resource, for the first service. An unoccupied sub-gap resource of type health resource. In this way, the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource. The quality of the resources, thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
本发明实施例提供一种资源分配设备 50 , 如图 5所示, 包括: 检测单元 501 , 用于检测每个候选资源, 得到每个所述候选资 源的检测结果。 第一确定单元 502 , 用于根据所述检测单元 501 得到的每个所 述候选资源的检测结果和预设的 n 个类型的判定条件, 确定每个所 述候选资源的类型, 其中, 所述 n为大于 1 的整数。 The embodiment of the present invention provides a resource allocation device 50. As shown in FIG. 5, the method includes: a detecting unit 501, configured to detect each candidate resource, and obtain a detection result of each candidate resource. a first determining unit 502, configured to determine, according to a detection result of each candidate resource obtained by the detecting unit 501 and a preset n types of determining conditions, a type of each candidate resource, where n is an integer greater than 1.
分配单元 503 , 用于根据所述第一确定单元 502 确定的每个所 述候选资源的类型为第一业务分配与所述第一业务对应类型的第一 资源。  The allocating unit 503 is configured to allocate, according to the type of each candidate resource determined by the first determining unit 502, a first resource of a type corresponding to the first service for the first service.
这样一来, 资源分配设备不再是上层应用出现问题后, 下层逐 级检查, 而是在资源分配设备先检测每个候选资源, 再为第一业务 分配候选资源, 因此, 分配的第一资源出现错误的概率就会大大降 低, 从而上层应用出现问题的概率也会大大降低, 用户体验也相应 提升。  In this way, after the resource allocation device is no longer a problem in the upper layer application, the lower layer checks step by step, but the resource allocation device detects each candidate resource first, and then allocates candidate resources for the first service, and therefore, allocates the first resource. The probability of an error is greatly reduced, so that the probability of problems in the upper application is greatly reduced, and the user experience is correspondingly improved.
所述候选资源可以是链路资源, 也可以是 TDM 交换方式下的 子间隙资源,  The candidate resource may be a link resource or a sub-gap resource in a TDM exchange mode.
当候选资源是链路资源时, 相应的, 检测结果是丟包率, 相应的, 所述检测单元 501具体用于:  When the candidate resource is a link resource, the detection result is a packet loss rate. Correspondingly, the detecting unit 501 is specifically configured to:
对所述链路资源进行 TCP/IP协议定义的 PING检测, 得到所述 链路资源的丟包率;  Performing PING detection by using the TCP/IP protocol on the link resource, and obtaining a packet loss rate of the link resource;
或,对每个所述链路资源进行除所述 TCP/IP协议定义之外的其 他协议定义或自定义的类 PING检测, 得到所述链路资源的丟包率。  Or, performing, for each of the link resources, other protocol definitions or custom PING detections other than the definition of the TCP/IP protocol, to obtain a packet loss rate of the link resources.
TCP/IP协议定义 PING检测是通过 TCP/IP协议定义 PING命令 实现的。 具体的, 对于第一链路资源, 资源分配设备运行的 PING 命令向每个链路资源发送 4 个 ICMP ( Internet Control Message Protocol , 网间控制报文协议 ) 回送请求, 该 ICMP是 TCP/IP协议 的一个子协议, 如果一切正常, 每个链路资源就能得到 4 个 ICMP 回送应答。 资源分配设备获取预设时间内未得到 4 个 ICMP发送回 送应答的第一链路资源个数和接收回送请求的第一链路资源的个 数, 将发送未回送应答的第一链路资源个数和接收回送请求的第一 链路资源的个数的商作为第一链路资源的丟包率, 每个链路资源的 丟包率和第一链路资源的丟包率获取方法相同。 PING能够以毫秒为 单位显示发送回送请求到返回回送应答之间的时间量。 如果应答时 间短, 表示数据报不必通过太多的路由器或网络, 连接速度比较快。The TCP/IP protocol defines that the PING detection is implemented by the TCP/IP protocol defining the PING command. Specifically, for the first link resource, the PING command run by the resource allocation device sends four ICMP (Internet Control Message Protocol) echo requests to each link resource, where the ICMP is a TCP/IP protocol. A sub-protocol, if everything is ok, each link resource can get 4 ICMP echo responses. The resource allocation device acquires the number of the first link resources that do not receive the four ICMP echo reply responses and the number of the first link resources that receive the loopback request within the preset time, and sends the first link resources that have not sent back the response. The quotient of the number of the first link resources that receives the loopback request is used as the packet loss rate of the first link resource, and the packet loss rate of each link resource is the same as the packet loss rate acquisition method of the first link resource. PING can be in milliseconds The unit shows the amount of time between sending a loopback request and returning a loopback response. If the response time is short, it means that the datagram does not have to go through too many routers or networks, and the connection speed is faster.
PING的实现过程很简单, 命令将引发 IP层发送一个简单的 IP 包, 而目 的方收到这个包之后, 将源和目 的地址做一下交换, 重新发出 这个包即可, 当然还可以增加一些超时的机制。 The implementation process of PING is very simple. The command will cause the IP layer to send a simple IP packet. After receiving the packet, the destination will exchange the source and destination addresses and re-issue the packet. Of course, some timeouts can be added. Mechanisms.
对于第一链路资源, 所述检测单元 501具体用于:  For the first link resource, the detecting unit 501 is specifically configured to:
获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数;  Acquiring the number m of detection packets sent by the local end node to the opposite end node by using the first link resource in a preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 n ,所述 n是小于或等于 m 的正整数;  Acquiring the number n of the detection packets sent by the local node to the peer node by using the first link resource in the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。  (m-n) / m is used as the packet loss rate of the first link resource.
若 n等于 3 ,  If n is equal to 3,
对于第一候选资源, 所述第一确定单元 502具体用于:  For the first candidate resource, the first determining unit 502 is specifically configured to:
若所述丟包率小于或等于所述判定条件的第一阔值, 则确定所 述第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔 值和第二阔值;  If the packet loss rate is less than or equal to the first threshold of the determining condition, determining that the type of the first link resource is a high priority, and the determining condition includes the first threshold and the second threshold Value
若所述丟包率大于所述第一阔值且小于所述第二阔值, 则确定 所述第一链路资源的类型是中优先级, 所述中优先级的链路资源优 先级低于所述高优先级的链路资源;  If the packet loss rate is greater than the first threshold and less than the second threshold, determining that the type of the first link resource is a medium priority, and the medium priority priority of the link resource is low. The high priority link resource;
若所述丟包率大于或等于所述第二阔值, 则确定所述第一链路 资源的类型是低优先级, 所述低优先级的链路资源优先级低于所述 中优先级的链路资源。  If the packet loss rate is greater than or equal to the second threshold, determining that the type of the first link resource is a low priority, and the low priority link resource priority is lower than the medium priority Link resources.
所述链路资源的检测是所述 TCP/IP协议定义的 PING检测, 所述分配单元 503具体用于:  The detecting of the link resource is the PING detection defined by the TCP/IP protocol, and the allocating unit 503 is specifically configured to:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 第一业务;  Acquiring a correspondence between all services and the n types, where all services include a first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源; 从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Obtaining, according to the corresponding relationship, a link resource of a type of the first service corresponding to a high priority or a medium priority; The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
由于本实施例采用的 TCP/IP协议定义的 PING检测 , 该 PING 检测是可靠的检测, 给业务分配的链路资源可以是类型为高优先级 和中优先级的链路资源。 假设第一业务对应的是类型为中优先级的 链路资源, 资源分配设备在中优先级的链路资源中选择未占用的资 源的作为第一资源; 假设第一业务对应的是类型为中优先级或高优 先级的链路资源, 若类型为高优先级的链路资源中有未占用的资源, 则在类型为高优先级的链路资源中的未占用的资源选择出第一资 源。  Due to the PING detection defined by the TCP/IP protocol in this embodiment, the PING detection is reliable detection, and the link resources allocated to the service may be link resources of a high priority and a medium priority. Assume that the first service corresponds to a medium-priority link resource, and the resource allocation device selects an unoccupied resource as the first resource among the medium-priority link resources; If the priority or high-priority link resource has an unoccupied resource in the high-priority link resource, the first resource is selected in the unoccupied resource in the link resource of the high priority type. .
所述链路资源的检测是所述其他协议定义的类 PING检测, 所述分配单元 503具体用于:  The detecting of the link resource is a class PING detection defined by the other protocol, and the allocating unit 503 is specifically configured to:
获取所有业务和所述 n个类型的对应关系, 所述所有业务包括 所述第一业务;  Acquiring a correspondence between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、 中优先级和低优先级的链路资源至少一种;  Acquiring at least one type of link resources of the high priority, medium priority, and low priority corresponding to the first service according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。  The link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
由于本实施例采用除 TCP/IP 协议之外的协议定义或自定义的 类 PING检测 , 该类 PING检测不是可靠的检测 , 所以给业务分配的 链路资源可以是类型为高优先级、 中优先级的链路资源和低优先级 的链路资源。 示例的, 假设第一业务对应的是类型为中优先级的链 路资源, 资源分配设备在中优先级的链路资源中选择未占用的资源 的作为第一资源; 假设第一业务对应的是类型为低优先级、 中优先 级或高优先级的链路资源, 若类型为高优先级的链路资源中有未占 用的资源, 则在未占用的链路资源中选择优先级最高的资源作为第 一资源。  Since the present embodiment adopts a protocol definition other than the TCP/IP protocol or a customized PING detection, the PING detection is not reliable detection, so the link resources allocated to the service may be of a high priority and a medium priority. Level link resources and low priority link resources. For example, it is assumed that the first service corresponds to a link resource of the medium priority, and the resource allocation device selects the unoccupied resource as the first resource among the medium priority link resources; If the link resource of the type of the high-priority link resource has unoccupied resources, the resource with the highest priority is selected among the unoccupied link resources. As the first resource.
值得说明的是, 在业务建立时, 建立该业务的服务器可以向资 源分配设备发送检测启动指令, 该检测启动指令用于指示资源分配 设备检测每个待选资源, 资源分配设备开始检测, 第一种可实现方 式的检测是周期性检测, 检测周期和检测的环境和被测对象有关。 It is worth noting that, when the service is established, the server that establishes the service may send a detection start instruction to the resource allocation device, where the detection start instruction is used to indicate resource allocation. The device detects each candidate resource, and the resource allocation device starts detecting. The first achievable detection is periodic detection, and the detection period and the detected environment are related to the measured object.
特别说明的是, 本端节点和对端节点不仅可以是同一设备的两 个节点, 也可以是同一系统中本端设备的接口和对端设备的接口, 即本发明提供的设备不仅可以检测同一设备内的链路资源, 也可以 检测同一系统中的链路资源, 但是对于这类能够以系统中的物理链 路的检测, 其目 的是要使得检测覆盖到本系统内的物理链路段, 保 障本系统内的物理链路质量, 对于对端端口和中间传输设备, 无法 有效进行检测; 如果本端和对端设备是同一私有协议的, 例如 MAC ( Medium Access Control , 介质访问控制层) 协议的 PING检测和 UDP ( User Data Protocol , 用户数据报协议) 协议的 PING检测, 可 以通过私有协议检测覆盖整个物理链路; 如果本端设备和对端设备 的私有协议不同, 检测就没法检测覆盖到对端设备的链路, 只能覆 盖到本端设备的链路, 对于类似 TCP/IP协议定义的检测也是如此, 如果采用 TCP/IP协议定义的的 PING检测, 可以兼容私有协议的设 备, 如果采用类 PING检测, 则需要两端设备做私有协议交互, 其 中类 PING检测包括私有协议的这类检测。  In particular, the local node and the peer node can be not only the two nodes of the same device, but also the interface of the local device and the interface of the peer device in the same system, that is, the device provided by the present invention can not only detect the same The link resources in the device can also detect the link resources in the same system. However, for the detection of such physical links in the system, the purpose is to make the detection cover the physical link segments in the system. The physical link quality of the system is guaranteed. The peer port and the intermediate transmission device cannot be detected effectively. If the local device and the peer device are the same private protocol, for example, the MAC (Medium Access Control) protocol. The PING detection and the PING detection of the UDP (User Data Protocol) protocol can cover the entire physical link through the detection of the private protocol. If the private protocol of the local device and the peer device are different, the detection cannot detect the coverage. The link to the peer device can only cover the link to the local device. The detection of the definition of the IP protocol is also the same. If the PING detection defined by the TCP/IP protocol is used, the device can be compatible with the proprietary protocol. If the PING-based detection is used, the two devices need to perform private protocol interaction. This type of detection of the agreement.
这样一来, 资源分配设备对链路资源进行检测之后, 为第一业 务分配第一业务对应链路资源中优先级最高的链路资源, 保证了为 第一检测资源分配的第一资源的质量, 从而避免了由于链路资源导 致的第一业务的传输中断, 提高了用户体验。  In this way, after the resource allocation device detects the link resource, the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
当候选资源是 TDM 交换方式下的子间隙资源时, 相应的, 所 述检测结果是第二码流,  When the candidate resource is a sub-gap resource in the TDM switching mode, the detection result is a second code stream.
对于第一子间隙资源, 所述检测单元 501具体用于:  For the first sub-gap resource, the detecting unit 501 is specifically configured to:
在所述第一子间隙资源中插入第一码流, 所述第一子间隙资源 的类型是待检资源;  Inserting, in the first sub-gap resource, a first code stream, where the type of the first sub-gap resource is a resource to be tested;
根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。  Performing a loopback test on the transmission channel of the first sub-slot resource according to the first code stream, to obtain the second code stream.
若 n等于 3 , 对于第一候选资源, 所述第一确定单元具体用于: 判断所述第一码流和所述第二码流是否相同; If n is equal to 3, for the first candidate resource, the first determining unit is specifically configured to: Determining whether the first code stream and the second code stream are the same;
若所述第一码流和所述第二码流相同, 则将所述第一子间隙资 源的类型由所述检待资源变为健康资源;  And if the first code stream and the second code stream are the same, changing the type of the first sub-gap resource from the check resource to a health resource;
若所述第一码流和所述第二码流不相同, 判断在所述第一子间 隙资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行 所述环回检测;  If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be tested. ;
若所述第一子间隙资源是第一次进行所述环回检测, 则复位所 述第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源 进行所述环回检测;  And if the first sub-gap resource is to perform the loopback detection for the first time, resetting the first sub-slot resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again;
若所述第一子间隙资源不是第一次进行所述环回检测, 则将所 述第一子间隙资源的类型由待检资源变为闭塞资源。  If the first sub-gap resource is not the first time to perform the loopback detection, the type of the first sub-gap resource is changed from a resource to be tested to an occlusion resource.
进一步的, 如图 6所示, 所述资源分配设备 50还包括: 第二确定单元 504 , 用于确定闭塞时间是否大于或等于第一预 设时间, 所述闭塞时间是所述第一子间隙资源的类型变为闭塞资源 开始计时, 所述第一子时隙资源的类型是所述闭塞资源所经历的时 间;  Further, as shown in FIG. 6, the resource allocation device 50 further includes: a second determining unit 504, configured to determine whether an occlusion time is greater than or equal to a first preset time, where the occlusion time is the first sub-gap The type of the resource becomes a timing of the occlusion resource, and the type of the first sub-slot resource is the time elapsed by the occlusion resource;
处理单元 505 , 用于当所述第二确定单元 504 确定出所述闭塞 时间大于或等于所述第一预设时间时, 将所述第一子间隙资源的类 型由所述闭塞资源变为所述待检资源, 使得所述资源分配设备再次 对所述子间隙资源进行所述环回检测。  The processing unit 505 is configured to change, when the second determining unit 504 determines that the blocking time is greater than or equal to the first preset time, the type of the first sub-gap resource from the occlusion resource Determining the resource to be checked, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
进一步的, 初始状态下, 第一子时隙资源的类型是所述健康资 源,  Further, in the initial state, the type of the first sub-slot resource is the health resource,
如图 6所示, 所述资源分配设备 50还包括:  As shown in FIG. 6, the resource allocation device 50 further includes:
所述第二确定单元 504 , 还用于确定健康时间是否大于或等于 第二预设时间, 所述健康时间是所述子时隙资源的类型变为健康资 源开始计时, 所述子时隙资源的类型是所述健康资源所经历的时间; 第三确定单元 506 , 用于当所述第二确定单元确定出所述健康 时间大于或等于所述第二预设时间时, 确定所述第一业务是否繁忙; 所述处理单元 505 , 还用于当所述第三确定单元确定出所述第 一业务不繁忙, 则将所述第一子时隙资源的类型由所述健康资源变 为所述待检资源, 使得所述资源分配设备再次对所述第一子间隙资 源进行所述环回检测。 The second determining unit 504 is further configured to determine whether the health time is greater than or equal to a second preset time, where the health time is that the type of the sub-slot resource becomes a healthy resource start timing, and the sub-slot resource The type is the time that the health resource is experienced; the third determining unit 506 is configured to determine the first when the second determining unit determines that the health time is greater than or equal to the second preset time Whether the service is busy; the processing unit 505 is further configured to: when the third determining unit determines the first If the service is not busy, the type of the first sub-slot resource is changed from the healthy resource to the to-be-checked resource, so that the resource allocation device performs the loopback on the first sub-gap resource again. Detection.
所述分配单元 503具体用于:  The allocating unit 503 is specifically configured to:
为所述第一业务分配所述第一资源, 所述第一资源是类型为所 述健康资源的未占用的子间隙资源。  Allocating the first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
这样一来, 资源分配设备在为第一用户设备分配第一资源之前, 检测类型为待检资源的子间隙资源, 不仅节省了检测的工作量, 也 保证了为第一检测资源分配的第一资源的质量, 从而避免了由于子 间隙资源导致的业务传输中断, 提高了用户体验。  In this way, the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource. The quality of the resources, thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
特别说明的是, 本发明实施例提供的设备不仅仅检测和分配子 间隙资源和链路资源, 还可以检测和分配特定内存。 例如该资源分 配设备用于特征块读写一致性检测等等, 总而言之, 该资源分配设 备主要针对资源的可靠性要求比较高的场景。  Specifically, the device provided by the embodiment of the present invention not only detects and allocates sub-gap resources and link resources, but also detects and allocates specific memory. For example, the resource allocation device is used for feature block read/write consistency detection, etc. In summary, the resource allocation device is mainly for a scenario where resource reliability requirements are relatively high.
如图 7 , 为本发明实施例提供的又一种资源分配设备的结构示 意图, 如图所示, 该资源分配设备 60可以包括处理器 601 , 存储器 602 , 用于进行该资源分配设备 60 内部各设备之间的连接的至少一 个通信总线 603 , 用于实现这些设备之间的连接和相互通信。  FIG. 7 is a schematic structural diagram of another resource allocation device according to an embodiment of the present invention. As shown in the figure, the resource allocation device 60 may include a processor 601, and a memory 602, configured to perform internal At least one communication bus 603 for the connection between the devices is used to implement connections and mutual communication between the devices.
通信总线 603 可以是工业标准体系结构 ( Industry Standard Architecture , 简称为 ISA ) 总线、 外部设备互连 ( Peripheral Component , 简称为 PCI ) 总线或扩展工业标准体系结构 ( Extended Industry Standard Architecture , 简称为 EISA ) 总线等。 该总线 605 可以分为地址总线、 数据总线、 控制总线等。  The communication bus 603 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Wait. The bus 605 can be divided into an address bus, a data bus, a control bus, and the like.
存储器 602可以包括只读存储器和随机存取存储器, 并向处理 器 601603提供指令和数据。  Memory 602 can include read only memory and random access memory and provides instructions and data to processor 601603.
处理器 601 可以是一个中央处理器 601 ( Central Processing Unit , 简称为 CPU ) , 或者是特定集成电路 ( Application Specific Integrated Circuit , 简称为 ASIC ) , 或者是被配置成实施本发明实施 例的一个或多个集成电路。 其中, 处理器 601 用于检测每个候选资源, 得到每个所述候选 资源的检测结果; 根据每个所述候选资源的检测结果和预设的 n个 类型的判定条件, 确定每个所述候选资源的类型, 其中, 所述 n 为 大于 1 的整数; 根据每个所述候选资源的类型为第一业务分配与所 述第一业务对应类型的第一资源。 The processor 601 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more configured to implement the embodiments of the present invention. Integrated circuits. The processor 601 is configured to detect each candidate resource, and obtain a detection result of each of the candidate resources. Determine each of the candidate resources according to a detection result of each candidate resource and a preset n types of determination conditions. a type of the candidate resource, where the n is an integer greater than 1; the first resource corresponding to the first service is allocated to the first service according to the type of each candidate resource.
这样一来, 资源分配设备不再是上层应用出现问题后, 下层逐 级检查, 而是在资源分配设备先检测每个候选资源, 再为第一业务 分配候选资源, 因此, 分配的第一资源出现错误的概率就会大大降 低, 从而上层应用出现问题的概率也会大大降低, 用户体验也相应 提升。  In this way, after the resource allocation device is no longer a problem in the upper layer application, the lower layer checks step by step, but the resource allocation device detects each candidate resource first, and then allocates candidate resources for the first service, and therefore, allocates the first resource. The probability of an error is greatly reduced, so that the probability of problems in the upper application is greatly reduced, and the user experience is correspondingly improved.
所述候选资源可以包括链路资源或 TDM 变换的子间隙资源, 当所述候选资源是链路资源时, 相应的所述检测结果是丟包率, 相应的, 所述处理器 601具体用于对所述链路资源进行 TCP/IP 协议定义的 PING 检测, 得到所述链路资源的丟包率; 或, 对每个 所述链路资源进行除所述 TCP/IP 协议定义之外的其他协议定义或 自定义的类 PING检测, 得到所述链路资源的丟包率。  The candidate resource may include a link resource or a TDM-transformed sub-gap resource. When the candidate resource is a link resource, the corresponding detection result is a packet loss rate. Correspondingly, the processor 601 is specifically configured to: Performing PING detection on the link resource by using the TCP/IP protocol to obtain a packet loss rate of the link resource; or, performing, for each link resource, other than the TCP/IP protocol definition. The protocol definition or the customized class PING detection obtains the packet loss rate of the link resource.
对于第一链路资源, 所述处理器 601 具体用于: 获取预设时间 内本端节点通过所述第一链路资源向对端节点发送的检测包的次数 m , 所述 m是正整数; 获取所述预设时间内所述本端节点通过所述 第一链路资源接收到所述对端节点发送的所述检测包的次数 n , 所 述 n是小于或等于 m的正整数; 将 ( m-n ) /m作为所述第一链路资 源的丟包率。  For the first link resource, the processor 601 is specifically configured to: acquire the number m of detection packets sent by the local end node to the opposite node by using the first link resource in a preset time, where the m is a positive integer; Acquiring the number n of the detection packets sent by the local node to the peer node by using the first link resource in the preset time, where n is a positive integer less than or equal to m; ( mn ) /m is the packet loss rate of the first link resource.
所述 n是 3 , 对于第一候选资源, 所述处理器 601具体用于若所 述丟包率小于或等于所述判定条件的第一阔值, 则确定所述第一链 路资源的类型是高优先级, 所述判定条件包括所述第一阔值和第二 阔值; 若所述丟包率大于所述第一阔值且小于所述第二阔值, 则确 定所述第一链路资源的类型是中优先级, 所述中优先级的链路资源 优先级低于所述高优先级的链路资源; 若所述丟包率大于或等于所 述第二阔值, 则确定所述第一链路资源的类型是低优先级, 所述低 优先级的链路资源优先级低于所述中优先级的链路资源。 The n is 3. For the first candidate resource, the processor 601 is specifically configured to determine the type of the first link resource if the packet loss rate is less than or equal to a first threshold of the determining condition. Is a high priority, the determining condition includes the first threshold and the second threshold; if the packet loss rate is greater than the first threshold and less than the second threshold, determining the first The link resource type is a medium priority, and the medium priority link resource priority is lower than the high priority link resource; if the packet loss rate is greater than or equal to the second threshold, Determining that the type of the first link resource is a low priority, the low The priority link resource priority is lower than the medium priority link resource.
当所述链路资源的检测是所述 TCP/IP 协议定义的 PING 检测 时,  When the detection of the link resource is the PING detection defined by the TCP/IP protocol,
所述处理器 601 具体用于获取所有业务和所述 n个类型的对应 关系, 所述所有业务包括第一业务; 根据所述对应关系获取所述第 一业务对应的类型为高优先级和或中优先级的链路资源; 从所述类 型对应的所有的未占用的链路资源中选择优先级最高的链路资源作 为所述第一资源。  The processor 601 is specifically configured to obtain a correspondence between all the services and the n types, where all the services include the first service, and the type corresponding to the first service is obtained according to the corresponding relationship as a high priority and/or The medium-priority link resource; the link resource with the highest priority is selected as the first resource from all the unoccupied link resources corresponding to the type.
当所述链路资源的检测是所述其他协议定义的类 PING检测时 , 所述处理器 601 具体用于获取所有业务和所述 n个类型的对应 关系, 所述所有业务包括所述第一业务; 根据所述对应关系获取所 述第一业务对应的类型为高优先级、 中优先级和低优先级的链路资 源至少一种; 从所述类型对应的所有的未占用的链路资源中选择优 先级最高的链路资源作为所述第一资源。  The processor 601 is specifically configured to acquire a correspondence between all services and the n types, where the detection of the link resource is a PING detection of the other protocol. Obtaining, according to the corresponding relationship, at least one type of link resources of the highest priority, medium priority, and low priority corresponding to the first service; and all unoccupied link resources corresponding to the type The link resource with the highest priority is selected as the first resource.
值得说明的是, 建立该业务的服务器可以向资源分配设备发送 检测启动指令, 该检测启动指令用于指示资源分配设备检测每个待 选资源, 资源分配设备开始检测, 第一种可实现方式的检测是周期 性检测, 检测周期和检测的环境和被测对象有关。  It is to be noted that the server that establishes the service may send a detection start instruction to the resource allocation device, where the detection start instruction is used to instruct the resource allocation device to detect each candidate resource, and the resource allocation device starts detecting, the first achievable manner The detection is periodic detection, and the detection period and the detected environment are related to the measured object.
特别说明的是, 本端节点和对端节点不仅可以是同一设备的两 个节点, 也可以是同一系统中本端设备的接口和对端设备的接口, 即本发明提供的设备不仅可以检测同一设备内的链路资源, 也可以 检测同一系统中的链路资源, 但是对于这类能够以系统中的物理链 路的检测, 其目 的是要使得检测覆盖到本系统内的物理链路段, 保 障本系统内的物理链路质量, 对于对端端口和中间传输设备, 无法 有效进行检测; 如果本端和对端设备是同一私有协议的, 例如 MAC ( Medium Access Control , 介质访问控制层) 协议的 PING检测和 UDP ( User Data Protocol , 用户数据报协议) 协议的 PING检测, 可 以通过私有协议检测覆盖整个物理链路; 如果本端设备和对端设备 的私有协议不同, 检测就没法检测覆盖到对端设备的链路, 只能覆 盖到本端设备的链路, 对于类似 TCP/IP的检测也是如此, 如果采用 TCP/IP协议定义的 PING检测, 可以兼容私有协议的设备, 如果采 用类 PING检测, 则需要两端设备做私有协议交互, 其中类 PING检 测包括私有协议的这类检测。 In particular, the local node and the peer node can be not only the two nodes of the same device, but also the interface of the local device and the interface of the peer device in the same system, that is, the device provided by the present invention can not only detect the same The link resources in the device can also detect the link resources in the same system. However, for the detection of such physical links in the system, the purpose is to make the detection cover the physical link segments in the system. The physical link quality of the system is guaranteed. The peer port and the intermediate transmission device cannot be detected effectively. If the local device and the peer device are the same private protocol, for example, the MAC (Medium Access Control) protocol. The PING detection and the PING detection of the UDP (User Data Protocol) protocol can cover the entire physical link through the detection of the private protocol. If the private protocol of the local device and the peer device are different, the detection cannot detect the coverage. The link to the peer device can only be overwritten The link to the local device is the same for TCP/IP-like detection. If the PING detection defined by the TCP/IP protocol is used, the device can be compatible with the proprietary protocol. If the PING-based detection is used, the devices at both ends need to be private. Protocol interaction, where class PING detection includes such detection of proprietary protocols.
这样一来, 资源分配设备对链路资源进行检测之后, 为第一业 务分配第一业务对应链路资源中优先级最高的链路资源, 保证了为 第一检测资源分配的第一资源的质量, 从而避免了由于链路资源导 致的第一业务的传输中断, 提高了用户体验。  In this way, after the resource allocation device detects the link resource, the first service allocates the link resource with the highest priority among the link resources of the first service, and ensures the quality of the first resource allocated for the first detection resource. Therefore, the transmission interruption of the first service due to the link resource is avoided, and the user experience is improved.
当所述候选资源是 TDM 交换方式下的子间隙资源, 所述检测 结果是第二码流,  When the candidate resource is a sub-gap resource in a TDM switching mode, the detection result is a second code stream,
对于第一子间隙资源, 所述处理器 601 具体用于: 在所述第一 子间隙资源中插入第一码流, 所述第一子间隙资源的类型是待检资 源; 根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。  For the first sub-gap resource, the processor 601 is specifically configured to: insert, in the first sub-gap resource, a first code stream, where the type of the first sub-gap resource is a resource to be tested; The code stream performs a loopback test on the transmission channel of the first subslot resource to obtain the second code stream.
所述 n是 3 ,  The n is 3
对于第一候选资源, 所述处理器 601 具体用于判断所述第一码 流和所述第二码流是否相同; 若所述第一码流和所述第二码流相同, 则将所述第一子间隙资源的类型由所述检待资源变为健康资源; 若 所述第一码流和所述第二码流不相同, 判断在所述第一子间隙资源 成为待检资源之后, 所述第一子间隙资源是否是第一次进行所述环 回检测; 若所述第一子间隙资源是第一次进行所述环回检测, 则复 位所述第一子时隙资源, 使得所述资源分配设备再次对所述子间隙 资源进行所述环回检测; 若所述第一子间隙资源不是第一次进行所 述环回检测, 则将所述第一子间隙资源的类型由待检资源变为闭塞 资源。  For the first candidate resource, the processor 601 is specifically configured to determine whether the first code stream and the second code stream are the same; if the first code stream and the second code stream are the same, The type of the first sub-gap resource is changed from the check-in resource to the health resource; if the first code stream and the second code stream are different, it is determined that after the first sub-gap resource becomes the resource to be tested Whether the first sub-gap resource is the first time to perform the loopback detection; if the first sub-gap resource is the first time performing the loopback detection, resetting the first sub-slot resource, And causing the resource allocation device to perform the loopback detection on the sub-gap resource again; if the first sub-gap resource is not performing the loopback detection for the first time, the type of the first sub-gap resource is From the resource to be tested to the occlusion resource.
所述处理单元还用于确定闭塞时间是否大于或等于第一预设时 间, 所述闭塞时间是所述第一子间隙资源的类型变为闭塞资源开始 计时, 所述第一子时隙资源的类型是所述闭塞资源所经历的时间; 当所述处理器 601 确定出所述闭塞时间大于或等于所述第一预设时 间时, 将所述第一子间隙资源的类型由所述闭塞资源变为所述待检 资源, 使得所述资源分配设备再次对所述子间隙资源进行所述环回 检测。 The processing unit is further configured to determine whether the occlusion time is greater than or equal to a first preset time, where the occlusion time is that the type of the first sub-gap resource becomes a occlusion resource start timing, and the first sub-slot resource Type is the time elapsed by the occlusion resource; when the processor 601 determines that the occlusion time is greater than or equal to the first preset During the time interval, the type of the first sub-gap resource is changed from the occlusion resource to the to-be-detected resource, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
初始状态下, 第一子时隙资源的类型是所述健康资源,  In an initial state, the type of the first sub-slot resource is the healthy resource,
所述处理器 601 还用于确定健康时间是否大于或等于第二预设 时间, 所述健康时间是所述子时隙资源的类型变为健康资源开始计 时, 所述子时隙资源的类型是所述健康资源所经历的时间; 当所述 处理器 601 确定出所述健康时间大于或等于所述第二预设时间时, 确定所述第一业务是否繁忙; 当所述处理器 601 确定出所述第一业 务不繁忙, 则将所述第一子时隙资源的类型由所述健康资源变为所 述待检资源, 使得所述资源分配设备再次对所述第一子间隙资源进 行所述环回检测。  The processor 601 is further configured to determine whether the health time is greater than or equal to a second preset time, where the health time is a time when the type of the sub-slot resource becomes a health resource, and the type of the sub-slot resource is The time elapsed by the health resource; when the processor 601 determines that the health time is greater than or equal to the second preset time, determining whether the first service is busy; when the processor 601 determines If the first service is not busy, the type of the first sub-slot resource is changed from the healthy resource to the to-be-checked resource, so that the resource allocation device performs the first sub-gap resource again. Loopback detection.
所述处理器 601 具体用于为所述第一业务分配所述第一资源, 所述第一资源是类型为所述健康资源的未占用的子间隙资源。  The processor 601 is specifically configured to allocate the first resource to the first service, where the first resource is an unoccupied sub-gap resource of the type of the healthy resource.
这样一来,资源分配设备在为第一用户设备分配第一资源之前, 检测类型为待检资源的子间隙资源, 不仅节省了检测的工作量, 也 保证了为第一检测资源分配的第一资源的质量, 从而避免了由于子 间隙资源导致的业务传输中断, 提高了用户体验。  In this way, the resource allocation device detects the sub-gap resource of the type to be tested before the first resource is allocated to the first user equipment, which not only saves the workload of the detection but also ensures the first allocation of the first detection resource. The quality of the resources, thereby avoiding the interruption of service transmission caused by the sub-gap resources and improving the user experience.
特别说明的是, 本发明实施例提供的设备不仅仅检测和分配子 间隙资源和链路资源, 还可以检测和分配特定内存。 例如该资源分 配设备用于特征块读写一致性检测等等, 总而言之, 该资源分配设 备主要针对资源的可靠性要求比较高的场景。  Specifically, the device provided by the embodiment of the present invention not only detects and allocates sub-gap resources and link resources, but also detects and allocates specific memory. For example, the resource allocation device is used for feature block read/write consistency detection, etc. In summary, the resource allocation device is mainly for a scenario where resource reliability requirements are relatively high.
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统, 装置和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置 实施例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑 功能划分, 实际实现时可以有另外的划分方式, 例如多个单元或组 件可以结合或者可以集成到另一个系统, 或一些特征可以忽略, 或 不执行。 另一点, 所显示或讨论的相互之间的耦合或直接耦合或通 信连接可以是通过一些接口, 装置或单元的间接耦合或通信连接, 可以是电性或其它的形式。 In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, It can be in electrical or other form.
需要说明的是, 本发明实施例提供的资源分配方法步骤的先后 顺序可以进行适当调整, 步骤也可以根据情况进行相应增减, 任何 熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想 到变化的方法, 都应涵盖在本发明的保护范围之内, 因此不再赘述。  It should be noted that the sequence of the steps of the resource allocation method provided by the embodiment of the present invention may be appropriately adjusted, and the steps may also be correspondingly increased or decreased according to the situation, and any person skilled in the art may be within the technical scope disclosed by the present invention. Methods that can be easily conceived of variations are encompassed within the scope of the present invention and therefore will not be described again.
另外, 在本发明各个实施例中的各功能单元可以集成在一个处 理单元中, 也可以是各个单元单独物理包括, 也可以两个或两个以 上单元集成在一个单元中。 上述集成的单元既可以采用硬件的形式 实现, 也可以采用硬件加软件功能单元的形式实现。  In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元, 可以存储在一 个计算机可读取存储介质中。 上述软件功能单元存储在一个存储介 质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 执行本发明各个实施例所述方法的部分 步骤。 而前述的存储介质包括: U 盘、 移动硬盘、 只读存储器 ( Read-Only Memory ,简称 ROM )、随机存取存储器( Random Access Memory , 简称 RAM )、 磁碟或者光盘等各种可以存储程序代码的介 最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术人员应当理解: 其依然可以对前述各实施例所记 载的技术方案进行修改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本发明各实 施例技术方案的精神和范围。  The above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium. The software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform portions of the steps of the various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a disk or an optical disk, and the like, which can store program codes. It should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the spirit of the technical solutions of the embodiments of the present invention. range.

Claims

权 利 要 求 书 claims
1、 一种资源分配方法, 其特征在于, 应用于资源分配设备, 包 括: 1. A resource allocation method, characterized in that it is applied to resource allocation equipment, including:
检测每个候选资源, 得到每个所述候选资源的检测结果; 根据每个所述候选资源的检测结果和预设的 n 个类型的判定条 件, 确定每个所述候选资源的类型, 其中, 所述 n为大于 1 的整数; 根据每个所述候选资源的类型为第一业务分配与所述第一业务 对应类型的第一资源。 Detect each candidate resource to obtain the detection result of each candidate resource; determine the type of each candidate resource according to the detection result of each candidate resource and the preset judgment conditions of n types, where, The n is an integer greater than 1; according to the type of each candidate resource, a first resource of a type corresponding to the first service is allocated to the first service.
2、 根据权利要求 1 所述的资源分配方法, 其特征在于, 所述候 选资源是链路资源, 所述检测结果是丟包率, 2. The resource allocation method according to claim 1, wherein the candidate resource is a link resource, and the detection result is a packet loss rate,
相应的, 所述检测每个候选资源, 得到每个所述候选资源的检测 结果, 包括: Correspondingly, detecting each candidate resource and obtaining detection results for each candidate resource include:
对所述链路资源进行传输控制协议 /因特网互联协议定义的因特 网包探索器 PING检测, 得到所述链路资源的丟包率; Perform PING detection on the link resource using an Internet packet explorer defined by the Transmission Control Protocol/Internet Protocol to obtain the packet loss rate of the link resource;
或, 对每个所述链路资源进行除所述传输控制协议 /因特网互联 协议定义之外的其他协议定义或自定义的类 PING检测, 得到所述链 路资源的丟包率。 Or, perform other protocol definitions or customized PING-like detection in addition to the Transmission Control Protocol/Internet Protocol definition on each of the link resources to obtain the packet loss rate of the link resource.
3、 根据权利要求 2所述的资源分配方法, 其特征在于, 对于第 一链路资源, 所述对所述第一链路资源进行除所述传输控制协议 /因 特网互联协议定义之外的其他协议定义或自定义的类 PING检测, 得 到所述链路资源的丟包率, 包括: 3. The resource allocation method according to claim 2, characterized in that, for the first link resource, the first link resource is subjected to other operations other than the transmission control protocol/Internet protocol definition. Protocol-defined or customized PING-like detection is used to obtain the packet loss rate of the link resource, including:
获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数; Obtain the number m of detection packets sent by the local node to the opposite node through the first link resource within the preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 n , 所述 n是小于或等于 m 的正整数; Obtain the number of times n that the local node receives the detection packet sent by the opposite node through the first link resource within the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。 Let (m-n)/m be the packet loss rate of the first link resource.
4、 根据权利要求 3 所述的资源分配方法, 其特征在于, 所述 n 是 3 , 对于第一候选资源,所述根据所述第一候选资源的质量和预设的 n个类型的判定条件, 确定所述第一候选资源的类型, 包括: 4. The resource allocation method according to claim 3, wherein n is 3, For the first candidate resource, determining the type of the first candidate resource based on the quality of the first candidate resource and preset judgment conditions of n types includes:
若所述丟包率小于或等于所述判定条件的第一阈值,则确定所述 第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔值和 第二阔值; If the packet loss rate is less than or equal to the first threshold of the determination condition, it is determined that the type of the first link resource is high priority. The determination condition includes the first threshold and the second threshold. ;
若所述丟包率大于所述第一阈值且小于所述第二阈值,则确定所 述第一链路资源的类型是中优先级, 所述中优先级的链路资源优先级 低于所述高优先级的链路资源; If the packet loss rate is greater than the first threshold and less than the second threshold, it is determined that the type of the first link resource is medium priority, and the priority of the medium priority link resource is lower than that of the first link resource. Describe high-priority link resources;
若所述丟包率大于或等于所述第二阔值,则确定所述第一链路资 源的类型是低优先级, 所述低优先级的链路资源优先级低于所述中优 先级的链路资源。 If the packet loss rate is greater than or equal to the second threshold, it is determined that the type of the first link resource is low priority, and the priority of the low priority link resource is lower than the medium priority. link resources.
5、 根据权利要求 4所述的资源分配方法, 其特征在于, 所述链 路资源的检测是所述传输控制协议 /因特网互联协议定义的 PING 检 测, 5. The resource allocation method according to claim 4, characterized in that the detection of the link resource is the PING detection defined by the transmission control protocol/Internet protocol,
所述根据每个所述候选资源的类型为第一业务分配与所述第一 业务对应类型的第一资源, 包括: Allocating a first resource of a type corresponding to the first service to the first service according to the type of each candidate resource includes:
获取所有业务和所述 n个类型的对应关系,所述所有业务包括第 一业务; Obtain the corresponding relationships between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源; Obtain the link resources corresponding to the first service type as high priority and or medium priority according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Select the link resource with the highest priority from all unoccupied link resources corresponding to the type as the first resource.
6、 根据权利要求 4所述的资源分配方法, 其特征在于, 所述链 路资源的检测是所述其他协议定义的类 PING检测, 6. The resource allocation method according to claim 4, characterized in that the detection of the link resources is a PING-like detection defined by the other protocols,
所述根据每个所述候选资源的类型为第一业务分配与所述第一 业务对应类型的第一资源, 包括: Allocating a first resource of a type corresponding to the first service to the first service according to the type of each candidate resource includes:
获取所有业务和所述 n个类型的对应关系,所述所有业务包括所 述第一业务; Obtain the corresponding relationships between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、中 优先级和低优先级的链路资源至少一种; According to the corresponding relationship, the type corresponding to the first service is obtained as high priority, medium At least one priority and low-priority link resource;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Select the link resource with the highest priority from all unoccupied link resources corresponding to the type as the first resource.
7、 根据权利要求 1 所述的资源分配方法, 其特征在于, 所述候 选资源是时分复用模式 TDM交换方式下的子间隙资源, 所述检测结 果是第二码流, 7. The resource allocation method according to claim 1, characterized in that, the candidate resources are sub-gap resources in time division multiplexing mode TDM switching mode, and the detection result is the second code stream,
对于第一子间隙资源, 所述检测所述第一子间隙资源, 得到所述 第一子间隙资源的检测结果, 包括: For the first sub-gap resource, detecting the first sub-gap resource and obtaining the detection result of the first sub-gap resource includes:
在所述第一子间隙资源中插入第一码流,所述第一子间隙资源的 类型是待检资源; Insert a first code stream into the first sub-gap resource, and the type of the first sub-gap resource is a resource to be inspected;
根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。 Perform a loopback test on the transmission channel of the first sub-slot resource according to the first code stream to obtain the second code stream.
8、 根据权利要求 7 所述的资源分配方法, 其特征在于, 所述 n 是 3 , 8. The resource allocation method according to claim 7, wherein n is 3,
对于第一候选资源,所述根据所述第一候选资源的检测结果和预 设的 n个类型的判定条件, 确定所述第一候选资源的类型, 包括: 判断所述第一码流和所述第二码流是否相同; For the first candidate resource, determining the type of the first candidate resource based on the detection result of the first candidate resource and preset judgment conditions of n types includes: judging the first code stream and the Whether the second code stream is the same;
若所述第一码流和所述第二码流相同,则将所述第一子间隙资源 的类型由所述检待资源变为健康资源; If the first code stream and the second code stream are the same, then change the type of the first sub-gap resource from the waiting resource to a healthy resource;
若所述第一码流和所述第二码流不相同,判断在所述第一子间隙 资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行所述 环回检测; If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be detected. ;
若所述第一子间隙资源是第一次进行所述环回检测,则复位所述 第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源进行 所述环回检测; If the first sub-slot resource is used for the loopback detection for the first time, the first sub-slot resource is reset so that the resource allocation device performs the loopback detection on the sub-slot resource again;
若所述第一子间隙资源不是第一次进行所述环回检测,则将所述 第一子间隙资源的类型由待检资源变为闭塞资源。 If the first sub-gap resource is not used for the loopback detection for the first time, the type of the first sub-gap resource is changed from the undetected resource to the blocked resource.
9、 根据权利要求 8所述的资源分配方法, 其特征在于, 所述第 一子间隙资源的类型由所述待检资源变为闭塞资源之后, 所述资源分 配方法还包括: 9. The resource allocation method according to claim 8, characterized in that, after the type of the first sub-gap resource changes from the unchecked resource to the blocked resource, the resource allocation method Preparation methods also include:
确定闭塞时间是否大于或等于第一预设时间,所述闭塞时间是所 述第一子间隙资源的类型变为闭塞资源开始计时, 所述第一子时隙资 源的类型是所述闭塞资源所经历的时间; Determine whether the blocking time is greater than or equal to a first preset time, the blocking time is the time when the type of the first sub-slot resource changes to the blocking resource, and the type of the first sub-slot resource is the type of the blocking resource. time experienced;
若所述闭塞时间大于或等于所述第一预设时间,将所述第一子间 隙资源的类型由所述闭塞资源变为所述待检资源, 使得所述资源分配 设备再次对所述子间隙资源进行所述环回检测。 If the blocking time is greater than or equal to the first preset time, the type of the first sub-gap resource is changed from the blocking resource to the to-be-checked resource, so that the resource allocation device assigns the sub-gap resource again. Gap resources perform the loopback detection.
10、 根据权利要求 9所述的资源分配方法, 其特征在于, 初始状 态下, 第一子时隙资源的类型是所述健康资源, 10. The resource allocation method according to claim 9, characterized in that, in the initial state, the type of the first sub-slot resource is the healthy resource,
在所述将第一子时隙资源的类型变为所述健康资源或所述将所 述第一子间隙资源的类型由所述检待资源变为健康资源之后, 所述资 源分配方法还包括: After the type of the first sub-slot resource is changed to the healthy resource or the type of the first sub-slot resource is changed from the waiting resource to the healthy resource, the resource allocation method further includes :
确定健康时间是否大于或等于第二预设时间,所述健康时间是所 述子时隙资源的类型变为健康资源开始计时, 所述子时隙资源的类型 是所述健康资源所经历的时间; Determine whether the healthy time is greater than or equal to the second preset time, the healthy time is the time when the type of the sub-slot resource changes to a healthy resource, and the type of the sub-slot resource is the time experienced by the healthy resource ;
若所述健康时间大于或等于所述第二预设时间,确定所述第一业 务是否繁忙; If the healthy time is greater than or equal to the second preset time, determine whether the first business is busy;
若所述第一业务不繁忙,则将所述第一子时隙资源的类型由所述 健康资源变为所述待检资源, 使得所述资源分配设备再次对所述第一 子间隙资源进行所述环回检测。 If the first service is not busy, the type of the first sub-slot resource is changed from the healthy resource to the pending resource, so that the resource allocation device performs the processing on the first sub-slot resource again. The loopback detection.
1 1、 根据权利要求 10所述的资源分配方法, 其特征在于, 所述 根据每个所述候选资源的类型为第一业务分配与所述第一业务对应 类型的第一资源, 包括: 11. The resource allocation method according to claim 10, characterized in that: allocating a first resource of a type corresponding to the first service to the first service according to the type of each candidate resource, including:
为所述第一业务分配所述第一资源,所述第一资源是类型为所述 健康资源的未占用的子间隙资源。 The first resource is allocated to the first service, and the first resource is an unoccupied sub-gap resource of the type healthy resource.
12、 一种资源分配设备, 其特征在于, 包括: 12. A resource allocation device, characterized by including:
检测单元, 用于检测每个候选资源, 得到每个所述候选资源的检 测结果; A detection unit, used to detect each candidate resource and obtain the detection result of each candidate resource;
第一确定单元,用于根据所述检测单元得到的每个所述候选资源 的检测结果和预设的 n个类型的判定条件, 确定每个所述候选资源的 类型, 其中, 所述 n为大于 1 的整数; A first determining unit configured to obtain each candidate resource according to the detection unit Determine the type of each candidate resource based on the detection results and preset judgment conditions of n types, where n is an integer greater than 1;
分配单元,用于根据所述第一确定单元确定的每个所述候选资源 的类型为第一业务分配与所述第一业务对应类型的第一资源。 An allocating unit, configured to allocate a first resource of a type corresponding to the first service to the first service according to the type of each candidate resource determined by the first determining unit.
13、 根据权利要求 12所述的资源分配设备, 其特征在于, 所述 候选资源是链路资源, 所述检测结果是丟包率, 13. The resource allocation device according to claim 12, wherein the candidate resource is a link resource, and the detection result is a packet loss rate,
相应的, 所述检测单元具体用于: Correspondingly, the detection unit is specifically used for:
对所述链路资源进行传输控制协议 /因特网互联协议定义的 PING检测, 得到所述链路资源的丟包率; Perform PING detection defined by Transmission Control Protocol/Internet Protocol on the link resource to obtain the packet loss rate of the link resource;
或, 对每个所述链路资源进行除所述传输控制协议 /因特网互联 协议定义之外的其他协议定义或自定义的类 PING检测, 得到所述链 路资源的丟包率。 Or, perform other protocol definitions or customized PING-like detection in addition to the Transmission Control Protocol/Internet Protocol definition on each of the link resources to obtain the packet loss rate of the link resource.
14、 根据权利要求 13 所述的资源分配设备, 其特征在于, 对于 第一链路资源, 所述检测单元具体用于: 14. The resource allocation device according to claim 13, characterized in that, for the first link resource, the detection unit is specifically used to:
获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数; Obtain the number m of detection packets sent by the local node to the opposite node through the first link resource within the preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 n , 所述 n是小于或等于 m 的正整数; Obtain the number of times n that the local node receives the detection packet sent by the opposite node through the first link resource within the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。 Let (m-n)/m be the packet loss rate of the first link resource.
15、 根据权利要求 14所述的资源分配设备, 其特征在于, 所述 ϋ是 3 , 15. The resource allocation device according to claim 14, characterized in that, said ϋ is 3,
对于第一候选资源, 所述第一确定单元具体用于: For the first candidate resource, the first determining unit is specifically used to:
若所述丟包率小于或等于所述判定条件的第一阈值,则确定所述 第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔值和 第二阔值; If the packet loss rate is less than or equal to the first threshold of the determination condition, it is determined that the type of the first link resource is high priority. The determination condition includes the first threshold and the second threshold. ;
若所述丟包率大于所述第一阈值且小于所述第二阈值,则确定所 述第一链路资源的类型是中优先级, 所述中优先级的链路资源优先级 低于所述高优先级的链路资源; 若所述丟包率大于或等于所述第二阔值,则确定所述第一链路资 源的类型是低优先级, 所述低优先级的链路资源优先级低于所述中优 先级的链路资源。 If the packet loss rate is greater than the first threshold and less than the second threshold, it is determined that the type of the first link resource is medium priority, and the priority of the medium priority link resource is lower than that of the first link resource. Describe high-priority link resources; If the packet loss rate is greater than or equal to the second threshold, it is determined that the type of the first link resource is low priority, and the priority of the low priority link resource is lower than the medium priority. link resources.
16、 根据权利要求 15所述的资源分配设备, 其特征在于, 所述 链路资源的检测是所述传输控制协议 /因特网互联协议定义的 PING 检测, 16. The resource allocation device according to claim 15, characterized in that the detection of the link resource is the PING detection defined by the transmission control protocol/Internet protocol,
所述分配单元具体用于: The distribution unit is specifically used for:
获取所有业务和所述 n个类型的对应关系,所述所有业务包括第 一业务; Obtain the corresponding relationships between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源; Obtain the link resources corresponding to the first service type as high priority and or medium priority according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Select the link resource with the highest priority from all unoccupied link resources corresponding to the type as the first resource.
17、 根据权利要求 15所述的资源分配设备, 其特征在于, 所述 链路资源的检测是所述其他协议定义的类 P I N G检测, 17. The resource allocation device according to claim 15, characterized in that the detection of link resources is a PING-like detection defined by the other protocols,
所述分配单元具体用于: The distribution unit is specifically used for:
获取所有业务和所述 n个类型的对应关系,所述所有业务包括所 述第一业务; Obtain the corresponding relationships between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、中 优先级和低优先级的链路资源至少一种; Obtain at least one type of link resource corresponding to the first service, which is high priority, medium priority, or low priority, according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Select the link resource with the highest priority from all unoccupied link resources corresponding to the type as the first resource.
18、 根据权利要求 12所述的资源分配设备, 其特征在于, 所述 候选资源是 TDM交换方式下的子间隙资源, 所述检测结果是第二码 流 , 18. The resource allocation device according to claim 12, wherein the candidate resource is a sub-gap resource in TDM switching mode, and the detection result is the second code stream,
对于第一子间隙资源, 所述检测单元具体用于: For the first sub-gap resource, the detection unit is specifically used to:
在所述第一子间隙资源中插入第一码流,所述第一子间隙资源的 类型是待检资源; Insert a first code stream into the first sub-gap resource, and the type of the first sub-gap resource is a resource to be inspected;
根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。 Loopback the transmission channel of the first sub-slot resource according to the first code stream Test to obtain the second code stream.
19、 根据权利要求 18所述的资源分配设备, 其特征在于, 所述 ϋ是 3 , 19. The resource allocation device according to claim 18, characterized in that, said ϋ is 3,
对于第一候选资源, 所述第一确定单元具体用于: For the first candidate resource, the first determining unit is specifically used to:
判断所述第一码流和所述第二码流是否相同; Determine whether the first code stream and the second code stream are the same;
若所述第一码流和所述第二码流相同,则将所述第一子间隙资源 的类型由所述检待资源变为健康资源; If the first code stream and the second code stream are the same, then change the type of the first sub-gap resource from the waiting resource to a healthy resource;
若所述第一码流和所述第二码流不相同,判断在所述第一子间隙 资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行所述 环回检测; If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be detected. ;
若所述第一子间隙资源是第一次进行所述环回检测,则复位所述 第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源进行 所述环回检测; If the first sub-slot resource is used for the loopback detection for the first time, the first sub-slot resource is reset so that the resource allocation device performs the loopback detection on the sub-slot resource again;
若所述第一子间隙资源不是第一次进行所述环回检测,则将所述 第一子间隙资源的类型由待检资源变为闭塞资源。 If the first sub-gap resource is not used for the loopback detection for the first time, the type of the first sub-gap resource is changed from the undetected resource to the blocked resource.
20、 根据权利要求 19所述的资源分配设备, 其特征在于, 所述 资源分配设备还包括: 20. The resource allocation device according to claim 19, characterized in that the resource allocation device further includes:
第二确定单元, 用于确定闭塞时间是否大于或等于第一预设时 间, 所述闭塞时间是所述第一子间隙资源的类型变为闭塞资源开始计 时, 所述第一子时隙资源的类型是所述闭塞资源所经历的时间; 处理单元,用于当所述第二确定单元确定出所述闭塞时间大于或 等于所述第一预设时间时, 将所述第一子间隙资源的类型由所述闭塞 资源变为所述待检资源, 使得所述资源分配设备再次对所述子间隙资 源进行所述环回检测。 The second determination unit is used to determine whether the blocking time is greater than or equal to the first preset time, the blocking time is the time when the type of the first sub-slot resource changes to the blocking resource, and the first sub-slot resource The type is the time experienced by the blocked resource; a processing unit configured to, when the second determining unit determines that the blocked time is greater than or equal to the first preset time, change the first sub-gap resource to The type changes from the blocked resource to the resource to be detected, so that the resource allocation device performs the loopback detection on the sub-gap resource again.
21、 根据权利要求 20所述的资源分配设备, 其特征在于, 初始 状态下, 第一子时隙资源的类型是所述健康资源, 21. The resource allocation device according to claim 20, characterized in that, in the initial state, the type of the first sub-slot resource is the healthy resource,
所述资源分配设备还包括: The resource allocation device also includes:
所述第二确定单元,还用于确定健康时间是否大于或等于第二预 设时间, 所述健康时间是所述子时隙资源的类型变为健康资源开始计 时, 所述子时隙资源的类型是所述健康资源所经历的时间; 第三确定单元,用于当所述第二确定单元确定出所述健康时间大 于或等于所述第二预设时间时, 确定所述第一业务是否繁忙; The second determining unit is also used to determine whether the healthy time is greater than or equal to a second preset time, and the healthy time is when the type of the sub-slot resource changes to a healthy resource. when the type of the sub-slot resource is the time experienced by the healthy resource; a third determining unit, configured to determine when the second determining unit determines that the healthy time is greater than or equal to the second preset time when, determine whether the first business is busy;
所述处理单元,还用于当所述第三确定单元确定出所述第一业务 不繁忙, 则将所述第一子时隙资源的类型由所述健康资源变为所述待 检资源, 使得所述资源分配设备再次对所述第一子间隙资源进行所述 环回检测。 The processing unit is further configured to change the type of the first sub-slot resource from the healthy resource to the pending resource when the third determining unit determines that the first service is not busy, The resource allocation device is caused to perform the loopback detection on the first sub-gap resource again.
22、 根据权利要求 21 所述的资源分配设备, 其特征在于, 所述 分配单元具体用于: 22. The resource allocation device according to claim 21, characterized in that the allocation unit is specifically used for:
为所述第一业务分配所述第一资源,所述第一资源是类型为所述 健康资源的未占用的子间隙资源。 The first resource is allocated to the first service, and the first resource is an unoccupied sub-gap resource of the type healthy resource.
23、 一种资源分配设备, 其特征在于, 包括: 23. A resource allocation device, characterized by including:
处理器, 用于检测每个候选资源, 得到每个所述候选资源的检测 结果; A processor, configured to detect each candidate resource and obtain the detection result of each candidate resource;
所述处理器,还用于根据每个所述候选资源的检测结果和预设的 n个类型的判定条件, 确定每个所述候选资源的类型, 其中, 所述 n 为大于 1 的整数; The processor is further configured to determine the type of each candidate resource based on the detection results of each candidate resource and preset judgment conditions of n types, where n is an integer greater than 1;
所述处理器,还用于根据每个所述候选资源的类型为第一业务分 配与所述第一业务对应类型的第一资源。 The processor is further configured to allocate a first resource of a type corresponding to the first service to the first service according to the type of each candidate resource.
24、 根据权利要求 23 所述的资源分配设备, 其特征在于, 所述 候选资源是链路资源, 所述检测结果是丟包率, 24. The resource allocation device according to claim 23, wherein the candidate resource is a link resource, and the detection result is a packet loss rate,
相应的, 所述处理器具体用于: Correspondingly, the processor is specifically used for:
对所述链路资源进行传输控制协议 /因特网互联协议定义的 PING检测, 得到所述链路资源的丟包率; Perform PING detection defined by Transmission Control Protocol/Internet Protocol on the link resource to obtain the packet loss rate of the link resource;
或, 对每个所述链路资源进行除所述传输控制协议 /因特网互联 协议定义之外的其他协议定义或自定义的类 PING检测, 得到所述链 路资源的丟包率。 Or, perform other protocol definitions or customized PING-like detection in addition to the Transmission Control Protocol/Internet Protocol definition on each of the link resources to obtain the packet loss rate of the link resource.
25、 根据权利要求 24所述的资源分配设备, 其特征在于, 对于 第一链路资源, 所述处理器具体用于: 获取预设时间内本端节点通过所述第一链路资源向对端节点发 送的检测包的次数 m , 所述 m是正整数; 25. The resource allocation device according to claim 24, characterized in that, for the first link resource, the processor is specifically configured to: Obtain the number m of detection packets sent by the local node to the opposite node through the first link resource within a preset time, where m is a positive integer;
获取所述预设时间内所述本端节点通过所述第一链路资源接收 到所述对端节点发送的所述检测包的次数 η , 所述 n是小于或等于 m 的正整数; Obtain the number of times n that the local node receives the detection packet sent by the opposite node through the first link resource within the preset time, where n is a positive integer less than or equal to m;
将 ( m-n ) /m作为所述第一链路资源的丟包率。 Let (m-n)/m be the packet loss rate of the first link resource.
26、 根据权利要求 25所述的资源分配设备, 其特征在于, 所述 ϋ是 3 , 26. The resource allocation device according to claim 25, characterized in that, said ϋ is 3,
对于第一候选资源, 所述处理器具体用于: For the first candidate resource, the processor is specifically used to:
若所述丟包率小于或等于所述判定条件的第一阈值,则确定所述 第一链路资源的类型是高优先级, 所述判定条件包括所述第一阔值和 第二阔值; If the packet loss rate is less than or equal to the first threshold of the determination condition, it is determined that the type of the first link resource is high priority. The determination condition includes the first threshold and the second threshold. ;
若所述丟包率大于所述第一阈值且小于所述第二阈值,则确定所 述第一链路资源的类型是中优先级, 所述中优先级的链路资源优先级 低于所述高优先级的链路资源; If the packet loss rate is greater than the first threshold and less than the second threshold, it is determined that the type of the first link resource is medium priority, and the priority of the medium priority link resource is lower than that of the first link resource. Describe high-priority link resources;
若所述丟包率大于或等于所述第二阔值,则确定所述第一链路资 源的类型是低优先级, 所述低优先级的链路资源优先级低于所述中优 先级的链路资源。 If the packet loss rate is greater than or equal to the second threshold, it is determined that the type of the first link resource is low priority, and the priority of the low priority link resource is lower than the medium priority. link resources.
27、 根据权利要求 26所述的资源分配设备, 其特征在于, 所述 链路资源的检测是所述传输控制协议 /因特网互联协议定义的 PING 检测, 27. The resource allocation device according to claim 26, characterized in that the detection of the link resources is the PING detection defined by the transmission control protocol/Internet protocol,
所述处理器具体用于: The processor is specifically used for:
获取所有业务和所述 n个类型的对应关系,所述所有业务包括第 一业务; Obtain the corresponding relationships between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级和 或中优先级的链路资源; Obtain the link resources corresponding to the first service type as high priority and or medium priority according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Select the link resource with the highest priority from all unoccupied link resources corresponding to the type as the first resource.
28、 根据权利要求 26所述的资源分配设备, 其特征在于, 所述 链路资源的检测是所述其他协议定义的类 P I N G检测, 28. The resource allocation device according to claim 26, characterized in that: The detection of link resources is a PING-like detection defined by other protocols.
所述处理器具体用于: The processor is specifically used for:
获取所有业务和所述 n个类型的对应关系,所述所有业务包括所 述第一业务; Obtain the corresponding relationships between all services and the n types, where all services include the first service;
根据所述对应关系获取所述第一业务对应的类型为高优先级、中 优先级和低优先级的链路资源至少一种; Obtain at least one type of link resource corresponding to the first service, which is high priority, medium priority, or low priority, according to the corresponding relationship;
从所述类型对应的所有的未占用的链路资源中选择优先级最高 的链路资源作为所述第一资源。 Select the link resource with the highest priority from all unoccupied link resources corresponding to the type as the first resource.
29、 根据权利要求 23 所述的资源分配设备, 其特征在于, 所述 候选资源是 TDM交换方式下的子间隙资源, 所述检测结果是第二码 流 , 29. The resource allocation device according to claim 23, wherein the candidate resource is a sub-gap resource in TDM switching mode, and the detection result is the second code stream,
对于第一子间隙资源, 所述处理器具体用于: For the first sub-gap resource, the processor is specifically used to:
在所述第一子间隙资源中插入第一码流,所述第一子间隙资源的 类型是待检资源; Insert a first code stream into the first sub-gap resource, and the type of the first sub-gap resource is a resource to be inspected;
根据所述第一码流对所述第一子时隙资源的传输通道进行环回 测试, 得到所述第二码流。 Perform a loopback test on the transmission channel of the first sub-slot resource according to the first code stream to obtain the second code stream.
30、 根据权利要求 29所述的资源分配设备, 其特征在于, 所述 ϋ是 3 , 30. The resource allocation device according to claim 29, characterized in that, said ϋ is 3,
对于第一候选资源, 所述处理器具体用于: For the first candidate resource, the processor is specifically used to:
判断所述第一码流和所述第二码流是否相同; Determine whether the first code stream and the second code stream are the same;
若所述第一码流和所述第二码流相同,则将所述第一子间隙资源 的类型由所述检待资源变为健康资源; If the first code stream and the second code stream are the same, then change the type of the first sub-gap resource from the waiting resource to a healthy resource;
若所述第一码流和所述第二码流不相同,判断在所述第一子间隙 资源成为待检资源之后, 所述第一子间隙资源是否是第一次进行所述 环回检测; If the first code stream and the second code stream are different, determine whether the first sub-gap resource is the first time to perform the loopback detection after the first sub-gap resource becomes a resource to be detected. ;
若所述第一子间隙资源是第一次进行所述环回检测,则复位所述 第一子时隙资源, 使得所述资源分配设备再次对所述子间隙资源进行 所述环回检测; If the first sub-slot resource is used for the loopback detection for the first time, the first sub-slot resource is reset so that the resource allocation device performs the loopback detection on the sub-slot resource again;
若所述第一子间隙资源不是第一次进行所述环回检测,则将所述 第一子间隙资源的类型由待检资源变为闭塞资源。 If the first sub-gap resource performs the loopback detection for the first time, the The type of the first sub-gap resource changes from the unchecked resource to the blocked resource.
3 1、 根据权利要求 30所述的资源分配设备, 其特征在于, 所述 资源分配设备还包括: 31. The resource allocation device according to claim 30, characterized in that the resource allocation device further includes:
所述处理器, 还用于确定闭塞时间是否大于或等于第一预设时 间, 所述闭塞时间是所述第一子间隙资源的类型变为闭塞资源开始计 时, 所述第一子时隙资源的类型是所述闭塞资源所经历的时间; The processor is also configured to determine whether the blocking time is greater than or equal to a first preset time. The blocking time is when the type of the first sub-slot resource changes to a blocking resource. The first sub-slot resource The type is the time experienced by the occlusion resource;
所述处理器,还用于当所述处理器确定出所述闭塞时间大于或等 于所述第一预设时间时, 将所述第一子间隙资源的类型由所述闭塞资 源变为所述待检资源, 使得所述资源分配设备再次对所述子间隙资源 进行所述环回检测。 The processor is further configured to, when the processor determines that the blocking time is greater than or equal to the first preset time, change the type of the first sub-gap resource from the blocking resource to the The resource to be checked causes the resource allocation device to perform the loopback detection on the sub-gap resource again.
32、 根据权利要求 3 1 所述的资源分配设备, 其特征在于, 初始 状态下, 第一子时隙资源的类型是所述健康资源, 32. The resource allocation device according to claim 31, characterized in that, in the initial state, the type of the first sub-slot resource is the healthy resource,
所述资源分配设备还包括: The resource allocation device also includes:
所述处理器, 还用于确定健康时间是否大于或等于第二预设时 间, 所述健康时间是所述子时隙资源的类型变为健康资源开始计时, 所述子时隙资源的类型是所述健康资源所经历的时间; The processor is also configured to determine whether the healthy time is greater than or equal to a second preset time. The healthy time is when the type of the sub-time slot resource changes to a healthy resource. The type of the sub-time slot resource is The time experienced by said health resource;
所述处理器,还用于当所述处理器确定出所述健康时间大于或等 于所述第二预设时间时, 确定所述第一业务是否繁忙; The processor is also configured to determine whether the first business is busy when the processor determines that the healthy time is greater than or equal to the second preset time;
所述处理器, 还用于当所述处理器确定出所述第一业务不繁忙, 则将所述第一子时隙资源的类型由所述健康资源变为所述待检资源, 使得所述资源分配设备再次对所述第一子间隙资源进行所述环回检 测。 The processor is also configured to change the type of the first sub-slot resource from the healthy resource to the pending resource when the processor determines that the first service is not busy, so that the The resource allocation device performs the loopback detection on the first sub-gap resource again.
33、 根据权利要求 32所述的资源分配设备, 其特征在于, 所述 处理器具体用于: 33. The resource allocation device according to claim 32, characterized in that the processor is specifically used to:
为所述第一业务分配所述第一资源,所述第一资源是类型为所述 健康资源的未占用的子间隙资源。 The first resource is allocated to the first service, and the first resource is an unoccupied sub-gap resource of the type healthy resource.
PCT/CN2014/075408 2014-04-15 2014-04-15 Method and device for resource allocation WO2015157913A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2014/075408 WO2015157913A1 (en) 2014-04-15 2014-04-15 Method and device for resource allocation
CN201480000853.3A CN104221340A (en) 2014-04-15 2014-04-15 Resource distributing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/075408 WO2015157913A1 (en) 2014-04-15 2014-04-15 Method and device for resource allocation

Publications (1)

Publication Number Publication Date
WO2015157913A1 true WO2015157913A1 (en) 2015-10-22

Family

ID=52100956

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/075408 WO2015157913A1 (en) 2014-04-15 2014-04-15 Method and device for resource allocation

Country Status (2)

Country Link
CN (1) CN104221340A (en)
WO (1) WO2015157913A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101005410A (en) * 2006-12-15 2007-07-25 华为技术有限公司 Detecting method and device for loading state and method and system for distributing loading resource
CN101060474A (en) * 2006-04-20 2007-10-24 大唐移动通信设备有限公司 A service quality assurance-based grouping service wireless resource dispatching method
EP2625916A1 (en) * 2010-10-04 2013-08-14 Airspan Networks Inc. Apparatus and method for controlling a wireless feeder network

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859078A (en) * 2005-11-03 2006-11-08 华为技术有限公司 Narrow band communication system data transmission method
CN1968056A (en) * 2006-06-26 2007-05-23 华为技术有限公司 Line fault diagnosis method in passive optical network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060474A (en) * 2006-04-20 2007-10-24 大唐移动通信设备有限公司 A service quality assurance-based grouping service wireless resource dispatching method
CN101005410A (en) * 2006-12-15 2007-07-25 华为技术有限公司 Detecting method and device for loading state and method and system for distributing loading resource
EP2625916A1 (en) * 2010-10-04 2013-08-14 Airspan Networks Inc. Apparatus and method for controlling a wireless feeder network

Also Published As

Publication number Publication date
CN104221340A (en) 2014-12-17

Similar Documents

Publication Publication Date Title
US10938710B2 (en) Protection switching method and system, and network device
US11799793B2 (en) Adaptive private network with dynamic conduit process
US10917322B2 (en) Network traffic tracking using encapsulation protocol
US10033602B1 (en) Network health management using metrics from encapsulation protocol endpoints
WO2016029749A1 (en) Communication failure detection method, device and system
WO2021128977A1 (en) Fault diagnosis method and apparatus
WO2008148334A1 (en) Method, system and apparatus thereof for detecting abnormal receipt of message
WO2021017658A1 (en) System and method for evaluating transmission performance related to network node and related device
US10516599B1 (en) Link priority for loop-protect
US11102273B2 (en) Uplink performance management
US20190394129A1 (en) Method And Apparatus For Datacenter Congestion Control Based On Software Defined Network
CN108632099B (en) Fault detection method and device for link aggregation
JP2023126364A (en) Congestion avoidance in slice-based network
WO2019011142A1 (en) Network link switching method and system
WO2020173424A1 (en) Message processing method, and gateway device
CN113890816A (en) Network health state analysis method and device, computer equipment and storage medium
CN109120449B (en) Method and device for detecting link failure
US20140211614A1 (en) Methods and systems for providing redundancy in data network communications
WO2015157913A1 (en) Method and device for resource allocation
WO2011120387A1 (en) Reverse fault detecting method and network side device
CN108307401B (en) Method and device for establishing communication connection and communication equipment
US10623422B2 (en) Protocol to detect a foreign device connected between network modules
CN109039728B (en) BFD-based flow congestion detection method and system
TW202232928A (en) Multi-access edge computing architecture and detection method thereof
CN106992878B (en) Multicast detection method and device

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: 14889692

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14889692

Country of ref document: EP

Kind code of ref document: A1