Script engine, script operation method and device, storage medium and vehicle

By analyzing and processing script environment parameters and determining the script running environment, the existing script engine has limited applicability and large storage resource usage have been solved, and support and resource conservation for multiple script types have been achieved.

CN120104133APending Publication Date: 2025-06-06BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311657735.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-05
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing script engine has limited applicability and requires a separate sandbox environment, resulting in a large occupancy of storage resources.

Method used

The script engine calls the script parameters of the upper-level business, analyzes the script environment parameters, determines the target script type and running element information, determines the script running environment based on the run path and environment relationship, and controls the script to run in the environment.

Benefits of technology

Improves the applicability of the script engine, allowing it to run scripts of preset script types, without setting up a large number of script engines, reducing resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104133A_ABST
    Figure CN120104133A_ABST
Patent Text Reader

Abstract

The invention discloses a script engine, a script running method and device, a storage medium and a vehicle, the method is applied to the script engine, and the method comprises the following steps: acquiring script parameters of calling an upper business application by the script engine; analyzing the script environment parameters to obtain a target script type of a script for operating the upper-layer business application; under the condition that the target script type exists in the preset script type, the script environment parameters are analyzed, and script operation element information of the script is determined; determining a script running environment corresponding to the script running path according to the relationship between the running path and the running environment; and controlling the script to run in the script running environment to obtain a script running result. Therefore, the script engine in the embodiment of the invention can run the scripts belonging to the preset script type, and the script running result is obtained, so that the applicability of the script engine is improved, the scripts of different upper-layer business applications do not need to be run by setting a large number of script engines, and the resource consumption for running the script engine is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the computer field, and in particular to a script engine, a script running method, a device, a storage medium and a vehicle. Background Art

[0002] In the field of electronic devices, in order to improve the flexibility and scalability of electronic devices, many manufacturers and developers are trying to introduce scripting languages ​​into the operating systems or applications of electronic devices.

[0003] In order to execute the script, the script engine is required to perform parsing. Existing script engines either have limited applicable script types or script languages, which have certain limitations. Or they require a separate sandbox environment, which will occupy more storage resources in the device. Summary of the invention

[0004] Embodiments of the present application provide a script engine, a script execution method, a device, a storage medium, and a vehicle, which improve the applicability of the script engine.

[0005] According to a first aspect of the present application, a script running method is provided, the method being applied to a script engine, the method comprising:

[0006] Obtaining script parameters for the script engine to call an upper-layer business application, the script parameters at least including: script environment parameters;

[0007] Parse the script environment parameters to obtain the target script type for running the upper-level business application script;

[0008] When the target script type exists in the preset script type, the script environment parameter is parsed to determine the script running element information of the script, where the script running element information at least includes: the script running path;

[0009] According to the relationship between the running path and the running environment, determine the script running environment corresponding to the script running path;

[0010] The control script runs in the script running environment and obtains the script running result.

[0011] Optionally, the script running element information also includes: a script version number;

[0012] When the target script type exists in the preset script type, after parsing the script environment parameter and determining the script running element information of the script, the method further includes:

[0013] According to the script version number, determine the script running logic from the relevant library corresponding to the script version number;

[0014] The control script runs in the script running environment and obtains the script running results, including:

[0015] The control script runs in the script running environment according to the script running logic to obtain the script running result.

[0016] Optionally, the script parameters also include script running parameters;

[0017] When the target script type exists in the preset script type, after parsing the script environment parameter and determining the script running element information of the script, the method includes:

[0018] Parse script running parameters and determine the script running mode;

[0019] The control script runs in the script running environment and obtains the script running results, including:

[0020] The control script runs in the script running environment according to the script running mode to obtain the script running result.

[0021] Optionally, the script running mode includes: synchronous execution;

[0022] The control script runs in the script running environment according to the script running mode to obtain the script running results, including:

[0023] According to the relationship between the running path and the execution order, determine the script running order corresponding to the script running path;

[0024] Send the script to the main thread so that the main thread runs the script in the script running environment according to the script running order to obtain the script running result.

