Method and apparatus for allocating time slot resources, storage medium and electronic device

By automatically determining the topology and bandwidth requirements of the master and slave devices, the automatic allocation of time slot resources is achieved, solving the cumbersome time slot allocation problem in the existing technology and simplifying the configuration process.

CN116418447BActive Publication Date: 2026-07-03SUZHOU CENTEC COMM CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU CENTEC COMM CO LTD
Filing Date
2021-12-30
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, administrators need to manually determine the port topology connection between the two devices and check the available time slots, which makes the time slot allocation process cumbersome.

Method used

By acquiring the bandwidth requirements of the master and slave devices, the topology connection relationship between the two devices is automatically determined, and the same target time slot resources are allocated to the client based on consistent bandwidth requirements. Automatic configuration is achieved by utilizing port topology learning and time slot resource allocation modules.

Benefits of technology

The time slot configuration process has been simplified, enabling automatic allocation of time slot resources and reducing manual intervention steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116418447B_ABST
    Figure CN116418447B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for allocating time slot resources, a storage medium, and an electronic device. The method includes: obtaining a first bandwidth requirement of a master device and a second bandwidth requirement of a slave device, wherein the first bandwidth requirement is the bandwidth requirement for a first client in a first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for a second client in a second Ethernet group of the slave device to send or receive the service data; determining whether the first bandwidth requirement and the second bandwidth requirement are consistent; and if the first bandwidth requirement and the second bandwidth requirement are consistent, allocating the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communications, and more specifically, to a method and apparatus for allocating time slot resources, a storage medium, and an electronic device. Background Technology

[0002] FlexE (Flex Ethernet) technology is based on the Ethernet interface. FlexE provides lightweight enhancements to Ethernet by adding a FlexE Shim layer between the Ethernet L2 (MAC) and L1 (PHY) layers, thus decoupling the MAC (Media Access Control sublayer, belonging to the data link layer) and PHY (Physical layer). Figure 1 As shown.

[0003] FlexE tunneling technology, also known as FlexE cross-connect end-to-end packet forwarding, uses PE (Provider Edge, the edge device of the backbone network) nodes to achieve statistical multiplexing based on packet forwarding, and P (intermediate forwarding node of the backbone network) nodes to support FlexE cross-connection, enabling L1 layer packet transparent transmission.

[0004] However, in related technologies, the administrator needs to determine the port topology connection relationship between the two devices, manually check the available time slots, and then allocate the corresponding time slots to the two devices.

[0005] In the relevant technologies, administrators need to determine the port topology connection between the two devices, manually check the available time slots, and then allocate the corresponding time slots to the two devices, which leads to cumbersome procedures. No effective solution has yet been proposed. Summary of the Invention

[0006] This invention provides a method and apparatus for allocating time slot resources, a storage medium, and an electronic device to at least solve the problems in related technologies, such as the need for administrators to determine the port topology connection relationship between the two devices, manually check the available time slots, and then allocate the corresponding time slots to the two devices, which leads to cumbersome steps.

[0007] According to one embodiment of the present invention, a method for allocating time slot resources is provided, comprising: obtaining a first bandwidth requirement of a master device and a second bandwidth requirement of a slave device, wherein the first bandwidth requirement is the bandwidth requirement for a first client in a first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for a second client in a second Ethernet group of the slave device to send or receive the service data; determining whether the first bandwidth requirement and the second bandwidth requirement are consistent; and if the first bandwidth requirement and the second bandwidth requirement are consistent, allocating the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource.

[0008] In an exemplary embodiment, allocating target time slot resources to the first client according to the first bandwidth requirement or the second bandwidth requirement includes: obtaining physical port information corresponding to one or more first physical layers in the first Ethernet group, wherein the physical port information includes: idle time slot resources of the first physical layer; determining the target time slot resource that meets the first bandwidth requirement or the second bandwidth requirement from the idle time slot resources of one or more first physical layers through a preset method, so as to allocate the target time slot resource to the first client.

[0009] In an exemplary embodiment, before obtaining the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, the method further includes: when the target object has completed the configuration of the first Ethernet group, connecting the first physical port to the first Ethernet group, and obtaining the member number of the first physical layer corresponding to the first physical port; obtaining the second Ethernet group and the second physical port information in the second Ethernet group through port topology learning; identifying the topological connection relationship between the first physical port and the second physical port; and sending the member number and the topological connection relationship to the slave device, so that the slave device allocates the member number to the second physical layer corresponding to the second physical port according to the topological connection relationship.

