Script information execution method and system

By determining the key statements and context information in the script information in the script information execution system, ensuring the matching of the operation code and the operation content information, solving the problems of low efficiency and poor accuracy of script information execution in the prior art, and achieving efficient and accurate script execution.

CN119847834APending Publication Date: 2025-04-18SUZHOU HUAXING YUANCHUANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411857523.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the prior art, there is a problem that the operation code and the operation content information do not match during the execution process of script information, resulting in low execution efficiency and poor accuracy.

Method used

By obtaining the target script information, the key statements carrying the control field are determined, the corresponding operation code is determined based on these key statements, and the matching operation content information is determined by analyzing the context information of the key statements, ensuring the exact match between the operation code and the operation content information.

Benefits of technology

Improve the execution efficiency of script information, enhance the accuracy of script execution, and ensure that the script execution results are consistent with expectations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847834A_ABST
    Figure CN119847834A_ABST
Patent Text Reader

Abstract

The invention discloses a script information execution method and system. The method comprises the steps of obtaining target script information; determining N key statements carrying control fields in the target script information, and determining corresponding N groups of operation codes according to the key statements; determining context information corresponding to the key statement in target script information, and determining N groups of operation content information matched with the corresponding operation code according to the context information; and executing an operation corresponding to the operation code on the operation content information. The operation content information can be correctly stored, updated and transmitted in the execution process of the target script information, and accurate matching of the operation code and the operation content information is ensured, so that the execution efficiency of the target script information is improved, the script execution accuracy is enhanced, and it is ensured that the script execution result conforms to the expectation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a script information execution method and system. Background Art

[0002] In the test and inspection machines in the display field, the traditional architecture solution usually uses ARM processors (or soft-core processors called inside FPGA) to work together with FPGA to realize convenient processing of business logic and customized drive of display interface. Due to its powerful processing power and rich software resources, ARM processors perform well in the implementation of business logic, can run script information conveniently, and conveniently maintain and update business, but there are high implementation difficulties, high manpower investment, and high hardware costs.

[0003] Script information is text information written in a scripting language. Scripting language is also called an extended language or a dynamic language. It is a computer programming language created to shorten the traditional edit-compile-link-run process. Scripting languages ​​are used to control software applications. They are usually saved in text (such as ASCII) and are only interpreted or compiled when called. Scripting languages ​​are usually simple, easy to learn, and easy to use. The purpose is to enable programmers to quickly complete program writing.

[0004] Based on FPGA, scripting languages ​​can be easily run, and business maintenance and updates can be conveniently performed. Script information can be directly applied to FPGA to replace the work of ARM. However, during the execution of script information, there is often a phenomenon that the operation code and the operation content information do not match. This mismatch not only leads to low script execution efficiency, but also seriously affects the accuracy of execution. This heterogeneous system design also brings a series of problems, such as high implementation difficulty, high manpower investment, and high hardware cost. Summary of the invention

[0005] One of the purposes of the present invention is to provide a script information execution method to solve the technical problem in the prior art that operation information and operation content information do not match during the execution of script information, resulting in low execution efficiency and poor accuracy of the script information.

[0006] One of the objectives of the present invention is to provide a script information execution system.

[0007] In order to achieve one of the above-mentioned purposes of the invention, the present invention provides a script information execution method, including: obtaining target script information; determining N key statements carrying control fields in the target script information, and determining corresponding N groups of operation codes based on the key statements; determining context information corresponding to the key statements in the target script information, and determining N groups of operation content information matching the corresponding operation codes based on the context information; and executing operations corresponding to the operation codes on the operation content information.

[0008] As a further improvement of an embodiment of the present invention, the context information corresponding to the key statement in the target script information is determined, and N groups of operation parameter information matching the corresponding operation type information are determined based on the context information, including: determining the operation type information and the corresponding operation parameter information based on the key statement; determining an identifier based on the operation type, and determining the context information corresponding to the key statement based on the identifier; and determining N groups of operation content information matching the corresponding operation code based on the context information.

[0009] As a further improvement of an embodiment of the present invention, the step of determining N key statements carrying a control field in the target script information includes:

[0010] Determine a first key statement and a second key statement carrying a control field in the target script information, wherein the first key statement and the second key statement have a first order relationship;

