CN110275778B - Online program running method and device, electronic equipment and computer storage medium - Google Patents

Online program running method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN110275778B
CN110275778B CN201910517559.4A CN201910517559A CN110275778B CN 110275778 B CN110275778 B CN 110275778B CN 201910517559 A CN201910517559 A CN 201910517559A CN 110275778 B CN110275778 B CN 110275778B
Authority
CN
China
Prior art keywords
application program
available computing
computing resources
application
program operation
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
CN201910517559.4A
Other languages
Chinese (zh)
Other versions
CN110275778A (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.)
Shanghai Sensetime Intelligent Technology Co Ltd
Original Assignee
Shanghai Sensetime Intelligent Technology 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 Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN201910517559.4A priority Critical patent/CN110275778B/en
Publication of CN110275778A publication Critical patent/CN110275778A/en
Application granted granted Critical
Publication of CN110275778B publication Critical patent/CN110275778B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • 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/5083Techniques for rebalancing the load in a distributed system
    • 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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The embodiment of the disclosure discloses an online program running method, an online program running device, electronic equipment and a computer storage medium, wherein the method comprises the following steps: receiving an application program running request from at least one terminal; in response to receiving the condition of the at least two application program operation requests, sequencing the at least two application program operation requests; in response to the situation that the application program has available computing resources, acquiring identification information of the available computing resources; distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; sending the distribution result to terminals respectively corresponding to the application program operation requests; and the available computing resources respectively receive and run the application program to be run, which is sent by the terminal and respectively corresponds to the application program running request. Therefore, the execution response time of each code operation request can be balanced, so that more average and reasonable response time can be obtained at each code input end.

Description

