Script execution methods, devices, electronic devices and storage media

By generating and storing intermediate forms from pre-compiled script code, and executing them directly to avoid repeated compilation, the problem of script execution delay in application integration platforms is solved, achieving a balance between performance and resources. This approach is suitable for complex process orchestration and high-frequency task processing.

CN122086523APending Publication Date: 2026-05-26CISDI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610167954.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-05
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

The application integration platform needs to compile each time a script is executed, which results in a large response delay and high compilation overhead in large scripts or high-concurrency scenarios.

Method used

An intermediate form is generated by pre-compiling script code and stored in association with script identifiers and version information. The intermediate form is executed directly to avoid repeated compilation. A plug-in architecture is used for multi-type and multi-version management and supports on-demand loading.

Benefits of technology

It reduces script processing time, minimizes resource consumption, and improves script execution efficiency. It is suitable for complex process orchestration and high-frequency task processing scenarios, and meets users' personalized needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122086523A_ABST
    Figure CN122086523A_ABST
Patent Text Reader

Abstract

This invention provides a script execution method, apparatus, electronic device, and storage medium. The method includes acquiring script execution request information, which includes a script execution request, a target script identifier, and target version information. Based on the target script identifier and target version information, a target script intermediate form is determined from multiple preset script intermediate forms. The preset script intermediate form is obtained by pre-compiling the script code. The target script intermediate form is then executed to obtain an execution result. By pre-compiling the script code, the script code intermediate form is directly executed when responding to the script execution request, thereby avoiding repeated compilation each time the script is executed. This compilation-execution separation architecture can achieve a balance between performance and resources, reducing script processing time and the resource consumption of script execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of script management technology, and in particular to a script execution method, apparatus, electronic device, and storage medium. Background Technology

[0002] An application integration platform is a middleware technology framework used to connect, coordinate, and manage different software applications, systems, or services. To achieve seamless interaction and sharing of data, processes, and functions, the application integration platform needs to handle application and data connections from different environments such as cloud, local, and edge. Scripts are the core means of implementing integration logic such as data transformation and custom business logic.

[0003] However, the application integration platform needs to compile the script every time it is executed. For large scripts or high-concurrency scenarios, the compilation overhead is large and can easily lead to response delays. Summary of the Invention

[0004] This invention provides a script execution method, apparatus, electronic device, and storage medium to solve the technical problem that application integration platforms need to compile scripts every time they execute, which results in high compilation overhead and response delays when dealing with large scripts or high-concurrency scenarios.

[0005] The present invention provides a script execution method, the method comprising: acquiring script execution request information, the script execution request information including a script execution request, a target script identifier, and target version information; determining a target script intermediate form from a plurality of preset script intermediate forms according to the target script identifier and the target version information, wherein the preset script intermediate form is obtained by pre-compiling the script code; and executing the target script intermediate form to obtain an execution result.

[0006] In one embodiment of the present invention, before determining the target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information, the method includes: obtaining the script code and the metadata of the script code, the metadata including a script language type identifier, a script identifier, and a version number; determining a target script language processing plugin based on the script language type identifier and a preset routing mapping table between script languages ​​and script language processing plugins, and pre-compiling the script code through the target script language processing plugin to obtain an intermediate form corresponding to the script code, which serves as an initial script intermediate form; generating a composite key based on the script identifier and the version number, and associating the composite key with the initial script intermediate form to obtain the preset script intermediate form.

[0007] In one embodiment of the present invention, pre-compiling the script code using the target script language processing plugin includes: determining a corresponding pre-compilation method based on the script language type identifier; verifying the script code according to the pre-compilation method, wherein the pre-compilation method includes at least one type of verification such as syntax verification, blacklist verification, and operation permission verification; and, if the verification passes, converting the script code into a corresponding intermediate form using a compiler, wherein the intermediate form includes at least one of bytecode, instruction set, abstract syntax tree, and executable statement object.

