Configuration data processing method and related device
By obtaining and utilizing preset association relationships, determining the target network device identification and issuing configuration data, the problem of insufficient configuration flexibility of network equipment in the prior art is solved, and higher configuration flexibility is achieved.
Patent Information
- Application Number
- CN202311623286.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, the operational flexibility of configuring network equipment through network controllers is insufficient, resulting in inflexible configuration process.
By receiving the target configuration issuance request, the preset association relationship is obtained, the target network device identity is determined based on the association relationship and the target configuration identity, and the target configuration data is sent to the target network device.
The flexibility of configuring network devices is improved, so that the same configuration part between different network devices can be configured through one configuration data, solving the problem of insufficient flexibility.
Smart Images

Figure CN120075044A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer network technologies. Specifically, this application relates to a method for processing configuration data and related devices. Background Art
[0002] With the rapid development of computer networks, more and more services and scenarios need to utilize computer networks. Therefore, how to improve the flexibility of computer networks has become increasingly important.
[0003] In related technologies, a control system for a network controller is often developed independently according to service requirements, so as to configure the operation of network devices through the network controller.
[0004] However, currently, the flexibility of configuring the operation of network devices through network controllers is insufficient. Summary of the Invention
[0005] Embodiments of this application provide a method for processing configuration data and related devices, which are used to solve the technical problem of insufficient flexibility in configuring the operation of network devices through network controllers, thereby achieving the technical effect of improving the flexibility of configuring network devices.
[0006] On the one hand, embodiments of this application provide a method for processing configuration data, including:
[0007] Receiving a target configuration distribution request, where the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of a network device;
[0008] In response to the target configuration distribution request, obtaining a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier;
[0009] Based on the association relationship and the target configuration identifier, determining the target network device identifier, and determining the target network device corresponding to the target network device identifier from multiple network devices;
[0010] Sending the target configuration data to the target network device.
[0011] Optionally, if the target configuration distribution request is at least the second received configuration distribution request, obtaining the preset association relationship includes:
[0012] Determining the target configuration version identifier corresponding to the target configuration distribution request, and starting a data configuration workflow, where the target configuration version identifier is used as the target operation version identifier of the data configuration workflow;
[0013] If a preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier, starting the data configuration workflow to obtain the preset association relationship through the data configuration workflow;
[0014] The method further includes:
[0015] If the configuration start condition is not met between the target operation version identifier and the current operation version identifier, suspend the data configuration workflow until the configuration start condition is met between the target operation version identifier and the current operation version identifier.
[0016] Optionally, if there are at least two target configuration distribution requests, and the target configuration identifiers carried in each target configuration distribution request among the at least two target configuration distribution requests are the same, determining the target configuration version identifier corresponding to the target configuration distribution request includes:
[0017] Determine the target configuration version identifier corresponding to each target configuration distribution request among the at least two target configuration distribution requests respectively;
[0018] Among them, the target configuration version identifiers corresponding to different target configuration distribution requests are different.
[0019] Optionally, determining the target configuration version identifier corresponding to each target configuration distribution request among the at least two target configuration distribution requests respectively includes at least one of the following:
[0020] Based on the request reception time corresponding to each target configuration distribution request among the at least two target configuration distribution requests, determine the target configuration version identifier corresponding to each target configuration distribution request in sequence;
[0021] Based on the data type identifier carried in each target configuration distribution request, determine the configuration priority corresponding to each target configuration distribution request, and based on the configuration priority corresponding to each target configuration distribution request, determine the target configuration version identifier corresponding to each target configuration distribution request in sequence, where the configuration priorities corresponding to different data type identifiers are different.
[0022] Optionally, determining the target configuration version identifier corresponding to the target configuration distribution request includes:
[0023] Obtain the version identifier of the latest configuration;
[0024] Based on the preset version identifier adjustment step and the version identifier of the latest configuration, determine the target configuration version identifier corresponding to the target configuration distribution request;
[0025] The configuration start condition includes:
[0026] The difference between the target operation version identifier and the current operation version identifier is the version identifier adjustment step.
[0027] Optionally, the target configuration distribution request further carries a device identifier and an association table update identifier, and the association table update identifier is used to indicate the changed association relationship. The method further includes:
[0028] Determine the network device identifier to be updated based on the device identifier carried in the target configuration distribution request;
[0029] Update the association relationship based on the network device identifier to be updated and the association relationship change identifier;
[0030] Determine the target network device identifier based on the association relationship and the target configuration identifier, including:
[0031] Determine the target network device identifier based on the updated association relationship and the target configuration identifier.
[0032] Optionally, if the target configuration distribution request is at least the second configuration distribution request received, obtain the preset association relationship, including:
[0033] Obtain the latest association relationship;
[0034] Determine the target network device identifier based on the association relationship and the target configuration identifier, including:
[0035] Determine the target network device identifier based on the latest association relationship and the target configuration identifier.
[0036] Optionally, determine the network device identifier to be updated based on the device identifier carried in the target configuration distribution request, including at least one of the following:
[0037] If the device identifier is the identifier corresponding to the network device, determine the device identifier as the network device identifier to be updated;
[0038] If the device identifier is the identifier corresponding to the network device group, determine the target network device group corresponding to the device identifier, and determine the network device identifiers corresponding to all network devices in the target network device group as the network device identifiers to be updated.
[0039] Optionally, the method further includes:
[0040] During the process of distributing the target configuration data to the target network device, configure the state machine of the association relationship to be non-steady. When the state machine of the association relationship is in the non-steady state, prohibit changing the association relationship;
[0041] When the distribution of the target configuration data to the target network device ends, configure the state machine of the association relationship to be steady. When the state machine of the association relationship is in the steady state, allow changing the association relationship.
[0042] On the other hand, an embodiment of the present application further provides a processing device for configuration data, including:
[0043] A receiving module, configured to receive a target configuration distribution request, where the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of a network device;
[0044] A response module, configured to, in response to the target configuration distribution request, obtain a preset association relationship, where the association relationship is used to represent the relationship between a configuration identifier and a network device identifier;
[0045] A configuration data distribution module, configured to determine a target network device identifier based on the association relationship and the target configuration identifier, and determine a target network device corresponding to the target network device identifier from multiple network devices; and distribute the target configuration data to the target network device.
[0046] Optionally, if the target configuration distribution request is at least the second received configuration distribution request, when the response module obtains the preset association relationship, it can be used for:
[0047] Determine a target configuration version identifier corresponding to the target configuration distribution request, and start a data configuration workflow, where the target configuration version identifier serves as the target operation version identifier of the data configuration workflow;
[0048] If a preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier, start the data configuration workflow to obtain the preset association relationship through the data configuration workflow;
[0049] The response module is further configured to:
[0050] If the preset configuration start condition is not satisfied between the target operation version identifier and the current operation version identifier, suspend the data configuration workflow until the preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier.
[0051] Optionally, if there are at least two target configuration distribution requests, and the target configuration identifiers carried in each target configuration distribution request among the at least two target configuration distribution requests are the same, when the response module determines the target configuration version identifier corresponding to the target configuration distribution request, it can be used for:
[0052] Respectively determine the target configuration version identifiers corresponding to each target configuration distribution request among the at least two target configuration distribution requests;
[0053] Among them, the target configuration version identifiers corresponding to different target configuration distribution requests are different.
[0054] Optionally, when the response module respectively determines the target configuration version identifiers corresponding to each target configuration distribution request among the at least two target configuration distribution requests, it can be used for at least one of the following:
[0055] Based on the request reception time corresponding to each target configuration distribution request among at least two target configuration distribution requests, sequentially determine the target configuration version identifier corresponding to each target configuration distribution request;
[0056] Based on the data type identifier carried by each target configuration distribution request, determine the configuration priority corresponding to each target configuration distribution request, and based on the configuration priority corresponding to each target configuration distribution request, sequentially determine the target configuration version identifier corresponding to each target configuration distribution request, where the configuration priorities corresponding to different data type identifiers are different.
[0057] Optionally, when determining the target configuration version identifier corresponding to the target configuration distribution request, the response module can be used for:
[0058] Obtain the version identifier of the latest configuration;
[0059] Based on the preset version identifier adjustment step and the version identifier of the latest configuration, determine the target configuration version identifier corresponding to the target configuration distribution request;
[0060] Configuration startup conditions include:
[0061] The difference between the target operation version identifier and the current operation version identifier is the version identifier adjustment step.
[0062] Optionally, the target configuration distribution request also carries a device identifier and an association relationship change identifier, and the association relationship change identifier is used to indicate a change in the association relationship. The response module is also used for:
[0063] Based on the device identifier carried by the target configuration distribution request, determine the network device identifier to be updated;
[0064] Based on the network device identifier to be updated and the association relationship change identifier, update the association relationship;
[0065] When determining the target network device identifier based on the association relationship and the target configuration identifier, the response module can be used for:
[0066] Based on the updated association relationship and the target configuration identifier, determine the target network device identifier.
[0067] Optionally, if the target configuration distribution request is at least the second received configuration distribution request, when the response module obtains the preset association relationship, it can be used for:
[0068] Obtain the latest association relationship;
[0069] When determining the target network device identifier based on the association relationship and the target configuration identifier, the response module can be used for:
[0070] Based on the latest association relationship and the target configuration identifier, determine the target network device identifier.
[0071] Optionally, when determining the network device identifier to be updated based on the device identifier carried in the target configuration distribution request, the response module may be used for at least one of the following:
[0072] If the device identifier is the identifier corresponding to the network device, determine the device identifier as the network device identifier to be updated;
[0073] If the device identifier is the identifier corresponding to the network device group, determine the target network device group corresponding to the device identifier, and determine the network device identifiers corresponding to all network devices in the target network device group as the network device identifiers to be updated.
[0074] Optionally, the response module is further configured to:
[0075] During the process of distributing the target configuration data to the target network device, configure the state machine of the association relationship to be non-steady state. When the state machine of the association relationship is in the non-steady state, changing the association relationship is prohibited;
[0076] When the distribution of the target configuration data to the target network device ends, configure the state machine of the association relationship to be steady state. When the state machine of the association relationship is in the steady state, changing the association relationship is allowed.
[0077] On the other hand, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the method according to any embodiment of the present application.
[0078] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method according to any embodiment of the present application is implemented.
[0079] On the other hand, an embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the method according to any embodiment of the present application is implemented.
[0080] In an embodiment of the present application, by receiving a target configuration distribution request, the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of a network device; in response to the target configuration distribution request, obtaining a preset association relationship, the association relationship is used to represent the relationship between the configuration identifier and the network device identifier; based on the association relationship and the target configuration identifier, determining a target network device identifier, and determining a target network device corresponding to the target network device identifier from multiple network devices; sending the target configuration data to the target network device. By abstracting the relationship between the configuration and the network device into a preset association relationship, it is not necessary to develop an independent control system for each device. Through the association relationship, one configuration data can be used to configure the same configuration parts between different network devices, which can solve the technical problem of insufficient flexibility in configuring the operation of network devices through a network controller, thereby achieving the technical effect of improving the flexibility of configuring network devices. In addition, the association relationship can be adjusted as needed, so the flexibility of configuration can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1 FIG. is a schematic diagram of an implementation environment for implementing a method for processing configuration data provided by an embodiment of the present application;
[0082] Figure 2 FIG. is a flowchart of a method for processing configuration data provided by an embodiment of the present application;
[0083] Figure 3 FIG. is a schematic diagram of a framework of an electronic device provided by an embodiment of the present application;
[0084] Figure 4 FIG. is a flowchart of another method for processing configuration data provided by an embodiment of the present application;
[0085] Figure 5 FIG. is a flowchart of a method for configuring a network device provided by an embodiment of the present application;
[0086] Figure 6 FIG. is a flowchart of a synchronization phase of a creation operation provided by an embodiment of the present application;
[0087] Figure 7 FIG. is a flowchart of a synchronization phase of a modification / deletion operation provided by an embodiment of the present application;
[0088] Figure 8 FIG. is a flowchart of an asynchronous phase provided by an embodiment of the present application;
[0089] Figure 9 FIG. is a schematic diagram of a structure of a device for processing configuration data provided by an embodiment of the present application;
[0090] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0091] The embodiments of the present application will be described below with reference to the accompanying drawings in the present application. It should be understood that the implementation manners described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application, and do not constitute limitations on the technical solutions of the embodiments of the present application.
[0092] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", and "the" used herein may also include the plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements, and / or components (, but do not exclude being implemented as other features, information, data, steps, operations, elements, components, and / or their combinations supported by the art of the present technology. It should be understood that when we say an element is "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" indicates being implemented as "A", or being implemented as "B", or being implemented as "A and B". "Plurality" means not less than two.
[0093] To make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0094] First, several terms related to the present application will be introduced and explained:
[0095] High availability: Describes a system that has been specifically designed to reduce downtime and maintain a high level of availability of its services.
[0096] Controller platform: A platform-based network controller system that does not serve a specific business alone.
[0097] Software-defined network: Software-defined network (SDN) is a network architecture that separates the network control plane (controller) and the data plane (switch / router) so that network administrators can centrally manage and configure the network. The core idea of SDN is to control the network through software rather than hardware. This makes the network more flexible, scalable, and programmable, thereby improving the performance and manageability of the network. SDN technology can be used in various network scenarios such as data center networks, enterprise networks, and carrier networks.
[0098] In related technologies, the control system of the network controller is mainly developed independently according to business requirements, so as to configure the operation of network devices through the network controller. However, if the configuration of network devices needs to be adjusted, the independently developed control system needs to be adjusted, which has a great impact on the flexibility of configuring network devices. In actual situations, the network controller often develops the control system independently according to business requirements, but there are often common demands among different network controller systems, resulting in a lot of duplicate work.
[0099] Therefore, in view of at least one of the above technical problems or areas for improvement in related technologies, the present application proposes a method for processing configuration data and related devices. The solution receives a target configuration distribution request, which carries target configuration data and a target configuration identifier for configuring the operation of network devices; in response to the target configuration distribution request, obtains a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier; based on the association relationship and the target configuration identifier, determines the target network device identifier, and determines the target network device corresponding to the target network device identifier from multiple network devices; and distributes the target configuration data to the target network device, which can solve the technical problem of insufficient flexibility in configuring the operation of network devices through the network controller, thereby achieving the technical effect of improving the flexibility of configuring network devices.
[0100] Next, through the description of several exemplary embodiments, the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application are described. It should be noted that the following embodiments can refer to, draw on, or combine with each other. For the same terms, similar features, and similar implementation steps in different embodiments, they will not be described repeatedly.
[0101] The method for processing configuration data and related devices provided by the embodiments of the present application may relate to the field of cloud technology. For example, the method for processing configuration data provided by the embodiments of the present application is implemented through a cloud server.
[0102] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing.
[0103] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used as needed, and is flexible and convenient. Cloud computing technology will become an important support. The back-end services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the back-end system for logical processing. Data at different levels will be processed separately, and various industry data requires a powerful system back-end support, which can be achieved through cloud computing.
[0104] Specifically, the embodiments of the present application may involve a database (Database) and a network in cloud technology. Briefly speaking, a database can be regarded as an electronic filing cabinet - a place for storing electronic files. Users can perform operations such as adding, querying, updating, and deleting data in the files. The so-called "database" is a data set stored together in a certain way, shared by multiple users, having as little redundancy as possible, and independent of application programs.
[0105] A database management system (Database Management System, abbreviated as DBMS) is a computer software system designed to manage a database. It generally has basic functions such as storage, interception, security guarantee, and backup. The database management system can be classified according to the database model it supports, such as relational, XML (Extensible Markup Language); or according to the computer type it supports, such as server clusters, mobile phones; or according to the query language it uses, such as SQL (Structured Query Language), XQuery; or according to the performance impulse focus, such as maximum scale, highest running speed; or other classification methods. No matter which classification method is used, some DBMSs can cross categories. For example, they can support multiple query languages at the same time.
[0106] In this embodiment, for example, at least one of configuration data or association relationships can be stored in the database.
[0107] Figure 1 It is a schematic diagram of the implementation environment for the method of processing configuration data provided by the embodiments of the present application. As Figure 1 shown, among them, the network device 102 communicates with the network controller 104 through the network. The data storage system can store the data that the network controller 104 needs to process. The data storage system can be integrated on the network controller 104, or placed on the cloud or other network controllers 104.
[0108] The processing method of the configuration data is executed independently by the network device 102 or the network controller 104, or is executed jointly by the network device 102 and the network controller 104. In some embodiments, the processing method of the configuration data is executed by the network controller 104. The network controller 104 receives a target configuration distribution request, which carries target configuration data and a target configuration identifier for configuring the operation of the network device 102; in response to the target configuration distribution request, obtains a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device 102 identifier; based on the association relationship and the target configuration identifier, determines the target network device 102 identifier, and determines the target network device 102 corresponding to the target network device 102 identifier from multiple network devices 102; and distributes the target configuration data to the target network device 102.
[0109] Among them, the network device 102 can be, but is not limited to, at least one of various desktop computers, laptop computers, smart phones, tablet computers, Internet of Things devices, portable wearable devices, switches, or routers, etc. The Internet of Things devices can be at least one of smart speakers, smart TVs, smart air conditioners, or smart in-vehicle devices, etc. The portable wearable devices can be at least one of smart watches, smart bracelets, or head-mounted devices, etc.
[0110] The network controller 104 can be a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be at least one of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, or a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and this application does not make any restrictions here.
[0111] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for processing configuration data provided by an embodiment of the present application. The method of this embodiment can be executed by an electronic device, and the electronic device can include at least one of a network controller or a network device. As Figure 2 shown, the method can include:
[0112] S210. Receive a target configuration distribution request, where the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of the network device.
[0113] Among them, the target configuration distribution request may refer to a request for the electronic device to distribute configuration data. In this embodiment, the target configuration distribution request may be sent to the electronic device by the staff through the computer device after the configuration of the computer device is completed, which is not limited herein. Among them, the target configuration data may be used to configure the operation of the network device, for example, to configure the routing information of the network device. Optionally, the routing information may include address forwarding information. Specifically, in the case of request forwarding between the public network and the private network, the address forwarding information may be the address forwarding information between the public network and the private network, that is, the mapping relationship between the public network address and the private network address. The target configuration identifier may be an identifier indicating the service related to the target configuration data or the source of the target configuration data. In this embodiment, the target configuration identifier. Optionally, the service related to the target configuration data, such as the routing service, etc., is not limited herein.
[0114] In this embodiment, optionally, the target configuration distribution request may be received through a configuration model (config).
[0115] S220. In response to the target configuration distribution request, obtain a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier.
[0116] In this embodiment, the relationship between the configuration and the device is abstracted in advance to obtain the relationship representing the configuration identifier and the network device identifier. Generally, the configuration identifier corresponds to the configuration data. By representing the relationship between the configuration identifier and the network device identifier, the relationship between the configuration data and the network device identifier can be determined.
[0117] Optionally, the association relationship may be configured in an association model (binding).
[0118] S230. Based on the association relationship and the target configuration identifier, determine the target network device identifier, and determine the target network device corresponding to the target network device identifier from multiple network devices.
[0119] Among them, the target network device identifier may refer to the identifier corresponding to the target network device that needs to receive the configuration data. Specifically, since the association relationship represents the relationship between the configuration identifier and the network device identifier, the target network device identifier can be determined through the target configuration identifier and the association relationship. In this embodiment, the multiple network devices may be of the same type or different types, which is not limited herein. Optionally, the types of network devices may be divided according to the functions of the network devices. Exemplarily, the same type of network device may be a switch for forwarding requests; different types of network devices may be such that one type of network device is a switch and the other type of network device is a request filter, etc., which is not limited herein.
[0120] It is understandable that in this embodiment, the configuration data is the configuration data of the same type of network devices or the configuration data of different types of network devices. Specifically, for different types of network devices, if there are some common configurations, the configuration data can be the common configuration data among different types of network devices.
[0121] S240. Send the target configuration data to the target network device.
[0122] In this embodiment, optionally, the target configuration data can be sent to the device model (device) used for managing and maintaining the operation of network devices, so that the device model can associate and maintain the corresponding network devices based on the sent configuration data.
[0123] Please refer to Figure 3 , Figure 3 , which is a schematic framework diagram of an electronic device provided by an embodiment of this application. As Figure 3 shown in the schematic framework diagram, it can include config, binding, and device.
[0124] Among them, Config: The Config model is a simple configuration entity that stores the binary data of the configuration, the configuration type, version, and state machine. Config itself has no association with the device. Its changes are driven by the business API.
[0125] Binding: The Binding model establishes the association between Config and Device. It also has the version and binary data of the configuration. Its changes are driven by the Config change configuration workflow. Binding is the embodiment of the association between Config and Device.
[0126] Device: The Device is the device entity model. One or more devices can be associated with a Binding. It is used for device management and maintenance.
[0127] As Figure 3 shown in the software framework, a multi-layer abstraction association method such as Config - Binding - Devic is adopted, and the effects include but are not limited to the following:
[0128] 1. It becomes easier to smoothly scale in and out the devices within a group;
[0129] 2. Add / delete the Device associated within the Binding;
[0130] 3. It becomes easier to migrate the configuration to different groups / devices;
[0131] 4. Addition / Deletion of Bindings Associated with Config
[0132] In the technical solution of this embodiment, by receiving a target configuration distribution request, the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of a network device; in response to the target configuration distribution request, obtain a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier; based on the association relationship and the target configuration identifier, determine the target network device identifier, and determine the target network device corresponding to the target network device identifier from multiple network devices; send the target configuration data to the target network device. By abstracting the relationship between the configuration and the network device as a preset association relationship, it is not necessary to develop an independent control system for each device. Through the association relationship, one configuration data can be used to configure the same configuration parts between different network devices, which can solve the technical problem of insufficient flexibility in configuring the operation of network devices through a network controller, thereby achieving the technical effect of improving the flexibility of configuring network devices. In addition, the association relationship can be adjusted as needed, so the flexibility of configuration can be further improved.
[0133] In a possible implementation manner, if the target configuration distribution request is at least the second received configuration distribution request, obtaining the preset association relationship includes:
[0134] Determine the target configuration version identifier corresponding to the target configuration distribution request, and start a data configuration workflow, where the target configuration version identifier is used as the target operation version identifier of the data configuration workflow;
[0135] If the preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier, start the data configuration workflow to obtain the preset association relationship through the data configuration workflow;
[0136] The method further includes:
[0137] If the preset configuration start condition is not satisfied between the target operation version identifier and the current operation version identifier, suspend the data configuration workflow until the preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier.
[0138] In this embodiment, continuous or intermittent distribution of multiple configuration requests can be supported.
[0139] Among them, the data configuration workflow is the workflow corresponding to the target configuration distribution request. The target operation version identifier can be used to evaluate whether to start the data configuration workflow. When the data configuration workflow is started, the configuration data required to be distributed by the data configuration workflow will be distributed. Suspending the data configuration workflow may mean that the data configuration workflow is in a waiting state. When waiting until the configuration start condition is met between the target operation version identifier and the current operation version identifier, the data configuration workflow can be started to process the configuration data through this workflow.
[0140] In the technical solution of this embodiment, when obtaining the preset association relationship, the target configuration version identifier corresponding to the target configuration distribution request is determined, and the data configuration workflow is started. The target configuration version identifier is used as the target operation version identifier of the data configuration workflow; if the configuration start condition preset between the target operation version identifier and the current operation version identifier is met, the data configuration workflow is started to obtain the preset association relationship through the data configuration workflow; if the configuration start condition is not met between the target operation version identifier and the current operation version identifier, the data configuration workflow is suspended until the configuration start condition is met between the target operation version identifier and the current operation version identifier, and the preset association relationship is obtained. That is to say, in the case of continuous or intermittent distribution of multiple configuration requests, the orderly configuration of each configuration request can also be achieved, and the configuration data of the network device can be updated as needed, further improving the flexibility of configuring the network device. Optionally, updating the configuration data can be incremental update or full update, which can be set according to needs and is not limited here.
[0141] It should be noted that for different configuration identifiers, their corresponding version identifiers are independent. That is to say, for different configuration identifiers, their corresponding target configuration version identifiers, target operation version identifiers, and current operation version identifiers are independent of each other.
[0142] It can be understood that for different configuration identifiers, their corresponding version identifiers are independent, so for different configurations, their corresponding configuration data can be distributed asynchronously and simultaneously, thus improving the efficiency of distributing configuration data.
[0143] In a possible implementation manner, if there are at least two target configuration distribution requests, and the target configuration identifiers carried in each target configuration distribution request among the at least two target configuration distribution requests are the same, then determining the target configuration version identifier corresponding to the target configuration distribution request includes:
[0144] Respectively determine the target configuration version identifiers corresponding to each target configuration distribution request among the at least two target configuration distribution requests;
[0145] Among them, the target configuration version identifiers corresponding to different target configuration distribution requests are different.
[0146] In this embodiment, the situation where multiple target configuration distribution requests are concurrent can be supported.
[0147] Specifically, if the target configuration identifiers carried in each of at least two target configuration distribution requests are the same, it indicates that configuration data of different versions is distributed concurrently. Therefore, it is necessary to separately determine the target configuration version identifiers corresponding to each of the at least two target configuration distribution requests, and the target configuration version identifiers corresponding to different target configuration distribution requests are different. Thus, the network device can be configured using the configuration data of each version one by one, which can reduce the configuration anomalies caused by cross-version configuration, and further ensure the stability of the configuration.
[0148] The technical solution of this embodiment is that if there are at least two target configuration distribution requests and the target configuration identifiers carried in each of the at least two target configuration distribution requests are the same, then the target configuration version identifiers corresponding to each of the at least two target configuration distribution requests are separately determined; wherein, the target configuration version identifiers corresponding to different target configuration distribution requests are different, which can reduce the configuration anomalies caused by cross-version configuration, and further ensure the stability of the configuration.
[0149] In a possible implementation manner, separately determining the target configuration version identifiers corresponding to each of the at least two target configuration distribution requests includes at least one of the following:
[0150] Based on the request reception times corresponding to each of the at least two target configuration distribution requests, sequentially determine the target configuration version identifiers corresponding to each of the target configuration distribution requests;
[0151] Based on the data type identifiers carried in each of the target configuration distribution requests, determine the configuration priorities corresponding to each of the target configuration distribution requests, and based on the configuration priorities corresponding to each of the target configuration distribution requests, sequentially determine the target configuration version identifiers corresponding to each of the target configuration distribution requests, where the configuration priorities corresponding to different data type identifiers are different.
[0152] In this embodiment, for determining the target configuration version identifiers corresponding to each of the target configuration distribution requests based on the request reception times, it may be to first set the target configuration version identifier corresponding to the target configuration distribution request with an earlier reception time, and then configure the target configuration version identifier corresponding to the target configuration distribution request with a later reception time.
[0153] For determining the priority corresponding to the target configuration distribution request based on the data type identifier, the priorities corresponding to each data type identifier can be pre-configured. Then, when receiving at least two target configuration distribution requests, the priorities corresponding to each target configuration distribution request can be determined based on the data type identifiers in each target configuration distribution request. Specifically, in this embodiment, the priorities corresponding to different data types can be set as needed.
[0154] It should be noted that if the target configuration version identifier is determined based on the request reception time and the data type identifier, then the configuration priority between the reception time and the data type identifier can be based on, so as to determine the target configuration version identifier corresponding to each target configuration distribution request among at least two target configuration distribution requests based on the configuration priority.
[0155] Exemplarily, assume that multiple configuration requests include target configuration distribution request 1 and target configuration distribution request 2. The reception time of target configuration distribution request 1 is earlier than that of target configuration distribution request 2, and the priority corresponding to the data type identifier carried in target configuration distribution request 1 is lower than the priority corresponding to the data type identifier carried in target configuration distribution request 2. Then, there are the following situations:
[0156] If the configuration priority of the reception time is higher than the configuration priority of the data type identifier, then the target configuration version identifier of target configuration distribution request 1 is configured first; if the configuration priority of the reception time is lower than the configuration priority of the data type identifier, then the target configuration version identifier of target configuration distribution request 2 is configured first.
[0157] The technical solution of this embodiment can determine the target configuration version identifier based on the request reception time and the data type identifier, so that the setting of the configuration version identifier can be considered from different levels, and the accuracy of the configuration data distribution can be improved.
[0158] In a possible implementation manner, determining the target configuration version identifier corresponding to the target configuration distribution request includes:
[0159] Obtain the version identifier of the latest configuration;
[0160] Based on the preset version identifier adjustment step and the version identifier of the latest configuration, determine the target configuration version identifier corresponding to the target configuration distribution request;
[0161] The configuration start condition includes:
[0162] The difference between the target operation version identifier and the current operation version identifier is the version identifier adjustment step.
[0163] In this embodiment, the version identification adjustment step size can be fixed, for example, it can be 1. Based on the preset version identification adjustment step size and the version identification of the latest configuration, the target configuration version identification corresponding to the target configuration distribution request can be the version identification of the latest configuration ± the version identification adjustment step size. Taking the version identification adjustment step size as 1 as an example, the target configuration version identification can be the version identification of the latest configuration ± 1.
[0164] Exemplarily, assume that the version identification of the initial configuration is 0 and the initial operation version identification is 0. Then, if the target configuration distribution requests 1 and 2 are received, the target configuration version identification of the target configuration distribution request 1 can be configured as 1, and the target operation version identification of the target configuration distribution request 1 can be set as 1. Also, the target configuration version identification of the target configuration distribution request 2 can be configured as 2, and the target operation version identification of the target configuration distribution request 1 can be set as 2. At this time, since the difference between the target operation version identification of the target configuration distribution request 1 and the current operation version identification is 1, the configuration data of request 1 is first sent to the target network device. At this time, the current operation version identification becomes 1. Then, when the configuration data of request 1 is sent, since the difference between the target operation version identification corresponding to request 2 and the current operation version identification is 1, the configuration data of request 2 can be sent to the target network device at this time.
[0165] In a possible implementation, the target configuration distribution request also carries a device identification and an association relationship change identification, and the association relationship change identification is used to indicate a change in the association relationship. The method further includes:
[0166] Based on the device identification carried in the target configuration distribution request, determine the network device identification to be updated;
[0167] Based on the network device identification to be updated and the association relationship change identification, update the association relationship;
[0168] Based on the association relationship and the target configuration identification, determine the target network device identification, including:
[0169] Based on the updated association relationship and the target configuration identification, determine the target network device identification.
[0170] In this embodiment, the situation of changing the association relationship can be supported.
[0171] Optionally, the association relationship change identification can be at least one of an association relationship addition identification, an association relationship modification identification, or an association relationship deletion identification.
[0172] Among them, the association relationship addition identification is used to indicate adding the network device identification to be updated to the association relationship. Specifically, it can be adding the network device identification to be updated as the network device identification corresponding to the target configuration identification.
[0173] Among them, the association relationship modification identifier is used to indicate the network device identifier corresponding to the change target configuration identifier. Specifically, it may be to replace the network device identifier to be updated with the network device identifier corresponding to the target configuration identifier.
[0174] Among them, the association relationship deletion identifier is used to indicate the deletion of the network device identifier corresponding to the target configuration identifier. Specifically, it may be to delete the network device identifier to be updated from the network device identifiers corresponding to the target configuration identifier.
[0175] The technical solution of this embodiment can determine the network device identifier to be updated based on the device identifier carried in the target configuration distribution request, and update the association relationship based on the network device identifier to be updated and the association relationship change identifier, so as to update the association relationship, further improve the flexibility of configuration data distribution, and then improve the flexibility of configuring network devices.
[0176] In a possible implementation, since the association relationship is adjustable, if the target configuration distribution request is at least the second received configuration distribution request, the preset association relationship is obtained, including:
[0177] Obtain the latest association relationship;
[0178] Based on the association relationship and the target configuration identifier, determine the target network device identifier, including:
[0179] Based on the latest association relationship and the target configuration identifier, determine the target network device identifier.
[0180] The technical solution of this embodiment can improve the accuracy of finding the association relationship and then improve the accuracy of processing configuration data by obtaining the latest association relationship and determining the target network device identifier based on the latest association relationship and the target configuration identifier.
[0181] In a possible implementation, determining the network device identifier to be updated based on the device identifier carried in the target configuration distribution request includes at least one of the following:
[0182] If the device identifier is the identifier corresponding to the network device, then determine the device identifier as the network device identifier to be updated;
[0183] If the device identifier is the identifier corresponding to the network device group, then determine the target network device group corresponding to the device identifier, and determine the network device identifiers corresponding to all the network devices in the target network device group as the network device identifiers to be updated.
[0184] In this embodiment, specifically, the target network device group is at least one of multiple network device groups. Specifically, the network devices in each network device group are pre-configured.
[0185] In the technical solution of this embodiment, if the device identifier is the identifier corresponding to the network device, the device identifier is determined as the network device identifier to be updated; if the device identifier is the identifier corresponding to the network device group, the target network device group corresponding to the device identifier is determined, and the network device identifiers corresponding to all network devices in the target network device group are determined as the network device identifiers to be updated. Then, according to the needs, it is possible to select whether to issue the identifier corresponding to the network device group or the identifier corresponding to the network device, which can improve the flexibility of the configuration data distribution. In addition, through the identifier corresponding to a network device group, the configuration of multiple network devices can be realized, and the data size occupied by the identifier corresponding to a network device group is smaller than the data size occupied by the identifiers corresponding to multiple network devices respectively. Therefore, the packet size of the target configuration distribution request and the required bandwidth can also be reduced.
[0186] In a possible implementation manner, during the process of distributing the target configuration data to the target network device, the state machine of the association relationship is configured to be non-steady state. When the state machine of the association relationship is in the non-steady state, changing the association relationship is prohibited;
[0187] The method further includes:
[0188] When the distribution of the target configuration data to the target network device ends, the state machine of the association relationship is configured to be steady state. When the state machine of the association relationship is in the steady state, changing the association relationship is allowed.
[0189] In this embodiment, specifically, since the operation of the data configuration workflow takes a certain amount of time, that is, the processing of the configuration data and the configuration of the network device take a certain amount of time, it is necessary to configure the state machine of the association relationship to be non-steady state during the process of distributing the target configuration data to the target network device, and configure the state machine of the association relationship to be steady state when the distribution of the target configuration data to the target network device ends, so as to reduce the situation where one data configuration workflow starts before the other data configuration workflow is configured, thereby improving the stability and accuracy of the configuration data distribution.
[0190] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of another method for processing configuration data provided by the embodiment of the present application. As Figure 4 shown, the method may include:
[0191] S410. Receive a target configuration distribution request, where the target configuration distribution request carries target configuration data, a target configuration identifier, a device identifier, and an association relationship table update identifier for configuring the operation of the network device.
[0192] S420. In response to a target configuration distribution request, determine a target configuration version identifier corresponding to the target configuration distribution request, and initiate a data configuration workflow, with the target configuration version identifier serving as the target operation version identifier of the data configuration workflow.
[0193] S430. If a preset configuration startup condition is met between the target operation version identifier and the current operation version identifier, initiate the data configuration workflow to obtain a preset latest association relationship through the data configuration workflow.
[0194] S440. If the configuration startup condition is not met between the target operation version identifier and the current operation version identifier, suspend the data configuration workflow until the configuration startup condition is met between the target operation version identifier and the current operation version identifier.
[0195] S450. Based on the device identifier carried in the target configuration distribution request, determine the network device identifier to be updated.
[0196] S460. Update the association relationship based on the network device identifier to be updated and the association relationship change identifier.
[0197] S470. Based on the updated association relationship and the target configuration identifier, determine the target network device identifier, and determine the target network device corresponding to the target network device identifier from multiple network devices.
[0198] S480. Send the target configuration data to the target network device. During the process of sending the target configuration data to the target network device, configure the state machine of the association relationship to be non-steady.
[0199] S490. When the sending of the target configuration data to the target network device ends, configure the state machine of the association relationship to be steady.
[0200] It can be understood that the steps of S410 - S490 in this embodiment can refer to the description of any of the above embodiments and will not be elaborated here.
[0201] The technical solution of this embodiment is to receive a target configuration distribution request, which carries target configuration data and a target configuration identifier for configuring the operation of a network device; in response to the target configuration distribution request, obtain a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier; based on the association relationship and the target configuration identifier, determine the target network device identifier, and determine the target network device corresponding to the target network device identifier from multiple network devices; and distribute the target configuration data to the target network device. By abstracting the relationship between the configuration and the network device into a preset association relationship, it is not necessary to develop an independent control system for each device. Through the association relationship, one configuration data can be used to configure the same configuration parts between different network devices, which can solve the technical problem of insufficient flexibility in configuring the operation of network devices through a network controller, thereby achieving the technical effect of improving the flexibility of configuring network devices. In addition, the association relationship can be adjusted as needed, so the flexibility of configuration can be further improved.
[0202] Based on any of the above embodiments, the following embodiments illustrate the case of concurrent sending of a distribution configuration request for configuring routing information.
[0203] Specifically, the network controller simultaneously receives a distribution configuration request 1 and a distribution configuration request 2 from a computer device. Among them, request 1 carries target routing information 1, and request 2 carries target routing information 2. At this time, the server can respond to request 1 and request 2, and respectively determine the target configuration version identifiers corresponding to request 1 and request 2 according to the data type identifiers carried by request 1 and request 2. Assuming that the priority of the data type identifier carried by request 1 is higher than that of the data type identifier carried by request 2, the target configuration version identifier of request 1 can be set to A, and data configuration workflow 1 is started, with A used as the target operation version identifier of data configuration workflow 1, while the target configuration version identifier of request 2 is set to A + 1, and data configuration workflow 2 is started, with A used as the target operation version identifier of data configuration workflow 2.
[0204] Then, if the current operation version identifier is A-1 and the state machine is in a steady state, since the target operation version identifier of the data configuration workflow 1 is A at this time, the data configuration workflow 1 is started, and the data configuration workflow 2 is suspended simultaneously. During the process of starting the data configuration workflow 1, the state of the state machine is modified to a non-steady state. At this time, the network device identifier to be updated can be determined based on the device identifier carried in Request 1, and then based on the network device identifier to be updated and the association relationship change identifier carried in Request 1, the association relationship is changed to obtain the updated association relationship 1, and based on the updated association relationship 1 and the target configuration identifier in Request 1, the target device identifier 1 is determined. Then, for Request 1, the target routing information 1 is sent to the target network device corresponding to the target device identifier 1. If the sending of the target routing information 1 is completed, the state machine is updated to a steady state at this time.
[0205] At this time, since the state machine is updated to a steady state and the current operation version identifier is A, and since the target operation version identifier of the data configuration workflow 2 is A+1, the data configuration workflow 2 is started. During the process of starting the data configuration workflow 2, the state of the state machine is modified to a non-steady state. At this time, the network device identifier to be updated can be determined based on the device identifier carried in Request 2, and then based on the network device identifier to be updated and the association relationship change identifier carried in Request 2, the association relationship 1 is changed to obtain the updated association relationship 2, and based on the updated association relationship 2 and the target configuration identifier in Request 2, the target device identifier 2 is determined. Then, for Request 2, the target routing information 2 is sent to the target network device corresponding to the target device identifier 2. If the sending of the target routing information 2 is completed, the state machine is updated to a steady state at this time.
[0206] By continuously looping in this way, the configuration of the network device can be continuously updated.
[0207] It should be noted that during the process of sending routing information based on any request, if a new request is received, the target configuration version identifier corresponding to the new request is determined, and until the target configuration version identifier corresponding to the new request meets the configuration start condition with the current operation version identifier, the new routing information in the new request can be sent.
[0208] Please refer to Figure 5 , Figure 5 which is a schematic flowchart of a method for configuring a network device provided by an embodiment of the present application. As Figure 5 shown, the method may include:
[0209] S510. The network controller receives a target configuration distribution request, and the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of the network device.
[0210] S520. The network controller responds to the target configuration distribution request, obtains the preset association relationship, and the association relationship is used to represent the relationship between the configuration identifier and the network device identifier.
[0211] S530. The network controller determines the target network device identifier based on the association relationship and the target configuration identifier, and determines the target network device corresponding to the target network device identifier from multiple network devices.
[0212] S540. The network controller distributes the target configuration data to the target network device.
[0213] S550. The target network device configures the operation of the target network device based on the target configuration data.
[0214] The technical solution of this embodiment, by receiving the target configuration distribution request, the target configuration distribution request carries the target configuration data and the target configuration identifier for configuring the operation of the network device; in response to the target configuration distribution request, obtains the preset association relationship, and the association relationship is used to represent the relationship between the configuration identifier and the network device identifier; based on the association relationship and the target configuration identifier, determines the target network device identifier, and determines the target network device corresponding to the target network device identifier from multiple network devices; distributes the target configuration data to the target network device. By abstracting the relationship between the configuration and the network device into a preset association relationship, it is not necessary to develop an independent control system for each device. Through the association relationship, one configuration data can be used to configure the same configuration parts between different network devices, which can solve the technical problem of insufficient flexibility in configuring the operation of network devices through the network controller, thereby achieving the technical effect of improving the flexibility of configuring network devices. In addition, the association relationship can be adjusted as needed, so the flexibility of configuration can be further improved. The following embodiments further illustrate the concurrent control process of the configuration distribution request in the embodiments of the present application based on any of the above embodiments.
[0215] In this embodiment, the version-based concurrent configuration mechanism is mainly implemented through the optimistic lock configuration model. Among them, the version concurrent control process includes but is not limited to the synchronization phase and the asynchronous phase shown below.
[0216] Synchronization phase:
[0217] i. The service request (configuration distribution request) calls the Config for add, delete, modify, and query through the interface (API).
[0218] ii. All service operations will cause the Tar Version (target configuration version identifier) in the Config to be incremented by 1 based on the version identifier of the latest configuration, and let it be A at this time.
[0219] iii. Start the asynchronous workflow phase and set the Op Version (target operation version identifier) to A in the workflow Context.
[0220] It should be noted that: At this time, if there are concurrent business requests operating on the same Config, a distributed lock needs to be used to ensure the consistency of the change of Tar Version in the database (DB).
[0221] Please refer to Figure 6 and Figure 7 . Figure 6 FIG. is a schematic flow diagram of the synchronization phase of a creation operation provided by an embodiment of the present application. Figure 7 FIG. is a schematic flow diagram of the synchronization phase of a modification / deletion operation provided by an embodiment of the present application.
[0222] As Figure 6 shown, when there is an input, the creation synchronization phase is carried out. In the synchronization creation phase, necessary parameter checks can be carried out first, and then priorities and the like can be supplemented based on the config meta. Then, in the processing of the database, the table can be locked by select for update. Then, the deleting conversion logic updateXXX, or the ordinary logic insert XXX is carried out. XXX can represent a more config ID. After the synchronization is completed, the workflow can be started and the asynchronous phase is entered.
[0223] As Figure 7 shown, when there is an input, the update synchronization phase is carried out. Necessary parameter checks can be carried out first, and then based on the full data (fulldata) or incremental data (changedata) passed in by the service, all can be passed in or one can be selected from two. When selecting one from two, the target configuration version identifier is selected, then the target configuration version identifier is recorded, and then the full data or incremental data of the target network device is selected, and thus sent to the target network device. In the processing of the database, the table can be locked by select forupdate, and then the target configuration version identifier is compared, so as to select the matching network device for update. After the synchronization is completed, the workflow can be started and the asynchronous phase is entered.
[0224] Asynchronous phase:
[0225] i. Optimistic lock concurrent control phase:
[0226] 1. Based on the Op Version information in the workflow, the DB will be continuously queried to verify whether the Op Version (operation version, the currently issued version, the final configuration) is equal to the Current Version of the Config + 1 at this time.
[0227] 2. If different workflows are started for the same Config variant operation multiple times and their Op Versions are different, only the workflow with an Op Version that is 1 more than the Cur Version (current operation version identifier) can continue to execute, and other workflows are suspended and retried.
[0228] ii. Config drives the Binding change stage:
[0229] 1. After meeting the optimistic lock concurrency control stage in the previous step;
[0230] 2. As can be seen from the above design of the configuration and bound device abstraction relationship, config itself has no direct association with the device, so:
[0231] (a) For the create operation, binding data associated with the config (representing its association with a certain device / a certain group) will be inserted at this time;
[0232] (b) For operations of the modify / delete type, in the subsequent step 3, the associated binding will be searched to clarify the device / device group involved in this operation.
[0233] 3. [Modify, Delete] Config queries its associated Binding (associated device), modifies the status and information corresponding to the Binding, and enters the non-steady state (DOING states such as UPDATING (updating), DELETING (deleting), etc.).
[0234] 4. Based on the Config and Binding information, search for the device [if it is a single device, there is no need to search; if it is a device group, the list of devices within the group needs to be searched at this time] to generate the DevOplist (device command distribution list).
[0235] iii. Configuration distribution stage:
[0236] 1. Based on the DevOplist (device command distribution list) generated in the previous stage, send the configuration to the device. If there is a sending failure, retry.
[0237] iv. Binding steady state stage:
[0238] 1. Entering this stage means that all device configurations have been sent.
[0239] 2. Modify the Binding state machine to enter the steady state (ACTIVE).
[0240] V. Config steady state stage:
[0241] 1. Set Config Cur Version to Op Version in the workflow.
[0242] 2. If Cur Version equals Tar Version at this time, then this configuration is in a steady state (ACTIVE).
[0243] 3. When Cur Version is updated (which means +1), other workflows can start implementing configuration changes (changing the configuration relationship) through optimistic locking.
[0244] 4. In this way, concurrent control is achieved.
[0245] Please refer to Figure 8 , Figure 8 which is a schematic flow diagram of an asynchronous stage provided by an embodiment of this application.
[0246] As Figure 8 shown, in the asynchronous stage, it can go through stages such as optimistic lock concurrent control stage, Config-driven Binding change stage, configuration distribution stage, and Config steady state stage, etc.
[0247] Exemplarily, a typical configuration distribution process - distributing a route is used as an example to illustrate this solution.
[0248] Synchronization stage:
[0249] I. The service request creates a route (assuming its ID: route-a) for the device (assuming ID: dev-a) through API call.
[0250] Ii. Create a record in the database Config table with ID route-a, Tar Version 1, CurVersion 0, and State being in creation.
[0251] Iii. Start the asynchronous workflow stage and set Op Version to 1, Binding to dev-a, and it is for a single device in the workflow Context.
[0252] Asynchronous stage (workflow):
[0253] I. Optimistic lock concurrent control stage:
[0254] 1. The op version for creating the route (route-a) is 1. It will continuously query the configuration record with ID route-a in the database and observe the cur version. If the op version equals cur version + 1, then continue to execute; otherwise, wait. At this time, cur version is 0, which meets the condition, so continue to execute.
[0255] Ii. Config-driven Binding change phase:
[0256] 1. Create an operation based on the information in the workflow context: binding is dev-a, insert into the binding table, tarversion 1, cur version 0, state is being created, ConfigID: route-a, DeviceID: dev-a.
[0257] 2. Generate dev-oplist in the workflow context, the content of which is the command list required to be sent to the device: dev-a, including route-a.
[0258] Iii. Configuration distribution phase:
[0259] 1. Perform a distribution operation on the device based on dev-oplist.
[0260] 2. Binding steady state phase.
[0261] 3. Entering this phase means that all device configurations have been sent.
[0262] 4. Modify the Binding data (ConfigID: route-a, DeviceID: dev-a) to enter the steady state, State is ACTIVE.
[0263] Iv. Config steady state phase:
[0264] 1. Set the Cur Version of Config(route-a) to the Op Version in the workflow, which is 1.
[0265] 2. If Cur Version (1) is equal to Tar Version (1), then this configuration is in the steady state (ACTIVE).
[0266] 3. End.
[0267] In this embodiment, by abstracting the association relationship between the configuration and the device, decoupling the configuration and the device, the flexibility of the system is improved, and through the version control of cur, tar, and op version, combined with the synchronous and asynchronous phases, both the throughput of the system is improved and the concurrent security is ensured.
[0268] Please refer to Figure 9 , Figure 9 which is the structural schematic diagram of a configuration data processing device provided by the embodiment of the present application. As Figure 9The device 900 shown may include a receiving module 910, a response module 920, and a configuration data distribution module 930. Among them:
[0269] The receiving module 910 is configured to receive a target configuration distribution request, which carries target configuration data and a target configuration identifier for configuring the operation of a network device;
[0270] The response module 920 is configured to, in response to the target configuration distribution request, obtain a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier;
[0271] The configuration data distribution module 930 is configured to determine a target network device identifier based on the association relationship and the target configuration identifier, and determine a target network device corresponding to the target network device identifier from multiple network devices; and distribute the target configuration data to the target network device.
[0272] Optionally, if the target configuration distribution request is at least the second received configuration distribution request, when the response module 920 obtains the preset association relationship, it can be used to:
[0273] Determine a target configuration version identifier corresponding to the target configuration distribution request, and start a data configuration workflow, where the target configuration version identifier serves as the target operation version identifier of the data configuration workflow;
[0274] If the target operation version identifier and the current operation version identifier meet a preset configuration start condition, start the data configuration workflow to obtain the preset association relationship through the data configuration workflow;
[0275] The response module 920 is further configured to:
[0276] If the target operation version identifier and the current operation version identifier do not meet the configuration start condition, suspend the data configuration workflow until the target operation version identifier and the current operation version identifier meet the configuration start condition.
[0277] Optionally, if there are at least two target configuration distribution requests and the target configuration identifiers carried in each target configuration distribution request among the at least two target configuration distribution requests are the same, when the response module 920 determines the target configuration version identifier corresponding to the target configuration distribution request, it can be used to:
[0278] Respectively determine the target configuration version identifiers corresponding to each target configuration distribution request among the at least two target configuration distribution requests;
[0279] Among them, the target configuration version identifiers corresponding to different target configuration distribution requests are different.
[0280] Optionally, the response module 920, when determining the target configuration version identifier corresponding to each target configuration distribution request among at least two target configuration distribution requests, can be used for at least one of the following:
[0281] Based on the request reception time corresponding to each target configuration distribution request among at least two target configuration distribution requests, sequentially determine the target configuration version identifier corresponding to each target configuration distribution request;
[0282] Based on the data type identifier carried by each target configuration distribution request, determine the configuration priority corresponding to each target configuration distribution request, and based on the configuration priority corresponding to each target configuration distribution request, sequentially determine the target configuration version identifier corresponding to each target configuration distribution request, where the configuration priorities corresponding to different data type identifiers are different.
[0283] Optionally, when the response module 920 determines the target configuration version identifier corresponding to a target configuration distribution request, it can be used for:
[0284] Obtain the version identifier of the latest configuration;
[0285] Based on the preset version identifier adjustment step and the version identifier of the latest configuration, determine the target configuration version identifier corresponding to the target configuration distribution request;
[0286] Configuration start conditions include:
[0287] The difference between the target operation version identifier and the current operation version identifier is the version identifier adjustment step.
[0288] Optionally, the target configuration distribution request also carries a device identifier and an association relationship change identifier, and the association relationship change identifier is used to indicate a change in the association relationship. The response module 920 is also used for:
[0289] Based on the device identifier carried by the target configuration distribution request, determine the network device identifier to be updated;
[0290] Based on the network device identifier to be updated and the association relationship change identifier, update the association relationship;
[0291] When the response module 920 determines the target network device identifier based on the association relationship and the target configuration identifier, it can be used for:
[0292] Based on the updated association relationship and the target configuration identifier, determine the target network device identifier.
[0293] Optionally, if the target configuration distribution request is at least the second received configuration distribution request, then when the response module 920 obtains the preset association relationship, it can be used for:
[0294] Obtain the latest association relationship;
[0295] When the response module 920 determines the target network device identifier based on the association relationship and the target configuration identifier, it can be used for:
[0296] Determine the target network device identifier based on the latest association relationship and the target configuration identifier.
[0297] Optionally, when the response module 920 determines the network device identifier to be updated based on the device identifier carried in the target configuration distribution request, it can be used for at least one of the following:
[0298] If the device identifier is the identifier corresponding to the network device, determine the device identifier as the network device identifier to be updated;
[0299] If the device identifier is the identifier corresponding to the network device group, determine the target network device group corresponding to the device identifier, and determine the network device identifiers corresponding to all network devices in the target network device group as the network device identifiers to be updated.
[0300] Optionally, the response module 920 is further used for:
[0301] During the process of distributing the target configuration data to the target network device, configure the state machine of the association relationship to be non-steady. When the state machine of the association relationship is in the non-steady state, changing the association relationship is prohibited;
[0302] When the distribution of the target configuration data to the target network device ends, configure the state machine of the association relationship to be steady. When the state machine of the association relationship is in the steady state, changing the association relationship is allowed.
[0303] The device in the embodiment of the present application can execute the method provided in the embodiment of the present application, and its implementation principle is similar. The actions performed by each module in the device in the embodiments of the present application correspond to the steps in the method in the embodiments of the present application. For the detailed function descriptions of each module of the device, reference can be specifically made to the descriptions in the corresponding methods shown above, and details are not described herein again.
[0304] An electronic device is provided in an embodiment of the present application, including a memory, a processor, and a computer program stored on the memory. The processor executes the above computer program to implement the steps of the method in any embodiment of the present application.
[0305] In an optional embodiment, an electronic device is provided, as Figure 10 shown Figure 10The electronic device 1000 shown includes: a processor 1001 and a memory 1003. Among them, the processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the electronic device 1000 may further include a transceiver 1004, and the transceiver 1004 can be used for data interaction between this electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver 1004 is not limited to one, and the structure of the electronic device 1000 does not constitute a limitation on the embodiments of the present application.
[0306] The processor 1001 may be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of the present application. The processor 1001 may also be a combination that implements a computing function, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0307] The bus 1002 may include a path for transmitting information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture, extended industry standard architecture) bus, etc. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 10 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0308] The memory 1003 can be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and instructions. It can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, which is not limited herein.
[0309] The memory 1003 is used to store the computer program for implementing the embodiments of the present application and is controlled by the processor 1001 for execution. The processor 1001 is used to execute the computer program stored in the memory 1003 to implement the steps shown in the foregoing method embodiments.
[0310] The embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
[0311] The embodiments of the present application further provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
[0312] It should be understood that although the flowchart of the embodiments of the present application indicates each operation step by an arrow, the execution order of these steps is not limited to the order indicated by the arrow. Unless there is a clear description in this article, in some implementation scenarios of the embodiments of the present application, the implementation steps in each flowchart can be executed in other orders according to requirements. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage among these sub-steps or stages can also be executed at different times. In the scenario where the execution times are different, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and the embodiments of the present application do not limit this.
[0313] The above are only optional implementation manners of some implementation scenarios of this application. It should be noted that for those of ordinary skill in the art, without departing from the technical concept of the solution of this application, adopting other similar implementation means based on the technical idea of this application also belongs to the protection scope of the embodiments of this application.
Claims
1. A method for processing configuration data, characterized in that, it includes: Receiving a target configuration distribution request, where the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of a network device; In response to the target configuration distribution request, obtaining a preset association relationship, where the association relationship is used to represent the relationship between the configuration identifier and the network device identifier; Based on the association relationship and the target configuration identifier, determining a target network device identifier, and determining the target network device corresponding to the target network device identifier from multiple network devices; Sending the target configuration data to the target network device.
2. The method according to claim 1, characterized in that, if the target configuration distribution request is at least the second received configuration distribution request, then the obtaining of the preset association relationship includes: Determining a target configuration version identifier corresponding to the target configuration distribution request, and starting a data configuration workflow, where the target configuration version identifier serves as the target operation version identifier of the data configuration workflow; If a preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier, then starting the data configuration workflow to obtain a preset association relationship through the data configuration workflow; The method further includes: If the preset configuration start condition is not satisfied between the target operation version identifier and the current operation version identifier, then suspending the data configuration workflow until the preset configuration start condition is satisfied between the target operation version identifier and the current operation version identifier.
3. The method according to claim 2, characterized in that, if the target configuration distribution request is at least two, and the target configuration identifiers carried in each of the at least two target configuration distribution requests are the same, then the determining of the target configuration version identifier corresponding to the target configuration distribution request includes: Respectively determining the target configuration version identifiers corresponding to each of the at least two target configuration distribution requests; wherein, the target configuration version identifiers corresponding to different target configuration distribution requests are different.
4. The method according to claim 3, characterized in that, the respectively determining the target configuration version identifiers corresponding to each of the at least two target configuration distribution requests includes at least one of the following: Based on the request reception time corresponding to each of the at least two target configuration distribution requests, sequentially determining the target configuration version identifier corresponding to each target configuration distribution request; Based on the data type identifiers carried in each target configuration distribution request, determining the configuration priority corresponding to each target configuration distribution request, and based on the configuration priority corresponding to each target configuration distribution request, sequentially determining the target configuration version identifier corresponding to each target configuration distribution request, where different data type identifiers correspond to different configuration priorities.
5. The method according to claim 2, characterized in that, the determining of the target configuration version identifier corresponding to the target configuration distribution request includes: Obtaining the version identifier of the latest configuration; Adjust the step size based on a preset version identifier and the version identifier of the latest configuration, and determine the target configuration version identifier corresponding to the target configuration distribution request; The configuration startup condition includes: The difference between the target operation version identifier and the current operation version identifier is the version identifier adjustment step size.
6. The method according to any one of claims 1-5, wherein, The target configuration distribution request also carries a device identifier and an association relationship table change identifier, and the association relationship table change identifier is used to indicate a change in the association relationship. The method further includes: Based on the device identifier carried in the target configuration distribution request, determine the network device identifier to be updated; Based on the network device identifier to be updated and the association relationship change identifier, update the association relationship; The determining the target network device identifier based on the association relationship and the target configuration identifier includes: Based on the updated association relationship and the target configuration identifier, determine the target network device identifier.
7. The method according to claim 6, wherein, If the target configuration distribution request is at least the second configuration distribution request received, then the obtaining the preset association relationship includes: Obtain the latest association relationship; The determining the target network device identifier based on the association relationship and the target configuration identifier includes: Based on the latest association relationship and the target configuration identifier, determine the target network device identifier.
8. The method according to claim 6, wherein, The determining the network device identifier to be updated based on the device identifier carried in the target configuration distribution request includes at least one of the following: If the device identifier is the identifier corresponding to a network device, then determine the device identifier as the network device identifier to be updated; If the device identifier is the identifier corresponding to a network device group, then determine the target network device group corresponding to the device identifier, and determine the network device identifiers corresponding to all network devices in the target network device group as the network device identifiers to be updated.
9. The method according to claim 6, wherein, The method further includes: During the process of distributing the target configuration data to the target network device, configure the state machine of the association relationship to be non-steady. When the state machine of the association relationship is in the non-steady state, prohibit changing the association relationship; When the distribution of the target configuration data to the target network device ends, configure the state machine of the association relationship to be steady. When the state machine of the association relationship is in the steady state, allow changing the association relationship.
10. A processing device for configuration data, wherein, includes: A receiving module, configured to receive a target configuration distribution request, where the target configuration distribution request carries target configuration data and a target configuration identifier for configuring the operation of a network device; A response module, configured to, in response to the target configuration distribution request, obtain a preset association relationship, where the association relationship is used to represent the relationship between a configuration identifier and a network device identifier; A configuration data distribution module, configured to determine a target network device identifier based on the association relationship and the target configuration identifier, and determine a target network device corresponding to the target network device identifier from multiple network devices; and distribute the target configuration data to the target network device.
11. An electronic device, comprising a memory, a processor, and a computer program stored on the memory, wherein, the processor executes the computer program to implement the method according to any one of claims 1-9.
12. A computer-readable storage medium, on which a computer program is stored, wherein, the computer program, when executed by a processor, implements the method according to any one of claims 1-9.