A method and device for dynamically switching services

By generating multiple virtualization mapping paths in the business interface layer and the hardware interface layer, using hardware parameters to calculate weights, and automatically selecting hardware for switching, the problem of business interruption when hardware changes is solved and fast and reliable business switching is achieved.

CN115292061BActive Publication Date: 2025-09-16FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210869813.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-09-16
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

When hardware changes, existing technologies require manual configuration modifications and manual business deletion and creation, resulting in business interruptions and operation and maintenance risks, and inability to quickly switch.

Method used

By creating a business interface layer and a hardware interface layer, the business configuration information and the hardware configuration information are set separately, and multiple virtualization mapping paths are generated for each business. The weights are calculated using hardware parameters, and the hardware with the closest performance is selected for automatic switching, avoiding manual operations.

Benefits of technology

It achieves instant business switching when hardware changes, avoids interruptions, reduces operation and maintenance risks, and improves the smoothness, efficiency and reliability of switching. It is suitable for scenarios with frequent hardware environment changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115292061B_ABST
    Figure CN115292061B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for dynamically switching services, relating to the field of service configuration management. The method comprises the following steps: S1: creating a service interface layer and a hardware interface layer, setting all service configuration information in the service interface layer; setting the hardware configuration information of each piece of hardware in the hardware interface layer; S2: in the service interface layer, virtualizing and mapping each piece of service configuration information to all compatible hardware, generating multiple service paths for each piece of service configuration information, and marking one of the service paths as the primary path. The present invention can automatically and quickly switch services when hardware changes occur, thereby avoiding service interruptions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of service configuration management, and in particular to a method and device for dynamically switching services. Background Art

[0002] Hardware changes, such as replacing a card, switching service ports, or switching the actual working chip (a single drive supports multiple chip groups), require manual configuration modifications and service deletion and creation, which can cause service interruptions and the risk of configuration residue. If manual service switching is not completed smoothly and immediately, the network may become temporarily unavailable and unmanageable, posing certain operational risks. Summary of the Invention

[0003] In view of the defects in the prior art, the present invention solves the technical problem of how to automatically and quickly switch services when hardware changes occur, thereby avoiding service interruption.

[0004] To achieve the above objectives, the present invention provides a method for dynamically switching services, comprising the following steps:

[0005] S1: Create a business interface layer and a hardware interface layer, set all business configuration information in the business interface layer; set the hardware configuration information of each hardware in the hardware interface layer;

[0006] S2: In the service interface layer, each piece of service configuration information is virtualized and mapped to all compatible hardware, multiple service paths are generated for each piece of service configuration information, and one of the service paths is marked as the primary path.

[0007] Based on the above technical solution, S2 also includes the following steps: S3: When the hardware changes, determine all services using the hardware, and switch each service to other hardware according to the multiple service paths generated for each service in S2, and use the switched service path as the main path.

[0008] On the basis of the above technical solution, before S3, it also includes a hardware pre-configuration step, and the hardware pre-configuration step is mode 1 and / or mode 2;

[0009] Method 1: Set the weight w according to the hardware parameter value a of each hardware. The larger the hardware parameter value a, the larger the weight w. Calculate the performance value s of each hardware based on all the hardware parameter values ​​a and the corresponding weight w and save it. The calculation formula is: s = (a1*w1+a2*w2+…+an*wn) / (w1+w2+…+wn).

[0010] Method 2: According to the calculation formula, calculate the performance value for each hardware n times, where n represents the number of hardware parameters of the hardware. Each time the weight of one hardware parameter is increased, the weights of the other hardware parameters remain unchanged, and all performance values ​​of each hardware are saved.

[0011] Based on the above technical solution, after generating multiple service paths for each service configuration information in S2, the following steps are further included:

[0012] If the hardware pre-configuration step adopts method 1, the performance values ​​of all hardware mapped to each business configuration information are cached;

[0013] If the hardware pre-configuration step adopts the second method, multiple performance values ​​of all hardware mapped to each service configuration information are cached as multiple performance groups, and all performance values ​​corresponding to the same hardware parameter with increased weight are grouped together.

[0014] Based on the above technical solution, the process of switching each service to other hardware based on multiple service paths in S3 includes:

[0015] If the hardware preconfiguration step adopts method 1, the hardware with the closest performance value is selected for switching; if the hardware preconfiguration step adopts method 2, the hardware with the closest performance value is selected for switching in the performance group corresponding to the hardware parameters prioritized by each business.