[0008] In one embodiment of the present invention, before determining the target script language processing plugin based on the script language type identifier and a preset routing mapping table of script languages ​​and script language processing plugins, the method includes: responding to a timed event, querying the script language processing plugin library to obtain the script language processing plugin and the script languages ​​supported by the script language processing plugin; registering the script language processing plugin and associating the script language processing plugin with the script languages ​​to generate the routing mapping table.

[0009] In one embodiment of the present invention, the target version information includes a target version number. Determining a target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information includes: generating a target composite key based on the target script identifier and the target version number; matching the target composite key with the composite keys associated with each preset script intermediate form, and taking the preset script intermediate form associated with the successfully matched composite key as the target script intermediate form.

[0010] In one embodiment of the present invention, the target version information includes a target version status tag. Determining a target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information includes: querying a version number from a version control database that corresponds to both the target version status tag and the target script identifier, and using this version number as the target version number. The version control database stores the script identifier, version number, and version status tag for each script code, and there is a correspondence between the script identifier, the version number, and the version status tag. The version status tag indicates the stage of the script code in its lifecycle. A target composite key is generated based on the target script identifier and the target version number. The target composite key is matched with the composite keys associated with each preset script intermediate form, and the preset script intermediate form associated with the successfully matched composite key is used as the target script intermediate form.

[0011] In one embodiment of the present invention, executing the intermediate form of the target script to obtain an execution result includes: creating a subtask, executing the intermediate form of the target script through the subtask; monitoring the execution time of the subtask, and controlling the subtask to stop execution when the execution time reaches a preset threshold, thereby obtaining the execution result.

[0012] The present invention also provides a script execution device, the device comprising: a data receiving module for acquiring script execution request information, the script execution request information including a script execution request, a target script identifier, and target version information; an information processing module for determining a target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information, wherein the preset script intermediate form is obtained by compiling script code; and an execution module for executing the target script intermediate form to obtain an execution result.

[0013] The present invention also provides an electronic device, the electronic device comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the script execution method as described above.

[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer processor, causes the computer to execute the script execution method described above.

[0015] The beneficial effects of this invention are as follows: This invention proposes a script execution method, apparatus, electronic device, and storage medium. This method pre-compiles the script code and directly executes the intermediate form of the script code when responding to a script execution request, thereby avoiding repeated compilation each time the script is executed. This compilation-execution separation architecture achieves a balance between performance and resources, reducing script processing time and resource consumption during script execution. It is particularly suitable for scenarios involving complex process orchestration and high-frequency task processing in application integration platforms. Furthermore, through parallel management of multiple types and versions of pre-set script intermediate forms, on-demand loading can be achieved to meet users' personalized needs. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0017] In the attached diagram:

[0018] Figure 1 This is a schematic diagram illustrating the implementation environment of a script execution method according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating a script execution method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the script execution flow provided in a specific embodiment of the present invention; Figure 4 A schematic diagram of the script execution flow provided for another specific embodiment of the present invention; Figure 5 This is a block diagram of a script execution device provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a script execution system provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0020] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. The drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0021] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0022] The embodiments of the present invention provide a script execution method, a script execution device, an electronic device, a computer-readable storage medium, and a computer program product, which will be described in detail below.

[0023] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of a script execution method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the implementation environment may include a request sender 110 and an application integration platform 120. The request sender 110 may be an upstream business system, a user terminal, a scheduled task, an event-driven source, etc., without limitation. The request sender 110 can send script execution request information to the application integration platform 120, so that the application integration platform 120 executes the intermediate form of the target script according to the script execution request information.

