Cloud-native-based multi-network mode implementation method, device, equipment and medium
By verifying load creation requests in the cloud native environment, filtering target nodes and binding network characteristics, parsing events to obtain plug-in information, the problem of compatibility and low efficiency in multi-network modes is solved, and efficient network configuration and interface docking are achieved. .
Patent Information
- Application Number
- CN202211117685.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-09-14
AI Technical Summary
There are compatibility issues in the application of multiple network modes in the existing technology, and the cni plug-in relies on an external address allocator, resulting in low efficiency in pod network mode configuration.
By receiving the load creation request in the cloud native environment, verifying and sending it to the cluster server to create the workload, filtering the target nodes according to the characteristics of the work unit, binding the network characteristics to generate header information, parsing the event to obtain plug-in information and forwarding the processing request, it is realized Network interface docking.
It improves the compatibility of multi-network modes and the efficiency of network address allocation, and achieves balanced scheduling of work units and efficient network interface docking.
Smart Images

Figure CN115460075B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network configuration technology, and in particular to a cloud-native based multi-network mode implementation method, device, equipment and medium. Background Art
[0002] Cluster servers are widely used in data processing tasks. Applications involving multiple network modes in cluster servers, such as the pod multi-network mode application technology of the prior art methods, all call CNI plug-ins in a chained manner, and realize the adaptation and application of multiple network modes through the capabilities of the called CNI plug-ins. However, different CNI plug-ins may conflict with the network mode when implementing certain functions, resulting in compatibility issues in the application of multiple network modes in the prior art methods; and some CNI plug-ins also rely on external address allocators to allocate network addresses, resulting in incoordination in the scheduling of pods and the adaptation of corresponding network modes, affecting the efficiency of the network mode configuration of pods in cluster servers. Therefore, the existing technical methods have the problem of being unable to efficiently perform network configuration in multiple network modes. Summary of the invention
[0003] The embodiments of the present invention provide a cloud-native based multi-network mode implementation method, apparatus, device and medium, aiming to solve the problem that network configuration cannot be efficiently performed in the multi-network mode existing in the prior art methods.
[0004] In a first aspect, an embodiment of the present invention provides a method for implementing a multi-network mode based on cloud native, the method comprising:
[0005] If a load creation request is received, verify the load creation request to obtain a verification result of whether it passes;
[0006] If the verification result is passed, sending the load creation request to the cluster server to create a workload corresponding to the load creation request in the cluster server, wherein the workload is a collection of multiple work units;
[0007] Screening preset network nodes according to the unit characteristics of the working units in the workload to obtain target nodes corresponding to the unit characteristics of each working unit and satisfying preset screening conditions;
[0008] Binding the network characteristics of each of the working units to the corresponding target node to generate header information corresponding to each of the working units;
[0009] If an event from any of the working units is monitored, the header information corresponding to the working unit is parsed to obtain the plug-in information;
[0010] The processing request including the network interface corresponding to the event is forwarded to the plug-in corresponding to the plug-in information to perform network interface docking.
[0011] In a second aspect, an embodiment of the present invention provides a multi-network mode implementation device based on cloud native, which includes:
[0012] A verification result obtaining unit, configured to verify the load creation request to obtain a verification result indicating whether the load creation request has passed if a load creation request has been received;
[0013] A load creation request sending unit, configured to send the load creation request to the cluster server to create a workload corresponding to the load creation request in the cluster server if the verification result is passed, wherein the workload is a collection of multiple work units;
[0014] A network node screening unit, used to screen preset network nodes according to the unit characteristics of the working units in the workload, so as to obtain target nodes corresponding to the unit characteristics of each working unit and satisfying preset screening conditions;
[0015] A header information generating unit, used to bind the network characteristics of each of the working units with the corresponding target node to generate header information corresponding to each of the working units;
[0016] A plug-in information acquisition unit, configured to parse the header information corresponding to any of the working units to acquire the plug-in information if an event from the working unit is monitored;
[0017] The processing request forwarding unit is used to forward the processing request containing the network interface corresponding to the event to the plug-in corresponding to the plug-in information to perform network interface docking.
[0018] In the third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the cloud-native-based multi-network mode implementation method described in the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor enables the processor to execute the cloud-native-based multi-network mode implementation method described in the first aspect above.
[0020] The embodiment of the present invention provides a method, device, equipment and medium for realizing multi-network mode based on cloud native, verifies the load creation request, and if the verification is passed, sends it to the cluster server to create the corresponding workload, screens the network nodes according to the unit characteristics of the working unit in the workload, obtains the target node corresponding to the unit characteristics of each working unit, binds the network characteristics of the working unit with the corresponding target node to generate header information, parses the header information of the working unit after monitoring the event of the working unit to obtain the plug-in information, and forwards the event processing request to the plug-in corresponding to the plug-in information for network interface docking. Through the above method, multi-network adaptation application is performed through the network manager, which can greatly improve compatibility, bind the network characteristics of the working unit with the corresponding target node, thereby realizing balanced scheduling of the working unit and improving the efficiency of network address allocation and network interface docking. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0022] Figure 1 A flowchart of a method for implementing a multi-network mode based on cloud native provided by an embodiment of the present invention;
[0023] Figure 2 A schematic diagram of an application scenario of a cloud-native-based multi-network mode implementation method provided in an embodiment of the present invention;
[0024] Figure 3 A schematic diagram of a sub-process of a method for implementing a multi-network mode based on cloud native provided in an embodiment of the present invention;
[0025] Figure 4 Another flowchart of a method for implementing a multi-network mode based on cloud native provided by an embodiment of the present invention;
[0026] Figure 5 A schematic diagram of another sub-process of the cloud-native-based multi-network mode implementation method provided in an embodiment of the present invention;
[0027] Figure 6 A schematic diagram of another sub-process of the cloud-native-based multi-network mode implementation method provided in an embodiment of the present invention;
[0028] Figure 7 A schematic diagram of the latter sub-process of the cloud-native-based multi-network mode implementation method provided in an embodiment of the present invention;
[0029] Figure 8 Another flowchart of a method for implementing a multi-network mode based on cloud native provided by an embodiment of the present invention;
[0030] Fig. 9 A schematic block diagram of a cloud-native-based multi-network mode implementation device provided in an embodiment of the present invention;
[0031] Fig.10 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0034] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0035] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0036] See also Figure 1 and Figure 2As shown in the figure, the cloud-native-based multi-network mode implementation method is applied to the network manager 10. The method is executed by the application software installed in the network manager 10. A network connection is established between the network manager 10 and the cluster server 20 to realize the transmission of data information. The network manager 10 can be used to execute the cloud-native-based multi-network mode implementation method to connect the network interface with the corresponding plug-in in the cluster server 20. The network manager 10 can be a server configured within an enterprise or government department for network address management, and the cluster server 20 can be a server configured within an enterprise or government department for processing business data. Figure 1 As shown, the method includes steps S110 to S160.
[0037] S110: If a load creation request is received, verify the load creation request to obtain a verification result of whether it passes.
[0038] If a load creation request is received, the load creation request is verified to obtain a verification result of whether it passes. By verifying the load creation request, the security of load creation can be improved, and processing of load creation requests that do not meet the requirements can be avoided, thereby improving the security of the operation of the management server. The network manager 10 can receive the load creation request and verify the load creation request. Specifically, the load creation request can be authenticated. The load creation request can also be subjected to an access check.
[0039] For example, the network manager 10 may receive a load creation request through the kube-apiserver service, and call a corresponding verification method of the kube-apiserver service to verify the load creation request.
[0040] In one embodiment, if Figure 3 As shown, step S110 includes sub-steps S111, S112 and S113.
[0041] S111. Perform an authority authentication check on the load creation request to obtain a first verification result of whether the authority authentication is passed.
[0042] The load creation request can be authenticated and verified by obtaining the certificate and authentication identifier of the load creation request, and verifying the certificate by the authentication identifier. For example, the data values in the certificate are obtained, and the corresponding summary information is calculated after combining the data values, and the summary information is compared with the authentication identifier to see if they are the same, so as to realize the authentication and verification of the load creation request.
[0043] If the summary information is the same as the authentication identifier, a first verification result indicating that the authentication is passed is obtained; otherwise, a first verification result indicating that the authentication is failed is obtained.
[0044] S112: If the first verification result is passed, perform admission verification on the load creation request according to a preset admission controller to obtain a second verification result of whether the admission verification is passed.
[0045] The network manager 10 is also configured with an admission controller, through which the load creation request is admitted and checked. Specifically, the admission controller includes a modification type admission controller and a check type admission controller. The modification type admission controller can be executed serially first, and then the check type admission controller can be executed in parallel. The second check result returned by the admission controller is obtained.
[0046] S113. If the second verification result is passed, perform a format check on the load creation request to obtain a verification result of whether the format check passes, and use the verification result of the format check as the final verification result.
[0047] If the second verification result is passed, the format verification of the load creation request can be performed, such as verifying the schema of the request object corresponding to the load creation request. Schema, namely XML Schema, XSD (XML Schema Definition) is a recommended standard for XML. The type of verification parameters of the request object corresponding to the load creation request, the type of parameter values, and whether they are necessary parameters can be verified to obtain the result of whether the format verification is passed. According to the result of the format verification, it is determined whether the load creation request finally passes the verification. If the result of the format verification is passed, a verification result of passing is obtained; if the result of the format verification is not passed, the second verification result is not passed, or the first verification result is not passed, a verification result of not passing is obtained.
[0048] In one embodiment, if Figure 4 As shown, step S110 also includes step S1101 after step S110.
[0049] S1101. If the verification result is passed, the request object corresponding to the load creation request is stored in a preset distributed storage database.
[0050] The network manager 10 is also configured with a distributed storage database. If the verification result is passed, the request object corresponding to the load creation request is stored in the distributed database. Storing the load creation request in the distributed database can improve the efficiency of subsequent cluster servers reading the load creation request for processing, thereby improving the efficiency of load creation. For example, the request object can be stored in the ETCD database, which is a distributed key-value data storage system that provides shared configuration, service registration and discovery.
[0051] S120: If the verification result is passed, send the load creation request to the cluster server to create a workload corresponding to the load creation request in the cluster server, where the workload is a collection of multiple work units.
[0052] If the verification result is passed, the load creation request is sent to the cluster server to create a workload corresponding to the load creation request in the cluster server, and the workload is a collection of multiple work units. If the verification result is passed, the network manager sends the load creation request to the cluster server, and the cluster server creates the corresponding workload according to the load creation request. The workload contains multiple work units. If the work unit can be a pod unit, then the workload is also a collection of multiple pod units. Pod is a container configured in the cluster server for data processing. The kube-scheduler component in the network manager can listen to the events of the pod unit through the apiserver.
[0053] S130. Screening preset network nodes according to unit characteristics of the working units in the workload to obtain target nodes corresponding to the unit characteristics of each working unit and satisfying preset screening conditions.
[0054] The preset network nodes are screened according to the unit characteristics of the working units in the workload to obtain the target nodes corresponding to the unit characteristics of each working unit and satisfying the preset screening conditions. The target nodes can be obtained to configure the network interface corresponding to the unit characteristics of the working units, thereby improving the stability of the working units sending and receiving network information through the target nodes, that is, improving the stability of the operation of the working units. The workload includes multiple working units, each of which has a corresponding unit characteristic. The unit characteristic can be used to record the various characteristics corresponding to the working units. The network nodes can be screened by the unit characteristics of the working units to obtain the target nodes corresponding to the unit characteristics of each working unit. Usually, there is only one target node corresponding to each working unit.
[0055] In one embodiment, if Figure 5 As shown, step S130 includes sub-steps S131, S132 and S133.
[0056] S131. Filter out candidate network nodes whose screening parameters match the unit characteristics from the network nodes according to the unit characteristics and the screening parameters corresponding to the network nodes and the unit characteristics.
[0057] According to the unit characteristics and the corresponding screening parameters in the network nodes, it is possible to judge whether the screening parameters match the unit characteristics, thereby obtaining the candidate network nodes that match each working unit. The unit characteristics include the network protocol type, transmission type, etc., and the screening parameters corresponding to the unit characteristics in each network node can be obtained. The screening parameters include the parameter values corresponding to the network protocol type, transmission type, etc., and it is judged whether the values of each item in the unit characteristics are the same as the screening parameters, thereby determining whether the working unit to which the unit characteristics belong matches the network node corresponding to the screening parameters, and obtaining all network nodes that match the unit characteristics of the working unit as the candidate network nodes corresponding to the working unit.
[0058] S132: Calculate the resource score corresponding to the candidate network node according to the resource scoring formula in the screening condition.
[0059] After the candidate network nodes are obtained through preliminary screening, the resource score of each candidate network node can be calculated through the resource scoring formula. Specifically, the values corresponding to the candidate network nodes in multiple resource dimensions can be obtained, and the values of multiple resource dimensions can be weightedly calculated through the resource scoring formula to obtain the corresponding resource score.
[0060] For example, the resource scoring formula can be S=a×R1+b×R2+C×R3, where a, b and c are weight values in the resource scoring formula, and R1, R2 and R3 are values corresponding to resource dimensions, where resource dimensions can be CPU load, memory share, disk share, etc.
[0061] S133: Acquire a candidate network node whose resource score is not less than the score threshold in the screening condition as a target node corresponding to the unit characteristic.
[0062] The screening condition also includes a scoring threshold, and the candidate network nodes whose resource scores are not less than the scoring threshold in each work unit can be obtained as the target nodes corresponding to the unit characteristics of the work unit. If there is only one network node whose resource scores are not less than the scoring threshold among the candidate network nodes, then the network node is directly obtained as the corresponding target node; if there are multiple network nodes whose resource scores are not less than the scoring threshold among the candidate network nodes, then the network node with the largest score value can be obtained as the corresponding target node. Through the above method, the corresponding target node can be screened out from the candidate network nodes corresponding to each work unit.
[0063] S140: Bind the network characteristics of each of the working units with the corresponding target node to generate header information corresponding to each of the working units.
[0064] The network characteristics of each work unit are bound to the corresponding target node to generate header information corresponding to each work unit. The network characteristics of each work unit can be obtained, and the network characteristics of the work unit are bound to the corresponding target node to generate header information corresponding to each work unit. By binding the work unit to the corresponding target node, the target node is dedicated to the corresponding work unit, further improving the stability of the work unit operation. Specifically, the header information (annotation) of the pod unit includes at least the network address (IP address), mask, gateway, sub-plug type, VLAN address, advanced feature switch and node identification.
[0065] In one embodiment, if Figure 6 As shown, step S140 includes sub-steps S141, S142, S143, S144 and S145.
[0066] S141. Determine the network address configuration status of the working unit.
[0067] Specifically, the network address configuration status of the working unit may be judged first, and the network address configuration status includes a configured network address, a reserved network address, and an unconfigured network address.
[0068] S142: If the working unit has been configured with a network address, obtain corresponding network features according to the network address of the working unit.
[0069] If the work unit has been configured with a network address, the network characteristics corresponding to the network address can be directly obtained. Network characteristics include mask, gateway, sub-plug type, VLAN address, and advanced feature switches.
[0070] S143: If the working unit specifies a reserved network address, select one from the reserved network addresses as a target network address and obtain corresponding network characteristics.
[0071] If the work unit specifies a reserved network address, one of the reserved network addresses can be selected as the target network address. Usually, the reserved network address consists of multiple network addresses, one of which can be randomly selected as the target network address, and the corresponding network characteristics can be obtained based on the target network address.
[0072] S144: If the working unit is not configured with a network address, request allocation of a network address from the subnet of the working unit corresponding to the target node and obtain corresponding network characteristics.
[0073] If the work unit is not configured with a network address, a network address may be allocated from the subnet request of the target node corresponding to the work unit, and corresponding network characteristics may be obtained based on the allocated network address.
[0074] S145. Bind the network characteristics of each of the working units with the node identifier of the corresponding target node to generate header information corresponding to each of the working units.
[0075] The network characteristics of each working unit are bound to the node identifier of the corresponding target node, so as to achieve the binding of the network characteristics of the working unit to the corresponding target node. After the above information is bound, the header information corresponding to each working unit can be generated.
[0076] In one embodiment, if Figure 7 As shown, step S1451 is also included before step S145.
[0077] S1451. Store the network characteristics of the working unit in a preset resource pool.
[0078] The network manager 10 is also configured with a resource pool, which can store the network characteristics of the work unit in a preset resource pool, so that the network characteristics of each work unit can be more conveniently obtained from the resource pool in subsequent use. The resource pool can be a K8s crd resource pool, that is, the K8s crd resource pool is a resource pool for storing network characteristics based on the K8s standard configuration.
[0079] S150: If an event from any of the working units is monitored, parse the header information corresponding to the working unit to obtain plug-in information.
[0080] If an event from any of the working units is monitored, the header information corresponding to the working unit is parsed to obtain the plug-in information. After an event from any of the working units is monitored, the header information of the working unit can be parsed to obtain the plug-in information corresponding to the working unit. The event can be a working unit scheduling event.
[0081] For example, kubelet can monitor event changes from pod work units. If event changes from pod units are monitored, the header information of the pod is parsed to obtain the corresponding network address and plug-in type. The plug-in information at least includes the network address and the plug-in type. The parameter information required to request the corresponding plug-in is constructed based on the plug-in information.
[0082] In one embodiment, if Figure 8 As shown, step S1501 is included before step S150.
[0083] S1501. Create a sandbox environment corresponding to the event and add a network interface corresponding to the event.
[0084] After monitoring the event changes from the pod work unit through kubelet, you can create a sandbox environment corresponding to the event and add a network interface corresponding to the event in the sandbox environment. By creating a sandbox environment, you can isolate it from the external working environment, avoid external factors from interfering with the data stored in the sandbox environment, and thus improve the security of event forwarding processing.
[0085] For example, if changes from pod events are monitored through kubelet, a corresponding sandbox environment is created, and a network interface of the corresponding network namespace is added in the created sandbox environment; since a network interface needs to be added, the Beenet-cni plug-in can be loaded and a request can be sent to the Beenet-server by connecting the socket. By default, the Beenet-server is a socket-based monitoring service and does not need to monitor on a network address (IP address).
[0086] S160: Forward the processing request including the network interface corresponding to the event to the plug-in corresponding to the plug-in information to perform network interface docking.
[0087] The processing request containing the network interface corresponding to the event is forwarded to the plug-in corresponding to the plug-in information to connect the network interface. The processing request containing the network interface corresponding to the event is forwarded, and the processing request contains the network interface corresponding to the event and the parameter information required by the corresponding plug-in. The processing request is forwarded to the plug-in corresponding to the plug-in information to complete the connection of the network interface.
[0088] For example, the processing request may be a Beenet-cni request, which is forwarded by eenet-server to the plug-in that actually executes the processing request at the back end of the cluster server. The plug-in that executes the processing request may be one or more (such as calling ipvlan and sriov plug-ins at the same time). By forwarding the processing request, the network interface can be added to the corresponding network namespace, thereby realizing the docking of the network interface.
[0089] In the cloud-native-based multi-network mode implementation method provided in the embodiment of the present invention, the load creation request is verified. If the verification passes, it is sent to the cluster server to create the corresponding workload. The network nodes are screened according to the unit characteristics of the work units in the workload to obtain the target nodes corresponding to the unit characteristics of each work unit. The network characteristics of the work unit are bound to the corresponding target nodes to generate header information. After monitoring the events of the work unit, the header information of the work unit is parsed to obtain the plug-in information, and the event processing request is forwarded to the plug-in corresponding to the plug-in information for network interface docking. Through the above method, multi-network adaptation applications are performed through the network manager, which can greatly improve compatibility, bind the network characteristics of the work unit to the corresponding target node, thereby achieving balanced scheduling of the work unit and improving the efficiency of network address allocation and network interface docking.
[0090] The embodiment of the present invention also provides a multi-network mode implementation device based on cloud native, which can be configured in a network manager, and a network connection is established between the network manager and the cluster server to realize the transmission of data information. The multi-network mode implementation device based on cloud native is used to execute any embodiment of the aforementioned multi-network mode implementation method based on cloud native. Specifically, please refer to Fig. 9 , Fig. 9 A schematic block diagram of a cloud-native based multi-network mode implementation device provided in an embodiment of the present invention.
[0091] like Fig. 9 As shown, the cloud-native based multi-network mode implementation device 100 includes a verification result acquisition unit 110, a load creation request sending unit 120, a network node screening unit 130, a header information generation unit 140, a plug-in information acquisition unit 150 and a processing request forwarding unit 160.
[0092] The verification result obtaining unit 110 is used to verify the load creation request to obtain a verification result indicating whether the load creation request has passed if a load creation request has been received.
[0093] The load creation request sending unit 120 is used to send the load creation request to the cluster server to create a workload corresponding to the load creation request in the cluster server if the verification result is passed, and the workload is a collection of multiple work units.
[0094] The network node screening unit 130 is used to screen the preset network nodes according to the unit characteristics of the working units in the workload to obtain target nodes corresponding to the unit characteristics of each working unit and meeting the preset screening conditions.
[0095] The header information generating unit 140 is used to bind the network characteristics of each of the working units with the corresponding target node to generate header information corresponding to each of the working units.
[0096] The plug-in information acquisition unit 150 is used to parse the header information corresponding to any of the working units to obtain the plug-in information if an event from the working unit is monitored.
[0097] The processing request forwarding unit 160 is used to forward the processing request containing the network interface corresponding to the event to the plug-in corresponding to the plug-in information to perform network interface docking.
[0098] The multi-network mode implementation device based on cloud native provided in the embodiment of the present invention applies the multi-network mode implementation method based on cloud native, verifies the load creation request, and if the verification passes, sends it to the cluster server to create the corresponding workload, screens the network nodes according to the unit characteristics of the working unit in the workload, obtains the target node corresponding to the unit characteristics of each working unit, binds the network characteristics of the working unit with the corresponding target node to generate header information, parses the header information of the working unit after monitoring the event of the working unit to obtain the plug-in information, and forwards the event processing request to the plug-in corresponding to the plug-in information for network interface docking. Through the above method, multi-network adaptation application is performed through the network manager, which can greatly improve compatibility, bind the network characteristics of the working unit with the corresponding target node, thereby achieving balanced scheduling of the working unit and improving the efficiency of network address allocation and network interface docking.
[0099] The above-mentioned cloud-native-based multi-network mode implementation device can be implemented in the form of a computer program, which can be used in the following ways: Fig.10 Runs on the computer device shown.
[0100] See also Fig.10 , Fig.10 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device may be a network manager for executing a multi-network mode implementation method based on cloud native to connect a network interface with a corresponding plug-in in a cluster server.
[0101] See also Fig.10 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .
[0102] The storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 may execute a multi-network mode implementation method based on cloud native, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
[0103] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0104] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a multi-network mode implementation method based on cloud native.
[0105] The network interface 505 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0106] The processor 502 is used to run a computer program 5032 stored in the memory to implement the corresponding functions in the above-mentioned cloud-native-based multi-network mode implementation method.
[0107] Those skilled in the art will understand that Fig.10 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Fig.10 The embodiments shown are consistent and will not be described again here.
[0108] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0109] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps included in the above-mentioned cloud-native-based multi-network mode implementation method are implemented.
[0110] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0111] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0113] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk.
[0115] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for implementing a multi-network mode based on cloud native, the method is applied to a network manager, and a network connection is established between the network manager and a cluster server to realize the transmission of data information, characterized in that: The method comprises: If a load creation request is received, verify the load creation request to obtain a verification result of whether it passes; If the verification result is passed, sending the load creation request to the cluster server to create a workload corresponding to the load creation request in the cluster server, wherein the workload is a collection of multiple work units; Screening preset network nodes according to the unit characteristics of the working units in the workload to obtain target nodes corresponding to the unit characteristics of each working unit and satisfying preset screening conditions; Binding the network characteristics of each of the working units to the corresponding target node to generate header information corresponding to each of the working units; If an event from any of the working units is monitored, the header information corresponding to the working unit is parsed to obtain the plug-in information; Forwarding a processing request including the network interface corresponding to the event to a plug-in corresponding to the plug-in information for network interface docking; The step of binding the network features of each of the working units to the corresponding target node to generate header information corresponding to each of the working units includes: Determining the network address configuration status of the working unit; If the working unit has been configured with a network address, obtaining corresponding network characteristics according to the network address of the working unit; If the working unit specifies a reserved network address, select one of the reserved network addresses as a target network address and obtain corresponding network characteristics; If the working unit is not configured with a network address, requesting allocation of a network address from a subnet of a target node corresponding to the working unit and obtaining corresponding network characteristics; The network characteristics of each of the working units are bound to the node identifier of the corresponding target node to generate header information corresponding to each of the working units.
2. The method for implementing a multi-network mode based on cloud native according to claim 1, characterized in that: The verifying the load creation request to obtain a verification result of whether it passes or not includes: Performing an authorization authentication check on the load creation request to obtain a first verification result of whether the authorization authentication is passed; If the first verification result is passed, performing admission verification on the load creation request according to a preset admission controller to obtain a second verification result of whether the admission verification is passed; If the second verification result is passed, the load creation request is format checked to obtain a verification result of whether the format verification passes, and the verification result of the format verification is used as the final verification result.
3. The method for implementing a multi-network mode based on cloud native according to claim 1 or 2, characterized in that: After verifying the load creation request to obtain a verification result of whether it passes, the method further includes: If the verification result is passed, the request object corresponding to the load creation request is stored in a preset distributed storage database.
4. The method for implementing a multi-network mode based on cloud native according to claim 1, characterized in that: The screening of preset network nodes according to the unit characteristics of the working units in the workload to obtain target nodes corresponding to the unit characteristics of each working unit and satisfying preset screening conditions includes: According to the unit characteristics and the screening parameters corresponding to the network nodes and each of the unit characteristics, screening out candidate network nodes whose screening parameters match the unit characteristics from the network nodes; Calculate the resource score corresponding to the candidate network node according to the resource scoring formula in the screening condition; A candidate network node whose resource score is not less than a score threshold in the screening condition is obtained as a target node corresponding to the unit characteristic.
5. The method for implementing a multi-network mode based on cloud native according to claim 1, characterized in that: Before binding the network characteristics of each working unit with the node identifier of the corresponding target node, the method further includes: The network characteristics of the work unit are stored in a preset resource pool.
6. The method for implementing a multi-network mode based on cloud native according to claim 1, characterized in that: Before parsing the header information corresponding to the work unit to obtain the plug-in information, the method further includes: A sandbox environment corresponding to the event is created and a network interface corresponding to the event is added.
7. A multi-network mode implementation device based on cloud native, characterized in that: The device is configured in a network manager, and a network connection is established between the network manager and the cluster server to realize the transmission of data information. The device includes: A verification result obtaining unit, configured to verify the load creation request to obtain a verification result indicating whether the load creation request has passed if a load creation request has been received; A load creation request sending unit, configured to send the load creation request to the cluster server to create a workload corresponding to the load creation request in the cluster server if the verification result is passed, wherein the workload is a collection of multiple work units; A network node screening unit, used to screen preset network nodes according to the unit characteristics of the working units in the workload, so as to obtain target nodes corresponding to the unit characteristics of each working unit and satisfying preset screening conditions; A header information generating unit, used to bind the network characteristics of each of the working units with the corresponding target node to generate header information corresponding to each of the working units; A plug-in information acquisition unit, configured to parse the header information corresponding to any of the working units to acquire the plug-in information if an event from the working unit is monitored; A processing request forwarding unit, used to forward the processing request containing the network interface corresponding to the event to the plug-in corresponding to the plug-in information for network interface docking; The step of binding the network features of each of the working units to the corresponding target node to generate header information corresponding to each of the working units includes: Determining the network address configuration status of the working unit; If the working unit has been configured with a network address, obtaining corresponding network characteristics according to the network address of the working unit; If the working unit specifies a reserved network address, select one of the reserved network addresses as a target network address and obtain corresponding network characteristics; If the working unit is not configured with a network address, requesting allocation of a network address from a subnet of a target node corresponding to the working unit and obtaining corresponding network characteristics; The network characteristics of each of the working units are bound to the node identifier of the corresponding target node to generate header information corresponding to each of the working units.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the cloud-native based multi-network mode implementation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the cloud-native-based multi-network mode implementation method as described in any one of claims 1 to 6.
