Control execution method, control execution device, terminal and readable storage medium

By obtaining and compiling control programs in industrial control, matching and embeding function call instruction codes, the problem of difficulty in technical cooperation between users of different roles is solved, and application efficiency and fusion effect are improved.

CN113407186BActive Publication Date: 2024-11-26CHINA GREATWALL TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110511738.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-11
Publication Date
2024-11-26
Estimated Expiration
2041-05-11

AI Technical Summary

Technical Problem

In industrial control, engineers in the fields of artificial intelligence and automatic control have low application efficiency and poor technical integration due to different programming languages ​​and concerns, making it difficult to achieve technical collaboration between users of different roles.

Method used

By obtaining the control program written by the user of the first role, using the compiler to generate the control code containing the function call instruction code. The interpreter matches and embeds the function names and parameters in the target execution code segment to realize the target function written by the user of the second role The call to promote technical integration between users of different roles.

Benefits of technology

It improves the efficiency and integration of technical cooperation between users of different roles, so that the implementation of different roles can be integrated during automated execution, and improves the efficiency of technical application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113407186B_ABST
    Figure CN113407186B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of computer control technology, and provides a control execution method, a control execution device, a terminal and a readable storage medium, wherein the method includes: obtaining a control program written by a first role user to call a target function; controlling a compiler to compile the control program to generate a control code containing a function call instruction code; controlling an interpreter to read the control code, and when the interpreter reads the function call instruction code, matching a target execution code segment corresponding to the function call instruction code; embedding the function name and function parameters of the target function in the target execution code segment; executing the target execution code segment based on the interpreter, calling the target function written by a second role user through the function name and function parameters. This solution can facilitate technical collaboration between users of different roles, and improve the efficiency of technical application and the effect of technical integration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer control technology, and in particular, relates to a control execution method, a control execution device, a terminal and a readable storage medium. Background Art

[0002] With the rapid development of science and technology, computer control has become a widely used technology in all walks of life. Different computer technologies are cross-applied in one field. For example, in industrial control, as the automation of industrial control proceeds, more and more machine learning models will be applied to industrial control. This process is accompanied by different application technologies and different implementation languages.

[0003] For example, engineers in the field of industrial control are more concerned with the process of automatic control and are good at the implementation of control systems. Engineers in the field of artificial intelligence focus on the training and deployment of machine learning models and are good at model selection and adjustment and parameter optimization. The two have completely different focuses and strengths. In addition, the difference in programming languages ​​makes it inconvenient for users of different roles to collaborate on technology, which also leads to the inconvenience of machine learning models in the field of industrial control, low technology application efficiency and poor technology integration effect. Summary of the invention

[0004] The embodiments of the present application provide a control execution method, a control execution device, a terminal and a readable storage medium to solve the problems in the prior art that different application technologies are cross-applied in industrial control, which makes it inconvenient for users of different roles to perform technical collaboration, and results in low efficiency in technical application and poor effect of technical integration.

[0005] A first aspect of an embodiment of the present application provides a control execution method, including:

[0006] Obtaining a control program written by a first role user to call a target function;

[0007] A control compiler is used to compile the control program to generate a control code, wherein the control code includes a function call instruction code;

[0008] The control interpreter is controlled to read the control code, and when the interpreter reads the function call instruction code, the target execution code segment corresponding to the function call instruction code is matched; wherein the interpreter contains execution code segments corresponding to different instruction codes respectively;

[0009] Embedding the function name and function parameters of the target function in the target execution code segment;

[0010] The target execution code segment is executed based on the interpreter, and the target function written by the second role user is called through the function name and the function parameters.

[0011] A second aspect of an embodiment of the present application provides a control execution device, including:

[0012] An acquisition module, used to acquire a control program written by a first role user to call a target function;

[0013] A compiling module, used to control a compiler to compile the control program to generate a control code, wherein the control code includes a function call instruction code;

[0014] An interpretation module, used for controlling an interpreter to read the control code, and matching a target execution code segment corresponding to the function call instruction code when the interpreter reads the function call instruction code; wherein the interpreter contains execution code segments corresponding to different instruction codes respectively;

