CN111176782B - Online experiment method and device - Google Patents

Online experiment method and device Download PDF

Info

Publication number
CN111176782B
CN111176782B CN201911093768.7A CN201911093768A CN111176782B CN 111176782 B CN111176782 B CN 111176782B CN 201911093768 A CN201911093768 A CN 201911093768A CN 111176782 B CN111176782 B CN 111176782B
Authority
CN
China
Prior art keywords
node
terminal
image file
container
address information
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
CN201911093768.7A
Other languages
Chinese (zh)
Other versions
CN111176782A (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.)
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Cloud Computing Beijing 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 Tencent Cloud Computing Beijing Co Ltd filed Critical Tencent Cloud Computing Beijing Co Ltd
Priority to CN201911093768.7A priority Critical patent/CN111176782B/en
Publication of CN111176782A publication Critical patent/CN111176782A/en
Application granted granted Critical
Publication of CN111176782B publication Critical patent/CN111176782B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources

Abstract

The application discloses an online experiment method and device, wherein the method comprises the following steps: receiving an experiment environment access request carrying a first course identifier sent by a terminal; acquiring a first mirror image identifier and first resource information from a database according to a first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier; selecting a node from the node cluster as a bearing node of a first container according to the first resource information, wherein the first container is used for running a first mirror image file; acquiring address information corresponding to a bearing node; sending an experimental environment access response carrying address information to a terminal; and when the bearing node corresponding to the terminal request access address information is detected, connecting the terminal and the bearing node. By implementing the embodiment of the application, different experimental environments are prevented from being configured on the same physical host, the load of the physical host is reduced, and the operation efficiency of the physical host is improved, so that the on-line experimental efficiency is improved.

Description