[0011] The method of determining the context information corresponding to the key statement in the target script information, and determining N groups of operation content information matching the corresponding operation code according to the context information, includes: determining a first operation code according to a first key statement, determining first context information corresponding to the first key statement in the target script information, determining first operation content information matching the first operation code according to the first context information, and determining a second operation code according to a second key statement, determining second context information corresponding to the second key statement in the target script information, and determining second operation content information matching the second operation code according to the second context information; in accordance with a first order relationship, performing an operation corresponding to the first operation code on the first operation content information, and performing an operation corresponding to the second operation code on the second operation content information.

[0012] As a further improvement of an embodiment of the present invention, the performing of an operation corresponding to a first operation code on the first operation content information, and the performing of an operation corresponding to a second operation code on the second operation content information, include: performing an operation corresponding to the first operation code on the first operation content information, and updating a state parameter of the first operation content information; determining whether the state parameter of the current first operation content information matches the operation parameter in the second operation code; if so, updating the second operation content information according to the state parameter of the current first operation content information, and performing an operation corresponding to the second operation code on the updated second operation content information.

[0013] As a further improvement of an embodiment of the present invention, before obtaining the target script information, the method also includes: obtaining a plurality of script information, and determining a priority order of the response script information according to the triggering sources of the plurality of script information; and determining the target script information according to the priority order.

[0014] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a script information execution system, the system includes an FPGA, and the FPGA includes: a UART controller, used to receive original information from the input end of the execution system, and perform data processing on the original information to determine the corresponding target script information; a script module, used to receive and execute the script information execution method according to the target script information.

[0015] As a further improvement of an embodiment of the present invention, the script module includes: a script loading module, used to obtain target script information; a script parsing module, used to parse the target script information, determine the corresponding N groups of operation codes and N groups of operation content information matching the corresponding operation codes; a script execution module, used to execute the operation corresponding to the operation code on the operation content information.

[0016] As a further improvement of an embodiment of the present invention, the script loading module includes a first unit and a second unit, the first unit is used to obtain a plurality of script information, the second unit is used to determine the priority order of the response script information according to the triggering source of the plurality of script information, and determine the target script information according to the priority order.

[0017] As a further improvement of an embodiment of the present invention, the context information includes at least one of the operation instruction information and the operation status information; the script parsing module includes a first cache area and a second cache area, the first cache area is used to store the operation status information of the script information, and the second cache area is used to store the operation instruction information of the script information.

[0018] As a further improvement of an embodiment of the present invention, the script execution module includes a third unit and several script execution sub-units, and the third unit is used to determine the corresponding operation type according to the operation code, and determine the corresponding script execution sub-unit according to the operation type.

[0019] Compared with the prior art, the present invention parses the target script information to determine the key statements carrying the control field, and according to these key statements, the corresponding operation codes can be accurately determined; the context information of the key statements is analyzed to obtain the operation content information matching the operation code; and the operation content information is executed according to the determined operation code, so that the target script information can correctly save, update and transmit the operation content information during the execution process, ensuring the precise match between the operation code and the operation content information, thereby improving the execution efficiency of the target script information, enhancing the accuracy of the script execution, and ensuring that the script execution result is consistent with the expectation. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic diagram of the structure of a script information execution system in one embodiment of the present invention.

[0021] Figure 2 It is a schematic diagram of the principle structure of a script information execution system in one embodiment of the present invention.

[0022] FIG. 3( a ) is a schematic diagram of the structure of an ARM-based FPGA system in one embodiment of the present invention.

[0023] FIG. 3( b ) is a schematic diagram of the structure of a script information execution system based on FPGA in one embodiment of the present invention.

[0024] Figure 4 It is a schematic diagram of the steps of a script information execution method in one embodiment of the present invention.

[0025] Figure 5 It is a schematic diagram of steps before step S1 in one embodiment of the present invention.

[0026] Figure 6 2 is a schematic diagram of step S3 in one embodiment of the present invention.

[0027] Figure 7 It is a flow chart of a script information execution system based on FPGA in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0028] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.

[0029] It should be noted that the term "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In addition, the terms "first", "second", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0030] like Figure 1 As described above, one embodiment of the present invention provides a script information execution system 100.

[0031] In one embodiment, the script information execution system 100 interprets the target script information according to a script information execution method and performs corresponding operations.

[0032] In a specific embodiment, the script information execution method can be implemented with reference to any technical solution provided below.

[0033] In a specific embodiment, the script information execution system 100 can be applied to an FPGA (Field-Programmable Gate Array) control device. In this embodiment, the script information execution system 100 is deployed or implemented on the FPGA, which is used as a hardware platform for executing script information, and the script information execution system 100 is software or logic running on this platform.