[0016] The device for dynamically switching services in an embodiment of the present invention includes a service interface layer creation module, a hardware interface layer creation module, and a service path configuration module;

[0017] The business interface layer creation module is used to: create a business interface layer and set all business configuration information in the business interface layer;

[0018] The hardware interface layer creation module is used to: create a hardware interface layer and set the hardware configuration information of each hardware in the hardware interface layer;

[0019] The service path configuration module is used to: in the service interface layer, after virtualizing and mapping each service configuration information with all hardware that can adapt to it, generate multiple service paths for each service configuration information and mark one of the service paths as the main path.

[0020] Based on the above technical solution, the service path configuration module is also used to: when the hardware changes, determine all services using the hardware, switch each service to other hardware according to the multiple service paths of each service, and use the switched service path as the main path.

[0021] On the basis of the above technical solution, the service path configuration module is further used to: adopt the following method 1 and / or method 2 to perform the switching hardware pre-configuration process;

[0022] Method 1: Set the weight w according to the hardware parameter value a of each hardware. The larger the hardware parameter value a, the larger the weight w. Calculate the performance value s of each hardware based on all the hardware parameter values ​​a and the corresponding weight w and save it. The calculation formula is: s = (a1*w1+a2*w2+…+an*wn) / (w1+w2+…+wn).

[0023] Method 2: According to the calculation formula, calculate the performance value for each hardware n times, where n represents the number of hardware parameters of the hardware. Each time the weight of one hardware parameter is increased, the weights of the other hardware parameters remain unchanged, and all performance values ​​of each hardware are saved.

[0024] Based on the above technical solution, after generating multiple service paths for each piece of service configuration information, the service path configuration module is further configured to:

[0025] If the hardware pre-configuration process adopts method 1, the performance values ​​of all hardware mapped to each business configuration information are cached;

[0026] If the hardware pre-configuration process adopts the second method, multiple performance values ​​of all hardware mapped to each service configuration information are cached as multiple performance groups, and all performance values ​​corresponding to the same hardware parameter with increased weight are grouped together.

[0027] Based on the above technical solution, the process of the service path configuration module switching each service to other hardware according to multiple service paths of each service includes:

[0028] If the hardware preconfiguration process adopts method 1, the hardware with the closest performance value is selected for switching; if the hardware preconfiguration process adopts method 2, the hardware with the closest performance value is selected for switching in the performance group corresponding to the hardware parameters prioritized by each business.

[0029] Compared with the prior art, the advantages of the present invention are:

[0030] Compared with the existing technology that requires manual configuration modification and manual service deletion when hardware changes, the present invention establishes multiple mapping relationships between a service and multiple hardware that can adapt to it in advance. When the currently used hardware changes, the present invention can not only switch to other service paths in real time to avoid service interruption, but also does not require manual configuration modification operations. The switching process is very simple, thereby ensuring the smoothness, efficiency and reliability of service switching.

[0031] In summary, the present invention optimizes service switching processing, with the advantages of fast switching speed, low resource usage, support for dynamic updates, and fast rollback. When hardware changes, service switching can be dynamically converted and rapidly scalable.

[0032] At the same time, this invention reduces the complexity of service switching, avoids the risk of human error, and resolves operational and maintenance issues such as lossy service switching, high risk, and difficult rollback. It is particularly suitable for scenarios where hardware environments frequently change, ports or modules are prone to failure, and boards support multiple sets of switchable chips. It also lays a solid foundation for subsequent clustering scenarios and cloud-based management supporting batch services. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0034] Figure 1 Schematic diagram of service virtualization mapping path switching after hardware changes in an embodiment of the present invention;

[0035] Figure 2 A diagram showing the mapping relationship between virtualization service configuration and hardware-related parameters;

[0036] Figure 3 This is a flow chart of a method for dynamically switching services according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0038] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

[0039] See also Figure 3 As shown, the method for dynamically switching services in an embodiment of the present invention includes the following steps:

[0040] S1: Create a business interface layer and a hardware interface layer, and set all business configuration information in the business interface layer. That is, the business interface layer only focuses on pure software business information such as business type, business level, business specifications, and business direction; set the hardware configuration information of each hardware in the hardware interface layer, that is, associate hardware-related data such as board type, port number, module number, chip number, and business keywords.