Online program running method and device, electronic equipment and computer storage medium
Technical Field
The present invention relates to the field of online programming, and in particular, to an online program running method, an online program running device, an electronic device, and a computer storage medium.
Background
With the continuous development of artificial intelligence technology, machine learning and artificial intelligence programming education are becoming an important part of K12 education, and in practical application, an online programming platform can be used as an important teaching tool for online programming education, for example, students can write and run experiment codes through the online programming platform. When online programming education is implemented, a large amount of computing resources, such as Graphics Processing Unit (GPU) resources, are required for running codes, and under the condition that the computing resources are limited, a large amount of time is consumed for each code running task to wait for computing resources, so that the efficiency is low.
Disclosure of Invention
The embodiment of the disclosure is expected to provide a scheme for online program running.
The embodiment of the disclosure provides an online program running method, which comprises the following steps:
receiving an application program running request from at least one terminal;
in response to the condition that at least two application program operation requests are received, sequencing the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests;
in response to the situation that the application program has available computing resources, acquiring identification information of the available computing resources;
distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result;
sending the distribution result to terminals respectively corresponding to the application program operation requests;
and the available computing resources respectively receive the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests, and operate the application programs to be operated.
Optionally, the obtaining the identification information of the available computing resource includes:
and receiving the identification information of the self sent by the available computing resource through a bill mechanism.
Optionally, the receiving, by a ticket mechanism, the identification information of the self sent by the available computing resource includes:
sending a ticket to the available computing resource; receiving the bill and the identification information sent by the available computing resource; in response to a received ticket not matching the sent ticket, ignoring the received identification information; in response to a received ticket matching a sent ticket, it is determined that identification information for the available computing resource was received.
Optionally, the method further comprises: and in response to the situation that the application program has available computing resources, deleting the application program running request corresponding to the application program with the available computing resources in the sequencing result.
Optionally, the sorting the at least two application program operation requests includes:
and sequencing the at least two application program operation requests by adopting a first-in first-out strategy or a weighted sequencing strategy.
Optionally, the allocating the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain an allocation result includes:
and distributing the available computing resources according to the sequencing result of the at least two application program operation requests to obtain the incidence relation between the application program operation requests and the available computing resources.
Optionally, the method further comprises:
and the available computing resources feed back the running information of the application program to be run to the corresponding terminal.
Optionally, before receiving an application running request from at least one terminal, the method further includes:
and establishing a WebSocket connection with the at least one terminal.
Optionally, before the available computing resources respectively receive the application programs to be executed sent by the terminals respectively corresponding to the application program execution requests, the method further includes:
and establishing a WebSocket connection with the at least one terminal.
The disclosed embodiment also provides an online program running device, which comprises a queuing service module and a calculation execution module, wherein,
the queuing service module is used for receiving an application program operation request from at least one terminal; in response to the condition that at least two application program operation requests are received, sequencing the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests; in response to a situation that an application program has available computing resources of the computing execution module, acquiring identification information of the available computing resources; distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; sending the distribution result to terminals respectively corresponding to the application program operation requests;
the available computing resources are used for respectively receiving the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests and operating the application programs to be operated.
Optionally, the queuing service module is configured to receive, through a ticket mechanism, identification information of the queuing service module, where the identification information is sent by the available computing resource.
Optionally, the queuing service module is configured to send a ticket to the available computing resource; receiving the bill and the identification information sent by the available computing resource; in response to a received ticket not matching the sent ticket, ignoring the received identification information; in response to a received ticket matching a sent ticket, it is determined that identification information for the available computing resource was received.
Optionally, the queuing service module is further configured to, in response to a situation that the application program has available computing resources, delete, in the sorting result, the application program running request corresponding to the application program that has available computing resources.
Optionally, the queuing service module is configured to sort the at least two application program operation requests by using a first-in first-out policy or a weighted sorting policy.
Optionally, the queuing service module is configured to allocate available computing resources according to a sequencing result of the at least two application program operation requests, so as to obtain an association relationship between the application program operation request and the available computing resources.
Optionally, the available computing resource is configured to feed back the running information of the application to be run to the corresponding terminal.
Optionally, the queuing service node is further configured to establish a WebSocket connection with the at least one terminal before receiving the application program operation request from the at least one terminal.
Optionally, the available computing resource is further configured to establish a WebSocket connection with the at least one terminal before receiving the application program to be executed sent by the terminal respectively corresponding to the application program execution request.
The disclosed embodiments also provide an electronic device comprising a processor and a memory for storing a computer program capable of running on the processor; wherein the content of the first and second substances,
the processor is configured to execute any one of the above online program running methods when running the computer program.
The embodiment of the disclosure also provides a computer storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement any one of the above online program running methods.
In the embodiment of the disclosure, an application program operation request is received from at least one terminal; in response to the condition that at least two application program operation requests are received, sequencing the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests; in response to the situation that the application program has available computing resources, acquiring identification information of the available computing resources; distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; sending the distribution result to terminals respectively corresponding to the application program operation requests; and the available computing resources respectively receive the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests, and operate the application programs to be operated. Therefore, the application program operation requests can be sequenced, and when available computing resources exist in the application program, the computing resources are distributed to the application program according to the sequencing result, so that the execution response time of each application program operation request can be balanced, each terminal can obtain relatively average and reasonable response time, and poor user experience of long waiting time of a user of a certain terminal can be avoided; in addition, because the application program is operated when the application program has available computing resources, all the computing resources can be more efficiently utilized, and the optimal utilization of the computing resources is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic view of an application scenario of an online program running method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of online program operation of an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an interaction flow of an embodiment of the disclosed application;
FIG. 4 is a schematic diagram of a component structure of an online program running apparatus according to an embodiment of the disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
The present disclosure will be described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the examples provided herein are merely illustrative of the present disclosure and are not intended to limit the present disclosure. In addition, the embodiments provided below are some embodiments for implementing the disclosure, not all embodiments for implementing the disclosure, and the technical solutions described in the embodiments of the disclosure may be implemented in any combination without conflict.
It should be noted that, in the embodiments of the present disclosure, the terms "comprises," "comprising," or any other variation thereof are intended to cover a non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the explicitly recited elements but also other elements not explicitly listed or inherent to the method or apparatus. Without further limitation, the use of the phrase "including a. -. said." does not exclude the presence of other elements (e.g., steps in a method or elements in a device, such as portions of circuitry, processors, programs, software, etc.) in the method or device in which the element is included.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
For example, the online program running method provided by the embodiment of the present disclosure includes a series of steps, but the online program running method provided by the embodiment of the present disclosure is not limited to the described steps, and similarly, the online program running device provided by the embodiment of the present disclosure includes a series of modules, but the device provided by the embodiment of the present disclosure is not limited to include the explicitly described modules, and may also include modules that are required to be set for acquiring relevant information or performing processing based on the information.
The disclosed embodiments may be implemented in a computer system comprised of terminals and servers and may be operational with numerous other general purpose or special purpose computing system environments or configurations. Here, the terminal may be a thin client, a thick client, a hand-held or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronics, a network personal computer, a small computer system, etc., and the server may be a server computer system, a small computer system, a mainframe computer system, a distributed cloud computing environment including any of the above, etc.
The electronic devices of the terminal, server, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
In some embodiments of the present disclosure, for online programming education, when a server has multiple computing execution nodes, a conventional load balancing scheme is to evenly distribute jobs (code execution tasks) to the computing execution nodes, but since the difference in execution time of codes (such as artificial intelligence codes or machine learning codes) is large, it is possible to vary from tens of seconds to several minutes; thus, if a conventional load balancing scheme such as a polling (polling) scheme is adopted, it may cause accumulation of long jobs or idling of computing resources of the computing execution nodes. Further, for online programming education, a pure background operation execution mode is usually adopted, that is, the process of running program codes is realized in the background and is not displayed in the foreground; the computing execution node is difficult to directly establish connection with a front-end application (such as an online programming education application), so that the front-end application is required to acquire program code running information in a polling mode, the instantaneity is poor, and the user interaction characteristic of online education cannot be adapted; that is, the compute execution node cannot feed back the running process and result of the program code to the front-end application in real time, which is not favorable for the user to experience the running process of the program code (e.g., the process of model training and deduction).
In view of the above technical problems, some embodiments of the present disclosure provide an online program running method, which may be implemented in scenarios such as artificial intelligence education, online programming platforms, and artificial intelligence platforms.
Fig. 1 is a schematic view of an application scenario of an online program running method according to an embodiment of the present disclosure, and as shown in fig. 1, a queuing service module is used to sequence application program running requests, where the queuing service module may include one queuing service node, or may include a queuing service node cluster formed by multiple queuing service nodes. The computing execution module comprises computing resources for running the online program, and the computing resources of the computing execution module may be software resources and/or hardware resources, for example, the computing execution module may comprise one computing execution node, and may also comprise a queuing service node cluster composed of a plurality of computing execution nodes, where the computing execution node represents the hardware computing resources of the computing execution module; identification information exists in the computing resources of the computing execution module, and the identification information of the computing resources of the computing execution module can be names or other identification information.
The at least one terminal, the queuing service module and the calculation execution module can perform data interaction pairwise, for example, the at least one terminal can perform data interaction with the queuing service module through WebSocket connection, and the at least one terminal can also perform data interaction with the calculation execution module through WebSocket connection.
Alternatively, the queuing service module and the computation execution module may be located on the server side. In practical application, an online programming education application program can be installed on the terminal, so that a user can input related codes; the terminal can send an application program running request to the queuing service module after acquiring the submission code of the user; the queuing service module can sequence the received application program requests to obtain a sequencing result; the calculation execution module can run the program code; the state of the compute execution module may be the presence or absence of available compute resources; the computation execution module may obtain the computation resource by queuing, for example, may queue different computation execution nodes, and sequentially allocate the computation resource to the different computation execution nodes according to the queuing result.
In practical applications, the queuing service module and the computation execution module may be implemented by a Device such as a server-based Processor, and the Processor is at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor.
First embodiment
The following describes an online program operating method according to an embodiment of the present disclosure, taking an application scenario shown in fig. 1 as an example.
Fig. 2 is a flowchart of an online program running method according to an embodiment of the present disclosure, and as shown in fig. 2, the flowchart may include:
step 201: the queuing service module receives an application execution request from at least one terminal.
In practical applications, the terminal may receive a code submitted by a user based on the online programming education application, then generate a corresponding application program running request, and transmit the generated application program running request to at least one queuing service node of the queuing service module. That is, when the number of queuing service nodes is greater than 1, the generated application execution request may be simultaneously transmitted to a plurality of queuing service nodes.
As an embodiment, the application running request may be presented in the form of a Ticket (Ticket).
Step 202: the queuing service module is used for sequencing the at least two application program operation requests in response to the condition that the at least two application program operation requests are received, and obtaining the sequencing result of the at least two application program operation requests.
Here, in the queuing service module, each queuing service node may receive an application execution request from a plurality of terminals, or may receive a plurality of application execution requests from one terminal.
In this disclosure, the sequencing result of the application program operation request may be used to reflect the execution order of the corresponding application program, and in the sequencing result, the earlier the application program operation request is, the more the corresponding application program needs to be preferentially operated.
For the implementation manner of sequencing the at least two application program operation requests, in one example, a First-in First-Out (FIFO) policy may be adopted to sequence the at least two application program operation requests, so that the application programs may be ensured to be operated in time sequence, and the First-in First-Out principle of the operation may be followed to the maximum extent in the program operation process with different operation time lengths; the users of all the terminals can obtain relatively average response speed, and the situation that the program runs and waits too long can not occur.
For the implementation manner of sorting the at least two application program operation requests, in another example, a weighted sorting policy may be adopted to sort the at least two application program operation requests; alternatively, the weights may be calculated from metadata such as expected execution time of the application, user priority, and the like. By adopting the weighted sorting strategy, various factors can be comprehensively considered, so that the optimization of the application program running request sorting can be realized, and the response speed and the user experience better than those of the FIFO strategy can be shown.
In one specific example, the Weighted ordering policy may be a Weighted Fair Queuing (WFQ) policy, a Class-Based Weighted Fair Queuing (CBWFQ) policy, or other Weighted ordering policy.
Further, after each queuing service node sorts at least the application program running requests, if the application program running requests are received again, the application program running requests can be sorted by combining the application program running requests received again.
Step 203: the queuing service module responds to the situation that the available computing resources exist in the application program, and obtains the identification information of the available computing resources.
For the implementation of this step, for example, when the computing execution module has available computing resources for running the application program, the queuing service module may be sent with identification information of the available computing resources; in a specific example, the identification information of the available computing resource may be identification information of at least one computing execution node in the computing execution module, or may be identification information of at least one software computing resource in the computing execution module.
It should be noted that, when the state of the computation execution module is that there is no available computation resource, the state may continue to wait until there is an available computation resource.
Step 204: the queuing service module distributes the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; and sending the distribution result to terminals respectively corresponding to the application program operation requests.
For the implementation manner in which the queuing service module allocates the available computing resource and the identification information thereof according to the sorting result of the at least two application program operation requests, for example, the available computing resource may be allocated according to the sorting result, so as to obtain the association relationship between the application program operation request and the available computing resource. Here, the allocation result includes: and the association relationship between the application program running request and the available computing resource.
In the embodiment of the disclosure, the queuing service node can judge how many application program operation requests in the sequencing result can be met by the available computing resources according to the amount of the available computing resources and the computing resources required to be used by the application program corresponding to each application program operation request in the sequencing result; when the available computing resource can meet the application program running request (which can run the corresponding application program) ranked at the top in the ranking result, the queuing service node can directly allocate the available computing resource and the corresponding identification information for the application program running request ranked at the top in the ranking result, that is, can determine the application program running request ranked at the top in the ranking result corresponding to the available computing resource; then, the available computing resources and the corresponding identification information can be directly sent to the terminal corresponding to the application program running request arranged at the top in the sequencing result.
When n is greater than 1 and the available computing resources can meet the n application program operation requests (which can operate corresponding application programs) ranked at the top in the ranking result, the queuing service node can respectively allocate the available computing resources and corresponding available computing resource identification information for the n application program operation requests ranked at the top in the ranking result, that is, can determine the available computing resources corresponding to the n application program operation requests ranked at the top in the ranking result; then, the available computing resources and the corresponding available computing resource identification information may be sent to the terminals corresponding to the n application program operation requests ranked at the top in the ranking result.
It can be seen that, in the embodiment of the present disclosure, the available computing resources can be flexibly allocated to the application program operation request according to the available computing resources and the sorting result, and further, the utilization rate of the available computing resources can be improved.
Step 205: and the available computing resources respectively receive the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests, and operate the application programs to be operated.
In the embodiment of the disclosure, when the terminals respectively corresponding to the application program running requests receive the available computing resources and the corresponding identification information, connection can be established with the corresponding available computing resources according to the received identification information; the application to be run may then be sent to the corresponding available computing resource based on the established connection. Therefore, the available computing resources can be acquired to the running application program through the direct interaction of the terminal and the available computing resources, and therefore the code execution efficiency of the application program is improved.
The online program running method of the embodiment of the disclosure receives an application program running request from at least one terminal; in response to the condition that at least two application program operation requests are received, sequencing the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests; in response to the situation that the application program has available computing resources, acquiring identification information of the available computing resources; distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; sending the distribution result to terminals respectively corresponding to the application program operation requests; and the available computing resources respectively receive the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests, and operate the application programs to be operated. Therefore, the application program operation requests can be sequenced, and when available computing resources exist in the application program, the computing resources are distributed to the application program according to the sequencing result, so that the execution response time of each application program operation request can be balanced, each terminal can obtain relatively average and reasonable response time, and poor user experience of long waiting time of a user of a certain terminal can be avoided; in addition, because the application program is operated when the application program has available computing resources, all the computing resources can be more efficiently utilized, and the optimal utilization of the computing resources is realized.
In addition, in the embodiment of the present disclosure, scheduling of each application program running request is performed first, the scheduling of each application program running request is mainly implemented based on the sequencing result of the queuing service module, then, the program running is implemented, and the program running can be implemented through direct interaction between the terminal and the computation execution module; therefore, the scheduling of the application program operation request and the program operation can be sequentially realized in two stages in the embodiment of the disclosure, and the fairness and the real-time performance of the program operation can be considered; the scheduling of the application program operation request and the program operation are relatively independent processes, and the program operation process is not influenced when the sequencing strategy is optimized and adjusted.
In one embodiment, when the computing execution module presents available computing resources on which the application can run, the computing execution module may identify information of the available computing resources to the queuing service module through a ticketing mechanism.
In a specific example, in each queuing service node, when each application program running request is presented through a ticket, the ticket corresponding to each application program running request may carry identification information of the queuing service node; when the available computing resources appear, a reading instruction can be sent to any queuing service node, and the reading instruction is used for indicating to read the bill; then, when the queuing service node receives the reading instruction, the bill can be sent to the available computing resource; the available computing resources may send the ticket and its own identification information to each queuing service node.
In practical applications, the available computing resource may send the ticket and its own identification information to each queuing service node by broadcasting.
Optionally, each queuing service node may determine whether the received ticket matches itself (i.e., determine whether the received ticket is the ticket sent by the queuing service node), and when the received ticket matches itself, may send the received identification information to the corresponding terminal; the received identification information may be ignored when the received ticket does not match itself.
For the implementation manner that each queuing service node determines whether the received ticket matches itself, for example, in each queuing service node, it may be determined whether the received new ticket includes the identification information of the queuing service node, so as to determine whether the received new ticket matches itself.
It can be seen that through the bill mechanism, only one queuing service node is needed to send the identification information of the available computing resources to the terminal, i.e. a plurality of queuing service nodes are not needed to interact with the terminal, thereby improving the interaction efficiency between the queuing service nodes and the terminal.
In each queuing service node, when available computing resources appear in the computing execution module, the application program running request corresponding to the application program with the available computing resources can be deleted in the sorting result; in a specific implementation, after the available computing resources send the tickets and the identification information of the tickets to each queuing service node, each queuing service node can delete the corresponding application program running request in the sorting result, so that a new sorting result can be obtained, and corresponding processing can be performed on the new sorting result again when the available computing resources appear later.
As an implementation manner, after the application program to be run is run by using the computing resource, the running information of the application program to be run can be fed back to the corresponding terminal; here, the operation information of the application program to be operated may be an operation procedure and/or an operation result of the application program to be operated.
When the terminal is provided with the online programming education application, the running information of the application program to be run can be displayed on the interface of the online programming education application at the front end.
It can be seen that the problem that the running information of the application program cannot be fed back to the front end in the running process of the application program can be solved, and the running information of the application program can be fed back to the terminal in real time, for example, the running information of the application program can be fed back to the front end application; furthermore, the user can view the running information of the application program in real time.
Second embodiment
On the basis of the first embodiment of the present disclosure, further illustration is made.
The present disclosure is further illustrated by the following specific application example.
Fig. 3 is an interaction flow diagram of an embodiment of the present disclosure, and as shown in fig. 3, a plurality of queuing service nodes may be set in a server cluster, and a plurality of computation execution nodes may be set in a computation execution node cluster; a user may submit written artificial intelligence or machine learning code based on an online programmatic educational application of a browser.
Referring to fig. 3, a flow of an application embodiment of the present disclosure may include:
after receiving the program codes for submission, the browser-based online programming education application can establish Websocket connection with each queuing service node in the server cluster and submit a socket of an application program operation request to each queuing service node; the received multiple application program running requests may be sequenced in each queuing service node, and the implementation of sequencing the application program running requests has been described in the foregoing embodiments, and is not described here again.
When any one code running node in the computation execution node cluster is an available computation resource, a packet can be read from any one queuing service node, and the packet and an Identity (Identity, ID) of the node are sent to each queuing service node in a broadcast manner.
Each queuing service node can process the messages matched with the queuing service node after receiving the broadcast message, and specifically, the ID of the calculation execution node can be sent to the corresponding front-end application (i.e. the browser-based online programming education application) according to the application program running request at the top in the sequencing result.
The browser-based online programming education application can directly establish Websocket connection with the corresponding calculation execution node according to the received ID of the calculation execution node, and submit program codes to the calculation execution node through the Websocket connection.
The computation execution node starts to run the program code, and the computation execution node can push the running information of the program code to the browser-based online programming education application through the WebSocket connection.
It can be seen that, in the application embodiment of the present disclosure, for all the codes to be run in the online programming education application platform, the application program running requests can be sequenced to obtain a queue; in the computing execution node cluster, as long as computing execution nodes serving as available computing resources appear, corresponding program codes are received and run from the browser-based online programming education application on the basis of the queue; and the running information of the program code can be directly fed back to the front-end application in real time through WebSocket connection.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic
Third embodiment
On the basis of the online program running method provided by the foregoing embodiment, the embodiment of the present disclosure provides an online program running device.
Fig. 4 is a schematic structural diagram of an online program running apparatus according to an embodiment of the present disclosure, as shown in fig. 4, the apparatus includes a queuing service module 401 and a calculation execution module 402, wherein,
the queuing service module 401 is configured to receive an application program operation request from at least one terminal; in response to the condition that at least two application program operation requests are received, sequencing the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests; in response to a situation that an application program has available computing resources of the computing execution module, acquiring identification information of the available computing resources; distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; sending the distribution result to terminals respectively corresponding to the application program operation requests;
the available computing resources are used for respectively receiving the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests and operating the application programs to be operated.
In the embodiment of the disclosure, when the terminals respectively corresponding to the application program running requests receive the available computing resources and the corresponding identification information, connection can be established with the corresponding available computing resources according to the received identification information; the application to be run may then be sent to the corresponding available computing resource based on the established connection. Therefore, the available computing resources can be acquired to the running application program through the direct interaction of the terminal and the available computing resources, and therefore the code execution efficiency of the application program is improved.
The method and the device can sequence the application program running requests, and when the application program has available computing resources, the computing resources are distributed to the application program according to the sequencing result, so that the execution response time of each application program running request can be balanced, each terminal can obtain more average and reasonable response time, and poor user experience of long waiting time of a user of a certain terminal can be avoided; in addition, because the application program is operated when the application program has available computing resources, all the computing resources can be more efficiently utilized, and the optimal utilization of the computing resources is realized.
In addition, in the embodiment of the present disclosure, scheduling of each application program running request is performed first, the scheduling of each application program running request is mainly implemented based on the sequencing result of the queuing service module, then, the program running is implemented, and the program running can be implemented through direct interaction between the terminal and the computation execution module; therefore, the scheduling of the application program operation request and the program operation can be sequentially realized in two stages in the embodiment of the disclosure, and the fairness and the real-time performance of the program operation can be considered; the scheduling of the application program operation request and the program operation are relatively independent processes, and the program operation process is not influenced when the sequencing strategy is optimized and adjusted.
In one embodiment, the queuing service module 401 is configured to receive, through a ticket mechanism, identification information of itself sent by the available computing resource.
In one embodiment, the queuing service module 401 is configured to send a ticket to the available computing resource; receiving the bill and the identification information sent by the available computing resource; in response to a received ticket not matching the sent ticket, ignoring the received identification information; in response to a received ticket matching a sent ticket, it is determined that identification information for the available computing resource was received.
It can be seen that through the bill mechanism, only one queuing service module is needed to send the identification information of the available computing resources to the terminal, i.e. a plurality of queuing service modules are not needed to interact with the terminal, thereby improving the interaction efficiency of the queuing service node and the terminal.
In an embodiment, the queuing service module 401 is further configured to, in response to a situation that the application program has available computing resources, delete, in the sorting result, an application program running request corresponding to the application program that has available computing resources. In specific implementation, after the available computing resources send the tickets and the identification information of the tickets to the queuing service module, the queuing service module can delete the corresponding application program running requests in the sorting results, so that new sorting results can be obtained, and corresponding processing can be performed on the new sorting results again when the available computing resources appear later.
In an embodiment, the queuing service module 401 is configured to sort the at least two application running requests by using a first-in first-out policy or a weighted sorting policy.
When a first-in first-out strategy is adopted to sequence the at least two application program operation requests, the application programs can be ensured to operate according to the time sequence, so that the program operation processes with different operation time lengths can follow the first-in first-out principle of operation to the maximum extent; the users of all the terminals can obtain relatively average response speed, and the situation that the program runs and waits too long can not occur.
When a weighted sorting strategy is adopted to sort the at least two application program operation requests; the weights may be calculated from metadata such as expected execution time of the application, user priority, etc. By adopting the weighted sorting strategy, various factors can be comprehensively considered, so that the optimization of the application program running request sorting can be realized, and the response speed and the user experience better than those of the FIFO strategy can be shown.
In an embodiment, the queuing service module 401 is configured to allocate available computing resources according to a sequencing result of the at least two application program operation requests, so as to obtain an association relationship between the application program operation request and the available computing resources.
It can be seen that, in the embodiment of the present disclosure, the available computing resources can be flexibly allocated to the application program operation request according to the available computing resources and the sorting result, and further, the utilization rate of the available computing resources can be improved.
In an embodiment, the available computing resource is configured to feed back the running information of the application to be run to the corresponding terminal.
It can be seen that the problem that the running information of the application program cannot be fed back to the front end in the running process of the application program can be solved, and the running information of the application program can be fed back to the terminal in real time, for example, the running information of the application program can be fed back to the front end application; furthermore, the user can view the running information of the application program in real time.
In an embodiment, the queuing service module is further configured to establish a WebSocket connection with the at least one terminal before receiving an application program running request from the at least one terminal.
Therefore, the WebSocket connection is established between the terminal and the queuing service module, so that the data interaction between the terminal and the queuing service module is convenient to realize.
In an embodiment, the available computing resource is further configured to establish a WebSocket connection with the at least one terminal before receiving the application to be executed sent by the terminal respectively corresponding to the application execution request.
Therefore, the WebSocket connection is established between the terminal and the available computing resources, and the data interaction between the terminal and the available computing resources is convenient to realize.
The queuing service module 401 and the calculation execution module 402 can be implemented by a processor located at a server side, where the processor is at least one of an ASIC, a DSP, a DSPD, a PLD, an FPGA, a CPU, a controller, a microcontroller, and a microprocessor.
In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Specifically, the computer program instructions corresponding to an online program running method in the present embodiment may be stored on a storage medium such as an optical disc, a hard disc, or a usb disk, and when the computer program instructions corresponding to an online program running method in the storage medium are read or executed by an electronic device, any of the online program running methods of the foregoing embodiments is implemented.
Based on the same technical concept of the foregoing embodiment, referring to fig. 5, it shows an electronic device 50 provided by the embodiment of the present disclosure, which may include: a memory 51 and a processor 52; wherein the content of the first and second substances,
the memory 51 for storing computer programs and data;
the processor 52 is configured to execute the computer program stored in the first memory to implement any one of the online program running methods of the foregoing embodiments.
In practical applications, the memory 51 may be a volatile memory (RAM); or a non-volatile memory (non-volatile memory) such as a ROM, a flash memory (flash memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD); or a combination of the above types of memories and provides instructions and data to the processor 52.
The processor 52 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understood that the electronic devices for implementing the above-described processor functions may be other devices, and the embodiments of the present disclosure are not particularly limited.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and for specific implementation, reference may be made to the description of the above method embodiments, and for brevity, details are not described here again
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, which are not repeated herein for brevity
The methods disclosed in the method embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in various product embodiments provided by the application can be combined arbitrarily to obtain new product embodiments without conflict.
The features disclosed in the various method or apparatus embodiments provided herein may be combined in any combination to arrive at new method or apparatus embodiments without conflict.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present disclosure.
While the embodiments of the present disclosure have been described in connection with the drawings, the present disclosure is not limited to the specific embodiments described above, which are intended to be illustrative rather than limiting, and it will be apparent to those of ordinary skill in the art in light of the present disclosure that many more modifications can be made without departing from the spirit of the disclosure and the scope of the appended claims.