[0010] In an exemplary embodiment, allocating target time slot resources to the second client according to the first bandwidth requirement or the second bandwidth requirement includes: sending target time slot resource information to the slave device, so that the slave device allocates target time slot resources to the second client according to the member number of the first physical layer and the sequence number of the target time slot resource, wherein the target time slot resource information is used to indicate the sequence number of the target time slot resource allocated to the first client and the member number of the first physical layer corresponding to the target time slot resource.

[0011] In an exemplary embodiment, after allocating the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, the method further includes: saving the sequence number of the target time slot resource to a first schedule table of the master device; and, if it is determined that the slave device saves the sequence number of the target time slot resource to a second schedule table of the slave device, sending or receiving service data through the target time slot resource in the first schedule table.

[0012] In an exemplary embodiment, after allocating the same target time slot resources to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, the method further includes: in the event of a failure of a third physical port in the first Ethernet group, determining one or more third clients occupying time slot resources in the third physical port, and the total occupied time slots of the one or more third clients; determining the idle time slot resources of other physical ports in the first Ethernet group; determining the size relationship between the idle time slot resources of the other physical ports and the total occupied time slots; and, if the idle time slot resources of the other physical ports are greater than the total occupied time slots, allocating the idle time slot resources of the other physical ports to the one or more third clients.

[0013] In an exemplary embodiment, before obtaining the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, the method further includes: establishing a first binding relationship between the first client and the first Ethernet group, and a second binding relationship between the first client and the service port, after the target object has created the first client and the service port; allocating target time slot resources in the first Ethernet group to the first client according to the first binding relationship, and determining the service port according to the second binding relationship, so that the first client can send or receive the service data through the service port and the target time slot resources.

[0014] According to another embodiment of the present invention, a time slot resource allocation apparatus is also provided, comprising: an acquisition module, configured to acquire a first bandwidth requirement of a master device and a second bandwidth requirement of a slave device, wherein the first bandwidth requirement is the bandwidth requirement for a first client in a first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for a second client in a second Ethernet group of the slave device to send or receive the service data; a determination module, configured to determine whether the first bandwidth requirement and the second bandwidth requirement are consistent; and an allocation module, configured to, if the first bandwidth requirement and the second bandwidth requirement are consistent, allocate the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource.

[0015] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the above-described time slot resource allocation method at runtime.

[0016] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described time slot resource allocation method through the computer program.

[0017] In this embodiment of the invention, a first bandwidth requirement of the master device and a second bandwidth requirement of the slave device are obtained. The first bandwidth requirement is the bandwidth requirement for a first client in a first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for a second client in a second Ethernet group of the slave device to send or receive the service data. It is then determined whether the first bandwidth requirement and the second bandwidth requirement are consistent. If they are consistent, the same target time slot resource is allocated to the first client and the second client according to either the first or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource. This technical solution solves the problem of administrators needing to determine the port topology connection relationship between the two devices, manually check idle time slots, and then allocate corresponding time slots to the two devices, leading to cumbersome steps. Therefore, this embodiment of the invention achieves automatic time slot configuration, greatly simplifying the configuration process. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0019] Figure 1 This is a structural block diagram of the flexible Ethernet according to an embodiment of the present invention;

[0020] Figure 2 This is a hardware structure block diagram of a computer terminal for a time slot resource allocation method according to an embodiment of the present invention.

[0021] Figure 3 This is a flowchart of a time slot resource allocation method according to an embodiment of the present invention;

[0022] Figure 4 This is a schematic diagram of the allocation of time slot resources according to an embodiment of the present invention;

[0023] Figure 5 This is a schematic diagram (a) of a time slot resource allocation method according to an optional embodiment of the present invention;

[0024] Figure 6 This is a schematic diagram (II) of a time slot resource allocation method according to an optional embodiment of the present invention;

[0025] Figure 7 This is a schematic diagram (iii) of a time slot resource allocation method according to an optional embodiment of the present invention;

[0026] Figure 8 This is a schematic diagram (four) of a time slot resource allocation method according to an optional embodiment of the present invention;

[0027] Figure 9 This is a state transition diagram of a client according to an optional embodiment of the present invention;

[0028] Figure 10 This is a structural block diagram of a time slot resource allocation device according to an optional embodiment of the present invention;