[0025] Optionally, the script running mode includes: asynchronous execution;

[0026] The control script runs in the script running environment according to the script running mode to obtain the script running results, including:

[0027] Send the script to the thread pool so that the thread pool runs the script in the script running environment according to the script running order to obtain an initial running result. The script running order is related to the callback function corresponding to the script. The thread pool includes multiple threads.

[0028] The initial running result is sent to the callback function to execute the parameters corresponding to the callback function to obtain the script running result.

[0029] Optionally, according to the relationship between the running path and the running environment, determining the script running environment corresponding to the script running path; so that the upper-layer business runs the script in the script running environment through the script engine, and after obtaining the script running result, the method further includes:

[0030] Send the script running results to the upper-level business application.

[0031] According to a second aspect of the present application, a script engine is provided, comprising:

[0032] The interface layer is connected to the upper layer business application for communication and is used to obtain the script parameters of the upper layer business application to be called, the script parameters including: script environment parameters;

[0033] The first parsing layer is used to parse the script environment parameters to obtain the target script type of the script running the upper-layer business application; if the target script type exists in the preset script type, the script environment parameters are parsed to determine the script running element information of the script, and the script running element information at least includes: the script running path;

[0034] The distribution layer is used to determine the script running environment corresponding to the script running path according to the relationship between the running path and the running environment, and control the script to run in the script running environment to obtain the script running result.

[0035] According to a third aspect of the present application, an embodiment of the present application provides a script execution device, which includes: a processor and a memory storing computer program instructions;

[0036] When the processor executes the computer program instructions, the script execution method as described in any one of the first aspects is implemented.

[0037] According to the fourth aspect of the present application, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the script running method of any one of the first aspects is implemented.

[0038] According to the fifth aspect of the present application, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the script running method of any one of the first aspects.

[0039] According to the sixth aspect of the present application, an embodiment of the present application provides a vehicle, which includes: at least one of the script engine as described in any one of the second aspect and the script running device as described in any one of the third aspect.

[0040] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0041] The embodiment of the present application provides a script engine, a script running method, a device, a storage medium and a vehicle. The script engine calls the script parameters of the upper-layer business, thereby parsing the script environment parameters in the script parameters to obtain the target script type of the script running the upper-layer business application. When it is determined that the target script type exists in the preset script type in the script engine, it means that the script engine can run the script, so the script environment parameters are parsed again to obtain the script running element information of the script, and then the script running environment can be determined according to the script running path in the script running element information, so as to control the script to run in the script running environment and obtain the script running result. Therefore, the script engine in the embodiment of the present application can run all scripts belonging to the preset script type and obtain the script running result, which improves the applicability of the script engine, so that there is no need to set up a large number of script engines to run scripts of various upper-layer business applications, thereby reducing the resource consumption of running the script engine.

[0042] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.

[0044] Figure 1 is a flow chart of a script running method according to an exemplary embodiment;

[0045] Figure 2 is another flow chart of a script running method according to an exemplary embodiment;

[0046] Figure 3 is another flow chart of a script running method according to an exemplary embodiment;

[0047] Figure 4 is another flow chart of a script running method according to an exemplary embodiment;

[0048] Figure 5 is a structural block diagram of a script engine according to an exemplary embodiment;

[0049] Figure 6 The figure is a structural block diagram of a script running device according to an exemplary embodiment. DETAILED DESCRIPTION

[0050] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0051] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0052] As described in the background technology, in the field of electronic devices, in order to improve the flexibility and scalability of electronic devices, many manufacturers and developers are trying to introduce scripting languages ​​into the operating systems or applications of electronic devices. In order to execute the script, a script engine is required to perform parsing. Existing script engines either have limited applicable script types or scripting languages, which have certain limitations. Or they require a separate sandbox environment, which will occupy more storage resources in the device.

[0053] In order to solve the problems of the prior art, the script engine in the embodiment of the present application can run scripts belonging to preset script types and obtain script running results, thereby improving the applicability of the script engine and eliminating the need to set up a large number of script engines to run scripts of various upper-level business applications, thereby reducing the resource consumption of running the script engine.