Online experiment method and device
Technical Field
The application relates to the technical field of computers, in particular to an online experiment method and device.
Background
With the rapid development of internet technology, computer technology is increasingly emphasized. Such as programming languages, databases, application systems, etc. Therefore, in order to cultivate talents familiar with the computer technology field, various courses related to the computer technology, especially on-machine experiment courses, are often set.
At present, different experimental environments are configured on the same physical host aiming at different on-machine experimental courses. For example, various types of software associated with the on-line experiment courses are installed on the same physical host. Therefore, the physical host machine has low load and operation efficiency, thereby reducing the efficiency of the on-line experiment.
Disclosure of Invention
The embodiment of the application provides an online experiment method and device, which avoid configuring different experiment environments on the same physical host, lighten the load of the physical host and improve the operation efficiency of the physical host so as to improve the on-line experiment efficiency.
The first aspect of the application provides an online experimental method, comprising the following steps:
receiving an experimental environment access request sent by a terminal, wherein the experimental environment access request carries a first course identifier;
Acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment;
selecting a node from a node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first image file;
acquiring address information corresponding to the bearing node;
sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information;
and when the terminal is detected to request to access the bearing node corresponding to the address information, connecting the terminal with the bearing node.
The second aspect of the present application provides an online experimental teaching device, comprising:
the receiving module is used for receiving an experimental environment access request sent by the terminal, wherein the experimental environment access request carries a first course identifier;
the first acquisition module is used for acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment;
The selecting module is used for selecting a node from the node cluster according to the first resource information as a bearing node of a first container, and the first container is used for running the first mirror image file;
the second acquisition module is used for acquiring address information corresponding to the bearing node;
the sending module is used for sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information;
and the connection module is used for connecting the terminal and the bearing node when the terminal is detected to request to access the bearing node corresponding to the address information.
A third aspect of the present application provides an electronic device for on-line experimental teaching, comprising a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are generated for execution by the processor to perform the instructions of the steps of any of the methods of an on-line experimental method.
A fourth aspect of the application provides a computer readable storage medium for storing a computer program for execution by the processor to implement a method as claimed in any one of the on-line experimental methods.
According to the technical scheme, the experimental environment access request sent by the terminal is received, wherein the experimental environment access request carries the first course identifier; acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment; selecting a node from a node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first image file; acquiring address information corresponding to the bearing node; sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information; when the terminal requests to access the bearing node corresponding to the address information, the terminal is connected with the bearing node, so that the first mirror image file is operated in a first container of the bearing node, namely, an experimental environment is configured in the first container of the bearing node, different experimental environments are prevented from being configured on the same physical host, the load of the physical host is reduced, the operation efficiency of the physical host is improved, and the experimental efficiency of the on-line computer is improved. Meanwhile, address information of the access bearing node is provided for the terminal, so that the terminal can access the bearing node, and the terminal performs experiments based on the experiment environment configured in the first container of the bearing node.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
FIG. 1A is a schematic view of a scenario of an online experimental method according to an embodiment of the present application;
FIG. 1B is a schematic diagram of an online experimental system according to an embodiment of the present application;
FIG. 1C is a schematic diagram of an online experimental system according to an embodiment of the present application;
FIG. 2A is a schematic flow chart of an online experimental method according to an embodiment of the present application;
FIG. 2B is a schematic diagram of an experimental environment access interface according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of another online experimental method according to an embodiment of the present application;
fig. 4 is a schematic diagram of an online experiment teaching apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of a server structure of a hardware running environment according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following will describe in detail.
The terms first and second in the description and claims of the application and in the above-mentioned figures are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
First, referring to fig. 1A, fig. 1A is a schematic view of a scenario of an online experimental method according to an embodiment of the present application. As shown in fig. 1A, the user clicks an experimental environment access button in the experimental environment access interface 10a of the terminal and prompts the user to log in. The terminal obtains login information input by a user and sends the login information to a bearing node 10d in the node cluster 10b, the bearing node 10d is selected from the node cluster 10b according to first resource information, the first resource information is used for representing resources required for running a first image file corresponding to a first image identifier, the first image file is a file required for constructing an experimental environment, the first resource information and the first image identifier are obtained from a database 10c according to a first course identifier, and an experimental environment access request carrying the first course identifier is generated when the terminal detects a click experimental environment access button. Further, the first container 10f is running on the bearing node 10d, after the first container 10f verifies the login information, the bearing node 10d detects whether a first image file is stored, if not, the bearing node 10d requests the first server 10e for the first image file, and stores the first image file in the root directory of the first container 10 f; if so, the first image file is stored in the root directory of the first container 10 f. Further, an experiment operation interface 10g is provided for the terminal. The experiment operation interface 10g includes an experiment operation area and an experiment preparation area. The user may write the code in the experimental operation area according to the experimental lesson manual in the experimental preparation area, or may compile the code in the experimental operation area. The user can also view resources required for the experiment class, the experiment class manual, and the experiment report in the experiment preparation area. The content that the user can operate specifically at the experiment operation interface 10g is not limited in the present application. It can be seen that the first image file is operated in the first container of the bearing node, that is, the experimental environment is configured in the first container of the bearing node, so that different experimental environments are prevented from being configured on the same physical host, the load of the physical host is reduced, the operation efficiency of the physical host is improved, and the on-line experimental efficiency is improved.
Referring to fig. 1B, fig. 1B is a schematic diagram of an online experiment system according to an embodiment of the present application, where the online experiment system 100 includes: an in-line experiment processing apparatus 110. The online experiment processing device 110 is used for processing data and/or storing data, and a specific working mode can be set according to actual application conditions, so that the scheme is not limited more. The online experiment system 100 may include an integrated single device or multiple devices, and for convenience of description, the online experiment system 100 will be collectively referred to as an electronic device. It is apparent that the electronic device may include various handheld devices having a wireless communication function, other processing devices connected to a wireless modem, and various forms of User Equipment (UE), mobile Station (MS), terminal device (terminal device), tablet, notebook, palm, MID, desktop or other server devices, etc.
Further, referring to fig. 1C, fig. 1C is a schematic diagram of an architecture of an online experimental system according to an embodiment of the present application. As shown in fig. 1C, the user may log in through a secure shell protocol service or a virtual network console service, i.e., the user may log in through an SSH agent or a VNC agent. That is, the user may complete the login on the client, which may be push or opensh. Wherein, push is a Telnet, SSH, rlogin, pure TCP and serial interface connection software, opensh is a free open source implementation of secure shell protocol. Furthermore, the user can also realize login when applying for static resources. The user can be prompted to log in when clicking the experiment environment access button on the experiment environment access interface. That is, the user may complete the login on the browser. Further, the experimental environment access interface is displayed on a node, which may include various handheld devices having a wireless communication function, other processing devices connected to a wireless modem, and various forms of User Equipment (UE), mobile Station (MS), terminal device (terminal device), tablet, notebook, palm, MID, desktop or other server devices, and so on. In addition, it can be seen that the business logic system includes a content delivery network (Content Delivery Networks, CDN), a remote dictionary service (Remote Dictionary Server, redis), node nodes, databases, and a back-end for obtaining task results. Further, the task results are derived from the on-machine scheduling system. The on-machine scheduling system comprises a web forwarding access layer, flower, beat, redis, celery, crontab, schedule and the like. The web forwarding access layer is a proxy server. flow is a monitoring tool for monitoring the results and status of task execution. The bed is a timing trigger for triggering timing tasks. Redis is used as a message broker, i.e., a message queue. celery is a distributed task queue that focuses on real-time processing and task scheduling, while providing the tools needed to operate and maintain a distributed system. crontab is a kind of timing trigger used to trigger timing tasks in an asynchronous task queue. The schedule is used to schedule clusters of containers. The schedule may schedule the containers dockerAPI, kubernetesAPI and the messenger cloud APIs. The Kubernetes is a distributed scheduler based on containers and is also a container orchestration engine of Google open source, which supports automatic deployment, large-scale scalability and application containerization management. Further, after the user logs in, the docker API can be called to realize mirror image construction. In addition, the experimental environment can be established and deleted by calling the Kubernetes API. The messenger cloud API can also be called to perform container cluster capacity expansion or cloud host mirror synchronization. Furthermore, the on-line scheduling system also establishes connection with the cloud deployment environment. When the authentication of the Tengming cloud real name is needed, the MD5proxy can be adopted for authentication, and when the authentication is successful, the Tengming cloud intranet interface is accessed.
In the prior art, different experimental environments are configured on the same physical host aiming at different on-machine experimental courses. For example, various types of software associated with the on-line experiment courses are installed on the same physical host. Therefore, the physical host machine has low load and operation efficiency, thereby reducing the efficiency of the on-line experiment.
Based on this, an online experimental method is provided in the embodiments of the present application to solve the above-mentioned problems, and the embodiments of the present application are described in detail below.
Referring to fig. 2A, fig. 2A is a schematic flow chart of an online experimental method according to an embodiment of the present application, which is applied to the online experimental system shown in fig. 1B, and as shown in fig. 2A, the online experimental method according to an embodiment of the present application includes:
201. the method comprises the steps that an online experiment system receives an experiment environment access request sent by a terminal, wherein the experiment environment access request carries a first course identifier;
the terminal may be, for example, a mobile phone, a tablet computer, a notebook computer, a palm computer, an MID, a desktop computer, or other server devices.
The first course identification is used for identifying a first course, and the first course can be used for constructing an experiment course, a cat and dog identification experiment course, a license plate identification experiment course and the like for a client system.
Furthermore, the online experiment system can also generate an experiment environment access interface, the online experiment system can issue the experiment environment access interface to the terminal, and the experiment environment access request is sent by the terminal when the experiment environment access interface detects the experiment environment access operation. Further, referring to fig. 2B, fig. 2B is a schematic diagram of an experimental environment access interface provided by an embodiment of the present application, and as shown in fig. 2B, the experimental environment access interface may include xx experimental lessons, course duration, an experimental environment access button, xx experimental lesson overview, and xx experimental lesson manual. Further, xx experiment courses may be, for example, constructing experiment courses, cat and dog recognition experiment courses, license plate recognition experiment courses, and the like for client systems; the course duration may be, for example, 30 minutes, 40 minutes, 65 minutes, etc.; xx summary of experimental lessons may include, for example, experimental lesson introduction and resources required for experimental lessons, which may include, for example, CPU resources, system resources, etc. Further, the user may perform the experiment environment access operation on the experiment environment access interface, for example, may click the experiment environment access button.
202. The online experiment system acquires a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experiment environment;
The first resource information may include, for example, CPU resource information and/or system resource information.
The first image identification is generated according to a first image name and a first image version number, wherein the first image name is the name of the first image file, and the first image version number is used for representing the version of the first image file. Further, mirroring is a form of file storage, a type of redundancy. Further, the first image file is implemented by adopting image semantics. The first image file is generated by at least one file required for constructing the experiment environment, wherein the experiment environment is an environment required for running a first code file, and the first code file corresponds to a first course. For example, a first course builds an experimental course for a client system, and then the first code file includes the code required to build the client system. Further, if the first code file is written in JAVA, the experimental environment is an environment supporting the operation of the first code file written in JAVA.
203. The online experiment system selects a node from the node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first mirror image file;
The node cluster includes a plurality of nodes, and each node in the plurality of nodes may be, for example, various handheld devices with wireless communication functions, other processing devices connected to a wireless modem, and various types of User Equipment (UE), mobile Station (MS), terminal device (terminal device), tablet, notebook, palm computer, MID, desktop or other server devices, and so on.
Wherein the first container (Docker) is an open-source application container engine. Further, the bearer node is one node in the node cluster and the first container is run on the bearer node.
Further, the selecting a node from the node cluster according to the first resource information as a bearing node of the first container includes: and invoking Kubernetes to process the first resource information so as to select a node from a node cluster as the bearing node of the first container. The Kubernetes is a distributed scheduler based on containers and is also a container orchestration engine of Google open source, which supports automatic deployment, large-scale scalability and application containerization management.
Optionally, in one possible implementation manner, after selecting a node from the node cluster according to the first resource information as a bearing node of the first container, before the obtaining address information corresponding to the bearing node, the method further includes: building the first container on the load-bearing node; constructing a first user name, a first user password and a main catalog in the first container, wherein the first user name and the first user password are used for the terminal to access the main catalog; and distributing the authority for accessing the first file to the terminal, wherein the first file belongs to the main catalog.
Wherein said constructing said first container on said load-bearing node comprises: a second process is employed to invoke container build instructions to build the first container on the bearer node and to build a web space (net namespace) and a process namespace (pidnamespace) for the first container. Wherein the second process runs on the bearer node.
Further, the second process may be a Daemon (Docker Daemon). The second process is also for storing the first image file on a root directory of the first container using a federated file system (Union File System).
In addition, container build instructions are used to build the first container on the carrier node and to build a web space and a process namespace for the first container.
Optionally, after said invoking the container build instruction with the second process to build the first container on the bearer node and to build a web space and a process namespace for the first container, the method further comprises: and setting an iptables flow forwarding rule for the network space and setting the working state of the first container as a second working state. Wherein Iptables is an IP packet filtering rule for setting, maintaining and checking Linux kernels. The second working state is a created state, and the second working state is used for indicating that the first container is in a preparation state.
Optionally, in a possible implementation manner, before the first user name, the first user password and the main directory are built in the first container, the method further includes: and calling a container running instruction by adopting the second process so as to set the working state of the first container to be a third working state. Wherein the third operating state is used to indicate that the first container is in an operating state.
Further, the master catalog belongs to the root catalog. The first user name and the first user password are generated by the online experiment system.
Further, the master directory includes a plurality of files, which may include, for example, code files, image files, and the like. The first file is one of the plurality of files.
Wherein, before the permission to access the first file is allocated to the terminal, the method further comprises: and switching a working directory to the master directory, wherein the working directory comprises environment variables configured for the first container. Further, after the permission to access the first file is allocated to the terminal, the method further includes: and deleting the environment variable configured for the first container.
204. The online experiment system acquires address information corresponding to the bearing node;
the address information includes an internet protocol and a port number of the bearing node, the port number is obtained from a database according to the first course identifier, the port number includes a first port or a second port, the first port is used for providing a secure shell protocol service, and the second port is used for providing a virtual network console service.
For example, the first port may comprise 22 or 2222, for example, and the second port may comprise 5900 or 6900, for example.
Optionally, in a possible implementation manner, the obtaining address information corresponding to the bearer node includes: acquiring an internet protocol corresponding to the bearing node; and mapping a port number to the Internet protocol to obtain the address information, wherein the port number is obtained from a database according to the first course identification.
It can be seen that in the above technical solution, determination of address information is implemented, and preparation is made for a subsequent terminal accessing to a bearing node corresponding to the address information.
205. The online experiment system sends an experiment environment access response to the terminal, wherein the experiment environment access response carries the address information;
206. and when the online experiment system detects that the terminal requests to access the bearing node corresponding to the address information, the terminal is connected with the bearing node.
Optionally, in a possible implementation manner, when detecting that the terminal requests to access the bearer node corresponding to the address information, connecting the terminal and the bearer node includes: when a first process is adopted to detect that the terminal requests to access the bearing node corresponding to the address information, a second user name and a second user password sent by the terminal are obtained; verifying the identity of the terminal according to the second user name and the second user password; and when the verification is passed, connecting the terminal with the bearing node.
The first service is run on the first process, and when the first process detects that the terminal requests to access the bearing node corresponding to the address information, the second user name and the second user password sent by the terminal are obtained, including: when the first service is adopted to detect the port number and/or the address information, determining that the terminal requests to access the bearing node corresponding to the address information; and acquiring a second user name and a second user password sent by the terminal according to the determination result. Further, the first process is generated using Tini, which is a process monitor. Further, before determining that the terminal requests to access the bearer node corresponding to the address information when the first service is adopted to detect the port number and/or the address information, the method further includes: and loading the secure shell protocol service and the virtual network console service under the first service.
The first service may be, for example, a Supervisor, which is a client/server service developed by Python, and is a process management tool in the Linux/Unix system.
Wherein said verifying the identity of the terminal according to the second user name and the second user password comprises: and verifying the second user name and the second user password by adopting the first user name and the first user password so as to verify the identity of the terminal.
Further, the second user name and the second user password may be assigned to the terminal by an online experiment system.
It can be seen that in the above technical solution, when the first process detects that the terminal requests to access the bearing node corresponding to the address information, a second user name and a second user password sent by the terminal are obtained; verifying the identity of the terminal according to the second user name and the second user password; when verification passes, the terminal is connected with the bearing node, so that the safety of experiments is improved, and illegal users are prevented from accessing the bearing node.
Optionally, in one possible embodiment, the method further includes: when receiving an experiment ending instruction sent by the terminal, setting the working state of the first container to be a first working state and sending a first signal to a root process of the first container, wherein the first signal is used for indicating the root process to stop running in a first time period; and if the root process does not stop running in the first time period, sending a second signal to the root process, wherein the second signal is used for indicating the root process to stop running when receiving the second signal.
When receiving an experiment ending instruction sent by the terminal, setting the working state of the first container to be a first working state and sending a first signal to a root process of the first container, wherein the method comprises the following steps: and when receiving an experiment ending instruction sent by the terminal, calling a service deleting instruction and a container deleting instruction to set the working state of the first container as a first working state and send a first signal to a root process of the first container. Further, the delete service instruction may be, for example, delete_space, and the delete container instruction may be, for example, delete_space_delete_space. Further, the method further comprises: and calling an experiment environment query instruction to determine that the experiment environment is in a deleted state. The experiment environment query instruction may be listnamespace, for example.
The first period of time may be set by an administrator or may be a fixed value.
The root process is generated by adopting Tini, and the Tini is also used for monitoring the experiment ending instruction. And receiving an experiment ending instruction sent by the terminal, namely adopting Tini to monitor the experiment ending instruction sent by the terminal.
According to the technical scheme, the experimental environment access request sent by the terminal is received, wherein the experimental environment access request carries the first course identifier; acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment; selecting a node from a node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first image file; acquiring address information corresponding to the bearing node; sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information; when the terminal requests to access the bearing node corresponding to the address information, the terminal is connected with the bearing node, so that the first mirror image file is operated in a first container of the bearing node, namely, an experimental environment is configured in the first container of the bearing node, different experimental environments are prevented from being configured on the same physical host, the load of the physical host is reduced, the operation efficiency of the physical host is improved, and the experimental efficiency of the on-line computer is improved. Meanwhile, address information of the access bearing node is provided for the terminal, so that the terminal can access the bearing node, and the terminal performs experiments based on the experiment environment configured in the first container of the bearing node.
Referring to fig. 3, fig. 3 is a schematic flow chart of an online experimental method according to an embodiment of the application. As shown in fig. 3, before the address information corresponding to the bearer node is obtained, the method further includes:
301. the online experiment system detects whether the first image file is stored in the bearing node or not;
if not, go to step 302; if yes, the first image file is obtained from the bearing node.
302. The online experiment system sends an image file acquisition request to a first server, wherein the image file acquisition request carries the first image identifier, and the image file acquisition request is used for indicating the first server to determine the first image file matched with the first image identifier;
the first server may be a file server, and the first server includes a plurality of image files, and the first image file is one image file of the plurality of image files. Further, the plurality of image files include image files of different versions having the same image name and image files having different image names.
Further, the sending the image file obtaining request to the first server includes: and sending the image file acquisition request to the first server through HTTPS protocol.
303. And the online experiment system receives an image file acquisition response sent by the first server, wherein the image file acquisition response carries the first image file.
It can be seen that in the above technical solution, whether the first image file is stored in the bearing node is detected; if not, sending an image file acquisition request to a first server, wherein the image file acquisition request carries the first image identifier, and the image file acquisition request is used for indicating the first server to determine the first image file matched with the first image identifier; receiving an image file acquisition response sent by the first server, wherein the image file acquisition response carries the first image file, and acquiring the image file is realized.
Referring to fig. 4, fig. 4 is a schematic diagram of an on-line experimental teaching device according to an embodiment of the present application. As shown in fig. 4, an online experimental teaching apparatus 400 according to an embodiment of the present application may include:
a receiving module 410, configured to receive an experiment environment access request sent by a terminal, where the experiment environment access request carries a first course identifier;
a first obtaining module 420, configured to obtain, from a database according to the first course identifier, a first image identifier and first resource information, where the first resource information is used to represent resources required for running a first image file corresponding to the first image identifier, and the first image file is a file required for building an experiment environment;
A selecting module 430, configured to select, according to the first resource information, a node from a node cluster as a bearing node of a first container, where the first container is used to run the first image file;
a second obtaining module 440, configured to obtain address information corresponding to the bearer node;
optionally, the second obtaining module 440 is specifically configured to obtain an internet protocol corresponding to the bearer node; and mapping a port number to the Internet protocol to obtain the address information, wherein the port number is obtained from a database according to the first course identification.
The port number comprises a first port or a second port, wherein the first port is used for providing security shell protocol service, and the second port is used for providing virtual network console service.
A sending module 450, configured to send an experimental environment access response to the terminal, where the experimental environment access response carries the address information;
and a connection module 460, configured to connect the terminal and the bearer node when detecting that the terminal requests to access the bearer node corresponding to the address information.
Optionally, the connection module 460 is specifically configured to obtain a second user name and a second user password sent by the terminal when the first process detects that the terminal requests to access the bearer node corresponding to the address information; verifying the identity of the terminal according to the second user name and the second user password; and when the verification is passed, connecting the terminal with the bearing node.
Optionally, the online experiment teaching apparatus 400 further includes a processing module 470, where the processing module 470 is configured to construct the first container on the bearing node; constructing a first user name, a first user password and a main catalog in the first container, wherein the first user name and the first user password are used for the terminal to access the main catalog; and distributing the authority for accessing the first file to the terminal, wherein the first file belongs to the main catalog.
Optionally, a processing module 470 is configured to detect whether the first image file is stored in the bearer node; if not, sending an image file acquisition request to a first server, wherein the image file acquisition request carries the first image identifier, and the image file acquisition request is used for indicating the first server to determine the first image file matched with the first image identifier; and receiving an image file acquisition response sent by the first server, wherein the image file acquisition response carries the first image file.
Optionally, the processing module 470 is configured to set, when receiving an experiment ending instruction sent by the terminal, a working state of the first container to a first working state and send a first signal to a root process of the first container, where the first signal is used to instruct the root process to stop running in a first period of time; and if the root process does not stop running in the first time period, sending a second signal to the root process, wherein the second signal is used for indicating the root process to stop running when receiving the second signal.
Referring to fig. 5, fig. 5 is a schematic diagram of a server structure of a hardware running environment according to an embodiment of the present application.
The embodiment of the application provides an electronic device for pushing information, which comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor to execute instructions comprising the steps in any information pushing method. As shown in fig. 5, a server of a hardware running environment according to an embodiment of the present application may include:
a processor 501, such as a CPU.
The memory 502 may alternatively be a high-speed RAM memory or a stable memory, such as a disk memory.
A communication interface 503 for enabling a connected communication between the processor 501 and the memory 502.
Those skilled in the art will appreciate that the structure of the server shown in fig. 5 is not limiting and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 5, the memory 502 may include an operating system, a network communication module, and a program for data processing. An operating system is a program that manages and controls server hardware and software resources, programs that support personnel management, and other software or program runs. The network communication module is used to enable communication between components within the memory 502 and with other hardware and software within the server.
In the server shown in fig. 5, the processor 501 is configured to execute a program for personnel management stored in the memory 502, and the following steps are implemented:
receiving an experimental environment access request sent by a terminal, wherein the experimental environment access request carries a first course identifier;
acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment;
selecting a node from a node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first image file;
acquiring address information corresponding to the bearing node;
sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information;
and when the terminal is detected to request to access the bearing node corresponding to the address information, connecting the terminal with the bearing node.
The specific implementation of the server according to the present application can be found in the embodiments of the above-mentioned abnormal cell screening method, and will not be described herein.
The present application also provides a computer readable storage medium for storing a computer program, the stored computer program being executed by the processor to implement the steps of:
receiving an experimental environment access request sent by a terminal, wherein the experimental environment access request carries a first course identifier;
acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment;
selecting a node from a node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first image file;
acquiring address information corresponding to the bearing node;
sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information;
and when the terminal is detected to request to access the bearing node corresponding to the address information, connecting the terminal with the bearing node.
The embodiment of the computer readable storage medium according to the present application can be seen in the above embodiments of the abnormal cell screening method, and will not be described herein.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of action described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (10)