[0034] In another specific embodiment, the script information execution system 100 includes an FPGA. In this embodiment, the FPGA is a component of the script information execution system 100. In other words, the FPGA is an indispensable part of the script execution system, and its functions and characteristics are directly incorporated into the definition of the script information execution system 100, rather than just as an execution environment or platform.

[0035] In the above embodiment, the FPGA includes a UART controller 1 (Universal Asynchronous Receiver / Transmitter) and a script module 2. UART is a serial communication protocol and interface standard that allows data transmission between a computer and an external device through a serial interface without requiring a clock signal to synchronize data transmission.

[0036] In one embodiment, the UART controller 1 is used to receive original information from the input end of the execution system, and perform data processing on the original information to determine the corresponding target script information;

[0037] The script module 2 refers to a logic unit implemented in the FPGA for executing a specific script or program. The script module 2 can receive data from the UART controller 1 or other input sources, and process, analyze and control it according to the preset script logic, and the processing results can be output to other parts of the FPGA or external devices.

[0038] The script module 2 includes a script loading module 11 for loading script information or script instructions.

[0039] In one embodiment, the script loading module 11 is used to obtain target script information. The target script information can be classified according to the trigger source of the script information, and the trigger source refers to the factor or event that causes the target script information to be activated or triggered.

[0040] In a specific embodiment, the target script information includes at least one of initialization loading script information (e.g., triggered based on a system initialization operation), external input script information (e.g., triggered based on a user real-time input operation), external interrupt control script information (e.g., triggered based on an external interrupt request operation), and calling function reading script information (e.g., triggered based on a function call operation).

[0041] Specifically, the initialization loading script information is used to configure and initialize the basic settings, parameters, environment variables, etc. of its application object (such as FPGA) to ensure that the application system can run correctly. The initialization loading script information can be used to provide a stable and predictable initial state to ensure that subsequent business logic and input operations can be executed in a known and correctly configured environment.

[0042] The external input script information is responsible for capturing the input information and converting it into instructions or data that the application object can understand. The external input script information supports dynamic interaction with the system, changing the state of its application object in real time or performing specific operations, and enhancing interactivity and user-friendliness.

[0043] The external interrupt control script information is responsible for responding to external interrupts and executing corresponding processing logic to ensure that the application object can respond to external events in a timely manner and perform necessary processing operations. The external interrupt includes at least one of other system components, devices or external events (such as timer overflow, key press, network data packet arrival, etc.).

[0044] The calling function reads the script information and is responsible for calling the function or module and passing the necessary parameters and data, so as to realize the modularization and reuse of the script information and improve the maintainability and scalability.

[0045] In one embodiment, the script loading module includes a first unit and a second unit, the first unit is used to obtain a number of script information, the second unit is used to determine the priority order of the response script information according to the triggering source of the several script information, and determine the target script information according to the priority order.

[0046] like Figure 2 As shown, in a specific embodiment, the script loading module 11 may include an initialization loading submodule, an external script input submodule, an external interrupt control submodule, a call function reading submodule (i.e., corresponding to storage in the first unit) and an arbitration selection submodule (i.e., the second unit). The script loading module 11 controls the character stream of the script information in the first unit to be input to the arbitration selection submodule, and the arbitration selection submodule selects the target script information according to the set priority and sends it to the script parsing module 12.

[0047] The script module 2 includes a script parsing module 12, which is used to perform syntax analysis on the target script information, determine the corresponding N groups of operation codes and the N groups of operation content information matching the corresponding operation codes.

[0048] In one embodiment, the script parsing module 12 is used to determine N key statements carrying control fields in the target script information, and determine corresponding N groups of operation codes according to the N key statements.

[0049] In one embodiment, the script parsing module 12 is used to determine the context information corresponding to the key statement in the target script information, and determine N groups of operation content information matching the corresponding operation code according to the context information.

[0050] like Figure 2 As shown, in a specific embodiment, the script parsing module 12 includes a syntax parsing submodule, an opcode generation processing submodule, an opcode cache unit submodule and an opcode status register stack submodule.

[0051] Specifically, the syntax parsing submodule is used to parse the character stream in the target script information word by word to identify the syntax keywords therein. The syntax keywords are specific words in the target script information used to define structures such as operations, judgments, and loops. Specifically, the target script information is received from the script loading module; the target script information is scanned and compared to identify and determine the syntax keywords; the syntax keywords are matched with the preset syntax rules to determine their legality and correctness.