[0029] Figure 11 This is a structural block diagram of a time slot resource allocation device according to an embodiment of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a computer terminal as an example, Figure 2 This is a hardware structure block diagram of a computer terminal for a time slot resource allocation method according to an embodiment of the present invention. Figure 2 As shown, a computer terminal may include one or more ( Figure 2 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. In one exemplary embodiment, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 2 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 2 The more or fewer components shown, or having the same Figure 2 Equivalent functions or ratios shown Figure 2 The functions shown have more different configurations.

[0033] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the time slot resource allocation method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0035] This embodiment provides a method for allocating time slot resources, applied to the aforementioned computer terminal. Figure 3 This is a flowchart of a time slot resource allocation method according to an embodiment of the present invention, the process including the following steps:

[0036] Step S302: Obtain the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, wherein the first bandwidth requirement is the bandwidth requirement for the first client of the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client of the second Ethernet group of the slave device to send or receive the service data.

[0037] Step S304: Determine whether the first bandwidth requirement and the second bandwidth requirement are consistent;

[0038] Step S306: If the first bandwidth requirement and the second bandwidth requirement are consistent, allocate the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource.

[0039] Through the above steps, the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device are obtained. The first bandwidth requirement is the bandwidth requirement for the first client in the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client in the second Ethernet group of the slave device to send or receive the service data. It is then determined whether the first bandwidth requirement and the second bandwidth requirement are consistent. If they are consistent, the same target time slot resource is allocated to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource. This solves the problem in related technologies where administrators need to determine the port topology connection relationship between the two devices, manually check the idle time slots, and then allocate corresponding time slots to the two devices, leading to cumbersome steps. Therefore, through this embodiment of the invention, automatic time slot configuration is achieved, greatly simplifying the configuration process.

[0040] In an exemplary embodiment, step S306 further includes: obtaining physical port information corresponding to one or more first physical layers in the first Ethernet group, wherein the physical port information includes: idle time slot resources of the first physical layer; determining the target time slot resource that meets the first bandwidth requirement or the second bandwidth requirement from the idle time slot resources of one or more first physical layers in a preset manner, so as to allocate the target time slot resource to the first client.

[0041] It should be noted that the physical port information also includes: the physical port number, the physical port priority, and the time slot number of the idle time slot resource of the first physical layer corresponding to the physical port. Therefore, after determining the idle time slot resource of the first physical layer, the target timing resource can be determined through one of the following methods:

[0042] 1) Determine the priority of the physical port corresponding to the idle time slot resource, and determine the target physical port and the idle time slot resource corresponding to the target physical port from multiple physical ports according to the priority order;

[0043] 2) Determine the physical port number and the time slot number of the idle time slot resource corresponding to the physical port, and determine the target time slot resource in the idle time slot resource according to the number order.

[0044] It should be noted that the target time slot resource may be on a single physical port or span multiple physical ports, and this embodiment of the invention does not limit this.

[0045] In an exemplary embodiment, before obtaining the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, if the target object has completed the configuration of the first Ethernet group, the first physical port is connected to the first Ethernet group, and the member number of the first physical layer corresponding to the first physical port is obtained; the second Ethernet group and the second physical port information in the second Ethernet group are obtained through port topology learning; the topological connection relationship between the first physical port and the second physical port is identified; the member number and the topological connection relationship are sent to the slave device, so that the slave device allocates the member number to the second physical layer corresponding to the second physical port according to the topological connection relationship.

[0046] It should be noted that the two interacting devices determine the master and slave devices through negotiation or System MAC values.

[0047] Specifically, the user first needs to configure the first group identifier of the first Ethernet group corresponding to the master device and add the first physical port of FlexE to the first Ethernet group. FlexE performs port topology learning, discovers the second Ethernet group of the slave device, the second group identifier of the second Ethernet group, and the second physical port information, and identifies the topology connection relationship between the first physical port and the second physical port. According to the topology connection relationship, it automatically assigns a member number to the first physical layer corresponding to the first physical port, and determines the order of the first physical layer of the first Ethernet group according to the member number. After the master device determines the order of the first physical layer of the first Ethernet group, it sends the member number of the first physical layer to the slave device so that the slave device can assign a member number to the second physical layer according to the member number of the first physical layer.