[0054] Based on this, the present application provides a script engine, a script execution method, a device, a storage medium and a vehicle. The following first introduces the script execution method provided in the embodiment of the present application. The script execution method may include:

[0055] Figure 1 FIG. 1 shows a structural block diagram of a script execution method provided by an embodiment of the present application. Figure 1 As shown, in one embodiment, the method is applied to a script engine, and the method may include:

[0056] S101, obtaining script parameters for a script engine to call an upper-layer business application, the script parameters at least including: script environment parameters;

[0057] S102, parsing script environment parameters to obtain a target script type for running the script of the upper-layer business application;

[0058] S103, if the target script type exists in the preset script type, parsing the script environment parameter, determining the script running element information of the script, the script running element information at least including: the script running path;

[0059] S104, determining the script running environment corresponding to the script running path according to the relationship between the running path and the running environment;

[0060] S105, controlling the script to run in the script running environment to obtain the script running result.

[0061] Based on the above embodiment, the script parameters of the upper-layer business are called by the script engine, so that the script environment parameters in the script parameters can be parsed to obtain the target script type of the script running the upper-layer business application. When it is determined that the target script type exists in the preset script type in the script engine, it means that the script engine can run the script, so the script environment parameters are parsed again to obtain the script running element information of the script, and then the script running environment can be determined according to the script running path in the script running element information, so as to control the script to run in the script running environment and obtain the script running result. Therefore, the script engine in the embodiment of the present application can run scripts belonging to the preset script type and obtain the script running result, which improves the applicability of the script engine, so that there is no need to set up a large number of script engines to run scripts of various upper-layer business applications, thereby reducing the resource consumption of running the script engine.

[0062] In the above S101, the script engine can obtain the script parameters required for running each upper-layer business application by connecting with the upper-layer business application.

[0063] As an example, script parameters may include: input data, configuration information, authentication credentials, etc.

[0064] Define the script parameters that need to be passed to the upper-level business application in the script engine, and define the interface or method for receiving the script parameters in the upper-level business application. These interfaces or methods should correspond to the parameter list in the script engine. Call the interface or method of the upper-level business application in the script engine, and pass the required script parameters to the script engine. This can be achieved through function calls, command line parameter passing, hypertext transfer protocol requests, etc. Receive and process the passed script parameters in the upper-level business application. These parameters can be verified, parsed, and processed in the application to achieve the required functions. Then return the processing results to the script engine, so that the script engine obtains the script parameters.

[0065] As an example, upper-layer business applications may include: application programs, systems or platforms, etc. These applications may interact and integrate with the script engine, and utilize the running results provided by the script engine to expand and optimize the business processing flow.

[0066] In the above S102, the acquired script parameters are parsed and interpreted to determine the target script type, which may involve parsing the names, values ​​and other related information of the script parameters.

[0067] Specifically, the script type is determined according to the script language format in the parameter parsed from the script parameter.

[0068] As an example, script environment parameters may include: command line parameters, environment variables, etc., where command line parameters are: parameters that can be passed through the command line when running the script, and these parameters can be obtained and used in the script; environment variables are: environment variables that can be set before the script runs, and these variables can be obtained and used in the script.

[0069] In the above S103, if the target script type of the script exists in the preset script type, it can be determined that the script can be run on the script engine. Therefore, in order to further enable the script to run on the script engine, the script environment parameters need to be parsed again to determine the script running element information when the script is running.

[0070] As an example, the script environment parameters may also include:

[0071] Script path: Specifies the path where the script file to be executed is located. This can be a relative path or an absolute path.

[0072] Input data: Input data passed to the script, such as data to be processed, parameter values, etc.

[0073] Configuration information: Specify the configuration settings for the script, such as database connection information, file paths, etc.

[0074] As an example, the script execution element information may include: the script execution path.

[0075] As an example, the preset script type may include at least one of a lua type, a python type, a ruby ​​type, and a js type.