[0024] Indicatively, the application integration platform 120 obtains script execution request information, which includes the script execution request, target script identifier, and target version information. Based on the target script identifier and target version information, it determines the target script intermediate form from multiple preset script intermediate forms, wherein the preset script intermediate form is obtained by pre-compiling the script code. The target script intermediate form is then executed to obtain the execution result. As can be seen, the technical solution of this embodiment of the invention, by pre-compiling the script code, directly executes the script code intermediate form when responding to the script execution request, thereby avoiding repeated compilation each time the script is executed. This compilation-execution separation architecture can achieve a balance between performance and resources, reducing script processing time and the resource consumption of script execution, and is particularly suitable for scenarios involving complex process orchestration and high-frequency task processing in application integration platforms. Furthermore, through the parallel management of multiple types and versions of preset script intermediate forms, on-demand loading can be achieved to meet users' personalized needs.

[0025] It should be noted that the script execution method provided in this embodiment of the invention can be specifically executed by the application integration platform 120, and correspondingly, the script execution device can be set in the application integration platform 120.

[0026] Please see Figure 2 , Figure 2 This is a flowchart illustrating a script execution method according to an embodiment of the present invention. This script execution method can be applied to... Figure 1 The implementation environment shown is specifically executed by the application integration platform 120 within that implementation environment. It should be understood that this script execution method can also be applied to other exemplary implementation environments and executed by devices in other implementation environments; this embodiment does not limit the implementation environment to which this script execution method is applicable. Figure 2 As shown, in an exemplary embodiment, the script execution method includes at least steps S210 to S230, which are described in detail below: Step S210: Obtain script execution request information.

[0027] Step S220: Determine the target script intermediate form from multiple preset script intermediate forms based on the target script identifier and target version information in the script execution request information.

[0028] Step S230: Execute the intermediate form of the target script to obtain the execution result.

[0029] In step S210, the script execution request information includes a script execution request, a target script identifier, and target version information. The target script identifier refers to the identification information of the script code to be executed, and the target version information refers to the version information of the script code to be executed, which can be a version number or a version status label. The version status label indicates the stage of the script code in its lifecycle.

[0030] In step S220, the preset intermediate form of the script is obtained by pre-compiling the script code. Each script code can be pre-compiled to obtain a corresponding intermediate form, and this intermediate form is associated with the script identifier and version information corresponding to that script code to form a preset intermediate form, which is then stored in a local cache. Upon receiving a script execution request, the target script intermediate form is retrieved from the local cache based on the target script identifier and target version information in the script execution request.

[0031] In some embodiments, the target script identifier and target version information can be matched with the script identifier and version information corresponding to each preset intermediate script form, so that a unique intermediate script form with the same target script identifier and target version information can be matched.

[0032] In step S230, the intermediate form of the target script can be executed in a secure sandbox environment, and the execution result can be returned.

[0033] In one embodiment of the present invention, before step S220, the method includes: acquiring script code and metadata of the script code, the metadata including a script language type identifier, a script identifier, and a version number; determining a target script language processing plugin based on the script language type identifier and a preset routing mapping table between script languages ​​and script language processing plugins, and pre-compiling the script code through the target script language processing plugin to obtain an intermediate form corresponding to the script code, which serves as the initial intermediate script form; generating a composite key based on the script identifier and the version number, and associating the composite key with the initial intermediate script form to obtain a preset intermediate script form. By pre-compiling to generate the intermediate form corresponding to the script code and associating it with the composite key of the script identifier and the version number, one-time compilation and multiple reuse are achieved, avoiding repeated parsing overhead and improving script execution efficiency. It also supports multi-version management, reducing resource consumption in high-concurrency scenarios.

[0034] In this embodiment, pre-compilation can be performed when the script code is first loaded or updated. The generated intermediate form is stored in the local cache with the script identifier and version number as a composite key, which can be directly called during subsequent execution. The local cache is a concurrency-safe key-value pair data structure.

[0035] For example, for a certain script code, a key-value pair is formed by using the script identifier and version number of the script code as the composite key and the intermediate form of the script code as the value. This key-value pair data structure is stored in the local cache, and the composite key is the globally unique key of the intermediate form.

[0036] For example, the local cache could be Caffeine (a Java caching framework, Java being a programming language) or ConcurrentMap (an interface in the Java concurrency package).