[0048] For example, the first Ethernet group includes physical port 1, physical port 2, and physical port 3; the second Ethernet group includes physical port 4, physical port 5, and physical port 6. Through topology learning, it is determined that physical ports 1 and 5 have a topological connection, physical ports 2 and 6 have a topological connection, and physical ports 3 and 4 have a topological connection. If the first physical layer member number assigned to physical port 1 in the first Ethernet group is 1, the first physical layer member number assigned to physical port 2 is 2, and the first physical layer member number assigned to physical port 3 is 3, the second physical layer member number assigned to physical port 4 in the second Ethernet group is 1, and the second physical layer member number assigned to physical port 6 is 2. That is, the master device assigns the member numbers, and the slave device follows the member number assignment result of the master device. Otherwise, it will lead to a mismatch in the allocated time slots. It should be noted that the above values ​​are only for better understanding of the embodiments of the present invention, and the embodiments of the present invention do not limit the member numbers, physical ports, etc.

[0049] In an exemplary embodiment, allocating target time slot resources to the second client according to the first bandwidth requirement or the second bandwidth requirement includes: sending target time slot resource information to the slave device, so that the slave device allocates target time slot resources to the second client according to the member number of the first physical layer and the sequence number of the target time slot resource, wherein the target time slot resource information is used to indicate the sequence number of the target time slot resource allocated to the first client and the member number of the first physical layer corresponding to the target time slot resource.

[0050] When allocating target time slot resources to the first client, the sequence number of the target time slot resource and the member number of the first physical layer corresponding to the target time slot resource are sent to the slave device so that the slave device can allocate the same target time slot resources to the second client as the first client. For example, if the master device allocates physical layer time slots 0-5 with member number 1 to the first client, then the slave device allocates physical layer time slots 0-5 with member number 1 to the second client.

[0051] In an exemplary embodiment, after allocating the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, the sequence number of the target time slot resource is saved to the first schedule table of the master device; if it is determined that the slave device saves the sequence number of the target time slot resource to the second schedule table of the slave device, service data is sent or received through the target time slot resource in the first schedule table.

[0052] The sequence number of the target timing resource is saved to the first schedule table of the hardware. Both the master device and the slave device save the sequence number of the target timing resource to the corresponding first schedule table of the hardware. Service data is sent or received through the target timing resource in the first schedule table, and the first client and the second client start working.

[0053] In an exemplary embodiment, after allocating the same target time slot resources to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, in the event of a failure of a third physical port in the first Ethernet group, one or more third clients occupying the timing resources in the third physical port are identified, as well as the total time slots occupied by the one or more third clients; the idle time slot resources of other physical ports in the first Ethernet group are determined; the relationship between the idle time slot resources of the other physical ports and the total occupied time slots is determined; and if the idle time slot resources of the other physical ports are greater than the total occupied time slots, the idle time slot resources of the other physical ports are allocated to the one or more third clients.

[0054] In other words, if a physical port in the first Ethernet group fails, the system iterates through the time slots used on that physical port and the corresponding third clients (one or more third clients) to determine if other physical ports in the first Ethernet group have sufficient free time slots. If the free time slots on other physical ports are insufficient to reallocate time slots for all third clients, time slots can be allocated to some third clients, allowing them to continue operating.

[0055] For example, a 100G port has 20 time slots. If a failure occurs on a 100G port, and there are 4 third-party clients connected to it, each occupying 5 time slots, then a maximum of 20 time slots might need to be allocated to the third-party clients. However, if there are less than 20 remaining free time slots, then some of the third-party clients can be restored. For instance, if there are 10 time slots remaining, the service of 2 third-party clients can be restored; if there are 15 time slots remaining, the service of 3 third-party clients can be restored. And so on, to restore as many third-party clients as possible using available time slots.

[0056] In an exemplary embodiment, before obtaining the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, after the first client and service port of the target object have been created, a first binding relationship between the first client and the first Ethernet group, and a second binding relationship between the first client and the service port are established; a target time slot resource in the first Ethernet group is allocated to the first client according to the first binding relationship, and the service port is determined according to the second binding relationship, so that the first client can send or receive the service data through the service port and the target time slot resource.

[0057] Specifically, the user creates a first client and assigns a first client identifier to the first client; the user binds the first client to a first Ethernet group to establish a first binding relationship. It should be noted that a client can only belong to one Ethernet group; a service port is created, and a second binding relationship is established between the first client and the service port, so that the first client can send or receive the service data through the service port and the target time slot resource.