[0041] The principle behind S1 is that existing business model objects are strongly hardware-dependent, necessitating the deletion and reconstruction of business model instances when hardware changes occur. To achieve separation and decoupling from hardware entities, business model container components are introduced to containerize the business model. The "container" here does not refer to the commonly used operating system container technology, but rather utilizes some of the characteristics and concepts of containers to transform the business model, such as isolation, standardization, shared resources, and virtualization.

[0042] To this end, a layered architecture can be used for business containers, forming a business interface layer and a hardware interface layer. Subsequently, business images are used to virtualize the mapping of business configurations to hardware data. Business images can be built once and reused multiple times. After the business container is started, services are dynamically migrated between different business images within the business container as device hardware changes, enabling dynamic scheduling of business resources. Neither the upstream control plane nor the downstream hardware infrastructure is aware of the processing within the business container, ensuring smooth, efficient, and reliable service switching.

[0043] S2: See Figure 1 As shown, in the business interface layer, each business configuration information is virtually mapped to all hardware that can adapt to it, so as to generate multiple business paths for each business configuration information and mark one of the business paths as the main path, that is, each business configuration information is marked with the hardware to be used; in subsequent use, the corresponding business is processed through each main path.

[0044] The principle of S2 is: business virtualization is the abstract processing of business-related data, for example: resource ID allocation parameters no longer use hardware-related data, business model objects are de-hardwareized, etc., which separates and decouples business configuration from hardware entities. Figure 2 As shown, the mapping relationship between business configuration and hardware-related parameters is no longer one-to-one, but many-to-many, and one of them is used as the current business image.