Claims (18)

1. An online program running method is applied to a server, and the server comprises a plurality of queuing service nodes; the method comprises the following steps:
each queuing service node receives an application program running request from at least one terminal;
each queuing service node, in response to the condition that at least two application program operation requests are received, sequences the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests;
each queuing service node responds to the situation that the available computing resource exists in the application program, and acquires the identification information of the available computing resource through a bill mechanism;
each queuing service node distributes the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result;
each queuing service node sends the distribution result to a terminal corresponding to the application program running request;
the available computing resources respectively receive the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests, and operate the application programs to be operated;
in each queuing service node, when each application program running request is presented through a ticket, the ticket corresponding to each application program running request includes identification information of the queuing service node.
2. The method of claim 1, wherein receiving, by a ticket mechanism, the own identification information sent by the available computing resource comprises:
sending a ticket to the available computing resource;
receiving the bill and the identification information sent by the available computing resource;
in response to a received ticket not matching the sent ticket, ignoring the received identification information;
in response to a received ticket matching a sent ticket, it is determined that identification information for the available computing resource was received.
3. The method of claim 1, further comprising: and in response to the situation that the application program has available computing resources, deleting the application program running request corresponding to the application program with the available computing resources in the sequencing result.
4. The method of claim 1, wherein said ordering the at least two application execution requests comprises:
and sequencing the at least two application program operation requests by adopting a first-in first-out strategy or a weighted sequencing strategy.
5. The method according to claim 1, wherein said allocating the available computing resources and their identification information according to the sorted results of the at least two application program operation requests to obtain an allocation result comprises:
and distributing the available computing resources according to the sequencing result of the at least two application program operation requests to obtain the incidence relation between the application program operation requests and the available computing resources.
6. The method of claim 1, further comprising:
and the available computing resources feed back the running information of the application program to be run to the corresponding terminal.
7. The method according to any one of claims 1 to 6, wherein before receiving an application execution request from at least one terminal, the method further comprises:
and establishing a WebSocket connection with the at least one terminal.
8. The method according to any one of claims 1 to 6, wherein before receiving the application to be executed sent by the terminal respectively corresponding to the application execution request, the method further comprises:
and establishing a WebSocket connection with the at least one terminal.
9. An online program execution apparatus comprising a queuing service module and a computation execution module, wherein,
the queuing service module comprises a plurality of queuing service nodes, and each queuing service node is used for receiving an application program operation request from at least one terminal; in response to the condition that at least two application program operation requests are received, sequencing the at least two application program operation requests to obtain a sequencing result of the at least two application program operation requests; in response to the situation that the application program has available computing resources of the computing execution module, acquiring identification information of the available computing resources through a bill mechanism; distributing the available computing resources and the identification information thereof according to the sequencing result of the at least two application program operation requests to obtain a distribution result; sending the distribution result to terminals respectively corresponding to the application program operation requests;
the available computing resources are used for respectively receiving the application programs to be operated sent by the terminals respectively corresponding to the application program operation requests and operating the application programs to be operated;
in each queuing service node, when each application program running request is presented through a ticket, the ticket corresponding to each application program running request includes identification information of the queuing service node.
10. The apparatus of claim 9, wherein the queuing service module is configured to send a ticket to the available computing resource; receiving the bill and the identification information sent by the available computing resource; in response to a received ticket not matching the sent ticket, ignoring the received identification information; in response to a received ticket matching a sent ticket, it is determined that identification information for the available computing resource was received.
11. The apparatus according to claim 9, wherein the queuing service module is further configured to delete, in the sorting result, the application running request corresponding to the application program having the available computing resource, in response to a situation that the application program has the available computing resource.
12. The apparatus of claim 9, wherein the queue service module is configured to order the at least two application running requests using a first-in-first-out policy or a weighted ordering policy.
13. The apparatus according to claim 9, wherein the queuing service module is configured to allocate available computing resources according to the sequencing result of the at least two application program operation requests, so as to obtain an association relationship between the application program operation request and the available computing resources.
14. The apparatus according to claim 9, wherein the available computing resource is configured to feed back running information of the application to be run to the corresponding terminal.
15. The apparatus according to any one of claims 9 to 14, wherein the queuing service module is further configured to establish a WebSocket connection with at least one terminal before receiving an application running request from the at least one terminal.
16. The apparatus according to any one of claims 9 to 14, wherein the available computing resources are further configured to establish a WebSocket connection with the at least one terminal before receiving the to-be-executed application sent by the terminal respectively corresponding to the application execution request.
17. An electronic device comprising a processor and a memory for storing a computer program operable on the processor; wherein the content of the first and second substances,
the processor is configured to perform the method of any one of claims 1 to 8 when running the computer program.
18. A computer storage medium on which a computer program is stored, characterized in that the computer program realizes the method of any one of claims 1 to 8 when executed by a processor.
CN201910517559.4A 2019-06-14 2019-06-14 Online program running method and device, electronic equipment and computer storage medium Active CN110275778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910517559.4A CN110275778B (en) 2019-06-14 2019-06-14 Online program running method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910517559.4A CN110275778B (en) 2019-06-14 2019-06-14 Online program running method and device, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN110275778A CN110275778A (en) 2019-09-24
CN110275778B true CN110275778B (en) 2021-07-27