[0058] To better understand the process of the above-mentioned time slot resource allocation method, the implementation flow of the above-mentioned time slot resource allocation method will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solutions of the embodiments of the present invention.

[0059] Example 1

[0060] This embodiment provides a method for allocating time slot resources. Figure 4 This is a schematic diagram illustrating the allocation of time slot resources according to an embodiment of the present invention, such as... Figure 4 As shown:

[0061] It should be noted that the FlexE physical interface can operate in both traditional Ethernet mode and FlexE mode. Currently, FlexE only supports physical interfaces with speeds of 50G / 100G / 200G / 400G.

[0062] FlexE Group: A collection of physical interfaces with the same attributes. The bandwidth of a FlexE group is equal to the sum of the bandwidths of the physical interfaces in the group, and the bandwidth of a FlexE group can be flexibly allocated to FlexE Clients.

[0063] FlexE Shim: A shim inserted between the traditional Ethernet MAC layer and PHY layer, implementing the core module of FlexE technology through a calendar-based time slot distribution mechanism.

[0064] FlexE Client (equivalent to the first, second, and third clients in the above embodiments): As a client of the FlexE Shim, the FlexE Client corresponds one-to-one with the MAC address. The FlexE Client can be flexibly allocated from the time slot resource pool of the FlexE group at the granularity of 5G bandwidth.

[0065] FlexE Business Interface: This is the logical interface for business forwarding. One FlexE business interface can be bound to one FlexEClient.

[0066] If the service interface requires 65G of bandwidth, allocate 13 time slots to the service interface; if the service interface requires 40G of bandwidth, allocate 8 time slots to the service interface; if the service interface requires 15G of bandwidth, allocate 3 time slots to the service interface; correspondingly, the same number of time slots are allocated to the service interface on the other end.

[0067] Example 2

[0068] This embodiment provides a method for allocating time slot resources, which can be divided into the following two stages:

[0069] I. Setting port attributes: The specific steps are as follows:

[0070] Step 11: The user configures the first FlexE group and the first group identifier (e.g., group ID), and adds the first FlexE physical port to the first FlexE group;

[0071] Step 12: FlexE performs port topology learning, discovers the second group identifier (e.g., group ID) of the peer end and the second physical port information corresponding to the second FlexE physical port of the second FlexE group, and identifies the topological connection relationship between the first FlexE physical port and the second FlexE physical port.

[0072] Step 13: Based on the first FlexE group, the second FlexE group, and the topology connection relationship, FlexE automatically assigns PHY numbers (equivalent to member numbers in the above embodiment) to the master switch (equivalent to the master device in the above embodiment) and the slave switch (equivalent to the slave device in the above embodiment), and determines the order of PHYs in the first FlexE group and the second FlexE group.

[0073] It should be noted that a master switch and a slave switch must be selected from the two interconnected switches. In this embodiment, the switch corresponding to the first FlexE group is designated as the master switch. The master is responsible for allocating time slots, and the slave follows the master's time slot allocation results. Otherwise, a mismatch in time slots allocated to the master and slave will occur. Furthermore, the switch with the smaller System MAC address can be designated as the master.

[0074] The specific method for allocating PHY numbers to the master and slave switches is as follows: The Master arranges the PHY numbers according to the port number of the Master's physical port, such as... Figure 5 As shown, port1's PHY num = 1, port2's PHY num = 2, and port3's PHY num = 3. The Master informs the corresponding physical port of the Slave of the Master's PHY num, and the Slave assigns this PHY num to the Ports, as shown. Figure 6 As shown, if the Master's port 1 and the Slave's port 2 are connected, then the PHY num of the Slave's port 2 is 1; if the Master's port 2 and the Slave's port 3 are connected, then the PHY num of the Slave's port 3 is 2; if the Master's port 3 and the Slave's port 1 are connected, then the PHY num of the Slave's port 1 is 3.

[0075] Step 14: Determine the time slot order within the first and second FlexE groups based on the PHY number.

[0076] II. The time slot allocation phase, the specific steps are as follows:

[0077] Step S21: The user creates the first FlexE client (equivalent to the first client in the above embodiment) and assigns a Client ID;

[0078] Step S22: The user binds the first FlexE client to the first FlexE group. It should be noted that a client can only belong to one FlexE group.

[0079] Step S23: Create a FlexE service port and bind it to the FlexE client;

[0080] Step S24: Determine the bandwidth of the FlexE client based on the business data, for example, 30G;

