Method, system, platform and medium for running process template mixed script

Through the operation method of mixed scripts with process templates, the script fragments are analyzed and executed, the process configuration and operation of business process links are generated, and the existing system's shortcomings in flexibility and detail processing are solved, and flexible customization and highly encapsulated process construction is achieved.

CN119201213BActive Publication Date: 2025-03-07E SURFING IOT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411718669.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-07
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The existing business process engines and task orchestration systems have shortcomings in processing details and flexibility, and are difficult to meet complex business needs. They need to be deeply expanded to achieve satisfactory process construction.

Method used

A method of running a process template mixed script is proposed. By obtaining the business process template, analyzing and generating script fragments, creating data context instances and script run stacks, executing script fragments to generate process configuration fragments, and running the business process links forward until the script fragment is completed.

Benefits of technology

It realizes flexible customization and highly packaged processes, quickly builds the processes required for various businesses, and improves the flexibility and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201213B_ABST
    Figure CN119201213B_ABST
Patent Text Reader

Abstract

The present application relates to a method, system, platform and medium for running a hybrid script of a process template, wherein the method includes: obtaining a business process template, parsing the business process template according to the hybrid script, and generating several script fragments; if an instance of starting to run a business process is detected, creating a data context instance based on the instance, and storing the input data in the data context instance; creating a script running stack, and storing the script fragments in the script running stack in reverse order; creating a configuration buffer corresponding to the instance, executing the script fragment to generate a process configuration fragment, and storing the process configuration fragment in the configuration buffer; forward parsing the configuration buffer, and running the parsed business process links until the script fragments in the script running stack are finished running. The present application implements flexible customization and highly encapsulated processes, and quickly builds the processes required for various businesses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology for the Internet of Things, and in particular to a method, system, platform and medium for running a process template mixed script. Background Art

[0002] Although existing low-code systems such as business process engines and task orchestration have advantages such as high encapsulation and visual customization, the flexibility of the system is obviously insufficient. When dealing with details, it either cannot meet the needs or requires in-depth research and various extensions to achieve it. Summary of the invention

[0003] The purpose of the embodiments of the present application is to propose a method, system, platform and medium for running a process template mixed script to achieve a flexibly customizable and highly encapsulated process and quickly build the processes required for various businesses.

[0004] In order to solve the above technical problems, the embodiment of the present application provides a method for running a process template mixed script, including:

[0005] Obtaining a business process template, parsing the business process template according to the mixed script, and generating a plurality of script fragments;

[0006] If it is detected that an instance of the business process starts to run, a data context instance is created based on the instance, and the input data is stored in the data context instance;

[0007] Creating a script execution stack, and storing the script fragments in the script execution stack in reverse order;

[0008] Creating a configuration buffer corresponding to the instance, executing the script fragment to generate a process configuration fragment, and storing the process configuration fragment in the configuration buffer;

[0009] The configuration buffer is forward parsed, and the parsed business process links are executed until the script fragments in the script execution stack are executed.

[0010] In order to solve the above technical problems, the embodiment of the present application provides a system for running a process template mixed script, including:

[0011] A template parsing module is used to obtain a business process template, parse the business process template according to the mixed script, and generate a number of script fragments;

[0012] A data context module, configured to, if detecting that an instance of a business process starts to run, create a data context instance based on the instance and store input data in the data context instance;

[0013] A running stack creation unit, used for creating a script running stack and storing the script fragments in the script running stack in reverse order;

[0014] A script execution module, used to create a configuration buffer corresponding to the instance, execute the script fragment to generate a process configuration fragment, and store the process configuration fragment into the configuration buffer;

[0015] The process parsing module is used to parse the configuration buffer forward and run the parsed business process links until the script fragments in the script execution stack are completed.

[0016] In order to solve the above technical problems, a technical solution adopted by the present invention is: to provide an Internet of Things platform, including one or more processors; a memory for storing one or more programs, so that one or more processors can implement the operation method of the process template mixed script described in any one of the above items.

[0017] To solve the above technical problems, a technical solution adopted by the present invention is: a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the operating method of the process template mixed script described in any one of the above items is implemented.