[0076] In the above S104, the script needs to be run stably in an execution environment, and each execution path has a corresponding execution environment, so the script execution environment required by the current script can be determined according to the script execution path.

[0077] As an example, the script running environment is one of the important factors for script running, which may include operating system, programming language, library and tools, etc. Determining the correct script running environment can enable the script to run correctly and achieve the expected results.

[0078] In the above S105, after the script running environment of the script is determined, the script engine can control the script to run in the script running environment, so as to obtain the script running result.

[0079] As an example, the script execution result may include: data processing output results, business logic processing results, script execution status, script execution log and other related information. The script execution result can be used to monitor, debug and manage the script execution process and results.

[0080] In addition, since the script engine can be applicable to all scripts whose script types exist in the preset script types, in the process of developing upper-level business applications, the script engine of the present application can be used to run tests on scripts of different script types, and it is easy to compare the running results, so that better script types can be selected for upper-level business applications.

[0081] By running the scripts of the upper-level business applications in the script engine of this embodiment, the script engine can be applied to a variety of different types of scripts (existing in the preset script types), so that the upper-level business applications can be automatically updated, and the process of the upper-level business applications can be changed by dynamically sending scripts to the script engine for execution. Bugs in the upper-level business applications can be resolved in real time according to the script execution results, or the operation process of the upper-level business applications can be optimized.

[0082] In order to ensure the stability of script execution, the present application also provides another implementation of the script execution method.

[0083] The script running element information also includes: script version number;

[0084] Figure 2 Another flowchart of a script execution method provided by an embodiment of the present application is shown as follows: Figure 2 As shown, after the above S103, the method may further include:

[0085] S201, according to the script version number, determine the script running logic from the relevant library corresponding to the script version number;

[0086] The above S105 may include:

[0087] S202, controlling the script to run in the script running environment according to the script running logic to obtain the script running result.

[0088] Based on the above embodiment, after the type of the known script is the target script type, the script environment factor is parsed again to determine the script version number of the script in the target script type, thereby determining the script running logic of the script from the relevant library corresponding to the script version number, so that the script can be run according to the script running logic. This ensures that the script can run stably in the current script running environment.

[0089] In the above S201, each script type has been continuously developed to form different versions, and by parsing the script environment parameters, the script version number of the script to be run can also be known. Specifically, the script environment parameters can be matched with predefined rules or patterns. Since the predefined rules or patterns are in one-to-one correspondence with the preset versions, if the predefined rules or patterns are successfully matched, the script version number of the script is the version number corresponding to the predefined rules or patterns.

[0090] In another embodiment, the script environment parameter may be parsed into a specific data type or structure, and the data type or structure is compared with a preset data type or structure, and the version number corresponding to the successfully compared data type or structure becomes the script version number.

[0091] The script version number is an identifier used to reflect the script version. Due to the update of the script version, the running logic of the same type of script will be different between different versions. In other words, the running logic has changed, which means the script version has changed. The script version and the running logic of the script are one-to-one corresponding, so the script running logic of the script can be determined based on the script version number of the script.

[0092] As an example, if a script version is significantly updated, specifically, the original operating logic is modified, then the relevant library corresponding to the modified script version can also be written into the script engine to improve the applicability of the script engine.

[0093] As an example, if the script version is only slightly updated, specifically by adding or deleting the original running logic, the relevant library corresponding to the script version is updated to ensure the accuracy of the relevant library corresponding to the script version.

[0094] In the above S202, more preferably, after determining the script running logic of the script, it is necessary to control the script to run in the script running environment according to the script running logic, so as to obtain accurate script running results, and also improve the stability of the script during the running process and reduce the possibility of running errors.

[0095] In order to ensure that the script can be executed smoothly, the present application also provides another implementation of the script running method.

[0096] Script parameters also include script running parameters;

[0097] Figure 3 Another flowchart of a script execution method provided by an embodiment of the present application is shown as follows: Figure 3 As shown, after the above S103, the method may further include:

[0098] S301, parsing script running parameters to determine the script running mode;

[0099] The above S105 may include:

[0100] S302, controlling the script to run in the script running environment according to the script running mode, and obtaining the script running result.

[0101] Based on the above embodiment, the script running mode of the script is determined by parsing the script running parameters, so that the script can be run according to the script running mode in the current script running environment to obtain the script running result. Therefore, the script can be run according to the script running mode to optimize the script running process and logic, thereby improving the running efficiency and reliability. This helps to complete the script running faster, obtain the script running result, and reduce the possibility of errors.

[0102] In the above S301, similarly, the script running parameters are parsed to obtain parsing results, and the parsing results are then matched with predefined rules or patterns, and the execution mode corresponding to the matching predefined rules or patterns is the script running mode.

[0103] As an example, the script running parameters may include input data and configuration information of the script engine, etc. The specific script running parameters depend on the scripting language, framework or library used.

[0104] In the above S302, the control script selects a corresponding running path, calls different functions or methods, loads different configuration files, etc. to run the script in the script running environment according to different script running modes to obtain the script running result.

[0105] As an example, the script running mode may include: synchronous execution.

[0106] Specifically, the control script is run in the script running environment according to the script running mode, and the script running result obtained may include:

[0107] According to the relationship between the running path and the execution order, determine the script running order corresponding to the script running path;

[0108] Send the script to the main thread so that the main thread runs the script in the script running environment according to the script running order to obtain the script running result.

[0109] Among them, the script code to be executed is determined according to the running path, and the order in which the script code is executed is arranged according to certain rules or logic as the script running order. More specifically, the script running order may include: according to the calling order of functions or methods, according to the flow order of conditional statements or loop statements, etc.

[0110] The main thread will run the script in a certain script running order. During the script running process, it will perform necessary calculations or process data to generate script running results. These script running results are usually saved in variables or used as function return values.

[0111] As an example, the script running mode may include: asynchronous execution.

[0112] Send the script to the thread pool so that the thread pool runs the script in the script running environment according to the script running order to obtain an initial running result. The script running order is related to the callback function corresponding to the script. The thread pool includes multiple threads.

[0113] The initial running result is sent to the callback function to execute the parameters corresponding to the callback function to obtain the script running result.

[0114] The script is submitted to the thread pool for execution. The thread pool can manage multiple threads and assign the script running tasks to each thread for execution according to the script running order, thereby obtaining the initial running result.

[0115] When the script is finished running in the thread pool and the initial running result is obtained, the calculated initial running result is passed to the preset callback function for processing. This callback function can be a processing function inside the thread pool or a callback function in the business code.

[0116] In the process of running scripts in asynchronous execution mode, although callback functions play an important role in handling asynchronous execution, they cannot determine the order of script execution in asynchronous execution alone. The order of script execution is also affected by other factors such as the execution mechanism.

[0117] In order to more clearly reflect the feedback script running results, this application also provides another implementation of the script running method.

[0118] Figure 4 Another flowchart of a script execution method provided by an embodiment of the present application is shown as follows: Figure 4 As shown, after the above S105, the method may further include:

[0119] S401, sending the script running result to the upper-layer business application.

[0120] Based on the above embodiment, the script engine returns the operation results to the upper-level business application, which can realize the automation and optimization of the business process of the upper-level business application. The upper-level business application can automatically control and adjust the process according to the returned operation results, reduce manual intervention and operation, improve work efficiency and automation level, and better optimize business processes and improve work efficiency.

[0121] In the above S401, the script engine and the upper-layer business application are in communication connection, so the script running result is directly returned to the upper-layer business application through the communication connection.

[0122] It should be noted that the application scenarios described in the above-mentioned embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems; and new embodiments of the present application can be combined with each other, and new solutions formed by the combination of various embodiments are all within the protection scope of the present application.

[0123] Based on the same inventive concept, the present application also provides a script engine 500. Figure 5 Provide detailed explanation.

[0124] Figure 5 A schematic diagram of the hardware structure of a script engine 500 provided in an embodiment of the present invention is shown.