[0015] A function embedding module, used for embedding the function name and function parameters of the target function in the target execution code segment;

[0016] A function calling module is used to execute the target execution code segment based on the interpreter, and call the target function written by the second role user through the function name and the function parameters.

[0017] A third aspect of an embodiment of the present application provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0018] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0019] A fifth aspect of the present application provides a computer program product, which, when executed on a terminal, enables the terminal to execute the steps of the method described in the first aspect.

[0020] As can be seen from the above, in the embodiment of the present application, by obtaining the control program written by the first role user to call the target function, the control compiler is controlled to compile the control program to generate a control code including a function call instruction code, and the control interpreter is controlled to read the control code. When the interpreter reads the function call instruction code, the target execution code segment corresponding to the function call instruction code is matched, and the function name and function parameters of the target function are embedded in the target execution code segment. Based on the interpreter executing the target execution code segment, the target function written by the second role user is called through the function name and function parameters. This allows different role users to focus on their own technical application implementation while integrating the work of different role users. In the automated execution process of the control program written by the first role user, it can be integrated with the functions written and implemented by other role users, thereby facilitating technical collaboration between different role users and improving technical application efficiency and technical integration effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 This is a process of a control execution method provided in an embodiment of the present application. Figure 1 ;

[0023] Figure 2 This is a process of a control execution method provided in an embodiment of the present application. Figure 2 ;

[0024] Figure 3 is a structural diagram of a control execution device provided in an embodiment of the present application;

[0025] Figure 4 It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0027] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0028] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0029] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0030] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0031] In a specific implementation, the terminal described in the embodiments of the present application includes, but is not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers with touch-sensitive surfaces (e.g., touch screen displays and / or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., touch screen displays and / or touch pads).

[0032] In the following discussion, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse and / or joystick.

[0033] The terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disk burning application, a spreadsheet application, a game application, a telephone application, a video conferencing application, an email application, an instant messaging application, a workout support application, a photo management application, a digital camera application, a digital camcorder application, a web browsing application, a digital music player application, and / or a digital video player application.

[0034] Various applications that can be executed on the terminal can use at least one common physical user interface device such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and / or changed between applications and / or within corresponding applications. In this way, the common physical architecture of the terminal (e.g., the touch-sensitive surface) can support various applications with user interfaces that are intuitive and transparent to the user.

[0035] It should be understood that the size of the serial numbers of the steps in this embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0036] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0037] See also Figure 1 , Figure 1 This is a process of a control execution method provided in an embodiment of the present application. Figure 1 .like Figure 1 As shown, a control execution method comprises the following steps:

[0038] Step 101: Obtain a control program written by a first role user for calling a target function.

[0039] Here, the first role user may be a user role user who is responsible for realizing industrial automation control, and this role user can write a control program. In this embodiment, the control program written by this role user needs to realize the call of external functions while realizing the normal industrial control function.

[0040] Specifically, the control program includes logic control, and the target function is a function written by the second role user. The first role user is different from the second role user.

[0041] As an optional implementation, before obtaining the control program written by the first role user to call the target function, it also includes: setting an interface function table for declaring the interface function.

[0042] The interface function table contains the function name and parameter list of each interface.

[0043] The interface functions declared in the interface function table can be the relevant function interfaces of the artificial intelligence model. The setting of the interface function table can make it easy to add, delete and modify the model-related functions in the interface function table. Among them, the functions declared in the interface function table can be written and implemented by other role users.

[0044] Optionally, the interface function table includes the definition of the interface function prototype, for example, in the form as shown below:

[0045] Bool model_init(string p1,dint p2,dint p3); define the model initialization function;

[0046] Dint model_inference(dint p1,dint p2); defines the model inference function.

[0047] In this process, the function is agreed upon or declared through the interface function table, and the function-related parameters are specifically agreed upon, such as the return value, function name, parameter list, function type, etc.

[0048] Correspondingly, the step of obtaining a control program written by the first role user to call the target function includes: obtaining a control program written by the first role user to call the target function in the interface function declared in the interface function table.

[0049] The control program is specifically an application program written in ST (Structured Text) language, in which the target interface function declared in the interface function table is called.

[0050] Step 102: The control compiler compiles the control program to generate control code.