[0018] The embodiment of the present invention provides a method, system, platform and medium for running a mixed script of a process template. The method includes: obtaining a business process template, parsing the business process template according to the mixed script, and generating several script fragments; if an instance of starting to run a business process is detected, creating a data context instance based on the instance, and storing the input data in the data context instance; creating a script running stack, and storing the script fragment in reverse order in the script running stack; creating a configuration buffer corresponding to the instance, executing the script fragment to generate a process configuration fragment, and storing the process configuration fragment in the configuration buffer; forward parsing the configuration buffer, and running the parsed business process link until the script fragment in the script running stack is completed. The embodiment of the present invention synchronizes the parsing of the process configuration and the running of the process through a mixed script, so that the two can feed back data to each other, realize flexible customization and highly encapsulated processes, and quickly build processes required for various businesses. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are 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.

[0020] Figure 1 It is a flowchart of the implementation of the method flow of running the process template mixed script provided in the embodiment of the present application;

[0021] Figure 2 is a specific implementation flow chart of step S1 provided in an embodiment of the present application;

[0022] Figure 3 is a specific implementation flow chart of step S15 provided in an embodiment of the present application;

[0023] Figure 4 is a specific implementation flow chart of step S5 provided in an embodiment of the present application;

[0024] Figure 5 is a specific implementation flow chart of step S51 provided in an embodiment of the present application;

[0025] Figure 6 is a specific implementation flow chart of step S52 provided in an embodiment of the present application;

[0026] Figure 7 It is a schematic diagram of the operating system of the process template mixed script provided in the embodiment of the present application;

[0027] Figure 8 It is a schematic diagram of the Internet of Things platform provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0029] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0031] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0032] It should be noted that the method for running the process template hybrid script provided in the embodiment of the present application is generally executed by an Internet of Things platform, and accordingly, the running system of the process template hybrid script is generally configured in the Internet of Things platform.

[0033] The operation method of the process template mixed script provided in the embodiment of the present application can be used for various data processing, such as IoT terminal data processing, big data processing, etc. It is suitable for various business processing, such as business process customization, task scheduling, intelligence, etc. It can be used in multiple links of the application platform life cycle, such as R&D, testing, operation and maintenance, monitoring, BI, etc.

[0034] Explanation of the names in the embodiments of the present application: A process link refers to an executable link or task in a business process engine or task orchestration system. A process refers to a sequence of several process links, and a business process engine or task orchestration system can execute the links in the sequence according to the configuration. A stack is a linear table that is limited to insertion and deletion operations only at the end of the table. The characteristic is that the things put into the stack are taken out in reverse order. For example, if 1, 2, 3, 4, and 5 are put into the stack in sequence, the first thing taken out is 5, followed by 4, and so on. The data path is similar to JSONPATH or XPATH, and is used to retrieve data.

[0035] The method provided in the embodiment of the present application is composed of the following modules:

[0036] Template parsing module: parses the template before it runs, parsing it into several script fragments instead of executable process configuration. Script execution module: executes the script fragments, generates process configuration fragments and puts them into the configuration buffer.

[0037] The configuration buffer is a text streaming buffer. Only the script execution module can append text to the end of the buffer, and only the process parsing module can read text at the beginning of the buffer. And when the buffer is empty, that is, the end is equal to the beginning, when a read operation is encountered, the script execution module will be actively notified to execute a new script fragment.

[0038] Process parsing module: reads the text in the configuration buffer, parses the process configuration one by one, and puts each parsed process link into the process link running module for execution. Process link running module: runs the process link and puts the running data into the context module. Data context module: manages the data of each process running instance. Field evaluation module: can use the data path to obtain specified data from the data context or other data sources.

[0039] See also Figure 1, Figure 1 A specific implementation of a method for running a process template hybrid script is shown.

[0040] It should be noted that if there are substantially the same results, the method of the present invention is not limited to Figure 1 The process sequence shown is limited to the following steps:

[0041] S1: Obtain a business process template, parse the business process template according to the mixed script, and generate several script fragments.

[0042] Specifically, a hybrid script is a text embedding tag consisting of placeholders, data paths, and control identifiers. The placeholder is used to identify and distinguish the original process template text and the script; the data path is used to identify the location of the target data that needs to be evaluated; and the control identifier is used to control the branching, looping, and other logic of the script execution. The hybrid method is to insert the script into the existing business process template through the placeholder.