[0045] This design can achieve the following: when the hardware is switched, the upstream business configuration can be kept unchanged. It is no longer necessary to implement business switching by deleting and building business configurations from top to bottom. Instead, the virtual mapping relationship between the business interface and the hardware interface is changed, and the business image used is switched according to the changes in hardware parameters (such as Figure 1When hardware is replaced, the upstream service configuration remains unchanged. Similarly, there is no need to implement service switching by deleting and creating service configurations from top to bottom. Instead, the hardware interface data of the service image is modified to update the virtualization mapping relationship.

[0046] It can be seen from this that compared with the existing technology that requires manual configuration modification and manual business deletion when hardware changes, the present invention pre-establishes multiple mapping relationships between a business and multiple hardware that can adapt to it. When the hardware currently in use changes, the present invention can not only switch to other business paths in real time to avoid business interruption, but also does not require manual configuration modification operations. The switching process is very simple, thereby ensuring the smoothness, efficiency and reliability of business switching.

[0047] As can be seen from the preceding description, S1 and S2 are the "pre-configuration" processes before the service is used. After S2, the service can start normally. The following describes how to switch the service path when the hardware changes (such as hardware failure or hardware replacement).

[0048] S3: When the hardware changes, all services using the hardware are determined, and each service is switched to other hardware according to the virtual mapping relationship established in S2, and the switched service path is used as the primary path.

[0049] Preferably, before S3, a hardware pre-configuration step is also included (this step is generally performed during S2). This step can include the following two methods at the same time, or one of the following two methods can be selected.

[0050] Method 1: Comprehensive performance priority mode, specifically: set the weight w according to the hardware parameter value a of each hardware. The larger the hardware parameter value a, the larger the weight w. The hardware parameter values ​​may include service capacity, service timing range, upper limit of available bandwidth and number of service levels, etc. The hardware parameters of the present invention only include "necessary parameters" that will affect service performance or that the service has requirements for them, and do not include the remaining "non-essential parameters". Ordinary technicians in this field can combine the above requirements (i.e., those that will affect service performance or that the service has requirements for them) with existing knowledge to screen "necessary parameters" and "non-essential parameters". According to all the hardware parameter values ​​a and the corresponding weight w of each hardware, calculate the performance value s of the hardware and save it; the calculation formula is: s = (a1*w1+a2*w2+…+an*wn) / (w1+w2+…+wn), which is a formula of weight nature. It can be concluded that according to this formula, the larger w is, the larger s is, and the larger s means the higher the performance, and vice versa.

[0051] Method 2, single performance priority mode: Specifically, according to the calculation formula in Method 1, calculate the performance value for each hardware device n times, where n represents the number of hardware parameters of the hardware device. Each calculation increases the weight of one hardware parameter, while the weights of the other hardware parameters remain unchanged. All performance values ​​of each hardware device are saved.

[0052] On this basis, after generating multiple service paths for each service configuration information in S2 and marking one of the service paths as the primary path, the following steps may also be included:

[0053] If method 1 is adopted, the performance values ​​of all hardware mapped to each business configuration information are cached. In order to facilitate subsequent switching of hardware according to the performance value, the caching method can be: all performance values ​​are arranged in ascending order.

[0054] If method 2 is adopted, multiple performance values ​​of all hardware mapped to each business configuration information are cached as multiple performance groups, and all performance values ​​corresponding to the same hardware parameter with increased weight are in one group. At this time, each group can also be marked. For example, if the hardware parameter with increased weight is the upper limit of the available bandwidth, it can be marked as bandwidth performance for subsequent selection.

[0055] Furthermore, in S3, the process of switching each business to other hardware according to the virtual mapping relationship includes: if method one is adopted, the hardware with the closest performance value is selected for switching; if method two is adopted, the hardware with the closest performance value is selected for switching in the performance group corresponding to the hardware parameters prioritized by each business.

[0056] If both methods 1 and 2 are used, the cache of method 1 can be formed into a regular cache group. Then, according to user needs, hardware can be selected in the corresponding group. For example, method 1 is selected by default. If the user specifies a certain performance priority, the hardware is selected in the performance group of the corresponding hardware parameters.

[0057] Preferably, when the hardware is replaced, after the new hardware is inserted, the process of S2 is re-executed. Specifically, the number is recalculated only for the new hardware, and the business relationship associated with the new hardware is mapped.

[0058] The device for dynamically switching services in an embodiment of the present invention includes a service interface layer creation module, a hardware interface layer creation module, and a service path configuration module;

[0059] The business interface layer creation module is used to: create a business interface layer and set all business configuration information in the business interface layer;

[0060] The hardware interface layer creation module is used to: create a hardware interface layer and set the hardware configuration information of each hardware in the hardware interface layer;

[0061] The service path configuration module is used to: in the service interface layer, after virtualizing and mapping each service configuration information with all hardware that can adapt to it, generate multiple service paths for each service configuration information and mark one of the service paths as the main path.

[0062] The service path configuration module is also used to: when the hardware changes, determine all services using the hardware, switch each service to other hardware based on multiple service paths for each service, and use the switched service path as the main path.

[0063] The service path configuration module is further configured to: perform a switching hardware pre-configuration process using the following method 1 and / or method 2;

[0064] Method 1: Set the weight w according to the hardware parameter value a of each hardware. The larger the hardware parameter value a, the larger the weight w. Calculate the performance value s of each hardware based on all the hardware parameter values ​​a and the corresponding weight w and save it. The calculation formula is: s = (a1*w1+a2*w2+…+an*wn) / (w1+w2+…+wn).

[0065] Method 2: According to the calculation formula, calculate the performance value for each hardware n times, where n represents the number of hardware parameters of the hardware. Each time the weight of one hardware parameter is increased, the weights of the other hardware parameters remain unchanged, and all performance values ​​of each hardware are saved.

[0066] After generating multiple service paths for each piece of service configuration information, the service path configuration module is also used to:

[0067] If the hardware pre-configuration process adopts method 1, the performance values ​​of all hardware mapped to each business configuration information are cached;

[0068] If the hardware pre-configuration process adopts the second method, multiple performance values ​​of all hardware mapped to each service configuration information are cached as multiple performance groups, and all performance values ​​corresponding to the same hardware parameter with increased weight are grouped together.

[0069] The service path configuration module switches each service to other hardware based on multiple service paths for each service. The process includes:

[0070] If the hardware preconfiguration process adopts method 1, the hardware with the closest performance value is selected for switching; if the hardware preconfiguration process adopts method 2, the hardware with the closest performance value is selected for switching in the performance group corresponding to the hardware parameters prioritized by each business.

[0071] It will be understood by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer-readable storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).

[0072] As is well known to those skilled in the art, the term computer-readable storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically contains computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0073] For example, the computer-readable storage medium may be an internal storage unit of the electronic device of the aforementioned embodiment, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the electronic device.