[0037] In one embodiment of the present invention, pre-compiling script code using a target scripting language processing plugin includes: determining a corresponding pre-compilation method based on a scripting language type identifier; verifying the script code according to the pre-compilation method, wherein the pre-compilation method includes at least one type of verification such as syntax verification, blacklist verification, and operation permission verification; and, if the verification passes, converting the script code into a corresponding intermediate form using a compiler, wherein the intermediate form includes at least one of bytecode, instruction set, abstract syntax tree, and executable statement object.

[0038] In this embodiment, the pre-compilation method can select the most suitable technology stack based on different scripting language types. When script code is interpreted or compiled line by line only during execution, effective static security checks and access control are difficult to perform, resulting in lower security. This embodiment uses a scripting language processing plugin to execute the pre-compilation method, performing steps such as syntax correctness checks, method blacklist verification, and data operation permission verification on the script code. By performing security checks and access control on the script code through pre-compilation, potential security risks can be identified in advance, preventing vulnerabilities from lurking at runtime, thereby elevating security from "runtime remediation" to "pre-execution blocking."

[0039] In some embodiments, the pre-compilation process can employ different strategies depending on the scripting language type. For QLExpress (Quick Language Express) expression language scripts, syntax correctness checks can be performed, and expressions can be parsed into InstructionSets. For Java scripts, the Janino compiler can be used for syntax checks and method blacklist verification, wrapping user-defined classes into a uniform execution format and generating bytecode execution objects. For JavaScript scripts, the GraalVM engine can be used for syntax verification, encapsulating the source code into Source objects and applying host access control policies to restrict access to dangerous classes. For SQL (Structured Query Language) query language scripts, MyBatis MappedStatement objects can be constructed, SQL command types can be parsed, execution timeout parameters can be set, and database-executable mapping statements can be generated.

[0040] In some embodiments, blacklists for all scripting language types can also be managed, and blacklists for each scripting language type can be dynamically loaded and updated so that dangerous methods and class references can be checked through the blacklist mechanism at the time of script compilation.

[0041] In some embodiments, the scripting language processing plugin may select the most suitable technology stack implementation based on the scripting language type.

[0042] In one embodiment of the present invention, before determining the target script language processing plugin based on the script language type identifier and a preset routing mapping table of script languages ​​and script language processing plugins, the method includes: responding to a timed event, querying the script language processing plugin library to obtain the script language processing plugin and the script languages ​​supported by the script language processing plugin; registering the script language processing plugin and associating the script language processing plugin with the script languages ​​to generate a routing mapping table.

[0043] In this embodiment, the script language processing plugin library can be scanned periodically, script language processing plugins can be dynamically loaded, and registered to the script language to script language processor (i.e., script language processing plugin) routing mapping table. This allows for querying the script language to script language processor routing mapping table based on the script language type identifier, thus obtaining the script language processor corresponding to the script language represented by the script language type identifier. For example, a scheduled scanning task can be created when the application integration platform starts, automatically scanning the script language processing plugin library located in a specified directory every minute. The plugin manager loads and starts the script language processing plugins, registering them to the script language to script language processor routing mapping table, dynamically expanding the types of script languages ​​they support. When the application integration platform runs, the registered script language processing plugins can be dynamically called based on the script language type identifier. The routing mapping table can be implemented using a concurrent-safe key-value pair data structure, with the script language type identifier as the key and the corresponding script language processor instance as the value, forming a key-value pair. The routing mapping table can be automatically built during system initialization using a dependency injection framework, integrating all instances implementing the unified script language processor abstract interface.

[0044] In some embodiments, the process of dynamically loading a scripting language processing plugin includes defining standard methods for script loading, pre-compiling, execution, and unloading through a scripting language processor abstract interface. The scripting language processing plugin is provided as a software package conforming to the scripting language processor abstract interface for integrating a specific scripting language processor. The built-in scripting language processor supports languages ​​including QLExpress expression language, Java, JavaScript, and SQL query language. By loading the scripting language processing plugin, the number of supported scripting languages ​​is dynamically expanded.