[0043] According to the mixed script, the business process template is parsed into several script fragments. The script fragment type can be fixed text or control script fragment. Among them, the control script fragment can include several sub-script fragments. For frequently run process templates, the parsing results can be cached. The next run directly uses the last parsing result without re-parsing.

[0044] See also Figure 2 , Figure 2 A specific implementation of step S1 is shown, which is described in detail as follows:

[0045] S11: Create a parsing stack.

[0046] S12: Searching forward from the business process template for the placeholder.

[0047] S13: When the placeholder is searched, the process template text of the business process template is intercepted based on the placeholder, and the process template text is stored in the parsing stack.

[0048] S14: Parsing the data path and control identifier in the placeholder.

[0049] S15: Perform script matching and generation according to the type of the control identifier to obtain a plurality of script fragments.

[0050] Specifically, a parsing stack is created to parse the business process template. Placeholders are continuously searched from the business process template. When the placeholder is found, the process template text of the business process template is intercepted based on the placeholder, that is, the previous generation text of the business process template is intercepted from the position of the placeholder to obtain the process template text, and the process template text is stored in the parsing stack. The data path and control identifier in the placeholder are parsed. Script matching and generation are performed according to the type of the control identifier to obtain a number of the script fragments.

[0051] See also Figure 3 , Figure 3 A specific implementation of step S15 is shown, which is described in detail as follows:

[0052] S151: If the control identifier is a control end identifier, extracting a plurality of the script segments from the parsing stack in sequence until a control script segment among the extracted plurality of script segments matches the control end identifier, thereby obtaining a matching script.

[0053] S152: Put the matched script into the matched script as a sub-segment, and store the matched script in the parsing stack.

[0054] S153: If the control identifier is not the control end identifier, a new control script fragment is created according to the control identifier, and the data path corresponding to the control identifier is placed in the new control script fragment, and the new control script fragment is stored in the parsing stack.

[0055] S154: If no new placeholder can be found, the last section of the process template text is used as a fixed text script, and the fixed text script is stored in the parsing stack.

[0056] S155: extract all script fragments in the parsing stack, and record them in reverse order to obtain a script parsing result.

[0057] Specifically, if the control identifier is a control end identifier, several script fragments are taken out from the parsing stack until the control script fragment taken out matches the end identifier, then the other script fragments taken out are placed into the matching script fragment as sub-fragments, and then the matching script fragment is placed back into the parsing stack. If the control identifier is not a control end identifier, a corresponding new control script fragment is created according to the control identifier, and the parsed data path is placed into the new control script fragment, and finally the new script fragment is placed into the parsing stack. If no new placeholder can be searched, the last section of the process template text is placed into the parsing stack as a fixed text script fragment. The parsing takes out all the script fragments in the stack one by one and records them in reverse order, which is the script parsing result.

[0058] S2: If it is detected that an instance of the business process starts to run, a data context instance is created based on the instance, and the input data is stored in the data context instance.

[0059] Specifically, if it is detected that an instance of a business process has started to run, a data context instance is created for the instance through the data context module to record and read various data in this process. At the same time, the input data of this process is put into the data context instance.

[0060] S3: Create a script execution stack, and store the script fragments in the script execution stack in reverse order.

[0061] Specifically, a script running stack is created to store the script fragments in reverse order in the script running stack. When the script is running, the script fragments need to be extracted from the script running stack.

[0062] S4: Create a configuration buffer corresponding to the instance, execute the script fragment to generate a process configuration fragment, and store the process configuration fragment in the configuration buffer.

[0063] Specifically, create a configuration buffer corresponding to the instance, execute the script fragment to generate a process configuration fragment, and store the process configuration fragment in the configuration buffer. The configuration buffer is a text streaming buffer. Only the script execution module can append text to the end of the buffer, and only the process parsing module can read text at the beginning of the buffer. And when the buffer is empty, that is, the end is equal to the beginning, when a read operation is encountered, the script execution module will be actively notified to execute a new script fragment.

[0064] S5: parsing the configuration buffer forward, and running the parsed business process links until the script fragments in the script execution stack are finished running.

[0065] Specifically, the process parsing module starts to read the configuration from the configuration buffer. If it can be read, it will parse forward. Each time a business process link is parsed, it will be handed over to the process link running module to run and wait for the link to finish running before continuing to parse forward until the script fragment in the script running stack is finished running.