[0052] The operation code generation processing submodule receives the grammatical keywords output by the grammar analysis submodule and determines the corresponding operation code. In the process of generating the operation code, when the operation code points to an operation such as a loop, a conditional judgment or a function call, the control operation state register stack submodule pushes the current operation state information into the operation stack, and after the operation is completed, pops the previously maintained operation state from the stack to restore the previous execution environment. The operation state information includes at least one of the result of instruction execution, the condition flag and the value of the program counter.

[0053] At the same time, the control operation code cache unit submodule stores the parsed operation code data when receiving the operation code. In addition, the context information corresponding to the key sentence in the target script information can also be stored in the cache unit so that subsequent execution can be accessed at any time.

[0054] It can be seen that the operation status register stack submodule focuses on managing the state changes of the target script information during execution, especially the state of complex control structures such as loops and conditional judgments. The opcode cache unit submodule is used to increase the execution speed of instructions. By caching opcodes, the number of accesses to the main memory can be reduced, thereby reducing the delay of instruction execution.

[0055] The script module 2 includes a script execution module 13, which is used to execute an operation corresponding to the operation code on the operation content information.

[0056] like Figure 2 As shown, in a specific embodiment, the script execution module 13 includes an operation sorting processing submodule, an execution submodule, a data variable space submodule and a data information storage stack submodule.

[0057] Specifically, the operation sorting processing submodule receives the operation code transmitted from the script parsing module 2, and distributes it to the corresponding execution submodule for processing according to the operation type corresponding to the operation code, obtains the return value after processing by the execution submodule, and then feeds back the return value to the script parsing module 2.

[0058] During the execution of the execution submodule, the control data variable control submodule manages the corresponding data variable area and control information, including at least one of creating, assigning, reading and destroying variables.

[0059] The data information storage stack submodule is used to store and manage the data variable space range, data pointer, and function return value when the function is called, ensuring that its local parameters can be correctly accessed and operated when the function is called and returned.

[0060] It can be seen that the operation sorting processing submodule acts as a "dispatching center" to distribute the operation code to the corresponding execution submodule for processing; the execution submodule is responsible for the specific operation execution; the data variable space submodule manages the variables during the script execution process; and the data information storage stack submodule ensures the correct transmission of information during function calls and returns. These submodules work together to form the powerful function of the script execution module 3.

[0061] The execution submodule includes at least one of an IO access processing submodule, a data calculation processing submodule, and a system control processing submodule.

[0062] Specifically, IO access processing, i.e. input / output access processing, refers to the data transmission process between the computer and external devices. In the script execution module, the IO access processing submodule is responsible for processing data exchange with these external devices. Data calculation processing refers to the process of performing various mathematical operations and logical processing on input data. In the script execution module, the data calculation processing submodule is responsible for performing these calculation tasks. System control processing refers to the process of managing and controlling the overall operation of the computer system, such as coordinating the operation of various modules and processes of system resources (CPU, memory, disk, etc.), and handling system-level events and errors.

[0063] In order to more intuitively demonstrate the framework of the script information execution system of the present invention applied to the FPGA system and the difference between the existing ARM-based FPGA system framework.

[0064] For example, as shown in Figure 3(a), the system framework consists of two parts: ARM_system and FPGA_system. ARM_system executes instructions through the processor core, manages task scheduling, and interacts with the PCIE Device in the FPGA_system through the PCIE Root (PCI Express Root Port, PCI port).

[0065] For example, ARM_system loads picture data from external memory or network into FPGA through picture loading module (i.e., Pictures Load), performs various processing operations on the loaded picture data based on picture processing module (i.e., Pictures Handle), such as filtering, scaling, rotating, etc., and stores the processed picture data in picture storage module (i.e., Pictures Store). In addition, the picture data to be processed can be transferred to FPGA_system through PCIE for processing, and then the processing results are transmitted back to ARM_system.

[0066] The ARM processor core (i.e., ARM Cores) in the ARM_system acts as the control center, controlling and coordinating the work of the FPGA by configuring the registers (i.e., Registers) in the FPGA_system. At the same time, the FPGA_system can also send interrupts or status information to the ARM_system to notify it of its current working status or processing results. The FPGA_system implements specific acceleration functions through hardware logic. The system framework combines the powerful transaction management capabilities of ARM and the hardware acceleration capabilities of FPGA, and is suitable for application scenarios that require high performance and flexibility.

