Method and device for expanding capability of function block, electronic equipment and storage medium

CN119895388APending Publication Date: 2025-04-25SIEMENS (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280099801.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the field of workflow technology, existing technologies are difficult to effectively expand the capabilities of functional blocks, resulting in code duplication occupying storage space and increasing update workload.

Method used

By determining the extension capability calling relationship between function blocks, the code for calling the extension capability is generated, and the description file and code are stored in the function block to avoid code duplication and realize dynamic calling and updating.

Benefits of technology

It saves the storage space of function blocks, reduces the workload of code updates, and enriches the control logic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119895388A_ABST
    Figure CN119895388A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and device for expanding the capability of a function block, electronic equipment and a storage medium. The method comprises the steps that a first description file of a first function block is determined, the first description file comprises first information, and the first information is used for describing the calling relation of the expansion capacity in the first function block and the expansion capacity in a second function block; generating a first code for calling the expansion capability in the second function block based on the first information; and storing the first description file and the first code into the first function block, and calling the expansion capability in the second function block when the first code is operated. The function codes of other function blocks do not need to be copied in the function block, and the storage space of the function block is saved. Moreover, when the called extended function is changed or the code needs to be updated, the code does not need to be updated one by one, so that the workload is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device and storage medium for expanding the capabilities of a functional block Technical Field

[0001] The present invention relates to the technical field of workflow, and in particular to a method, a device, an electronic device and a storage medium for extending the capability of a function block. Background Art

[0002] A workflow can be simply defined as a description of a series of operational processes. Workflows are widely used in automation systems, artificial intelligence, robotics, and other fields. For example, the workflow of a product sorting line in an automated system can be simply described as starting, taking photos, classifying, and moving products to their destinations. In the field of artificial intelligence, the model deployment workflow can be described as data collection, data labeling, model training, and model deployment, among other things.

[0003] In the workflow canvas, workflows typically consist of function blocks (FBs). Function blocks can be defined using a common information model and are used to package specific skills. Function blocks typically contain complex code and are implemented using domain-specific knowledge.

[0004] When users want to expand the capabilities of a function block or customize its functionality, they typically duplicate the code of other function blocks within the function block. First, duplicated code within a function block takes up valuable storage space within the function block. Furthermore, when the duplicated code needs to be updated (for example, due to a bug), all function blocks that duplicated the code need to be updated accordingly, increasing the workload.

[0005] Summary of the Invention

[0006] The embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for expanding the capabilities of a functional block.

[0007] A method for extending the capability of a function block, comprising:

[0008] Determining a first description file of a first function block, where the first description file includes first information, where the first information is used to describe a calling relationship between the first function block and an extended capability in a second function block, where the extended capability includes a basic capability of the second function block and a newly added capability of the second function block;

[0009] generating, based on the first information, a first code for calling the extended capability in the second function block;

[0010] The first description file and the first code are stored in the first function block, wherein when the first code is executed, the extended capability in the second function block is called.

[0011] Therefore, you can access the functionality of other function blocks without duplicating code within a function block, saving storage space. Furthermore, if the called extended function changes or its code needs to be updated, there is no need to update the code block by block, reducing workload.

[0012] In one embodiment, the first information includes a unique identifier of the second functional block and a unique identifier of the newly added capability in the second functional block.

[0013] Therefore, the newly added capability can be accurately located through the respective unique identifiers of the second functional block and the newly added capability.

[0014] In one embodiment, it further includes:

[0015] Determine a second description file for the second functional block, where the second description file includes second information, and the second information is used to describe the newly added capability;

[0016] Based on the second information, obtaining a second code for implementing the newly added capability;

[0017] The second description file and the second code are stored in the second function block.

[0018] Therefore, based on the description of the newly added capability in the second description file, the implementation code for realizing the newly added capability can be conveniently stored in the second functional block, so that other functional blocks can call the newly added capability.

[0019] In one embodiment, the second information includes metadata of the second code and a storage address of the second code.

[0020] Therefore, the implementation code of the newly added capability can be conveniently obtained through the second information.

[0021] In one embodiment, obtaining, based on the second information, a second code for implementing the newly added capability includes:

[0022] obtaining the metadata from the second information;

[0023] Based on the storage address, obtaining the second code;

[0024] The metadata is associated with the second code.

[0025] Therefore, based on the second information, the implementation code of the newly added capability is conveniently stored in the second functional block.

[0026] In one embodiment, the first functional block further includes a third code for implementing the basic capabilities of the first functional block; and the method further includes:

[0027] The first code and the third code are executed based on the execution sequence represented by the first lifecycle information, wherein the execution sequence includes at least one of the following:

[0028] Firstly, the first code is executed to call the extended capability, and then the third code is executed to execute the basic capability of the first functional block;

[0029] Firstly, the third code is executed to execute the basic capability of the first functional block, and then the first code is executed to call the extended capability;

[0030] While executing the first code to invoke the extended capability, executing the third code to execute the basic capability of the first function block;

[0031] wherein the first life cycle information is included in the main code of the first functional block, and the main code further includes the third code; or

[0032] The first life cycle information is included in the first description file.

[0033] Therefore, the first functional block can execute multiple control logics, enriching the control scenarios.

[0034] In one embodiment, the second functional block further includes a fourth code for implementing the basic capabilities of the second functional block; and the method further includes:

[0035] The second code and the fourth code are executed based on the execution sequence represented by the second lifecycle information, wherein the execution sequence includes at least one of the following:

[0036] First, the fourth code is executed to execute the basic capability of the second functional block, and then the second code is executed to execute the newly added capability;

[0037] First, running the second code to execute the newly added capability, and then running the fourth code to execute the basic capability of the second functional block;

[0038] While executing the second code to execute the newly added capability, executing the fourth code to execute the basic capability of the second functional block;

[0039] The second life cycle information is included in the main code of the second functional block, and the main code further includes the fourth code;

[0040] Or the second life cycle information is included in the second description file.

[0041] Therefore, the functions of the second functional block can be called according to various control logics, enriching the control scenarios.

[0042] A device for extending the capability of a function block, comprising:

[0043] a determining module configured to determine a first description file of a first function block, the first description file comprising first information, the first information being used to describe a calling relationship between the first function block and an extended capability in a second function block, the extended capability comprising a basic capability of the second function block and a newly added capability of the second function block;

[0044] a generating module configured to generate, based on the first information, a first code for calling the extended capability in the second function block;

[0045] The calling module is configured to store the first description file and the first code in the first function block, wherein when the first code is executed, the extended capability in the second function block is called.

[0046] Therefore, you can access the functionality of other function blocks without duplicating code within a function block, saving storage space. Furthermore, if the called extended function changes or its code needs to be updated, there is no need to update the code block by block, reducing workload.

[0047] In one embodiment, the determining module is configured to determine a second description file of the second functional block, where the second description file includes second information, and the second information is used to describe the newly added capability;

[0048] The generating module is configured to obtain a second code for implementing the newly added capability based on the second information;

[0049] The calling module is configured to store the second description file and the second code in the second function block.

[0050] Therefore, based on the description of the newly added capability in the second description file, the implementation code for realizing the newly added capability can be conveniently stored in the second functional block, so that other functional blocks can call the newly added capability.

[0051] In one embodiment, the first functional block further includes a third code for implementing the basic capabilities of the first functional block; and the apparatus further includes:

[0052] An execution module is configured to execute the first code and the third code based on an execution sequence represented by the first lifecycle information, wherein the execution sequence includes at least one of the following:

[0053] Firstly, the first code is executed to call the extended capability, and then the third code is executed to execute the basic capability of the first functional block;

[0054] Firstly, the third code is executed to execute the basic capability of the first functional block, and then the first code is executed to call the extended capability;

[0055] While executing the first code to invoke the extended capability, executing the third code to execute the basic capability of the first function block;

[0056] wherein the first life cycle information is included in the main code of the first functional block, and the main code further includes the third code; or

[0057] The first life cycle information is included in the first description file.

[0058] Therefore, the first functional block can execute multiple control logics, enriching the control scenarios.

[0059] In one embodiment, the second functional block further includes a fourth code for implementing the basic capability of the second functional block; and the apparatus further includes:

[0060] An execution module is configured to execute the second code and the fourth code based on an execution sequence represented by the second lifecycle information, wherein the execution sequence includes at least one of the following:

[0061] First, the fourth code is executed to execute the basic capability of the second functional block, and then the second code is executed to execute the newly added capability;

[0062] First, running the second code to execute the newly added capability, and then running the fourth code to execute the basic capability of the second functional block;

[0063] While executing the second code to execute the newly added capability, executing the fourth code to execute the basic capability of the second functional block;

[0064] The second life cycle information is included in the main code of the second functional block, and the main code further includes the fourth code;

[0065] Or the second life cycle information is included in the second description file.

[0066] Therefore, the functions of the second functional block can be called according to various control logics, enriching the control scenarios.

[0067] An electronic device, comprising:

[0068] processor;

[0069] a memory for storing executable instructions of the processor;

[0070] The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement any one of the above methods for extending the capability of a functional block.

[0071] A computer-readable storage medium stores computer instructions thereon, wherein when the computer instructions are executed by a processor, the method for extending the capability of a function block as described above is implemented.

[0072] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the method for extending the capability of a function block as described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, so that those skilled in the art will understand the above and other features and advantages of the present invention more clearly. In the accompanying drawings:

[0074] FIG1 is a flowchart of a method for extending the capability of a function block according to an embodiment of the present invention.

[0075] FIG2 is a schematic diagram of a process for extending the capabilities of a functional block according to an embodiment of the present invention.

[0076] FIG3 is a schematic diagram showing the relationship between a function block providing an extension capability and a function block calling the extension capability according to an embodiment of the present invention.

[0077] FIG4 is a schematic diagram of executing function blocks at run time according to an embodiment of the present invention.

[0078] FIG. 5 is a schematic diagram of the editing and sharing function blocks according to an embodiment of the present invention.

[0079] FIG6 is a structural diagram of an apparatus for extending the capabilities of a functional block according to an embodiment of the present invention.

[0080] FIG. 7 is a structural diagram of an electronic device according to an embodiment of the present invention.

[0081] The accompanying drawings are numerals as follows:

[0082]

[0083]

[0084]

[0085] DETAILED DESCRIPTION

[0086] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail with reference to the following examples.

[0087] For the sake of brevity and intuitiveness in description, the solution of the present invention is explained below by describing several representative implementations. A large number of details in the implementations are only used to help understand the solution of the present invention. However, it is obvious that the technical solution of the present invention may not be limited to these details when implemented. In order to avoid unnecessarily obscuring the solution of the present invention, some implementations are not described in detail, but only a framework is given. Hereinafter, "including" means "including but not limited to", and "according to..." means "at least according to..., but not limited to only according to...". Due to the language habits of Chinese, when the number of a component is not specifically specified below, it means that the component can be one or more, or can be understood as at least one.

[0088] FIG1 is a flow chart of a method for expanding the capabilities of a function block according to an embodiment of the present invention. As shown in FIG1 , the method includes:

[0089] Step 101: Determine a first description file of the first functional block, the first description file including first information, the first information being used to describe the calling relationship between the first functional block and the extended capabilities in the second functional block, the extended capabilities including the basic capabilities of the second functional block and the newly added capabilities of the second functional block.

[0090] A first description file containing first information can be edited in a description file editor of a common information model. The first information describes a calling relationship between a first function block and an extended capability in a second function block. The basic capability is an existing function included in the second function block, and the added capability is a capability added to the second function block.

[0091] For example, assuming that the second functional block is a functional block for executing a database write operation, the basic function of the second functional block is a database write operation. A new function can be added to the second functional block: an operation for calculating the average value of data. The extended function of the second functional block is a combination of a database read operation and an operation for calculating the average value of data. In the specific implementation of the extended capability, any combination of basic capabilities and newly added capabilities can be included. For example, the extended capability can include any one of the following: (1) first executing the basic capability of the second functional block, and then executing the newly added capability of the second functional block; (2) first executing the newly added capability of the second functional block, and then executing the basic capability of the second functional block; (3) executing the newly added capability and basic capability of the second functional block at the same time.

[0092] In one embodiment, the first information includes a unique identifier for the second functional block and a unique identifier for the newly added capability in the second functional block. Based on the first information, the first functional block can generate a first code for invoking the extended capability in the second functional block. The first description file may also include other descriptive information about the first functional block, such as a front-end canvas, port description information, functional block metadata, and programming language description.

[0093] There may be multiple newly added capabilities in the second functional block. Accordingly, there may also be multiple extended capabilities in the second functional block that can be called by the first functional block. Therefore, the first description file may contain one or more first information for describing the respective calling relationships with the respective extended capabilities in the second functional block. In addition, the first information may also describe the calling relationships with the extended capabilities of other functional blocks other than the second functional block. For example, the first information further describes the calling relationships with one or more extended capabilities in a third functional block different from the second functional block, thereby further introducing the extended capabilities in the third functional block into the first functional block.

[0094] Step 102: Based on the first information, generate a first code for calling the extended capability in the second functional block.

[0095] The code generator of the common information model can generate the first code for calling the extended capability in the second functional block by parsing the first description file.

[0096] For example, the unique identifier of the second functional block and the unique identifier of the newly added capability in the second functional block are extracted from the first information, and the two unique identifiers can be used to generate a first code for invoking the extended capability. When the first code is executed, the second functional block is located based on the unique identifier of the second functional block (thereby accessing the basic capability of the second functional block), and the newly added capability is further located in the second functional block based on the unique identifier of the extended capability in the second functional block (thereby accessing the newly added capability of the second functional block), thereby invoking the extended capability including the basic capability and the newly added capability.

[0097] Step 103: Store the first description file and the first code in the first functional block, wherein when the first code is executed, the extended capability in the second functional block is called.

[0098] Therefore, when the first function block is executed in runtime, description information about the first function block, such as the front-end canvas, port description information, function block metadata and program language description, etc., can be obtained from the first description file as basic information for executing the work, and the first code can also be executed to call the extended capabilities in the second function block.

[0099] In one embodiment, the present invention further includes the step of setting the newly added capability in the second functional block. Specifically, the present invention further includes: determining a second description file for the second functional block, the second description file including second information, the second information being used to describe the newly added capability; obtaining a second code for implementing the newly added capability based on the second information; and storing the second description file and the second code in the second functional block.

[0100] Similarly, a second description file containing second information can be edited in the description file editor of the common information model. The second information describes the newly added capabilities included in the second functional block, where the described newly added capabilities can be one or more. The second description file can also include other descriptive information of the second functional block, such as the front-end canvas, port description information, functional block metadata, and programming language description.

[0101] In one embodiment, the second information includes metadata for the second code and the storage address of the second code. The code generator of the common information model parses the second description file to implement the newly added capability in the second functional block. For example, the metadata may be obtained from the second information; the second code may be obtained based on the storage address; and the metadata may be associated with the second code. For example, the metadata may include the name of the newly added capability, a description of the newly added capability, and parameter descriptions of the newly added capability.

[0102] In one embodiment, the first functional block further includes third code for implementing basic capabilities of the first functional block. The first lifecycle information is included in the main code of the first functional block, and the third code is included in the main code of the first functional block. Alternatively, the first lifecycle information is included in the first description file.

[0103] The execution sequence represented by the first lifecycle information can be parsed from the main code or the first description file. The method further includes: executing the first code and the third code based on the execution sequence represented by the first lifecycle information, wherein the execution sequence includes:

[0104] (1) First run the first code to call the extended capability, and then run the third code to execute the basic capability of the first function block.

[0105] For example, suppose the first function block's basic capability is a sort operation. The second function block's extended capability is to first read data from the database (the second function block's basic capability) and then calculate the average of the read data (the second function block's added capability). Therefore, the first code is executed to invoke the second function block's extended capability, which uses the second function block to read data from the database and then calculate the average of the data. Then, the third code is executed to execute the first function block's basic capability, which is to sort the data based on the average value.

[0106] (2) First run the third code to execute the basic capabilities of the first functional block, and then run the first code to call the extended capabilities.

[0107] For example, assume the first functional block's base capability is a sort operation. The second functional block's extended capability is to first clean the data (the second functional block's base capability) and then write the data to the database (the second functional block's added capability). First, the third code is run to sort the data using the first functional block's base capability. Then, the first code is run to invoke the second functional block's extended capability, which uses the second functional block's base capability to clean the sorted data and then uses the second functional block's added capability to write the cleaned data to the database.

[0108] (3) While running the first code to call the extended capability, run the third code to execute the basic capability of the first functional block.

[0109] Here, the extended capability and the basic capability of the first functional block are executed simultaneously, i.e., two parallel tasks are executed simultaneously.

[0110] In one embodiment, the second functional block further includes a fourth code for implementing the basic capabilities of the second functional block. The second lifecycle information is included in the main code of the second functional block, and the fourth code is included in the main code. Alternatively, the second lifecycle information is included in the second description file. The operation sequence represented by the second lifecycle information can be parsed from the main code or the second description file. The method further includes: running the second code and the fourth code based on the operation sequence represented by the second lifecycle information, wherein the operation sequence includes:

[0111] (1) First run the fourth code to execute the basic capabilities of the second functional block, and then run the second code to execute the newly added capabilities.

[0112] For example, assume the second function block's basic capability is sorting. The second function block also adds a new capability: data concatenation. When the second function block's extended capability is called by the first function block, the second function block first runs the fourth code to sort the data. Then, the second code runs to concatenate the sorted data. Finally, the concatenated data is returned to the first function block as the call's execution result.

[0113] (2) First run the second code to execute the newly added capability, and then run the fourth code to execute the basic capability of the second functional block.

[0114] For example, assume the second function block's basic capability is sorting. The second function block's newly added capability is data concatenation. When the second function block's extended capability is called by the first function block, the second function block first runs the second code to concatenate the data. Then, the fourth code runs to sort the concatenated data. Finally, the sorted data is returned to the first function block as the call's execution result.

[0115] (3) while running the second code to execute the newly added capability, running the fourth code to execute the basic capability of the second functional block;

[0116] For example, assume the second function block's basic capability is sorting. The second function block's newly added capability is data concatenation. When the second function block's extended capability is called by the first function block, the second function block executes the second code to concatenate the first data, while simultaneously executing the fourth code to sort the second data. Finally, the sorted first and second data are returned to the first function block as the call's execution results.

[0117] Figure 2 is a schematic diagram of the process of expanding the capabilities of a function block according to an embodiment of the present invention. In Figure 2, a second function block 20 has basic functionality and newly added functionality. The first function block 10 can call an expanded functionality that includes both the basic functionality of the second function block 20 and the newly added functionality of the second function block 20.

[0118] The second functional block 20 includes a code area 21 and a second description file 22. The second description file 22 includes metadata 221, a programming language description 222, a port description 223, and second information 224 for the second functional block 20. The second information 224 is used to describe the newly added capabilities of the second functional block 20, where the newly added capabilities can be one or more. The second information 224 includes metadata 23 (e.g., the name of the newly added capability, description of the newly added capability, and parameter description of the newly added capability, etc.) for the implementation code (referred to as the second code) of each newly added capability, as well as the corresponding storage address 24 of each second code.

[0119] The code generator of the common information model parses the second description file 22 and obtains the storage address of the second code for each newly added capability and metadata associated with the second code based on the second information 224. The code generator obtains the second code based on the storage address, associates the metadata with the second code, and stores the second code 214 associated with the metadata for each newly added capability in the code area 21.

[0120] In addition to the second code 214, the code area 21 also includes a runtime communicator 211, a main code 212, and a test method 213. The main code 212 also includes a fourth code (not shown) for executing the basic capabilities of the second functional block 20. Second lifecycle information representing the execution order of the second code 214 and the fourth code can be set in the main code 212. Alternatively, this second lifecycle information can be set in the second description file 22.

[0121] When the second code 214 is called by the first function block 10, the running order represented by the second life cycle information is parsed from the main code 212 or the second description file 22, and the second code 214 and the fourth code are run according to the running order, and the running result is returned to the first function block 10 as the calling result.

[0122] The first function block 10 includes a code area 11 and a first description file 12. The first description file 12 includes metadata 121, a programming language description 122, a port description 123, and first information 124 of the first function block 10. The first information 124 is used to describe the calling relationship between the first function block 10 and the extended capabilities of the second function block 20. The number of newly added capabilities in the second function block 20 can be one or more, and the corresponding calling relationships can be one or more. For each calling relationship, the first information 124 includes a unique identifier of the second function block 20 and a unique identifier of the corresponding newly added capability in the second function block 20.

[0123] The code generator in the common information model parses the first description file 12 , generates a first code 114 for calling a corresponding extended capability in the second function block 20 based on the first information 124 , and saves the first code 114 into the code area 11 .

[0124] In addition to the first code 114, the code area 11 also includes a runtime communicator 111, a main code 112, and a test method 113. The main code 112 may include a third code (not shown) for executing the basic capabilities of the first functional block 10. First lifecycle information representing the execution order of the first code 114 and the third code may be set in the main code 112. Alternatively, the first lifecycle information may be set in the first description file 12.

[0125] The execution sequence represented by the first lifecycle information is parsed from the main code 112 or the first description file 12, and the first code 114 and the third code are executed in this order. For example, after executing the first code 114 and obtaining the call result provided by the second function block 20, the third code may be executed based on the call result. Alternatively, after executing the third code, the first code 114 may be executed to invoke the extended function of the second function block 20.

[0126] Figure 3 illustrates the relationship between the functional blocks that provide expansion capabilities and the functional blocks that invoke expansion capabilities, according to an embodiment of the present invention. As shown in Figure 3 , the second functional block 20 and the first functional block 10 are tightly coupled, like a socket and a plug. The illustration in Figure 3 is a schematic metaphor for illustrative purposes and is not intended to limit the present invention.

[0127] Figure 4 is a schematic diagram illustrating the runtime execution of function blocks according to an embodiment of the present invention. The runtime environment includes an interpreter 31, dependency detection 32, process management 33, parameter passing 34, step control 35, and a file system 36. For each function block unit 37, the second function block 20 can call the extended functionality of the first function block 10.

[0128] FIG5 is a schematic diagram of the editing and sharing function blocks according to an embodiment of the present invention.

[0129] As shown in FIG5 , in the description file editor 61 of the common information model 60 , the description file of the function block is edited.

[0130] For example, for a first function block 10 that needs to call an extended function in a second function block 20, the description file is edited to describe the calling relationship between the extended capabilities of the first function block 10 and the second function block 20. For the second function block 20 that is called, the description file also describes the newly added capabilities.

[0131] Furthermore, the code generator 62 generates codes for each functional block. For example, in the first functional block 10, a first code is generated to call the extended capability in the second functional block 20. In the second functional block 10, a second code is generated to implement the newly added capability.

[0132] Therefore, the editing function 64 for the first function block 10 includes: editing the description of the calling relationship between the first function block 10 and the extended capabilities in the second function block 20, and generating a first code for calling the extended capabilities in the second function block 20. The editing function 63 for the second function block includes: describing the newly added capabilities in the description file of the second function block 20, and generating a second code in the second function block 20 to implement the newly added capabilities.

[0133] The first function 10 and the second function 20 can be stored and displayed in the function block management platform 70. The function block management platform 70 can also provide authentication 71 and function block retrieval 72. For example, the function block management platform 70 can be a local platform or a remote platform located in the cloud.

[0134] FIG6 is a block diagram of an apparatus for extending the capabilities of a functional block according to an embodiment of the present invention. As shown in FIG6 , the apparatus 600 for extending the capabilities of a functional block includes:

[0135] A determining module 601 is configured to determine a first description file of a first functional block, where the first description file includes first information, and the first information is used to describe a calling relationship between the first functional block and an extended capability in a second functional block;

[0136] A generating module 602 is configured to generate a first code for calling an extended capability in a second functional block based on the first information;

[0137] The calling module 603 is configured to store the first description file and the first code in the first functional block, wherein when the first code is executed, the extended capability in the second functional block is called.

[0138] In one embodiment, the first information includes a unique identifier of the second functional block and a unique identifier of the newly added capability in the second functional block. In one embodiment, the second information includes metadata of the second code and a storage address of the second code. In one embodiment, obtaining the second code for implementing the newly added capability based on the second information includes: obtaining the metadata from the second information; obtaining the second code based on the storage address; and associating the metadata with the second code.

[0139] In one embodiment, the determination module 601 is configured to determine a second description file of the second functional block, the second description file contains second information, and the second information is used to describe the extended capability; the generation module 602 is configured to obtain a second code for implementing the extended capability based on the second information; and the calling module 603 is configured to store the second description file and the second code in the second functional block.

[0140] In one embodiment, the first functional block also includes a third code for implementing the basic capabilities of the first functional block; the device also includes: an execution module 604, configured to execute the first code and the third code based on the running order represented by the first lifecycle information, wherein the running order includes at least one of the following: first running the first code to call the extended capability, and then running the third code to execute the basic capabilities of the first functional block; first running the third code to execute the basic capabilities of the first functional block, and then running the first code to call the extended capability; while running the first code to call the extended capability, running the third code to execute the basic capabilities of the first functional block; wherein the first lifecycle information is included in the main code of the first functional block, and the main code also includes the third code; or the first lifecycle information is included in the first description file.

[0141] In one embodiment, the second functional block also includes a fourth code for implementing the basic capabilities of the second functional block; the device also includes: an execution module 604, configured to run the second code and the fourth code based on the running order represented by the second lifecycle information, wherein the running order includes at least one of the following: first running the fourth code to execute the basic capabilities of the second functional block, and then running the second code to execute the newly added capabilities; first running the second code to execute the newly added capabilities, and then running the fourth code to execute the basic capabilities of the second functional block; while running the second code to execute the newly added capabilities, running the fourth code to execute the basic capabilities of the second functional block; wherein the second lifecycle information is included in the main code of the second functional block, and the main code also includes the fourth code; or the second lifecycle information is included in the second description file.

[0142] The embodiment of the present invention further provides an electronic device having a processor-memory architecture. FIG7 is a structural diagram of an electronic device according to an embodiment of the present invention.

[0143] As shown in Figure 7, the electronic device 700 includes a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. When the computer program is executed by the processor 701, the method for expanding the capabilities of the functional block as described above is implemented. Among them, the memory 702 can be specifically implemented as a variety of storage media such as an electrically erasable programmable read-only memory (EEPROM), a flash memory (Flash memory), and a programmable read-only memory (PROM). The processor 701 can be implemented to include one or more central processing units or one or more field programmable gate arrays, wherein the field programmable gate array integrates one or more central processing unit cores. Specifically, the central processing unit or the central processing unit core can be implemented as a CPU, an MCU, or a DSP, etc.

[0144] It should be noted that not all steps and modules in the above processes and structure diagrams are required, and certain steps or modules can be omitted based on actual needs. The execution logic of each step is not fixed and can be adjusted as needed. The division of each module is merely for the convenience of describing the functional division adopted. In actual implementation, a module can be implemented by multiple modules, and the functions of multiple modules can be implemented by the same module. These modules can be located in the same device or in different devices.

[0145] The hardware modules in each embodiment can be implemented mechanically or electronically. For example, a hardware module may include a specially designed permanent circuit or logic device (such as a dedicated processor, such as an FPGA or ASIC) for performing a specific operation. The hardware module may also include a programmable logic device or circuit (such as a general-purpose processor or other programmable processor) temporarily configured by software to perform a specific operation. As for whether to implement the hardware module mechanically, or using a dedicated permanent circuit, or using a temporarily configured circuit (such as configured by software), it can be decided based on cost and time considerations.

[0146] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A method for extending the capabilities of a function block, characterized in that: include: Determining (101) a first description file of a first function block, the first description file comprising first information, the first information being used to describe a calling relationship between the first function block and an extended capability in a second function block, the extended capability comprising a basic capability of the second function block and a newly added capability of the second function block; Based on the first information, generating (102) a first code for calling the extended capability in the second functional block; The first description file and the first code are stored (103) in the first function block, wherein when the first code is executed, the extended capability in the second function block is called.

2. The method according to claim 1, characterized in that The first information includes a unique identifier of the second functional block and a unique identifier of the newly added capability in the second functional block.

3. The method according to claim 1, characterized in that Also includes: Determine a second description file for the second functional block, where the second description file includes second information, and the second information is used to describe the newly added capability; Based on the second information, obtaining a second code for implementing the newly added capability; The second description file and the second code are stored in the second function block.

4. The method according to claim 3, characterized in that The second information includes metadata of the second code and a storage address of the second code.

5. The method according to claim 4, characterized in that The acquiring, based on the second information, a second code for implementing the newly added capability includes: obtaining the metadata from the second information; Based on the storage address, obtaining the second code; The metadata is associated with the second code.

6. The method according to any one of claims 1 to 5, characterized in that The first functional block further includes a third code for implementing a basic capability of the first functional block; and the method further includes: The first code and the third code are executed based on the execution sequence represented by the first lifecycle information, wherein the execution sequence includes at least one of the following: Firstly, the first code is executed to call the extended capability, and then the third code is executed to execute the basic capability of the first functional block; Firstly, the third code is executed to execute the basic capability of the first functional block, and then the first code is executed to call the extended capability; While executing the first code to invoke the extended capability, executing the third code to execute the basic capability of the first function block; wherein the first life cycle information is included in the main code of the first functional block, and the main code further includes the third code; or The first life cycle information is included in the first description file.

7. The method according to any one of claims 1 to 5, characterized in that The second functional block further includes a fourth code for implementing a basic capability of the second functional block; and the method further includes: The second code and the fourth code are executed based on the execution sequence represented by the second lifecycle information, wherein the execution sequence includes at least one of the following: First, the fourth code is executed to execute the basic capability of the second functional block, and then the second code is executed to execute the newly added capability; First, running the second code to execute the newly added capability, and then running the fourth code to execute the basic capability of the second functional block; While executing the second code to execute the newly added capability, executing the fourth code to execute the basic capability of the second functional block; The second life cycle information is included in the main code of the second functional block, and the main code further includes the fourth code; Or the second life cycle information is included in the second description file.

8. A device for extending the capabilities of a function block, characterized in that: include: A determination module (601) is configured to determine a first description file of a first function block, wherein the first description file includes first information, wherein the first information is used to describe a calling relationship between the first function block and an extended capability in a second function block, wherein the extended capability includes a basic capability of the second function block and a newly added capability of the second function block; A generating module (602) is configured to generate a first code for calling the extended capability in the second function block based on the first information; The calling module (603) is configured to store the first description file and the first code in the first function block, wherein when the first code is executed, the extended capability in the second function block is called.

9. The device according to claim 8, characterized in that The determining module (601) is configured to determine a second description file of the second functional block, wherein the second description file includes second information, and the second information is used to describe the newly added capability; The generating module (602) is configured to obtain a second code for implementing the newly added capability based on the second information; The calling module (603) is configured to store the second description file and the second code in the second function block.

10. The device according to claim 8 or 9, characterized in that The first functional block further includes a third code for implementing a basic capability of the first functional block; and the apparatus further includes: An execution module (604) is configured to execute the first code and the third code based on an execution sequence represented by the first lifecycle information, wherein the execution sequence includes at least one of the following: Firstly, the first code is executed to call the extended capability, and then the third code is executed to execute the basic capability of the first functional block; Firstly, the third code is executed to execute the basic capability of the first functional block, and then the first code is executed to call the extended capability; While executing the first code to invoke the extended capability, executing the third code to execute the basic capability of the first function block; wherein the first life cycle information is included in the main code of the first functional block, and the main code further includes the third code; or The first life cycle information is included in the first description file.

11. The device according to claim 8 or 9, characterized in that The second functional block further includes a fourth code for implementing a basic capability of the second functional block; and the apparatus further includes: An execution module (604) is configured to execute the second code and the fourth code based on an execution sequence represented by the second lifecycle information, wherein the execution sequence includes at least one of the following: First, the fourth code is executed to execute the basic capability of the second functional block, and then the second code is executed to execute the newly added capability; First, running the second code to execute the newly added capability, and then running the fourth code to execute the basic capability of the second functional block; While executing the second code to execute the newly added capability, executing the fourth code to execute the basic capability of the second functional block; The second life cycle information is included in the main code of the second functional block, and the main code further includes the fourth code; Or the second life cycle information is included in the second description file.

12. An electronic device, characterized in that: include: Processor (701); a memory (702) for storing executable instructions of the processor (701); The processor (701) is configured to read the executable instructions from the memory (702) and execute the executable instructions to implement the method for extending the capability of a function block according to any one of claims 1 to 7.

13. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method for extending the capability of a function block according to any one of claims 1 to 7 is implemented.

14. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method for extending the capability of a function block according to any one of claims 1 to 7.