[0066] See also Figure 4 , Figure 4 A specific implementation of step S5 is shown, which is described in detail as follows:

[0067] S51: forward parsing the configuration buffer, when parsing out a business process link, after running the business process link, continuing to forward parse the configuration buffer.

[0068] See also Figure 5 , Figure 5 A specific implementation of step S51 is shown, which is described in detail as follows:

[0069] S511: forwardly parse the configuration buffer, and when a business process link is parsed out, execute the business process link.

[0070] S512: Record the operation information of the business process link into the context instance, wherein the operation information includes input information, configuration information, operation information and output information.

[0071] S513: When the business process link is completed, continue to parse the configuration buffer forward;

[0072] S514: If the business process link is determined to be the last process link, the output of the business process link is used as the target output.

[0073] Specifically, the configuration buffer is forward parsed, and when a business process link is parsed, the business process link is run. The running information of the business process link is recorded in the context instance, wherein the running information includes input information, configuration information, running information, and output information. When the business process link is completed, the configuration buffer is further forward parsed; if the business process link is determined to be the last process link, the output of the business process link is used as the target output of the entire process.

[0074] S52: When the configuration buffer is empty, extract and execute the script fragment in the script execution stack to generate a new process configuration fragment, and store the new process configuration fragment in the configuration buffer.

[0075] Specifically, when the configuration buffer is empty, it is necessary to extract and execute the script fragment in the script execution stack, generate a new process configuration fragment, and store the new process configuration fragment in the configuration buffer so that the script execution and parsing can continue.

[0076] See also Figure 6 , Figure 6 A specific implementation of step S52 is shown, which is described in detail as follows:

[0077] S521: When the configuration buffer is empty, extract the script fragment in the script execution stack as the current script fragment.

[0078] S522: If the current script segment is fixed text, output the fixed text to the configuration buffer.

[0079] S523: When a control script fragment in the fixed text is read, control processing is performed according to the control type of the control script fragment in the fixed text to generate the new process configuration fragment, and the new process configuration fragment is stored in the configuration buffer, wherein the control processing includes evaluation, conversion, branching and looping.

[0080] Specifically, when the configuration buffer is empty, extract the script fragment in the script execution stack as the current script fragment. If the current script fragment is a fixed text, the fixed text is output to the configuration buffer. When the control script fragment in the fixed text is read, control processing is performed according to the control type of the control script fragment, a new process configuration fragment is generated, and the new process configuration fragment is stored in the configuration buffer. Wherein, the control processing includes evaluation, conversion, branching and looping.

[0081] Evaluation is to extract data from context, environment or external system according to data path. It mainly reads the data of the running process link through the context, and puts any data of the running process link into the subsequent configuration of the process. Data evaluation is the core function of embedded scripts. The evaluation result can be output to the buffer as text or as a control parameter according to the control type.

[0082] S524: If the current script fragment has a sub-script fragment, determine the sub-script fragment to be stacked according to the control type and parameters of the sub-script fragment, and store the sub-script fragment to be stacked in the script execution stack in reverse order.

[0083] Specifically, if the current script fragment has sub-script fragments, it will be determined whether to push the sub-script fragments into the stack according to the control type and parameters, and the sub-script fragments to be pushed into the stack will be stored in the script running stack in reverse order.

[0084] S53: When the script execution stack is empty, stop forward parsing the configuration buffer.

[0085] Specifically, when the script execution stack is empty, there is no script fragment to parse, so forward parsing of the configuration buffer is stopped.

[0086] The process parsing module is an implementation of process configuration parsing based on JSON format and open source Jackson components. The process link operation module is a basic implementation that supports basic operation links such as RESTful calls, MQ operations, cache operations, database data operations, text parsing, and data verification.

[0087] In an embodiment of the present application, a business process template is obtained, and the business process template is parsed according to a mixed script to generate several script fragments; if an instance of a business process is detected to start running, a data context instance is created based on the instance, and the input data is stored in the data context instance; a script running stack is created, and the script fragments are stored in the script running stack in reverse order; a configuration buffer corresponding to the instance is created, the script fragment is executed to generate a process configuration fragment, and the process configuration fragment is stored in the configuration buffer; the configuration buffer is forward parsed, and the parsed business process links are run until the script fragments in the script running stack are finished running. The embodiment of the present invention synchronizes the parsing of the process configuration and the running of the process through a mixed script, so that the two can feed back data to each other, realize flexible customization and highly encapsulated processes, and quickly build processes required for various businesses.