1. An on-line experimental method, comprising:
receiving an experimental environment access request sent by a terminal, wherein the experimental environment access request carries a first course identifier;
Acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment;
selecting a node from a node cluster according to the first resource information as a bearing node of a first container, wherein the first container is used for running the first image file;
acquiring address information corresponding to the bearing node;
sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information;
and when the terminal is detected to request to access the bearing node corresponding to the address information, connecting the terminal with the bearing node.
2. The method according to claim 1, wherein after selecting a node from the node cluster according to the first resource information as a bearer node of the first container, before the obtaining address information corresponding to the bearer node, the method further comprises:
building the first container on the load-bearing node;
Constructing a first user name, a first user password and a main catalog in the first container, wherein the first user name and the first user password are used for the terminal to access the main catalog;
and distributing the authority for accessing the first file to the terminal, wherein the first file belongs to the main catalog.
3. The method of claim 1, wherein prior to the obtaining the address information corresponding to the bearer node, the method further comprises:
detecting whether the first image file is stored in the bearing node or not;
if not, sending an image file acquisition request to a first server, wherein the image file acquisition request carries the first image identifier, and the image file acquisition request is used for indicating the first server to determine the first image file matched with the first image identifier;
and receiving an image file acquisition response sent by the first server, wherein the image file acquisition response carries the first image file.
4. A method according to any one of claims 1-3, wherein the obtaining address information corresponding to the bearer node includes:
acquiring an internet protocol corresponding to the bearing node;
And mapping a port number to the Internet protocol to obtain the address information, wherein the port number is obtained from a database according to the first course identification.
5. The method of claim 4, wherein the port number comprises a first port for providing secure shell protocol services or a second port for providing virtual network console services.
6. The method according to any one of claims 1-5, wherein when detecting that the terminal requests access to the bearer node corresponding to the address information, connecting the terminal to the bearer node includes:
when a first process is adopted to detect that the terminal requests to access the bearing node corresponding to the address information, a second user name and a second user password sent by the terminal are obtained;
verifying the identity of the terminal according to the second user name and the second user password;
and when the verification is passed, connecting the terminal with the bearing node.
7. The method according to any one of claims 1-6, further comprising:
when receiving an experiment ending instruction sent by the terminal, setting the working state of the first container to be a first working state and sending a first signal to a root process of the first container, wherein the first signal is used for indicating the root process to stop running in a first time period;
And if the root process does not stop running in the first time period, sending a second signal to the root process, wherein the second signal is used for indicating the root process to stop running when receiving the second signal.
8. An on-line experimental device, comprising:
the receiving module is used for receiving an experimental environment access request sent by the terminal, wherein the experimental environment access request carries a first course identifier;
the first acquisition module is used for acquiring a first mirror image identifier and first resource information from a database according to the first course identifier, wherein the first resource information is used for representing resources required for running a first mirror image file corresponding to the first mirror image identifier, and the first mirror image file is a file required for constructing an experimental environment;
the selecting module is used for selecting a node from the node cluster according to the first resource information as a bearing node of a first container, and the first container is used for running the first mirror image file;
the second acquisition module is used for acquiring address information corresponding to the bearing node;
the sending module is used for sending an experimental environment access response to the terminal, wherein the experimental environment access response carries the address information;
And the connection module is used for connecting the terminal and the bearing node when the terminal is detected to request to access the bearing node corresponding to the address information.
9. An electronic device for on-line experimental teaching, comprising a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are generated for execution by the processor to perform the instructions of the steps of the method of any of claims 1-7.
10. A computer readable storage medium for storing a computer program, the stored computer program being executed by the processor to implement the method of any one of claims 1-7.
CN201911093768.7A 2019-11-08 2019-11-08 Online experiment method and device Active CN111176782B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911093768.7A CN111176782B (en) 2019-11-08 2019-11-08 Online experiment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911093768.7A CN111176782B (en) 2019-11-08 2019-11-08 Online experiment method and device

