Network connection method, device, equipment, medium and program product
By automatically detecting and configuring virtual devices in a containerized operating system environment using network setup scripts and large language models, the problem of virtual machines not being able to automatically connect to the network is solved, and the efficiency and success rate of network connections are improved.
Patent Information
- Application Number
- CN202510046824.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-13
AI Technical Summary
When a virtual machine applies a containerized operating system, the virtual machine cannot automatically connect to the network, resulting in low network configuration efficiency, high labor costs, and manual configuration is prone to errors.
By creating a new virtual machine in response to the target server, using the network setup script to obtain the virtual devices in the target server, determining the network settings based on the file system, using the large language model to determine whether there are pending virtual devices that are not connected to the network cluster, and using the network setup script to modify the parameters of the newly created virtual machine to connect the pending virtual device to the network cluster.
It improves the efficiency and success rate of network connections, reduces the error rate and cost of manual configuration, and realizes automated network connections in containerized operating system environment.
Smart Images

Figure CN119449602B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer networks, and in particular to a network connection method, device, equipment, medium and program product. Background Art
[0002] With the development of computer technology, it is becoming more and more common to create virtual machines on host machines and use virtual machines for business operations. Virtual machines can run multiple operating systems on a single physical server and provide an isolated environment so that operating systems and applications can run without affecting the host system. This allows users to run different operating systems and applications on a single computer at the same time, greatly improving application flexibility.
[0003] In the process of using virtual machines, it is necessary to create a new virtual machine on the host machine and connect the virtual machine to the network cluster where the host machine is located before performing business operations. Most existing operating systems can automatically create and manage the configuration of virtual devices used to connect to the network when creating a new virtual machine. However, when a containerized operating system is used on a virtual machine, it is found that such a virtual machine cannot automatically connect to the network because the containerized operating system does not have the function of automatically creating and managing the configuration of virtual devices.
[0004] In the process of implementing the present invention, it is found that there are at least the following problems in the prior art: when a virtual machine applies a containerized operating system, the virtual devices of the virtual machine are usually manually configured to connect them to the network. This method of network configuration is inefficient, has high labor costs, and is prone to errors. Summary of the invention
[0005] In view of the above problems, the present invention provides a network connection method, apparatus, device, medium and program product.
[0006] According to a first aspect of the present invention, a network connection method is provided, comprising: in response to a target server creating a new virtual machine, obtaining a virtual device in the target server by using a network setting script, wherein the target server includes a server applying a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server; determining the network setting of the target server based on the file system of the target server; based on the network setting, determining whether there is a pending virtual device in the target server that is not connected to a network cluster by using a large language model, wherein the network cluster includes multiple servers, and the multiple servers include the target server; and in the case where there is a pending virtual device, modifying the parameters of the newly created virtual machine by using the network setting script so that the pending virtual device is connected to the network cluster.
[0007] According to an embodiment of the present invention, based on the network setting, a large language model is used to determine whether there are unprocessed virtual devices in the target server that are not connected to the network cluster, including: based on the network setting, determining multiple virtual devices in the target server; determining a virtual device corresponding to a newly created virtual machine from the multiple virtual devices; based on the network setting, determining whether the virtual device corresponding to the newly created virtual machine is connected to the network cluster; in the case that the virtual device corresponding to the newly created virtual machine is not connected to the network cluster, using the large language model to determine the cause of the connection failure, wherein the cause of the connection failure includes a network cluster failure, a target server failure, and an operating system type limitation of a containerized operating system; in the case that the cause of the connection failure is the operating system type limitation of the containerized operating system, determining the virtual device as a unprocessed virtual device.
[0008] According to an embodiment of the present invention, when there is a virtual device to be processed, the parameters of the newly created virtual machine are modified by using a network setting script so that the virtual device to be processed is connected to the network cluster, including: using the network setting script to determine the script instructions required to modify the parameters; and executing the script instructions on the target server to modify the parameters of the newly created virtual machine.
[0009] According to an embodiment of the present invention, the network connection method further includes: mounting the file system of the target server using a network setting script.
[0010] According to an embodiment of the present invention, determining the network settings of the target server based on the file system of the target server includes: determining a network container in a network settings script for obtaining the network settings; and obtaining the network settings from the file system of the target server using the network container.
[0011] According to an embodiment of the present invention, the network connection method further includes: in response to introducing a server into a network cluster, determining an operating system of the server application; and configuring a network setting script to the server when the server application uses a containerized operating system.
[0012] A second aspect of the present invention provides a network connection device, comprising:
[0013] A device acquisition module, configured to, in response to the target server creating a new virtual machine, acquire a virtual device in the target server using a network setting script, wherein the target server includes a server applying a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server;
[0014] A setting determination module, used for determining the network setting of the target server based on the file system of the target server;
[0015] a device determination module, configured to determine, based on network settings, whether there is a virtual device to be processed in a target server that is not connected to a network cluster by using a large language model, wherein the network cluster includes a plurality of servers, and the plurality of servers includes the target server; and
[0016] The parameter modification module is used to modify the parameters of the virtual device to be processed by using the network setting script when there is a virtual device to be processed, so that the newly created virtual machine is connected to the network cluster.
[0017] A third aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0018] The fourth aspect of the present invention further provides a computer-readable storage medium on which a computer program or instruction is stored, and the steps of the above method are implemented when the above computer program or instruction is executed by a processor.
[0019] The fifth aspect of the present invention also provides a computer program product, including a computer program or instructions, which implement the steps of the above method when executed by a processor.
[0020] According to an embodiment of the present invention, when a new virtual machine is created in a target server, a network setting script is used to obtain virtual devices in the target server, and the network setting of the target server is determined, and a large language model is further used to determine whether there are virtual devices to be processed in the target server that are not connected to the network cluster. By predetermining the virtual devices to be processed, it is possible to not perform subsequent network connection operations when there are no virtual devices that are not connected to the network cluster in the target server, and / or the reason why the target server is not connected to the network cluster is not a virtual device configuration problem, thereby reducing the use of resources required for network connection and improving resource utilization. In the case of determining that there are virtual devices to be processed, the network setting script is used to modify the parameters of the newly created virtual machine so that the virtual devices to be processed are connected to the network cluster. Since the network setting script is determined based on the virtual devices to be processed, the virtual devices to be processed can be accurately determined from the target server when the network setting script is executed, thereby achieving an accurate parameter modification process and improving the success rate and efficiency of network connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0022] Figure 1An application scenario diagram of a network connection method, apparatus, device, medium, and program product according to an embodiment of the present invention is shown.
[0023] Figure 2 A flow chart of a network connection method according to an embodiment of the present invention is shown.
[0024] Figure 3 A flow chart of a network connection method according to another embodiment of the present invention is shown.
[0025] Figure 4 A structural block diagram of a network connection device according to an embodiment of the present invention is shown.
[0026] Figure 5 A block diagram of an electronic device suitable for implementing a network connection method according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, invention and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0032] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present invention provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0033] An embodiment of the present invention provides a network connection method, comprising: in response to a target server creating a new virtual machine, using a network setting script to obtain a virtual device in the target server, wherein the target server includes a server that applies a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server; based on the file system of the target server, determining the network setting status of the target server; based on the network setting status, using a large language model to determine whether there is a pending virtual device in the target server that is not connected to a network cluster, wherein the network cluster includes multiple servers, and the multiple servers include the target server; and in the case where there is a pending virtual device, using the network setting script to modify the parameters of the newly created virtual machine so that the pending virtual device is connected to the network cluster.
[0034] Figure 1 An application scenario diagram of a network connection method, apparatus, device, medium, and program product according to an embodiment of the present invention is shown.
[0035] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0036] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0038] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0039] It should be noted that the network connection method provided in the embodiment of the present invention can generally be executed by the server 105. Accordingly, the network connection device provided in the embodiment of the present invention can generally be set in the server 105. The network connection method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the network connection device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0040] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0041] The following will be based on Figure 1 The scene described by Figure 2~Figure 3 The network connection method according to the embodiment of the present invention is described in detail.
[0042] Figure 2 A flow chart of a network connection method according to an embodiment of the present invention is shown.
[0043] like Figure 2 As shown, the network connection method of this embodiment includes operations S210 to S240.
[0044] In operation S210 , in response to the target server creating a new virtual machine, a network setting script is used to obtain a virtual device in the target server.
[0045] According to an embodiment of the present invention, a target server is monitored using a network setting script. When a new virtual machine is created on the target server, the virtual device in the target server is obtained using the network setting script, wherein the target server includes a server that applies a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server. The virtual device may be a TAP device that is automatically created when a new virtual machine is created.
[0046] In operation S220, a network setting condition of the target server is determined based on the file system of the target server.
[0047] According to an embodiment of the present invention, the network settings of the target server are determined based on the file system of the target server, wherein the file system of the target server may be pre-mounted, and when the network settings need to be determined, the file system may be directly obtained, and the network settings of the target server may be determined by parsing the data in progress of the file system.
[0048] In operation S230 , based on the network setting situation, a large language model is used to determine whether there is a to-be-processed virtual device in the target server that is not connected to the network cluster.
[0049] According to an embodiment of the present invention, since the operating system of the target server is a containerized operating system, the containerized operating system does not have a mechanism for automatically creating and managing virtual devices, so under normal circumstances, the containerized operating system cannot automatically connect to the network cluster. The network setting situation is processed using a large language model to determine the reason why the target server is not connected to the network cluster. When the reason for not connecting to the network cluster is that the virtual device is not connected, it can be determined that there are virtual devices to be processed in the target server that are not connected to the network cluster, wherein the network cluster includes multiple servers, and the multiple servers include the target server.
[0050] In operation S240, when there is a virtual device to be processed, the parameters of the newly created virtual machine are modified by using a network setting script so that the virtual device to be processed is connected to the network cluster.
[0051] According to an embodiment of the present invention, when there are virtual devices to be processed, the parameters of the network device corresponding to the newly created virtual machine are modified using a network setting script so that the virtual devices to be processed are connected to the network cluster, thereby ensuring that the newly created virtual machine can be connected to the network cluster.
[0052] According to an embodiment of the present invention, when a new virtual machine is created in a target server, a network setting script is used to obtain virtual devices in the target server, and the network setting of the target server is determined, and a large language model is further used to determine whether there are virtual devices to be processed in the target server that are not connected to the network cluster. By predetermining the virtual devices to be processed, it is possible to not perform subsequent network connection operations when there are no virtual devices that are not connected to the network cluster in the target server, and / or the reason why the target server is not connected to the network cluster is not a virtual device configuration problem, thereby reducing the use of resources required for network connection and improving resource utilization. In the case of determining that there are virtual devices to be processed, the network setting script is used to modify the parameters of the newly created virtual machine so that the virtual devices to be processed are connected to the network cluster. Since the network setting script is determined based on the virtual devices to be processed, the virtual devices to be processed can be accurately determined from the target server when the network setting script is executed, thereby achieving an accurate parameter modification process and improving the success rate and efficiency of network connection.
[0053] According to an embodiment of the present invention, based on the network setting, a large language model is used to determine whether there are unprocessed virtual devices in the target server that are not connected to the network cluster, including: based on the network setting, determining multiple virtual devices in the target server; determining a virtual device corresponding to a newly created virtual machine from the multiple virtual devices; based on the network setting, determining whether the virtual device corresponding to the newly created virtual machine is connected to the network cluster; in the case that the virtual device corresponding to the newly created virtual machine is not connected to the network cluster, using the large language model to determine the cause of the connection failure, wherein the cause of the connection failure includes a network cluster failure, a target server failure, and an operating system type limitation of a containerized operating system; in the case that the cause of the connection failure is the operating system type limitation of the containerized operating system, determining the virtual device as a unprocessed virtual device.
[0054] According to an embodiment of the present invention, based on the network setting, it is determined that there are multiple virtual devices in the target server, and the network connection status of each of the multiple virtual devices is determined, wherein each virtual device corresponds to a virtual machine.
[0055] According to an embodiment of the present invention, a virtual device corresponding to the newly created virtual machine is determined from multiple virtual devices, and the network connection status of the virtual device corresponding to the newly created virtual machine, that is, whether it is connected to the network cluster, is determined based on the network connection status of each of the multiple virtual devices.
[0056] According to an embodiment of the present invention, when a network cluster fails, for example, the network cluster cannot provide network connection temporarily, even if the virtual device is set to connect to the network cluster, the target server cannot connect to the network correctly. When a target server fails, for example, a hardware device such as a network card of the target server fails, even if the virtual device is set to connect to the network cluster, the target server cannot connect to the network correctly. Therefore, when determining the network connection status, it is necessary to first detect the operation status of the network cluster and the target server. The above-mentioned failure conditions can be stored in the network setting status in the form of logs.
[0057] According to an embodiment of the present invention, when a virtual device corresponding to a newly created virtual machine is not connected to a network cluster, a large language model is used to analyze the portion of the network setting corresponding to the newly created virtual machine to obtain the cause of the connection failure, wherein the network setting may include records in the form of logs, and the large language model is used to analyze the logs of the network connection to determine whether there is a fault in the network cluster and / or the target server.
[0058] According to an embodiment of the present invention, when it is determined that the network cluster and the target server can operate normally, it can be determined that the cause of the connection failure is the operating system type limitation of the containerized operating system, so the virtual device can be determined as a virtual device to be processed.
[0059] According to an embodiment of the present invention, multiple virtual devices in the target server are determined based on the network settings, the network connection conditions of each of the multiple virtual devices are determined respectively, the virtual device corresponding to the newly created virtual machine is determined from the multiple virtual devices, and the network connection conditions of the virtual device corresponding to the newly created virtual machine are determined. In the case where the virtual device corresponding to the newly created virtual machine is not connected to the network cluster, the large language model is used to analyze the part of the network settings corresponding to the newly created virtual machine to obtain the cause of the connection failure. In the case where the network cluster and the target server have faults that can be excluded, the cause of the connection failure is determined to be limited by the operating system type, and the virtual device is determined as a virtual device to be processed, so that the virtual device to be processed can be set up to achieve network connection later. In the case where the network connection failure is not caused by the operating system type limitation, the subsequent processing of the virtual device can be stopped in time, reducing the waste of processing resources and improving resource utilization and network connection efficiency.
[0060] According to an embodiment of the present invention, when there is a virtual device to be processed, the parameters of the newly created virtual machine are modified by using a network setting script so that the virtual device to be processed is connected to the network cluster, including: using the network setting script to determine the script instructions required to modify the parameters; and executing the script instructions on the target server to modify the parameters of the newly created virtual machine.
[0061] According to an embodiment of the present invention, when there are unprocessed virtual devices in the target server, it can be determined that the target server cannot connect to the network due to problems with the virtual device settings, and based on the virtual device to be processed, the network setting script can be used to generate script instructions required to modify parameters, wherein the script instructions include an identifier of the virtual device to be processed, and the identifier of the virtual device to be processed can be used to uniquely mark a specific virtual device among multiple virtual devices of the target server.
[0062] According to an embodiment of the present invention, a script instruction is executed on the target server. Since the script instruction includes the identifier of the virtual device to be processed, the script instruction can be used to accurately locate the virtual device to be processed in the target server and modify the parameters of the newly created virtual machine in the virtual device to be processed.
[0063] According to an embodiment of the present invention, a network setting script is used to generate script instructions based on the virtual device to be processed, so that when the script instructions are executed on the target server, the virtual device to be processed can be correctly determined and its parameters can be modified, so that the newly created virtual machine can be correctly connected to the network, further improving the success rate of the network connection.
[0064] According to an embodiment of the present invention, the network connection method further includes: mounting the file system of the target server using a network setting script.
[0065] According to an embodiment of the present invention, the network setting script includes multiple containers, wherein different containers can be used for, for example, modifying virtual machine parameters in a virtual device, checking the network connection status of a virtual machine, detecting whether a newly created virtual machine exists in a target server, etc. Therefore, the network setting script can be used to mount the file system of the target server, so that the multiple containers in the network setting script can normally obtain the file system of the target server, thereby detecting and controlling the network connection status of the virtual machine in the target server.
[0066] According to an embodiment of the present invention, by using a network setting script to mount the file system of the target server, the container in the network setting script can correctly obtain and operate the configuration of the target server, thereby improving the feasibility and efficiency of network connection.
[0067] According to an embodiment of the present invention, determining the network settings of the target server based on the file system of the target server includes: determining a network container in a network settings script for obtaining the network settings; and obtaining the network settings from the file system of the target server using the network container.
[0068] According to an embodiment of the present invention, a network container for obtaining network setting conditions is determined from a network setting script, and the network setting conditions are obtained from a mounted file system using the network container.
[0069] According to an embodiment of the present invention, a network container is used to obtain network settings from a file system of a target server, thereby improving the efficiency and accuracy of network connections.
[0070] According to an embodiment of the present invention, the network connection method further includes: in response to introducing a server into a network cluster, determining an operating system of the server application; and configuring a network setting script to the server when the server application uses a containerized operating system.
[0071] According to an embodiment of the present invention, multiple servers in a network cluster are monitored in real time, and when a new server is introduced into the network cluster, the operating system applied by the server is determined in response to the introduction of the server into the network cluster. When it is determined that the server applies a containerized operating system, a network setting script is configured for the server, and the network setting script is used to detect and control the creation, operation and network connection of the virtual machine of the server.
[0072] According to an embodiment of the present invention, operating systems other than containerized operating systems generally have the function of automatically creating and managing configured virtual devices. Therefore, when it is determined that the server of the server application is not a containerized operating system, there is no need to configure a network setting script for the server. The virtual machines in the server can be normally connected to the network by relying on the functions of the server's operating system itself.
[0073] According to an embodiment of the present invention, the operating system used by the newly introduced server in the network cluster is determined, and when the operating system is a containerized operating system, a network setting script is configured to the server so that the network setting script can be used to perform network detection and control on the virtual machines of the server, further reducing labor costs and network connection efficiency.
[0074] Figure 3 A flow chart of a network connection method according to another embodiment of the present invention is shown.
[0075] like Figure 3 As shown, the network connection method includes operations S301 to S312.
[0076] In operation S301, the addition of servers in the network cluster is monitored.
[0077] In operation S302, it is determined whether a new server exists in the network cluster.
[0078] In operation S303, it is determined whether the operating system is a containerized operating system. If not, operation S304 is performed; if yes, operation S305 is performed.
[0079] In operation S304 , since the non-containerized operating system has the function of automatically creating and managing virtual devices, there is no need to configure a network setting script and no operation is performed.
[0080] In operation S305, a network setting script is configured to the server.
[0081] In operation S306, the newly created virtual machine status of the target server is monitored.
[0082] In operation S307, it is determined whether there is a newly created virtual machine in the target server. If not, operation S306 is executed to continue monitoring the newly created virtual machine; if yes, operation S308 is executed.
[0083] In operation S308, the virtual device of the target server is acquired and the network setting status is determined.
[0084] In operation S309, it is determined whether there is a virtual device to be processed in the target server that is not connected to the network cluster. If not, operation S310 is performed; if yes, operation S311 is performed.
[0085] In operation S310, since the reason for the network connection failure may be caused by a failure of the network cluster or the target server itself, even if the parameters of the newly created virtual machine are modified, the newly created virtual machine cannot connect to the network normally. Therefore, the parameters of the newly created virtual machine are not operated. This situation can be reported to the operation and maintenance personnel for troubleshooting.
[0086] In operation S311, a network setting script is generated.
[0087] In operation S312, a network setting script is executed to modify parameters of the newly created virtual machine.
[0088] Based on the above network connection method, the present invention also provides a network connection device. Figure 4 The device is described in detail.
[0089] Figure 4 A structural block diagram of a network connection device according to an embodiment of the present invention is shown.
[0090] like Figure 4As shown, the network connection device 400 of this embodiment includes a device acquisition module 410 , a setting determination module 420 , a device determination module 430 and a parameter modification module 440 .
[0091] The device acquisition module 410 is used to obtain the virtual device in the target server using the network setting script in response to the target server creating a new virtual machine, wherein the target server includes a server applying a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server. In one embodiment, the device acquisition module 410 can be used to perform the operation S210 described above, which will not be repeated here.
[0092] The setting determination module 420 is used to determine the network setting of the target server based on the file system of the target server. In one embodiment, the setting determination module 420 can be used to perform the operation S220 described above, which will not be repeated here.
[0093] The device determination module 430 is used to determine whether there is a virtual device to be processed in the target server that is not connected to the network cluster based on the network setting situation using the large language model, wherein the network cluster includes multiple servers, and the multiple servers include the target server. In one embodiment, the device determination module 430 can be used to perform the operation S230 described above, which will not be repeated here.
[0094] The parameter modification module 440 is used to modify the parameters of the virtual device to be processed by using the network setting script when there is a virtual device to be processed, so that the newly created virtual machine is connected to the network cluster. In one embodiment, the parameter modification module 440 can be used to perform the operation S240 described above, which will not be repeated here.
[0095] According to an embodiment of the present invention, the device determination module 430 includes a first device determination submodule, a second device determination submodule, a connection determination submodule, a cause determination submodule and a third device determination submodule.
[0096] The first device determination submodule is used to determine multiple virtual devices in the target server based on network settings.
[0097] The second device determination submodule is used to determine a virtual device corresponding to the newly created virtual machine from multiple virtual devices.
[0098] The connection determination submodule is used to determine whether the virtual device corresponding to the newly created virtual machine is connected to the network cluster based on the network settings.
[0099] The cause determination submodule is used to determine the cause of the connection failure by using a large language model when the virtual device corresponding to the newly created virtual machine is not connected to the network cluster, wherein the causes of the connection failure include network cluster failure, target server failure and operating system type limitation of the containerized operating system.
[0100] The third device determination submodule is used to determine the virtual device as a to-be-processed virtual device when the reason for the connection failure is the operating system type limitation of the containerized operating system.
[0101] According to an embodiment of the present invention, the parameter modification module 440 includes a script determination submodule and a parameter modification submodule.
[0102] The script determination submodule is used to use the network setting script to determine the script instructions required to modify the parameters.
[0103] The parameter modification submodule is used to execute script instructions on the target server and modify the parameters of the newly created virtual machine.
[0104] According to an embodiment of the present invention, the network connection device 400 further includes a file mounting module.
[0105] The file mounting module is used to mount the file system of the target server using the network setting script.
[0106] According to an embodiment of the present invention, the setting determination module 420 includes a container determination submodule and a setting determination submodule.
[0107] The container determination submodule is used to determine the network container used to obtain the network setting status in the network setting script.
[0108] The setting determination submodule is used to obtain the network setting status from the file system of the target server by using the network container.
[0109] According to an embodiment of the present invention, the network connection device 400 further includes a system determination module and a script configuration module.
[0110] The system determination module is used to determine the operating system of the server application in response to the server being introduced into the network cluster.
[0111] The script configuration module is used to configure a network setting script to the server when the server applies a containerized operating system.
[0112] According to an embodiment of the present invention, any multiple modules among the device acquisition module 410, the setting determination module 420, the device determination module 430, and the parameter modification module 440 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the device acquisition module 410, the setting determination module 420, the device determination module 430, and the parameter modification module 440 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of them. Alternatively, at least one of the device acquisition module 410, the setting determination module 420, the device determination module 430 and the parameter modification module 440 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0113] Figure 5 A block diagram of an electronic device suitable for implementing a network connection method according to an embodiment of the present invention is shown.
[0114] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present invention includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0115] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.
[0116] According to an embodiment of the present invention, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that the computer program read therefrom is installed into the storage portion 508 as needed.
[0117] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.
[0118] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0119] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present invention.
[0120] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 501. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0121] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0122] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0123] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.
[0126] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A network connection method, characterized in that: The method comprises: In response to the target server creating a new virtual machine, using a network setting script to obtain a virtual device in the target server, wherein the target server includes a server applying a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server; Determining the network settings of the target server based on the file system of the target server; Based on the network setting, using a large language model to determine whether there is a to-be-processed virtual device in the target server that is not connected to a network cluster, wherein the network cluster includes a plurality of servers, and the plurality of servers include the target server; and In the case where the virtual device to be processed exists, the network setting script is used to modify the parameters of the newly created virtual machine so that the virtual device to be processed is connected to the network cluster.
2. The method according to claim 1, characterized in that The determining, based on the network setting, using a large language model to determine whether there is a to-be-processed virtual device in the target server that is not connected to the network cluster includes: Based on the network setting, determining a plurality of virtual devices in the target server; Determining the virtual device corresponding to the newly created virtual machine from the multiple virtual devices; Based on the network setting, determining whether the virtual device corresponding to the newly created virtual machine has been connected to the network cluster; In a case where the virtual device corresponding to the newly created virtual machine is not connected to the network cluster, determining a cause of a connection failure using the large language model, wherein the cause of the connection failure includes a failure of the network cluster, a failure of the target server, and an operating system type limitation of the containerized operating system; When the reason for the connection failure is the operating system type limitation of the containerized operating system, the virtual device is determined as the virtual device to be processed.
3. The method according to claim 1, characterized in that: In the case where the virtual device to be processed exists, modifying the parameters of the newly created virtual machine by using the network setting script so that the virtual device to be processed is connected to the network cluster, comprises: Using the network setting script, determining the script instructions required to modify the parameters; and The script instruction is executed on the target server to modify the parameters of the newly created virtual machine.
4. The method according to claim 1, characterized in that The method further comprises: The file system of the target server is mounted using the network setting script.
5. The method according to claim 4, characterized in that The determining the network setting of the target server based on the file system of the target server includes: Determining a network container in the network setting script for obtaining the network setting status; and The network setting information is obtained from the file system of the target server by using the network container.
6. The method according to claim 1, characterized in that The method further comprises: In response to introducing a server into the network cluster, determining an operating system applied by the server; and In a case where the containerized operating system is applied to the server, the network setting script is configured to the server.
7. A network connection device, characterized in that: The device comprises: a device acquisition module, configured to, in response to a target server creating a new virtual machine, acquire a virtual device in the target server using a network setting script, wherein the target server includes a server applying a containerized operating system, and the virtual device is used to manage the network configuration of the virtual machine in the target server; A setting determination module, used to determine the network setting of the target server based on the file system of the target server; a device determination module, configured to determine, based on the network setting, whether there is a to-be-processed virtual device in the target server that is not connected to a network cluster by using a large language model, wherein the network cluster includes a plurality of servers, and the plurality of servers include the target server; and The parameter modification module is used to modify the parameters of the virtual device to be processed by using the network setting script when the virtual device to be processed exists, so that the newly created virtual machine is connected to the network cluster.
8. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Test method and test system
CN113703914A
Public cloud container instance creation method
CN114422350A