[0088] The embodiment of the present application can be combined with an existing business process engine or task scheduling system, using the existing business process configuration parsing module and process link operation module to support embedding scripts into the existing business process configuration. After using the visual scheduling function of the existing business process engine or task scheduling system, the embodiment of the present application exports the generated process template, embeds the script, and runs it in the system of the present method to achieve more powerful functions than the existing system.

[0089] Please refer to Figure 7 , as a response to the above Figure 1 The present application provides an embodiment of a system for running a process template mixed script. Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various Internet of Things platforms.

[0090] like Figure 7 As shown, the operating system of the process template mixed script of this embodiment includes: a template parsing module 61, a data context module 62, a running stack creation unit 63, a script execution module 64 and a process parsing module 65, wherein:

[0091] The template parsing module 61 is used to obtain a business process template, parse the business process template according to the mixed script, and generate a plurality of script fragments;

[0092] A data context module 62 is configured to create a data context instance based on the instance when detecting that an instance of a business process starts to run, and store input data in the data context instance;

[0093] A running stack creating unit 63, used for creating a script running stack and storing the script fragments in the script running stack in reverse order;

[0094] A script execution module 64, used to create a configuration buffer corresponding to the instance, execute the script fragment to generate a process configuration fragment, and store the process configuration fragment into the configuration buffer;

[0095] The process parsing module 65 is used to parse the configuration buffer forward and run the parsed business process links until the script fragments in the script execution stack are completed.

[0096] Furthermore, the mixed script includes a placeholder, a data path and a control identifier; the template parsing module 61 includes:

[0097] A parsing stack creation unit, used to create a parsing stack;

[0098] A forward search unit, used to search forward from the business process template for the placeholder;

[0099] An interception unit, configured to intercept a process template text of the business process template based on the placeholder when the placeholder is searched, and store the process template text in the parsing stack;

[0100] A placeholder parsing unit, used for parsing a data path and a control identifier in the placeholder;

[0101] The script generation unit is used to match and generate scripts according to the type of the control identifier to obtain a plurality of script fragments.

[0102] Furthermore, the script generation unit includes:

[0103] A first identification unit is used for, if the control identifier is a control end identifier, extracting a plurality of the script fragments from the parsing stack in sequence until a control script fragment among the extracted plurality of script fragments matches the control end identifier, thereby obtaining a matching script;

[0104] A sub-segment generation unit, placing the matched script into the matched script as a sub-segment, and storing the matched script into the parsing stack;

[0105] The second identification unit is used to create a new control script fragment according to the control identifier if the control identifier is not the control end identifier, put the data path corresponding to the control identifier into the new control script fragment, and store the new control script fragment in the parsing stack.

[0106] Furthermore, the second identification unit further includes:

[0107] A fixed text script generating unit, configured to use the last section of the process template text as a fixed text script if no new placeholder can be found, and store the fixed text script in the parsing stack;

[0108] The script fragment recording unit is used to extract all script fragments in the parsing stack and record them in reverse order to obtain a script parsing result.

[0109] Furthermore, the process analysis module 65 includes:

[0110] A forward parsing unit, configured to perform forward parsing on the configuration buffer, and when a business process link is parsed, continue to perform forward parsing on the configuration buffer after running the business process link;

[0111] A new fragment generation unit, used for extracting and executing the script fragment in the script execution stack when the configuration buffer is empty, generating a new process configuration fragment, and storing the new process configuration fragment in the configuration buffer;

[0112] The parsing stopping unit is used to stop forward parsing of the configuration buffer when the script execution stack is empty.

[0113] Furthermore, the forward parsing unit includes:

[0114] A process link running unit, used for forward parsing the configuration buffer, and when a business process link is parsed, running the business process link;

[0115] An operation recording unit, used to record the operation information of the business process link into the context instance, wherein the operation information includes input information, configuration information, operation information and output information;

[0116] An operation completion unit, used for continuing to parse the configuration buffer forward after the operation of the business process link is completed;

