Function execution method and device, storage medium and electronic device
By integrating the MAF architecture of the terminal program platform, dynamically loading plugins and uniformly managing data formats, the problems of low function execution efficiency and high maintenance costs in the MES system are solved, achieving efficient and flexible function execution and data management.
Patent Information
- Application Number
- CN202510997214.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-11-25
AI Technical Summary
In existing technologies, production data acquisition in Manufacturing Execution Systems (MES) suffers from low data collection efficiency, inconsistent logic, serious duplication of development, high maintenance costs, and the inability of independently deployed projects to adapt to rapidly changing business needs, forming technology silos and affecting automatic upgrades and updates.
The MAF architecture, which adopts a terminal program integration platform, dynamically loads and unloads plugins through the design of the action layer and execution layer, unifies interface specifications, automatically provides plugin installation packages on the cloud server, executes functions according to priority or preset order in the execution layer, and performs data format conversion and storage in the model layer, thereby achieving the flexibility of plugins and standardized management of data.
It improves the speed and efficiency of function execution, reduces maintenance costs, enhances the flexibility and security of the system, optimizes resource utilization, simplifies the deployment process of plug-ins, and adapts to rapidly changing business needs.
Smart Images

Figure CN121008853A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for performing a function, a storage medium, and an electronic device. Background Technology
[0002] Currently, in the desktop development field, the mainstream application architectures include the Model-View-Controller (MVC) pattern, the Model-View-Presenter (MVP) pattern, and the Model-View-ViewModel (MVVM) pattern. However, in practical applications, they are mainly implemented in the form of single projects, which exposes a series of problems such as high coupling between business logic and process control, increased testing complexity, high maintenance costs, and limited scalability.
[0003] Specifically, the production data acquisition process in Manufacturing Execution Systems (MES) suffers from inefficiency and inconsistency due to the dispersed and complex implementation of functions and the lack of unified management of data entry methods. Furthermore, the coexistence of multiple projects deployed on-site not only leads to inconsistent logical implementations but also results in redundant development of functions, increasing the project burden. In particular, the frequent turnover of developers and the lack of unified implementation standards cause maintenance costs to rise sharply. In addition, highly customized functional modules have low reusability and struggle to adapt to rapidly changing business needs. Even more serious is the fact that independently deployed projects are not under the unified control of the core platform. This not only hinders subsequent automatic upgrades and updates but also causes them to gradually lose their original functional positioning due to personnel turnover, creating technological silos and maintenance difficulties.
[0004] There is currently no effective solution to the problem of low system function execution efficiency in related technologies.
[0005] Therefore, it is necessary to improve the relevant technology to overcome the aforementioned defects. Summary of the Invention
[0006] This application provides a method and apparatus for executing functions, a storage medium, and an electronic device to at least solve the problem of low execution efficiency of system functions.
[0007] According to one aspect of the embodiments of this application, a method for executing a function is provided, applied to a terminal program integration platform, wherein the terminal program integration platform includes an action layer and an execution layer, wherein the action layer is used to implement business operations and logic processing, and the execution layer is used to implement the orchestration and control of business processes, including: when a target function is to be executed, determining whether the terminal program integration platform has a target plugin through the action layer, wherein the target plugin is used to execute the target function; and when it is determined that the terminal program integration platform has the target plugin, executing the target function through the execution layer.
[0008] In an exemplary embodiment, the method further includes: if it is determined that the target plugin is not present in the terminal program integration platform, sending a target instruction to a cloud server through the action layer, wherein the target instruction is used to instruct the cloud server to send the installation package of the target plugin to the terminal program integration platform; if the installation package of the target plugin is obtained, installing the target plugin to the terminal program integration platform through the action layer; and executing the target function through the execution layer.
[0009] In an exemplary embodiment, executing the target function through the execution layer includes: when there are multiple target functions and the action layer determines that there are multiple target plugins corresponding to multiple target functions in the terminal program integration platform, the execution layer sequentially executes the multiple target functions corresponding to the multiple target plugins in a preset order, wherein the multiple target plugins and the multiple target functions correspond one-to-one; or when there are multiple target functions and the action layer determines that there are multiple target plugins corresponding to multiple target functions in the terminal program integration platform, the execution layer obtains the priority of each target plugin among the multiple target plugins, wherein the priority is determined based on the number of times the target plugin is enabled; and the execution layer sequentially executes the multiple target functions corresponding to the multiple target plugins according to their priorities.
[0010] In an exemplary embodiment, the terminal program integration platform further includes a model layer, wherein the model layer is used for data structure definition and business rule encapsulation. After executing the target function corresponding to the target plugin, the method further includes: sending reference data generated by executing the target function to the model layer through the execution layer; converting the data format of the reference data into a preset data format through the model layer to obtain target data, and sending the target data to the execution layer; storing the target data in the target database in the terminal program integration platform through the execution layer, and sending a first prompt message, wherein the first prompt message is used to indicate that the target data has been stored in the target database.
[0011] In an exemplary embodiment, the terminal program integration platform further includes a model layer, wherein the model layer is used for data structure definition and business rule encapsulation. After executing the target function corresponding to the target plugin, the method further includes: when there are multiple target functions and the action layer determines that there are multiple target plugins corresponding to multiple target functions in the terminal program integration platform, sending multiple reference data generated by executing the multiple target functions to the model layer through the execution layer; integrating and processing the multiple reference data through the model layer to obtain a target data compressed package, and sending the target data compressed package to the execution layer; storing the target data compressed package in the target database in the terminal program integration platform through the execution layer, and sending a second prompt message, wherein the second prompt message is used to indicate that the target data compressed package has been stored in the target database.
[0012] In an exemplary embodiment, the model layer integrates and processes the plurality of reference data to obtain a target data compressed package, including: obtaining multiple data identifiers for the plurality of reference data through the model layer, wherein the plurality of reference data and the plurality of data identifiers correspond one-to-one; destroying the reference data corresponding to the preset alarm data identifier and sending an alarm message when a preset alarm data identifier exists among the plurality of data identifiers through the model layer, wherein the alarm message is used to indicate that there is reference data with a preset alarm data identifier among the plurality of reference data; and integrating and processing the reference data other than the reference data corresponding to the preset alarm data identifier among the plurality of reference data through the model layer to obtain the target data compressed package.
[0013] In an exemplary embodiment, the model layer is used to integrate and process the multiple reference data to obtain a target data compressed package. This includes: obtaining a preset data conversion rule and multiple data formats of the multiple reference data through the model layer, wherein the multiple reference data and the multiple data formats correspond one-to-one, and the preset data conversion rule is used to convert the data formats of the reference data into target data formats; converting the multiple data formats of the multiple reference data according to the multiple data formats and the preset data conversion rule through the model layer to obtain multiple target data; and merging the multiple target data to obtain the target data compressed package.
[0014] According to another aspect of the embodiments of this application, a functional execution device is also provided, applied to a terminal program integration platform, wherein the terminal program integration platform includes: an action layer and an execution layer, wherein the action layer is used to implement business operations and logic processing, and the execution layer is used to implement the orchestration and control of business processes, including: a determination module, used to determine whether the terminal program integration platform has a target plugin when a target function is to be executed, wherein the target plugin is used to execute the target function; and an execution module, used to execute the target function through the execution layer when it is determined that the target plugin is in the terminal program integration platform.
[0015] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to perform the execution method of the above-described functions when it is run.
[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the execution method of the above-mentioned functions through the computer program.
[0017] This application determines whether the terminal program integration platform has a target plugin that can be used to execute the target function through the action layer in the terminal program integration platform. If the target plugin is present, the target function is executed through the execution layer in the terminal program integration platform, thereby improving the execution speed and efficiency of the target function and solving the problem of low execution efficiency of system functions. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the hardware environment for a method of executing a function according to an embodiment of this application;
[0021] Figure 2 This is a flowchart of a method for performing a function according to an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of a change in a terminal frame according to an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of an optional terminal integration process according to an embodiment of this application;
[0024] Figure 5 This is a structural block diagram of an optional function execution device according to an embodiment of this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] According to one aspect of the embodiments of this application, a method for executing a function is provided. This method for executing a function is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, smart home device ecosystems, and intelligencehouse ecosystems. Optionally, in this embodiment, the above-mentioned method for executing a function can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0028] The aforementioned networks may include, but are not limited to, wired networks and wireless networks. Wired networks may include, but are not limited to, wide area networks (WANs), metropolitan area networks (MANs), and local area networks (LANs). Wireless networks may include, but are not limited to, Wi-Fi (Wireless Fidelity) and Bluetooth. Terminal device 102 may not be limited to PCs, mobile phones, tablets, smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projectors, smart TVs, smart clothes racks, smart curtains, smart audio-visual equipment, smart sockets, smart speakers, smart speakers, smart fresh air systems, smart kitchen and bathroom equipment, smart bathroom fixtures, smart robot vacuums, smart window cleaning robots, smart mopping robots, smart air purifiers, smart steam ovens, smart microwave ovens, smart water heaters, smart air purifiers, smart water dispensers, smart door locks, etc.
[0029] To address the aforementioned issues, this embodiment provides a method for executing a function, applied to a terminal program integration platform. The terminal program integration platform includes an action layer and an execution layer. The action layer implements business operations and logic processing, while the execution layer implements the orchestration and control of business processes. Optionally, this method includes, but is not limited to, applications applied to the aforementioned terminal device 102. Figure 2 This is a flowchart of a method for performing a function according to an embodiment of this application, the process including the following steps S202-S204:
[0030] Step S202: When the target function is to be executed, the action layer determines whether the terminal program integration platform has a target plugin, wherein the target plugin is used to execute the target function;
[0031] Optionally, the terminal program integration platform can be used in an MES system, which includes target functions. When a target object (e.g., a user) needs to use the system to perform target functions (e.g., data entry, equipment monitoring, quality inspection, etc.), it can log in to the terminal program integration platform after verification. The terminal program integration platform is a platform based on the Model-Action-Flow (MAF) framework, which includes an action layer and an execution layer.
[0032] Optionally, the target plugin is designed as an independent unit that conforms to a unified interface specification. It can be a dynamic link library (DLL) or an executable file (EXE). This means that the plugin itself has high flexibility and independence and can be easily integrated into the terminal application integration platform without modifying the core code of the terminal application integration platform.
[0033] It's worth noting that the action layer design in the terminal application integration platform allows the platform to respond quickly to user needs without waiting for the full development and testing of new features. It only requires ensuring that the target plugin adheres to a unified interface specification. Since plugins interact with the platform's core components through interfaces, this decoupled design makes plugin development, testing, and deployment more independent, reducing the impact on the overall stability and performance of the platform. Furthermore, the unified interface specification ensures that plugins can be reused across various business scenarios, lowering development costs.
[0034] Step S204: If it is determined that the target plugin is present in the terminal program integration platform, the target function is executed through the execution layer.
[0035] Optionally, when the action layer confirms that the target plugin exists in the terminal program integration platform, the execution layer will start the target plugin and call its interface to execute the target function.
[0036] It should be noted that the execution layer is designed as a highly flexible process controller, capable of managing the concurrent execution of multiple plugins, as well as handling data exchange and collaborative work between plugins.
[0037] Optionally, when the terminal program integration platform is executing target function A, the terminal program integration platform can simultaneously determine whether the terminal program integration platform has a target plugin corresponding to target function B.
[0038] It should be noted that through the above steps, the system can dynamically load and unload plugins, reducing the memory and CPU usage of terminal devices and improving system resource utilization efficiency. Furthermore, the execution layer's flow control design simplifies plugin maintenance and the addition of new features, eliminating the need for major modifications to the system core and terminal program integration platform core, thus reducing maintenance costs and enhancing system scalability. The execution layer also enables unified management of user permissions and function access control, ensuring that only authorized users and plugins can perform specific operations, thereby enhancing system security.
[0039] It should be noted that the above steps propose a pluggable function execution method based on the MAF architecture, which effectively solves the problems of high coupling between business logic and process control, high testing difficulty, high maintenance cost, and limited scalability in traditional terminal program integration. This method not only improves the maintainability and scalability of the terminal program, but also further optimizes resource utilization and enhances the system's flexibility and security through dynamic loading and unloading of plug-ins and unified access control.
[0040] The above steps determine whether the terminal program integration platform has a target plugin that can be used to execute the target function through the action layer in the terminal program integration platform. If the target plugin is available, the target function is executed through the execution layer in the terminal program integration platform, thereby improving the execution speed and efficiency of the target function and solving the problem of low execution efficiency of system functions.
[0041] In an exemplary embodiment, the method further includes the following steps S11-S13:
[0042] Step S11: If it is determined that the target plugin is not present in the terminal program integration platform, a target instruction is sent to the cloud server through the action layer, wherein the target instruction is used to instruct the cloud server to send the installation package of the target plugin to the terminal program integration platform;
[0043] Optionally, if the target plugin is undergoing a temporary upgrade or is being called by the terminal program integration platform for the first time when querying whether the target plugin exists in the terminal program integration platform, then the target plugin does not exist in the terminal program integration platform.
[0044] Optionally, the action layer can query the target plugin list in the terminal program integration platform, which contains all the plugins available in the terminal program integration platform.
[0045] Optionally, after receiving the target instruction, the cloud server will send the installation package of the target plugin (usually a compiled DLL or EXE file, and possibly configuration files) back to the terminal integration platform. This step ensures that the terminal integration platform can quickly and automatically obtain the implementation code of the required function without manual intervention.
[0046] It should be noted that the above steps enable the terminal application integration platform to dynamically download target plugins from the cloud server according to actual needs. This allows the platform to quickly adapt even if on-site business requirements change, ensuring system flexibility. Furthermore, the cloud server can manage plugin versions, ensuring the platform obtains the latest or most stable versions, which helps to unify the functional and performance standards of the entire system.
[0047] Step S12: If the installation package of the target plugin is obtained, the target plugin is installed to the terminal program integration platform through the action layer;
[0048] Optionally, during the process of installing the target plugin to the terminal program integration platform at the action layer, the integrity and security of the target plugin are verified, and the target plugin list is updated to ensure that the execution layer can recognize and call the new plugin.
[0049] It should be noted that dynamically installing plugins can avoid pre-installing all possible plugins, reducing the storage space occupied by the terminal device and the initialization time, and improving resource utilization.
[0050] Step S13: Execute the target function through the execution layer.
[0051] Optionally, after the target plugin is installed, the execution layer will be responsible for invoking the target plugin and executing the target function. This includes initializing the target plugin, performing specific operations within the target plugin (such as data acquisition, analysis, or presentation), and possibly uninstalling the plugin after the function is completed, ensuring that resources are used efficiently.
[0052] It should be noted that the above steps automatically download and install plugins via a cloud server, enabling the terminal program integration platform to quickly respond to new functional requirements while maintaining system stability and efficient resource utilization. This not only improves the flexibility and adaptability of field terminals but also simplifies the plugin deployment process and reduces maintenance costs, providing crucial technical support for achieving intelligent manufacturing and industrial automation.
[0053] In an exemplary embodiment, the target function is executed through the execution layer, which can be achieved through the following steps S21 or S22-S23:
[0054] Step S21: When there are multiple target functions and the terminal program integration platform has multiple target plugins corresponding to multiple target functions as determined by the action layer, the multiple target functions corresponding to the multiple target plugins are executed sequentially by the execution layer according to the preset order corresponding to the multiple target plugins, wherein the multiple target plugins and the multiple target functions correspond one-to-one.
[0055] Optionally, the preset order is defined by the user in the configuration or preset based on functional dependencies.
[0056] Step S22: When there are multiple target functions and the terminal program integration platform has multiple target plugins corresponding to multiple target functions as determined by the action layer, the priority of each target plugin among the multiple target plugins is obtained through the execution layer, wherein the priority is determined according to the number of times the target plugin is enabled;
[0057] Optionally, the more times the target plugin is enabled, the higher its priority.
[0058] It should be noted that by determining the priority through the number of times the function is enabled, the terminal program integration platform can automatically identify the user's most frequently used functions and execute these functions first, thereby improving response speed.
[0059] Step S23: Through the execution layer, execute the multiple target functions corresponding to the multiple target plugins in sequence according to their priorities.
[0060] Optionally, high-priority plugins consume system resources first, while low-priority plugins execute only when resources allow, avoiding resource waste and ensuring the overall operating efficiency of the terminal program integration platform.
[0061] Optionally, by learning user behavior (i.e. when and how often plugins are enabled), the terminal program integration platform can automatically adjust the priority of function execution to better adapt to user habits and needs.
[0062] It should be noted that the above steps, whether executed in a preset order or dynamically adjusted based on plugin usage frequency, aim to improve function execution efficiency and user experience, while making rational use of system resources, reflecting an intelligent and user-centric design philosophy. This not only enhances the flexibility and intelligence of the terminal program integration platform but also provides more efficient and personalized operating procedures for industrial sites.
[0063] In an exemplary embodiment, the terminal program integration platform further includes a model layer, wherein the model layer is used for data structure definition and business rule encapsulation, and after executing the target function corresponding to the target plugin, the method further includes the following steps S31-S33:
[0064] Step S31: The reference data generated by executing the target function is sent to the model layer through the execution layer;
[0065] Optionally, after the execution of the target function is completed, the execution layer will send the raw or intermediate data (reference data) generated during the process to the model layer. The reference data includes, but is not limited to, data collection results from the plugin, user input information, operation logs, etc.
[0066] It should be noted that the execution layer and the model layer have a clear division of labor. The execution layer focuses on function execution, while the model layer is responsible for data management and rule (such as rules for a unified data format) encapsulation. This decoupling helps the system maintainability and scalability.
[0067] Step S32: Through the model layer, the data format of the reference data is converted into a preset data format to obtain the target data, and the target data is sent to the execution layer;
[0068] Optionally, after receiving the reference data, the model layer converts it into a system-preset data format to ensure data consistency and standardization before storage. This format conversion includes, but is not limited to, data type conversion, field mapping, and encoding standardization. The converted data, referred to as the target data, will be sent back to the execution layer for further storage.
[0069] It should be noted that different target plugins may generate data in different formats. Through format conversion at the model layer, it is ensured that all data conforms to the same standard before storage, which facilitates subsequent data integration and analysis.
[0070] Step S33: Through the execution layer, the target data is stored in the target database in the terminal program integration platform, and a first prompt message is sent, wherein the first prompt message is used to indicate that the target data has been stored in the target database.
[0071] Optionally, the target database can be specifically designed for storing data generated by the plugin, or it can be a unified database used to integrate data from all business processes. After storage is complete, the execution layer will send an initial notification to the target object (the user who has successfully logged into the terminal program integration platform), informing the user that the data has been successfully stored.
[0072] It should be noted that in the above steps, the model layer plays a crucial role in encapsulating data rules and converting formats. This mechanism ensures data standardization, security, and persistent storage, which is beneficial for improving the overall performance of the system and the efficiency of data management. It also provides end-users with more reliable and transparent operational feedback. This approach not only strengthens data management but also enhances the maintainability and scalability of the system through logical layering, providing strong data support and process management capabilities for industrial automation and intelligent manufacturing.
[0073] In an exemplary embodiment, the terminal program integration platform further includes a model layer, wherein the model layer is used for data structure definition and business rule encapsulation, and after executing the target function corresponding to the target plugin, the method further includes the following steps S41-S43:
[0074] Step S41: When there are multiple target functions and the terminal program integration platform has multiple target plugins corresponding to multiple target functions as determined by the action layer, the multiple reference data generated by executing the multiple target functions are sent to the model layer through the execution layer.
[0075] Optionally, the plurality of reference data includes various types of data, such as sensor data, user operation records, device status information, etc.
[0076] Step S42: Through the model layer, the multiple reference data are integrated and processed to obtain a target data compressed package, and the target data compressed package is sent to the execution layer;
[0077] Optionally, after receiving multiple reference data, the model layer will integrate and convert the multiple reference data. The integration process includes, but is not limited to, data cleaning, data format conversion, and data analysis steps to ensure that all data meets the preset data format and quality requirements.
[0078] Step S43: Through the execution layer, the target data compressed package is stored in the target database in the terminal program integration platform, and a second prompt message is sent, wherein the second prompt message is used to indicate that the target data compressed package has been stored in the target database.
[0079] Optionally, the terminal program integration platform will send the second prompt message to the target object, indicating that the data has been successfully entered into the database, so that the user can confirm the data status.
[0080] It's important to note that the above steps implement an efficient data integration, compression, and storage mechanism after the execution of multi-plugin functions. The model layer plays a crucial role here, not only ensuring the definition of data structures and the encapsulation of business rules, but also improving data processing efficiency and optimizing storage through data integration and compression, thereby enhancing the overall performance of the system. This mechanism not only improves the quality of data management but also enhances the user experience through real-time feedback, providing a solid foundation for data-intensive applications in industrial scenarios.
[0081] In an exemplary embodiment, the multiple reference data are integrated and processed through the model layer to obtain a target data compressed package, which can be achieved through the following steps S51-S53:
[0082] Step S51: Obtain multiple data identifiers of the multiple reference data through the model layer, wherein the multiple reference data and the multiple data identifiers correspond one-to-one;
[0083] Optionally, before the model layer begins processing the data, the data identifier of each reference data is first obtained. The data identifier is metadata used to uniquely identify each set of data. The data identifier includes, but is not limited to, information such as data type, source, and timestamp, ensuring the traceability and identifiability of each reference data.
[0084] Step S52: Through the model layer, if a preset alarm data identifier exists among the multiple data identifiers, the reference data corresponding to the preset alarm data identifier is destroyed and an alarm message is sent, wherein the alarm message is used to indicate that there is reference data with a preset alarm data identifier among the multiple reference data.
[0085] It should be noted that if there is a preset alarm data identifier in the data identifier, it means that this set of reference data may contain abnormal information or violate specific business rules (such as data security rules, data format rules, etc.). The model layer will destroy this part of the data and send alarm information to the target object.
[0086] Optionally, after receiving the alarm information, the target object may send operation information to the terminal program integration platform to instruct the terminal program integration platform to perform data tracing and repair.
[0087] Step S53: Through the model layer, integrate the reference data other than the reference data corresponding to the preset alarm data identifier from the plurality of reference data to obtain the target data compressed package.
[0088] Optionally, after excluding anomalous data with alarm flags, the model layer integrates and converts the remaining reference data to generate a compressed target data package. This data will be processed uniformly to ensure its consistency and integrity before storage.
[0089] It should be noted that data compression and storage are performed after anomaly data is excluded, which further enhances data security and ensures that the stored data is error-free and complies with business rules.
[0090] It should be noted that the above steps implement a data preprocessing and anomaly detection mechanism, which not only ensures data quality and security but also improves data storage efficiency and optimizes resource utilization through data integration and compression. This mechanism is particularly important for data management and decision support in industrial automation and intelligent manufacturing scenarios, as it prevents the spread of anomalous data, thus ensuring stable system operation and data-driven business decisions.
[0091] In an exemplary embodiment, the multiple reference data are integrated and processed through the model layer to obtain a target data compressed package, which can be achieved through the following steps S61-S62:
[0092] Step S61: Through the model layer, obtain the preset data conversion rules and multiple data formats of the multiple reference data, wherein the multiple reference data and the multiple data formats correspond one-to-one, and the preset data conversion rules are used to convert the data formats of the reference data into the target data format;
[0093] Optionally, before processing the data, the model layer will first obtain the preset data conversion rules and the original format (data format) of each reference data. The preset data conversion rules are a set of data processing logic defined in advance according to the needs of the terminal program integration platform and the format requirements of the target database. They are used to guide the conversion of data formats and ensure that all data can be stored in a unified standard format.
[0094] It should be noted that a unified data format enables greater interoperability between different plugins and functions, facilitating comprehensive data analysis and utilization.
[0095] Step S62: Through the model layer, the multiple data formats of the multiple reference data are converted according to the multiple data formats and the preset data conversion rules to obtain multiple target data; the multiple target data are merged to obtain the target data compressed package.
[0096] Optionally, after obtaining the data format and conversion rules, the model layer performs format conversion on each reference data to generate multiple target data. Then, these target data are merged and compressed into a target data compression package for efficient storage and transmission.
[0097] It should be noted that through steps S61 - S62, this application implements a processing method for format conversion, merging, and compression of multiple reference data in the model layer. This process not only ensures the consistency of data formats, improves the readability and analyzability of data, but also optimizes the use of storage space and network resources through data compression technology, enhancing the overall performance of the system. In addition, the automated and standardized data processing process reduces errors and inefficiencies in manual operations, providing a solid data foundation for industrial automation and data - driven applications. This mechanism reflects the core role of the model layer in data management and provides an innovative solution for the data processing link of the terminal program integration platform.
[0098] Obviously, the above - described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. To better understand the above method, the following will describe the above process in conjunction with embodiments, but it is not used to limit the technical solutions of the embodiments of this application. Specifically:
[0099] As Figure 3 shown, there have been different application program architectures at different time periods, with different mode characteristics, but there are various problems, such as inability to decouple functions, low execution efficiency of functions, inability to unify data, etc. What this application proposes is an application program framework based on MAF. This framework is divided into three core levels: Model, Action, and Flow. By decoupling business logic, data processing, and process control, it improves the maintainability and scalability of the code.
[0100] Optionally, this application provides a terminal program integration platform, which is standardized in several ways: First, it features a unified interface specification: interface integration is completed uniformly according to the Interface for Monitored Model (IMonitored), supporting callbacks of functional functions in different program domains. Second, it provides a unified development specification: a common user interface (UI) component library is provided to support standardized interface development. Third, it adopts a unified deployment standard: the main program loads a plugin mode, achieving a unified program startup entry point. Fourth, it is modularized: functional modules are divided: corresponding DLLs or EXEs are implemented according to business function modules. Fifth, it follows a standard template design specification: development follows a standard template pattern. Sixth, it manages dependencies: it supports the encapsulation of common components and methods and supports module calls. Seventh, it implements access control: user access control: the program uses a unified login entry point, and the access verification logic is consistent. Eighth, it manages function access: module functions are allocated by the backend, and only allocated functions can be operated on-site. Ninth, it implements operation audit logs: a unified logging framework is introduced to record module anomalies. Finally, it implements version management: plugin version control, update mechanism design, and compatibility management.
[0101] This application can effectively improve the maintainability and scalability of the system, and reduce development and maintenance costs.
[0102] Optionally, the Model-Action-Flow (MAF) architecture includes: Model layer (i.e., the model layer mentioned above): the foundational layer of the MAF framework, mainly responsible for data structure definition and business rule encapsulation, and is the concrete embodiment of the business domain model; Action layer (i.e., the action layer mentioned above): the intermediate layer of the MAF framework, responsible for encapsulating specific business operations and processing logic, and realizing atomic business action processing; Flow layer (i.e., the execution layer mentioned above): the top layer of the MAF framework, responsible for the orchestration and control of business processes, combining multiple business processes into a complete business process, and realizing the processing of complex business scenarios.
[0103] Optionally, in the MAF architecture terminal program integration platform, plugins are dynamically loaded: according to the program plugin storage path and configured plugin loading method; plugin loading is completed based on the program execution flow and functional requirements. They are also dynamically unloaded: plugins are dynamically unloaded after the plugin's business execution is complete; this reduces the use of computer memory, CPU, and other resources.
[0104] Optionally, the above implementation can be divided into three parts: (1) AssemblyDynamicLoader: Main responsibility: responsible for creating and managing independent application domains (AppDomain) to load plugins; core functions: responsible for creating independent plugin runtime environments, managing the lifecycle of plugins, and handling interface support for plugin instantiation and method invocation; (2) RemoteLoader: Main responsibility: performing actual assembly loading and type instantiation operations in independent application domains; core functions: loading assembly files, creating type instances, executing plugin methods, and handling callbacks of monitoring methods; (3) ExposeInteractiveEvent: Main responsibility: handling event communication across application domains; core functions: managing delegates of monitoring methods, handling UI thread synchronization, and providing event registration and triggering mechanisms.
[0105] like Figure 4 As shown, this application needs to ensure data consistency and accuracy, requiring verification of data sources and formats. Implementing this effective algorithm involves the following key steps:
[0106] 1. Source verification: User login is required before using the function;
[0107] For example, ensuring the validity and traceability of data sources by using the latest and unified personnel verification mechanism is crucial for subsequent processing and analysis.
[0108] 2. Data Conversion: The terminal program supports global deployment and can run in different time zones;
[0109] For example, store the time zone according to the current operating time zone. This avoids interference from local time zones and complex time formats, ensuring data consistency and comparability.
[0110] 3. Data Validation: To effectively prevent invalid data, special characters, and other data that may interfere with the logic from being passed into the MES system when faced with various external data inputs, the data can be filtered and validated.
[0111] To ensure the program (i.e., the aforementioned target functions) is controllable, the following needs to be done:
[0112] 1. Transparent plugin functionality: The platform supports displaying plugin functions in a list format, making it easy for factories to select and enable them according to their needs;
[0113] 2. Controllable source code: Plugins integrated into the platform must provide the source code address for project management purposes;
[0114] 3. Independent versions of plugins (modules) that support automatic feature iteration and upgrades.
[0115] It should be noted that each module (plugin) runs in an independent program domain, and module failures do not affect the overall program operation. The system monitors the disk path where the plugin is located; if a plugin file is deleted or replaced, the main program supports plugin change alerts (the alert mechanism can be configured according to business needs).
[0116] It should be noted that the modular development of corresponding functions using this application, and the support for independent operation, makes unit testing simpler and allows for more independent development of multiple modules. Once each module is completed, it can be used after being loaded into the main module. Furthermore, this application supports dynamic loading and single-module updates, greatly reducing the bandwidth load of on-site updates.
[0117] It should be noted that using the plug-in approach of this application to integrate MES field functional programs eliminates the need to consider framework constraints, code style, or code logic adjustments; integration can be completed simply by connecting to a unified interface; this greatly reduces the problem of multiple opaque field functional projects and improves project reusability.
[0118] It should be noted that this application also has the following advantages: (1) Stronger scalability: After the external terminal program exposes the interface according to the standard document, it can be integrated into the main program to complete the integration and support platform version control and upgrade; (2) More precise use of program capabilities: The main program only provides login and key public component capabilities, and other module plugins are downloaded and used in the form of plugins according to business needs, making program download and update more precise; (3) MAF has the excellent features of controlling the start, stop and uninstallation of plugins and supporting multiple versions of a plugin to run at the same time; once a new plugin has a problem, it can be rolled back to the old version to ensure the stability of online production.
[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. With this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0120] This embodiment also provides a functional execution device applied to a terminal program integration platform, wherein the terminal program integration platform includes an action layer and an execution layer, wherein the action layer is used to implement business operations and logic processing, and the execution layer is used to implement the orchestration and control of business processes. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0121] Figure 5 This is a structural block diagram of a functional execution device according to an embodiment of this application. The device includes:
[0122] The determining module 502 is used to determine, in the case of a target function to be executed, whether the terminal program integration platform has a target plugin through the action layer, wherein the target plugin is used to execute the target function;
[0123] The execution module 504 is used to execute the target function through the execution layer when it is determined that the target plugin is present in the terminal program integration platform.
[0124] The aforementioned device determines whether the terminal program integration platform has a target plugin that can be used to execute the target function through the action layer in the terminal program integration platform. If the target plugin is present, the target function is executed through the execution layer in the terminal program integration platform, thereby improving the execution speed and efficiency of the target function and solving the problem of low execution efficiency of system functions.
[0125] In an exemplary embodiment, the above apparatus further includes: a sending module, configured to send a target instruction to a cloud server through the action layer when it is determined that the target plugin is not present in the terminal program integration platform, wherein the target instruction is used to instruct the cloud server to send the installation package of the target plugin to the terminal program integration platform; an installation module, configured to install the target plugin to the terminal program integration platform through the action layer when the installation package of the target plugin is obtained; and an execution module 504, further configured to execute the target function through the execution layer.
[0126] In an exemplary embodiment, the execution module 504 is further configured to, when there are multiple target functions and the action layer determines that there are multiple target plugins corresponding to multiple target functions in the terminal program integration platform, execute the multiple target functions corresponding to the multiple target plugins sequentially according to a preset order corresponding to the multiple target plugins, wherein the multiple target plugins and the multiple target functions correspond one-to-one; or when there are multiple target functions and the action layer determines that there are multiple target plugins corresponding to multiple target functions in the terminal program integration platform, obtain the priority of each target plugin among the multiple target plugins through the execution layer, wherein the priority is determined according to the number of times the target plugin is enabled; and execute the multiple target functions corresponding to the multiple target plugins sequentially according to the priority of the multiple target plugins through the execution layer.
[0127] In an exemplary embodiment, the terminal program integration platform further includes: a model layer, wherein the model layer is used for data structure definition and business rule encapsulation; a sending module, further used to send reference data generated by executing the target function corresponding to the target plugin to the model layer through the execution layer after executing the target function; the above device further includes: a processing module, used to convert the data format of the reference data into a preset data format through the model layer to obtain target data, and send the target data to the execution layer; a storage module, used to store the target data in the target database in the terminal program integration platform through the execution layer, and send a first prompt message, wherein the first prompt message is used to indicate that the target data has been stored in the target database.
[0128] In an exemplary embodiment, the terminal program integration platform further includes: a model layer, wherein the model layer is used for data structure definition and business rule encapsulation; a sending module, further used to send multiple reference data generated by executing the multiple target functions to the model layer through the execution layer when the target function has multiple target functions and the action layer determines that there are multiple target plugins corresponding to the multiple target functions in the terminal program integration platform; a processing module, further used to integrate and process the multiple reference data through the model layer to obtain a target data compressed package, and send the target data compressed package to the execution layer; and a storage module, further used to store the target data compressed package in the target database in the terminal program integration platform through the execution layer, and send a second prompt message, wherein the second prompt message is used to indicate that the target data compressed package has been stored in the target database.
[0129] In an exemplary embodiment, the processing module is further configured to: obtain multiple data identifiers of the multiple reference data through the model layer, wherein the multiple reference data and the multiple data identifiers correspond one-to-one; through the model layer, if a preset alarm data identifier exists among the multiple data identifiers, destroy the reference data corresponding to the preset alarm data identifier and send an alarm message, wherein the alarm message is used to indicate that there is reference data with a preset alarm data identifier among the multiple reference data; and through the model layer, integrate and process the reference data other than the reference data corresponding to the preset alarm data identifier among the multiple reference data to obtain the target data compressed package.
[0130] In an exemplary embodiment, the processing module is further configured to obtain, through the model layer, a preset data conversion rule and multiple data formats of the multiple reference data, wherein the multiple reference data and the multiple data formats correspond one-to-one, and the preset data conversion rule is used to convert the data formats of the reference data into target data formats; through the model layer, convert the multiple data formats of the multiple reference data according to the multiple data formats and the preset data conversion rule to obtain multiple target data; and merge the multiple target data to obtain the target data compressed package.
[0131] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0132] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0133] S1, when the target function is to be executed, the action layer determines whether the terminal program integration platform has a target plugin, wherein the target plugin is used to execute the target function;
[0134] S2, if it is determined that the target plugin exists in the terminal program integration platform, the target function is executed through the execution layer.
[0135] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0136] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0137] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0138] S1, when the target function is to be executed, the action layer determines whether the terminal program integration platform has a target plugin, wherein the target plugin is used to execute the target function;
[0139] S2, if it is determined that the target plugin exists in the terminal program integration platform, the target function is executed through the execution layer.
[0140] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0141] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0142] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0143] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0144] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0145] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0146] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for executing a function, characterized in that, This is applied to a terminal application integration platform, which includes an action layer and an execution layer. The action layer is used to implement business operations and logic processing, and the execution layer is used to orchestrate and control business processes, including: When a target function is to be executed, the action layer determines whether the terminal program integration platform has a target plugin, wherein the target plugin is used to execute the target function; If the target plugin is found in the terminal program integration platform, the target function is executed through the execution layer.
2. The method according to claim 1, characterized in that, The method further includes: If it is determined that the target plugin is not present in the terminal program integration platform, a target instruction is sent to the cloud server through the action layer, wherein the target instruction is used to instruct the cloud server to send the installation package of the target plugin to the terminal program integration platform; If the installation package of the target plugin is obtained, the target plugin is installed to the terminal program integration platform through the action layer; The target function is executed through the execution layer.
3. The method according to claim 1, characterized in that, Executing the target function through the execution layer includes: When there are multiple target functions and the terminal program integration platform has multiple target plugins corresponding to these target functions as determined by the action layer, the execution layer sequentially executes the multiple target functions corresponding to the multiple target plugins according to a preset order, wherein the multiple target plugins and the multiple target functions correspond one-to-one; or When there are multiple target functions and the terminal program integration platform has multiple target plugins corresponding to multiple target functions as determined by the action layer, the priority of each target plugin among the multiple target plugins is obtained through the execution layer, wherein the priority is determined according to the number of times the target plugin is enabled; the multiple target functions corresponding to the multiple target plugins are executed sequentially according to the priority of the multiple target plugins through the execution layer.
4. The method according to claim 1, characterized in that, The terminal program integration platform further includes a model layer, wherein the model layer is used for data structure definition and business rule encapsulation. After executing the target function corresponding to the target plugin, the method further includes: The reference data generated by executing the target function is sent to the model layer through the execution layer; The model layer converts the reference data into a preset data format to obtain the target data, and then sends the target data to the execution layer. The execution layer stores the target data in the target database of the terminal program integration platform and sends a first prompt message, wherein the first prompt message is used to indicate that the target data has been stored in the target database.
5. The method according to claim 1, characterized in that, The terminal program integration platform further includes a model layer, wherein the model layer is used for data structure definition and business rule encapsulation. After executing the target function corresponding to the target plugin, the method further includes: When there are multiple target functions and the terminal program integration platform has multiple target plugins corresponding to multiple target functions as determined by the action layer, the multiple reference data generated by executing the multiple target functions are sent to the model layer through the execution layer. The model layer integrates and processes the multiple reference data to obtain a target data compressed package, and then sends the target data compressed package to the execution layer. The execution layer stores the target data compressed package in the target database of the terminal program integration platform and sends a second prompt message, wherein the second prompt message is used to indicate that the target data compressed package has been stored in the target database.
6. The method according to claim 5, characterized in that, The model layer integrates and processes the multiple reference data to obtain a target data compressed package, including: Through the model layer, multiple data identifiers of the multiple reference data are obtained, wherein the multiple reference data and the multiple data identifiers correspond one-to-one; Through the model layer, when a preset alarm data identifier exists among the multiple data identifiers, the reference data corresponding to the preset alarm data identifier is destroyed and an alarm message is sent. The alarm message is used to indicate that there is reference data with a preset alarm data identifier among the multiple reference data. Through the model layer, the reference data other than the reference data corresponding to the preset alarm data identifier are integrated and processed to obtain the target data compressed package.
7. The method according to claim 5, characterized in that, The model layer integrates and processes the multiple reference data to obtain a target data compressed package, including: Through the model layer, preset data conversion rules and multiple data formats of the multiple reference data are obtained, wherein the multiple reference data and the multiple data formats correspond one-to-one, and the preset data conversion rules are used to convert the data formats of the reference data into the target data format; Through the model layer, the multiple data formats of the multiple reference data are converted according to the multiple data formats and the preset data conversion rules to obtain multiple target data; the multiple target data are merged to obtain the target data compressed package.
8. A functional execution device, characterized in that, This is applied to a terminal application integration platform, which includes an action layer and an execution layer. The action layer is used to implement business operations and logic processing, and the execution layer is used to orchestrate and control business processes, including: The determination module is used to determine, in the case of a target function to be executed, whether the terminal program integration platform has a target plugin through the action layer, wherein the target plugin is used to execute the target function; An execution module is used to execute the target function through the execution layer when it is determined that the target plugin exists in the terminal program integration platform.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 7 through the computer program.