[0045] In one embodiment of the present invention, the target version information includes a target version number. The target script intermediate form is determined from multiple preset script intermediate forms based on the target script identifier and the target version information, including: generating a target composite key based on the target script identifier and the target version number; matching the target composite key with the composite keys associated with each preset script intermediate form, and taking the preset script intermediate form associated with the successfully matched composite key as the target script intermediate form.

[0046] In another embodiment of the present invention, the target version information includes a target version status tag. Determining the target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information includes: querying a version number from a version control database that corresponds to both the target version status tag and the target script identifier, and using this version number as the target version number. The version control database stores the script identifier, version number, and version status tag for each script code. There is a correspondence between the script identifier, version number, and version status tag, and the version status tag indicates the stage of the script code in its lifecycle. A target composite key is generated based on the target script identifier and the target version number. The target composite key is matched with the composite keys associated with each preset script intermediate form, and the preset script intermediate form associated with the successfully matched composite key is used as the target script intermediate form.

[0047] In this embodiment, for script code with the same function but different versions, the script identifier is the same, but the version number is different. Moreover, each version of the script code is in a different stage of the life cycle, such as the development stage, the release stage, and the decommissioning stage. Therefore, a version control database can be used to record all version numbers, version status tags, and evolution relationships between versions corresponding to each script identifier, with the version status tags representing the stage of the script code in the life cycle.

[0048] The target version information in the script execution request information can be a specific version number or a version status label pointing to a specific version state. If the target version information in the script execution request information is a version number, i.e., the target version number, then a composite key can be formed using the target script identifier and the target version number to query the local cache and obtain the intermediate form of the target script. If the target version information in the script execution request information is a version status label, i.e., the target version status label, then the version control database is queried to map the target version status label to a specific version number, which is used as the target version number. Then, a composite key is formed using the target script identifier and the target version number to query the local cache and obtain the intermediate form of the target script.

[0049] In one embodiment of the present invention, step S230 includes: creating a subtask, executing an intermediate form of the target script through the subtask; monitoring the execution time of the subtask, and controlling the subtask to stop execution when the execution time reaches a preset threshold, thereby obtaining the execution result. By creating an asynchronous subtask to execute the loaded intermediate form and implementing strict execution timeout control, the script is prevented from executing indefinitely, ensuring that the main program is not affected by script execution and guaranteeing system stability.

[0050] In some embodiments, the execution process of subtasks can also be monitored, exceptions during the execution process can be captured, and exceptions can be handled and resources cleaned up in a unified manner.

[0051] Please see Figure 3 , Figure 3 This is a schematic diagram of the script execution flow provided in a specific embodiment of the present invention, such as... Figure 3 As shown, the script execution flow is as follows: Step S310: Scan the script language processing plugin library and dynamically load script language processing plugins; Step S320: Receive the script code and its metadata submitted by the user; Step S330: Based on the script language type identifier, load the corresponding script language processing plugin, pre-compile the script, and convert it into an executable intermediate form; Step S340: Associate the intermediate form of the script with the metadata, and store it in the local cache using the script identifier and version number as a composite key; Step S350: Receive the script execution request, load the corresponding intermediate form from the cache according to the script identifier and version number, and execute it in the security sandbox.

[0052] Please see Figure 4 , Figure 4 A schematic diagram of the script execution flow provided for another specific embodiment of the present invention, such as... Figure 4 As shown, the script execution flow is as follows: The system receives script code and metadata submitted by the user. The metadata includes a script language type identifier, a script identifier, and a version number. Based on the script language type identifier, it retrieves the corresponding script language processing plugin from the script language to script language processor routing table, pre-compiles the script code, and converts the script code into an executable intermediate form. It associates the intermediate form with the metadata and stores it in the local cache using a composite key of the script's unique identifier and the version number. In response to a script execution request, it retrieves and loads the corresponding intermediate form from the local cache based on the script identifier and version number in the script execution request, executes the loaded intermediate form in a secure sandbox environment, and returns the execution result.