Publications (2)

Publication Number Publication Date
CN111176782A CN111176782A (en) 2020-05-19
CN111176782B true CN111176782B (en) 2023-11-03

Family

ID=70647354

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911093768.7A Active CN111176782B (en) 2019-11-08 2019-11-08 Online experiment method and device

Country Status (1)

Country Link
CN (1) CN111176782B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667350A (en) * 2020-12-23 2021-04-16 广州三七互娱科技有限公司 Configuration scheduling method, device and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application
WO2019095936A1 (en) * 2017-11-15 2019-05-23 腾讯科技(深圳)有限公司 Method and system for building container mirror image, and server, apparatus and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019095936A1 (en) * 2017-11-15 2019-05-23 腾讯科技(深圳)有限公司 Method and system for building container mirror image, and server, apparatus and storage medium
CN108958927A (en) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 Dispositions method, device, computer equipment and the storage medium of container application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Docker的HTTP服务器在实验室的应用;李慧春;;实验室研究与探索(05);全文 *

Also Published As

Publication number Publication date
CN111176782A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN110535831B (en) Kubernetes and network domain-based cluster security management method and device and storage medium
US11088903B2 (en) Hybrid cloud network configuration management
CN104536899B (en) A kind of software deployment and its maintaining method based on Intelligent cluster
CN111431740B (en) Data transmission method, device, equipment and computer readable storage medium
US9489227B2 (en) Apparatus and method for virtual desktop service
US8019835B2 (en) Automated provisioning of computing networks using a network database data model
US9524382B2 (en) System and method for centralizedly controlling server user rights
US8250570B2 (en) Automated provisioning framework for internet site servers
US7124289B1 (en) Automated provisioning framework for internet site servers
US7152109B2 (en) Automated provisioning of computing networks according to customer accounts using a network database data model
US20120203870A1 (en) Concurrent Web Based Multi-Task Support For Control Management System
US20130086594A1 (en) Execution of applications distributed across a plurality of computing devices
WO2007075846A2 (en) Method and system for providing virtualized application workspaces
JP2005539298A (en) Method and system for remotely and dynamically configuring a server
JP2002351829A (en) Providing computing service through online network computer environment
CN111262839A (en) Vulnerability scanning method, management equipment, node and storage medium
CN111338893A (en) Process log processing method and device, computer equipment and storage medium
US20070078841A1 (en) System and method for network resource management
CN109542862B (en) Method, device and system for controlling mounting of file system
CN113037891B (en) Access method and device for stateful application in edge computing system and electronic equipment
CN1787432A (en) Method and system for authenticating a node requesting another node to perform work
CN108289080B (en) Method, device and system for accessing file system
CN109617966A (en) A kind of cloud pipe Platform deployment system and method based on Openstack
CN111176782B (en) Online experiment method and device
CN110661780A (en) Wireless city data sharing method and system based on SAAS application

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