[0074] The above are only specific implementations of the embodiments of the present invention, but the scope of protection of the embodiments of the present invention is not limited to them. Any person skilled in the art can easily conceive of various equivalent modifications or replacements within the technical scope disclosed in the embodiments of the present invention, and such modifications or replacements should be included in the scope of protection of the embodiments of the present invention. Therefore, the scope of protection of the embodiments of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for dynamically switching services, characterized in that: The method comprises the following steps: S1: Create a business interface layer and a hardware interface layer, set all business configuration information in the business interface layer; set the hardware configuration information of each hardware in the hardware interface layer; S2: In the service interface layer, each service configuration information is virtualized and mapped to all compatible hardware. Multiple service paths are generated for each service configuration information, and one of the service paths is marked as the primary path. S3: When hardware changes, identify all services using that hardware and switch each service to the new hardware. Before S3, the method further includes a hardware pre-configuration switching step, which is a method 1 and / or a method 2; Method 1: Set the weight w according to the hardware parameter value a of each hardware. The larger the hardware parameter value a is, the larger the weight w is. Based on all the hardware parameter values ​​a of each hardware and the corresponding weight w, calculate the performance value s of the hardware and save it. The calculation formula is: ; Method 2: According to the calculation formula, calculate the performance value for each hardware n times, where n represents the number of hardware parameters of the hardware. Each time the weight of one hardware parameter is increased, the weights of the other hardware parameters remain unchanged, and all performance values ​​of each hardware are saved.

2. The method for dynamically switching services according to claim 1, wherein: According to the multiple service paths generated for each service in S2, each service is switched to other hardware, and the switched service path is used as the main path.

3. The method for dynamically switching services according to claim 1, wherein: After generating multiple service paths for each piece of service configuration information in S2, the following steps are also included: If the hardware pre-configuration step adopts method 1, the performance values ​​of all hardware mapped to each business configuration information are cached; If the hardware pre-configuration step adopts the second method, multiple performance values ​​of all hardware mapped to each service configuration information are cached as multiple performance groups, and all performance values ​​corresponding to the same hardware parameter with increased weight are grouped together.

4. The method for dynamically switching services according to claim 3, wherein: In S3, the process of switching each service to other hardware based on multiple service paths includes: If the hardware preconfiguration step adopts method 1, the hardware with the closest performance value is selected for switching; if the hardware preconfiguration step adopts method 2, the hardware with the closest performance value is selected for switching in the performance group corresponding to the hardware parameters prioritized by each business.

5. A device for dynamically switching services, characterized in that: The device includes a service interface layer creation module, a hardware interface layer creation module and a service path configuration module; The business interface layer creation module is used to: create a business interface layer and set all business configuration information in the business interface layer; The hardware interface layer creation module is used to: create a hardware interface layer and set the hardware configuration information of each hardware in the hardware interface layer; The service path configuration module is used to: in the service interface layer, after virtualizing and mapping each piece of service configuration information to all compatible hardware, generate multiple service paths for each piece of service configuration information, and mark one of the service paths as the primary path; when the hardware changes, determine all services using the hardware and switch each service to other hardware; the service path configuration module is further used to: perform the hardware switching pre-configuration process using the following method 1 and / or method 2; Method 1: Set the weight w according to the hardware parameter value a of each hardware. The larger the hardware parameter value a is, the larger the weight w is. Calculate the performance value s of the hardware according to all the hardware parameter values ​​a and the corresponding weight w of each hardware and save it. The calculation formula is: ; Method 2: According to the calculation formula, calculate the performance value for each hardware n times, where n represents the number of hardware parameters of the hardware. Each time the weight of one hardware parameter is increased, the weights of the other hardware parameters remain unchanged, and all performance values ​​of each hardware are saved.

6. The device for dynamically switching services according to claim 5, wherein: The service path configuration module is further configured to: switch each service to other hardware according to the multiple service paths of each service, and use the switched service path as the main path.

7. The device for dynamically switching services according to claim 5, wherein: After generating multiple service paths for each piece of service configuration information, the service path configuration module is further configured to: If the hardware pre-configuration process adopts method 1, the performance values ​​of all hardware mapped to each business configuration information are cached; If the hardware pre-configuration process adopts the second method, multiple performance values ​​of all hardware mapped to each service configuration information are cached as multiple performance groups, and all performance values ​​corresponding to the same hardware parameter with increased weight are grouped together.

8. The device for dynamically switching services according to claim 7, wherein: The process of the service path configuration module switching each service to other hardware according to multiple service paths of each service includes: If the hardware preconfiguration process adopts method 1, the hardware with the closest performance value is selected for switching; if the hardware preconfiguration process adopts method 2, the hardware with the closest performance value is selected for switching in the performance group corresponding to the hardware parameters prioritized by each business.

Citation Information

Patent Citations

  • Active / standby link switching method and network device

    CN101547082A

  • SR-based service routing calculation method

    CN110289996A