[0081] Step S25: The FlexE time slot allocation module determines that both the first FlexE group and the second FlexE group are configured with FlexEclient and client ID. If the bandwidth requirements of the first FlexE client and the second FlexE client are consistent, it enters the time slot allocation state.

[0082] Step S26: The FlexE time slot allocation module negotiates idle time slot resources. These resources may be on a single physical port or span multiple physical ports. The negotiated time slot resources enter a pre-allocation state. Idle time slots can be allocated from smallest to largest, or some port priority factors can be added. For example, if the physical port has a higher priority, the time slot resources on that physical port will be selected first. Then, the time slot resources are distributed to the hardware's backup Calendar table.

[0083] It should be noted that the specific methods for the first and second FlexE clients described above are as follows: The Master selects the time slot resources on the physical port, such as... Figure 7 As shown, the Master selects PHY num=1, Slot=0-3 and PHY num=2, Slot=7,9. The Master allocates the time slot resources of PHY num=1, Slot=0-3 and PHY num=2, Slot=7,9 to the first FlexE client. The Master notifies the Slave of the selected time slot resources, and the Slave allocates the corresponding time slot resources to the second FlexE client, as shown. Figure 8 As shown, the Slave allocates time slot resources of PHY num=1, Slot=0-3 and PHY num=2, Slot=7,9 to the second FlexE client.

[0084] Step S27: When the time slot resources of both Master and Slave are distributed to the backup Calendar table of the hardware, the switching action is started. The calendar switching action is performed on both Master and Slave. If successful, the first FlexE client and the second FlexE client enter the WORKING state.

[0085] Step S28: If any step fails, both the first and second FlexE clients will transition to the SLEEPING state until the port or configuration changes, at which point new allocable time slot resources may become available, and a new allocation attempt will be made. Figure 9 As shown;

[0086] Step S29: After both clients enter the WORKING state, the FlexE service ports on both ends can come up normally. At this time, packets can be sent from the FlexE service ports on both ends to communicate with each other.

[0087] It should be noted that when a physical port within a FlexE group fails, the system iterates through the time slots used on that physical port, identifies which client it belongs to, and then checks if there are enough free time slots available to allocate. If there aren't enough free time slots to reallocate for all clients, time slot resources can be allocated to some clients, allowing them to continue working.

[0088] Example 3

[0089] like Figure 10 As shown, Figure 10 This is a structural block diagram of a time slot resource allocation device according to an optional embodiment of the present invention, including: a user configuration module, a topology learning module, an overhead communication module, a time slot allocation and negotiation module, a FlexE configuration module, and a FlexE hardware module.

[0090] The system comprises the following modules: a user configuration module for receiving user configuration operations; a topology learning module for learning the topology connections of physical ports in the first and second FlexE groups; an overhead communication module, which uses FlexE overhead channels to send and receive protocol messages, utilizing some fields provided by FlexE for communication between ports; a FlexE configuration module, a set of FlexE configuration interfaces provided by the SDK, through which the software performs actions such as adding a group, adding a client, adding a port to a FlexE group, setting the PHY_num for a port, allocating time slots for clients, and triggering handover; a FlexE hardware module, which is the chip-implemented FlexE state machine, primarily implementing the chip processing logic of the FlexE configuration module, especially the master / slave handover actions to ensure lossless adjustment of client bandwidth, and writing and retrieving FlexE overhead fields; and a time slot allocation module, used to allocate time slot resources to the first and second FlexE clients.

[0091] In this embodiment of the invention, the topology relationship is discovered through negotiation between the two ends; time slots are automatically allocated between the two ends; when a physical port fails or malfunctions, a time slot change is triggered, and then an idle time slot is reselected, thereby achieving protection switching.

[0092] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0093] This embodiment also provides a time slot resource allocation device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0094] Figure 11 This is a structural block diagram of a time slot resource allocation device according to an embodiment of the present invention; as shown below. Figure 11 As shown, it includes:

[0095] The acquisition module 1102 is used to acquire the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, wherein the first bandwidth requirement is the bandwidth requirement for the first client of the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client of the second Ethernet group of the slave device to send or receive the service data.

[0096] The determination module 1104 is used to determine whether the first bandwidth requirement and the second bandwidth requirement are consistent;

[0097] The allocation module 1106 is used to allocate the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement when the first bandwidth requirement and the second bandwidth requirement are consistent, so that the first client and the second client can send or receive service data through the target time slot resource.