[0051] A compiler is a computer program that converts source code written in a programming language into another computer code, which is usually in binary form and is called object code. The purpose of this conversion process is usually to generate an executable program. In this step, the application is compiled by a designed language compiler to generate instruction code.

[0052] The control code includes a function call instruction code, which is specifically a call instruction code, for implementing the calling of a function.

[0053] In addition, the control code may also include other instruction codes.

[0054] The instructions corresponding to the other instruction codes may include arithmetic instructions, relational operation instructions, data transmission instructions, logic instructions, conditional jump instructions, function call instructions and stack operation instructions, and each type of instruction includes at least the instructions described in the following table.

[0055]

[0056]

[0057] The instruction code is a series of integers, and the instructions correspond to the instruction codes one by one.

[0058] Step 103, controlling the interpreter to read the control code, and when the interpreter reads the function call instruction code, matching the target execution code segment corresponding to the function call instruction code.

[0059] In computer science, an interpreter is a computer program that directly executes code written in a programming or scripting language, without precompiling the source code into machine code.

[0060] In the application process, the aforementioned compiler converts the source code (i.e. the control program) into other lower-level codes (such as binary code, machine code), but does not execute it. The interpreter directly generates instructions for the computer hardware to execute, and does not output another code.

[0061] Specifically, the compiler may be an ST language compiler, and the interpreter may be an ST language interpreter. ST language is a language used to write application programs in industrial control. An ST language interpreter is implemented on a target platform to execute instruction codes generated by the ST language compiler.

[0062] The interpreter includes execution code segments corresponding to different instruction codes.

[0063] Specifically, the execution code segments included in the interpreter include: stack operation instruction execution code segments for pushing and popping data (such as function parameters), function call instruction execution code segments for implementing function calls, data transmission instruction execution code segments for reading and writing memory data to assign variables, etc. The execution code segments included in the interpreter can be set accordingly with reference to the instruction codes included in the aforementioned control code.

[0064] When the interpreter reads the control code and detects that a function call instruction code is read, a target execution code segment corresponding to the function call instruction code is matched from multiple execution code segments.

[0065] The target execution code segment needs to be embedded with the function name and function parameters of the target function required to be called by the current function call instruction code, so as to implement the call to the target function when the target execution code segment is executed.

[0066] Step 104: embed the function name and function parameters of the target function in the target execution code segment.

[0067] The function name and function parameters are specifically defined and declared in the control program written by the first role user to call the target function. The function name and function parameters of the target function can be determined based on the control program that calls the target function and the control code generated by compiling the control program.

[0068] Among them, when the control interpreter reads the control code, if the interpreter reads the function parameter stack instruction code, the first execution code segment corresponding to the function parameter stack instruction code is matched, and the function parameter stack operation is implemented by executing the first execution code segment to realize the function parameter transfer. Correspondingly, in this step, the stacked function parameters can be extracted and embedded into the target execution code segment.

[0069] Step 105 , based on the interpreter executing the target execution code segment, the target function written by the second role user is called through the function name and function parameters.

[0070] The second role user has written multiple functions, including the target function that needs to be called in this embodiment. When the interpreter makes a function call, the target function is determined and the function parameters are passed through the function name and function parameters embedded in the target execution code segment, so that the target function implements the corresponding processing function based on the passed function parameters.

[0071] This process designs a method for calling and implementing functions during the control execution process. It allows the first role user, such as an industrial control engineer, to call model-related functions from the ST application when implementing the automation control function, and the artificial intelligence engineer to write and implement the pre-declared model-related functions on the specific platform to achieve the connection and integration of the work of the two. Among them, model-related functions are some processing functions related to the model, such as model loading, model initialization, model configuration and model unloading, etc., which are specifically related to the design of the interface function; the specific platform refers to the environment composed of specific hardware and the operating system and software running on it.

[0072] This process solves the application barriers of artificial intelligence models in industrial control due to the differences in programming languages ​​and focuses between artificial intelligence engineers and industrial control engineers. It allows artificial intelligence engineers to focus on the implementation of model-related functions on specific platforms, and industrial control engineers to focus on calling model-related functions and implementing control logic.