[0053] Figure 3 and Figure 4 For details regarding the specific script execution flow shown, please refer to the descriptions in the aforementioned embodiments; they will not be repeated here. The two script execution flows described above utilize a plug-in architecture, allowing seamless integration with any scripting language to meet diverse integration needs. The pre-compilation and caching mechanisms eliminate the overhead of repeated parsing and compilation, significantly reducing latency and increasing throughput, making them particularly suitable for high-frequency call scenarios. Furthermore, strict version management ensures the stability and reproducibility of the integration process, simplifying the DevOps (Development Operations) process. Static security scanning, such as detecting dangerous functions, can be performed during the pre-compilation stage, which, combined with the runtime sandbox, forms a dual security defense.

[0054] Please see Figure 5 , Figure 5 This is a block diagram of a script execution device according to an embodiment of the present invention. This device can be applied to… Figure 1 The implementation environment shown is specifically configured in the application integration platform 120. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which this device is applicable.

[0055] like Figure 5 As shown, the exemplary script execution device includes: a data receiving module 510, used to acquire script execution request information, the script execution request information including a script execution request, a target script identifier, and target version information; an information processing module 520, used to determine a target script intermediate form from multiple preset script intermediate forms based on the target script identifier and target version information, wherein the preset script intermediate form is obtained by compiling script code; and an execution module 530, used to execute the target script intermediate form to obtain an execution result.

[0056] In this embodiment, the data receiving module 510, the information processing module 520, and the execution module 530 can be software modules, hardware modules, or a combination of software and hardware modules; no limitation is imposed here.

[0057] In some embodiments, the data receiving module 510 may be a receiver, a network card, or the like.

[0058] In some embodiments, the information processing module 520 may be a computer, server, cloud platform, etc.

[0059] In some embodiments, the execution module 530 may be a computer, an edge device, a server, a cloud platform, etc.

[0060] In some embodiments, the data receiving module 510, the information processing module 520, and the execution module 530 may be configured in the application integration platform.

[0061] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a script execution system provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the script execution system includes: a script manager 610, which receives script code and metadata submitted by users and coordinates the workflow of various modules; a script extension module 620, which manages and loads various script language processing plugins in a plug-in manner and provides core lifecycle methods for script execution; a version controller 630, which manages script version information and version status; and a security sandbox module 640, which provides a restricted execution environment to securely run intermediate forms of scripts.

[0062] The script manager 610 can be an example of the data receiving module 510, the script extension module 620 and the version controller 630 can be sub-modules of the information processing module 520, and the security sandbox module 640 can be an example of the execution module 530.

[0063] It should be noted that the script execution device and system provided in the above embodiments belong to the same concept as the script execution method provided in the above embodiments. The specific execution methods of each module have been described in detail in the method embodiments and will not be repeated here. In practical applications, the script execution device and system provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device and system can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.

[0064] In one embodiment of the present invention, an electronic device is also provided, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the script execution method provided in the above embodiments.

[0065] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. It should be noted that... Figure 7 The electronic device 700 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0066] like Figure 7 As shown, the electronic device 700 includes a processor 701, a memory 702, and a communication bus 703; the communication bus 703 is used to connect the processor 701 and the memory 702; the processor 701 is used to execute a computer program stored in the memory 702 to implement one or more methods in the above embodiments.

[0067] In one embodiment of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored. When executed by a computer's processor, the computer program causes the computer to perform the script execution method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not incorporated into the electronic device.

[0068] In one embodiment of the present invention, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the script execution methods provided in the various embodiments described above.

[0069] The electronic device provided in this embodiment of the invention includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication between them. The memory is used to store computer programs, the communication interface is used to perform communication, and the processor and the transceiver are used to run the computer programs, so that the electronic device performs the various steps of the above method.

[0070] In embodiments of the present invention, the memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.