[0117] The target output determination unit is used to use the output of the business process link as the target output if the business process link is determined to be the last process link.

[0118] Furthermore, the new fragment generation unit includes:

[0119] A current script fragment extraction unit, configured to extract a script fragment in the script execution stack as a current script fragment when the configuration buffer is empty;

[0120] a fixed text generating unit, configured to output the fixed text to the configuration buffer if the current script fragment is a fixed text;

[0121] a configuration fragment storage unit, configured to, when a control script fragment in the fixed text is read, perform control processing according to the control type of the control script fragment in the fixed text, generate the new process configuration fragment, and store the new process configuration fragment in the configuration buffer, wherein the control processing includes evaluation, conversion, branching and looping;

[0122] The sub-script fragment to be stacked determining unit is used for determining the sub-script fragment to be stacked according to the control type and parameters of the sub-script fragment if the current script fragment has a sub-script fragment, and storing the sub-script fragment to be stacked in the script execution stack in reverse order.

[0123] To solve the above technical problems, the present application embodiment also provides an Internet of Things platform. Figure 8 , Figure 8 This is a basic structural block diagram of the Internet of Things platform in this embodiment.

[0124] The Internet of Things platform 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that: Figure 8 Only an IoT platform 7 having three components, memory 71, processor 72, and network interface 73, is shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the IoT platform here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0125] The IoT platform can be a computing device such as a desktop computer, notebook, PDA, or cloud server. The IoT platform can interact with users through keyboard, mouse, remote control, touchpad, or voice control device.

[0126] The memory 71 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 71 can be an internal storage unit of the Internet of Things platform 7, such as a hard disk or memory of the Internet of Things platform 7. In other embodiments, the memory 71 can also be an external storage device of the Internet of Things platform 7, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the Internet of Things platform 7. Of course, the memory 71 can also include both the internal storage unit of the Internet of Things platform 7 and its external storage device. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the Internet of Things platform 7, such as the program code of the running method of the process template mixed script, etc. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or are to be output.

[0127] In some embodiments, the processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 72 is generally used to control the overall operation of the Internet of Things platform 7. In this embodiment, the processor 72 is used to run the program code stored in the memory 71 or process data, such as running the program code of the above-mentioned process template mixed script operation method to implement various embodiments of the process template mixed script operation method.

[0128] The network interface 73 may include a wireless network interface or a wired network interface, and the network interface 73 is generally used to establish a communication connection between the Internet of Things platform 7 and other electronic devices.

[0129] The present application also provides another implementation, namely, providing a computer-readable storage medium, which stores a computer program, and the computer program can be executed by at least one processor to enable the at least one processor to perform the steps of a method for running a process template mixed script as described above.

[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0131] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for running a process template mixed script, characterized in that: include: Obtaining a business process template, parsing the business process template according to the mixed script, and generating a plurality of script fragments; If it is detected that an instance of the business process starts to run, a data context instance is created based on the instance, and the input data is stored in the data context instance; Creating a script execution stack, and storing the script fragments in the script execution stack in reverse order; Creating a configuration buffer corresponding to the instance, executing the script fragment to generate a process configuration fragment, and storing the process configuration fragment in the configuration buffer; Parse the configuration buffer forward and run the parsed business process links until the script fragments in the script execution stack are finished running; The mixed script is a text embedding tag, and the mixed script includes a placeholder, a data path, and a control identifier; the business process template is obtained, and the business process template is parsed according to the mixed script to generate a plurality of script fragments, including: Create a parsing stack; Searching forward from the business process template for the placeholder; When the placeholder is searched, intercepting the process template text of the business process template based on the placeholder, and storing the process template text in the parsing stack; Parsing the data path and control identifier in the placeholder; If the control identifier is a control end identifier, extracting a plurality of the script fragments from the parsing stack in sequence until a control script fragment among the extracted plurality of script fragments matches the control end identifier, thereby obtaining a matching script; placing the matched script into the matched script as a sub-fragment, and storing the matched script in the parsing stack; If the control identifier is not the control end identifier, a new control script fragment is created according to the control identifier, and the data path corresponding to the control identifier is placed in the new control script fragment, and the new control script fragment is stored in the parsing stack.