[0125] like Figure 5 As shown, the script engine 500 may include:

[0126] The interface layer 510 is connected to the upper layer business application for communication and is used to obtain the script parameters of the upper layer business application to be called, the script parameters including: script environment parameters;

[0127] The first parsing layer 520 is used to parse the script environment parameters to obtain the target script type of the script running the upper-layer business application; if the target script type exists in the preset script type, the script environment parameters are parsed to determine the script running element information of the script, and the script running element information at least includes: the script running path;

[0128] The distribution layer 530 is used to determine the script running environment corresponding to the script running path according to the relationship between the running path and the running environment, and control the script to run in the script running environment to obtain the script running result.

[0129] Based on the above embodiment, the script parameters of the upper-layer business are called through the interface layer 510 of the script engine 500, so that the first parsing layer 520 can parse the script environment parameters in the script parameters to obtain the target script type of the script running the upper-layer business application. When it is determined that the target script type exists in the preset script type in the script engine, it means that the script engine can run the script, so the script environment parameters are parsed again to obtain the script running element information of the script, and the distribution layer 530 can then determine the script running environment according to the script running path in the script running element information, thereby controlling the script to run in the script running environment and obtaining the script running result. Therefore, the script engine in the embodiment of the present application can run scripts belonging to the preset script type and obtain the script running result, which improves the applicability of the script engine, so that there is no need to set up a large number of script engines to run scripts of various upper-layer business applications, thereby reducing the resource consumption of running the script engine.

[0130] Optionally, the script running element information also includes: a script version number;

[0131] The script engine 500 may also include:

[0132] The determination layer is used to determine the script running logic from the relevant library corresponding to the script version number according to the script version number;

[0133] The distribution layer 530 may include:

[0134] The first running module is used to control the script to run in the script running environment according to the script running logic to obtain the script running result.

[0135] Optionally, the script parameters also include script running parameters;

[0136] The script engine 500 may also include:

[0137] The second parsing layer is used to parse the script running parameters and determine the script running mode;

[0138] The distribution layer 530 may also include:

[0139] The control module is used to control the script in the script running environment, run according to the script running mode, and obtain the script running result.

[0140] Optionally, the script running mode includes: synchronous execution;

[0141] The control module may include:

[0142] A determination unit, used to determine the script running order corresponding to the script running path according to the relationship between the running path and the execution order;

[0143] The first sending unit is used to send the script to the main thread, so that the main thread runs the script in the script running environment according to the script running order to obtain the script running result.

[0144] Optionally, the script running mode includes: asynchronous execution;

[0145] The control module may also include:

[0146] A second sending unit is used to send the script to a thread pool, so that the thread pool runs the script in a script running environment according to the script running order to obtain an initial running result. The script running order is related to the callback function corresponding to the script. The thread pool includes multiple threads;

[0147] The third sending unit is used to send the initial running result to the callback function to execute the parameters corresponding to the callback function to obtain the script running result.

[0148] Optionally, the script engine 500 may further include:

[0149] The sending layer is used to send the script running results to the upper-layer business application.

[0150] The script running method provided in the embodiment of the present application can achieve Figure 1-4 The various processes implemented by any script running method embodiment can achieve the same technical effect. To avoid repetition, they will not be described here.

[0151] Figure 6 A schematic diagram of the hardware structure of a script execution device provided in an embodiment of the present invention is shown.

[0152] The script execution device may include a processor 601 and a memory 602 storing computer program instructions.

[0153] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0154] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.

[0155] In certain embodiments, the memory 602 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory 602 includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors 601), it is operable to perform the operations described with reference to the method according to an aspect of the present application.

[0156] The processor 601 implements any one of the script running methods in the above embodiments by reading and executing the computer program instructions stored in the memory 602 .

[0157] In one example, the script execution device may further include a communication interface 603 and a bus 604. As shown in the figure, the processor 601, the memory 602, and the communication interface 603 are connected via the bus 604 and communicate with each other.

[0158] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiment of the present invention.