[0071] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0072] As will be understood by those skilled in the art, the computer-readable storage medium in the embodiments of the present invention can implement all or part of the steps of the above method embodiments by hardware related to computer programs. The aforementioned computer program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disks, or optical disks.

[0073] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A script execution method, characterized in that, The method includes: Obtain script execution request information, which includes script execution request, target script identifier, and target version information; Based on the target script identifier and the target version information, a target script intermediate form is determined from multiple preset script intermediate forms, wherein the preset script intermediate form is obtained by pre-compiling the script code; The intermediate form of the target script is executed to obtain the execution result.

2. The script execution method according to claim 1, characterized in that, Before determining the target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information, the method includes: Obtain the script code and its metadata, including the script language type identifier, script identifier, and version number; Based on the script language type identifier and the preset routing mapping table between script languages ​​and script language processing plugins, the target script language processing plugin is determined, and the script code is pre-compiled through the target script language processing plugin to obtain the intermediate form corresponding to the script code, which serves as the initial script intermediate form. A composite key is generated based on the script identifier and the version number, and the composite key is associated with the initial script intermediate form to obtain the preset script intermediate form.

3. The script execution method according to claim 2, characterized in that, Pre-compiling the script code using the target scripting language processing plugin includes: The corresponding pre-compilation method is determined based on the script language type identifier; The script code is verified according to the pre-compilation method, wherein the pre-compilation method includes at least one type of verification: syntax verification, blacklist verification, and operation permission verification. If the verification is successful, the script code is converted into a corresponding intermediate form by the compiler. The intermediate form includes at least one of bytecode, instruction set, abstract syntax tree, and executable statement object.

4. The script execution method according to claim 2, characterized in that, Before determining the target script language processing plugin based on the script language type identifier and a preset routing mapping table between script languages ​​and script language processing plugins, the method includes: In response to a timed event, the script language processing plugin library is queried to obtain the script language processing plugin and the script languages ​​supported by the script language processing plugin. The script language processing plugin is registered, and the script language processing plugin is associated with the script language to generate the routing mapping table.

5. The script execution method according to claim 2, characterized in that, The target version information includes a target version number. Based on the target script identifier and the target version information, a target script intermediate form is determined from multiple preset script intermediate forms, including: Generate a target composite key based on the target script identifier and the target version number; The target composite key is matched with the composite keys associated with each preset script intermediate form, and the preset script intermediate form associated with the successfully matched composite key is taken as the target script intermediate form.

6. The script execution method according to claim 2, characterized in that, The target version information includes a target version status tag. Based on the target script identifier and the target version information, a target script intermediate form is determined from multiple preset script intermediate forms, including: Based on the target version status label and the target script identifier, a version number that corresponds to both the target version status label and the target script identifier is queried from the version control database and used as the target version number. The version control database is used to store the script identifier, version number, and version status label of each script code. There is a correspondence between the script identifier, the version number, and the version status label. The version status label indicates the stage of the script code in its lifecycle. Generate a target composite key based on the target script identifier and the target version number; The target composite key is matched with the composite keys associated with each preset script intermediate form, and the preset script intermediate form associated with the successfully matched composite key is taken as the target script intermediate form.

7. The script execution method according to claim 1, characterized in that, Executing the intermediate form of the target script yields the execution result, including: Create a subtask, and execute the intermediate form of the target script through the subtask; The execution time of the subtask is monitored, and when the execution time reaches a preset threshold, the subtask is stopped from execution to obtain the execution result.

8. A script execution device, characterized in that, The device includes: The data receiving module is used to acquire script execution request information, which includes a script execution request, a target script identifier, and target version information. The information processing module is used to determine the target script intermediate form from multiple preset script intermediate forms based on the target script identifier and the target version information, wherein the preset script intermediate form is obtained by compiling the script code; The execution module is used to execute the intermediate form of the target script and obtain the execution result.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the script execution method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by the computer's processor, causes the computer to perform the script execution method as described in any one of claims 1-7.