Function Block Capability Extension Through Reference-Based Code Calls
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for extending the capability of a function block in workflows require copying and updating code, which occupies storage space and increases workload.
Innovation Solution
A method and apparatus for extending a function block capability by determining a description file with information on the calling relationship between the first and second function blocks, generating a code to call the extended capability, and storing this information in the first function block, allowing the extended capability to be accessed without copying code, thus saving storage space and reducing the need for individual updates.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If code is copied into function blocks to extend capability, then function block capability is extended, but storage space is occupied and workload increases
Solution Approach 1:
The patent uses a form of copying by storing only the unique identifier of the extended capability in the first function block, rather than copying the entire capability code. This selective copying approach allows the first function block to reference and execute the extended capability from the second function block without duplicating the full code, thereby extending functionality while minimizing storage space occupation.
2Adaptability or versatility
If code is copied into function blocks to extend capability, then function block capability is extended, but updating code requires individual updates to each function block
Solution Approach 1:
The patent implements a reference-based copying mechanism where the first function block stores only a unique identifier pointing to the extended capability in the second function block. This creates a lightweight reference rather than a full code copy, enabling centralized updates. When the extended capability needs updating, only the second function block requires modification, and all referencing function blocks automatically benefit from the update without requiring individual modifications.
Solution Approach 2:
The patent creates a universal reference mechanism where the unique identifier system allows multiple function blocks to reference the same extended capability. This universal referencing approach enables a single extended capability to serve multiple function blocks simultaneously, and updates to the capability propagate universally to all users of that capability, significantly reducing update workload across the system.
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
Embodiments of the present invention disclose a method and an apparatus for extending a capability of a function block, an electronic device, and a storage medium. The method includes: determining a first description file of a first function block, the first description file including first information, and the first information being used for describing a calling relationship between the first function block and an extended capability in a second function block; generating a first code used for calling the extended capability in the second function block based on the first information; and storing the first description file and the first code in the first function block, the extended capability in the second function block being called when the first code is run. There is no need to copy a function code of another function block into a function block, thereby saving the storage space of the function block. In addition, when the called extended function changes or the code needs to be updated, there is no need to update the code of each function block one by one, thereby reducing the workload.