2. The method for running a process template mixed script according to claim 1, characterized in that: If the control identifier is not the control end identifier, a new control script segment is created according to the control identifier, and the data path corresponding to the control identifier is placed in the new control script segment, and after the new control script segment is stored in the parsing stack, the method further includes: If no new placeholder can be found, the last section of the process template text is used as a fixed text script, and the fixed text script is stored in the parsing stack; All script fragments in the parsing stack are extracted and recorded in reverse order to obtain a script parsing result.

3. The method for running a process template mixed script according to any one of claims 1 to 2, characterized in that: The forward parsing of the configuration buffer and running the parsed business process links until the script fragments in the script running stack are finished running include: The configuration buffer is forward parsed, and when a business process link is parsed, the business process link is run, and then the configuration buffer is further forward parsed; When the configuration buffer is empty, extract and execute the script fragment in the script execution stack to generate a new process configuration fragment, and store the new process configuration fragment in the configuration buffer; When the script execution stack is empty, forward parsing of the configuration buffer is stopped.

4. The method for running a process template mixed script according to claim 3, characterized in that: The forward parsing of the configuration buffer, when parsing out a business process link, after running the business process link, continues to forward parse the configuration buffer, including: Forward parsing the configuration buffer, and when a business process link is parsed, running the business process link; Recording the operation information of the business process link into the context instance, wherein the operation information includes input information, configuration information, operation information and output information; When the business process link is completed, continue to parse the configuration buffer forward; If the business process link is determined to be the last process link, the output of the business process link is used as the target output.

5. The method for running a process template mixed script according to claim 3, characterized in that: When the configuration buffer is empty, extracting and executing the script fragment in the script execution stack, generating a new process configuration fragment, and storing the new process configuration fragment in the configuration buffer, comprises: When the configuration buffer is empty, extracting a script fragment in the script execution stack as the current script fragment; If the current script fragment is a fixed text, outputting the fixed text to the configuration buffer; When a control script fragment in the fixed text is read, control processing is performed according to the control type of the control script fragment in the fixed text to generate the new process configuration fragment, and the new process configuration fragment is stored in the configuration buffer, wherein the control processing includes evaluation, conversion, branching and looping; If the current script fragment has a sub-script fragment, the sub-script fragment to be stacked is determined according to the control type and parameters of the sub-script fragment, and the sub-script fragment to be stacked is stored in the script execution stack in reverse order.

6. A system for running a process template mixed script, characterized in that: include: A template parsing module is used to obtain a business process template, parse the business process template according to the mixed script, and generate a number of script fragments; A data context module, configured to, if detecting that an instance of a business process starts to run, create a data context instance based on the instance and store input data in the data context instance; A running stack creation unit, used for creating a script running stack and storing the script fragments in the script running stack in reverse order; A script execution module, used to create a configuration buffer corresponding to the instance, execute the script fragment to generate a process configuration fragment, and store the process configuration fragment into the configuration buffer; A process parsing module, used to parse the configuration buffer forward and run the parsed business process links until the script fragments in the script execution stack are finished running; The mixed script is a text embedding tag, and the mixed script includes a placeholder, a data path, and a control identifier; the business process template is obtained, and the business process template is parsed according to the mixed script to generate a plurality of script fragments, including: A parsing stack creation unit, used to create a parsing stack; A forward search unit, used to search forward from the business process template for the placeholder; An interception unit, configured to intercept a process template text of the business process template based on the placeholder when the placeholder is searched, and store the process template text in the parsing stack; A placeholder parsing unit, used for parsing a data path and a control identifier in the placeholder; A first identification unit is used for, if the control identifier is a control end identifier, extracting a plurality of the script fragments from the parsing stack in sequence until a control script fragment among the extracted plurality of script fragments matches the control end identifier, thereby obtaining a matching script; A sub-segment generation unit, used for placing the matched script into the matched script as a sub-segment, and storing the matched script into the parsing stack; The second identification unit is used to create a new control script fragment according to the control identifier if the control identifier is not the control end identifier, put the data path corresponding to the control identifier into the new control script fragment, and store the new control script fragment in the parsing stack.

7. An Internet of Things platform, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the method for running the process template mixed script as described in any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for running the process template mixed script according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Work flow based on XML and Flash technology stack engine

    CN107153898A

  • Process control method, device and equipment

    CN116107730A