[0073] In the specific application process, the declaration information of the relevant functions of the machine learning model in artificial intelligence is summarized as an interface function table. With this as a reference, AI engineers are responsible for the implementation of model-related functions on specific platforms, and industrial control engineers are responsible for calling model-related functions in applications. This process realizes the separation of calling and implementation. Industrial control engineers can call functions in a language environment that they are familiar with, and artificial intelligence engineers can write functions in their own way.

[0074] In an embodiment of the present application, a control program written by a first role user to call a target function is obtained, a compiler is controlled to compile the control program, a control code including a function call instruction code is generated, and an interpreter is controlled to read the control code. When the interpreter reads the function call instruction code, a target execution code segment corresponding to the function call instruction code is matched, and a function name and function parameters of the target function are embedded in the target execution code segment. The interpreter executes the target execution code segment, and the target function written by the second role user is called through the function name and function parameters. This allows different role users to focus on their own technical application implementations while integrating the work of different role users. In the automated execution process of the control program written by the first role user, it can be integrated with functions written and implemented by other role users, thereby facilitating technical collaboration between different role users and improving technical application efficiency and technical integration effects.

[0075] Different implementation methods of the control execution method are also provided in the embodiments of the present application.

[0076] See also Figure 2 , Figure 2 This is a process of a control execution method provided in an embodiment of the present application. Figure 2 .like Figure 2 As shown, a control execution method comprises the following steps:

[0077] Step 201: Obtain a control program written by a first role user for calling a target function.

[0078] The implementation process of this step is the same as the implementation process of step 101 in the aforementioned embodiment, and will not be repeated here.

[0079] Step 202 , control the compiler to load the control program, and load the attribute information of the variables and target functions involved in the control program into the identifier list through the compiler.

[0080] The attribute information of the target function is, for example, the function name, function number, etc.

[0081] The variables involved in the control program include fields such as variable name, type, variable initial value and relative address. When the compiler loads the control program and extracts the variables involved in the control program, it is necessary to determine the required space occupation according to the type of each variable and uniformly assign a unique relative address to all variables.

[0082] The identifier list may include identifiers formed by program keywords, custom variables, numerical constants, interface function names, function numbers, etc. The identifiers in the identifier list may be loaded and customized.

[0083] The legalization of the relevant information is achieved through the identifiers set in the identifier list, and the content of the compiled object is identified and verified through the legalized identifiers.

[0084] Step 203: parse the control program according to the identifier list to generate a control code.

[0085] The control code includes a function call instruction code.

[0086] The content of the compiled object is identified and verified through the legalized identifiers in the identifier list. For example, during the compilation process, when the compiler encounters a function name, it will compare whether the parameters of the interface function called in the control program code are completely consistent with the interface function prototype, and parse the control program through the identifier information imported in the identifier list (that is, the variables involved in the imported control program and the attribute information of the target function).

[0087] The parsing process may specifically include: lexical checking (the syntax of the control program may be checked according to the syntax requirements of the ST language specified in IEC61131-3), syntax checking, semantic parsing, etc., and finally generating instruction codes.

[0088] When generating instruction codes, the source program is compiled into target codes consisting of instruction codes and operands using the statement expressions in the control program as the basic units. The starting positions of some continuous code blocks can also be recorded as needed to enable subsequent interpreters to read and execute the instruction codes.

[0089] Specifically, the compiler compiles the relevant information of the interface function call (function name, parameter list) into corresponding instruction codes, which may specifically include parameter stacking instructions and function call instructions, etc.

[0090] Optionally, after the control compiler loads the control program, it also includes: obtaining character format requirements corresponding to the writing language of the control program, and based on the character format requirements, performing character format processing on the control program through the compiler; wherein, the character format of the control program after the character format processing remains unchanged, or the characters contained in the control program after the character format processing are adjusted to the same format.

[0091] Before parsing the control program, it is necessary to first obtain the character format requirements corresponding to the language in which the control program is written. Based on the character format requirements, it is determined whether the current control program's writing language meets the compilation format requirements. If it meets the requirements, the character format of the current control program needs to be kept unchanged. If it does not meet the requirements, the control program needs to be formatted differently.