[0159] The bus 604 includes hardware, software or both. For example, but not limitation, the bus 604 may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industry standard architecture (ISA) bus, a wireless bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral control interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, the bus 604 may include one or more buses 604. Although the present application embodiment describes and shows a specific bus 604, the present application considers any suitable bus 604 or interconnection.

[0160] The script running device can run the method based on the current script, thereby achieving the combination Figure 1-Figure 5 The script execution method and script engine 600 are described.

[0161] In addition, an embodiment of the present application further provides a computer program product, including computer program instructions, which can implement the steps and corresponding contents of the aforementioned method embodiment when the computer program product is executed by the processor 601.

[0162] Finally, an embodiment of the present application also provides a vehicle, which includes at least one of the above-mentioned script engine 600 and script running device.

[0163] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0164] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0165] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0166] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable terminal to produce a machine so that these instructions executed by the processor of the computer or other programmable terminal enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0167] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A script running method, It is characterized in that The method is applied to a script engine, and comprises: Acquire script parameters for the script engine to call an upper-layer business application, wherein the script parameters at least include: script environment parameters; Parsing the script environment parameters to obtain a target script type for running the script of the upper-layer business application; In the case where the target script type exists in the preset script type, parsing the script environment parameter to determine the script running element information of the script, the script running element information at least including: a script running path; Determine the script running environment corresponding to the script running path according to the relationship between the running path and the running environment; The script is controlled to run in the script running environment to obtain a script running result.

2. The method according to claim 1, It is characterized in that The script running element information also includes: script version number; In the case where the target script type exists in the preset script type, after parsing the script environment parameter and determining the script running element information of the script, the method further includes: According to the script version number, determining the script running logic from the relevant library corresponding to the script version number; The controlling the script to run in the script running environment to obtain the script running result includes: The script is controlled to run in the script running environment according to the script running logic to obtain a script running result.

3. The method according to claim 1, It is characterized in that The script parameters also include script running parameters; In the case where the target script type exists in the preset script type, after parsing the script environment parameter and determining the script running element information of the script, the method includes: Parsing the script running parameters to determine the script running mode of the script; The controlling the script to run in the script running environment to obtain the script running result includes: The script is controlled to run in the script running environment according to the script running mode to obtain a script running result.

4. The method according to claim 3, It is characterized in that The script running mode includes: synchronous execution; The controlling the script to run in the script running environment according to the script running mode to obtain the script running result includes: According to the relationship between the running path and the execution order, the script running order of the script is determined according to the script running path; The script is sent to the main thread, so that the main thread runs the script in the script running environment according to the script running order to obtain the script running result.

5. The method according to claim 3, It is characterized in that The script running mode includes: asynchronous execution; The controlling the script to run in the script running environment according to the script running mode to obtain the script running result includes: Sending the script to a thread pool so that the thread pool runs the script in the script running environment according to the script running order to obtain an initial running result, wherein the script running order is related to the callback function corresponding to the script, and the thread pool includes multiple threads; The initial running result is sent to the callback function to execute the parameters corresponding to the callback function to obtain the script running result.

6. The method according to claim 1, It is characterized in that After controlling the script to run in the script running environment and obtaining the script running result, the method further includes: The script execution result is sent to the upper layer business application.

7. A scripting engine, It is characterized in that include: The interface layer is connected to the upper layer business application for communication and is used to obtain script parameters of the upper layer business application to be called, wherein the script parameters include: script environment parameters; The first parsing layer is used to parse the script environment parameters to obtain a target script type for running the script of the upper-layer business application; if the target script type exists in a preset script type, parse the script environment parameters to determine script running element information of the script, wherein the script running element information at least includes: a script running path; The distribution layer is used to determine the script running environment corresponding to the script running path according to the relationship between the running path and the running environment, and control the script to run in the script running environment to obtain the script running result.

8. A script engine running device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 6.

11. A vehicle, It is characterized in that The vehicle includes at least one of the script engine according to claim 7 and the script engine execution device according to claim 8.