Family

ID=67962225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910517559.4A Active CN110275778B (en) 2019-06-14 2019-06-14 Online program running method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN110275778B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427551A (en) * 2020-02-14 2020-07-17 深圳市商汤科技有限公司 User code operation method of programming platform, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968750A (en) * 2010-10-15 2011-02-09 珠海举天软件科技有限公司 Computer system and working method thereof
CN103491151A (en) * 2013-09-13 2014-01-01 中安消技术有限公司 Method and device for dispatching cloud computing resources and cloud computing platform
CN105607896A (en) * 2015-09-25 2016-05-25 中国铁路总公司 Application program development method and system
CN105988874A (en) * 2015-02-10 2016-10-05 阿里巴巴集团控股有限公司 Resource processing method and device
CN107977268A (en) * 2017-10-13 2018-05-01 北京百度网讯科技有限公司 Method for scheduling task, device and the computer-readable recording medium of the isomerization hardware of artificial intelligence
CN109783256A (en) * 2019-01-10 2019-05-21 上海商汤智能科技有限公司 Artificial intelligence tutoring system and method, electronic equipment, storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE517815C2 (en) * 2000-10-27 2002-07-16 Terraplay Systems Ab Configuration of a flexible infrastructure
US20160314408A1 (en) * 2015-04-21 2016-10-27 Microsoft Technology Licensing, Llc Leveraging learned programs for data manipulation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101968750A (en) * 2010-10-15 2011-02-09 珠海举天软件科技有限公司 Computer system and working method thereof
CN103491151A (en) * 2013-09-13 2014-01-01 中安消技术有限公司 Method and device for dispatching cloud computing resources and cloud computing platform
CN105988874A (en) * 2015-02-10 2016-10-05 阿里巴巴集团控股有限公司 Resource processing method and device
CN105607896A (en) * 2015-09-25 2016-05-25 中国铁路总公司 Application program development method and system
CN107977268A (en) * 2017-10-13 2018-05-01 北京百度网讯科技有限公司 Method for scheduling task, device and the computer-readable recording medium of the isomerization hardware of artificial intelligence
CN109783256A (en) * 2019-01-10 2019-05-21 上海商汤智能科技有限公司 Artificial intelligence tutoring system and method, electronic equipment, storage medium