[0098] The above-described device obtains the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device. The first bandwidth requirement is the bandwidth requirement for a first client in the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for a second client in the second Ethernet group of the slave device to send or receive the service data. It then determines whether the first bandwidth requirement and the second bandwidth requirement are consistent. If they are consistent, the same target time slot resource is allocated to the first client and the second client according to either the first or the second bandwidth requirement, enabling them to send or receive service data through the target time slot resource. This solves the problem in related technologies where administrators need to determine the port topology connection between the two devices, manually check idle time slots, and then allocate corresponding time slots to both devices, leading to cumbersome steps. Therefore, this invention enables automatic time slot configuration, greatly simplifying the configuration process.

[0099] In an exemplary embodiment, the allocation module 1106 is further configured to obtain physical port information corresponding to one or more first physical layers in the first Ethernet group, wherein the physical port information includes: idle time slot resources of the first physical layer; and to determine the target time slot resource that meets the first bandwidth requirement or the second bandwidth requirement from the idle time slot resources of one or more first physical layers by means of a preset method, so as to allocate the target time slot resource to the first client.

[0100] In an exemplary embodiment, the allocation module 1106 is further configured to, when the target object has completed the configuration of the first Ethernet group, connect the first physical port to the first Ethernet group, and obtain the member number of the first physical layer corresponding to the first physical port; obtain the second Ethernet group and the second physical port information in the second Ethernet group through port topology learning; identify the topological connection relationship between the first physical port and the second physical port; and send the member number and the topological connection relationship to the slave device, so that the slave device allocates the member number to the second physical layer corresponding to the second physical port according to the topological connection relationship.

[0101] In an exemplary embodiment, the allocation module 1106 is further configured to send target time slot resource information to the slave device, so that the slave device allocates target time slot resources to the second client according to the member number of the first physical layer and the sequence number of the target time slot resource, wherein the target time slot resource information is used to indicate the sequence number of the target time slot resource allocated to the first client and the member number of the first physical layer corresponding to the target time slot resource.

[0102] In an exemplary embodiment, the above apparatus further includes: a storage module, configured to save the sequence number of the target timing resource to a first schedule table of the master device; and, if it is determined that the slave device saves the sequence number of the target timing resource to a second schedule table of the slave device, send or receive service data through the target timing resource in the first schedule table.

[0103] In an exemplary embodiment, the allocation module 1106 is further configured to, in the event of a failure of a third physical port in the first Ethernet group, determine one or more third clients occupying timing resources in the third physical port, and the total occupied time slots of the one or more third clients; determine the idle time slot resources of other physical ports in the first Ethernet group; determine the size relationship between the idle time slot resources of the other physical ports and the total occupied time slots; and, if the idle time slot resources of the other physical ports are greater than the total occupied time slots, allocate the idle time slot resources of the other physical ports to the one or more third clients.

[0104] In an exemplary embodiment, the above apparatus further includes an establishment module, configured to, upon completion of the creation of the first client and the service port by the target object, establish a first binding relationship between the first client and the first Ethernet group, and a second binding relationship between the first client and the service port; allocate target time slot resources in the first Ethernet group to the first client according to the first binding relationship, and determine the service port according to the second binding relationship, so that the first client can send or receive the service data through the service port and the target time slot resources.

[0105] Embodiments of the present invention also provide a storage medium comprising a stored program, wherein the program, when executed, performs any of the methods described above.

[0106] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0107] S1, obtain the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, wherein the first bandwidth requirement is the bandwidth requirement for the first client of the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client of the second Ethernet group of the slave device to send or receive the service data.

[0108] S2, determine whether the first bandwidth requirement and the second bandwidth requirement are consistent;

[0109] S3, if the first bandwidth requirement and the second bandwidth requirement are consistent, allocate the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource.

[0110] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0111] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0112] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0113] S1, obtain the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, wherein the first bandwidth requirement is the bandwidth requirement for the first client of the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client of the second Ethernet group of the slave device to send or receive the service data.

[0114] S2, determine whether the first bandwidth requirement and the second bandwidth requirement are consistent;

[0115] S3, if the first bandwidth requirement and the second bandwidth requirement are consistent, allocate the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource.

