Port configuration method and device, storage medium and electronic equipment
By generating and issuing a target template containing a unique mapping relationship between PCI codes and physical ports, the problems of poor configuration accuracy and weak adaptability during network card port binding are solved, and efficient and accurate port configuration and management are achieved.
Patent Information
- Application Number
- CN202510943398.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-10-17
AI Technical Summary
In cloud computing and large-scale IT infrastructure, manual operations during network card port binding are prone to errors, leading to network failures and poor configuration accuracy, making it difficult to support large-scale deployment. Static configurations are also unable to dynamically adapt to complex business scenarios and have weak adaptability.
By obtaining the identification information of the target resource pool, a target template including the unique mapping relationship between PCI code and physical port is generated and automatically sent to the target resource pool to achieve accurate configuration and batch management of physical ports.
It improves the accuracy and adaptability of network card port configuration, improves configuration efficiency, and supports automated management and dynamic adaptation of large-scale network deployments.
Smart Images

Figure CN120811883A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a port configuration method and device, a storage medium and an electronic device. BACKGROUND
[0002] In cloud computing, data centers and large-scale IT infrastructures, network card ports, as the core components of network communication, directly affect business continuity and user experience in terms of reliability and bandwidth. To improve network redundancy, avoid single-point failures and optimize bandwidth utilization, network card port binding has become a key technical means. By aggregating multiple physical network card ports into a logical port, load balancing, primary-backup switching and other functions can be achieved to ensure network high availability.
[0003] In the network card port binding process, physical network card port binding and configuration mainly rely on manual operation and static scripts. After the physical server is pre-installed with an operating system, the operation and maintenance personnel need to log in to the host one by one, manually map the physical network card port and the system identifier, and execute command line operations in the operating system to delete the original network card configuration, create a binding group, configure a virtual network card, and set the IP address and binding mode.
[0004] However, the above-mentioned manual mapping method is prone to errors and network failures, and the one-by-one operation is difficult to support large-scale deployment. Moreover, static configuration cannot dynamically adapt to complex business scenarios, which restricts the reliability and scalability of physical network automation management, and thus leads to problems such as poor configuration accuracy and weak adaptability in large-scale network deployment. SUMMARY
[0005] Therefore, the present application provides a port configuration method, device, storage medium and electronic device to solve the problems of poor network card port configuration accuracy and weak adaptability.
[0006] In a first aspect, the present application provides a port configuration method, comprising:
[0007] obtaining identification information of a target resource pool, the target resource pool comprising at least one server, and the identification information comprising peripheral component interconnect standard codes of the servers;
[0008] inputting the identification information into an initial template to generate a target template, wherein the initial template comprises preset configuration parameters associated with the identification information, and the target template comprises a unique mapping relationship between the peripheral component interconnect standard codes and physical ports;
[0009] issuing the target template to the target resource pool;
[0010] configuring the physical ports of the corresponding servers in the target resource pool according to the target template.
[0011] In the method, the accurate configuration of the physical port can be realized through the unique mapping relationship between the peripheral component interconnect standard code and the physical port; meanwhile, the batch configuration and management of multiple devices can be realized based on the template issuing mode, thereby improving the configuration efficiency.
[0012] Optionally, the obtaining the identification information of the target resource pool comprises:
[0013] sending a obtaining command to the target resource pool;
[0014] receiving return information sent by the target resource pool in response to the obtaining command, wherein the return information comprises the peripheral component interconnect standard code, the network card name and the host ID corresponding to the server in the target resource pool;
[0015] parsing the return information to obtain the identification information.
[0016] In the method, the obtaining command is automatically sent to the target resource pool (i.e. target bare machine group) through a specific script, so as to accurately and quickly obtain the PCI identification information corresponding to each server (i.e. bare machine).
[0017] Optionally, before obtaining the identification information of the target resource pool, the method further comprises:
[0018] constructing an identification rule and a preset configuration parameter, wherein the identification rule is used to represent the association relationship between the peripheral component interconnect standard code and the preset configuration parameter, and the preset configuration parameter comprises at least one of a network label, a binding strategy, a binding state and an adaptation range;
[0019] generating the initial template according to the preset configuration parameter;
[0020] generating a matching parameter of the initial template according to the identification rule.
[0021] In the method, the standardized mapping of the PCI code and the network configuration is realized through the pre-defined association logic of the identification rule and the configuration parameter, the reusable initial template is constructed in advance, the rule basis is laid for the subsequent identification information backfilling and batch configuration issuing, and the specification and the automation efficiency of the configuration are improved.
[0022] Optionally, the inputting the identification information into the initial template comprises:
[0023] constructing a corresponding relationship data according to the identification information and the matching parameter, and querying the initial template corresponding to the identification information; the corresponding relationship data comprises a unique mapping relationship between the peripheral component interconnect standard code and the physical port in the target resource pool;
[0024] inputting the identification information and the corresponding relationship data into the initial template to generate the target template.
[0025] In the method, the unique mapping relationship between the PCI code and the physical port is generated based on the identification information and the matching parameter, accurate association between hardware and configuration is realized, the target template is generated through data backfilling, and accuracy and automation degree of batch configuration can be improved.
[0026] Optionally, the step of issuing the target template to the target resource pool comprises:
[0027] issuing the target template;
[0028] generating command information according to the target template, the command information being used for configuring a physical port of a target server in the target resource pool, the target server being a server indicated by the target template in the target resource pool;
[0029] sending the command information to the target server, so that the target server configures the physical port according to the command information.
[0030] In the method, the target template is issued and the corresponding command information is generated, automatic conversion of configuration parameters from the template to the physical port is realized, the target server is accurately positioned to execute the configuration instruction, standardization batch effect of hardware configuration is ensured, and large-scale deployment efficiency and operation consistency are improved.
[0031] Optionally, after the target template is issued to the target resource pool, the method further comprises:
[0032] storing the target template;
[0033] generating an update template in response to an update event of the target template;
[0034] issuing the update template to the target resource pool;
[0035] configuring a physical port of the server in the target resource pool according to the update template.
[0036] In the method, the target template is stored to realize management of configuration version, the update template is generated and issued in response to the update event, dynamic adjustment and version iteration of configuration are supported, and the physical port configuration can be updated in real time.
[0037] In a second aspect, the application provides a port configuration device, comprising:
[0038] an acquisition module configured to acquire identification information of a target resource pool, the target resource pool comprising at least one server, and the identification information comprising peripheral component interconnect standard codes of the servers;
[0039] The matching module is configured to input the identification information into an initial template to generate a target template; the initial template includes preset configuration parameters associated with the identification information, and the target template includes a unique mapping relationship between the peripheral component interconnect standard code and the physical port;
[0040] The template module is configured to distribute the target template to the target resource pool and configure the physical port of the corresponding server in the target resource pool according to the target template.
[0041] In a third aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method in the first aspect.
[0042] In a fourth aspect, the present application provides an electronic device, which includes a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, and the processor executes the computer program to implement the method in the first aspect.
[0043] In a fifth aspect, the present application provides a computer program product, which stores a computer program, and the computer program product is executed by a processor to implement the method in the first aspect.
[0044] According to the above technical solutions, the port configuration method, device, storage medium and electronic device provided by the present application are provided, the method includes obtaining identification information of a target resource pool and inputting the identification information into an initial template to generate a target template. The target resource pool includes at least one server, the identification information includes a PCI code of the server, the initial template includes preset configuration parameters associated with the identification information, and the target template includes a unique mapping relationship between the PCI code and the physical port. The target template is then distributed to the target resource pool to configure the physical port of the corresponding server in the target resource pool according to the target template. By applying the technical solutions of the present application, the accuracy of port configuration can be improved based on the unique correspondence between the PCI code and the physical port, and batch configuration can be realized through the distribution of the template to improve the configuration efficiency.
[0045] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS
[0046] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
[0048] Figure 1 A flowchart of a port configuration method provided by an embodiment of the present application is shown.
[0049] Figure 2 A flowchart of obtaining identification information provided by an embodiment of the present application is shown.
[0050] Figure 3 A flowchart of template generation provided by an embodiment of the present application is shown.
[0051] Figure 4 A flowchart of template publishing provided by an embodiment of the present application is shown.
[0052] Figure 5 A structural diagram of a port configuration device provided by an embodiment of the present application is shown.
[0053] Figure 6 A data flow conversion diagram of a port configuration process performed by a port configuration device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0054] The embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0055] In cloud computing, data centers and large-scale IT infrastructures, to solve the problem of network card or port failure affecting business continuity, improving network bandwidth and providing redundancy, network card port binding and other configuration operations need to be performed.
[0056] In some embodiments, for managing network card port binding and other configuration operations, different binding methods, modes and strategies can be used, and the implementation steps include: pre-installing an operating system on a physical server, logging into the system one by one, manually establishing the relationship between the network card port and the actual wiring device corresponding to the network port, deleting or modifying the physical network card configuration, creating or deleting the network card binding and virtual network card, completing the port binding (or unbinding) and IP, binding mode and other information configuration, and repeating the operation to complete the configuration of other physical servers.
[0057] However, the above method has many technical problems. Firstly, the correspondence between the network card port and the actual wiring is not clear, the data acquisition accuracy is low, and the configuration such as binding (or unbinding) is prone to failure; secondly, manual operation cannot realize batch processing, and cannot efficiently and accurately complete the configuration task such as binding (or unbinding); thirdly, it lacks flexibility and cannot realize template definition to process the configuration work such as network card port binding (unbinding). In this way, it will lead to the problems of poor configuration accuracy and weak adaptation ability in large-scale network deployment.
[0058] To improve the above problems, the embodiment provides a port configuration method, as shown in the following Figure 1 The method can include the following steps:
[0059] Step S101, obtaining the identification information of the target resource pool.
[0060] The target resource pool can include at least one server, that is, the target resource pool can include multiple bare-metal network cards that need to be configured; the identification information includes the peripheral component interconnect standard code of the server, that is, the PCI (Peripheral Component Interconnect, Peripheral Component Interconnect) code.
[0061] For the obtained identification information, in some embodiments, the identification information can include the PCI code, network card name, host ID and other identification information corresponding to each server device (that is, bare-metal network card).
[0062] For convenience of description, the identification information in the following part of the application will be represented as PCI identification information, and the PCI identification information can include multiple data such as PCI code, host ID and network card name, which is not limited by the application. However, it is worth noting that the PCI identification information at least includes the PCI code corresponding to the device.
[0063] To further illustrate the implementation process of the above embodiment, in some embodiments, as shown in the following Figure 2 The identification information of the target resource pool (that is, step S101) can include the following steps:
[0064] S11, sending an acquisition command to the target resource pool.
[0065] In some embodiments, the acquisition command can be pre-set in a specific module in the form of a code script, such as a pre-set acquisition module. For example, a specific protocol can be used to establish a connection with the target resource pool, and then send the acquisition command and receive the returned information through the connection relationship.
[0066] For example, the connection with the target resource pool is established through the SSH protocol (Secure Shell), which can provide secure remote login and command execution functions to ensure the security and reliability of the communication.
[0067] In some embodiments, the acquisition command sent to the target resource pool includes at least a command for querying the PCI codes of the servers in the target resource pool.
[0068] S12, receiving the return information sent by the target resource pool in response to the acquisition command.
[0069] In some embodiments, the return information fed back by the target resource pool can include the PCI codes, card names and host IDs of the servers in the target resource pool.
[0070] In some embodiments, after receiving the acquisition command, the target resource pool performs the operation corresponding to the acquisition command, such as acquiring the PCI codes and other information of the server devices in the target resource pool, and then feeds back these information as return information. For example, the acquisition module sends an acquisition command, and the target resource pool feeds back the PCI codes, host IDs and card names as return information to the acquisition module for analysis by the acquisition module.
[0071] This embodiment can realize the automatic collection of the PCI identification information such as the PCI codes, card names and host IDs of the servers in the target resource pool by sending specific commands to the target resource pool, avoiding the inefficiency and errors of manual query.
[0072] For example, the acquisition module can send acquisition commands to 100 bare-metal servers in the A computing pool through the built-in script to collect the PCI device information in the A computing pool. The return information fed back by the bare-metal servers includes the PCI codes, card names, host IDs and the like, such as host ID XX-XXX: PCI code XX:XX:XX corresponding to card eth0, and XXXXXX:XX corresponding to card eth1.
[0073] For the transmission of the return information, in some embodiments, the return information can be sent in the form of text, JSON, etc. to correctly analyze the identification information.
[0074] S13, analyzing the return information to obtain the identification information.
[0075] In some embodiments, the script content of the acquisition command can include the connection information of the target resource pool and the corresponding command set, etc. The acquisition module can automatically send acquisition commands to the bare-metal group of the target resource pool, receive the return information fed back by the bare-metal group based on the acquisition command, and determine the PCI identification information by analyzing specific fields in the return information.
[0076] The embodiment can realize the automation and batch acquisition of the PCI identification information by presetting the acquisition command in the form of code script in a specific module, automatically sending the script command to the target resource pool and reading the returned information.
[0077] In step S102, the identification information is input into the initial template to generate a target template.
[0078] The initial template includes preset configuration parameters associated with the identification information; and the target template generated based on the identification information and the initial template includes a unique mapping relationship between the PCI code and the physical port.
[0079] In some embodiments, the preset configuration parameters can include at least one of a network label, a binding strategy, a binding state, and an adaptation range, and the network label includes but is not limited to deployment, management, business, and storage. The deployment network is used for server initialization, operating system deployment, firmware update, and other infrastructure deployment tasks; the management network is used for device management, monitoring, and remote access; the business network carries user core business traffic (such as communication between application systems, processing of user requests, etc.); and the storage network is used for data transmission between storage devices and servers.
[0080] In some embodiments, the binding strategy can be primary backup or balanced, the binding mode can be bond or team, and the binding state can be unbound or bound; and the adaptation range can be the bare machine range of the resource pool POD (Physical or Virtual Resource Delivery Unit).
[0081] Based on the above initial template, in some embodiments, the identification rule and the preset configuration parameters can be constructed before the identification information of the target resource pool is acquired. The identification rule is used to represent the association relationship between the PCI code and the preset configuration parameters, and the preset configuration parameters can include at least one of a network label, a binding strategy, a binding state, and an adaptation range. Then, the corresponding initial template is generated according to the preset configuration parameters, and the matching parameters of the initial template are generated according to the identification rule. In this way, after the PCI identification information is acquired, the current initial template corresponding to the PCI code can be matched according to the constructed matching parameters.
[0082] For example, the initial template can include configuration parameters of the network label, the binding strategy, the binding mode, and the binding state, and different types of configuration parameters correspond to specific parameter values, as shown in the following table:
[0083] Parameter type Configuration value Network tag Deployment, management, business, storage Binding policy Master / standby or balance Binding mode Bond / team Binding state Unbound / bound
[0084] It should be noted that the above configuration values can be different forms of parameters, and the present application does not limit this. Obviously, the constructed initial template only contains general configuration requirements and has not yet associated specific device information.
[0085] The embodiment realizes the standardized mapping of PCI coding and network configuration through the association logic of the pre-defined identification rule and the pre-set configuration parameter, and through the construction of the reusable initial template in advance, can be used to realize the accurate backfilling of subsequent identification information, and further improve the automation efficiency of port configuration.
[0086] For the constructed identification rule, in some embodiments, the identification rule can include a correspondence table of PCI identification information and physical ports, such as a correspondence table including the correspondence relationship between PCI coding and physical ports; and a MAC address whitelist, such as binding the MAC address and the PCI identification information.
[0087] In order to further illustrate the implementation process of the above embodiment, in some embodiments, as shown in Figure 3 The generation process of the target template (i.e., step S102) can include:
[0088] S21, constructing correspondence relationship data according to the identification information and the matching parameter, and querying the initial template corresponding to the identification information.
[0089] That is, based on the above matching parameter and the initial template, after obtaining the identification information of the target resource pool, the server devices (i.e., bare machine devices) belonging to the target resource pool can be screened according to the matching parameter, and the correspondence relationship data is established and the corresponding initial template is queried.
[0090] For example, according to the PCI identification rule in the matching parameter, the correspondence relationship data of each bare machine server in the target resource pool is established, such as marking the network label M for each PCI coding obtained from the target resource pool; determining the binding relationship, and clearly defining the adaptation range as all bare machine servers in the target resource pool, etc.
[0091] S22, inputting the identification information and the correspondence relationship data into the initial template to generate the target template.
[0092] The correspondence relationship data includes the unique mapping relationship between the PCI coding and the physical port in the target resource pool. That is, the constructed correspondence relationship data and the PCI identification information are filled into the initial template to form the final target template. At this time, the target template contains the port configuration details of each server in the target resource pool.
[0093] For example, the target template can be host ID: xxxx-xxx, network label M, binding policy: load balancing, binding mode: team, binding state: bound, and unique mapping relationship of PCI-physical port: xxxx:xx:xx→eth0, xxxx:xx:xx→eth1.
[0094] The embodiment can generate a unique mapping relationship between a PCI code and a physical port based on identification information and matching parameters, accurately associate hardware and configuration, generate a target template through data backfilling, and improve the accuracy and automation degree of batch configuration.
[0095] In step S103, the target template is issued to the target resource pool.
[0096] The target template is issued to the server in the target resource pool, so that the server performs port configuration according to the content of the target template. The embodiment realizes automatic conversion of configuration parameters from a template to a physical port through a template. Since the template contains a unique mapping relationship between a PCI code and a physical port, the target server can be accurately located to perform port configuration. For example, the unique mapping relationship between the PCI code X and the port 1 of the network card A can define the unique mapping of the PCI code X and the port 1 of the network card A, and then realize accurate matching.
[0097] As shown in FIG. 10, in some embodiments, issuing the target template to the target resource pool (i.e., step S103) can include: Figure 4
[0098] S31, issuing a target template.
[0099] S32, generating command information according to the target template.
[0100] S33, sending the command information to the target server, so that the target server configures the physical port according to the command information.
[0101] The command information is used to configure the physical port of the target server in the target resource pool, and the target server is the server indicated by the target template in the target resource pool. Through the issuance of the template data, the embodiment can realize batch configuration and management of multiple server objects in the template resource pool, thereby realizing automatic conversion of configuration parameters from the template to the physical port.
[0102] In some embodiments, the command information supports batch release according to the resource pool, and if single server configuration fails, it does not affect other server devices. For example, a multi-thread or asynchronous task is used to batch send SSH command information; or the message queue is used to buffer the configuration command information to ensure stable issuance.
[0103] In step S104, the physical port of the corresponding server in the target resource pool is configured according to the target template.
[0104] In this embodiment, the target template includes a unique mapping relationship between PCI codes and physical ports, as well as preset configuration parameters such as network labels and binding strategies. Based on these data information, adaptive configuration instructions are automatically generated, such as creating a network card binding interface, setting an IP address, and specifying master and standby network cards. Then the instructions are sent to the target server through a remote connection tool, so that the server executes the instructions one by one to complete the configuration operation of the physical ports.
[0105] In some embodiments, after the target template is issued to the target resource pool, the target template is stored, and the management of the configuration version can be realized. When modifying the port configuration, the update event of the target template is also responded to, and an updated template is generated to support the dynamic adjustment and version iteration of the configuration. Then the updated template is issued to the target resource pool to configure the physical ports of the servers in the target resource pool according to the updated template.
[0106] For example, after issuing template A to configure the ports of the target resource pool, template A is automatically stored, and template A can be used as historical configuration version 1.0. Thereafter, the binding mode of each server device in the target resource pool is changed from master and standby to load balancing, and the configuration value corresponding to the binding configuration in template A is updated to generate a new template B (i.e., an updated template). Similarly, template B is issued to the A computing pool for port configuration, and template B is automatically stored, and template B can be used as historical configuration version 2.0.
[0107] In some embodiments, the update event of the target template can be input through a Web interface or by modifying the preset parameters through an API (Application Programming Interface).
[0108] In some embodiments, the stored historical templates can also be read. The historical templates include the target templates that have been issued to the resource pool, and the historical templates are stored based on version parameters. For example, the version parameters can be version numbers, release dates, operators, and the like. In this way, a corresponding historical port configuration can be restored by issuing a certain historical template again.
[0109] This embodiment can completely record the historical configuration versions, and facilitate the backtracking or comparison of configuration parameters at different stages. When the user needs to adjust the configuration, the preset configuration parameters (such as network labels and binding strategies) can be flexibly modified, and after the modification is confirmed, real-time updating of the configuration can be realized through the template issuing mode.
[0110] Based on the above embodiments, the port configuration method provided by the application realizes automatic configuration of physical ports through preset rules and automatic processes, greatly improves efficiency and reduces human operation errors; the unique mapping relationship is used to guarantee the accuracy and consistency of the configuration, the standardized management of the configuration parameters simplifies the management of large-scale resource pools; the mechanism of dynamically updating templates adapts to changes in resource pools, enhances the flexibility and scalability of the scheme, and reduces the influence range of configuration errors.
[0111] Based on the port configuration method of the above embodiments, the embodiment further provides a port configuration device, as shown in Figure 5 The port configuration device includes an acquisition module 501, a matching module 502, and a template module 503.
[0112] The acquisition module 501 is configured to acquire identification information of a target resource pool, the target resource pool including at least one server, and the identification information including peripheral component interconnect standard codes of the server.
[0113] The matching module 502 is configured to input the identification information into an initial template to generate a target template, the initial template including preset configuration parameters associated with the identification information, and the target template including a unique mapping relationship between the peripheral component interconnect standard codes and physical ports.
[0114] The template module 503 is configured to issue the target template to the target resource pool and configure the physical ports of the corresponding servers in the target resource pool according to the target template.
[0115] In some embodiments, the acquisition module 501 is configured to acquire PCI identification information from the target resource pool. For example, the acquisition module 501 can acquire PCI codes, network card names, host IDs, and other identification information by sending specific script commands to the servers of the target resource pool. The matching module 502 is configured to define unique correspondence (i.e., unique mapping relationship) between PCI codes and physical ports, binding strategies (such as primary and backup or balancing), binding modes (bond or team), adaptation ranges, and other parameters to construct a template for configuring ports. The template module 503 is configured to store and manage template data corresponding to the template, support historical version records, parameter modifications, and configuration releases, and realize batch issuance functions.
[0116] For example, as shown in Figure 5 The acquisition command is written into the acquisition module 501 in the form of a code script, the acquisition module 501 sends the acquisition command to the target resource pool, and then obtains PCI codes, network card names, host IDs, and other identification information through return information fed back by the target resource pool. Then, according to the pre-constructed matching parameters, the PCI codes and other identification information and the corresponding preset configuration parameters are input into the corresponding initial template to form a target template for subsequent execution of port configuration.
[0117] That is, in some embodiments, the obtaining module 501 is further configured to send an obtaining command to the target resource pool; receive return information sent by the target resource pool in response to the obtaining command, the return information including the peripheral component interconnect standard code corresponding to the server in the target resource pool, the network card name and the host ID; and parse the return information to obtain the identification information.
[0118] In this embodiment, the obtaining module 501 can automatically send the obtaining command to the target resource pool through a specific script to accurately and quickly obtain the PCI identification information corresponding to each server in the target resource pool.
[0119] In some embodiments, the matching module 502 is further configured to construct a corresponding relationship data according to the identification information and the matching parameter, and query an initial template corresponding to the identification information. Then, the identification information and the corresponding relationship data are input into the initial template to generate a target template. The corresponding relationship data includes a unique mapping relationship between the peripheral component interconnect standard code and the physical port in the target resource pool.
[0120] In this embodiment, the matching module 502 accurately maps the PCI code and the physical port by constructing the corresponding relationship data, querying the initial template and generating the target template, thereby providing a solid foundation for the automation and intelligent scheduling of system resources.
[0121] In some embodiments, the template module 503 is further configured to construct an identification rule and a preset configuration parameter. The identification rule is used to represent the association relationship between the peripheral component interconnect standard code and the preset configuration parameter, and the preset configuration parameter includes at least one of a network label, a binding strategy, a binding state and an adaptation range. The initial template is generated according to the preset configuration parameter, and the matching parameter of the initial template is generated according to the identification rule.
[0122] In this embodiment, the template module 503 establishes the association between the PCI code and the network configuration elements by constructing the identification rule and the preset configuration parameter. The initial template is generated based on the preset configuration parameter to ensure that the network configuration has a standardized and normalized basis, and the matching parameter is generated according to the identification rule to achieve accurate adaptation of the configuration.
[0123] In some embodiments, the template module 503 is configured to publish the target template; and generate command information according to the target template. The command information is used to configure the physical port of a target server in the target resource pool, and the target server is a server indicated by the target template in the target resource pool. Then, the command information is sent to the target server to make the target server configure the physical port according to the command information.
[0124] In the embodiment, the template module 503 publishes and converts the target template into command information, realizes the conversion of configuration information from the template to executable instructions, sends the configuration instructions adapted to the target server to the specified device, avoids the tediousness and inefficiency of manual configuration of each device, and improves the configuration efficiency.
[0125] In some embodiments, the template module 503 is further configured to store the target template and generate an updated template in response to an update event of the target template. Then, the updated template is issued to the target resource pool, and the physical ports of the servers in the target resource pool are configured according to the updated template.
[0126] In the embodiment, the storage and dynamic update mechanism of the template module 503 for the target template build an update system for the physical port configuration management of the servers in the target resource pool. The storage of the target template facilitates quick calling and reuse, and saves repeated configuration time; when the update event is triggered, the updated template is generated in time and automatically issued to the target resource pool, which can realize the dynamic adjustment of the physical port configuration.
[0127] In the embodiment, the template module 503 realizes the management of the configuration version by storing the target template, generates and issues the updated template in response to the update event, supports the dynamic adjustment and version iteration of the configuration, and can ensure that the physical port configuration can be updated in real time.
[0128] Therefore, in some embodiments, the template module 503 can be built-in with a storage unit for storing initial templates, target templates, and updated templates and the like template data.
[0129] Based on the above embodiments, the above port configuration method and device are described through an example as follows.
[0130] The A computing pool is set as the target resource pool, and the preset configuration parameters of the A computing pool include network labels, binding strategies, binding modes, and PCI identification rules. The parameters corresponding to the network labels, the binding strategies, and the binding modes are written into the template A in advance through the template module 503, and the PCI identification rules form data interaction with the matching module 502.
[0131] The acquisition module 501 sends an acquisition command to the A computing pool through a script command, and the return information fed back by the A computing pool includes PCI identification information (including PCI code, host ID, and network card name). The above return information passes through the matching module 502, the matching module 502 constructs the unique mapping relationship between the PCI code and the physical ports of the A computing pool, and matches and inputs the unique mapping relationship data and the PCI identification information into the template A corresponding to the template module 503. Then, the template module 503 issues the template A to the A computing pool. During the data issuing process of the template A, all data and target processes are performed simultaneously.
[0132] Based on the above example, the data flow of the port configuration process is as shown in Figure 6 The preset configuration parameter data of the A computing pool (target resource pool) is preset in the template module 503 of the port configuration device. The acquisition module 501 of the port configuration device sends an acquisition command to the A computing pool to acquire the PCI identification information. The matching module 502 constructs the unique mapping relationship data of the physical port, and generates the final template A (target template) based on the unique mapping relationship data and the PCI identification information. At the same time, the template A is issued to the A computing pool (target server), and the template A will send command information to the target server through the template module 503. After receiving the command information, the target server will execute the full-amount configuration in the template A and complete the writing of the related configuration, so as to complete the single port batch configuration of the A computing pool.
[0133] It should be noted that other corresponding descriptions of the various functional units involved in the port configuration device provided in this embodiment can refer to the corresponding descriptions of the port configuration method, which will not be described here.
[0134] Based on the above method as shown in Figure 1 Correspondingly, the embodiment also provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as shown in Figure 1 .
[0135] Based on the above method as shown in Figure 1 Correspondingly, the embodiment also provides a computer program product having a computer program stored thereon, which, when executed by a processor, implements the method as shown in Figure 1 .
[0136] Based on such understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.), and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0137] Based on the above method as shown in Figure 1 , and Figure 5 the virtual device embodiment, in order to achieve the above purpose, the embodiment of the present application also provides an electronic device such as a terminal device, etc., which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to implement the method as shown in Figure 1 .
[0138] Optionally, the above-mentioned entity device can further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, and the like. The user interface can include a display screen, an input unit such as a keyboard, and the like. Optionally, the user interface can further include a USB interface, a card reader interface, and the like. The network interface can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and the like.
[0139] Those skilled in the art can understand that the above-mentioned entity device structure provided by the embodiment does not constitute a limitation on the entity device, and can include more or fewer components, or combine certain components, or different component arrangements.
[0140] The storage medium can further include an operating system and a network communication module. The operating system is a program for managing hardware and software resources of the above-mentioned entity device, and supports the running of information processing programs and other software and / or programs. The network communication module is used to realize communication between components inside the storage medium, and communication with other hardware and software in the information processing entity device.
[0141] From the above technical solutions, it can be seen that the port configuration method, device, storage medium and electronic device disclosed by the present application, the method comprises obtaining identification information of a target resource pool, and inputting the identification information into an initial template to generate a target template. Wherein, the target resource pool includes at least one server, the identification information includes the PCI code of the server, the initial template includes the preset configuration parameter associated with the identification information, and the target template includes the unique mapping relationship between the PCI code and the physical port. Then, the target template is issued to the target resource pool, so as to configure the physical port of the corresponding server in the target resource pool according to the target template. By applying the technical solution of the present application, the accuracy of port configuration can be improved based on the unique correspondence between the PCI code and the physical port, and batch configuration can be realized through the issuance of the template, thereby improving the configuration efficiency.
[0142] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary general hardware platforms, or by hardware. Compared with the prior art, by applying the technical solution of the present embodiment, it is not necessary to compare each sample with the parts and samples in batches, and the defect detection of parts with different shapes and structures can be effectively realized, which can quickly adapt to the characteristics of complex parts, efficiently identify and classify various defects, and has great significance for improving production efficiency, reducing cost and ensuring product quality.
[0143] It has to be noted that, in the present document, the terms "comprising", "including", and "having" should be interpreted as specifying the presence of the stated features or steps, but do not preclude the presence of one or more additional features or steps. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. It is further understood that the use of "including" as well as "comprising" does not exclude the presence of elements other than the ones listed and do not exclude the presence of "additional" elements. When an indefinite article such as "an", "na" or "an" is used, the article should be understood to have a specific meaning and not a generic or indefinite meaning.
[0144] The foregoing detailed description has set forth various embodiments of the application via the use of specific terminology. However, embodiments thereof can be practiced without the specific details ("every" embodiment) set forth above. In general, the terms used are intended to be illustrative and not restrictive. The description is not intended to be exhaustive or to limit the application to the precise form disclosed. Many modifications and variations are possible in light of this disclosure. It is intended that the scope of the application be defined by the claims appended hereto rather than by the description presented above.
Claims
1. A port configuration method, characterized in that: include: Acquire identification information of a target resource pool, where the target resource pool includes at least one server, and the identification information includes a peripheral component interconnection standard code of the server; Inputting the identification information into an initial template to generate a target template; the initial template includes preset configuration parameters associated with the identification information, and the target template includes a unique mapping relationship between the peripheral component interconnection standard code and the physical port; Sending the target template to the target resource pool; The physical port of the corresponding server in the target resource pool is configured according to the target template.
2. The method according to claim 1, characterized in that The obtaining of identification information of the target resource pool includes: Sending an acquisition command to the target resource pool; receiving return information sent by the target resource pool in response to the acquisition command, the return information including a peripheral component interconnection standard code, a network card name, and a host ID corresponding to the server in the target resource pool; Parse the returned information to obtain the identification information.
3. The method according to claim 1, characterized in that Before obtaining the identification information of the target resource pool, the following steps are also included: Constructing an identification rule and preset configuration parameters, wherein the identification rule is used to characterize an association between the peripheral component interconnection standard code and the preset configuration parameters, wherein the preset configuration parameters include at least one of a network label, a binding policy, a binding state, and an adaptation range; generating the initial template according to the preset configuration parameters; Generate matching parameters of the initial template according to the identification rules.
4. The method according to claim 3, characterized in that The step of inputting the identification information into the initial template includes: Constructing corresponding relationship data according to the identification information and the matching parameters, and querying the initial template corresponding to the identification information; the corresponding relationship data includes a unique mapping relationship between the peripheral component interconnection standard code and the physical port in the target resource pool; The identification information and the corresponding relationship data are input into the initial template to generate the target template.
5. The method according to claim 1, wherein The sending the target template to the target resource pool includes: Publishing the target template; Generate command information according to the target template, the command information being used to configure a physical port of a target server in the target resource pool, the target server being the server indicated by the target template in the target resource pool; The command information is sent to the target server, so that the target server configures the physical port according to the command information.
6. The method according to any one of claims 1 to 5, characterized in that After sending the target template to the target resource pool, the method further includes: Storing the target template; generating an updated template in response to an update event of the target template; Sending the update template to the target resource pool; The physical port of the server in the target resource pool is configured according to the update template.
7. A port configuration device, characterized in that: include: an acquisition module configured to acquire identification information of a target resource pool, the target resource pool including at least one server, the identification information including a peripheral component interconnection standard code of the server; a matching module configured to input the identification information into an initial template to generate a target template; the initial template includes preset configuration parameters associated with the identification information, and the target template includes a unique mapping relationship between the peripheral component interconnection standard code and the physical port; The template module is configured to send the target template to the target resource pool; and configure the physical port of the corresponding server in the target resource pool according to the target template.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product having a computer program stored thereon, characterized in that: When the computer program product is executed by a processor, the method according to any one of claims 1 to 6 is implemented.