Also Published As

Publication number Publication date
CN110275778A (en) 2019-09-24

Similar Documents

Publication Publication Date Title
US11762697B2 (en) Method and apparatus for scheduling resource for deep learning framework
JP7112919B2 (en) Smart device task processing method and device
US8434085B2 (en) Scalable scheduling of tasks in heterogeneous systems
CN106095572B (en) distributed scheduling system and method for big data processing
WO2020258290A1 (en) Log data collection method, log data collection apparatus, storage medium and log data collection system
CN109729106B (en) Method, system and computer program product for processing computing tasks
WO2017166643A1 (en) Method and device for quantifying task resources
US11311722B2 (en) Cross-platform workload processing
CN112148468B (en) Resource scheduling method and device, electronic equipment and storage medium
CN108256118A (en) Data processing method, device, system, computing device and storage medium
CN111666147B (en) Resource scheduling method, equipment, system and central server
WO2021159831A1 (en) Programming platform user code running method, platform, node, device and medium
CN111679911A (en) Management method, device, equipment and medium for GPU (graphics processing Unit) card in cloud environment
CN115292014A (en) Image rendering method and device and server
CN110275778B (en) Online program running method and device, electronic equipment and computer storage medium
CN114629960B (en) Resource scheduling method, device, system, equipment, medium and program product
CN107342929B (en) Method, device and system for sending new message notification
CA2631255A1 (en) Scalable scheduling of tasks in heterogeneous systems
CN110716809B (en) Method and device for scheduling cloud resources
CN110515749B (en) Method, device, server and storage medium for queue scheduling of information transmission
CN111026532B (en) Message queue management method for voice data
US20150249625A1 (en) Using analytics to optimize performance of a messaging system via topic migration to alternate delivery methods
CN116166421A (en) Resource scheduling method and equipment for distributed training task
CN113099247B (en) Virtual resource processing method, device, server, storage medium and program product
CN111756648B (en) Flow congestion control method, device, equipment and medium

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