[0067] Although ARM processors, with their powerful processing capabilities and rich software resources, are extremely convenient in running scripting languages ​​to maintain and update business logic, this heterogeneous system design inevitably brings challenges such as high implementation difficulty, large manpower investment, and expensive hardware costs.

[0068] Based on this, as shown in FIG3(b), the present invention uses the script information execution system 100 as a part of the FPGA in an embedded manner to replace the work of ARM and realize the corresponding functions. The system framework only includes the FPGA_system part, which is completely based on the FPGA implementation. The target script information is executed by the script thread (i.e., Script Threads) to realize specific functions; and the file system module (i.e., File System) is used to manage and store files and directories in the FPGA system. It provides operations such as file creation, deletion, reading and writing, and supports different file systems and storage media. The system not only retains the convenient characteristics of the script language in realizing business logic, but also reduces the complexity of system implementation and reduces the investment cost of the product.

[0069] Continuing with FIG. 3(b), the SD Host is used to communicate with storage devices such as SD cards to implement data read and write operations. It provides a connection to the physical interface of the SD card and handles the protocol for communicating with the SD card; Ethernet (Ethernet controller) is used for communication between the FPGA system and the external network. It supports the standard Ethernet protocol, allowing the FPGA system to transmit and interact with other devices through the network; UART is used for low-speed communication between the FPGA system and external devices; Script Threads is a script execution thread integrated into the FPGA system, which is used to execute user-defined scripts or programs. These scripts can control the behavior of the FPGA system and implement complex logic control and data processing tasks. Compared with traditional ARM systems, Script Threads provides more flexible and efficient hardware acceleration capabilities; Registers: Registers are the basic storage units in the FPGA system, used to store temporary data and status information. They can be accessed and operated by different modules and threads to achieve data transmission and control; Memory Controller: The memory controller is responsible for managing and controlling memory resources in the FPGA system. It provides operations such as memory allocation, recycling, reading and writing, and supports different memory types and architectures (such as SRAM, DRAM, etc.).

[0070] like Figure 4 As shown, one embodiment of the present invention provides a script information execution method.

[0071] The script information execution method is applied to a script information execution system.

[0072] In one embodiment, the script information execution system may be as follows: Figure 1 to Figure 3(b) As described above, the corresponding technical solution is set and referenced in the execution method provided by the present invention. Of course, the script information execution system used by the script information execution method provided by the present invention is not limited to this configuration structure.

[0073] like Figure 4 As shown, a script information execution method provided in one embodiment of the present invention includes the following steps.

[0074] Step S1, obtaining target script information;

[0075] Step S2, determining N key statements carrying control fields in the target script information, and determining corresponding N groups of operation codes according to the key statements;

[0076] Step S3, determining context information corresponding to the key sentence in the target script information, and determining N groups of operation content information matching the corresponding operation code according to the context information;

[0077] Step S4: executing the operation corresponding to the operation code on the operation content information.

[0078] In this way, by parsing the target script information, the key statements carrying the control field are determined, and based on these key statements, the corresponding operation codes can be accurately determined; by analyzing the context information of the key statements, the operation content information matching the operation code is obtained; and then the operation content information is executed according to the determined operation code, so that the target script information can correctly save, update and transmit the operation content information during the execution process, ensuring the precise match between the operation code and the operation content information, thereby improving the execution efficiency of the target script information, enhancing the accuracy of the script execution, and ensuring that the script execution results are consistent with expectations.

[0079] The control field in step S2 refers to a field in the target information script that contains control instructions or control logic, and the control field is used to guide the execution flow of the script information, such as conditional judgment, loop execution, jump, etc.

[0080] In a specific embodiment, the control field includes specific keywords or symbols to identify its control function, such as if, while, @function, etc.

[0081] The key statement in step S2 refers to a statement in the target script information that is identified as carrying a control field. The operation code is an instruction code associated with the key statement, identifying the specific operation to be performed on the key statement. The key statement can be a simple conditional judgment or a complex loop structure or nested control structure, which is not specifically limited.

[0082] In a specific embodiment, the key statement includes at least one of a loop statement, a conditional judgment statement, a function call statement, and an input / output access statement.