[0116] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0117] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0118] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0119] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for allocating time slot resources, characterized in that, include: The first bandwidth requirement of the master device and the second bandwidth requirement of the slave device are obtained, wherein the first bandwidth requirement is the bandwidth requirement for the first client of the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client of the second Ethernet group of the slave device to send or receive the service data. Determine whether the first bandwidth requirement and the second bandwidth requirement are consistent; When the first bandwidth requirement and the second bandwidth requirement are consistent, the same target time slot resource is allocated to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, so that the first client and the second client can send or receive service data through the target time slot resource; Before obtaining the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, if the target object has completed the configuration of the first Ethernet group, the first physical port is connected to the first Ethernet group, and the member number of the first physical layer corresponding to the first physical port is obtained; the second Ethernet group and the second physical port information in the second Ethernet group are obtained through port topology learning; the topological connection relationship between the first physical port and the second physical port is identified; the member number and the topological connection relationship are sent to the slave device, so that the slave device assigns the member number to the second physical layer corresponding to the second physical port according to the topological connection relationship.

2. The method for allocating time slot resources according to claim 1, characterized in that, Allocating target time slot resources to the first client based on the first bandwidth requirement or the second bandwidth requirement includes: Obtain physical port information corresponding to one or more first physical layers in the first Ethernet group, wherein the physical port information includes: idle time slot resources of the first physical layer; The target time slot resource that meets the first bandwidth requirement or the second bandwidth requirement is determined from one or more idle time slot resources of the first physical layer by a preset method, and the target time slot resource is allocated to the first client.

3. The method for allocating time slot resources according to claim 1, characterized in that, Allocating target time slot resources to the second client based on the first bandwidth requirement or the second bandwidth requirement includes: The target time slot resource information is sent to the slave device so that the slave device allocates the target time slot resource to the second client according to the member number of the first physical layer and the sequence number of the target time slot resource. The target time slot resource information is used to indicate the sequence number of the target time slot resource allocated to the first client and the member number of the first physical layer corresponding to the target time slot resource.

4. The method for allocating time slot resources according to claim 1, characterized in that, After allocating the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, the method further includes: The sequence number of the target time slot resource is saved to the first schedule table of the master device; If it is determined that the slave device saves the sequence number of the target time slot resource to the slave device's second schedule table, service data is sent or received through the target time slot resource in the first schedule table.

5. The method for allocating time slot resources according to claim 1, characterized in that, After allocating the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement, the method further includes: In the event of a failure of the third physical port in the first Ethernet group, identify one or more third clients occupying the time slot resources in the third physical port, and the total time slots occupied by the one or more third clients; Determine the available time slot resources for other physical ports in the first Ethernet group; Determine the relationship between the idle time slot resources of the other physical ports and the total number of occupied time slots; If the idle time slot resources of the other physical ports are greater than the total occupied time slots, the idle time slot resources of the other physical ports shall be allocated to the one or more third clients.

6. The method for allocating time slot resources according to claim 1, characterized in that, Before obtaining the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, the method further includes: Once the target object has been created and the first client and service port are established, a first binding relationship between the first client and the first Ethernet group, and a second binding relationship between the first client and the service port are established. The first client is allocated a target time slot resource in the first Ethernet group according to the first binding relationship, and the service port is determined according to the second binding relationship, so that the first client can send or receive the service data through the service port and the target time slot resource.

7. A time slot resource allocation device, characterized in that, include: The acquisition module is used to acquire the first bandwidth requirement of the master device and the second bandwidth requirement of the slave device, wherein the first bandwidth requirement is the bandwidth requirement for the first client of the first Ethernet group corresponding to the master device to send or receive service data, and the second bandwidth requirement is the bandwidth requirement for the second client of the second Ethernet group of the slave device to send or receive the service data. A determining module is used to determine whether the first bandwidth requirement and the second bandwidth requirement are consistent; The allocation module is configured to allocate the same target time slot resource to the first client and the second client according to the first bandwidth requirement or the second bandwidth requirement when the first bandwidth requirement and the second bandwidth requirement are consistent, so that the first client and the second client can send or receive service data through the target time slot resource; The allocation module is further configured to, when the target object has configured the first Ethernet group, connect the first physical port to the first Ethernet group and obtain the member number of the first physical layer corresponding to the first physical port; obtain the second Ethernet group and the second physical port information in the second Ethernet group through port topology learning; identify the topological connection relationship between the first physical port and the second physical port; and send the member number and the topological connection relationship to the slave device, so that the slave device allocates the member number to the second physical layer corresponding to the second physical port according to the topological connection relationship.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 6.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 through the computer program.