Disclosure of Invention
In view of the above, the present invention discloses an automatic compiling method using jupyter, which realizes automatic matching of compiling environments, and further can meet the requirements of users for different compiling environments.
In a first aspect:
the embodiment of the invention discloses an automatic compiling method adopting jupyter, which is applied to a central server and comprises the following steps:
receiving a program to be processed sent by a user terminal;
responding to a compiling request, and determining the type of the program to be processed;
determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed;
determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment; the first compiling terminal comprises the target compiling environment;
sending the program to be processed to the first compiling terminal; the program to be processed is basic information of a compiling task executed by the first compiling terminal through an installed compiling environment;
the cloud compiling system is composed of a plurality of terminals provided with compiling environments; the installed compilation environment contains at least jupyter.
Optionally, the method further includes:
detecting whether a specified compiling environment is received;
and in the case of containing a specified compiling environment, taking the specified compiling environment as a target compiling environment.
Optionally, the determining, according to the target compiling environment, a target terminal for executing a compiling task from a preset cloud compiling system includes:
screening out a terminal containing a target compiling environment from the preset cloud compiling system;
screening out idle terminals from the terminals containing the target compiling environment;
acquiring an idle time period of an idle terminal;
predicting the compiling time length of the program to be processed;
and determining a first compiling terminal for executing the program to be compiled according to the compiling time length of the program to be processed and the idle time period of the idle terminal.
Optionally, the method further includes:
detecting a compiling process of a first compiling terminal;
when a preset situation occurs in the compiling process of the first compiling terminal, acquiring a current compiling result of the compiling terminal;
according to the occupation situation of the cloud compiling system resource, a third compiling terminal for compiling the program to be processed is allocated again;
and sending the compiling result and the program to be processed to the third compiling terminal.
Optionally, the method further includes:
when a request for sharing a compiling environment is received, acquiring information of a terminal initiating the request for sharing the compiling environment and information of the compiling environment installed on the terminal initiating the request for sharing the compiling environment;
information of a compilation environment installed on a terminal that initiates a request for sharing a compilation environment and information of a terminal that initiates a request for sharing a compilation environment are stored.
Optionally, the method further includes:
receiving error information fed back by a first compiling terminal; the error information is generated by the first compiling terminal in the compiling process;
analyzing the error information to obtain reasons and/or an optimization scheme corresponding to the error information;
feeding back the error information, the reason corresponding to the error information and/or the optimization scheme to the user terminal; the user terminal is a terminal for sending a program to be compiled.
Optionally, the method further includes:
responding to a program simulation request, and determining the type of the program to be processed;
determining a target simulator corresponding to the program to be processed according to the type of the program to be processed;
determining a second compiling terminal for executing a program simulation task from a preset cloud compiling system according to the target simulator;
acquiring the information of the second compiling terminal, and sending the information of the second compiling terminal to an initiating user terminal; the information of the second compiling terminal is a basis for the user terminal to initiate remote control to the second compiling terminal;
and sending the program to be processed to the second compiling terminal so that the user terminal controls a target simulator installed on the second compiling terminal to simulate the program to be processed after the user terminal initiates remote control to the second compiling terminal.
Optionally, the error information is presented in the form of a video; and the video is obtained by the first compiling terminal through screen recording.
Optionally, the method further includes:
when detecting that the user terminal executes the code editing process, analyzing a currently edited code of the user terminal, and predicting a function realized by the currently edited code of the user terminal;
calling a reference code corresponding to a function realized by a code currently edited by a user terminal;
acquiring optimization information of a reference code;
and sending the reference code and/or the optimization information of the reference code to the user terminal.
In a second aspect:
the embodiment of the invention also discloses an automatic compiling method adopting jupyter, which is applied to a user terminal and comprises the following steps:
receiving a program to be processed;
sending the program to be processed to a server so that the server processes the program to be compiled based on the automatic compiling method adopting jupyter in the first aspect;
and receiving a compiling result sent by the server.
Optionally, the receiving the compiling result sent by the server includes:
receiving an installation package sent by a central server;
or
And receiving the executable program sent by the central server.
Optionally, the method includes:
receiving a sharing program uploaded by a user;
determining an editable portion of the shared program;
marking an editable portion of the engineering program.
Optionally, the receiving the to-be-processed program includes:
calling a sharing program;
acquiring a modification result of an editable part of the shared program to obtain a modified program;
and taking the modified program as a program to be processed.
In a third aspect:
the embodiment of the invention discloses an automatic compiling system adopting jupyter, which comprises the following steps:
the system comprises a user terminal, a central server and a cloud compiling system;
the cloud compiling system is composed of a plurality of terminals provided with compiling environments; the installed compiling environment at least comprises jupyter;
the central server is used for executing the automatic compiling method adopting jupyter in the first aspect;
the user terminal is configured to perform the automatic compilation with jupyter according to the second aspect.
In a fourth aspect:
the invention also discloses an automatic compiling device adopting jupyter, which is applied to the central server, and the method comprises the following steps:
the first receiving unit is used for receiving the program to be processed sent by the terminal;
the type determining unit is used for responding to the compiling request and determining the type of the program to be processed;
the first compiling environment determining unit is used for determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed;
the compiling terminal determining unit is used for determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment; the target terminal comprises the target compiling environment;
the first sending unit is used for sending the program to be processed to the first compiling terminal; the program to be processed is basic information of a compiling task executed by the first compiling terminal through an installed compiling environment;
the cloud compiling system is composed of a plurality of terminals provided with compiling environments; the installed compilation environment contains at least jupyter.
In a fifth aspect:
the embodiment of the invention also discloses an automatic compiling device adopting jupyter, which is applied to a terminal and comprises the following components:
the second receiving unit is used for receiving the program to be processed;
a second sending unit, configured to send the program to be compiled to a server, so that the server processes the program to be compiled based on the automatic compilation method using jupyter of the first aspect;
and the third receiving unit is used for receiving the compiling result sent by the server.
The embodiment of the invention discloses an automatic compiling method adopting jupyter, which comprises the following steps: responding to a compiling request, and determining the type of the program to be processed; determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed; determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment; the target terminal comprises the target compiling environment; and sending the program to be processed to the first compiling terminal. Therefore, by identifying the type of the program and determining the target compiling environment corresponding to the type of the program, the compiling environment can be automatically matched, and the requirements of users on different compiling environments can be further met.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of an automatic compiling method using jupyter according to an embodiment of the present invention is shown, where the method is applied to a server, and the method includes:
s101: receiving a program to be processed sent by a terminal;
s102: responding to a compiling request, and determining the type of the program to be processed;
in this embodiment, the type of the program to be compiled in this embodiment may be understood as a certain type of computer language, for example, JAVA, PHP, C #, and the like.
Wherein each type of program has a unique writing format, for example, the type of program can be determined by the writing format of the program.
S103: determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed;
in this embodiment, in order to identify the target compilation environment corresponding to the type of the program, a correspondence relationship between the type of the program and the compilation environment may be preset. And when the type of the program to be processed is determined, determining a target compiling environment corresponding to the program to be processed according to the preset corresponding relation between the type of the program and the compiling environment.
In this embodiment, the compiling environment includes: the compiling environment provided by various compiling platforms such as winform, web, android, IOS and jupitter, in the embodiment, includes, but is not limited to, the compiling environment mentioned above.
S104: determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to a target compiling environment; the first compiling terminal comprises the target compiling environment;
in this embodiment, the cloud compiling system is composed of a plurality of terminals installed with compiling environments; the installed compilation environment contains at least jupyter.
As can be seen from the above description, the cloud compiling system includes compiling environments provided by various compiling platforms such as winform, web, android, IOS and jupyter, but is not limited to the above-mentioned compiling environments.
In this embodiment, in order to enrich the cloud compiling system, the personal terminal may be used as the cloud compiling system, and specifically, the method further includes:
when a request for sharing a compiling environment is received, acquiring information of a terminal initiating the request for sharing the compiling environment and information of the compiling environment installed on the terminal initiating the request for sharing the compiling environment;
information of a compilation environment installed on a terminal that initiates a request for sharing a compilation environment and information of a terminal that initiates a request for sharing a compilation environment are stored.
In this embodiment, it is assumed that the terminal a initiates a request for sharing the compiling environment to the central server, and the central server obtains information of the terminal a and information of the compiling environment installed on the terminal a.
The information of the terminal a may be information for uniquely representing the terminal a, or information for accessing the terminal a, such as an IP address of the terminal a.
The information of the compiling environment installed in the terminal a may be a name of the compiling environment, such as winform, web, android, IOS, jupitter, and the like.
In this embodiment, the first compiling terminal for executing the to-be-processed program may be determined according to the pre-compiling duration of the to-be-processed program and the idle condition of the terminal included in the current cloud compiling system, and a specific implementation method will be described below, which is not described in detail in this embodiment.
S105: sending the program to be processed to a first compiling terminal;
in this embodiment, when the first compiling terminal receives the to-be-processed program, the to-be-processed program is compiled through the installed compiling environment. That is, the to-be-processed program executes basic information of the compilation task for the first compilation terminal through the installed compilation environment.
In this embodiment, the type of the program to be processed is determined in response to a compilation request; determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed; determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment; the target terminal comprises the target compiling environment; and sending the program to be processed to the first compiling terminal. Therefore, by identifying the type of the program and determining the target compiling environment corresponding to the type of the program, the compiling environment can be automatically matched, and the requirements of users on different compiling environments can be further met.
Further, in order to provide a humanized choice, the user may select which compiling environment to use by himself, specifically, the method further includes:
detecting whether a specified compiling environment is received;
and if the specified compiling environment is received, taking the specified compiling environment as a target compiling environment.
Further, according to the specified compiling environment (namely a target compiling environment), a first compiling terminal for executing a compiling task is determined from a preset cloud compiling system; the target terminal comprises the target compiling environment and sends the program to be processed to the first compiling terminal.
In this embodiment, some error reporting problems may occur during the process of executing the compiling task by the first compiling terminal, so that the first compiling terminal sends error information generated during the compiling process to the central server in order to facilitate the user to know the compiling condition in time. In order to further instruct the user how to handle the error when the central server receives the error report, the central server may analyze the received error information, and further determine a reason and/or an optimization scheme corresponding to the error, specifically, the central server further includes:
receiving error information fed back by a first compiling terminal; the error information is generated by the first compiling terminal in the compiling process;
analyzing the error information to obtain reasons and/or an optimization scheme corresponding to the error information;
feeding back the error information, the reason corresponding to the error information and/or the optimization scheme to the user terminal; the user terminal is a terminal for sending a program to be compiled.
In this embodiment, the association relationship between the error information and the cause and the optimization scheme may be preset, and the cause generated by the error information and the optimization scheme for solving the error information may be found through the association relationship.
The error information can be fed back in a video mode or in a preset error information format.
And if the error information is fed back in a video mode, the video is obtained by a first compiling terminal which executes a compiling task through screen recording.
Further, to avoid congestion of the cloud compiling system, the resource allocation compiling terminal based on the cloud compiling system may specifically include:
1) screening out a terminal containing a target compiling environment from the preset cloud compiling system;
2) screening out idle terminals from the terminals containing the target compiling environment;
in this embodiment, the idle terminal is a terminal that does not currently execute the compiling task.
3) Acquiring an idle time period of an idle terminal;
in this embodiment, each terminal included in the cloud compiling system may preset a time period that can be used for executing the compiling task, and only execute the compiling task in the time period.
4) Predicting the compiling time length of the program to be processed;
in this embodiment, the compiling time of the program to be processed may be predicted through a preset prediction model, where the compiling time is represented as the time required for compiling the program to be processed.
The prediction model may be obtained by training a training sample, where the training sample includes: and training the models by taking training samples containing different types of programs as input and taking the compiling time of each program as output so as to obtain the prediction models. The prediction model may be a Deep Belief network (Deep Belief networks), a Deep convolutional neural network, or the like.
5) And determining a first compiling terminal for executing a compiling task according to the compiling time length of the program to be processed and the idle time period of the idle terminal.
In this embodiment, based on the current time as a reference and based on the idle time period of the idle terminal, it is calculated whether the remaining time length of the idle terminal can execute the compiling task of the to-be-processed program, where the method for determining whether the remaining time length of the idle terminal can execute the compiling task of the to-be-processed program includes multiple methods, which are not limited in this embodiment, and may be, for example, the following method: and judging whether the remaining time length of the idle terminal is greater than the compiling time length of the program to be processed, and if so, determining that the terminal can be used for executing the compiling task.
If a terminal which can be used for executing the compiling task is screened out, the terminal is used as a first compiling terminal;
if a plurality of terminals which can be used for executing the compiling task are screened out, one of the terminals can be screened out as a first compiling terminal.
Or, which first compiling terminal is selected according to the condition of the client requesting the compiling, and if the level of the client is higher, the terminal with higher performance can be selected.
In this embodiment, the first compiling terminal for executing the program to be compiled is determined according to the predicted compiling time length of the program to be processed and the idle time period of the idle terminal including the target compiling environment, so that the reasonable allocation of resources is realized.
Further, the method also comprises the following steps:
if no idle terminal exists in the cloud compiling system, setting a queuing identifier for the received program to be processed according to the time for receiving the program to be processed; and when the idle terminal exists, distributing the terminal for compiling the program to be processed according to the queuing identification of the program to be processed.
In this embodiment, a problem that compilation is slow in compilation or cannot be completed due to a system failure may occur in a compilation process of a compilation terminal, which may affect an overall process of compilation, even may cause that compilation of a program cannot be completed, and in order not to affect a result of compilation, referring to fig. 2, a flowchart illustrating a resource allocation method provided by an embodiment of the present invention is shown, and includes:
s201: detecting a compiling process of a first compiling terminal;
s202: when a preset situation occurs in the compiling process of the first compiling terminal, acquiring a current compiling result of the compiling terminal;
in this embodiment, the preset situation may include multiple situations, which are not limited in this embodiment, for example: slow compilation or system failure, etc.
S203: according to the occupation situation of the cloud compiling system resource, a third compiling terminal for compiling the program to be processed is allocated again;
s204: and sending the compiling result and the program to be processed to the third compiling terminal.
In this embodiment, when compiling the program, the following process may be performed: lexical analysis, syntax analysis, semantic analysis, library, class file loading, intermediate code generation, optimization and target code generation. Each of which generates a compilation result. When the slow compiling process of the compiling terminal or the system fault is detected, other compiling terminals (third compiling terminals) can be allocated according to the resource occupation condition of the cloud compiling system, and the third compiling terminals can compile the program according to the compiling result obtained by the first compiling terminal, so that the compiling process of the program can be accelerated.
Referring to fig. 3, a schematic flow chart of an automatic compiling method using jupyter according to an embodiment of the present invention is shown, where in this embodiment, the method includes:
s301: responding to a program simulation request, and determining the type of the program to be processed;
s302: determining a target simulator corresponding to the program to be processed according to the type of the program to be processed;
in this embodiment, if the to-be-processed program initiates the program simulation instruction, a simulator for simulating the to-be-processed program may be determined based on the type of the to-be-processed program.
In this embodiment, a correspondence between the type of the program to be processed and the simulator may be preset, and the simulator corresponding to the program to be processed may be determined according to the correspondence and the type of the program to be processed.
S303: determining a second compiling terminal for executing a program simulation task from a preset cloud compiling system according to the target simulator;
in this embodiment, the second compiling terminal for executing the program to be processed may be determined according to the simulation duration of the program to be processed and the idle condition of the terminal included in the current cloud compiling system.
The specific confirmation method is the same as S201 to S205 described above, and is not limited in this embodiment.
S304: acquiring the information of the second compiling terminal, and sending the information of the second compiling terminal to an initiating user terminal; the information of the second compiling terminal is a basis for the user terminal to initiate remote control to the second compiling terminal;
s305: and sending the program to be processed to the second compiling terminal so that the terminal initiating the program simulation request controls a target simulator installed on the second compiling terminal to simulate the program to be processed after the user terminal initiates remote control to the second compiling terminal.
In this embodiment, after receiving the terminal information of the second compiling terminal, the user terminal may initiate remote control with the second compiling terminal, install the to-be-processed program into the simulator of the second compiling terminal through the remote control, and control the simulator of the second compiling terminal to simulate the to-be-processed program.
In this embodiment, a target simulator corresponding to the program to be processed is determined according to the type of the program to be processed; determining a second compiling terminal for executing a program simulation task from a preset cloud compiling system according to the target simulator; acquiring the information of the second compiling terminal, and sending the information of the second compiling terminal to an initiating user terminal; the information of the second compiling terminal is a basis for the user terminal to initiate remote control to the second compiling terminal; and sending the program to be processed to the second compiling terminal so that the terminal initiating the program simulation request controls a target simulator installed on the second compiling terminal to simulate the program to be processed after the user terminal initiates remote control to the second compiling terminal. Therefore, the simulation function of the program is realized, and the compiling function of the program is enriched.
In this embodiment, when the user terminal edits the program, some errors may occur or a better scheme is not adopted for editing, so that problems are likely to occur in the compiling process, and in order to avoid the problems, the user terminal may prompt a problem that may occur to the client in advance or provide some reference programs for the client. Specifically, referring to fig. 4, a flowchart of a program optimization method provided in an embodiment of the present invention is shown, where in this embodiment, the method includes:
s401: when detecting that the user terminal executes the code editing process, analyzing a currently edited code of the user terminal, and predicting a function realized by the currently edited code of the user terminal;
in this embodiment, when a user calls a code in the version library, or after calling an upload code, the process of S401-S404 may be triggered.
In this embodiment, the currently edited program may be analyzed by an intelligent algorithm or a pre-trained prediction model.
The prediction model can be obtained by training codes and functions of the codes.
S402: calling a reference code corresponding to a function realized by a code currently edited by a user terminal;
the code stored in the version library can be preset with a function tag, and the reference code can be searched through the function tag.
S403: acquiring optimization information of a reference code;
the optimization information of the reference code may include: the position of the code which is easy to make mistakes, the writing mode of the editable part of the code and the like.
S404: and sending the reference code and/or the optimization information of the reference code to the user terminal.
In this embodiment, the reference code and/or the optimization information of the reference code is sent to the user terminal, and the user can edit the code with reference to the reference code.
In the embodiment, the reference code with the same or similar function as the edited code and the optimization information of the reference code are obtained, and the reference code and/or the optimization information are/is sent to the user terminal, so that the user terminal can edit the code according to the reference code and the optimization information, thereby avoiding common errors and further obtaining a code program with better effect.
Referring to fig. 5, a flowchart of an automatic compiling method using jupyter according to an embodiment of the present invention is shown, where the method is applied to a terminal, and includes:
s501: acquiring a program to be processed;
the acquiring manner of the to-be-processed program may include multiple manners, which is not limited in this embodiment, and may include, for example, the following two manners:
the method comprises the steps of firstly, programming a program written by a user;
in a second mode, the program obtained by modifying the program shared by other users by the user specifically includes:
calling a sharing program;
acquiring a modification result of an editable part of the shared program to obtain a modified program;
and taking the modified program as a program to be compiled.
Wherein, the terminal can provide the program sharing function, and specifically further comprises:
receiving a sharing program uploaded by a user;
determining an editable portion of the shared program;
marking an editable portion of the engineering program.
S502: sending the program to be compiled to a central server;
wherein the central server is used for executing the methods of S101-S104;
s503: and receiving a compiling result sent by the central server.
The compiling result fed back by the central server may include: an installation package or an executable program.
In the embodiment, the user can send the program to be processed to the central server through the terminal, and the central server allocates the terminal for executing the compiling task to the user, so that the purpose of automatically matching the compiling environment is realized, and the requirements of the user on different compiling environments can be further met.
Referring to fig. 6, a schematic structural diagram of an automatic compiling system using jupyter according to an embodiment of the present invention is shown, in this embodiment, the system includes:
a user terminal 601, a central server 602 and a cloud compiling system 603;
the cloud compiling system 603 is composed of a plurality of compiling terminals provided with compiling environments; the installed compiling environment at least comprises jupyter;
the central server 602 is configured to perform the following method:
receiving a program to be processed sent by a user terminal;
responding to a compiling request, and determining the type of the program to be processed;
determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed;
determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment; the first compiling terminal comprises the target compiling environment;
sending the program to be processed to the first compiling terminal; the program to be processed is basic information of a compiling task executed by the first compiling terminal through an installed compiling environment;
the cloud compiling system is composed of a plurality of terminals provided with compiling environments; the installed compilation environment contains at least jupyter.
Optionally, the method further includes:
detecting whether a specified compiling environment is received;
and in the case of containing a specified compiling environment, taking the specified compiling environment as a target compiling environment.
Optionally, the determining, according to the target compiling environment, a target terminal for executing a compiling task from a preset cloud compiling system includes:
screening out a terminal containing a target compiling environment from the preset cloud compiling system;
screening out idle terminals from the terminals containing the target compiling environment;
acquiring an idle time period of an idle terminal;
predicting the compiling time length of the program to be processed;
and determining a first compiling terminal for executing the program to be compiled according to the compiling time length of the program to be processed and the idle time period of the idle terminal.
Optionally, the method further includes:
if no idle terminal exists in the cloud compiling system, setting a queuing identifier for the received program to be processed according to the time for receiving the program to be processed;
and when the idle terminal exists, distributing the terminal for compiling the program to be processed according to the queuing identification of the program to be processed.
Optionally, when receiving a request for sharing a compiling environment, obtaining information of a terminal initiating the request for sharing the compiling environment and information of a compiling environment installed on the terminal initiating the request for sharing the compiling environment;
information of a compilation environment installed on a terminal that initiates a request for sharing a compilation environment and information of a terminal that initiates a request for sharing a compilation environment are stored.
Optionally, the method further includes:
receiving error information fed back by a first compiling terminal; the error information is generated by the first compiling terminal in the compiling process;
analyzing the error information to obtain reasons and/or an optimization scheme corresponding to the error information;
feeding back the error information, the reason corresponding to the error information and/or the optimization scheme to the user terminal; the user terminal is a terminal for sending a program to be compiled.
Optionally, the method further includes:
responding to a program simulation request, and determining the type of the program to be processed;
determining a target simulator corresponding to the program to be processed according to the type of the program to be processed;
determining a second compiling terminal for executing a program simulation task from a preset cloud compiling system according to the target simulator;
acquiring the information of the second compiling terminal, and sending the information of the second compiling terminal to an initiating user terminal; the information of the second compiling terminal is a basis for the user terminal to initiate remote control to the second compiling terminal;
and sending the program to be processed to the second compiling terminal so that the user terminal controls a target simulator installed on the second compiling terminal to simulate the program to be processed after the user terminal initiates remote control to the second compiling terminal.
Optionally, the error information is presented in the form of a video; and the video is obtained by the first compiling terminal through screen recording.
The user terminal 601 is configured to perform the following method:
receiving a program to be processed;
sending the program to be processed to a server;
and receiving a compiling result sent by the server.
Optionally, the receiving the compiling result sent by the server includes:
receiving an installation package sent by a central server;
or
And receiving the executable program sent by the central server.
Optionally, the method includes:
receiving a sharing program uploaded by a user;
determining an editable portion of the shared program;
marking an editable portion of the engineering program.
Optionally, the obtaining the program to be compiled includes:
calling a sharing program;
acquiring a modification result of an editable part of the shared program to obtain a modified program;
and taking the modified program as a program to be compiled.
In this embodiment, after receiving a to-be-processed program, a user terminal sends the to-be-processed program to a central server, the central server determines a target compiling environment corresponding to the to-be-processed program based on the type of the to-be-processed program, determines a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment, and sends the to-be-processed program to the first compiling terminal, and the first compiling terminal compiles the to-be-processed program. Therefore, through interaction of the user terminal, the central server and the compiling terminal, automatic matching of the compiling environments is achieved, and further the requirements of users on different compiling environments can be met.
Referring to fig. 7, a schematic structural diagram of an automatic compiling apparatus using jupyter according to an embodiment of the present invention is shown, where the apparatus is applied to a central server, and the server includes:
a first receiving unit 701, configured to receive a to-be-processed program sent by a terminal;
a type determining unit 702, configured to determine a type of the to-be-processed program in response to a compilation request;
a first compiling environment determining unit 703, configured to determine, based on the type of the to-be-processed program, a target compiling environment corresponding to the to-be-processed program;
a compiling terminal determining unit 704, configured to determine, according to the target compiling environment, a first compiling terminal for executing a compiling task from a preset cloud compiling system; the target terminal comprises the target compiling environment;
a first sending unit 705, configured to send the to-be-processed program to the first compiling terminal; the program to be processed is basic information of a compiling task executed by the first compiling terminal through an installed compiling environment;
the cloud compiling system is composed of a plurality of terminals provided with compiling environments; the installed compilation environment contains at least jupyter.
Optionally, the method further includes:
a second compilation environment determination unit to:
detecting whether a specified compiling environment is received;
and in the case of containing a specified compiling environment, taking the specified compiling environment as a target compiling environment.
Optionally, the compiling terminal determining unit is specifically configured to:
screening out a terminal containing a target compiling environment from the preset cloud compiling system;
screening out idle terminals from the terminals containing the target compiling environment;
acquiring an idle time period of an idle terminal;
predicting the compiling time length of the program to be processed;
and determining a first compiling terminal for executing the program to be compiled according to the compiling time length of the program to be processed and the idle time period of the idle terminal.
Optionally, the method further includes:
a queuing unit to:
if no idle terminal exists in the cloud compiling system, setting a queuing identifier for the received program to be processed according to the time for receiving the program to be processed;
and when the idle terminal exists, distributing the terminal for compiling the program to be processed according to the queuing identification of the program to be processed.
Optionally, the method further includes:
a compilation environment sharing unit to:
when a request for sharing a compiling environment is received, acquiring information of a terminal initiating the request for sharing the compiling environment and information of the compiling environment installed on the terminal initiating the request for sharing the compiling environment;
information of a compilation environment installed on a terminal that initiates a request for sharing a compilation environment and information of a terminal that initiates a request for sharing a compilation environment are stored.
Optionally, the method further includes:
an error feedback unit to:
receiving error information fed back by a first compiling terminal; the error information is generated by the first compiling terminal in the compiling process;
analyzing the error information to obtain reasons and/or an optimization scheme corresponding to the error information;
feeding back the error information, the reason corresponding to the error information and/or the optimization scheme to the user terminal; the user terminal is a terminal for sending a program to be compiled.
Optionally, the method further includes:
an analog unit to:
responding to a program simulation request, and determining the type of the program to be processed;
determining a target simulator corresponding to the program to be processed according to the type of the program to be processed;
determining a second compiling terminal for executing a program simulation task from a preset cloud compiling system according to the target simulator;
acquiring the information of the second compiling terminal, and sending the information of the second compiling terminal to an initiating user terminal; the information of the second compiling terminal is a basis for the user terminal to initiate remote control to the second compiling terminal;
and sending the program to be processed to the second compiling terminal so that the user terminal controls a target simulator installed on the second compiling terminal to simulate the program to be processed after the user terminal initiates remote control to the second compiling terminal.
Optionally, the error information is presented in the form of a video; and the video is obtained by the first compiling terminal through screen recording.
By the device of the embodiment, the type of the program to be processed is determined in response to a compiling request; determining a target compiling environment corresponding to the program to be processed based on the type of the program to be processed; determining a first compiling terminal for executing a compiling task from a preset cloud compiling system according to the target compiling environment; the target terminal comprises the target compiling environment; and sending the program to be processed to the first compiling terminal. Therefore, by identifying the type of the program and determining the target compiling environment corresponding to the type of the program, the compiling environment can be automatically matched, and the requirements of users on different compiling environments can be further met.
Referring to fig. 8, a schematic structural diagram of an automatic compiling apparatus using jupyter according to an embodiment of the present invention is shown, where the apparatus is applied to a terminal, and the apparatus includes:
a second receiving unit 801, configured to receive a program to be processed;
a second sending unit 802, configured to send the program to be processed to a server, so that the server processes the program to be compiled based on the method in S101-S104;
a third receiving unit 803, configured to receive the compiling result sent by the server.
Optionally, the third receiving unit is specifically configured to:
receiving an installation package sent by a central server;
or
And receiving the executable program sent by the central server.
Optionally, the program sharing unit is configured to:
receiving a sharing program uploaded by a user;
determining an editable portion of the shared program;
marking an editable portion of the engineering program.
Optionally, the second receiving unit is specifically configured to:
calling a sharing program;
acquiring a modification result of an editable part of the shared program to obtain a modified program;
and taking the modified program as a program to be compiled.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.