[0083] For example, the key statement is "while D002<10", and its corresponding opcode represents the instruction code for loop execution. The opcode is generated by the compiler or interpreter when parsing the target script information, and is used to instruct the computer hardware or software to perform the corresponding operation.

[0084] The context information in step S2 refers to data or environment information associated with a key statement and required for interpreting or executing the statement. The context information includes at least one of a variable value, a data type, a variable scope, and a function call relationship. Taking the above example, the context information includes the current value of the variable "D002", the content of the loop body, etc., which are necessary for correctly executing the script information.

[0085] The operation content information value in step S2 is the content of the specific operation to be performed according to the operation code and context information. The operation content information includes at least one of the instruction sequence, data operation and function call to be executed. During the script execution process, the operation content information will be dynamically changed and modified according to the operation code and context information. For example, when the operation code corresponds to the loop body execution, the operation content includes the specific instructions or code segments of the loop body, and these instructions or code segments will be executed in each iteration of the loop.

[0086] like Figure 5 As shown, in one embodiment, before step S1, the method may further include the following steps.

[0087] Step P11, obtaining a plurality of script information, and determining a priority order of the response script information according to the triggering sources of the plurality of script information;

[0088] Step P12, determining the target script information according to the priority order.

[0089] In this way, reasonable priorities are assigned to different script information according to the triggering source of the script information, thereby ensuring that when processing multiple script information, more critical or urgent information can be processed first, thereby improving information processing efficiency and response speed.

[0090] In a specific embodiment, the trigger source includes at least one of a system initialization operation, a user real-time input operation, an external interrupt request operation, and a function call operation.

[0091] When processing multiple script messages, the priority order of the response script messages is determined based on the priority and urgency of the trigger source. For example, external interrupts have a higher priority because they represent events that need to be processed immediately, while system initialization or function calls may have a lower priority because they can be processed when the system is idle.

[0092] like Figure 6 As shown, in one embodiment, step S3 of the present invention may specifically include the following steps.

[0093] Step S31, determining the operation type information and the corresponding operation parameter information according to the key sentence;

[0094] Step S32, determining an identifier according to the operation type, and determining context information corresponding to the key sentence according to the identifier;

[0095] Step S33: determining N groups of operation content information matching the corresponding operation code according to the context information.

[0096] In this way, by parsing key statements to accurately identify and configure operation types and their related parameters, and extracting contextual information matching these operation types, multiple sets of operation content information corresponding to specific operation codes are determined, which helps to better understand the integrity and contextual relevance of operation instructions, and avoid misunderstandings or errors that may result from interpreting operation instructions in isolation.

[0097] Operation type information refers to the category or identification of a certain operation or function, which is used to guide the system or program to perform which type of operation. For example, in the example "if D002>10", "if" is the operation type information, which indicates a conditional judgment operation. The system or program determines whether the subsequent operation needs to judge whether a condition is met based on this operation type information.

[0098] Operation parameter information refers to the parameters or conditions required when performing an operation, and the parameters or conditions are used to specifically guide how the operation is performed. For example, in the example "if D002>10", "D002>10" is the operation parameter information, which provides the specific content of the conditional judgment, that is, judging whether the value of the variable "D002" is greater than 10.

[0099] Operation content information refers to the specific operation or code block that needs to be executed when the operation type is determined and the operation parameters meet the conditions. For example, in the example "if D002>10then{xxxx}", "{xxx}" is the operation content information, which means that if the condition "D002>10" is true, the code or operation in the curly braces needs to be executed, and "xxx" can be one or more statements, function calls or other operations.

[0100] In one embodiment, step S2 of the present invention may specifically include the following steps.

[0101] Step S21, determining the order relationship of N key sentences in the script information;

[0102] Step S22: Execute the operations corresponding to the operation information associated with the N key sentences according to the sequence relationship.

[0103] In this way, by accurately parsing and executing key statements in the script information, we can ensure that the task or program can run efficiently and accurately in the predetermined logical order, enhance the controllability and predictability of the entire process, and make the automated processing of complex tasks possible.

[0104] Specifically, a first key statement and a second key statement carrying a control field in the target script information are determined, and the first key statement and the second key statement have a first sequential relationship; based on this, step S3 may specifically include: determining a first operation code according to the first key statement, determining first context information corresponding to the first key statement in the target script information, determining first operation content information matching the first operation code according to the first context information, and determining a second operation code according to the second key statement, determining second context information corresponding to the second key statement in the target script information, and determining second operation content information matching the second operation code according to the second context information; in accordance with the first sequential relationship, performing an operation corresponding to the first operation code on the first operation content information, and performing an operation corresponding to the second operation code on the second operation content information.

