Script generation method and device, storage medium and electronic equipment
By obtaining control flow, standard events and AI particles in intelligent edge devices and generating target scripts using graphical interfaces, the problem of long development cycle and low efficiency of intelligent edge devices when business logic changes is solved, real-time orchestration and rapid iteration of low-code programming are realized.
Patent Information
- Application Number
- CN202510579249.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, intelligent edge devices need to re-arrange and generate logical scripts when business logic changes, resulting in problems of long development cycle and low development efficiency.
By obtaining the control flow, standard events and AI particles of the program to be developed, the target script is generated using a graphical interface, and the low-code programming method is used to directly perform visual operations in the preset interface to generate the target script.
It realizes logical scripts without compilation, shortens the development iteration cycle of smart edge devices, improves development efficiency and flexibility, and adapts to diversified business scenarios.
Smart Images

Figure CN120508286A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a script generation method, device, storage medium, and electronic device. Background Art
[0002] Intelligent edge devices are widely used in work scenarios such as tower operation and maintenance and construction. Among them, intelligent edge devices are usually equipped with AI (Artificial Intelligence) algorithm tasks. The device can analyze videos, images, etc. through pre-arranged and integrated intelligent analysis processes, and complete different services based on the inference results obtained from the analysis.
[0003] However, when faced with different application scenarios, due to changes in business logic, the pre-orchestrated and integrated intelligent analysis process often cannot directly adapt to business requirements. It needs to be re-orchestrated and adjusted, and new applications need to be iteratively developed. In addition, intelligent edge devices need to be introduced to replace the original algorithm application to meet the needs of changing business processes. This will extend the entire algorithm orchestration adjustment and adaptation cycle, thereby causing technical problems such as long development cycle and low development efficiency.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The present application provides a script generation method, device, storage medium and electronic device to at least solve the technical problems in the prior art of long development cycle and low development efficiency caused by the need to re-arrange and generate logic scripts when the business logic corresponding to the intelligent edge device changes.
[0006] According to one aspect of the present application, a script generation method is provided, including: obtaining control flow and standard events corresponding to a program to be developed, wherein the program to be developed is an application program to be embedded in an intelligent edge device, and the intelligent edge device is a physical device with data processing and intelligent analysis capabilities located at the edge of the network, the control flow is used to characterize the control structure in the program to be developed, and the standard events are used to characterize the different stages of the execution of tasks by the program to be developed; obtaining standard actions and AI particles corresponding to the program to be developed, wherein the standard action is the minimum execution unit in the process of executing tasks by the program to be developed, and the AI particle is the minimum functional module of the AI algorithm embedded in the intelligent edge device; generating a target script based on the control flow, standard events, standard actions and AI particles through a preset interface, wherein the preset interface is a graphical visual operation interface, and the target script is a logic script corresponding to the program to be developed.
[0007] Optionally, a target script is generated based on control flow, standard events, standard actions and AI particles through a preset interface, including: creating L visual controls in the preset interface, where L is a positive integer, and the L visual controls are used to represent the program code corresponding to the control flow, standard events, standard actions and AI particles in the form of visual graphics; obtaining the association relationship between the L visual controls, and generating a target script based on the association relationship between the L visual controls, where the association relationship includes at least one of the following three relationships: an inclusion relationship; a parallel relationship; and a series relationship.
[0008] Optionally, a target script is generated based on the association relationship between L visual controls, including: performing a connection operation on the L visual controls based on the association relationship between the L visual controls to obtain a target flowchart, wherein the target flowchart is used to represent the execution process of the program to be developed; and generating a target script based on the target flowchart and the orchestration specification, wherein the orchestration specification is used to determine the format of the code included in the target script.
[0009] Optionally, before performing a connection operation on the L visual controls based on the association relationship between the L visual controls, the script generation method also includes: obtaining a control type corresponding to each of the L visual controls, and dragging the L visual controls according to the control type corresponding to each visual control, wherein the control type is any one of the following three types: a first type, wherein the first type of visual control is used to represent the code for processing videos and images in the form of visual graphics; a second type, wherein the second type of visual control is used to represent the code corresponding to the AI algorithm in the form of visual graphics; a third type, wherein the third type is a type other than the first type and the second type.
[0010] Optionally, after generating the target script based on control flow, standard events, standard actions and AI particles through a preset interface, the script generation method also includes: embedding the target script into a preset directory, wherein the preset directory is the storage directory of the application that needs to be embedded in the smart edge device; packaging the target script in the preset directory to obtain a target program, wherein the target program is a developed application that allows the smart edge device to run.
[0011] Optionally, after obtaining the target program, the script generation method further includes: when starting the target program, performing an initialization operation on the general framework, wherein the initialization operation is used to update the environment variables of the general framework, and the general framework includes at least L basic components, and the L basic components are hardware in the smart edge device for storing control flow, standard events, standard actions, and codes corresponding to AI particles; after the initialization operation is completed, importing the target program into the parser, wherein the parser is hardware in the smart edge device for parsing the code; reverse-engineering the target program based on the orchestration specification by the parser to obtain executable code; and running the executable code by the executor, wherein the executor is hardware in the smart edge device for performing intelligent analysis tasks.
[0012] Optionally, before importing the target program into the parser, the script generation method also includes: testing the target program based on preset test cases to obtain test results, wherein the preset test cases include at least test steps and test parameters under different application scenarios corresponding to the program to be developed; and transmitting the test results to the operation and maintenance personnel of the smart edge device.
[0013] According to another aspect of the present application, a script generation device is also provided, including: a first acquisition unit, used to obtain the control flow and standard events corresponding to the program to be developed, wherein the program to be developed is an application program that needs to be embedded in the intelligent edge device, and the intelligent edge device is a physical device with data processing and intelligent analysis capabilities located at the edge of the network, the control flow is used to characterize the control structure in the program to be developed, and the standard events are used to characterize the different stages of the execution task of the program to be developed; a second acquisition unit, used to obtain the standard actions and AI particles corresponding to the program to be developed, wherein the standard action is the minimum execution unit in the process of executing the task of the program to be developed, and the AI particle is the minimum functional module of the AI algorithm embedded in the intelligent edge device; a script generation unit, used to generate a target script based on the control flow, standard events, standard actions and AI particles through a preset interface, wherein the preset interface is a graphical visual operation interface, and the target script is a logic script corresponding to the program to be developed.
[0014] According to another aspect of the present application, a computer program product is provided, in which a computer program is stored. When the computer program is running, the computer program product is controlled to execute any one of the above script generation methods.
[0015] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned script generation methods.
[0016] In this application, the control flow and standard events corresponding to the program to be developed are first obtained, wherein the program to be developed is an application program that needs to be embedded in the intelligent edge device, and the intelligent edge device is a physical device with data processing and intelligent analysis capabilities located at the edge of the network. The control flow is used to characterize the control structure in the program to be developed, and the standard events are used to characterize the different stages of the execution of the program to be developed. Afterwards, this application obtains the standard actions and AI particles corresponding to the program to be developed, wherein the standard action is the smallest execution unit in the process of executing the task of the program to be developed, and the AI particle is the smallest functional module of the AI algorithm embedded in the intelligent edge device. Then, this application generates a target script based on the control flow, standard events, standard actions and AI particles through a preset interface, wherein the preset interface is a graphical visual operation interface, and the target script is the logic script corresponding to the program to be developed.
[0017] From the above content, it can be seen that this application abstracts the program to be developed to obtain control flow, standard events, standard actions and AI particles. Afterwards, this application uses a preset interface to visualize the control flow, standard events, standard actions and AI particles. When developing applications corresponding to smart edge devices, developers do not need to write traditional code. Instead, they perform visual operations in the preset interface and directly generate target scripts in a low-code form, thereby achieving the purpose of shortening the development iteration cycle of AI algorithms in smart edge devices.
[0018] It can be seen that this application adopts a visual low-code programming method, and through a preset graphical interface operation method, it achieves the purpose of instantly orchestrating the intelligent analysis process corresponding to the smart edge device, thereby realizing the technical effect of generating logic scripts without compilation, and thus solving the technical problems of long development cycle and low development efficiency caused by the need to re-arrange and generate logic scripts when the business logic corresponding to the smart edge device changes in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 This is a flowchart generated by an optional script according to an embodiment of the present application;
[0021] Figure 2 This is a schematic diagram of an optional arrangement of a business process in a preset interface according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of an optional target flow chart according to an embodiment of the present application;
[0023] Figure 4 It is a flowchart that generates applications on the fly without compilation;
[0024] Figure 5 is a schematic diagram of an optional script generation device according to an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] It should also be noted that the relevant information (including but not limited to information related to the program to be developed) and data (including but not limited to data used for display and analysis) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0029] In addition, the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant information and data involved in this application comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken, and do not violate public order and good morals. In addition, this application provides corresponding operation entrances for users to choose to agree to authorization or refuse authorization. If the user chooses to refuse authorization, he / she will enter the corresponding expert decision-making process.
[0030] According to an embodiment of the present application, an embodiment of a script generation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] In an optional embodiment, the defects of the provided intelligent edge device are as follows:
[0032] (1) The algorithm applications provided by intelligent edge devices are fixed and immutable, and cannot be directly adapted to different application scenarios;
[0033] (2) When smart edge devices need to adjust their business processes, they need to develop algorithm applications, compile new applications, and import them into edge devices to meet the adjustment requirements. This requires a long iteration cycle and high development costs.
[0034] (3) Even if the intelligent edge devices on the market can adjust the algorithm application, they are all controlled by parameter transmission, which has great limitations, especially the ability to orchestrate processes is seriously insufficient.
[0035] Therefore, users and related operation and maintenance personnel are more looking forward to a design method that can achieve AI granular orchestration based on low-code programming, which can dynamically adapt to the business processes corresponding to different application scenarios and take effect immediately, so as to improve the modifiability of intelligent edge devices and increase the iteration speed of intelligent algorithm applications.
[0036] This application provides a script generation system for executing the script generation method in this application. Figure 1 This is a flowchart generated by an optional script according to an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps:
[0037] Step S101, obtain the control flow and standard events corresponding to the program to be developed, where the program to be developed is an application that needs to be embedded in the intelligent edge device, and the intelligent edge device is a physical device with data processing and intelligent analysis capabilities located at the edge of the network. The control flow is used to characterize the control structure in the program to be developed, and the standard events are used to characterize the different stages of the execution task of the program to be developed.
[0038] Optionally, control flow refers to the code used to control the logical direction in the program to be developed, which at least includes conditional judgment, loop execution and branch selection.
[0039] Optionally, standard events define the trigger points of key states during the execution of the program to be developed, such as task start, task stop, task end, etc. By identifying these events, the script generation system can ensure that the program can perform state transitions according to preset rules and timing.
[0040] Optionally, the hardware solution for the intelligent edge device involves the following:
[0041] The intelligent edge device is based on the Rk3568 (a type of processor chip) / Rk3588 (a type of processor chip) / NX (a type of neural network accelerator) chip, and includes a complete NPU and GPU neural network computing chip, a hardware codec chip, RJ45 (Registered Jack 45, an Ethernet connection interface), RS485 (Recommended Standard 485, an electrical standard for serial data communication) / RS232 (Recommended Standard 232, an electrical standard for serial data communication), AI (Analog Input, analog input) / DI (Digital Input, digital input), DO (Digital Output, digital output), USB (Universal Serial Bus) and other device interfaces, network communication module, video processing module, algorithm loading module, hard decoding module, tailored ARM (Advanced RISC Machines, advanced reduced instruction set machine) architecture and Ubuntu (a Linux-based operating system), adapted to the above different types of hardware drivers to facilitate the normal execution of AI applications.
[0042] In step S101, the script generation system analyzes the business requirements of the program to be developed and determines its control structure during runtime, such as when to start the task, what conditions require switching the execution path, and when to end the task, thereby determining the business logic of the intelligent edge device, laying the foundation for subsequent target script generation, and ensuring the integrity and rationality of the intelligent analysis process.
[0043] Step S102: Obtain standard actions and AI particles corresponding to the program to be developed, where the standard action is the smallest execution unit in the process of executing the task of the program to be developed, and the AI particle is the smallest functional module of the AI algorithm embedded in the intelligent edge device.
[0044] Optionally, a standard action refers to the basic operational unit for executing an intelligent task, including at least reading task parameters, initializing the model, pulling video streams, extracting image frames, generating identifiers, and generating data. Standard actions are an indispensable part of intelligent edge devices' intelligent analysis process and are highly reusable.
[0045] Optionally, AI particles refer to the refined functional modules of intelligent algorithms, including at least object detection, classification, segmentation, and tracking. The script generation system can form complex intelligent analysis tasks by combining AI particles, thereby meeting business needs in different scenarios.
[0046] In step S102, the script generation system decomposes and abstracts the program to be developed, thereby breaking down the complex running process of the program to be developed into units that are easier to manage and combine, thereby achieving the purpose of subsequently visually arranging the above-mentioned units in a preset interface.
[0047] Step S103: Generate a target script based on control flow, standard events, standard actions, and AI particles through a preset interface, wherein the preset interface is a graphical visualization operation interface, and the target script is a logic script corresponding to the program to be developed.
[0048] Optionally, the preset interface is a visual operation interface, on which developers can intuitively design the process logic of the program by dragging controls, connecting lines, etc.
[0049] Optionally, Figure 2 This is a schematic diagram of an optional arrangement of a business process in a preset interface according to an embodiment of the present application, such as Figure 2 As shown: Figure 2 The Event in corresponds to the standard event in this application. Figure 2 The Action in corresponds to the standard action in this application. Figure 2 The Process in corresponds to the AI particles abstracted in this application.
[0050] In step S103, a target script is generated based on control flow, standard events, standard actions, and AI particles through a preset interface, thereby achieving the purpose of visual design and automatic conversion of the intelligent analysis process. Developers do not need to write traditional code, but can complete the orchestration of intelligent algorithm tasks through simple and intuitive operations, thereby lowering the technical threshold and improving development efficiency.
[0051] Through the above steps, the script generation system can significantly reduce the development cycle of intelligent edge devices when switching between different business scenarios, avoid tedious code rewriting due to changes in business logic, and achieve rapid iteration and efficient deployment of intelligent algorithms. The above steps not only improve the flexibility of intelligent edge devices, but also provide users with a more convenient programming method, promoting the popularization and application of AI algorithms in actual application scenarios.
[0052] From the above content, it can be seen that this application abstracts the program to be developed to obtain control flow, standard events, standard actions and AI particles. Afterwards, this application uses a preset interface to visualize the control flow, standard events, standard actions and AI particles. When developing applications corresponding to smart edge devices, developers do not need to write traditional code. Instead, they perform visual operations in the preset interface and directly generate target scripts in a low-code form, thereby achieving the purpose of shortening the development iteration cycle of AI algorithms in smart edge devices.
[0053] It can be seen that this application adopts a visual low-code programming method, and through a preset graphical interface operation method, it achieves the purpose of instantly orchestrating the intelligent analysis process corresponding to the smart edge device, thereby realizing the technical effect of generating logic scripts without compilation, and thus solving the technical problems of long development cycle and low development efficiency caused by the need to re-arrange and generate logic scripts when the business logic corresponding to the smart edge device changes in the existing technology.
[0054] In an optional embodiment, the script generation system first creates L visual controls in a preset interface, where L is a positive integer. The L visual controls are used to represent control flows, standard events, standard actions, and program codes corresponding to AI particles in the form of visual graphics. Then, the script generation system obtains associations between the L visual controls and generates a target script based on the associations between the L visual controls. The associations include at least one of the following three relationships:
[0055] Containment relationship;
[0056] Parallel relationship;
[0057] Series relationship.
[0058] Optionally, an inclusion relationship represents that a certain visual control or process logic is included by another visual control or logic; a parallel relationship represents that multiple visual controls or process logics can run simultaneously, which is suitable for scenarios that require multi-channel input data processing; a series relationship represents the sequential execution between visual controls or process logics, which can ensure that intelligent analysis tasks are performed in a predetermined order.
[0059] In the above embodiment, the script generation system converts complex program logic into visual controls, thereby providing users with an intuitive and easy-to-understand programming method, thereby reducing the difficulty of programming AI algorithms in smart edge devices.
[0060] In the above-mentioned embodiments, the script generation system lowers the threshold for deploying AI algorithms on intelligent edge devices by creating visual controls, obtaining control relationships, and automating script generation. This reduces the update or development cycle for AI algorithms in intelligent edge devices, thereby enhancing the responsiveness and flexibility of intelligent edge devices to diverse business scenarios. Furthermore, this graphical programming approach makes it easy for non-professionals to participate in the customization of intelligent analysis processes, further promoting the practical application and development of AI technology.
[0061] In an optional embodiment, the script generation system first connects L visual controls based on the association relationship between the L visual controls to obtain a target flowchart, wherein the target flowchart is used to represent the execution process of the program to be developed. Afterwards, the script generation system generates a target script based on the target flowchart and the orchestration specification, wherein the orchestration specification is used to determine the format of the code included in the target script.
[0062] Optionally, based on the L visual controls created previously, the user connects these controls by dragging cables or arrows in the graphical interface to determine the execution order and logical relationship between them. The connection operation achieves the purpose of converting program development requirements into a flowchart that can be recognized by the computer. It ensures that all controls can be executed in an orderly manner according to the preset logical structure, laying the foundation for subsequent script generation.
[0063] Optionally, through the constraints of the orchestration specifications, the target script generated by the script generation system will meet the execution requirements of the intelligent edge device, so that it can be directly embedded in the device without the need for additional compilation steps, realizing the instant deployment of intelligent algorithms.
[0064] In the above embodiment, the script generation system directly generates a target flowchart by connecting multiple visual controls. Then, the flowchart is converted into a target script according to the orchestration specification. This process simplifies the deployment of AI algorithms on smart edge devices. Compared with traditional programming methods, this method has the following advantages:
[0065] (1) Intuitive and easy to use: Users can easily design complex intelligent analysis processes through a graphical interface without having to deeply understand programming details.
[0066] (2) Efficient and fast: Target script generation does not require a complex compilation process, shortening the AI algorithm update and development cycle.
[0067] (3) High flexibility: Based on the target flowchart, the process logic can be quickly adjusted to adapt to different business scenarios, improving the adaptability and response speed of smart edge devices.
[0068] In an optional embodiment, the script generation system first obtains a control type corresponding to each of the L visual controls, and performs a drag operation on the L visual controls according to the control type corresponding to each visual control, wherein the control type is any one of the following three types:
[0069] The first type, wherein the first type of visualization control is used to represent the code for processing videos and images in the form of visual graphics; the second type, wherein the second type of visualization control is used to represent the code corresponding to the AI algorithm in the form of visual graphics; the third type, wherein the third type is a type other than the first type and the second type.
[0070] Optionally, Figure 3 is a schematic diagram of an optional target flow chart according to an embodiment of the present application, such as Figure 3 As shown: Figure 3 The video stream in is the first type in this application, Figure 3 The AI in is the second type in this application, Figure 3 The task flow in is the third type in this application.
[0071] In the above embodiment, the script generation system obtains the control types of L visual controls and performs drag operations according to the control type corresponding to each visual control, so that users can intuitively and efficiently complete the construction and adjustment of the intelligent analysis process, which reduces the difficulty of AI algorithm deployment and improves the speed of process orchestration, enabling intelligent edge devices to respond more quickly to changing application scenario requirements, thereby accelerating the iteration and optimization of intelligent analysis tasks.
[0072] Furthermore, the script generation system encapsulates complex technical details in visual controls, allowing non-professionals to participate in the deployment and management of intelligent algorithms, thereby expanding the user group and application areas of smart edge devices and improving the customizability of smart edge devices.
[0073] In an optional embodiment, the script generation system first embeds the target script into a preset directory, where the preset directory is the storage directory of the application that needs to be embedded in the smart edge device. Then, the target script is packaged in the preset directory, and the script generation system obtains the target program, where the target program is a developed application that allows the smart edge device to run.
[0074] Optionally, in the file system of the smart edge device, there are one or more specially reserved directories (i.e., preset directories) for storing applications to be run. The location and naming of the directory are fixed to simplify the software management and upgrade process on the device, thereby ensuring that the target script can be correctly identified and loaded by the executor on the smart edge device.
[0075] Optionally, after the target script is embedded in the preset directory, the script generation system will package the contents in the directory, which usually includes but is not limited to the target script itself, the script's necessary configuration files, and the AI algorithm model files, thereby forming a complete application (i.e., the target program).
[0076] In the above embodiment, the embedding and packaging operations of the target script greatly simplifies the deployment process of the intelligent algorithm on the intelligent edge device, eliminating the need for complex compilation and configuration steps, thereby improving the convenience and speed of deployment. In addition, by storing and packaging programs in preset directories, the security and integrity of the application are ensured, avoiding operational errors caused by missing files or directory confusion.
[0077] In an optional embodiment, when starting the target program, the script generation system first initializes the general framework, wherein the initialization operation is used to update the environment variables of the general framework, and the general framework includes at least L basic components, and the L basic components are hardware in the smart edge device for storing control flow, standard events, standard actions, and codes corresponding to AI particles. After the initialization operation is completed, the script generation system imports the target program into the parser, wherein the parser is hardware in the smart edge device for parsing the code. Then, the script generation system reversely parses the target program based on the orchestration specification through the parser to obtain executable code. Finally, the script generation system runs the executable code through the executor, wherein the executor is hardware in the smart edge device for performing intelligent analysis tasks.
[0078] Optionally, Figure 4 It is a flowchart that generates an application program without compilation, such as Figure 4 As shown, the process of generating an application without compilation is as follows:
[0079] (1) Abstractly split the AI algorithm application into two parts: the "shell" and the "core";
[0080] (2) The “shell” adopts a general framework to implement general functions and include basic capability components;
[0081] (3) The “core” consists of a “parser” and an “executor”. When it starts, it parses the specified process logic script and generates an executable code segment and imports it into the memory. When the code segment is ready, it calls back the “shell” to drive the executor to execute the code.
[0082] (4) The executor code implements the functional logic by calling the basic capability components contained in the "shell".
[0083] Optionally, the application runs as follows:
[0084] (1) The general framework initializes environment variables and basic components when the program starts;
[0085] (2) After initialization is completed, import the target script in the specified directory and verify the validity of the target script;
[0086] (3) After verification, the parser reverse-parses the target script according to the orchestration specification, generates a code segment that can be recognized by the executor, and stores the code segment in the executor;
[0087] (4) The executor starts executing instructions from the code segment entry until the end.
[0088] In the above embodiment, the script generation system ensures that all necessary basic components on the device can correctly identify and load the intelligent analysis tasks to be executed by updating the environment variables. Moreover, through the above steps, the intelligent edge device can realize dynamic intelligent algorithm deployment that can be run without compilation, quickly initialize the general framework when the device starts, then use the parser to reverse parse the code, and finally run the intelligent analysis task directly through the executor. The whole process is smooth and instant. The introduction of this mechanism can improve the application efficiency and flexibility of intelligent edge devices when facing diverse scenario requirements.
[0089] In an optional embodiment, the script generation system first tests the target program based on preset test cases to obtain test results, wherein the preset test cases include at least test steps and test parameters under different application scenarios corresponding to the program to be developed. Finally, the script generation system transmits the test results to the operation and maintenance personnel of the smart edge device.
[0090] Optionally, the above-mentioned preset test cases cover different application scenarios encountered by the target program; the test steps define the order and method of test execution; and the test parameters include input data and expected output results used to verify the correctness of the program during the test.
[0091] In the above embodiment, the script generation system can verify the accuracy and reliability of the target program through testing, ensuring that it can normally perform intelligent analysis tasks when it is actually deployed on the smart edge device, avoiding errors and anomalies generated when running directly on the device.
[0092] In the above embodiment, the reliability and effectiveness of the intelligent algorithm on the intelligent edge device are ensured by performing detailed testing on the target program based on preset test cases.
[0093] From the above content, it can be seen that this application abstracts the program to be developed to obtain control flow, standard events, standard actions and AI particles. Afterwards, this application uses a preset interface to visualize the control flow, standard events, standard actions and AI particles. When developing applications corresponding to smart edge devices, developers do not need to write traditional code. Instead, they perform visual operations in the preset interface and directly generate target scripts in a low-code form, thereby achieving the purpose of shortening the development iteration cycle of AI algorithms in smart edge devices.
[0094] It can be seen that this application adopts a visual low-code programming method, and through a preset graphical interface operation method, it achieves the purpose of instantly orchestrating the intelligent analysis process corresponding to the smart edge device, thereby realizing the technical effect of generating logic scripts without compilation, and thus solving the technical problems of long development cycle and low development efficiency caused by the need to re-arrange and generate logic scripts when the business logic corresponding to the smart edge device changes in the existing technology.
[0095] According to another aspect of the embodiment of the present application, a script generating device is also provided. Figure 5 is a schematic diagram of an optional script generation device according to an embodiment of the present application, such as Figure 5 As shown, the script generating apparatus includes: a first acquiring unit 501 , a second acquiring unit 502 and a script generating unit 503 .
[0096] Optionally, the first acquisition unit is used to obtain the control flow and standard events corresponding to the program to be developed, wherein the program to be developed is an application program that needs to be embedded in the intelligent edge device, and the intelligent edge device is a physical device with data processing and intelligent analysis capabilities located at the edge of the network, and the control flow is used to characterize the control structure in the program to be developed, and the standard events are used to characterize the different stages of the execution task of the program to be developed; the second acquisition unit is used to obtain the standard actions and AI particles corresponding to the program to be developed, wherein the standard action is the minimum execution unit in the process of executing the task of the program to be developed, and the AI particle is the minimum functional module of the AI algorithm embedded in the intelligent edge device; the script generation unit is used to generate a target script based on the control flow, standard events, standard actions and AI particles through a preset interface, wherein the preset interface is a graphical visual operation interface, and the target script is a logic script corresponding to the program to be developed.
[0097] In an optional embodiment, the script generation unit includes: a creation subunit and a generation subunit.
[0098] Optionally, a creation subunit is configured to create L visual controls in a preset interface, where L is a positive integer, and the L visual controls are configured to represent control flows, standard events, standard actions, and program codes corresponding to AI particles in the form of visual graphics; a generation subunit is configured to obtain associations between the L visual controls and generate a target script based on the associations between the L visual controls, where the associations include at least one of the following three relationships:
[0099] Containment relationship;
[0100] Parallel relationship;
[0101] Series relationship.
[0102] In an optional embodiment, the generating subunit includes: a connecting module and a generating module.
[0103] Optionally, a connection module is used to connect L visual controls based on the association relationship between the L visual controls to obtain a target flowchart, wherein the target flowchart is used to represent the execution process of the program to be developed; a generation module is used to generate a target script based on the target flowchart and the orchestration specification, wherein the orchestration specification is used to determine the format of the code included in the target script.
[0104] In an optional embodiment, the script generating device further includes: a third acquiring unit.
[0105] Optionally, the third acquisition unit is configured to acquire a control type corresponding to each of the L visual controls, and perform a drag operation on the L visual controls according to the control type corresponding to each visual control, wherein the control type is any one of the following three types:
[0106] The first type, wherein the first type of visual control is used to represent the code for processing videos and images in the form of visual graphics;
[0107] The second type, wherein the second type of visual control is used to represent the code corresponding to the AI algorithm in the form of a visual graphic;
[0108] A third type, wherein the third type is a type other than the first type and the second type.
[0109] In an optional embodiment, the script generating device further includes: an embedding unit and a packaging unit.
[0110] Optionally, the embedding unit is used to embed the target script into a preset directory, wherein the preset directory is the storage directory of the application that needs to be embedded in the smart edge device; the packaging unit is used to package the target script in the preset directory to obtain a target program, wherein the target program is a developed application that allows the smart edge device to run.
[0111] In an optional embodiment, the script generating device further includes: an initialization unit, an importing unit, a parsing unit, and an execution unit.
[0112] Optionally, an initialization unit is used to perform an initialization operation on the general framework when starting the target program, wherein the initialization operation is used to update the environment variables of the general framework, and the general framework includes at least L basic components, and the L basic components are hardware in the intelligent edge device for storing control flow, standard events, standard actions and codes corresponding to AI particles; an import unit is used to import the target program into the parser after the initialization operation is completed, wherein the parser is hardware in the intelligent edge device for parsing the code; a parsing unit is used to reverse parse the target program based on the orchestration specification through the parser to obtain executable code; an execution unit is used to run the executable code through the executor, wherein the executor is hardware in the intelligent edge device for performing intelligent analysis tasks.
[0113] In an optional embodiment, the script generating device further includes: a testing unit and a transmission unit.
[0114] Optionally, the testing unit is used to test the target program based on preset test cases to obtain test results, wherein the preset test cases include at least test steps and test parameters under different application scenarios corresponding to the program to be developed; the transmission unit is used to transmit the test results to the operation and maintenance personnel of the smart edge device.
[0115] From the above content, it can be seen that this application abstracts the program to be developed to obtain control flow, standard events, standard actions and AI particles. Afterwards, this application uses a preset interface to visualize the control flow, standard events, standard actions and AI particles. When developing applications corresponding to smart edge devices, developers do not need to write traditional code. Instead, they perform visual operations in the preset interface and directly generate target scripts in a low-code form, thereby achieving the purpose of shortening the development iteration cycle of AI algorithms in smart edge devices.
[0116] It can be seen that this application adopts a visual low-code programming method, and through a preset graphical interface operation method, it achieves the purpose of instantly orchestrating the intelligent analysis process corresponding to the smart edge device, thereby realizing the technical effect of generating logic scripts without compilation, and thus solving the technical problems of long development cycle and low development efficiency caused by the need to re-arrange and generate logic scripts when the business logic corresponding to the smart edge device changes in the existing technology.
[0117] According to another aspect of an embodiment of the present application, a computer program product is further provided, the computer program product including a stored computer program, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned script generation methods.
[0118] According to another aspect of an embodiment of the present application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned script generation methods by executing the executable instructions.
[0119] Optionally, Figure 6 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 6 As shown, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and runnable on the processor, and implements any one of the above script generation methods when the processor executes the program.
[0120] The above-mentioned embodiments or examples disclosed in this application are not exhaustive, but are only illustrations of some embodiments or examples, and are not intended to be specific limitations on the scope of protection disclosed in this application. In the absence of contradiction, each step in a certain embodiment or example in this application can be implemented as an independent example, and the steps can be arbitrarily combined. For example, the solution after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be arbitrarily combined; in addition, the various embodiments or examples can be arbitrarily combined. For example, some or all of the steps in different embodiments or examples can be arbitrarily combined, and a certain embodiment or example can be arbitrarily combined with the optional methods or optional examples of other embodiments or examples.
[0121] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0123] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0125] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0126] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0127] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A script generation method, characterized in that: include: Obtaining control flows and standard events corresponding to a program to be developed, wherein the program to be developed is an application program to be embedded in an intelligent edge device, which is a physical device at the edge of a network with data processing and intelligent analysis capabilities. The control flows are used to characterize control structures in the program to be developed, and the standard events are used to characterize different stages of executing tasks in the program to be developed. Obtaining standard actions and AI particles corresponding to the program to be developed, wherein the standard action is the smallest execution unit in the process of executing the task of the program to be developed, and the AI particle is the smallest functional module of the AI algorithm embedded in the intelligent edge device; A target script is generated based on the control flow, the standard events, the standard actions and the AI particles through a preset interface, wherein the preset interface is a graphical visualization operation interface, and the target script is a logic script corresponding to the program to be developed.
2. The script generation method according to claim 1, wherein: Generating a target script based on the control flow, the standard event, the standard action, and the AI particle through a preset interface includes: Creating L visual controls in the preset interface, where L is a positive integer, and the L visual controls are used to represent the control flow, the standard event, the standard action, and the program code corresponding to the AI particle in the form of visual graphics; Obtaining association relationships between the L visualization controls, and generating the target script based on the association relationships between the L visualization controls, wherein the association relationships include at least one of the following three relationships: Containment relationship; Parallel relationship; Series relationship.
3. The script generation method according to claim 2, wherein: Generating the target script according to the association relationship between the L visualization controls includes: Performing a connection operation on the L visual controls based on the association relationship between the L visual controls to obtain a target flow chart, wherein the target flow chart is used to represent the execution flow of the program to be developed; The target script is generated according to the target flow chart and an orchestration specification, wherein the orchestration specification is used to determine the format of the code included in the target script.
4. The script generation method according to claim 3, wherein: Before performing a connection operation on the L visual controls based on the association relationship between the L visual controls, the script generation method further includes: Obtain a control type corresponding to each of the L visual controls, and perform a drag operation on the L visual controls according to the control type corresponding to each visual control, wherein the control type is any one of the following three types: The first type, wherein the first type of visual control is used to represent the code for processing videos and images in the form of visual graphics; The second type, wherein the second type of visual control is used to represent the code corresponding to the AI algorithm in the form of a visual graphic; A third type, wherein the third type is a type other than the first type and the second type.
5. The script generation method according to claim 1, wherein: After generating a target script based on the control flow, the standard event, the standard action, and the AI particle through a preset interface, the script generation method further includes: Embed the target script into a preset directory, wherein the preset directory is a storage directory of the application that needs to be embedded in the smart edge device; The target script is packaged in the preset directory to obtain a target program, wherein the target program is a developed application program that allows the smart edge device to run.
6. The script generation method according to claim 5, characterized in that: After obtaining the target program, the script generation method further includes: When starting the target program, performing an initialization operation on the universal framework, wherein the initialization operation is used to update the environment variables of the universal framework, the universal framework includes at least L basic components, and the L basic components are hardware in the intelligent edge device for storing the control flow, the standard events, the standard actions, and the codes corresponding to the AI particles; After the initialization operation is completed, importing the target program into a parser, wherein the parser is hardware in the smart edge device for parsing code; Reverse-engineering the target program based on the layout specification to obtain executable code; The executable code is run through an executor, wherein the executor is hardware in the intelligent edge device for performing intelligent analysis tasks.
7. The script generation method according to claim 6, characterized in that: Before importing the target program into the parser, the script generation method further includes: Testing the target program based on preset test cases to obtain test results, wherein the preset test cases at least include test steps and test parameters under different application scenarios corresponding to the program to be developed; The test results are transmitted to the operation and maintenance personnel of the intelligent edge device.
8. A script generating device, characterized in that: include: a first acquisition unit, configured to acquire a control flow and standard events corresponding to a program to be developed, wherein the program to be developed is an application program to be embedded in an intelligent edge device, which is a physical device at the edge of a network with data processing and intelligent analysis capabilities; the control flow is used to characterize the control structure in the program to be developed, and the standard events are used to characterize different stages of executing a task of the program to be developed; A second acquisition unit is configured to acquire a standard action and an AI particle corresponding to the program to be developed, wherein the standard action is the smallest execution unit in the process of executing a task of the program to be developed, and the AI particle is the smallest functional module of the AI algorithm embedded in the intelligent edge device; A script generation unit is used to generate a target script based on the control flow, the standard events, the standard actions and the AI particles through a preset interface, wherein the preset interface is a graphical visual operation interface, and the target script is a logic script corresponding to the program to be developed.
9. A computer program product, characterized in that The computer program product includes a computer program, wherein when the computer program is run, the computer program product is controlled to execute the script generation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the script generation method described in any one of claims 1 to 7.