[0092] For example, when the control program is written in ST language, this language is not case-sensitive and does not meet the compilation format requirements. Therefore, before compiling the control program written in ST language, all characters need to be converted to lowercase to facilitate compilation and parsing operations.

[0093] Step 204, the control interpreter reads the control code, and when the interpreter reads the function call instruction code, it matches the target execution code segment corresponding to the function call instruction code.

[0094] The interpreter includes execution code segments corresponding to different instruction codes.

[0095] The implementation process of this step is the same as the implementation process of step 103 in the aforementioned embodiment, and will not be repeated here.

[0096] Step 205 : Based on the function number and the corresponding relationship between the function number and the function embedding position, determine the target embedding position from the target execution code segment.

[0097] The function call instruction code is associated with the function number of the target function. The function number can be an additional parameter of the function call instruction code. When the interpreter reads the function call instruction code, the additional parameter identified before or after the function call instruction code is identified as the function number of the target function.

[0098] Among them, the function embedding position corresponds to the function number one by one. In the implementation process, the call of all target functions can be set to use the same CALL instruction, and then the specific function to be called is determined by the number of the called function. After determining the currently called target function, the target embedding position corresponding to the current target function is determined based on the code content in the target execution code segment.

[0099] Step 206: Based on the target embedding position, the function name and function parameters of the target function are embedded into the target execution code segment through the interpreter.

[0100] That is, based on the target embedding position, the function name and function parameters of the target function are embedded into the target embedding position in the function call instruction code through the interpreter.

[0101] Step 207, based on the interpreter executing the target execution code segment, the target function written by the second role user is called through the function name and function parameters.

[0102] The implementation process of this step is the same as the implementation process of step 105 in the aforementioned embodiment, and will not be repeated here.

[0103] This process realizes the separation of calling and implementing. Industrial control engineers can call functions in a language environment that they are familiar with, and artificial intelligence engineers can write functions in their own way. This solves the technical application barriers caused by the different programming languages ​​and concerns of users with different roles in the application of artificial intelligence models in industrial control. It allows artificial intelligence engineers to focus on the implementation of model-related functions on specific platforms, and industrial control engineers to focus on calling model-related functions and implementing control logic.

[0104] See also Figure 3 , Figure 3 This is a structural diagram of a control execution device provided in an embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0105] The control execution device 300 includes:

[0106] An acquisition module 301 is used to acquire a control program written by a first role user to call a target function;

[0107] A compiling module 302, used to control a compiler to compile the control program to generate a control code, wherein the control code includes a function call instruction code;

[0108] An interpretation module 303 is used to control the interpreter to read the control code, and when the interpreter reads the function call instruction code, matches the target execution code segment corresponding to the function call instruction code; wherein the interpreter contains execution code segments corresponding to different instruction codes respectively;

[0109] A function embedding module 304, used for embedding the function name and function parameters of the target function in the target execution code segment;

[0110] The function calling module 305 is used to execute the target execution code segment based on the interpreter, and call the target function written by the second role user through the function name and the function parameters.

[0111] The function call instruction code is associated with the function number of the target function; the interpretation module is specifically used for:

[0112] Based on the function number and in combination with the corresponding relationship between the function number and the function embedding position, determining the target embedding position from the target execution code segment;

[0113] Based on the target embedding position, the function name and function parameters of the target function are embedded into the target execution code segment through the interpreter.

[0114] Wherein, the compiling module is specifically used for:

[0115] Controlling the compiler to load the control program, and loading the variables involved in the control program and the attribute information of the target function into an identifier list through the compiler;

[0116] The control program is parsed according to the identifier list to generate the control code.

[0117] Wherein, the compiling module is also specifically used for:

[0118] Obtaining character format requirements corresponding to the writing language of the control program;

[0119] Based on the character format requirement, performing character format processing on the control program by the compiler;

[0120] The character format of the control program after the character format processing remains unchanged, or the characters included in the control program after the character format processing are adjusted to have the same format.

[0121] The device also includes:

[0122] A setting module, used for setting an interface function table for declaring interface functions;

[0123] Correspondingly, the acquisition module is specifically used for:

[0124] A control program written by the first role user for calling a target function in the interface function declared in the interface function table is obtained.

[0125] The control execution device provided in the embodiment of the present application can implement each process of the embodiment of the above-mentioned control execution method and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0126] Figure 4 4 is a structural diagram of a terminal provided in an embodiment of the present application. As shown in the figure, the terminal 4 of this embodiment includes: at least one processor 40 ( Figure 4 Only one is shown in the figure), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the processor 40 implements the steps of any of the above-mentioned method embodiments when executing the computer program 42.

[0127] The terminal 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of terminal 4 and does not constitute a limitation on terminal 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.

[0128] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0129] The memory 41 may be an internal storage unit of the terminal 4, such as a hard disk or memory of the terminal 4. The memory 41 may also be an external storage device of the terminal 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal 4. The memory 41 is used to store the computer program and other programs and data required by the terminal. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0130] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0133] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0136] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0137] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be implemented through a computer program product. When the computer program product runs on a terminal, the terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0138] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A control execution method, It is characterized in that include: Obtaining a control program written by a first role user to call a target function; A control compiler is used to compile the control program to generate a control code, wherein the control code includes a function call instruction code; The control interpreter is controlled to read the control code, and when the interpreter reads the function call instruction code, the target execution code segment corresponding to the function call instruction code is matched; wherein the interpreter contains execution code segments corresponding to different instruction codes respectively; Embedding the function name and function parameters of the target function in the target execution code segment; The target execution code segment is executed based on the interpreter, and the target function written by the second role user is called through the function name and the function parameters.

2. The control execution method according to claim 1, It is characterized in that The function call instruction code is associated with the function number of the target function; the function name and function parameters of the target function are embedded in the target execution code segment, including: Based on the function number and in combination with the corresponding relationship between the function number and the function embedding position, determining the target embedding position from the target execution code segment; Based on the target embedding position, the function name and function parameters of the target function are embedded into the target execution code segment through the interpreter.

3. The control execution method according to claim 1, It is characterized in that The control compiler compiles the control program to generate control code, including: Controlling the compiler to load the control program, and loading the variables involved in the control program and the attribute information of the target function into an identifier list through the compiler; The control program is parsed according to the identifier list to generate the control code.

4. The control execution method according to claim 3, It is characterized in that After controlling the compiler to load the control program, the method further includes: Obtaining character format requirements corresponding to the writing language of the control program; Based on the character format requirement, performing character format processing on the control program by the compiler; The character format of the control program after the character format processing remains unchanged, or the characters included in the control program after the character format processing are adjusted to have the same format.

5. The control execution method according to claim 1, It is characterized in that Before obtaining the control program written by the first role user to call the target function, the method further includes: Set up an interface function table for declaring interface functions; Correspondingly, the step of obtaining a control program written by the first role user to call the target function includes: A control program written by the first role user for calling a target function in the interface function declared in the interface function table is obtained.

6. A control execution device, It is characterized in that include: An acquisition module, used to acquire a control program written by a first role user to call a target function; A compiling module, used to control a compiler to compile the control program to generate a control code, wherein the control code includes a function call instruction code; An interpretation module, used for controlling an interpreter to read the control code, and matching a target execution code segment corresponding to the function call instruction code when the interpreter reads the function call instruction code; wherein the interpreter contains execution code segments corresponding to different instruction codes respectively; A function embedding module, used for embedding the function name and function parameters of the target function in the target execution code segment; A function calling module is used to execute the target execution code segment based on the interpreter, and call the target function written by the second role user through the function name and the function parameters.

7. The control execution device according to claim 6, It is characterized in that The function call instruction code is associated with the function number of the target function; the interpretation module is specifically used for: Based on the function number and in combination with the corresponding relationship between the function number and the function embedding position, determining the target embedding position from the target execution code segment; Based on the target embedding position, the function name and function parameters of the target function are embedded into the target execution code segment through the interpreter.

8. The control execution device according to claim 6, It is characterized in that The compilation module is specifically used for: Controlling the compiler to load the control program, and loading the variables involved in the control program and the attribute information of the target function into an identifier list through the compiler; The control program is parsed according to the identifier list to generate the control code.

9. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.