[0105] The order relationship refers to the order in which N key statements are arranged according to certain logic or rules in the target script information. This order relationship defines the order in which the key statements are processed or executed. The order relationship is crucial in script execution. It can ensure the correctness of script logic and the consistency of operations. If the order relationship is disrupted, it may cause script execution errors and even lead to unpredictable results.

[0106] In a specific embodiment, the “performing an operation corresponding to a first operation code on the first operation content information, and performing an operation corresponding to a second operation code on the second operation content information” may further specifically include the following steps.

[0107] Step S221, performing an operation corresponding to a first operation code on the first operation content information, and updating a state parameter of the first operation content information;

[0108] Step S222, determining whether the state parameter of the current first operation content information matches the operation parameter in the second operation code;

[0109] If so, jump to step S223, update the second operation content information according to the state parameter of the current first operation content information, and perform the operation corresponding to the second operation code on the updated second operation content information.

[0110] In this way, by executing the operation corresponding to the first operation code on the first operation content information and updating its state parameters in real time, it is ensured that the first stage of the task can be completed as expected, and accurate state feedback is provided for subsequent operations, achieving conditional connection and state synchronization between operations, so as to ensure the accuracy and consistency of task execution.

[0111] State parameters are the specific state of the target script information at a certain moment or stage during the execution process. The stage or state can be represented by a set of physical quantities or data. In other words, these physical quantities or data can be called state parameters.

[0112] The state parameter of the first operation content information: refers to the state of the first operation content information after the operation corresponding to the first operation code is executed, which is represented by a set of data or physical quantities. The operation parameter in the second operation code: refers to a set of data, conditions or physical quantities that need to be referenced or input before executing the operation corresponding to the second operation code. Determine whether the state parameter of the first operation content information meets the requirements or conditions of the operation parameters in the second operation code. If satisfied, it means that the two operations can be smoothly connected and the task can continue to be executed; if not satisfied, additional measures may need to be taken to adjust the state parameters, or re-evaluate the operation sequence and conditions.

[0113] The above-mentioned various implementation modes, embodiments or specific examples provided by the present invention can be combined with each other to finally form multiple better implementation modes.

[0114] Figure 7 The present invention shows the communication between the script loading module, the script parsing module and the script execution module in a script language processing system based on FPGA in a preferred embodiment. Figure 7 The content shown summarizes the interaction process between the above three modules.

[0115] In the FPGA-based script language processing system, the script loading module can use its internal submodules to obtain the target script information and output the target script information to the script parsing module; after receiving the target script information, the script parsing module parses the target script information to determine the key statements carrying the control field in the target script information; determines the corresponding operation code and current context information according to the key statements, and outputs them to the script execution module; the script execution module classifies the received operation code and determines the corresponding execution submodule (for example, IO access processing, data calculation processing, system control processing, etc.); the execution submodule determines the operation content information matching the corresponding operation code according to the context information; performs the specific operation corresponding to the operation code on the operation content information, and feeds back the execution result to the script parsing module for subsequent processing or jump judgment.

[0116] Specifically, in the FPGA-based script language processing system, by restarting the program or system, temporary data in the memory can be cleared, various state variables can be reset, etc., and the system is in a reset state. After the system completes the reset operation, the initialization loading submodule is activated to select and load the script information for implementing system initialization. The initialization script information is obtained, the initialization script information is verified, and the verified initialization script information is transmitted to the script parsing module for subsequent parsing and execution.

[0117] When the external script input submodule receives script information input by the user in real time (for example, through communication interfaces such as UART and USB), the submodule will cache these commands and mark them as script information to be processed, and transmit them to the script parsing module according to the set process for subsequent parsing and execution.

[0118] When an external device or sensor triggers an interrupt signal, the interrupt signal is captured by the external interrupt control submodule. The submodule generates the script information of the corresponding interrupt function call according to the interrupt type and the preset mapping relationship. The script information is passed to the script parsing module for subsequent parsing and execution. In addition, the external interrupt control submodule can also handle complex situations such as interrupt priority and interrupt nesting.

[0119] When the script execution module encounters a function call instruction during the execution process, it will send a loading request to the calling function reading submodule, and the loading request includes loading information such as the function name, parameters, and return value type; the calling function reading submodule searches for the corresponding function script command from the function library or script file in the memory according to the loading information, and passes it to the script parsing module for parsing. The parsed operation code and context information are passed to the script execution module for execution, thereby realizing the function call and execution.

