CN113342461B - Equipment mounting method and device, computer equipment and readable storage medium - Google Patents

Equipment mounting method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN113342461B
CN113342461B CN202110598938.8A CN202110598938A CN113342461B CN 113342461 B CN113342461 B CN 113342461B CN 202110598938 A CN202110598938 A CN 202110598938A CN 113342461 B CN113342461 B CN 113342461B
Authority
CN
China
Prior art keywords
equipment
mounting
service
container
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110598938.8A
Other languages
Chinese (zh)
Other versions
CN113342461A (en
Inventor
包梦源
田志仲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to CN202110598938.8A priority Critical patent/CN113342461B/en
Publication of CN113342461A publication Critical patent/CN113342461A/en
Application granted granted Critical
Publication of CN113342461B publication Critical patent/CN113342461B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

The invention provides a device mounting method, a device, a computer device and a readable storage medium, wherein a service container creation request is intercepted, mounting devices are selected according to user-defined device parameters and available online devices of a user, the selected mounting devices are mounted in a newly created container by using corresponding configuration mapping files, a device scheduling use strategy and a device scheduling rule of a user-defined scene can be expanded and added according to needs, the corresponding mounting devices are selected according to the user-defined parameters, the performance problem caused by affinity between the devices and the services is avoided actively, and the performance loss is reduced greatly.

Description

Equipment mounting method and device, computer equipment and readable storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a device mounting method and apparatus, a computer device, and a readable storage medium.
Background
With the continuous progress of scientific technology, the internet technology is greatly developed, so that a user can know more knowledge through the internet to contact more contents and realize more functions, and great convenience is brought to the life and learning of the user. The process of application deployment in the current internet enterprise production environment can be roughly divided into three stages: the method comprises the steps of physical machine deployment, virtual machine deployment and containerized deployment, wherein the containerized deployment is widely applied due to the advantages of small consumption, low license cost, portability, rapid deployment, better and better container management and automation and the like.
The application deployment in the enterprise production environment mainly needs to be finally realized through Device mounting, and taking Device mounting in a kubernets environment as an example, mostly, a privilege Container is configured, all devices under a host computer are mounted, or devices are directly mounted in a Volume Mount manner, or a Device plug-in manner is used to inform a Container Runtime of a Device identifier (Identity document, ID) that needs to be mounted, and the Container Runtime of the Container identifier configures rights of related devices and mounts the devices.
Disclosure of Invention
The embodiment of the disclosure at least provides a device mounting method and device, computer equipment and a readable storage medium.
In a first aspect, an embodiment of the present disclosure provides a device mounting method, where the method includes:
intercepting a service container creation request responding to a service deployment request, wherein the service deployment request comprises user-defined equipment parameters set by a user;
determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device;
adding the device information of the at least one mounting device to a configuration mapping file of the service container creation request;
and mounting each mounting device into a corresponding container in the newly created container group based on the configuration mapping file added with the device information and the service container creation request.
Therefore, by intercepting a service container creation request, selecting mounting equipment according to user-defined equipment parameters and available online equipment of a user, and using a corresponding configuration mapping file to mount the selected mounting equipment in a newly created container, an equipment scheduling use strategy and an equipment scheduling rule of a user-defined scene can be expanded and added as required, corresponding mounting equipment is selected according to the user-defined parameters, the performance problem caused by affinity between the equipment and the service is avoided actively, and the performance loss is reduced greatly.
In an optional embodiment, before the intercepting a service container creation request in response to a service deployment request, the method comprises:
and acquiring a service deployment request of a user for setting the user-defined equipment parameters.
In an optional embodiment, the adding the device information of the at least one mounted device to the configuration mapping file of the service container creation request includes:
initializing a configuration mapping file in the service container creation request;
and adding the equipment information of the at least one mounting equipment into the initialized configuration mapping file.
Therefore, by adding the equipment information in the initialized configuration mapping file, a user-defined equipment scheduling rule can be added, random selection of mounted equipment is avoided, and the affinity between equipment and service is improved.
In an optional embodiment, the method further comprises:
creating a new container group comprising at least one container;
adding an equipment-mounted environment variable to the container group, wherein the environment variable points to the configuration mapping file.
Therefore, by adding the configuration mapping file pointing to the mounted equipment information to the container group, the equipment scheduling and using strategy of the user-defined scene can be expanded as required, and the resource utilization rate is improved.
In an optional embodiment, the mounting each mounted device to a corresponding container in a newly created container group based on the configuration mapping file after adding the device information and the service container creation request includes:
and mounting each mounting device into a corresponding container in the newly created container group based on the configuration mapping file added with the device information and the environment variable.
In an optional embodiment, the method further comprises:
updating the equipment state information of each registered equipment, including an online event and/or an offline event, through the connection between the equipment manager and the software development kit of the equipment;
and determining at least one available online device in an available state according to the updated state information of each device and the monitored use condition of the existing container group to the device.
In an optional embodiment, the updating, through the connection between the device manager and the software development kit of the device, the device status information including an online event and/or an offline event of each registered device includes:
registering each device;
monitoring an online event and/or an offline event of each device through the connection between the device manager and a software development kit of the device;
and updating the stored equipment state information of the corresponding equipment according to the monitored on-line event and/or off-line event.
Therefore, through the connection between the software development toolkits of the equipment, the state of the equipment can be automatically sensed and updated when the equipment is on line again, and the real-time monitoring and the real-time state hot updating of the equipment are realized.
In a second aspect, an embodiment of the present disclosure further provides an apparatus for mounting a device, where the apparatus includes:
the system comprises a request intercepting module, a service container creating module and a service deploying module, wherein the request intercepting module is used for intercepting a service container creating request responding to a service deploying request, and the service deploying request comprises user-defined equipment parameters set by a user;
the device determining module is used for determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device;
the file configuration module is used for adding the equipment information of the at least one mounting equipment to a configuration mapping file of the service container creation request;
and the equipment mounting module is used for mounting each mounting equipment into a corresponding container in the newly created container group based on the configuration mapping file added with the equipment information and the service container creation request.
In an alternative embodiment, the apparatus further comprises:
and the request acquisition module is used for acquiring the service deployment request with the user-defined equipment parameters.
In an optional embodiment, the file configuration module is specifically configured to:
initializing a configuration mapping file in the service container creation request;
and adding the equipment information of the at least one mounting equipment into the initialized configuration mapping file.
In an optional embodiment, the apparatus further comprises a variable adding module, and the variable adding module is configured to:
creating a new container group comprising at least one container;
adding an equipment-mounted environment variable to the container group, wherein the environment variable points to the configuration mapping file.
In an optional implementation manner, the device mount module is specifically configured to:
and mounting each mounting device into a corresponding container in the newly created container group based on the configuration mapping file added with the device information and the environment variable.
In an optional embodiment, the apparatus further comprises a device monitoring module, the device monitoring module is configured to:
updating the equipment state information of each registered equipment, including an online event and/or an offline event, through the connection between the equipment manager and the software development kit of the equipment;
and determining at least one available online device in an available state according to the updated state information of each device and the monitored use condition of the existing container group to the device.
In an optional embodiment, when the device monitoring module is configured to update the device status information of each registered device, which includes an online event and/or an offline event, through connection between the device manager and a software development kit of the device, the device monitoring module is specifically configured to:
registering each device;
monitoring an online event and/or an offline event of each device through the connection between the device manager and a software development kit of the device;
and updating the stored equipment state information of the corresponding equipment according to the monitored on-line event and/or off-line event.
In a third aspect, an embodiment of the present disclosure further provides a computer device, including: the device comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor and the memory are communicated through the bus when a computer device runs, and the machine-readable instructions can execute the steps of the device mounting method when the processor executes the machine-readable instructions.
In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program may perform the steps of the above-mentioned device mounting method.
The equipment mounting method, the equipment mounting device, the computer equipment and the readable storage medium provided by the embodiment of the disclosure intercept a service container establishing request responding to a service deployment request, wherein the service deployment request comprises a user-defined equipment parameter set by a user; determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device; adding the device information of the at least one mounted device to a configuration mapping file of the service container creation request; and mounting each mounting device to a corresponding container in the newly-created container group based on the configuration mapping file after the device information is added and the service container creation request.
Therefore, by intercepting a service container creation request, selecting mounting equipment according to user-defined equipment parameters and available online equipment of a user, and using a corresponding configuration mapping file to mount the selected mounting equipment in a newly created container, the equipment scheduling use strategy and the equipment scheduling rule of a user-defined scene can be expanded and added as required, the corresponding mounting equipment is selected according to the user-defined parameters, the performance problem caused by affinity between the equipment and the service is avoided actively, and the performance loss is reduced greatly.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 is a flowchart of a device mounting method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a device scheduling mechanism provided in an embodiment of the present disclosure;
fig. 3 is a flowchart of another device mounting method provided in the embodiments of the present disclosure;
fig. 4 is a schematic diagram of a device registration and real-time dynamic update mechanism provided in an embodiment of the present disclosure;
fig. 5 is one of schematic diagrams of an apparatus mounting device according to an embodiment of the present disclosure;
fig. 6 is a second schematic diagram of an apparatus mounting device according to the second embodiment of the disclosure;
fig. 7 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
Research shows that, in application deployment in an enterprise production environment, application deployment is mainly achieved through Device mounting at present, taking Device mounting in a kubernets environment as an example, most devices under a host computer are mounted through configuration of a privileged Container, or devices are directly mounted through a Volume Mount (Volume Mount) mode, or Device IDs that are required to be mounted through notification of Container Runtime by Device Plugin (Device Plugin) are notified, and Container Runtime configures related Device permissions and mounts the devices.
Based on the research, the present disclosure provides an equipment mounting method, which includes intercepting a service container creation request, selecting a mounting device according to a user-defined device parameter and an available online device of a user, and mounting the selected mounting device in a newly created container by using a corresponding configuration mapping file, so that an equipment scheduling use strategy and an equipment scheduling rule of a user-defined scene can be extended and added as needed, and a corresponding mounting device is selected according to the user-defined parameter, thereby actively avoiding a performance problem caused by affinity between equipment and a service, and greatly reducing performance loss.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
To facilitate understanding of the present embodiment, first, a device mounting method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the device mounting method provided in the embodiments of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: a terminal device, which may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle mounted device, a wearable device, or a server or other processing device. In some possible implementations, the device mount method may be implemented by a processor invoking computer readable instructions stored in a memory.
The following describes a device mounting method provided by the embodiment of the present disclosure by taking an execution subject as a server.
Referring to fig. 1, fig. 1 is a flowchart of a device mounting method according to an embodiment of the disclosure. As shown in fig. 1, the method comprises:
s101: intercepting a service container creating request responding to a service deployment request, wherein the service deployment request comprises user-defined equipment parameters set by a user.
In this step, when a user needs to perform service deployment, a service deployment request may be sent according to a service requirement, so as to generate a corresponding service container creation request, and create a service container according to the service deployment request, so as to subsequently perform device mounting and implement service deployment.
For example, please refer to fig. 2, fig. 2 is a schematic diagram of a device scheduling mechanism provided by the embodiment of the present disclosure, and as shown in fig. 2, taking device mount in a kubernets environment as an example, the service container creation request may be intercepted by a variant Admission network hook in an Admission Controller, notification Admission Webhook.
In a specific embodiment, the user may select a device to be deployed for the service deployment by adding an annotation, for example, by selecting a device number form in each node of the distributed cluster management system kubelet.
S102: and determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device.
In this step, after the service container creation request is intercepted, at least one mounted device meeting the service deployment requirement and the user requirement at this time is selected from the at least one available online device by acquiring the at least one monitored available online device and combining the user-defined device parameters.
The at least one monitored available online device may be an online device determined by monitoring devices registered in each node of the kubel in real time, such as a device in an online state, an unused device, and a device which is newly online.
S103: and adding the equipment information of the at least one mounting equipment into the configuration mapping file of the service container creation request.
In this step, after determining the at least one mount device, the at least one mount device may be considered to be a device suitable for service deployment corresponding to the service deployment request, and therefore, the device information of the at least one mount device may be added to the configuration mapping file of the service container creation request.
The configuration mapping file of the service container creation request may be a configuration mapping file configured in the service container creation request generated in response to the service deployment request, so that the device information addition may be to update original randomly configured device information in the configuration mapping file, or may be to reconfigure a configuration mapping file for the service container creation request, and add device information in the newly configured configuration mapping file.
For example, as shown in fig. 2, in a kubernets environment, at least one mounted device may be selected comprehensively according to a device selected according to the annotations and the monitored device usage, so as to inject device information, such as a device number, of the at least one mounted device into a configuration map file configmap.
S104: and mounting each mounting device to a corresponding container in the newly-created container group based on the configuration mapping file after the device information is added and the service container creation request.
In this step, after the configuration mapping file to which the device information is added is obtained, the device mount can be performed in combination with the service container creation request.
The service container creation request may be an intercepted service container creation request, or a new service container creation request generated according to the intercepted service container creation request and redeployed information for the service deployment.
For example, as shown in fig. 2, taking device mount in a Kubernetes environment as an example, when a Kubelet senses that a node has a new Container pod that needs to be deployed, a docker (an open-source application Container engine) Container may be started, container Runtime Container associated with a device is used to inject prehook into Runc spec, and then, running is started, and at least one corresponding mounting device is mounted into a corresponding Container by hooking Container running time related to the device called by the running at the prehook process and calling a device mounting service Container running time Cli by the running.
According to the device mounting method provided by the embodiment of the disclosure, by intercepting a service container creation request, mounting devices are selected according to user-defined device parameters and available online devices of a user, and the selected mounting devices are mounted in a newly created container by using corresponding configuration mapping files, a device scheduling use strategy and a device scheduling rule of a user-defined scene can be expanded and added as required, corresponding mounting devices are selected according to the user-defined parameters, the performance problem caused by affinity between the devices and the services is avoided actively, and the performance loss is reduced greatly.
Referring to fig. 3, fig. 3 is a flowchart of another device mounting method according to an embodiment of the disclosure. As shown in fig. 3, the method includes:
s301: and acquiring a service deployment request with user-defined equipment parameters.
In this step, after the user sends the service deployment request configured with the custom device parameters, the request may be received.
The custom device parameter may include information such as the number of a device already registered in the distributed cluster management system kubel, or may be some technical parameters of a device that a user desires to configure and needs to use, such as performance parameters of frequency, memory, computing power, and the like.
S302: intercepting a service container creating request responding to a service deployment request, wherein the service deployment request comprises user-defined equipment parameters set by a user.
S303: and determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device.
S304: adding the device information of the at least one mounted device to a configuration mapping file of the service container creation request.
S305: and mounting each mounting device to a corresponding container in the newly-created container group based on the configuration mapping file after the device information is added and the service container creation request.
The descriptions of step S302 to step S305 may refer to the descriptions of step S101 to step S104, and the same technical effect and the same technical problem can be achieved, and are not described herein again.
In some possible embodiments, step S304 includes:
initializing a configuration mapping file in the service container creation request; and adding the equipment information of the at least one mounting equipment into the initialized configuration mapping file.
In this step, no matter the original configuration mapping file in the intercepted service container creation request is used, or the configuration mapping file newly configured for the service container creation request is used, the configuration mapping file may be initialized, for example, the device ID in the configuration mapping file, and then the device information of the selected mounted device is added to the initialized configuration mapping file.
For example, as shown in fig. 2, in a kubernets environment, the configuration map file may be initialized by calling a multicasting advertisement Webhook to initialize the randomly selected device ID recorded in the configuration map file, and then the device information, such as the device number, of the selected at least one mounted device may be injected into the configuration map file configmap by the Scheduler Extender.
In some possible embodiments, the method further comprises:
creating a new container group comprising at least one container; adding an equipment-mounted environment variable to the container group, wherein the environment variable points to the configuration mapping file.
In this step, after it is sensed that there is a need for service deployment, that is, when there is a container to be deployed, a container group may be newly created, and some parameters used to specify an operating environment of an operating system, such as a temporary folder location and a system folder location, are added to the container group, and the environment variable points to the configuration mapping file, for example, a path of a file or a folder is the configuration mapping file, so that the configuration mapping file may be called when used.
For example, as shown in fig. 2, in a kubernets environment, a Kubelet perceives that a node has a new container pod to be deployed, a container group including at least one container may be created according to a service deployment requirement, for example, the number of containers is the same as that of required mounted devices, an environment variable mounted by a device is added to the pod through a called multicast advertisement Webhook, and the container is directed to a configuration map file configmap.
Accordingly, in some possible embodiments, step S305 includes:
and mounting each mounting device into a corresponding container in the newly created container group based on the configuration mapping file added with the device information and the environment variable.
In this step, according to the configuration mapping file to which the device information is added and the environment variable pointing to the configuration file, a corresponding parameter may be set for the container corresponding to each mounted device, and device mounting may be performed.
In some possible embodiments, the method further comprises:
updating the equipment state information of each registered equipment, including an online event and/or an offline event, through the connection between the equipment manager and the software development kit of the equipment; and determining at least one available online device in an available state according to the updated state information of each device and the monitored use condition of the existing container group to the device.
In this step, in order to dynamically monitor the available device, the device may be directly monitored in the form of a bottom layer data packet through the connection between the device manager and the software development kit of the device, so as to sense an online event and/or an offline event of the device, and update the state of the registered device through the corresponding device state information and the use condition of the existing device, thereby determining at least one available online device in an available state.
Further, in some possible embodiments, the updating the device status information including the online event and/or the offline event of each registered device through the connection between the device manager and the software development kit of the device includes:
registering each device; monitoring an online event and/or an offline event of each device through the connection between the device manager and a software development kit of the device; and updating the stored equipment state information of the corresponding equipment according to the monitored on-line event and/or off-line event.
For example, please refer to fig. 4, fig. 4 is a schematic diagram of a Device registration and real-time dynamic update mechanism provided in the embodiment of the present disclosure, as shown in fig. 4, in a kubernets environment, a Device manager Device plugin may be called, the Device plugin is connected to an event service of a software development kit SDK of a Device through a socket, an online event and/or an offline event of the Device is obtained in real time, then a resource is registered to the kubbelet through the Device plugin, device state information is updated to the kubbelets through an API Server interface, a Kubelet schedules the resource to an applet registration Device, and monitors the Device plugin through the socket, and a Scheduler Extender monitors a Device resource change through a resource change monitoring tool Informer, and simultaneously monitors a Pod resource, obtains a usage of the Device by a Pod, updates an actual online and usage of the Device to a memory in real time, and waits for allocation when the service is scheduled.
According to the equipment mounting method provided by the embodiment of the disclosure, the service deployment request of a user is obtained, the service container creation request corresponding to the service deployment request is intercepted, the mounting equipment is selected according to the user-defined equipment parameters and the available online equipment of the user, the selected mounting equipment is mounted in the newly created container by using the corresponding configuration mapping file, the equipment scheduling use strategy and the equipment scheduling rule of the user-defined scene can be expanded and added according to needs, the corresponding mounting equipment is selected according to the user-defined parameters, the performance problem caused by the affinity between the equipment and the service is avoided actively, and the performance loss is reduced greatly.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides an apparatus mounting device corresponding to the apparatus mounting method, and since the principle of solving the problem of the apparatus in the embodiment of the present disclosure is similar to that of the apparatus mounting method in the embodiment of the present disclosure, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described again.
Referring to fig. 5 to 6, fig. 5 is a first schematic view of an apparatus mounting device according to an embodiment of the disclosure, and fig. 6 is a second schematic view of an apparatus mounting device according to an embodiment of the disclosure.
As shown in fig. 5, a device mounting apparatus 500 provided in an embodiment of the present disclosure includes:
a request intercepting module 510, configured to intercept a service container creation request responding to a service deployment request, where the service deployment request includes a user-defined device parameter set by a user;
a device determining module 520, configured to determine at least one mounted device to be mounted in the at least one available online device according to the custom device parameter and the monitored at least one available online device;
a file configuration module 530, configured to add the device information of the at least one mounted device to the configuration mapping file of the service container creation request;
and the device mount module 540 is configured to mount each mount device to a corresponding container in the newly created container group based on the configuration mapping file to which the device information is added and the service container creation request.
In an alternative embodiment, as shown in fig. 6, the device mounting apparatus 500 further includes:
the request obtaining module 550 is configured to obtain a service deployment request in which a user sets a user-defined device parameter.
In an optional implementation manner, the file configuration module 530 is specifically configured to:
initializing a configuration mapping file in the service container creation request;
and adding the equipment information of the at least one mounting equipment into the initialized configuration mapping file.
In an alternative embodiment, as shown in fig. 6, the device mounting apparatus 500 further includes a variable adding module 560, where the variable adding module 560 is configured to:
creating a new container group comprising at least one container;
adding an equipment-mounted environment variable to the container group, wherein the environment variable points to the configuration mapping file.
In an optional implementation manner, the device mount module 540 is specifically configured to:
and mounting each mounting device into a corresponding container in the newly created container group based on the configuration mapping file added with the device information and the environment variable.
In an alternative embodiment, as shown in fig. 6, the device mounting apparatus 500 further includes a device monitoring module 570, where the device monitoring module 570 is configured to:
updating the equipment state information of each registered equipment, including an online event and/or an offline event, through the connection between the equipment manager and the software development kit of the equipment;
and determining at least one available online device in an available state according to the updated state information of each device and the monitored use condition of the existing container group to the device.
In an optional embodiment, when the device monitoring module 570 is configured to update the device status information of each registered device including an online event and/or an offline event through the connection between the device manager and the software development kit of the device, specifically, to:
registering each device;
monitoring an online event and/or an offline event of each device through the connection between the device manager and a software development kit of the device;
and updating the stored equipment state information of the corresponding equipment according to the monitored on-line event and/or off-line event.
The device mounting device provided by the embodiment of the disclosure can mount the selected mounting device in the newly created container by intercepting the service container creation request according to the user-defined device parameters and the available online devices of the user and using the corresponding configuration mapping file, can expand and add the device scheduling use strategy and the device scheduling rule of the user-defined scene as required, and select the corresponding mounting device according to the user-defined parameters, thereby actively avoiding the performance problem caused by affinity between the device and the service and greatly reducing the performance loss.
The description of the processing flow of each module in the apparatus and the interaction flow between the modules may refer to the relevant description in the above method embodiments, and will not be described in detail here.
Corresponding to the device mounting method shown in fig. 1 and fig. 3, an embodiment of the present disclosure further provides a computer device 700, as shown in fig. 7, a schematic structural diagram of the computer device 700 provided for an embodiment of the present disclosure includes: a processor 710, a memory 720, and a bus 730. The memory 720 stores machine-readable instructions executable by the processor 710, the processor 710 and the memory 720 communicate via the bus 730 when the computer device 700 is running, and the machine-readable instructions, when executed by the processor 710, may perform the steps of the device mounting method as shown in fig. 1 and 3.
For the specific execution process of the instruction, reference may be made to the steps of the device mounting method in the embodiments of the present disclosure, and details are not described here again.
The disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the device mounting method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The computer program product may be implemented in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units into only one type of logical function may be implemented in other ways, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, but not to limit the technical solutions, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes and substitutions do not depart from the spirit and scope of the embodiments disclosed herein, and they should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method for device mounting, the method comprising:
intercepting a service container creation request responding to a service deployment request, wherein the service deployment request comprises user-defined equipment parameters set by a user;
determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device, wherein the at least one mounting device corresponds to the service deployment request and the user requirement;
adding the device information of the at least one mounted device to a configuration mapping file of the service container creation request;
and mounting each mounting device into a corresponding container in a newly created container group based on the configuration mapping file added with the device information and the service container creation request, wherein the service container creation request comprises an intercepted service container creation request or a new service container creation request generated according to the intercepted service container creation request and redeployed information aiming at the service deployment.
2. The method of claim 1, wherein prior to said intercepting a service container creation request responsive to a service deployment request, the method comprises:
and acquiring a service deployment request of a user for setting the user-defined equipment parameters.
3. The method according to claim 1, wherein the adding the device information of the at least one mounted device to the configuration mapping file of the service container creation request comprises:
initializing a configuration mapping file in the service container creation request;
and adding the equipment information of the at least one mounting equipment into the initialized configuration mapping file.
4. The method of claim 1, further comprising:
creating a new container group comprising at least one container;
adding an equipment-mounted environment variable to the container group, wherein the environment variable points to the configuration mapping file.
5. The method according to claim 4, wherein the mounting each mounted device to a corresponding container in a newly created container group based on the configuration mapping file after adding the device information and the service container creation request comprises:
and mounting each mounting device into a corresponding container in the newly created container group based on the configuration mapping file added with the device information and the environment variable.
6. The method of claim 1, further comprising:
updating the equipment state information of each registered equipment, including an online event and/or an offline event, through the connection between the equipment manager and the software development kit of the equipment;
and determining at least one available online device in an available state according to the updated state information of each device and the monitored use condition of the existing container group to the device.
7. The method according to claim 6, wherein the updating the device status information including an online event and/or an offline event of each registered device through the connection between the device manager and the software development kit of the device comprises:
registering each device;
monitoring an online event and/or an offline event of each device through the connection between the device manager and a software development kit of the device;
and updating the stored equipment state information of the corresponding equipment according to the monitored on-line event and/or off-line event.
8. An apparatus for mounting a device, the apparatus comprising:
the system comprises a request intercepting module, a service container creating module and a service deploying module, wherein the request intercepting module is used for intercepting a service container creating request responding to a service deploying request, and the service deploying request comprises user-defined equipment parameters set by a user;
the device determining module is used for determining at least one mounting device to be mounted in the at least one available online device according to the user-defined device parameter and the monitored at least one available online device, wherein the at least one mounting device corresponds to the service deployment request and the user requirement;
the file configuration module is used for adding the equipment information of the at least one mounting equipment to a configuration mapping file of the service container creation request;
and the equipment mounting module is used for mounting each mounting equipment into a corresponding container in the newly created container group based on the configuration mapping file after the equipment information is added and the service container creation request, wherein the service container creation request comprises an intercepted service container creation request or a new service container creation request generated according to the intercepted service container creation request and the redeployed information aiming at the service deployment.
9. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the device mounting method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the steps of the device mounting method according to any one of claims 1 to 7.
CN202110598938.8A 2021-05-31 2021-05-31 Equipment mounting method and device, computer equipment and readable storage medium Active CN113342461B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110598938.8A CN113342461B (en) 2021-05-31 2021-05-31 Equipment mounting method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110598938.8A CN113342461B (en) 2021-05-31 2021-05-31 Equipment mounting method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113342461A CN113342461A (en) 2021-09-03
CN113342461B true CN113342461B (en) 2023-04-07

Family

ID=77472338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110598938.8A Active CN113342461B (en) 2021-05-31 2021-05-31 Equipment mounting method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113342461B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589734A (en) * 2015-12-15 2016-05-18 国云科技股份有限公司 Method for creating applications through self-defined templates
CN110287029A (en) * 2019-06-27 2019-09-27 中国—东盟信息港股份有限公司 A method of it is adjusted based on kubernetes container resource dynamic
CN111367615A (en) * 2018-12-26 2020-07-03 卓望数码技术(深圳)有限公司 Method, apparatus, device and storage medium facilitating container instance scheduling
CN111399855A (en) * 2020-03-09 2020-07-10 山东汇贸电子口岸有限公司 Automatic application instance publishing method based on container technology
CN112866333A (en) * 2020-12-28 2021-05-28 上海领健信息技术有限公司 Cloud-native-based micro-service scene optimization method, system, device and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10496987B2 (en) * 2016-09-13 2019-12-03 Verizon Patent And Licensing Inc. Containerization of network services

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105589734A (en) * 2015-12-15 2016-05-18 国云科技股份有限公司 Method for creating applications through self-defined templates
CN111367615A (en) * 2018-12-26 2020-07-03 卓望数码技术(深圳)有限公司 Method, apparatus, device and storage medium facilitating container instance scheduling
CN110287029A (en) * 2019-06-27 2019-09-27 中国—东盟信息港股份有限公司 A method of it is adjusted based on kubernetes container resource dynamic
CN111399855A (en) * 2020-03-09 2020-07-10 山东汇贸电子口岸有限公司 Automatic application instance publishing method based on container technology
CN112866333A (en) * 2020-12-28 2021-05-28 上海领健信息技术有限公司 Cloud-native-based micro-service scene optimization method, system, device and medium

Also Published As

Publication number Publication date
CN113342461A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
Varghese et al. Challenges and opportunities in edge computing
CN109976774B (en) Block link point deployment method, device, equipment and storage medium
Shiraz et al. Energy efficient computational offloading framework for mobile cloud computing
CN112506669B (en) Task allocation method and device, storage medium and electronic equipment
CN108459911B (en) Method and system for multi-tenant middleware cloud service
US9146716B2 (en) Automatic resource balancing for multi-device applications
CN108572833A (en) Automatic application update
KR20170067829A (en) Method and apparatus for mobile device based cluster computing infrastructure
CN106371889B (en) Method and device for realizing high-performance cluster system of scheduling mirror image
CN111694649A (en) Resource scheduling method and device, computer equipment and storage medium
CN110489126B (en) Compiling task execution method and device, storage medium and electronic device
CN112231049A (en) Computing equipment sharing method, device, equipment and storage medium based on kubernets
CN110333939B (en) Task mixed scheduling method and device, scheduling server and resource server
CN111880936A (en) Resource scheduling method and device, container cluster, computer equipment and storage medium
CN110635944A (en) Cluster network configuration method and device, electronic equipment and storage medium
CN112579622B (en) Method, device and equipment for processing service data
CN108073423A (en) A kind of accelerator loading method, system and accelerator loading device
CN107086937B (en) Monitoring method and device
EP2842044A1 (en) Platform runtime abstraction
CN110505618A (en) A kind of method for processing business and server
CN114615340A (en) Request processing method and device, computer equipment and storage device
LiWang et al. Multi-task offloading over vehicular clouds under graph-based representation
Kim et al. Adaptive job allocation scheduler based on usage pattern for computing offloading of IoT
CN106911741B (en) Method for balancing virtual network management file downloading load and network management server
CN110532060A (en) A kind of hybrid network environmental data collecting method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant