CN115098222A - Script execution method, device and equipment - Google Patents

Script execution method, device and equipment Download PDF

Info

Publication number
CN115098222A
CN115098222A CN202210713083.3A CN202210713083A CN115098222A CN 115098222 A CN115098222 A CN 115098222A CN 202210713083 A CN202210713083 A CN 202210713083A CN 115098222 A CN115098222 A CN 115098222A
Authority
CN
China
Prior art keywords
kernel
script
request
executed
execution
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.)
Pending
Application number
CN202210713083.3A
Other languages
Chinese (zh)
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202210713083.3A priority Critical patent/CN115098222A/en
Publication of CN115098222A publication Critical patent/CN115098222A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the specification discloses a script execution method, a script execution device and equipment. Obtaining a request to be executed; determining a kernel corresponding to the request to be executed, wherein the kernel is created in advance in a container with a unique container address; acquiring a script code corresponding to the request to be executed; and executing the script codes in the kernel to generate an execution result. Therefore, the front-end user can directly call and execute the script, and the execution environments of the scripts are not influenced and blocked in the execution process.

Description

Script execution method, device and equipment
Technical Field
The present specification relates to the field of internet technologies, and in particular, to a method, an apparatus, and a device for executing a script.
Background
In practical applications, the user at the front end often needs to execute various scripts. And the current execution environment is often used for execution, so that the problem of information leakage exists, and the context cannot be guaranteed. Once an exception occurs, the entire execution environment will crash, thereby affecting the use experience of all users.
Based on this, a more secure and reliable script execution scheme is required.
Disclosure of Invention
One or more embodiments of the present specification provide a method, an apparatus, a device, and a storage medium for executing a script, so as to solve the following technical problems: a more secure and reliable script execution scheme.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in a first aspect, an embodiment of the present specification provides a method for executing a script, including: acquiring a request to be executed;
determining a kernel corresponding to the request to be executed, wherein the kernel is created in advance to have a unique container address
In the container of (1); acquiring a script code corresponding to the request to be executed; and executing the script codes in the kernel to generate an execution result.
In a second aspect, an apparatus for executing a script provided in an embodiment of the present specification includes: request acquisition Module, get
Fetching a request to be executed; the determining module is used for determining a kernel corresponding to the request to be executed, wherein the kernel is created in advance in a container with a unique container address; the code acquisition module is used for acquiring script codes corresponding to the request to be executed; and the execution module executes the script codes in the kernel to generate an execution result.
In a third aspect, embodiments of the present specification provide an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
In a fourth aspect, embodiments of the present specification provide a non-volatile computer storage medium having stored thereon computer-executable instructions that, when read by a computer, cause the one or more processors to perform the method of the first aspect.
At least one technical scheme adopted by one or more embodiments of the specification can achieve the following beneficial effects: obtaining a request to be executed; determining a kernel corresponding to the request to be executed, wherein the kernel is pre-created in a container with a unique container address; acquiring a script code corresponding to the request to be executed; and executing the script codes in the kernel to generate an execution result. Therefore, the direct calling and the execution of the scripts by the front-end user are realized, the mutual influence and blockage among the execution environments of the scripts are avoided in the execution process, and the context of the script operation can be stored, so that the safer and more reliable script execution is realized.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is an architectural diagram of the manner in which scripts are executed as is involved in the present environment;
FIG. 2 is a flowchart illustrating a script execution method according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a script execution system according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of a system according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an execution apparatus of a script according to an embodiment of the present specification;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
The embodiment of the specification provides a script execution method, a script execution device and a storage medium
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
The traditional script call execution needs a back end to maintain a common call resource, and the front end requests the back end to initiate code execution through a hypertext Transfer Protocol (HTTP) interface. As shown in fig. 1, fig. 1 is a schematic diagram of an architecture of a script execution mode currently involved. In this implementation, the implementation based on the HTTP interface itself increases the complexity of the link and the request response time, and the user interaction experience is greatly reduced.
In terms of invoking resources, the control of resources itself has a high cost. The problem of information leakage exists when the resource is called for public use, and the context cannot be guaranteed. And once an exception occurs, the whole environment can be rushed to influence the use experience of all users. Based on this, the embodiment of the present specification provides a more secure and reliable script execution scheme.
In a first aspect, as shown in fig. 2, fig. 2 is a flowchart of a script execution method provided in an embodiment of this specification, and includes the following steps:
s201: and acquiring a request to be executed.
The request to be executed is sent by the user and used for calling the back end to execute the corresponding script code. When there are multiple to-be-called requests, the back end may group the to-be-called requests into a corresponding sequence and execute the sequence sequentially.
S203, determining the kernel corresponding to the request to be executed.
In the embodiments of the present specification, a Kernel (Kernel) refers to an execution environment that contains a context (context). The kernels are created in advance based on the requests of the users, and the kernels created by the users are isolated from each other. The same user may create multiple different kernels to perform different trials.
For example, user 1 may create kernel a and kernel B simultaneously, where kernel a is used to execute various types of scripts included in test a that user 1 wants to implement, and kernel B is used to execute various types of scripts in test B that user 1 wants to implement. Kernel A is independent of Kernel B, and Kernel A, B is independent of Kernel C created by user 2. Independent means that the execution environment and context of each core do not affect each other.
As shown in fig. 3, fig. 3 is a schematic diagram of a framework of a script execution system according to an embodiment of the present disclosure. In this schematic view. Each user can be linked with each Kernel independently established by the user, when the link is established, the front end is directly connected and communicated with the Kernel through a Kernel Connector (Kernel Connector), the delay of the link is influenced by the size of a network and a request body, and the delay can be basically ignored under ideal conditions.
The execution environment refers to a mechanism which is relied on by the script code during running and is used for completing the processing of the script in the aspects of scope, life cycle and the like during running. The execution environment defines whether a variable or a function has the right to access other data, and then determines the respective behavior. The execution environment may include a global execution environment, a function execution environment, and so on. Under different execution environments, the same script code may have different output results after being executed.
The context means that before the script code is executed, the script code is prepared to create a corresponding text environment for the execution of the script code, and the text environment records all variable names, function names, class names and the like. The context itself is also part of the execution environment, and the execution of any script code is context dependent, but can be changed.
For example, as shown in fig. 3, a user 1 can sequentially execute a script 1 and a script 2 in a kernel a through a front end 1, wherein the execution of the script 1 depends on the context in the initial execution environment, but after the execution of the script 1, the context in the kernel a is changed and stored therein, and the execution of the script 2 depends on the changed context. Each individual context has its own corresponding Kernel, thereby achieving isolation between environments to avoid information leakage.
As indicated previously, each user has its own corresponding kernel. If not, the one or more kernels corresponding to the user can be initialized in advance based on the request of the user. Namely, the back end can receive a kernel creating request of a user; allocating a container address according to the kernel creating request, and creating a container corresponding to the container address; and creating a kernel corresponding to the kernel creating request in the container.
For example, when a user communicates with the backend through the visual interface at the front end, the user initiates a script execution request to the backend through the kernel connector, and the backend discovers that the user does not have a corresponding kernel. A request may be initiated to the corresponding Container Manager (Container Manager) which pulls a Container in the K8S cluster and assigns the Container a unique Container address.
Thus, under the container, a corresponding kernel or kernels can be created for the user, and a corresponding path can be allocated under the container address for each kernel.
When the user creates only one kernel, the kernel can be determined as the kernel corresponding to the request to be executed.
When a user creates multiple kernels, it means that the types of script codes executed by the user may be multiple, and different execution environments have an influence on the output result, and the kernels need to be distinguished.
In an embodiment, in order to facilitate the user to distinguish the cores created by the user, a core identifier may be added to each core. For example, when a user creates a kernel, the user is reminded that the kernel identifier can be customized, and the kernel identifier is used for representing the script type identifier corresponding to the kernel, so that when the kernel is created in a container, the corresponding relationship between the script type identifier and the kernel identifier can be established and stored.
As shown in fig. 3, when the user 1 creates the kernel B, a corresponding kernel identifier "kernel B" may be added to the kernel B, so as to establish a correspondence relationship between the kernel B and the test B and store the correspondence relationship with the back end. And based on the needs of the user, the corresponding relation can be visually displayed, edited, added, deleted and the like.
Further, when the kernel corresponding to the request to be executed is determined, the script type identifier in the request to be executed can be obtained, and the kernel identifier is determined according to the pre-established corresponding relation; and determining the kernel corresponding to the request to be executed according to the kernel identification.
For example, when the user 1 wants to execute a script related to the test B, the corresponding script type identifier "test B" may be added to the script execution request, and the back end may determine the kernel B as the kernel corresponding to the request to be executed based on the pre-created correspondence relationship between the script type identifier and the kernel identifier (test B, kernel B).
S205, acquiring the script code corresponding to the request to be executed.
The script code may be pre-edited and stored in a designated directory. The back end can obtain the script code corresponding to the request to be executed only by giving the corresponding directory or the corresponding name of the script code.
The script code may be code encoded in various languages, such as python script code, or js (javascript) script code, for example.
In one embodiment, there may be multiple script codes that the user wants to execute. For example, a corresponding execution of a plurality of to-be-executed codes is requested in one to-be-executed request. Then, the back end may obtain a plurality of codes to be executed, and form a script code sequence from the plurality of script codes. The sorting mode can be specified by the user in the execution request, or the sorting mode can be sequentially arranged based on the sequence in the execution request.
For example, in the execution request, the user may specify that script 1 is executed first, and then script 2 is executed; alternatively, if the user does not specify the execution order, but the script 1 is arranged before the script 2 in the execution request, the script 1 and the script 2 may be arranged in order to generate the script code sequence.
S207, the script codes are executed in the kernel, and an execution result is generated.
When a script code sequence composed of a plurality of script codes is obtained, the script code sequence can be sequentially executed in the kernel. For example, the script code at the top of the script code sequence is executed in sequence. And updating the context of the kernel after the execution is finished, and saving the context. The method can avoid the blocking caused by the simultaneous execution of a plurality of scripts by the kernel by sequentially executing the script code sequences.
In practical applications, a Code executor (Code Runner) for calling and executing script codes can be created. The specific execution of the script Code is responsible for the Code Runner module. In particular, it may format the code execution request specifically into raw script code and initiate execution in the kernel, thereby generating execution results.
In one embodiment, Code Runner may also format the execution result and return the formatted execution result to the front end. The execution result after formatting may be classification of the execution flow, statistics of the result, and so on. For example, classifying the execution flow may include such things as "correct execution", "no error report", "error report point", etc. The corresponding statistics on the generated results may be: the front end can perform corresponding strategy adjustment, condition modification, visual display and the like on the execution result after formatting according to the number, proportion, total amount, statistical error and the like of the covered crowd.
Obtaining a request to be executed; determining a kernel corresponding to the request to be executed, wherein the kernel is pre-created in a container with a unique container address; acquiring a script code corresponding to the request to be executed; and executing the script codes in the kernel to generate an execution result. Therefore, the direct calling and the execution of the scripts by the front-end user are realized, the mutual influence and blockage among the execution environments of the scripts are avoided in the execution process, and the context of the script operation can be stored, so that the safer and more reliable script execution is realized.
In one embodiment, the front end may also visually display the kernel created by the user in a visual manner. For example, the front end displays each kernel in the front end interface in the form of an icon, and displays the name, the kernel identifier, and the like of each kernel. The user script can also be displayed in the front-end interface in a visual text form, and at the moment, the user can move the script to the corresponding kernel for execution in modes of dragging, selecting and the like, so that the execution result is directly generated.
In this manner, to avoid user inaction, custom naming operation functionality for each kernel may also be provided. Namely receiving the naming request of the user, and modifying the name of the kernel according to the naming request so as to simultaneously display the modified name of the kernel when the kernel is displayed at the front end. For example, the user 1 selects the kernel a, performs operations such as double-click and right-click on the kernel a, and initiates a custom naming request including the modified name "interactive policy test", so that the back end can modify the name of the kernel a according to the request, i.e., "interactive policy test", and display the modified name in the front-end interface of the user 1 in an ice manner, so that the user 1 performs related script execution to avoid misoperation.
The script code may not modify the context when executed in the kernel. However, in one embodiment, if a context modification situation arises, then execution needs to be performed based on the modified context. Based on this, when the script code is executed in the kernel, the context of the kernel can be obtained in advance, and the script code is executed according to the context to generate an execution result; correspondingly, the context of the kernel is modified according to the execution result and is stored, so that the subsequent script can be executed depending on the changed context.
For example, executing script code may modify the context of the kernel when: when the codes are entered or called in the script code, the values of related variables in the kernel can be changed, namely the context of the kernel is changed, and the context of the kernel needs to be modified according to an execution result and stored. So that subsequent script code executes based on the modified context. Therefore, the context in the same kernel can be saved, and the contexts in different kernels are isolated from each other.
In order to make the solution of the present application more clear and understandable, an example of a specific real-time scenario is given below as an illustration.
In the data visualization scenario of interactive policy recommendation algorithms, front-end business personnel often need to perform tasks such as machine learning, testing, and data visualization by executing scripts written in various languages (e.g., python scripts). For example, for a front-end user performing an interactive policy recommendation algorithm, the front-end user may implement the following three types of scripts: strategy selection scripts, condition replacement scripts and result visualization scripts. Therefore, various strategies can be tested on the target group conveniently, and a better recommendation strategy for the target group can be obtained.
The strategy selection script is used for selecting different types of strategies, the condition replacement script is used for replacing relevant conditions in the selected strategies, and the selected target is visually displayed by the result visualization script.
And, for the same front-end user, it may also need to develop interactive strategies under multiple different tasks simultaneously. For example, it may be desirable to develop both a path recommendation policy and a multimedia recommendation policy. In other words, the front-end user requires multiple kernels to handle different policy development tasks.
Based on such situations, the embodiment of the present disclosure provides a system architecture as follows, as shown in fig. 4, and fig. 4 is a schematic diagram of an architecture of a system provided by the embodiment of the present disclosure. It includes a front-end and a back-end, where the back-end provides Web services and K8s cluster services. Based on the K8S cluster-based scheduling, the problem of container resource allocation can be solved conveniently.
Under the system architecture, a front-end user can keep connected with the kernel through the kernel connector. If the kernel exists, the front-end user can directly communicate with the kernel.
When no kernel exists, namely when kernel initialization is needed, a user can initiate a kernel creation request to a Container manager in a web service at the back end through a kernel connector, the Container manager informs the kernel connector of a unique Container address after pulling up a jupyter Server connector in a K8S cluster, and the kernel connector performs corresponding address maintenance. The Jupyter Server Container is the Container containing the Jupyter Server image pulled up in K8S.
The kernel connector then creates the corresponding kernel in the jupyter Server Container according to the current context (i.e., the context required at script initialization, which may be specified by the user or obtained based on the script default requirements). The created kernel has a corresponding path under the container address.
And when the user also wants to create another kernel, then a corresponding another kernel can be created in the initialized jupyter Server Container, and a corresponding another path is allocated to the another kernel.
After the kernel is created, the kernel connector can be connected with the kernel, the script codes which are interactively related with the user are maintained by the front end and called, the script codes which are needed to be called by the user form a sequence, and the script codes are called in sequence in a queue mode to prevent the kernel from being blocked. The specific execution of the script code is handled by the code executer. The Code Runner will process the request submitted by the Task Manager, format the request into the original Python Code and then initiate execution in Kernel, and at the same time format the execution result of the Python Code for consumption by the front end.
Suppose that the front-end user needs to debug the multimedia recommendation policy in this process, and has selected a script related to the kernel for executing the multimedia recommendation policy, specifically including a policy selection script, a condition replacement script, and a result visualization script.
The front-end user can firstly execute the strategy selection script in the process, so that the context in the execution environment is changed after the execution, the condition change script can be executed again based on the changed context to obtain the combination of a certain strategy under different conditions, the context is changed again when the condition is changed, and the result visualization script can be executed again by the user based on the context which is changed again, so that the visualized execution result is obtained.
It can be seen that in the foregoing process, each time the script is executed, the context in the execution environment of the kernel may be changed, and the kernel is the same debugging task for the corresponding user and is isolated from other kernels. Therefore, a user can conveniently obtain various strategies, change conditions and display results in the same kernel without being influenced by other scripts, so that the problem of resource management is solved, and the execution environments of the scripts are not influenced and blocked mutually, which is impossible to realize in the architecture shown in fig. 1. And as long as the user needs, the user can preset a plurality of kernels to deal with different actual execution environments, the executable script codes are unlimited, and the front end can realize any script function which is required to be realized through the architecture.
Based on the same idea, one or more embodiments of the present specification further provide apparatuses and devices corresponding to the above-described method, as shown in fig. 5 and fig. 6.
In a second aspect, as shown in fig. 5, fig. 5 is a schematic structural diagram of an apparatus for executing a script according to an embodiment of the present specification, where the apparatus includes:
an obtaining module 501, configured to obtain a request to be executed;
a determining module 503, configured to determine a kernel corresponding to the request to be executed, where the kernel is created in advance in a container having a unique container address;
a code obtaining module 505, configured to obtain a script code corresponding to the request to be executed;
the execution module 507 executes the script code in the kernel to generate an execution result.
Optionally, the apparatus further includes a kernel establishing module 509, which receives a kernel creating request of a user; allocating a container address according to the kernel creating request, and creating a container corresponding to the container address; and creating a kernel corresponding to the kernel creating request in the container.
Optionally, the kernel establishing module 509 determines a script type identifier corresponding to the kernel creating request; determining a kernel identifier corresponding to the kernel; and creating the kernel in the container, and creating and storing the corresponding relation between the script type identifier and the kernel identifier.
Optionally, the determining module 503 obtains a script type identifier in the request to be executed, and determines a kernel identifier according to the pre-established correspondence; and determining the kernel corresponding to the request to be executed according to the kernel identifier.
Optionally, the apparatus further includes a renaming module 511, configured to receive a naming request of the user, modify the name of the kernel according to the naming request, so as to simultaneously display the modified name of the kernel when the kernel is displayed at the front end.
Optionally, the apparatus further includes a formatting module 513, configured to format the execution result, and return the formatted execution result to the front end.
Optionally, the execution module 509 obtains the context of the kernel, and executes the script code according to the context to generate an execution result; accordingly, the method further includes a save module 515: and modifying the context of the kernel according to the execution result and storing the context.
Optionally, when there are multiple script codes, the code obtaining module 505 composes the multiple script codes into a script code sequence; accordingly, the execution module 509 executes the script code sequence in the kernel sequentially.
In a third aspect, as shown in fig. 6, fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of this specification, where the electronic device includes:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
In a fourth aspect, based on the same idea, the present specification further provides a non-volatile computer storage medium corresponding to the method described above, and storing computer-executable instructions, which, when read by a computer, cause one or more processors to execute the method according to the first aspect.
In the 90's of the 20 th century, improvements to a technology could clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements to process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: the ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be regarded as a hardware component and the means for performing the various functions included therein may also be regarded as structures within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, apparatuses, modules or units described in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and non-volatile computer storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to the partial description of the method embodiments for relevant points.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is merely one or more embodiments of the present disclosure and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments of the present description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method of executing a script, comprising:
acquiring a request to be executed;
determining a kernel corresponding to the request to be executed, wherein the kernel is created in advance in a container with a unique container address;
acquiring a script code corresponding to the request to be executed;
and executing the script codes in the kernel to generate an execution result.
2. The method of claim 1, wherein the kernel is pre-established based on:
receiving a kernel creating request of a user;
allocating a container address according to the kernel creating request, and creating a container corresponding to the container address;
and creating a kernel corresponding to the kernel creating request in the container.
3. The method of claim 2, wherein creating the kernel in the container corresponding to the kernel creation request comprises:
determining a script type identifier corresponding to the kernel creating request;
determining a kernel identifier corresponding to the kernel;
and creating the kernel in the container, and creating and storing the corresponding relation between the script type identifier and the kernel identifier.
4. The method of claim 3, wherein determining the kernel to which the request to be executed corresponds comprises:
acquiring a script type identifier in the request to be executed, and determining a kernel identifier according to the pre-established corresponding relation;
and determining the kernel corresponding to the request to be executed according to the kernel identification.
5. The method of claim 2, wherein the method further comprises:
and receiving a naming request of the user, and modifying the name of the kernel according to the naming request so as to simultaneously display the modified name of the kernel when the kernel is displayed at the front end.
6. The method of claim 1, wherein the method further comprises:
and formatting the execution result, and returning the formatted execution result to the front end.
7. The method of claim 1, wherein executing the script code in the kernel comprises:
acquiring the context of the kernel, executing the script code according to the context, and generating an execution result;
correspondingly, the method further comprises the following steps: and modifying the context of the kernel according to the execution result and storing the context.
8. The method of claim 1, wherein when a plurality of script codes exist, acquiring the script code corresponding to the request to be executed comprises:
composing the plurality of script codes into a script code sequence;
correspondingly, the script code is executed in the kernel, and the script code comprises: sequentially executing the script code sequence in the kernel.
9. An apparatus for executing a script, comprising:
the request acquisition module is used for acquiring a request to be executed;
the determining module is used for determining a kernel corresponding to the request to be executed, wherein the kernel is created in advance in a container with a unique container address;
the code acquisition module is used for acquiring script codes corresponding to the request to be executed;
and the execution module executes the script codes in the kernel to generate an execution result.
10. An electronic device, comprising:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.
CN202210713083.3A 2022-06-22 2022-06-22 Script execution method, device and equipment Pending CN115098222A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210713083.3A CN115098222A (en) 2022-06-22 2022-06-22 Script execution method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210713083.3A CN115098222A (en) 2022-06-22 2022-06-22 Script execution method, device and equipment

Publications (1)

Publication Number Publication Date
CN115098222A true CN115098222A (en) 2022-09-23

Family

ID=83292901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210713083.3A Pending CN115098222A (en) 2022-06-22 2022-06-22 Script execution method, device and equipment

Country Status (1)

Country Link
CN (1) CN115098222A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229480A (en) * 2017-06-19 2017-10-03 郑州云海信息技术有限公司 A kind of desktop application construction method and device based on web technology
US9785489B1 (en) * 2014-12-18 2017-10-10 Amazon Technologies, Inc. Secure script execution using sandboxed environments
US20170344731A1 (en) * 2016-05-26 2017-11-30 Microsoft Technology Licensing, Llc Self-described security model for resource access
CN111162941A (en) * 2019-12-26 2020-05-15 浪潮云信息技术有限公司 Method for automatically managing virtual IP (Internet protocol) in Kubernetes environment
US10747875B1 (en) * 2020-03-19 2020-08-18 Cyberark Software Ltd. Customizing operating system kernels with secure kernel modules
CN111679965A (en) * 2020-04-23 2020-09-18 平安国际智慧城市科技股份有限公司 Automatic testing method and device, computer equipment and storage medium
US20210011740A1 (en) * 2019-07-12 2021-01-14 National University of Defense Technology, People's Liberation Army of China Method and system for constructing lightweight container-based user environment (cue), and medium
CN113986257A (en) * 2021-11-12 2022-01-28 航天信息股份有限公司 Cloud platform front-end management interface deployment method and device and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9785489B1 (en) * 2014-12-18 2017-10-10 Amazon Technologies, Inc. Secure script execution using sandboxed environments
US20170344731A1 (en) * 2016-05-26 2017-11-30 Microsoft Technology Licensing, Llc Self-described security model for resource access
CN107229480A (en) * 2017-06-19 2017-10-03 郑州云海信息技术有限公司 A kind of desktop application construction method and device based on web technology
US20210011740A1 (en) * 2019-07-12 2021-01-14 National University of Defense Technology, People's Liberation Army of China Method and system for constructing lightweight container-based user environment (cue), and medium
CN111162941A (en) * 2019-12-26 2020-05-15 浪潮云信息技术有限公司 Method for automatically managing virtual IP (Internet protocol) in Kubernetes environment
US10747875B1 (en) * 2020-03-19 2020-08-18 Cyberark Software Ltd. Customizing operating system kernels with secure kernel modules
CN111679965A (en) * 2020-04-23 2020-09-18 平安国际智慧城市科技股份有限公司 Automatic testing method and device, computer equipment and storage medium
CN113986257A (en) * 2021-11-12 2022-01-28 航天信息股份有限公司 Cloud platform front-end management interface deployment method and device and storage medium

Similar Documents

Publication Publication Date Title
CN111078315B (en) Microservice arranging and executing method and system, architecture, equipment and storage medium
US20210294617A1 (en) Systems and methods for adaptive user interfaces
CN110532020B (en) Data processing method, device and system for micro-service arrangement
CN111967849A (en) Task processing flow arrangement method and device and electronic equipment
CN109947643B (en) A/B test-based experimental scheme configuration method, device and equipment
CN107203465B (en) System interface testing method and device
CN108549562A (en) A kind of method and device of image load
US20080005752A1 (en) Methods, systems, and computer program products for generating application processes by linking applications
US10908948B2 (en) Multiple application instances in operating systems that utilize a single process for application execution
CN114064024A (en) Method, apparatus, device, storage medium, and program product for developing micro-application
US7096475B2 (en) Runlets as application execution units
CN109902003B (en) Test script generation method and device
CN113434063B (en) Information display method, device and equipment
US9141353B2 (en) Dynamically building locale objects at run-time
US20070073635A1 (en) Table rows filter
CN104778087B (en) A kind of information processing method and information processing unit
CN115098222A (en) Script execution method, device and equipment
US8276165B2 (en) Continuation-based runtime callback invocation
CN113485686B (en) Information system program generation method and device, electronic equipment and storage medium
US20180210717A1 (en) Time Integrated Development and Modification System
CN113590660A (en) Data self-service query method and device and electronic equipment
CN113326079A (en) Service version switching method, switching device, electronic equipment and storage medium
US20140282128A1 (en) System and Method for a User Interface Controller for Mandatory and Shared User Interface Functions
CN115391185A (en) Applet pressure testing method, device and equipment
CN117573359B (en) Heterogeneous cluster-based computing framework management system and method

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