[0120] In summary, the present invention parses the target script information to determine the key statements carrying the control field, and based on these key statements, the corresponding operation codes can be accurately determined; the context information of the key statements is analyzed to obtain the operation content information matching the operation code; and the operation content information is executed according to the determined operation code, so that the target script information can correctly save, update and transmit the operation content information during the execution process, ensuring the precise match between the operation code and the operation content information, thereby improving the execution efficiency of the target script information, enhancing the accuracy of the script execution, and ensuring that the script execution result is consistent with expectations.

[0121] It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

[0122] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.

Claims

1. A script information execution method, characterized in that: include: Get target script information; Determine N key statements carrying control fields in the target script information, and determine corresponding N groups of operation codes according to the key statements; Determine context information corresponding to the key statement in the target script information, and determine N groups of operation content information matching the corresponding operation code according to the context information; An operation corresponding to the operation code is performed on the operation content information.

2. The script information execution method according to claim 1, characterized in that: Determining context information corresponding to the key sentence in the target script information, and determining N groups of operation parameter information matching the corresponding operation type information according to the context information, including: According to the key statement, determine the operation type information and the corresponding operation parameter information; Determine an identifier according to the operation type, and determine context information corresponding to the key sentence according to the identifier; N groups of operation content information matching the corresponding operation code are determined according to the context information.

3. The script information execution method according to claim 1, characterized in that: The determining of N key statements carrying control fields in the target script information includes: Determine a first key statement and a second key statement carrying a control field in the target script information, wherein the first key statement and the second key statement have a first order relationship; The determining of context information corresponding to the key statement in the target script information, and determining N groups of operation content information matching the corresponding operation code according to the context information, includes: Determine a first operation code according to the first key statement, determine first context information corresponding to the first key statement in the target script information, determine first operation content information matching the first operation code according to the first context information, and Determine a second operation code according to the second key statement, determine second context information corresponding to the second key statement in the target script information, and determine second operation content information matching the second operation code according to the second context information; In the first order relationship, an operation corresponding to the first operation code is performed on the first operation content information, and an operation corresponding to the second operation code is performed on the second operation content information.

4. The script information execution method according to claim 3, characterized in that: The performing an operation corresponding to a first operation code on the first operation content information, and performing an operation corresponding to a second operation code on the second operation content information, comprises: Performing an operation corresponding to a first operation code on the first operation content information, and updating a state parameter of the first operation content information; Determine whether the state parameter of the current first operation content information matches the operation parameter in the second operation code; If so, the second operation content information is updated according to the state parameter of the current first operation content information, and the operation corresponding to the second operation code is performed on the updated second operation content information.

5. The script information execution method according to claim 1, characterized in that: Before obtaining the target script information, the method further includes: Acquire a plurality of script information, and determine a priority order of the response script information according to trigger sources of the plurality of script information; The target script information is determined according to the priority order.

6. A script information execution system, characterized in that: The system includes an FPGA, and the FPGA includes: The UART controller is used to receive the original information from the input end of the execution system, and perform data processing on the original information to determine the corresponding target script information; A script module is used to receive and execute the script information execution method described in any one of claims 1-5 according to the target script information.

7. The script information execution system according to claim 6, characterized in that: The script module includes: Script loading module, used to obtain target script information; A script parsing module, used to parse the target script information, determine the corresponding N groups of operation codes and the N groups of operation content information matching the corresponding operation codes; The script execution module is used to execute the operation corresponding to the operation code on the operation content information.

8. The script information execution system according to claim 7, characterized in that: The script loading module includes a first unit and a second unit, the first unit is used to obtain a number of script information, and the second unit is used to determine the priority order of the response script information according to the triggering source of the several script information, and determine the target script information according to the priority order.

9. The script information execution system according to claim 7, characterized in that: The context information includes at least one of the operation instruction information and the operation status information; the script parsing module includes a first cache area and a second cache area, the first cache area is used to store the operation status information of the script information, and the second cache area is used to store the operation instruction information of the script information.

10. The script information execution system according to claim 7, characterized in that: The script execution module includes a third unit and several script execution sub-units. The third unit is used to determine the corresponding operation type according to the operation code, and determine the corresponding script execution sub-unit according to the operation type.