WO2023051832A1 - 构造组合函数块的方法及装置、组合函数块、存储介质 - Google Patents

构造组合函数块的方法及装置、组合函数块、存储介质 Download PDF

Info

Publication number
WO2023051832A1
WO2023051832A1 PCT/CN2022/125382 CN2022125382W WO2023051832A1 WO 2023051832 A1 WO2023051832 A1 WO 2023051832A1 CN 2022125382 W CN2022125382 W CN 2022125382W WO 2023051832 A1 WO2023051832 A1 WO 2023051832A1
Authority
WO
WIPO (PCT)
Prior art keywords
data item
type
function block
data
output
Prior art date
Application number
PCT/CN2022/125382
Other languages
English (en)
French (fr)
Inventor
容毅
曲春晓
Original Assignee
山东程序元软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 山东程序元软件有限公司 filed Critical 山东程序元软件有限公司
Priority to GB2404687.2A priority Critical patent/GB2625954A/en
Publication of WO2023051832A1 publication Critical patent/WO2023051832A1/zh
Priority to NO20240309A priority patent/NO20240309A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Definitions

  • Embodiments of the present disclosure relate to a method for constructing a combined function block by nesting using a combined paradigm, an apparatus for constructing a combined function block, a combined function block, and a non-transitory computer-readable storage medium.
  • At least one embodiment of the present disclosure provides a method for constructing a combined function block by nesting and using the combined paradigm, which is applied to a function block library, and the function block library includes a plurality of function blocks, wherein the method includes: from multiple Selecting at least one combination paradigm in the combination paradigm; obtaining the permutation operation of at least two function blocks in the plurality of function blocks to obtain a calculation sequence; The connection relationship between; based on the interface of each function block in the at least two function blocks and the connection relationship between the at least two function blocks, the at least two function blocks are packaged as a combined function block, and generated The interface corresponding to the combined function block; wherein, each function block in the plurality of function blocks includes at least one input data item and at least one output data item corresponding to the interface corresponding to the function block, and the at least one input The data item and the at least one output data item exist in the form of storage in the function block, and the splicing operation includes connecting at least part of the input data items and/or at least part of the output data
  • At least one embodiment of the present disclosure provides a combined function block obtained according to the method described in any embodiment of the present disclosure, the combined function block includes: one or more function blocks, and the one or more function blocks pass data Joins and/or auxiliary merged joins.
  • At least one embodiment of the present disclosure provides an apparatus for constructing a combined function block, including: a memory for non-transitory storage of computer-readable instructions; a processor for running the computer-readable instructions, the computer-readable The instructions implement the method according to any embodiment of the present disclosure when executed by the processor.
  • At least one embodiment of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the computer-readable instructions according to The method described in any one of the embodiments of the present disclosure.
  • FIG. 1 is a schematic diagram of a method for constructing a combined function block provided by some embodiments of the present disclosure
  • FIG. 2A is a schematic diagram of two calculated graphical expressions provided by some embodiments of the present disclosure.
  • Figure 2B is a schematic diagram of combining the two calculations shown in Figure 2A;
  • FIG. 2C is a schematic diagram of a graphical representation of a new calculation obtained by combining the two calculations shown in FIG. 2A;
  • FIG. 2D is a schematic diagram of a graphical representation of an interface of a new calculation obtained by combining the two calculations shown in FIG. 2A;
  • Fig. 3A is a schematic diagram of a graphical expression form of a data item provided by some embodiments of the present disclosure
  • FIG. 3B is a schematic diagram of a graphical expression form of an integer data item provided by some embodiments of the present disclosure.
  • Figures 3(1)A to 3(1)F are storage hierarchical structure diagrams of interfaces of function blocks provided by some embodiments of the present disclosure.
  • FIG. 4A is a schematic diagram of a graphical representation of an interface of a basic function block provided by some embodiments of the present disclosure
  • FIG. 4B is a storage hierarchical structure diagram of an interface of a basic function block provided by some embodiments of the present disclosure
  • FIG. 4C is a schematic diagram of a graphical representation of an interface of an addition function block provided by some embodiments of the present disclosure.
  • FIG. 4D(1) is a storage hierarchy structure diagram of an interface of an addition function block provided by some embodiments of the present disclosure.
  • FIG. 4D(2) is another storage hierarchy structure diagram of an interface of an addition function block provided by some embodiments of the present disclosure.
  • FIG. 4E is a schematic diagram of a graphical expression form of a basic function block representing a relational expression provided by some embodiments of the present disclosure
  • FIG. 4F is a schematic diagram of a graphical expression form of a specific example of a basic function block representing a relational expression provided by some embodiments of the present disclosure
  • FIG. 4G is a storage hierarchical structure diagram of an interface of a basic function block representing a relational expression provided by some embodiments of the present disclosure
  • FIG. 4H is a schematic diagram of a graphical expression form of a basic function block representing a logical expression provided by some embodiments of the present disclosure
  • FIG. 4I is a schematic diagram of a graphical expression form of a specific example of a basic function block representing logic and expressions provided by some embodiments of the present disclosure
  • FIG. 4J is a storage hierarchy structure diagram of an interface representing a basic function block of logic and expressions provided by some embodiments of the present disclosure
  • FIG. 4K is a schematic diagram of a graphical expression form of a basic function block representing an arithmetic expression provided by some embodiments of the present disclosure
  • FIG. 4L is a schematic diagram of a graphical expression form of a basic function block representing an addition expression provided by some embodiments of the present disclosure
  • FIG. 4M is a storage hierarchy structure diagram of an interface of a basic function block representing an addition expression provided by some embodiments of the present disclosure
  • FIG. 4N is another storage hierarchy structure diagram of an interface of a basic function block representing an addition expression provided by some embodiments of the present disclosure
  • FIG. 40 is a schematic diagram of a graphical expression form of a basic function block representing an assignment expression provided by some embodiments of the present disclosure
  • Fig. 4P is a schematic diagram of a graphical expression form of a specific example of a basic function block representing an assignment expression provided by some embodiments of the present disclosure
  • FIG. 4Q is a storage hierarchical structure diagram of an interface of a basic function block representing an assignment expression provided by some embodiments of the present disclosure
  • FIG. 4R is a schematic diagram of a graphical expression form representing a basic function block of a getname function provided by some embodiments of the present disclosure
  • FIG. 4S is a storage hierarchy structure diagram representing an interface of a basic function block of a getname function provided by some embodiments of the present disclosure
  • FIG. 5A is a schematic diagram of an output-output transmission line provided by an embodiment of the present disclosure.
  • FIG. 5B is a schematic diagram of an output-input transmission line provided by an embodiment of the present disclosure.
  • FIG. 5C is a schematic diagram of another output-input transmission line provided by an embodiment of the present disclosure.
  • FIG. 5D is a schematic diagram of another output-input transmission line provided by an embodiment of the present disclosure.
  • FIG. 5E is a schematic diagram of an auxiliary merging connection provided by an embodiment of the present disclosure.
  • Fig. 6 is a schematic diagram of a combined function block provided by some embodiments of the present disclosure.
  • FIG. 7A is a schematic diagram of a method for combining function blocks based on the sequential combination paradigm provided by some embodiments of the present disclosure
  • Fig. 7B is a schematic diagram of a graphical expression form of at least two function blocks provided by some embodiments of the present disclosure.
  • FIG. 7C is a schematic diagram of a graphical expression form of a constant data item provided by some embodiments of the present disclosure.
  • Fig. 7D is a schematic diagram of the graphical expression form of two function blocks provided by some embodiments of the present disclosure.
  • Fig. 8A is a schematic diagram of a graphical expression form of a calculation sequence provided by some embodiments of the present disclosure.
  • FIG. 8B is a schematic diagram of a graphical representation of the constant data item shown in FIG. 8A;
  • Fig. 8C is a schematic diagram of a graphical expression form after connecting the calculation sequence shown in Fig. 8A;
  • FIG. 8D is a schematic diagram of a graphical expression of the interface corresponding to the combination function block determined based on the connection relationship shown in FIG. 8C;
  • FIG. 8E is a storage hierarchy structure diagram of the interface shown in FIG. 8D;
  • FIG. 9A is a schematic diagram of a combination function block of an if structure provided by some embodiments of the present disclosure.
  • FIG. 9B is a schematic diagram of a method for combining function blocks based on the if combination paradigm provided by some embodiments of the present disclosure.
  • FIG. 9C is a schematic diagram of a graphical expression form of a combination function block of an if structure provided by some embodiments of the present disclosure.
  • Fig. 9D is a schematic diagram of a graphical expression form after connecting the data items in the combination function block shown in Fig. 9C;
  • FIG. 9E is a schematic diagram of a combination function block of a conditional structure provided by some embodiments of the present disclosure.
  • FIG. 9F is a schematic diagram of a graphical expression of the interface corresponding to the combination function block of the if structure shown in FIG. 9E;
  • FIG. 10A is a schematic diagram of a combined function block of a for structure provided by some embodiments of the present disclosure.
  • FIG. 10B is a schematic diagram of a method for combining function blocks based on the for combination paradigm provided by some embodiments of the present disclosure
  • FIG. 10C is a schematic diagram of a graphical expression form of a combination function block of a for structure provided by some embodiments of the present disclosure.
  • Fig. 10D is a schematic diagram of a graphical expression form after connecting the calculation sequence shown in Fig. 10C;
  • Fig. 10E is a schematic diagram of another graphical expression form after connecting the calculation sequence shown in Fig. 10C;
  • Fig. 10F is a schematic diagram of another graphical expression form after connecting the calculation sequence shown in Fig. 10C;
  • FIG. 10G is a schematic diagram of a graphical expression of the interface corresponding to the combination function block of the for structure shown in FIG. 10F;
  • FIG. 10H shows a storage hierarchy diagram of an interface of a function block including data items of an array type
  • FIG. 10I shows a storage hierarchy structure diagram when the first layer of data items of the array type is expanded
  • Fig. 10J shows a storage hierarchy structure diagram when a second-level expansion is performed on an array-type data item
  • Fig. 11A is a schematic diagram of a calculation function provided by some embodiments of the present disclosure.
  • FIG. 11B is a schematic diagram of another graphical expression form of a combination function block of a for structure provided by some embodiments of the present disclosure.
  • FIG. 11C is another schematic diagram of a calculation function provided by some embodiments of the present disclosure.
  • Fig. 11D is a schematic diagram of a graphical expression form after connecting the calculation sequence shown in Fig. 11B;
  • Fig. 11E is a schematic diagram of another graphical expression form after connecting the calculation sequence shown in Fig. 11C;
  • FIG. 11F is a schematic diagram of a graphical expression of the interface corresponding to the combined function block of the for structure shown in FIG. 11E;
  • FIG. 12A is a schematic diagram of a combination function block of a while structure provided by some embodiments of the present disclosure.
  • FIG. 12B is a schematic diagram of a method for combining function blocks based on the while combination paradigm provided by some embodiments of the present disclosure
  • Fig. 13 is a device for constructing a combined function block provided by some embodiments of the present disclosure.
  • Fig. 14 is a schematic diagram of a non-transitory computer-readable storage medium provided by at least one embodiment of the present disclosure
  • Fig. 15A is a schematic diagram of a plurality of function blocks for combination provided by some embodiments of the present disclosure.
  • Fig. 15B is a schematic diagram of performing wiring operations on multiple function blocks shown in Fig. 15A;
  • FIG. 15C is a schematic diagram of an interface of a large function block generated based on the combination of multiple function blocks shown in FIG. 15A;
  • FIG. 15D is a schematic diagram of a large function block generated based on the combination of multiple function blocks shown in FIG. 15A .
  • Algorithm is a combinatorial system, which consists of a finite number of basic structural units and a finite number of combination rules to form an algorithmic closure. Any algorithm can be evolved from the repeated use of basic structural units and a limited number of combination rules.
  • the modular software design method is a method that can improve the efficiency of software development and maintenance. On the one hand, the structure of the software is not 100% modular, and there are still a large number of non-modular development behaviors at the statement level; on the other hand, Existing software design applications and algorithms are not separated, so that although the algorithms used by different software are essentially the same, they cannot be shared because of the different variable names used in the algorithms.
  • the statements in the high-level language are all contained in a function structure.
  • the function structure includes the data area and the calculation area.
  • the data area includes the input parameters of the function, the variables (including output variables and intermediate variables) and the function used to define the statement inside the function. Variables outside the function that will be used, and the calculation area is composed of statements.
  • Statement types include: compound statements (statements can be included in the statement, if, for, while), function (call) statements and basic statements (to achieve addition (+), subtraction (-), multiplication (*), division (/), Statements such as assignment, logical calculation, etc., that is, statements other than variable definition statements, compound statements, and function statements that implement language-defined calculations).
  • the basic statement in the high-level language is regarded as a calculation unit, and the calculation unit includes two parts of the input and output of the calculation.
  • the high-level language compiles a small calculation unit into a large calculation unit through the statement; and in the high-level language organization function In this case, it is necessary to determine the data area first, and name each storage in the data area (that is, define the variable name), and the statement expresses the calculation of the data in the data area by referring to the variable name in the data area, so the high-level language is through the description
  • the relationship between each statement and the storage of the data area organizes calculations, rather than organizing calculations by describing the interactive relationship between each statement, and there is no direct relationship between each statement.
  • the software modularization mentioned in the prior art actually encapsulates multiple statements that realize certain functions into a software module, that is, organizes large calculations by first defining data, and then expressing the relationship between small calculations and data
  • the method is not a modular organization method in essence, and the main reason why the modularization cannot be fully realized is the implementation method of the function structure including statements and data areas in the high-level language.
  • At least one embodiment of the present disclosure provides a method for constructing a combined function block by nesting and using a combined paradigm, a device for constructing a combined function block, a combined function block, and a non-transitory computer-readable storage medium.
  • the method for constructing a combined function block by nesting combined normal forms is applied to a function block library, the function block library includes a plurality of function blocks, and the method includes: selecting at least one combined normal form from multiple combined normal forms;
  • the calculation sequence is obtained by the arrangement operation of at least two function blocks in the function block; based on the calculation sequence, a splicing operation is performed to determine the connection relationship between the at least two function blocks; based on the interface of each function block in the at least two function blocks and A connection relationship between at least two function blocks, encapsulating the at least two function blocks as a composite function block, and generating an interface corresponding to the composite function block.
  • Each function block in the plurality of function blocks includes at least one input data item and at least one output data item corresponding to the interface corresponding to the function block, at least one input data item and at least one output data item are stored in the function block
  • the splicing operation includes connecting at least part of the input data items and/or at least part of the output data items of at least two function blocks.
  • the method for constructing combined function blocks provided by the present disclosure solves the problems of modularization and incomplete abstraction caused by implementing software in existing high-level languages.
  • a larger combined function block can be formed by organizing the calculation interaction relationship between small function blocks, which can realize 100% modularization of the software structure.
  • only Logic implementation needs to be considered, and non-modularized statement-level development behavior is no longer required.
  • algorithm abstraction is realized, which solves the problem of modularization and incomplete abstraction caused by using existing high-level languages to implement software.
  • the relationship between the statement and the data is no longer described, but by describing the relationship between each function block, the data item is attached to the function block in the form of storage so that the description of the relationship between calculations can be converted into an input Output the description of the relationship between storage; use the connection method to establish a connection between function blocks and function blocks, and build an algorithm program that realizes a certain function, that is, a combination of function blocks, which fundamentally realizes modularization, because each function block All have their own storage, no need to define variables, and each variable no longer has actual meaning. In essence, it realizes the high abstraction and standardization of the algorithm, and has high portability, because the variables have no actual meaning, so Break down the code wall between different industries.
  • basic calculations of high-level languages are subdivided according to the type of data to be calculated, and each subdivided basic The statement is attached with input and output storage that matches the type of its data. For example, subdividing the addition statement into two storages of integer type adds the value and outputs it to another storage of integer type, and the storage of two storage types of floating point type Values are added to output to another storage of floating point type, and so on.
  • the number of basic calculations may be 67, and the number of basic data types may be 10, but the disclosure is not limited thereto, and the number of basic calculations and basic data types may be determined according to actual conditions.
  • the storage is attached to the function block so that the description of the relationship between the function blocks can be converted into the description of the relationship between the input and output storage of the function block, thereby realizing modularization.
  • the function block (basic function block and combined function block) is regarded as a chip
  • the type storage (input data item and output data item) is regarded as the pin of the chip (with type), provided in this disclosure
  • the combination operation of the function block becomes the operation of connecting pins similar to the hardware design, so the visual design of the function block can be realized.
  • Visualization operations do not involve naming stores, so the functional block (ie, computation) representation of visualizations is abstract. Visual hardware-like organizational logic makes abstract computing easier to understand.
  • Fig. 1 is a schematic diagram of a method for constructing a combined function block provided by some embodiments of the present disclosure.
  • a function block library includes several function blocks.
  • a plurality of function blocks includes a plurality of basic function blocks and a plurality of combination function blocks.
  • a plurality of basic function blocks represent the smallest unit forming any combination of function blocks, that is to say, in the present disclosure, a basic function block is the smallest function block and cannot be further divided.
  • Add storage that is, data items
  • all combined function blocks All are made up of these smallest basic function blocks.
  • any combination function block can finally be split into multiple basic function blocks, for example, for any combination function block A, the combination function block A is composed of a combination function block B and a basic function block C1, the combination function block B is composed of two basic function blocks C2 and C3, that is to say, actually, the combined function block A is composed of three basic function blocks (ie basic function blocks C1, C2 and C3).
  • each combined function block is composed of at least one basic function block and/or at least one combined function block.
  • the method for constructing a combined function block includes the following steps S10 to S13.
  • Step S10 Select at least one combined normal form from multiple combined normal forms
  • Step S11 Obtain the permutation operation of at least two function blocks in the plurality of function blocks to obtain a calculation sequence
  • Step S12 Based on the calculation sequence, perform a splicing operation to determine the connection relationship between at least two function blocks;
  • Step S13 Based on the interface of each function block in the at least two function blocks and the connection relationship between the at least two function blocks, at least two function blocks are encapsulated into a combined function block, and an interface corresponding to the combined function block is generated.
  • Algorithms and applications are separated to form a public and unified algorithm representation space, which establishes a theoretical basis for 100% algorithm sharing among the entire industry.
  • Standardized specification output for example, generate python code through visual operation.
  • Combination function blocks can achieve high abstraction and high portability
  • each function block in a plurality of function blocks includes at least one input data item and at least one output data item corresponding to the interface corresponding to the function block, at least one input data item and at least one output data item in the function block It exists in the form of storage, that is to say, the input data item and the output data item have data types, and no variable name needs to be specified, that is, at least one input data item and the at least one output data item do not need to specify a variable name.
  • the arranging operation may represent information such as an arrangement order and an arrangement position of at least two function blocks.
  • the permutation operation may be determined based on the calculation functions of the combined function blocks that need to be combined.
  • the splicing operation includes connecting at least part of the input data items and/or at least part of the output data items of at least two function blocks.
  • connection relationship between the at least two function blocks can be determined.
  • a combined function block is obtained by splicing and combining multiple function blocks, and the connection mode between multiple function blocks determines the calculation function of the constructed combined function block. That is, the input and output data items (ie, input and output parameters) of a combined function block can be generated by the connection relationship between the input data items and output data items of multiple function blocks and the input data items and output data items of multiple function blocks , based on this principle to realize the formation process from small function blocks to large function blocks (ie combination function blocks), this principle can be called combination formation principle.
  • the basic combination of calculations (that is, function blocks) is: if the data type attribute of the output data item of one calculation and the data type attribute of the input data item of another calculation (described later) satisfy the type matching rules (described later) will describe), you can connect two data items (that is, storage) to form a combination of two calculations.
  • the input and output data items of the new calculation (combination function block) formed by combination can be generated according to the input and output data items of the two calculations and the connection relationship between the two calculations.
  • calculation A1 includes three input data items t11, t12, and t13, and two output data items t14 and t15
  • calculation A2 includes two input data items t14 and t16, and two output data items t17 and t18.
  • the datatype attribute of the output data item t14 of calculation A1 matches the data type attribute of the input data item t14 of calculation A2 (for example, the data type attribute of the output data item t14 of calculation A1 and the data type attribute of the input data item t14 of calculation A2 type attributes are the same), thus, as shown in Figure 2B, the output data item t14 of calculation A1 and the input data item t14 of calculation A2 can be connected, thus obtaining the new calculation A3 formed by the combination shown in Figure 2C, for example, as As shown in FIG. 2C, the new calculation A3 may include calculation A1 and calculation A2.
  • calculation A3 includes four input data items t11, t12, t13 and t16, and three output data items Items t15, t17, and t18, the output data item t14 of calculation A1 and the input data item t14 of calculation A2 are connected internally, thus, the output data item t14 of calculation A1 and the input data item t14 of calculation A2 are not counted as calculation Input and output data items of A3.
  • step S11 the splicing operation is performed in the following order: according to at least one combination paradigm in a plurality of combination paradigms, at least two function blocks are combined; at least two function blocks after the combination At least some of the input data items and/or at least some of the output data items of the block are connected.
  • step S11 the splicing operation is performed in the following order: at least part of the input data items and/or at least part of the output data items of at least two function blocks are connected; according to multiple combination paradigms At least one composition paradigm in is composed of at least two function blocks following the concatenated data items.
  • a calculation sequence corresponding to the at least two function blocks can be obtained based on the at least two function blocks.
  • the combination process of function blocks is a cyclic recursive process.
  • the combination paradigm for combining multiple function blocks is selected.
  • Nested use finally forms a combination function of various functions. For example, a function block is generated cyclically and recursively, and the data type is a part of the function block, which is also generated cyclically and recursively at the same time.
  • connection rules for combining multiple function blocks are: connect the output data items or sub-data items of one function block to other input or output data items or sub-data items of the same algorithm type in a one-to-many manner .
  • the operation mode for storage follows the data transfer connection Rules, data transmission and connection rules must be followed in the process of organizing function blocks in the four combined paradigms, and all of them are connections issued by output data items.
  • Data transfer link rules include data transfer links, which are directed line segments starting from one data item and ending with another data item.
  • the practical connection rules include an auxiliary merged connection, which is an undirected line segment, and two ends of the auxiliary merged connection connect two data items.
  • Data transfer connections include output-to-output data transfer connections (referred to as output-output connections) and output-to-input data transfer connections (referred to as output-input connections), and output-output connections are used to connect at least two output data items , the output-input link is used to connect at least one input data item and at least one output data item; the auxiliary merged link represents a line connecting multiple input data items.
  • the meaning of the auxiliary merging connection is equivalent to externally storing the input data item with the auxiliary merging connection connected to the same output item by the data transfer connection.
  • a plurality of combined paradigms and wiring rules are applied to the function blocks, so that large function blocks can be constructed from small function blocks.
  • 4 operation modes for function blocks that is, four combination paradigms: sequential combination paradigm, conditional combination paradigm (if combination paradigm), loop combination paradigm (for combination paradigm), when-type loop combination paradigm (while combination paradigm)) and 2
  • An operation mode for storage namely data transfer connection and auxiliary merging connection
  • the function blocks constructed by combination rules are called combination function blocks, which are denoted by the symbol PF. Both basic function blocks and composite function blocks belong to the function block library collection.
  • the combination of functions can be realized by graphical operation plus some language storage data (XML is used as an example in this disclosure), and the user uses graphical visualization operation, which is simple, convenient and easy to understand.
  • XML is used as an example in this disclosure
  • the combination of functions can also be realized by XML language alone.
  • multiple combination paradigms include sequence combination paradigm, conditional combination paradigm (if combination paradigm), loop combination paradigm (for combination paradigm), and when type loop combination paradigm (while combination paradigm).
  • These compositional paradigms enable the process of composing small function blocks into large function blocks.
  • the if combination paradigm is to combine the true function block and the false function block into a combination function block and form the input data item and the output data item of the combination function block.
  • combination paradigm and the for combination paradigm combine the conditional function block and the loop body function block (for example, the loop body function block may run multiple times) to form a combination function block and form the input data items and outputs of the combination function block data item.
  • the sequential combination paradigm is to combine multiple function blocks with a determined execution order into a combined function block and form the input data items and output data items of the combined function block.
  • the structural frames of sequential combination paradigm, if combination paradigm, while combination paradigm and for combination paradigm are fixed.
  • sequence combination paradigm, the if combination paradigm, and the while combination paradigm are basic paradigms, and the for combination paradigm is an additional combination paradigm, so as to facilitate the combination of function blocks.
  • step S13 when at least one combination paradigm is a sequential combination paradigm, the combination function block obtained by combination is a combination function block of sequential structure; when at least one combination paradigm is a conditional combination paradigm, the combination function block obtained by combination is a conditional structure (if structure) combination function block; when at least one combination paradigm is a loop combination paradigm, the combination function block obtained by combination is a combination function block of a loop structure (for structure), when at least one combination paradigm is a current type loop combination paradigm, the combination The obtained combination function block is a combination function block of a while-type loop structure (while structure).
  • the method provided by the embodiments of the present disclosure further includes: storing the combined function block as a function block in the function block library, so as to expand the function block library.
  • Combined function blocks obtained by combining function blocks in the function block library can be used as function blocks to generate new combined function blocks. That is to say, in the embodiments of the present disclosure, multiple function blocks are used to form corresponding combined function blocks, and then the combined function blocks can be used in the organization of other combined function blocks to form new combinations Function block, the new composite function block can be applied again to the organization of the next layer of composite function blocks, organized and nested layer by layer, and finally realize the composite function block with corresponding functions, that is, realize the final software design.
  • Each combination paradigm consists of three parts, which are paradigm combination area, large function interface area, large function interface type and small function interface type relationship area.
  • the data type of the data item of the interface of the large function is determined by all the The data types of data items and/or the data types of all data items in the paradigm combination area are broken up and reassembled to obtain a subset of data types.
  • the data types/interfaces do not exist independently and do not need to be designed independently.
  • Combination paradigm is generated to realize the integration of storage and calculation.
  • the paradigm combination area also includes a small function block area and a combination action area.
  • the small function block area is composed of the interface of at least one function block selected by the user from the function block library, and the combination action area records the splicing of the function blocks in the small function block area by the user.
  • Action the large function interface area is automatically generated by the combination paradigm after the paradigm combination area is completed, including the input part and the output part, and the data items in the input part are all input data items of the small function block area and/or all inputs of the small function block area
  • a subset of the set of data items obtained by breaking up and recombining data items, the data items in the output part are all output data items in the small function block area and/or all output data items in the small function block area are broken up and combined
  • a subset of the set composed of data items obtained by recombination, all the large function interface areas generated by the combination paradigm follow the same function interface specification;
  • the relationship between the large function interface type and the small function interface type records the large function interface area generated by the combination paradigm and
  • the entire algorithm is generally conceived in a top-down manner, the interface part of the algorithm is first designed, each data item is defined in the form of variable names, and then the algorithm statement is written inside the algorithm, and the statement refers to all Defined variables represent calculations on variables.
  • the writing process repeatedly confirm the reference relationship between the algorithm process and the algorithm interface.
  • the algorithm writing process generally generate local variables in the algorithm at the same time.
  • the writing process repeatedly confirm the relationship between the algorithm statement and local variables, local variables and interface definition variables , the whole process is completely manual. This application adopts a bottom-up method.
  • the process of conceiving the algorithm is to manually select the combination paradigm, select the function block integrating storage and calculation, and the splicing and connection actions between the function blocks. While completing the algorithm logic, the function interface and function are automatically generated. The relationship between the interface and the data items of the internal function block does not need to manually write and confirm the relationship between local variables, interface variables and each variable and the algorithm.
  • each function block in the plurality of function blocks has its corresponding calculation function
  • the method provided by the embodiment of the present disclosure further includes: determining the calculation function of the combined function blocks based on the calculation functions and connection relationships of at least two function blocks.
  • each basic function block in the multiple basic function blocks has its corresponding calculation function
  • the calculation function of each combination function block is based on the calculation function and connection relationship of at least one basic function block and/or at least one combination function block to determine the calculation function of each combination function block. That is, in the present disclosure, the computing function of each combined function block may be determined based on the computing functions and connection relationships of multiple function blocks that combine the combined function block.
  • the combined algorithm formed can be obtained according to known algorithms (computing functions of at least two function blocks) and the action relationship between known algorithms (connection relationship of at least two function blocks)
  • the process of combining combined function blocks with corresponding computing functions includes: according to the requirements of corresponding computing functions, the function blocks and combination paradigms required to realize the corresponding computing functions can be determined, Then, multiple required function blocks can be selected from the function block library, and the multiple function blocks can include basic function blocks or composite function blocks.
  • the execution sequence and arrangement position of the selected multiple function blocks can be determined, that is, the multiple function blocks are combined to obtain the calculation sequence corresponding to the multiple function blocks; then , the calculation sequence is spliced and connected to obtain the intermediate combination function block; it is judged whether the intermediate combination function block realizes the corresponding calculation function, and in response to the realization of the corresponding calculation function of the intermediate combination function block, the intermediate combination function block is used as the corresponding Combination function block corresponding to the calculation function; in response to the failure of the intermediate combination function block to realize the corresponding calculation function, continue to select function blocks from the function block library for combination until the combined intermediate combination function block can realize the corresponding calculation function, and then The intermediate combination function block is used as a combination function block to realize the function to be designed, and thus the combination is realized to obtain a combination function block that realizes the corresponding calculation function.
  • the combination function block can be stored in a function block library for subsequent combination. Repeatedly, there will be more and more function blocks in the function block library to realize specific algorithm functions. When all the function blocks contained in the function block to be combined exist in the function block library, use the corresponding function block directly to perform Just combine.
  • each function block (basic function block and combined function block) in the plurality of function blocks can be presented in a graphical form, and the graphical presentation can present the function block to the user in a simple, convenient and intuitive manner.
  • the graphical form corresponds to the symbolic language. That is to say, in the present disclosure, each function block can have a two-dimensional form of expression, that is, two formalization methods, which are imagery and corresponding symbolic language, so as to enrich the expression form of the function block. Expressions can be visualized. These two representation forms can independently and completely express the syntax and programming process of the function block. The user can perform visual operations on the graphics corresponding to the function block, which is simple, convenient and easy to understand, or can also edit the symbolic language corresponding to the function block, so as to realize the operation on the function block.
  • each data item may also have two representation forms of graphics and symbolic language.
  • the symbolic language includes Extensible Markup Language (XML) and json (JavaScript Object Notation, JS Object Notation).
  • XML and json are used as an example to describe each function block, but the present disclosure includes but is not limited thereto.
  • a function block and/or each store (input data item, output data item, etc.) of the function block may be given (applying) a name, and this behavior is called materialization.
  • These names do not intervene in the organizational behavior of the function block, but serve as comments, increasing the readability of the function block and its input and output data items.
  • Some of the names become variable names if the resulting combined function block is compiled into a high-level language. These names are not used if the resulting combined function block is compiled into machine code.
  • the symbolic representation of the combined function blocks is used to store the results of the visual design and provide input to the compiler. The user may not need to manipulate the symbolic representation of the compositional language.
  • the interface corresponding to the function block includes an input part and an output part, the input part of the interface corresponding to the function block corresponds to at least one input data item of the function block, and the function block The output part of the corresponding interface corresponds to at least one output data item of the function block. That is to say, in the embodiments of the present disclosure, each function block corresponds to an interface, and the interface includes an input part and an output part, the input part corresponds to at least one input data item, and the output part corresponds to at least one output data item.
  • each input data item in the input part of each interface can be combined into an input data item of a combined data type
  • each output data item in the output part of each interface can be combined into a combined data type output data item.
  • At least one input data item and at least one output data item each include a data type attribute, a data class attribute, a storage type attribute, a value attribute, a physical address attribute, a relative address attribute, a name attribute, and the like.
  • input data items and output data items may be collectively referred to as data items.
  • the data items may be input data items or output data items. For example, if a data If the item is in the input part of the interface corresponding to the function block, then the data item is an input data item; if a data item is in the output part of the interface corresponding to the function block, then the data item is an output data item.
  • a data item has a storage function.
  • the name attribute (id attribute) is used to comment on the data item corresponding to the name attribute, and does not participate in the splicing operation of the function block to which the data item corresponding to the name attribute belongs.
  • the technical solution provided by this disclosure can realize abstract algorithm design, that is, the combination process of function blocks provided by this disclosure does not involve variable names, it is an abstract algorithm representation and design, and it is a common algorithm representation and design method for all different applications, so as to realize different applications algorithm sharing among them.
  • the application is reflected in the id attribute of the data item.
  • the value of the id attribute can be the application name to facilitate the description of the algorithm with the concept of the application, but the id attribute does not intervene in the algorithm design and operation, and is only used as a comment.
  • the name attribute is compiled into a variable name in the high-level language.
  • the relative addressing of data items is handled automatically by the algorithm.
  • the physical address attribute (name attribute) is used to indicate the physical address where the data item is located when the algorithm (the algorithm determined based on the function block) actually runs.
  • the relative address attribute is used to represent the sequence coded value of the data item, and can be automatically calculated by the algorithm.
  • the relative address attribute may not be reflected.
  • data category attributes include basic data types, composite data types, pointer types, and generic types
  • composite data types include basic composite data types, XOR types, array types, etc.
  • pointer types include general pointer types and non-generic pointer types.
  • the data item of the general pointer type does not have a specific data item, that is, the data item of the general pointer type is empty, and the data item of the non-general pointer type has a specific data item.
  • the data type attribute refers to the type of data item, and the storage type attribute includes virtual storage and real storage.
  • the storage type attribute in the Extensible Markup Language (XML) framework, can be expressed as memory, when memory is 1, it means real storage, when memory is 0, it means virtual storage, default In this case, the memory is 1, and the memory can be determined by the splicing action.
  • the circle representing the data item in graphics, if the storage type attribute of the data item is real storage, the circle representing the data item is a solid circle; if the storage type attribute of the data item is virtual storage, it represents the data item The circle of the item is a hollow circle.
  • the present disclosure is not limited to using circles to represent data items, and may also use rectangles, rhombuses, etc. to represent data items. In the description of the present disclosure, the embodiments of the present disclosure are described by taking circles to represent data items as an example.
  • the data item can be called a combined data item; if the data category attribute of a data item is a basic data type , then the data item can be called a basic data item; if the data category attribute of the data item is a pointer type, the data item can be called a pointer data item; if the data category attribute of the data item is generic, the data item can be Known as a generic data item.
  • the data item of the combined data type includes a plurality of data items whose data category attribute is a basic data type, or, Include multiple data items whose data category attribute is a composite data type, or include multiple data items whose data category attribute is a pointer type, or include multiple data items whose data category attribute is a generic type, or, the composite data type
  • the data item includes at least two data category attributes of the following data category attributes: basic data type, combined data type, pointer type and generic type.
  • a data item of a composite data type is composed of one or more data items of a basic data type and/or one or more data items of a composite data type, one or more data items of a pointer type and/or one or more A combination of generic data items.
  • the structure format of the data item whose data category attribute is a basic data type, the data item whose data category attribute is a composite data type, the data item whose data category attribute is a pointer type, and the data item whose data category attribute is a generic type are the same and canonical Yes
  • the structure of a data item whose data category attribute is a combined data type is a nested structure
  • the structure format of each layer of data items in the nested structure is the same.
  • basic data types include but are not limited to byte data types (byte), short integers (short), integers (int), long integers (long), single precision floating point (float), double precision floating point Type (double), Boolean (boolean), character type (char), string type (string).
  • the basic data types are not limited to the above data types. You can choose the basic data types of the high-level language, or you can only choose bits (bit, 0, 1), etc. For practicality, you can choose the basic data corresponding to the high-level language type. It should be noted that the basic data type may also include a constant type, and a data item of the constant type has a specific constant value.
  • pointer types In addition to the basic data types, there are pointer types (ref) and generic types (*).
  • the data items of the pointer type represent the physical addresses stored in the actual runtime.
  • the data items of the generic type represent the uncertain data types. It can Represents any data type.
  • id represents the annotation description name of the data item (i.e., the concrete name), and represents the meaning of the data item in the data structure corresponding to the data item, which can be named concretely by the user and does not participate in the organization and calculation of the function block; name is used Indicates the physical address of the data item when the algorithm (based on the function block) is actually running, and the relative position of the data item is determined by the xml structure; value indicates the value attribute of the data item, for the data item of the combined data type It is determined by the value of the data item inside the data item of the combined data type; typeclass indicates the data category attribute of the data item; typevalue indicates the data type attribute, that is, the actual data type of the data item, such as int, char and other basic data types , int2 and other combined data types; typeid represents the user-defined data type name, that is to say, in this application, the user can customize some data types, in some embodiments, typeid and typevalue can be the same; memory represents the
  • the value of memory is 0, indicating that the data item is virtual storage, and the value of memory is 1, indicating that the data item is real storage.
  • typeclass can be represented by numbers. When typeclass is 0, it indicates the basic data type; when typeclass is 1, it indicates the basic combined data type; when typeclass is 2, it indicates that the data structure is an array type; when typeclass When it is 3, it represents the XOR type; when the typeclass is 4, it represents the pointer type ref; when the typeclass is 5, it represents the generic type.
  • the basic combined data type, array type and XOR type are all combined data types, and the data items of the basic combined data type can be composed of basic data types, pointer types, and generic types, for example, consisting of two int types
  • a data item int2 is obtained by combining the data items, and the type of the data item int2 is the basic combined data type.
  • a data item charref is obtained by combining a data item of char type and a pointer type
  • the type of the data item charref is a basic combined data type.
  • Pointer types ref and generics are neither primitive nor composite data types.
  • the typevalue of the pointer-type data item is the symbol "&" plus the data type of the data item pointed to by the pointer-type data item, for example, a pointer to an int2 type A pointer to a data item whose typevalue is &int2. If the data item of the pointer type does not point to any data item, the data item of the pointer type is a data item of the general pointer type, and the internal structure of the data item of the general pointer type is empty and does not contain any other data description.
  • the data item of the non-universal pointer type contains descriptions of other data items inside, and other data items Items can be primitive data types, primitive composite data types, array types, and exclusive-or types. For example, if the data item pointed to by a pointer type data item is an integer type data item, then the pointer type data item is a non-generic pointer type data item, and the XML description of the non-generic pointer type data item:
  • data items of basic data types, pointer types, and generic types can be combined into data items of composite data types.
  • Data items of combined data types can be further combined with other data items (data items of combined data types, data items of basic data types, pointer types or generic types) to obtain new data items of combined data types.
  • a data item of a basic data type has a basic data structure
  • a data item of a combined data type has a combined data structure
  • the data structure of a data item of a combined data type is called a combined data structure
  • the basic data structure the data structure of the data item of the data type
  • the data item of the general pointer type and the generic data item that is, its data category attribute is generic
  • the data items of have a data structure consistent with the composite data structure.
  • the JSON representation of the data item is as follows:
  • Tags represent attributes in the same format as XML.
  • name is used to indicate the physical address where the data item is located when the algorithm (based on the algorithm determined by the function block) actually runs.
  • the relative address attribute of the data item in the data structure corresponding to the data item can be automatically calculated by the algorithm, and may not be reflected in the JSON expression of the data item.
  • the 7 attribute values in the angle brackets ⁇ > are arranged in sequence, representing the values corresponding to id, name, value, typeclass, typevalue, typeid, and memory in XML in sequence.
  • the data item can be expanded.
  • the expansion action has no data type attributes and data category attributes for the data item and the data items contained in it. Influence. If the data item contained in the pointer data item is also a combined data type (basic combined data type, XOR type, array type) or a data item of a non-universal pointer type, the expansion action can continue to be applied to the data item contained inside until the data item The type satisfies the type matching rules or the data item is a basic data type, a general pointer type, or a generic type.
  • FIG. 3A is a schematic diagram of a graphical expression form of a data item provided by some embodiments of the present disclosure
  • FIG. 3B is a schematic diagram of a graphical expression form of an integer data item provided by some embodiments of the present disclosure.
  • FIG. 3A shows a graphical expression form of a data item id.
  • a solid circle can represent a data item of a basic data type, that is, storage.
  • the variable name id indicates the name of the comment description of the data item;
  • the attributes of the data item can include: data type attribute, whether it is a constant (the value of the constant data is a definite value, and it cannot be modified in subsequent operations, If it is a constant, there are also constant value attributes), etc.
  • FIG. 3B shows a graphical representation of an int-type data item a
  • the XML schema representation of the data item a is:
  • the JSON representation of the data item a is:
  • XML schema representation of a constant data item a is:
  • a blue solid circle may be used to represent non-constant data items
  • a yellow solid circle may be used to represent constant data items.
  • two data items of type int are IdName1 and IdName2 respectively.
  • the combination of the two int-type data items results in the combined data item int2, and the XML schema of the combined data item int2 is expressed as (it should be noted that the int2-type data item only exists in the basic function block):
  • the input and output data items formed according to the combination rules are combined data types outside the scope of basic data types, pointer types and generic types, and the data items of combined data types (that is, combined data items) are
  • the ordered set of input and output data items in the interface of the combined function block can be expanded to basic data types, general pointer types, and generic data items in the combined function block.
  • the combination data item is a data item (input data item and output data item) formed according to the combination rules during the combination process of the function block, and the combination data item may represent an ordered set of input data items in the interface of the combination function block and An ordered collection of output data items.
  • the XML representation of a data item of composite data type is:
  • the nested structure of the combined data item can represent the relative position of the combined data item in the data structure
  • the generation rules of the relative position of the data item include: in the data structure of the same layer, the value of the relative position value starts from 0 Encoding, increasing in integer order.
  • the data item int2 and the data item 21 are two data items in the same layer data structure of the data item (int2) int, and the data type attribute is int2
  • the data item int2 is the first data item in the data structure of the combined data item (int2) int, therefore, the relative position value of the data item int2 is 0, and the data item 21 is the data structure of the combined data item (int2) int Therefore, the relative position value of data item 21 is 1; for data item int2, data item 11 is the first data item of data item int2, and the relative position value of data item 11 is 0, data Item 12 is the second data item of data item int2, and the relative position value of data item 12 is 1, and so on, and the relative position encoding rules of each layer of data structure are the same.
  • the relative position does not need to be described by attribute symbols, it is determined by the structure of the data item, and can be automatically calculated and obtained by the algorithm
  • the positioning of the data item includes: positioning the data item x, starting from the outermost layer of the combined data structure of the combined data item where the data item is located, along the path of the data item x in the combined data structure, using relative The position value is expressed by adding ".”
  • the positioning of data item 12 starts from the outermost data item (int2) int, traverses along the path from data item (int2) int to data item int2, and uses the relative position value to obtain the data item 12
  • the relative path in the data structure is 0.0.1, wherein the first 0 in the relative path 0.0.1 represents the relative position value of the data item (int2) int, and the 0 in the relative path 0.0.1
  • the second 0 represents the relative position value of the data item int2
  • the 1 in the relative path 0.0.1 represents the relative position value of the data item 12; similarly, the relative path of the data item int2 is 0.1; the data item (int2)int
  • the relative path is 0. It should be noted that, since the data item 11 and the data item 12 are data items of the same layer, the relative position value of the data item 11 is not included in the relative path of the data item 12 .
  • the value of typevalue in a combined data item can be omitted to indicate that when the typevalue attribute is used
  • the naming rules for the typevalue (namely the type label) in the data item of the basic combined data type include:
  • the typevalue of the data item is composed of the basic data type, pointer type, and generic type contained in the data item.
  • the representation form of the typevalue of the data item is: (basic data type, pointer type, generic type)+quantity.
  • the input part of the interface of the addition function block of type int is composed of two input data items of type int, that is, the data type attribute of the combined data item obtained by combining is represented as int2, for example, the XML representation of the input part is:
  • the naming rules for the typevalue in the data item of the basic composite data type also include: for the data item of the composite data structure in the composite function block, the typevalue of the data item is determined by the composite data type or the basic data type or Pointer type or generic composition.
  • the representation form of the typevalue of the data item basic data type/pointer type/generic type 1+(combined data type 1)+ «; where () indicates a combined data type.
  • the XML representation of a data item T of the composite data structure is:
  • the actual data type attributes of the data item T are t1t2... tn, for 1 ⁇ k ⁇ n, if tk is a composite data type or a non-generic pointer type, then in the naming of the actual data type attribute of data item T, tk is replaced by the data type attribute of its internal data item and added with brackets, According to this rule, recurse in turn until the data item is a data item of basic data type, general pointer type or generic type.
  • the combined function block includes a basic function block of a relational expression and a basic function block of a logical expression.
  • the expression form of the typevalue of the data item (int2)(boolean2) of the combined data type corresponding to the input part is: (int2)(boolean2).
  • the data item (int2) (boolean2) is composed of two data items of combined data type int2 and boolean2, the data item int2 is composed of data items of two basic data types (int), and the data item boolean2 is composed of two basic data types (boolean ) consists of data items.
  • the splicing operation also includes data item expansion rules, type matching rules, and connection requirement rules, corresponding to data item expansion actions and connection actions (ie, connection operations), that is, data items can be expanded based on data item expansion rules.
  • data item expansion actions and connection actions ie, connection operations
  • Type matching rules or data items are basic data types, general pointer types or generic types.
  • data item d is composed of n data items d1, d2,...dn
  • the data categories of n data items are tc1, tc2,...tcn respectively
  • the types of n data items are t1, t2, ...tn, where, n>1
  • the data item d is a data item of a basic combined data type
  • the data item s is composed of m data items s1, s2,...sm
  • the data categories are tcf1, tcf2,...tcfm
  • the types of n data items are tf1, tf2,...tfm, where m>1, and then data item d and data item s are combined in an XOR manner, Form a combined data item of the XOR type, the typeclass of the combined data item of the XOR type is 3, the typevalue of the combined data item of the XOR type is the typevalue of the data item d and the typevalue of the data item s are
  • the data item d and the data item s inside the combined data item of the XOR type may be a basic data type, a basic combined data type, an XOR type, an array type, a pointer type, a generic type, and the like. It should be noted that the data item of the XOR type has an XOR structure. The value of the typevalue of the data item of the XOR type can be omitted, and it is automatically calculated by the algorithm.
  • a combined data item of the XOR type may be graphically represented by a '+' symbol in a solid circle (eg, blue) (eg, as shown in FIG. 9F ).
  • a combination data item of XOR type is formed by XOR of data item T1 and data item T2
  • the XML representation of the combination data item of XOR type is as follows:
  • an expansion action can be performed on the combined data item of the XOR type, and the expansion action can be performed on the combined data item of the XOR type and the data type attributes of the data items contained in it ,
  • the data category attribute has no effect.
  • the expansion operation can continue to be applied to the data items contained inside until the data The type of the item satisfies the type matching rules or the data item is a basic data type, a general pointer type, or a generic type.
  • an array data item a is a data item that contains n data items of type T
  • n can be any constant, or a variable
  • type T can be a basic data type, a basic combined data type, an exclusive OR type, Array type, pointer type, and generic type, simplify the representation of n data items of type T, and only give a description of the data item.
  • the data type attribute of the array data item a is T[], and the data type attribute is 2.
  • the xml representation of an array data item of type T[] is as follows:
  • the value of typevalue of an array-type data item can be omitted, and it is automatically calculated by the algorithm.
  • the expansion action will affect the data type attribute and data category attribute of the array data item and the data items contained in it.
  • the operation process of the expansion action is as follows: If the expanded data The array data item contained inside the item is also an array data item of composite data type, and the expansion action can be continued to be applied to the array data item of composite data type contained inside, until the type of the data item meets the type matching rule or the data item is an array of basic data types Or an array of pointer types or an array of generic types.
  • the data category attribute of the array data item T[] is 2
  • the data type attribute of the array data item T[] is T[]
  • the array data item T[] contains a combined data item of type T
  • the combined data item contains k data items
  • the data type attributes of the k data items are t1, t2, ..., tk
  • the data category of T The attribute may be 1, 3 (except the basic data type), and the data type attribute of T is t1t2...tk.
  • the array data item T[] is expanded, and the k data items are Nized to form k arrays Data items t1[], t2[],...tk[], the data category attribute of each array data item in the k array data items is 2, and follow the combination rules of data types at the same time, the array data item T[] Become a combined data item D formed by the combination of t1[], t2[],...tk[], that is, cancel the Nization of T[], and combine the data category attribute of the data item D with the data category of the array data item T
  • the attributes are the same (possibly 1, 3), and the data type attribute of the combined data item D is t1[]t2[]...tk[].
  • the data item at this time is the basic Type array, which cannot be expanded; second, when the user's connection operation requirements are met, you can choose not to expand the operation.
  • the array logical equivalent transformation rule indicates that the array data item T[] can be expressed as a combined data item D formed by combining t1[], t2[], ... tk[].
  • the data type attribute of the array data item T[] is T[]
  • T is an array of combined data types, namely T itself is an array, which contains m data items t1, t2, ..., tm
  • the data type attribute of T is (t1t2...tm)[]
  • the data category attribute of T is 2, and the array
  • the data type attribute of the data item T[] is ((t1t2...tm)[])[])[]]
  • to expand the array data item T[] needs to expand T first, that is, first to (t1t2...tm )[] data item is expanded, and the expansion action is as described above, expand (t1t2...tm)[] into t1[]t2[]...tm[], at this time, the data type attribute of the array data item T[] It is (t1[]t2[]...tm[])[], and the data type attribute is 2. If there are arrays of
  • the specific operation is expressed as: the expansion rule of the array structure, that is, for the function block where the data item of the array type is located, the logical equivalent expansion operation can be performed for the data item of the array type, and the operation needs to be described as follows : Assuming that the output data item of the current layer of the function block is an array type data item, the data category attribute of the array type data item is 2, and the data type attribute is ((t1t2)t3)[], the array type data item is An array of combined data types, which contains a data item D1 of a combined data type (data type attribute is t1t2) and a data item D2 of a basic data type (data type attribute is t3), and the combined data type is ((t1t2)t3) , the data category attribute is 1.
  • the data items D1 and D2 contained in the data item are logically converted into an array form of each data item, and the data type attributes are (t1t2)[] and t3[ ], the data category attribute of the array data item is 2, and at the same time, the original data item T[] is cancelled.
  • the generated data type attribute is (t1t2)[]t3[ ] and the data item whose data type attribute is 1; for the array data item whose data type attribute is (t1t2)[] formed after expansion, you can choose to continue to expand according to the user's wishes; for the data item whose data type attribute is t3[], Because it is an array of basic data types, it does not meet the expansion conditions, and cannot continue to expand the data item whose data type attribute is t3[]. For input data items, reference may be made to the above relevant descriptions for output data items. After the array data items are expanded, they can be merged according to the inverse of the above steps until the first level of the data items.
  • FIGS. 3(1)A to 3(1)F are diagrams of the storage hierarchy structure of the interfaces of the function blocks provided by some embodiments of the present disclosure.
  • Figure 3(1)A is a function block with array data items of basic combined data types
  • Figure 3(1)A is the storage hierarchy structure diagram of the interface of the function block when it is not expanded
  • Figure 3(1)B It is the form after the expansion action of the array data item
  • Figure 3(1)B is the storage hierarchy structure diagram of the interface of the function block expanded to the second layer
  • Figure 3(1)A is Figure 3(1)B The combined form of the array data items.
  • Figure 3(1)C is a function block with an array data item of XOR combination data type
  • Figure 3(1)D is the form after the array data item is expanded
  • Figure 3(1)C is Figure 3 (1)
  • Figure 3(1)E is a function block containing data items of array type inside
  • Figure 3(1)F is the form after expanding the array
  • Figure 3(1)E is the array merge of Figure 3(1)F later form. It should be noted that the specific meanings of each part in the storage hierarchy diagram shown in FIGS. 3(1)A to 3(1)F will be described below.
  • Fig. 10H shows a storage hierarchy structure diagram of the interface of the function block including the data item of the above-mentioned array type
  • Fig. 10I shows a storage hierarchy structure diagram when the data item of the above-mentioned array type is expanded at the first level
  • Fig. 10J shows a storage hierarchy structure diagram when the second-level expansion is performed on the data items of the above-mentioned array type.
  • the input part of the function block PF has a total of one layer, and the input part is currently displayed on the first layer, and the output part of the function block PF has three layers, and the output part is currently displayed on the first layer layer.
  • the operation when the first layer of the output data item of the function block is expanded is: the internal type of the first layer of the output data item is logically modified to (t1t2)[]t3[], XML Expressed as:
  • the input part of the function block PF is currently displayed to the first layer, and the output part of the function block PF is currently displayed to the second layer.
  • the operation for expanding the second layer of the output data item of the function block is: logically modify the internal type of the second layer of the output data item to t1[]t2[]t3[], XML is represented as:
  • the input part of the function block PF is currently displayed to the first layer, and the output part of the function block PF is currently displayed to the third layer.
  • basic function blocks in the XML schema, basic function blocks can be expressed as F, and composite function blocks can be expressed as PF), and the basic function blocks are refined according to basic data types.
  • 134 basic function blocks can be formed.
  • data items with different data types are attached to the basic function blocks, so that when combining, only the connection (line) between the algorithms needs to be considered. Storage design is required.
  • the data type of the data item of the basic function block is a basic data type or a basic composite data type or a general pointer type or a generic type.
  • the basic function block whose name value is 0 can be defined as expaddI (described later, expaddI means int type Addition function block), the basic function block whose name value is 1 is expsubI (it will be described later, expsubI represents the subtraction function block of int type), etc., as long as it is different from the name value of other function blocks in the function block library.
  • expaddI means int type Addition function block
  • expsubI means the subtraction function block of int type
  • the value of name in F/PF indicates the relative address of the function block in the function block library, which is globally unique.
  • the basic function block is the smallest function block used by the combined function block method.
  • the paradigmatic basic function block includes a basic function block that operates on pointers, and the paradigmatic basic function block includes a basic function block getname for obtaining the address of a data item.
  • the multiple basic function blocks in the function block library include basic function blocks representing relational expressions, basic function blocks representing logical expressions, basic function blocks representing arithmetic expressions, and basic function blocks representing assignment expressions , the basic function block representing the data type conversion function, getname.
  • the basic function block, basic type, etc. include but not limited to the above specific cases.
  • Fig. 4A is a schematic diagram of a graphical expression form of an interface of a basic function block provided by some embodiments of the present disclosure
  • Fig. 4B is a diagram of a storage hierarchy structure of an interface of a basic function block provided by some embodiments of the present disclosure.
  • basic function blocks can be represented graphically and in XML.
  • Figure 4A shows a graphical representation of the interface of a basic function block.
  • id represents the name of the basic function block, which is defined by the user;
  • the arrowed line on the left side of the rectangular frame of the basic function block id indicates the input pin of the basic function block, and the solid circle (representing real storage) and hollow circle (representing virtual storage) corresponding to the input pin represent the basic function block i1 represents the i1th input data item of the basic function block, i2 represents the i2th input data item of the basic function block, and so on, all the input data items of the input part of the interface of the basic function block are in order Encoding, the encoding rule is 0, 1, 2, 3..., that is to say, for example, i1 can be 0, i2 can be 1; the line with arrow located on the right side of the rectangular box representing the basic function block id represents The output pin of the basic function block, the
  • the relevant description of the basic function block id can be annotated in the rectangular frame of the basic function block id, for example, the functions that the basic function block can realize can be explained by annotation.
  • the data items are displayed in a tree-shaped nested structure, so that users can have a more intuitive observation of the overall structure of the data items.
  • Users can select a data item, for example, click on Figure 4B
  • the operation buttons "+" and "-" in the storage hierarchy diagram corresponding to the function block F shown in the figure expand and merge the data items in the interface corresponding to the function block F, and store the id of the function block F in the hierarchy diagram
  • the number on the left of "F" is the total level of input data items in the interface corresponding to the function block F
  • the number on the right is the total level of output data items in the interface corresponding to the function block F.
  • the first grid in the first row represents the level of the input part (level represents the maximum nesting level value of the combination type of the input data item corresponding to the input part), and the first row of The second grid represents the id of the basic function block F, and the third grid in the first row represents the level of the output part (level represents the maximum nesting level value of the combination type of the output data item corresponding to the output part).
  • the first grid and the third grid in the second row represent the level decrement button and the increment button.
  • the selected data items can be merged or expanded. If the selected data item does not contain Data item, that is, the selected data item is an array of basic data types, general pointer types, or basic data types. The selected data item cannot be expanded. If the selected data item has been merged, it will not work to use the merge operation on the selected data item. effect.
  • the data items of the input part and the data items of the output part of the interface of the basic function block id are displayed at the second level by default, if the total level of the input part or output part If it is 1, only display up to level 1.
  • Fig. 4C is a schematic diagram of a graphical representation of an interface of an addition function block provided by some embodiments of the present disclosure
  • Fig. 4D (1) is a storage hierarchy structure of an interface of an addition function block provided by some embodiments of the present disclosure
  • FIG. 4D(2) is another storage hierarchy structure diagram of an interface of an addition function block provided by some embodiments of the present disclosure.
  • the input part of the interface corresponding to the addition function block addI includes two levels, namely level1 and level2, and the data type of the input data item corresponding to level1 is int2, which represents a data item of a combined data type; level2
  • the data types of the corresponding input data items are int and int, representing data items of two basic data types.
  • Figure 4D(1) in a current storage hierarchy diagram, the input part is currently expanded to the second level, so that the input part of the interface shows two input data items (int and int), and the output part is currently expanded to level 1.
  • the current storage hierarchy structure diagram shown in FIG. 4D(1) is a default storage hierarchy structure diagram.
  • children is the subordinate data item of the int2 data item.
  • XML schema representation of the interface of a basic function block is:
  • the basic function block F has three attributes: id, name, and value.
  • id represents the name of the basic function block, which is defined by the user
  • name represents the global address of the basic function block in the function block library, and is determined by the computer according to The rules define that the global address is numbered sequentially from 0, the name is a number
  • the function block library is a collection of all function blocks (including basic function blocks and combined function blocks); value represents the operation symbol of the basic function block, for example, "+", "-".
  • the interface of the basic function block F includes two parts, the part between ⁇ in> and ⁇ /in> represents the input part, the part between ⁇ out> and ⁇ /out> represents the output part, the input data items of the input part and
  • the output data item in the output part is the storage attached to the basic function block, and the storage is the carrier of the data;
  • T in ⁇ in> and ⁇ /in> and ⁇ out> and ⁇ /out> indicates the data type of the data item, It can be a basic data type, a composite data type, a pointer type, or a generic type.
  • the JSON representation of the interface of the basic function block is:
  • the third representation of the interface of the basic function block is:
  • F indicates that the function block is a basic function block, and the following three values represent the id, name, and value attribute values of the function block in turn, and the first ⁇ " ",”",””,””,””,””/> indicates the input part of the function block, the format is the same as the data item, the second ⁇ "",”",”",”", “",””,””/> indicates the output part of the function block.
  • Relational operations are operations on data items of seven basic data types: int, float, double, long, char, byte, and short.
  • the output of the formula is a data item of unary boolean type (that is, an output data item). Table 1 below shows various relational expressions.
  • the embodiment of the present disclosure also includes two basic function blocks related to pointers, namely equalref: judging whether the data items of the pointer type are equal, and isnull: judging whether the data items of the pointer type are null.
  • isnull includes an input data item and an output data item, the data type attribute of the input data item is ref, and the data type attribute of the output data item is boolean.
  • FIG. 4E is a schematic diagram of a graphical expression form of a basic function block representing a relational expression provided by some embodiments of the present disclosure.
  • the name of the basic function block representing a relational expression is RE
  • the basic function block RE representing a relational expression has two input data items, which are respectively idName1 and idName2, which represent a relational expression
  • the basic function block RE has an output data item idName3, and the output data item idName3 is a data item of boolean type.
  • the XML schema of the basic function block RE representing a relational expression is represented as:
  • the data type attribute of the two input data items idName1 and idName2 is expressed as T
  • T can be any one of int, float, double, long, char, byte, short
  • the data type attribute of the output data item idName3 is boolean .
  • T is int, that is, the data types of the input data items idName1 and idName2 are both integers
  • the data type T2 of the combined data item formed by combining the two input data items idName1 and idName2 is int2 .
  • the two input data items idName1 and idName2 can be combined into a combined data item, which is encapsulated as the basic function representing the relational expression
  • the input part of the interface corresponding to the block, and the output data item idName3 is encapsulated as the output part of the interface corresponding to the basic function block representing the relational expression.
  • the relative address of the input data item idName1 is 0, that is, the relative address of the input data item idName1 in the combined data item obtained by combining the input data items idName1 and idName2
  • the address is 0, and the relative address of the input data item idName2 is 1, that is, the relative address of the input data item idName2 in the combined data item obtained by combining the input data items idName1 and idName2 is 1, and so on.
  • the relative address of the combined data item obtained by combining the input data items idName1 and idName2 is 0, that is, the relative address of the combined data item obtained by combining the input data items idName1 and idName2 in the input part of the interface corresponding to the basic function block RE representing the relational expression
  • the address is 0. It should be noted that the relative address attribute of a data item is not represented by name, but is implied by the data structure of the data item and automatically calculated by an algorithm.
  • FIG. 4F is a schematic diagram of a graphical expression form of a specific example of a basic function block representing a relational expression provided by some embodiments of the present disclosure
  • FIG. 4G is a basic function representing a relational expression provided by some embodiments of the present disclosure.
  • FIG. 4F shows a graphical expression form of a basic function block representing a relational expression of type int
  • FIG. 4G is a storage hierarchy of an interface of a basic function block of a relational expression of type int
  • the relational expression of the int type is an int type greater than expression, and the expression forms of other data types are similar to this.
  • the name of the basic function block representing the relational expression of type int is moreint
  • the basic function block moreint representing the relational expression of type int includes two input data items a1 and a2 and one output data item b1
  • the data type attributes of the input data items a1 and a2 are both int type
  • the data type attribute of the output data item b1 is boolean type.
  • the XML schema representation of the basic function block moreint is:
  • the input part of the interface corresponding to the basic function block moreint includes two levels, which are respectively the first level (ie int2) and the second level (ie int and int), and the interface corresponding to the basic function block moreint
  • the output part of includes 1 level (i.e. boolean), thus, as shown in Figure 4G, in the storage hierarchy structure diagram of the interface of the basic function block moreint, the total level of the input part is 2, and the total level of the output part is 1 , the current display level of the input part is 2, and the current display level of the output part is 1.
  • the input part shows two input data items a1 and a2, and the output part shows one output data item b1.
  • logical expressions are used to implement logical operations, which include three types: && logic and expand,
  • the input of unary logic operation is a data item, and the data type of the data item must be boolean type, the input of binary logic operation is a combined data item formed by combining two data items of boolean type, the output of unary logic operation and The output of the binary logical operation is a data item of boolean type.
  • FIG. 4H is a schematic diagram of a graphical expression form of a basic function block representing a logical expression provided by some embodiments of the present disclosure.
  • the name of the basic function block representing the logical expression is LE
  • the basic function block LE representing the logical expression has two input data items, respectively idName4 and idName5, which represent the logical expression
  • the basic function block LE of has an output data item idName6.
  • the two input data items idName4 and idName5 and the output data item idName6 are all boolean data items.
  • the XML schema for an elementary function block LE representing a logical expression is:
  • the data type attribute of the two input data items idName4 and idName5 is boolean
  • the data type attribute of the combined data item formed by the combination of the two input data items idName4 and idName5 is boolean2
  • the data type attribute of the output data item idName6 is boolean.
  • the two input data items idName4 and idName5 can be combined into a combined data item, and the combined data item is encapsulated as corresponding to the basic function block representing the logical expression
  • the input part of the interface, the output data item idName6 is encapsulated as the output part of the interface corresponding to the basic function block representing the logical expression.
  • FIG. 4I is a schematic diagram of a graphical expression form of a specific example of a basic function block representing logic and expressions provided by some embodiments of the present disclosure
  • FIG. 4J is a schematic representation of a basic function block representing logic and expressions provided by some embodiments of the present disclosure.
  • Fig. 4I shows the graphical expression form of the basic function block of logic and expression representing two Boolean type data items
  • Fig. 4J is the interface of the basic function block of logic and expression storage hierarchy diagram.
  • the name of the basic function block representing the logic and expression is expand
  • the basic function block expand representing the logic and expression includes two input data items a3 and a4 and an output data item b2, the input data item
  • the data type attributes of a3 and a4 and the output data item b2 are both boolean types.
  • the XML schema of the basic function block expand representing logic and expressions is represented as:
  • the input part of the interface corresponding to the basic function block expand includes two levels, which are respectively the first level (ie boolean2) and the second level (ie boolean and boolean), and the interface corresponding to the basic function block expand
  • the output part of includes 1 level (i.e. boolean), thus, as shown in Figure 4J, in the storage hierarchy structure diagram of the interface of the basic function block expand, the total level of the input part is 2, and the total level of the output part is 1 , the current display level of the input part is 2, and the current display level of the output part is 1.
  • the input part shows two input data items a3 and a4, and the output part shows one output data item b2.
  • arithmetic expressions are used to implement arithmetic operations.
  • Arithmetic operations are operations on data items of basic data types (ie: int, float, double, long, byte, short). Table 2 below shows various arithmetic expressions.
  • FIG. 4K is a schematic diagram of a graphical expression form of a basic function block representing an arithmetic expression provided by some embodiments of the present disclosure.
  • the name of the basic function block representing the arithmetic expression is AE
  • the basic function block AE representing the arithmetic expression has two input data items, which are respectively idName7 and idName8, which represent the arithmetic expression
  • the basic function block AE of has an output data item idName9.
  • the data type attributes of the two input data items idName7 and idName8 and the output data item idName9 are the same.
  • the XML schema representation of the basic function block AE representing an arithmetic expression is:
  • the data type attributes of the two input data items idName7 and idName8 are both expressed as T
  • T can be any one of int, float, double, long, byte, short
  • the data type attribute of the output data item idName9 is also expressed as T.
  • T is int, that is, the data type attributes of the input data items idName7 and idName8 and the output data item idName9 are both int types.
  • the combined data item formed by the combination of the two input data items idName7 and idName8 The data type of attribute T2 is int2.
  • the two input data items idName7 and idName8 can be combined into a combined data item, and the combined data item is encapsulated as the basic function block representing the arithmetic expression
  • the input part of the interface corresponding to AE, and the output data item idName9 is encapsulated as the output part of the interface corresponding to the basic function block AE representing the arithmetic expression.
  • FIG. 4L is a schematic diagram of a graphical expression form of a basic function block representing an additive expression provided by some embodiments of the present disclosure
  • FIG. 4M is an interface of a basic function block representing an additive expression provided by some embodiments of the present disclosure
  • Fig. 4N is another storage hierarchical structure diagram of an interface representing a basic function block of an addition expression provided by some embodiments of the present disclosure.
  • the arithmetic expression includes an addition expression
  • FIG. 4L shows a graphical expression form of a basic function block representing an addition expression of the int type
  • FIG. 4M and FIG. 4N show an int type
  • the storage hierarchy of the interface of the basic function block of the addition expression, and the arithmetic expression form of other data types is similar to this.
  • the name of the basic function block representing the addition expression is expaddI
  • the basic function block expaddI representing the addition expression includes two input data items a5 and a6 and an output data item b3, the input data items a5 and
  • the data type attributes of a6 and output data item b3 are both int type.
  • the input part of the interface corresponding to the basic function block expaddI includes two levels, which are respectively the first level (ie int2) and the second level (ie int and int), and the interface corresponding to the basic function block expaddI
  • the output part of includes 1 level (namely int), thus, as shown in Fig. 4M and Fig. 4N, in the storage hierarchical structure diagram of the interface of the basic function block expaddI, the total level of the input part is 2, and the total level of the output part The level is 1, as shown in Figure 4M, the current display level of the input part is 2 (default value), and the current display level of the output part is 1.
  • the input part shows two input data items a5 and a6 (int and int), the output part shows an output data item b3, as shown in Figure 4N, the current display level of the input part is 1, and the current display level of the output part is 1, at this time, the input part shows an input data item(int2), the output section shows an output data item b3.
  • the input part and the output part shown in FIG. 4L correspond to the storage hierarchy structure shown in FIG. 4M.
  • an assignment expression is used to implement an assignment operation.
  • the assignment expression has an input data item and an output data item, and the data type attribute of the input data item and the data type attribute of the output data item must be consistent, and both are basic Data type, the assignment operation means assigning the value of the input data item to the value of the output data item.
  • the assignment algorithm has corresponding assignment basic function blocks for 10 basic data types. Table 3 below shows various assignment expressions.
  • FIG. 4O is a schematic diagram of a graphical representation of a basic function block representing an assignment expression provided by some embodiments of the present disclosure.
  • the name of the basic function block representing an assignment expression is assignid
  • the basic function block assignid representing an assignment expression has an input data item idName10 and an output data item idName11.
  • the data type attribute of the input data item idName10 is the same as the data type attribute of the output data item idName11.
  • the XML schema of the basic function block assignid representing an assignment expression is represented as:
  • the data type attributes of the input data item idName10 and the output data item idName11 are both represented as T, and T can be any one of 10 basic data types.
  • T can be any one of 10 basic data types.
  • FIG. 4P is a schematic diagram of a graphical representation of a specific example of a basic function block representing an assignment expression provided by some embodiments of the present disclosure
  • FIG. 4Q is a basic function block representing an assignment expression provided by some embodiments of the present disclosure.
  • the storage hierarchy diagram of the interface is a schematic diagram of a graphical representation of a specific example of a basic function block representing an assignment expression provided by some embodiments of the present disclosure
  • FIG. 4Q is a basic function block representing an assignment expression provided by some embodiments of the present disclosure.
  • the storage hierarchy diagram of the interface The storage hierarchy diagram of the interface.
  • Fig. 4P shows the graphical expression form of the basic function block representing the assignment expression of the Char type
  • Fig. 4Q shows the interface of the basic function block representing the assignment expression of the Char type
  • the storage hierarchy is similar to that of other data types.
  • the name of the basic function block representing the assignment expression of the Char type is assignchar
  • the basic function block assignchar representing the assignment expression of the Char type includes an input data item a7 and an output data item b4
  • the data type attributes of item a7 and output data item b4 are both Char type.
  • the XML schema representation of the basic function block assignchar is:
  • the input part of the interface corresponding to the basic function block assignchar includes 1 level (ie char), and the output part of the interface corresponding to the basic function block assignchar includes 1 level (ie char), thus, as shown in Figure 4Q , in the storage hierarchy structure diagram of the interface of the basic function block assignchar, the total level of the input part is 1, the total level of the output part is 1, the current display level of the input part is 1, and the current display level of the output part is 1, At this time, the input part shows the input data item a7, and the output part shows the output data item b4.
  • basic data type conversion includes automatic type conversion, basic type to string and forced type conversion.
  • Table 4 below shows automatic type conversion
  • table 5 shows basic type conversion to string
  • table 6 shows forced type conversion.
  • the normal form basic function blocks include getname and addAddress.
  • getname means to obtain the address of other data items, and the data type attribute of the address data item is pointer type ref.
  • the type of data pointed to by the output data item (pointer type) of the getname is the same as the type of the input data item of the getname, when the type of the input data item is determined, the type of the data item pointed to by the output data item is also determined .
  • the getname function means to obtain the physical address of the storage when it is actually running. The algorithm formed by using the combination technology needs to be run on the computer, and each data item (real storage) that appears in the algorithm is allocated to a certain hardware carrier at runtime.
  • the process of allocation and operation needs to manage the hardware carrier. Giving each hardware carrier an identifier is a prerequisite for managing hardware resources.
  • the getname function obtains the identifier of the hardware resource where a certain data item is located, which is generally called the physical address. Adding and subtracting the addresses means that the addresses of the hardware carrier are ordered and can be added.
  • addAddress means to add addresses. The addition axiom defines the orderly concept of natural numbers. Address addition also means that addresses are ordered.
  • the data type of the input data item of addAddress is address/pointer and int type, and the data type of the output data item is address/pointer.
  • addAddress has constraints on the data category of the data item, which will be explained later.
  • getValueFromAddr means to obtain the data item pointed to by the address (pointer type).
  • FIG. 4R is a schematic diagram of a graphical expression form representing a basic function block of the getname function provided by some embodiments of the present disclosure
  • FIG. 4S is a storage hierarchy structure of an interface representing a basic function block of the getname function provided by some embodiments of the present disclosure. picture.
  • the name of the basic function block representing the getname function is getname
  • the basic function block getname has an input data item idName12 and an output data item idName13.
  • the data type attribute of the input data item idName12 can be any type
  • the data type attribute of the output data item idName13 is a pointer type ref (if the type of the input data item is uncertain, the output data item is a general pointer type, which can point to data item of any type).
  • the data type of the input data item can actually be a basic data type, a basic combined data type, an array type, or an XOR type.
  • x can be 0, 1, 2, 3.
  • t is determined by the internal data structure of the data item whose id is a, refer to the subsequent typevalue generation rules.
  • the input part of the interface corresponding to the basic function block getname includes level 1 (i.e. data type T), and the output part of the interface corresponding to the basic function block getname includes level 1 (i.e. ref), thus, as shown in Figure 4S
  • the total level of the input part is 1
  • the total level of the output part is 1
  • the current display level of the input part is 1
  • the current display level of the output part is 1.
  • the input part shows the input data item idName12
  • the output part shows the output data item idName13.
  • connection expansion is different from the graphics viewing expansion.
  • the connection expansion indicates the preparation of the internal data item connection of the data item for the type matching rule; the graphics viewing expansion is for the user to view the internal composition of the data item. Internal components are not transformed. There is no difference in the results of line expansion and graphic view expansion of data items of basic composite data types, XOR types, non-universal pointer types, etc., but the operations of line expansion and graphic view expansion on data items of array type There is a difference.
  • the array logic equivalent transformation rules are applied when the connection is expanded. The data structure of the array type data items has changed, and the array logic equivalent transformation rules are not applied when the graphics are viewed and expanded.
  • the data item (intint)[] is connected and expanded, the user will see that the data type attribute of the first layer data item of the data item (intint)[] is int[]int[], the second-level data item of the data item (intint)[] is two data items whose data type attribute is int[]; It will be seen that the data type attribute of the first layer data item of the data item (intint)[] is (intint)[], and the second layer data item of the data item (intint)[] is a data type attribute of intint
  • the data item indicates that the inside of the data item of the array type is an array formed by a plurality of data items of the intint type. It should be noted that, here, in order to simplify the description, only the connection expansion and graphics viewing expansion corresponding to the data items of the array type are described. It should be noted that all the expansion actions in the embodiments of the present
  • the extensible markup language corresponding to any one of the multiple function blocks includes a calculation sequence part, an interface part, a connection relationship part, and an interface and sequence comparison part.
  • the calculation sequence part is used to describe the interface of the function block included in any function block.
  • the interface sequences of the function blocks inside any function block are arranged in order;
  • the interface part is used to describe the interface of any function block.
  • Interface is used to describe the interface of any function block.
  • connection relationship part is used to describe the data transfer relationship and input combination relationship between the function blocks included in any function block;
  • interface and sequence comparison part is used to describe the data items in the function blocks included in any function block
  • the contrast relationship with the data items in the interface of any function block also describes the connection relationship between the input data items connected by auxiliary merging lines in any function block.
  • the comparison relationship is embodied by the first relative path and the second relative path of the data item in the interface of any function block.
  • any function block is a combination function block of sequential structure
  • the corresponding XML representation of the complete structure of any function block is:
  • the complete structure of the combined function block of the sequence structure (wrapped by ⁇ PF> ⁇ /PF>) consists of three parts: paradigm combination area, large function interface area, large function interface type and small function interface type relationship area .
  • the small function block area (that is, the calculation sequence part) of the paradigm combination area is used to show at least one small function block, each small function block is wrapped by ⁇ PF> ⁇ /PF> or ⁇ F> ⁇ /F>, and the order
  • the interface sequence of each function block inside the combined function block of the structure is arranged in order, and the small function block area can include multiple ⁇ F/PF> ⁇ /F/PF> parts, that is, it includes multiple small function blocks; the paradigm combination area
  • the combination action area includes the connection relationship part, the connection relationship part of the paradigm combination area (ie VMS), which is wrapped by ⁇ VMS> ⁇ /VMS>, and is used to store the data transfer between the calculation sequences composed of various function blocks Relationship, input merge relationship; in the large function interface area (that is, the interface part
  • the input part and the output part contain their own basic data items or combined data items or generic or pointer data items.
  • the data items are automatically generated by the combined paradigm through the combined rules and follow the The description specifications of data items, the data items of the interface of function blocks are identified by relative paths, which replaces the technical means of using variable names to identify data items in traditional software development.
  • the meaning of data items and function blocks does not depend on variable names, and does not generate Data items and algorithms with specific industry characteristics generate pure abstract algorithms, which essentially realize the high abstraction and standardization of algorithms.
  • the relationship area between the large function interface type and the small function interface type (that is, the interface and sequence comparison part, PFVMS), wrapped with ⁇ PFVMS> ⁇ /PFVMS>, is used to describe the corresponding data items in the calculation sequence composed of various function blocks and The comparison relationship of the data items in the interface of the combined function block and the connection relationship between the input data items connected by the auxiliary merging connection in the calculation sequence composed of each function block.
  • the JSON representation of the complete structure of the combined function block of the sequential structure is:
  • PFList is the calculation sequence part of the combination function block.
  • any function block is a combined function block of a conditional structure
  • the corresponding XML representation of the complete structure of any function block is:
  • the complete structure of the combination function block of the conditional structure is composed of three parts: normal form combination area, large function interface area, large function interface type and small function interface type relationship area.
  • the small function block area (that is, the calculation sequence part) of the paradigm combination area is composed of three parts: the first part, the judgment condition part, which is wrapped by ⁇ exp> ⁇ /exp>, and the judgment condition part includes the output data item as boolean data type
  • each small function block is wrapped by ⁇ PF> ⁇ /PF> or ⁇ F> ⁇ /F>
  • the second part the branch structure when the condition is true (the first branch part) , wrapped by ⁇ doTrue> ⁇ /doTrue>, in the first branch part, each small function block is wrapped by ⁇ PF> ⁇ /PF> or ⁇ F> ⁇ /F>
  • the third part when the condition is false
  • VMS combination action area
  • ⁇ VMS> ⁇ /VMS> is used to store the data transfer relationship and input combination relationship between the calculation sequences composed of various function blocks;
  • the large function interface area that is, the interface part
  • the input part of the interface is wrapped with ⁇ in> ⁇ /in>
  • the output part of the interface is wrapped with ⁇ out> ⁇ /out>
  • the large function interface area is used to describe the condition
  • the relationship area between the large function interface type and the small function interface type that is, the interface and sequence comparison part, PFVMS), wrapped with ⁇ PFVMS> ⁇ /PFVMS>, used to describe the structure composed of various function blocks
  • one of the doTrue branch and the doFalse branch can be empty.
  • any function block is a combined function block with a loop structure
  • the corresponding XML representation of the complete structure of any function block is:
  • the complete structure of the combination function block of the loop structure is composed of three parts: normal form combination area, large function interface area, large function interface type and small function interface type relationship area.
  • the small function block area (that is, the calculation sequence part) of the paradigm combination area is divided into two parts: the first part, the part of the single expression, wrapped by ⁇ exp1> ⁇ /exp1>; the second part, the part of the loop body Part, wrapped by ⁇ loopN> ⁇ /loopN>, wherein the loop body includes at least one loop part, ⁇ IFloop> ⁇ /IFloop> describes a loop part, and the internal structure of each loop part is the same, and a loop is displayed by default above part, you can increase the loop part by yourself according to your needs, wherein, in each loop part, the ⁇ exp2> ⁇ /exp2> part represents the conditional expression, the ⁇ loop> ⁇ /loop> part represents the intermediate loop expression, ⁇ exp3> ⁇ /exp3>The
  • the JSON representation of the complete structure of the combined function block of the loop structure is:
  • any function block is a combination function block of a current loop structure
  • the XML representation of the complete structure of any function block is:
  • the complete structure of the combination function block of the when-type loop structure consists of three parts: normal form combination area, large function interface area, large function interface type and small function interface type relationship area.
  • the small function block area (that is, the calculation sequence part) of the paradigm combination area includes: the part of the when-type loop body, wrapped by ⁇ loopN> ⁇ /loopN>, wherein the when-type loop body includes at least one when-type loop part, ⁇ IFloop> ⁇ /IFloop> describes a when-type loop part, each when-type loop part is wrapped by ⁇ IFLoop> ⁇ /IFLoop>, where ⁇ exp> ⁇ /exp> part represents a when-type conditional expression, ⁇ loop The > ⁇ /loop> part represents the when-type loop expression; when the small function block area of the normal form combination area includes multiple when-type loop parts, the internal structure of the multiple when-type loop parts is the same; the connection relationship of the normal form combination area The part (VMS), wrapped by ⁇ loopN> ⁇ /
  • the large function interface area is used to describe the interface of the combined function block of the current structure; the large function interface type and the small function
  • the interface type relationship area (interface and sequence comparison part, namely PFVMS), wrapped with ⁇ PFVMS> ⁇ /PFVMS>, is used to describe the corresponding data items in the calculation sequence composed of various function blocks and the interface of the combined function block
  • each small function block is wrapped by ⁇ PF> ⁇ /PF> or ⁇ F> ⁇ /F>.
  • any input data item is extracted as a part of the interface corresponding to the composite function block.
  • Any input data item corresponds to a first relative path, and the first relative path of any input data item represents the relative path of any input data item in the input part of the interface corresponding to the combination function block.
  • the relative position of the data item describes the output-input relationship of the data item, and does not need to be marked with a name, which is specifically expressed as a path.
  • the expression form of the first relative path of any input data item is as follows:
  • Path(data_in1) is the relative path of any input data item calculated in the following way: based on the splicing structure of the combination function block (that is, the combination function The calculation sequence corresponding to the block), from the input data item of the outermost layer corresponding to any input data item to any input data item in the input part of the interface corresponding to the combination function block, obtain and any input data item layer by layer The relative address attribute related to the input data item is input, and the relative path of any input data item is calculated according to the relative address attribute related to any input data item.
  • any output data item corresponding to any function block is extracted as a part of the interface corresponding to the combined function block, any output data item corresponds to a first relative path, any output data item
  • the first relative path represents the relative path of any output data item in the output part of the interface corresponding to the combination function block.
  • the expression form of the first relative path of any output data item is as follows:
  • Path(data_out1) is the relative path of any output data item calculated in the following way: based on the splicing structure of the combination function block, in the combination From the output part of the interface corresponding to the function block, from the outermost output data item corresponding to any output data item to any output data item, the relative address attribute related to any output data item is obtained layer by layer, and The relative path of any output data item is calculated according to the relative address attribute related to any output data item.
  • the relative address attribute associated with any input data item can be connected with dot notation (ie: .) to obtain the relative path of any input data item, that is, the input data item in the input.
  • dot notation ie: .
  • the relative path in the input part of the interface corresponding to the combination function block where the data item is located can be obtained in the following way: from the outermost input data item corresponding to the input data item in the input part to the center of the input data item according to the nested structure
  • the relative address attributes of all input data items between (including the outermost input data item and this input data item) are connected with dot symbols.
  • the relative address attributes associated with any output data item can be connected with a dot symbol (ie: .) to obtain the relative path of any output data item, that is, the combination of the output data item in the output data item.
  • the relative path in the output part of the interface corresponding to the function block can be obtained in the following way: from the outermost output data item corresponding to the output data item in the output part to all output data between the output data item according to the nested structure
  • the relative address attributes of items are connected with dot notation.
  • the specific calculation process of Path(data_in1) and Path(data_out1) can refer to the positioning process of data items described below.
  • the first relative path of any data item is reflected in the PFVMS corresponding to the combination function block corresponding to any data item. Only the data items extracted as part of the interface corresponding to the composite function block will calculate the corresponding first relative path.
  • the path attribute of the source tag inside the line tag can be used to store the first Relative path
  • the path attribute of the source tag inside the line tag can be used to store the first relative path of any output data item.
  • the data type attributes of the two connected data items meet the type matching rules or the connected two data items meet the connection requirements Rules, type matching rules match the data type attributes of two data items.
  • the wire requirement rule includes that the data type attribute of one of the two data items is a generic type, and the other of the two data items is a basic data type, a composite data type, or a generic type, that is, the two data items
  • the other of the two data items is of any data type other than a pointer type, or, the wire requirement rules include the data type attribute of one of the two data items being a generic pointer type and the other of the two data items
  • the datatype attribute of a data item is a non-generic pointer type.
  • the type matching rule includes matching of data type attributes of two data items, and the matching of data type attributes of two data items may indicate that the data type attributes of the two data items are the same.
  • the fact that the data type attributes of the two data items are the same means that the data type attributes of the two data items are the same basic data type or the same composite data type or the same pointer type.
  • the matching of the data type attributes of two data items can also indicate that the data type attribute of one of the two data items is generic, and the data type attribute of the other of the two data items is other than the pointer type For other data types, at this time, the two data items meet the type matching rules or connection requirements.
  • the data type attribute of the data item of the combination data type and the data item of the pointer type may not be empty, and when the data type attribute is not empty, it is possible to directly judge the two data types based on the data type attributes of the two data items. Whether a data item satisfies the type matching rule, and if the values of the data type attributes of the two data items are the same, determine that the two data items are two data items satisfying the type matching rule.
  • the data type attribute of the data item of the combined data type and the data item of the pointer type may be empty, and when the data type attribute of the data item of the combined data type and the data item of the pointer type is empty, two
  • the steps to check whether the data type attribute of each data item matches are as follows.
  • the steps of judging whether the data type attributes of the two data items match are also as follows.
  • determining two data items satisfying the type matching rule includes: for at least part of the output data items and/or at least part of the selected first data items and second data items in the input data items: judging the identity of the first data item Whether the data category attribute and the data category attribute of the second data item are the same, in response to the data category attribute of the first data item being the same as the data category attribute of the second data item, judging the data category attribute of the first data item and the second data item is a basic data type, a combined data type, a pointer type or a generic type, and in response to the fact that the data type attribute of the first data item and the data type attribute of the second data item are both basic data types, it is judged that the first data item Whether the data type attribute and the data type attribute of the second data item are the same, in response to the data type attribute of the first data item being the same as the data type attribute of the second data item, determining that the first data item and the second data item satisfy type matching Two data items for the rule.
  • combined data types include basic combined data types, XOR types, and array types
  • determining two data items satisfying type matching rules also includes: responding to the data category attribute of the first data item and the data category of the second data item
  • the attributes are all combined data types, judging whether the data category attribute of the first data item and the data category attribute of the second data item are XOR type, basic combined data type, or array type, and responding to the data category attribute of the first data item and
  • the data category attributes of the second data item are all XOR types, and the data items in the same position of the first data item and the second data item are cyclically judged by the type matching rules to obtain multiple XOR judgment results, in response to Each of the multiple XOR judgment results indicates that the type matching rule is satisfied, and the first data item and the second data item are determined to be two data items satisfying the type matching rule.
  • determining two data items satisfying the type matching rule also includes: in response to both the data category attribute of the first data item and the data category attribute of the second data item being an array type, looping to judge whether the first data item and the second data item Whether the data item at the same position of the data item satisfies the type matching rule to obtain at least one array judgment result, and in response to each of the at least one array judgment result indicating that the type matching rule is satisfied, determining the first data item and the second data item Two data items that satisfy the type matching rules.
  • determining two data items that meet the type matching rule also includes: in response to the data category attribute of the first data item and the data category attribute of the second data item being both basic combined data types, looping judgments between the first data item and the second data item Whether the data item at the same position of the second data item satisfies the type matching rule to obtain at least one basic combination judgment result, in response to each of the at least one basic combination judgment result indicating that the type matching rule is satisfied, determining the first data item and The second data item is two data items satisfying the type matching rule.
  • determining two data items satisfying the type matching rule further includes: responding to both the data category attribute of the first data item and the data category attribute of the second data item being pointer types, if the first data item and the second data item Both are general pointer types, determine that the first data item and the second data item are two data items that satisfy the type matching rules; if the first data item and the second data item are both non-universal pointer types, the loop judgment is Whether the data items at the same position of the item and the second data item satisfy the type matching rule to obtain at least one non-generic pointer judgment result, and in response to each of the at least one non-generic pointer judgment result indicating that the type matching rule is satisfied, determine the first The first data item and the second data item are two data items satisfying the type matching rule.
  • determining two data items satisfying the type matching rule further includes: in response to both the data category attribute of the first data item and the data category attribute of the second data item being generic, determining the first data item and the second data item Two data items that satisfy the type matching rules.
  • the same data type attributes of two data items may include the same basic type, the same composite type, the same pointer type, and the same generic type.
  • the same basic type means that the two data items are both basic data types (that is, nine basic data types, byte, short, int, long, float, double, boolean, char, string), and the specific data types are the same.
  • the data types of the two data items are the basic data types t1 and t2 respectively (t1 and t2 are one of the nine basic data types).
  • multiple data items of type int are data items of the same data type.
  • the same combination type indicates that the two data items are both combination data types, and the specific data types are the same.
  • the data types of two data items are combined data types T1 and T2 respectively.
  • T1 and T2 are equal, and the typeclass of any corresponding data type is also the same, the two data Item satisfies the requirements of the type matching rule.
  • T1 is expressed as t1t2
  • T2 is expressed as t3t4
  • the two data items meet the requirements of the type matching rule.
  • the same pointer type means that the two data items are of common pointer type, or the two data items are of non-universal pointer type and the data types of the specific data items they point to are the same.
  • the data type attributes of two data items are non-generic pointer types, and the data types of the two data items are represented as &T1 and &T2 respectively, when the data types of any corresponding two internal data items inside &T1 and &T2 are equal , and when the typeclass of the data type of any corresponding two internal data items is also the same, the two data items meet the requirements of the type matching rule.
  • T1 is expressed as t1t2
  • T2 is expressed as t3t4
  • t1 and t3 are the same
  • t2 and t4 are the same
  • the two data items meet the requirements of the type matching rule.
  • Step 1 Assume that the data type attribute of the data item T1 is type1, the data type class (typeclass) of the data item T1 is class1, the data type attribute of the data item T2 is type2, and the data type class of the data item T2 is class2.
  • Step 3 Determine whether the data item T1 and the data item T2 are data items of the basic data type (that is, determine whether class1 and class2 are 0), if yes, then perform step 4, if not, then perform step 5.
  • Step 4 Type matching judgment of basic data types, which includes the following two steps 4.1-4.2:
  • Step 4.1 judging whether the data type attributes of the two data items T1 and T2 are the same, if they are the same, go to step 4.2, if not, go to step 16.
  • Step 4.2 Determine that the data item T1 and data item T2 satisfy the type matching rule, and execute step 15.
  • Step 5 Determine whether the data type class1 of the data item T1 and the data type class2 of the data item T2 are XOR types. If yes, execute step 6; if not, execute step 7.
  • Step 6 Type matching judgment of XOR type, which includes the following five steps 6.1-6.5:
  • Step 6.1 Assume that the type value of the data item T1 of the XOR type is t1xort2, and the type value of the data item T2 of the XOR type is t3xort4;
  • Step 6.2 Perform data type matching judgment on data item t1 and data item t3, recursively jump to step 1, and record and return the result r1;
  • Step 6.3 Perform data type matching judgment on data item t2 and data item t4, recursively jump to step 1, and record and return result r2;
  • Step 6.4 judge whether r1 and r2 are both true (r1/r2 being true means that the data types of the two judged data items (data items t1 and t3/data items t2 and t4) match successfully), if so, execute the step 6.5, if not, go to step 16;
  • Step 6.5 Determine that the data item T1 and the data item T2 satisfy the type matching rule of the XOR type, and execute step 15.
  • Step 7 judge whether the category class1 of the data type of the data item T1 and the category class2 of the data type of the data item T2 are array types, if yes, then perform step 8, if not, then perform step 9;
  • Step 8 the type matching judgment of the array type, which includes the following four steps 8.1-8.4:
  • Step 8.1 Assume that the type value of the internal data item t1 of the array-type data item T1 is d1d2d3..., and the type value of the internal data item t2 of the array-type data item T2 is d4d5d6...;
  • Step 8.2. Perform data type matching judgment on data item t1 and data item t2, recursively jump to step 1, and record the returned result;
  • Step 8.3 judge whether all the returned results in 8.2 are true, if so, then perform step 8.4, if not, then perform step 16;
  • Step 8.4 Determine that the data item T1 and the data item T2 satisfy the type matching rule of the array type, and execute step 15.
  • Step 9 Determine whether the data type class1 of the data item T1 and the data type class2 of the data item T2 are basic combined data types, if yes, execute step 10, and if not, execute step 11.
  • Step 10 the type matching judgment of the basic combined data type, which includes the following four steps 10.1-10.4:
  • Step 10.1 assuming that the type value of the data item T1 of the combined data type is h1h2h3..., and the type value of the data item T2 of the combined data type is h4h5h6...;
  • Step 10.2 cyclically judge whether the data types of the data items at the same position (for example, h1 in data item T1 and h4 in data item T2 are two data items at the same position) match, recursively jump to step 1, and record return result;
  • Step 10.3 judging whether all the returned results in 10.2 are true, if so, execute step 10.4, if not, execute step 16;
  • Step 10.4 Determine that the data item T1 and the data item T2 meet the type matching rule of the combination type, and execute step 15.
  • Step 11 Determine whether the data type class1 of the data item T1 and the data type class2 of the data item T2 are pointer types. If yes, execute step 12; if not, execute step 13.
  • Step 12 the type matching judgment of the pointer type, which includes the following four steps 12.1-12.5:
  • Step 12.1 Assume that the type value of the data item T1 of the pointer type is ref, and the type value of the data item T2 of the pointer type is ref, determine that the data item T1 and the data item T2 satisfy the type matching rule of the combination type, and execute step 15;
  • Step 12.2 assuming that the type value of the data item T1 of the pointer type is &h1h2h3..., and the type value of the data item T2 of the pointer type is &h4h5h6...;
  • Step 12.3 cyclically judge whether the data types of the data items at the same position (for example, h1 in data item T1 and h4 in data item T2 are two data items at the same position) match, recursively jump to step 1, and record return result;
  • Step 12.4 judging whether all the returned results in 12.3 are true, if yes, execute step 12.5, if not, execute step 16;
  • Step 12.5 Determine that the data item T1 and the data item T2 satisfy the type matching rule of the pointer type, and execute step 15.
  • Step 13 Determine whether the class class1 of the data type of the data item T1 and the class2 of the data type of the data item T2 are generic; if yes, execute step 14; if not, execute step 16.
  • Step 14 Generic type matching judgment, if the data type attributes of the two data items are generic, determine that data item T1 and data item T2 meet the type matching rules, and execute step 15.
  • Step 17 return the matching result flag.
  • both data item T1 and data item T2 are data items of the basic data type
  • class1 and class2 are both 0, if the data type attributes of the two data items are type1 and type2 respectively, when type1 and type2 are similar
  • the data type attribute of the data item T1 of the basic data type is the same as the data type attribute of the data item T2 of the basic data type.
  • data item T1 and data item T2 are data items of combined data types, and if class1 and class2 are both 3, then data item T1 and data item T2 are both data items of XOR type. At this time, XOR type can be executed. or type matching judgment (i.e.
  • step 6 above for example, if the type value of data item T1 is t1xort2, the type value of data item T2 is t3xort4, if the data type attribute of data item t1 and the data type attribute of data item t3 Same, the data type attribute of data item t2 is the same as the data type attribute of data item t4, for example, data item t1 and data item t3 are both data items of type int, and data item t2 and data item t4 are also data of type int item, at this time, the data type attribute of the data item T1 of the XOR type is the same as the data type attribute of the data item T2 of the XOR type.
  • t1 and t2 may be basic data types, basic Combining data types, XOR types, array types, pointer types or generic types, the comparison of t1 and t2 needs to recursively go to step 1 for comparison.
  • both data item T1 and data item T2 are data items of the array type
  • the type matching judgment of the array type can be performed (that is, the above step 8), for example, the data item T1 includes The data item t1 and the data item T2 include the data item t2, and the data type matching judgment is performed on the data item t1 and the data item t2 (return to step 1).
  • the specific process refer to the specific description of each step.
  • step 4 determines whether the data type attributes of the two data items t1 and data item t2 are the same, and if they are the same, then Determine that the data item t1 and data item t2 satisfy the type matching rule, thereby determining that the data type attribute of the data item T1 of the array type is the same as the data type attribute of the data item T2 of the array type; in other examples, if the data item t1 and the data Item t2 is a data item of the basic combined data type, the type value of data item t1 is d1d2d3..., and the type value of data item t2 is d4d5d6..., then step 10 is performed.
  • the data type attribute of data item d1 is The attribute is the same as the data type attribute of data item d4
  • the data type attribute of data item d2 is the same as the data type attribute of data item d5
  • the data type attribute of data item d3 is the same as the data type attribute of data item d6, for example, data item
  • the data type attributes of d1 and data item d4 are both (int2)
  • the data type attributes of data item d2 and data item d3 are both int
  • the data type attributes of data item d3 and data item d6 are both long.
  • data item t1 and data item t2 satisfy the type matching rule, so that it is determined that the data type attribute of the array type data item T1 is the same as the data type attribute of the array type data item T2, and so on.
  • both data item T1 and data item T2 are data items of the basic combined data type.
  • the type matching judgment of the basic combined data type can be performed (i.e. the above step 10), for example, if the data The type value of item T1 is h1h2h3, and the type value of data item T2 is h4h5h6.
  • the data type attribute of data item h1 is the same as the data type attribute of data item h4, the data type attribute of data item h2 and the data type attribute of data item h5 The same, and the data type attributes of data item h3 and data item h6 are the same, for example, the data type attributes of data item h1 and data item h4 are both (int2), and the data type attributes of data item h2 and data item h3 Both are int, and the data type attributes of data item h3 and data item h6 are both long.
  • the data type attribute of the combined type data item T1 is the same as the data type attribute of the combined type data item T2.
  • both data item T1 and data item T2 are data items of pointer type.
  • the type matching judgment of the pointer type can be performed (that is, the above step 12), if and only if the data item
  • the data type attribute of the data item (basic data type or combined data type) stored at the address pointed to by T1 is the same as the data type attribute of the data item (basic data type or combined data type) stored at the address pointed to by data item T2 or the data
  • the data type attributes of the data item T1 and the data item T2 are the same.
  • the data type attributes of the two data items T1 and T2 satisfy the type matching rules or the two data items T1 and T2 meet the connection requirement rules, for example, the two data items T1 and
  • the splicing operation (connection action) of T2 is as follows:
  • Step 1 Apply the type matching rule to the two data items T1 and T2, execute step 6 after the matching is successful, and execute step 2 if the matching is unsuccessful;
  • Step 2 If the data type attribute of one of the two data items T1 and T2 is generic, and the other data item of the two data items T1 and T2 is any data type except the pointer type, determine the two data items meet the connection requirement rules, go to step 6;
  • Step 3 If the data type attribute of one of the two data items T1 and T2 is a general pointer type, and the other data item of the two data items T1 and T2 is a non-generic pointer type, determine that the two data items satisfy the connection Line requirement rules, go to step 6;
  • Step 4 If the type matching of the two data items T1 and T2 is unsuccessful in step 1, and the two data items T1 and T2 do not meet the connection requirement rules in steps 2 and 3, and both data items T1 and T2 are For data items of combined data types, you can try to expand the two data items T1 and T2;
  • Step 5 Return the expanded data items and internal data items to step 1;
  • Step 6 The types of the two data items T1 and T2 in step 1 match successfully, or the two data items in steps 2 and 3 meet the connection requirement rules, and the connection action can be applied to the two data items T1 and T2.
  • connection action when the splicing operation is performed, when the two data items meet any one of the type matching rule and the connection requirement rule, the connection action can be applied to the two data items, That is, if two data items do not satisfy the type matching rule but satisfy the connection requirement rule, the connection action can be applied to the two data items.
  • At least some of the input data items include a first partial input data item.
  • step S11 in the splicing operation, at least part of the input data items and/or at least part of the output data items of at least two function blocks are connected, including: based on type matching rules and/or connection requirements rules, through data transfer
  • a wire connects at least some of the output data items with the first part of the input data items.
  • the result of a wire action is equivalent to a storage merge, which means that two data items (that is, storage) connected by a wire are merged into one data item.
  • the data type attribute of two data items connected by a data transfer line satisfies the type matching rule or the two data items connected meet the connection requirement rule
  • the type matching rule or the connection requirement rule is the prerequisite for the connection operation Conditions
  • the data items connected through the data transfer connection must meet the type matching rule or the connection requirement rule in order to connect successfully.
  • data transfer connection rules must be followed in the process of organizing function blocks.
  • the data transfer connection rules include: if the data type attributes of two data items meet the type matching rules, the two data items can be connected. Wire.
  • a practical connection rule is added in the process of organizing function blocks.
  • the practical connection rules include: if the data type attributes of the two input data items satisfy the type matching rule, then the two input data items can be auxiliary merged and connected.
  • a data transfer line represents a line connecting an output data item to an input data item or an output data item.
  • the data transfer line includes an output output transfer line and an output input transfer line.
  • the output output transfer line is used to connect at least two output data items.
  • the output-input transfer line is used to connect at least one output data item to at least one input data item.
  • Both output-output transfer lines and output-in transfer lines are wires emanating from output data items.
  • the data transmission connection is a directional connection. For example, in a graphical presentation, a line with an arrow may be used to represent the data transmission connection.
  • the output data items include a first output data item, a second output data item and a third output data item, and the first part of the input data items includes the first input data item.
  • connecting at least some of the output data items and the first part of the input data items through data transfer lines includes at least one of the following: connecting the second output data items to the first output data items through output-output transfer lines, the first The second output data item appears after the first output data item, set the storage type attribute of the second output data item to virtual storage, do not change the storage type attribute of the first output data item, record the first output data item and the second output
  • the connection relationship of data items, the function block where the second output data item is located is calculated after the function block where the first output data item is located, and the calculated value of the second output data item is passed to the first output data item;
  • a transfer line connects the third output data item to the first input data item; in response to the third output data item occurring after the first input data item or the third output data item and the first input data item belonging to the same function block, the The storage type attribute of the third output data item is set to virtual storage, the storage type attribute of the first input data item is not changed, and the connection relationship between the first input data
  • first output data item, the second output data item, the third output data item and the first input data item are positioned in the form of a second relative path, and the connection relationship between the first output data item and the second output data item is passed through the second
  • the second relative path between an output data item and the second output data item is embodied and recorded in the connection relationship part of the selected combination paradigm, and the connection relationship between the first input data item and the third output data item is passed through the first input data item. item and a second relative path representation of the third output data item.
  • At least part of the input data items also includes a second part of the input data items.
  • connecting at least part of the input data items and/or at least part of the output data items of at least two function blocks further includes: based on type matching rules and/or wiring requirement rules, through auxiliary The merge connection connects the second part of the input data items.
  • the second part of input data items includes a second input data item and a third input data item
  • connecting the second part of input data items through an auxiliary merged connection includes: connecting the third input data item to For the second input data item, set the storage type attribute of the third input data item to virtual storage without changing the storage type attribute of the second input data item, and record the connection relationship between the second input data item and the third input data item.
  • the second input data item and the third input data item are located in the form of a second relative path, and the connection relationship between the second input data item and the third input data item passes through the second input data item and the third input data item.
  • Two relative pathways are embodied and documented in the Interface and Sequence Alignment section of the chosen combinatorial paradigm.
  • any input data item in the interface corresponding to any function block in at least two function blocks corresponds to a second relative path
  • the second relative path of any input data item represents any The relative path of the input data item in the combined function block
  • the expression form of the second relative path of any input data item is:
  • Path (PF) is the relative path in the combined function block of any function block to which any input data item belongs calculated in the following manner: based on the splicing structure of the combined function block (that is, the calculation sequence corresponding to the combined function block, It is stipulated that the relative address coding of the function block is built in order in the calculation sequence, and the coding rules are coded according to 0, 1, 2...), from the outermost function block corresponding to any function block of the combined function block to any Between function blocks, the relative address attribute related to any function block is obtained layer by layer, and the relative path of any function block is calculated according to the relative address attribute related to any function block; in means that any input data item is in any The input part of the interface corresponding to a function block, Path(data_in2) is the relative path of any input data item in the input part of the interface corresponding to any function block calculated in the following way: from the interface corresponding to any function block Between the outermost input data item corresponding to any input data item and any input data item in the input part, the relative address attribute
  • any output data item in the interface corresponding to any function block corresponds to a second relative path
  • the second relative path of any output data item means that any output data item is in the combined function block
  • Path(PF) indicates the relative path of any function block to which any output data item belongs in the combination function block: out indicates that any output data item is in the output part of the interface corresponding to any function block, and Path(data_out2 ) is the relative path of any output data item in the output part of the interface corresponding to any function block calculated in the following way: in the output part corresponding to any output data item from any function block Between the output data item of the outer layer and any output data item, the relative address attribute related to any output data item is obtained layer by layer, and any output data item is calculated according to the relative address attribute related to any output data item relative path.
  • the relative address attributes related to any function block can be connected with dot notation (ie: .) to obtain the address of any function block in the combined function block obtained by combining any function block.
  • the relative path that is, the relative path of the function block in the combined function block composed of the function block can be obtained in the following way: from the outermost function block corresponding to any function block of the combined function block to the
  • the relative address attributes of all function blocks between any function blocks are connected with dot symbols.
  • the relative path of the input data item in the input part of the interface corresponding to the function block where the input data item is located can be obtained in the following way: from the outermost input of the input part corresponding to the input data item according to the nested structure
  • the relative address attributes of all input data items between the data item and the input data item are connected with dot symbols;
  • the relative path of the output data item in the output part of the interface corresponding to the function block where the output data item is located can be obtained in the following way :
  • the relative address attributes of are concatenated with dot notation.
  • the path attribute inside the destination tag inside the line tag in PFVMS can be used to store the second relative path of any input data item or store the second relative path of any output data item.
  • the internal data items of at least two function blocks are connected according to the connection rules, so as to generate the VMS part corresponding to the combined function blocks.
  • the data transfer connection relationship in the calculation sequence is stored in the VMS corresponding to the combination function block in the form of a second relative path
  • the calculation formula of the second relative path of the data item in the calculation sequence refers to the above (3 ) and (4).
  • the connection relationship of the auxiliary merged connection in the calculation sequence is temporarily stored in the VMS in the form of the second relative path.
  • the calculation formula of the second relative path of the data item in the calculation sequence also refers to the above (3) and (4) ), after the interface is generated, the relationship of the auxiliary merged link will be stored in the PFVMS area, and the relationship record of the auxiliary merged link in the VMS area will be deleted.
  • the XML representation of the VMS is:
  • the XML of the VMS is used to record the relationship of the data transmission connection, that is, to store the directional connection issued by the output data item.
  • Each connection is stored using a set of line tags, and the line tags are internally composed source and destination tags, the path attribute of the source tag stores the second relative path of the data item where the starting point of the directed line segment is located in the calculation sequence, and the path attribute of the destination tag stores the second relative path of the data item where the end point of the directed line segment is located in the calculation sequence Two relative paths.
  • storage type modification occurs in the memory attribute of the data item where the two endpoints of the directed line segment are located. It should be noted that the storage type attribute of any data item defaults to real storage, which is changed according to the connection rules (data transfer connection rules and practical connection rules) during the connection process.
  • the undirected attribute is used to distinguish the type of connection relationship. If there is no undirected attribute, it means that the record data transfer connection is to store the directional connection sent by the output data item. If there is an undirected attribute, it means that the auxiliary merge connection is temporarily stored. Stores undirected links between input data items and input data items.
  • the XML representation of the VMS corresponding to the data transfer connection is:
  • the XML representation of the VMS corresponding to the auxiliary merge connection is:
  • recording the connection relationship between the first output data item and the second output data item may include: connecting the second output data item to the first output data item using an output-output transfer line in a graphical representation item, the arrow of the output output transmission line points to the first output data item; in the XML expression form of the VMS of the combined function block, the second relative path of the second output data item is stored through the path attribute of the source tag, and the second relative path of the second output data item is stored through the destination tag
  • the path attribute stores the second relative path of the first output data item.
  • recording the connection relationship between the first input data item and the third output data item may include: using an output-input transfer line to connect the third output data item to the first input data item in a graphical representation item, the arrow of the output-input transmission line points to the first input data item; in the XML expression form of the VMS of the combined function block, the second relative path of the third output data item is stored through the path attribute of the source tag, and the second relative path of the third output data item is stored through the destination tag
  • the path attribute stores the second relative path of the first input data item.
  • recording the connection relationship between the second input data item and the third input data item includes: in a graphical expression form, connecting the second input data item and the third input data item using an auxiliary merged line without an arrow Enter the data item connection.
  • connection relationship between the second input data item and the third input data item can be temporarily stored in the XML expression form of the VMS of the combined function block, for example, storing the second relative path of the second input data item through the path attribute of the source tag, The second relative path of the third input data item is stored through the path attribute of the destination tag.
  • the second relative path of the third input data item is stored through the path attribute of the source tag, and the second relative path of the second input data item is stored through the path attribute of the destination tag.
  • setting the storage type attribute of a data item to virtual storage means setting the circle representing the data item as a hollow circle, and setting the storage type attribute of the data item to real storage means that the data will be represented
  • the circle of the item is set as a solid circle; in the XML expression form of the combined function block, setting the storage type attribute of the data item to virtual storage means setting the value of memory representing the data item to 0, and setting the storage type of the data item to Setting the attribute to real storage means setting the value of the memory representing the data item to 1.
  • setting the storage type attribute of the second output data item to virtual storage without changing the storage type attribute of the first output data item includes: In the graphical expression form , set the circle representing the second output data item as a hollow circle, and keep the circle representing the first output data item unchanged; in the XML expression form of the combined function block, set the storage type attribute memory of the second output data item If the value is 0, the value of the storage type attribute memory of the first output data item remains unchanged.
  • the circle representing the first output data item is a solid circle
  • the value of the storage type attribute memory of the first output data item is 1
  • the circle representing the first output data item is still a solid circle, and the value of the storage type attribute memory of the first output data item is still 1.
  • FIG. 5A is a schematic diagram of an output-output transmission line provided by an embodiment of the present disclosure.
  • a combined function block includes function block F1/PF1 and function block F2/PF2, and in the calculation order, function block F1/PF1 is located before function block F2/PF2, and function block F1/PF1 includes output data item b5 (e.g., the first output data item above), the function block F2/PF2 includes an output data item b6 (e.g., the second output data item above), which appears after output data item b5 in the order of calculation,
  • the output data item b6 can be connected to the output data item b5 through the output output transfer line.
  • the storage type attribute of the output data item b6 can be set as virtual storage, that is, the circle representing the output data item b6 is set as a hollow circle,
  • the storage type attribute of the output data item b5 remains unchanged, which means that the circle of the output data item b5 is still a solid circle.
  • the XML corresponding to the output output transfer line shown in Figure 5A is as follows:
  • connection relationship between the output data item b5 and the output data item b6 can be recorded in the VMS part of the XML schema of the combined function block, that is, the output-output transfer line shown in FIG. 5A can be recorded.
  • VMS corresponding to the output and output transfer lines shown in Figure 5A is as follows:
  • the output data item b5 and the output data item b6 are both data items of int type, and the path attribute of the destination tag in the line tag in VMS is 0.out.0, which indicates the second relative path of the output data item b5,
  • the path attribute of the source tag in the line tag in VMS is 1.out.0, which represents the second relative path of the output data item b6.
  • the memory of the output data item b5 is 1, which means that the output data item b5 is a real storage, and the memory of the output data item b6 is 0, which means that the output data item b6 is a virtual storage.
  • the JSON representation corresponding to the output output transfer line shown in Figure 5A is as follows:
  • FIG. 5B is a schematic diagram of an output-input transmission line provided by an embodiment of the present disclosure.
  • a combined function block includes function block F3/PF3 and function block F4/PF4.
  • function block F3/PF3 is located before function block F4/PF4
  • function block F3/PF3 includes input data item a8 (e.g., the first input data item above)
  • the function block F4/PF4 includes an output data item b7 (e.g., the third output data item above), which appears after the input data item a8 in the order of calculation
  • the output data item b7 and the input data item a8 do not belong to the same function block
  • the output data item b7 can be connected to the input data item a8 through the output-input transmission line, at this time, the storage type attribute of the output data item b7 can be set as Virtual storage means that the circle of the output data item b7 is set as a hollow circle, and the storage type attribute of the input data item a8 remains unchanged, which means that the circle of the input data item a8 is still a solid circle.
  • connection relationship between the output data item b7 and the input data item a8 can be recorded in the VMS part of the XML schema of the combined function block, that is, the output-input transfer line shown in FIG. 5B can be recorded.
  • the VMS corresponding to the output-input transfer line shown in Figure 5B is as follows:
  • both the output data item b7 and the input data item a8 are data items of int type
  • the path attribute of the source tag in the line tag in VMS is 1.out.0, which represents the second relative path of the output data item b7
  • the path attribute of the destination tag in the line tag in the VMS is 0.in.0.0, which represents the second relative path of the input data item a8.
  • the memory of the output data item b7 is 0, which means that the output data item b7 is a virtual storage
  • the memory of the input data item a8 is 1, which means that the input data item a8 is a real storage.
  • FIG. 5C is a schematic diagram of another output-input transmission line provided by an embodiment of the present disclosure.
  • a composite function block includes function block F5/PF5 and function block F6/PF6, and in the calculation order, function block F5/PF5 is located before function block F6/PF6, and function block F5/PF5 includes output data item b8 (for example, the above-mentioned third output data item), the function block F6/PF6 includes an input data item a9 (for example, the above-mentioned first input data item), in the order of calculation, the output data item b8 appears before the input data item a9, And the output data item b8 and the input data item a9 do not belong to the same function block, the output data item b8 can be connected to the input data item a9 through the output-input transfer line, at this time, the storage type attribute of the input data item a9 can be set as Virtual storage means that the circle of the input data item a9 is set as a hollow circle, and the storage type attribute of the output data item b8 remains unchanged, which means that the circle
  • connection relationship between the output data item b8 and the input data item a9 may be recorded in the VMS part of the XML schema of the combined function block, that is, the output-input transmission line shown in FIG. 5C is recorded.
  • the VMS corresponding to the output-input transfer line shown in Figure 5C is as follows:
  • both the output data item b8 and the input data item a9 are data items of int type, and the path attribute of the source tag in the line tag in VMS is 0.out.0, which represents the second relative path of the output data item b8,
  • the path attribute of the destination tag in the line tag in VMS is 1.in.0.0, which represents the second relative path of the input data item a9.
  • the memory of the output data item b8 is 1, which means that the output data item b8 is a real storage
  • the memory of the input data item a9 is 0, which means that the input data item a9 is a virtual storage.
  • FIG. 5D is a schematic diagram of another output-input transmission line provided by an embodiment of the present disclosure.
  • a combined function block includes function block F7/PF7, and function block F5/PF5 includes output data item b9 (for example, the above-mentioned third output data item) and input data item a10 (for example, the above-mentioned first input data item), according to the calculation order, the output data item b9 appears after the input data item a10, and the output data item b9 and the input data item a10 belong to the same function block, and the output data item b9 can be connected to Input data item a10, at this time, the storage type attribute of input data item a10 remains unchanged, which means that the circle of input data item a10 is still a solid circle, and the storage type attribute of output data item b9 is set to virtual storage, which means that the output data item The circle of b9 is set as a hollow circle.
  • the XML corresponding to the output-input transfer line shown in Figure 5D is as follows:
  • connection relationship between the output data item b9 and the input data item a10 may be recorded in the VMS part of the XML schema of the combined function block, that is, the output-input transmission line shown in FIG. 5D is recorded.
  • the VMS corresponding to the output-input transfer line shown in Figure 5D is as follows:
  • both the output data item b9 and the input data item a10 are data items of int type, and the path attribute of the source tag in the line tag in VMS is 0.out.0, which represents the second relative path of the output data item b9, The path attribute of the destination tag in the line tag in the VMS is 0.in.0.1, which represents the second relative path of the input data item a10.
  • the memory of the output data item b9 is 0, which means that the output data item b9 is a virtual storage, and the memory of the input data item a10 is 1, which means that the input data item a10 is a real storage.
  • FIG. 5E is a schematic diagram of an auxiliary merging connection provided by an embodiment of the present disclosure.
  • a combined function block includes function block F8/PF8 and function block F9/PF9, and in the calculation order, function block F8/PF8 is located before function block F9/PF9, and function block F8/PF8 includes input data Item a11 (for example, the above-mentioned second input data item), the function block F9/PF9 includes an input data item a12 (for example, the above-mentioned third input data item), in the order of calculation, the input data item a11 appears before the input data item a12, The input data item a11 and the input data item a12 do not belong to the same function block, and the input data item a11 and the input data item a12 can be connected through the auxiliary merge connection.
  • the storage type attribute of the input data item a11 remains unchanged. That is, the circle representing the input data item a11 is still a solid circle, and the storage type attribute of the input data item a12 can be set as virtual storage, that is, the circle representing the input data item a12 is set as a hollow circle.
  • the XML corresponding to the output-input transfer line shown in Figure 5E is as follows:
  • connection relationship between the input data item a11 and the input data item a12 may be temporarily recorded in the VMS part of the XML schema of the combined function block, that is, the auxiliary merging connection shown in FIG. 5E is recorded.
  • the connection relationship is updated in the PFVMS part, and the relevant content of the VMS part is deleted.
  • VMS corresponding to the auxiliary merging connection shown in FIG. 5E is as follows:
  • both the input data item a11 and the input data item a12 are data items of int type, and the path attribute of the source tag in the line tag in VMS is 0.in.0.0, which represents the second relative path of the input data item a11,
  • the path attribute of the destination tag in the line tag in the VMS is 1.in.0.0, which represents the second relative path of the input data item a12.
  • the memory of the input data item a11 is 1, which means that the input data item a11 is a real storage, and the memory of the input data item a12 is 0, which means that the input data item a12 is a virtual storage.
  • the interface corresponding to each function block in the multiple function blocks includes an input part and an output part.
  • step S13 at least two function blocks are encapsulated into a combination function block, and an interface corresponding to the combination function block is generated, including: combining and encapsulating at least one input data item extracted as an interface corresponding to the combination function block, to Obtain the input part of the interface corresponding to the combination function block; combine and encapsulate at least one output data item extracted as the interface corresponding to the combination function block, so as to obtain the output part of the interface corresponding to the combination function block.
  • the interface corresponding to the composition function block is stored in the interface part of the selected composition paradigm.
  • the input parts of all function blocks in the calculation sequence are merged in order to determine the input part of the interface corresponding to the combined function block, and all the function blocks in the calculation sequence
  • the output parts of are merged in order to determine the output part of the interface corresponding to the combined function block.
  • the input data items extracted as an interface may be sequentially combined into one or more input data items that serve as an input part of the interface, e.g., the one or more Input data items can include data items of composite data types other than XOR types, and can also include data items of basic data types or pointer types or generic data items; output data items extracted as interfaces can be combined in order into one or more output data items, the one or more output data items as the output part of the interface, for example, the one or more output data items may include data items of composite data types, and may also include data of basic data types Item or data item of pointer type or generic type.
  • step S13 at least two function blocks are encapsulated as a combined function block, and the interface corresponding to the generated combined function block also includes at least one of the following items: For any one of the at least two function blocks, in any one of the function blocks If the data type attribute of any input data item or output data item corresponding to the block is a combined data type, if no data item in any input data item or output data item is extracted as a part of the interface corresponding to the combined function block , break up any input data item or output data item, do not extract the certain data item, and recombine any input data item or the remaining data items in the output data item as part of the interface corresponding to the combination function ; For any function block in at least two function blocks, any input data item or output data item corresponding to any function block is a data item of pointer type, and any input data item or output data item of pointer type is extracted As part of the interface corresponding to the combined function block, the data structure of any input data item or output data item of the pointer type is not
  • the data type of the data item extracted as the interface is a pointer type
  • the internal data structure of the pointer type data item will not be broken up.
  • the input part and output part of all function blocks in the calculation sequence are respectively merged in sequence. If the combined structure of the same function block contains data items that are not extracted as interfaces, the rest of the data items other than the data items are reassembled and extracted as Part of the interface, the data item does not participate in reassembly, the data item is not part of the interface.
  • the input data items whose storage type attribute is real storage are extracted as part of the interface corresponding to the combined function block, and the input data items whose storage type attribute is virtual storage are not extracted as the combined function
  • the part of the interface corresponding to the block does not extract the input data item of constant type as part of the interface corresponding to the composite function block.
  • the output data items have three extraction methods: first, extract all output data items as part of the interface corresponding to the combined function block; second, the user can choose whether to Extract the output data item as a part of the interface corresponding to the combined function block; thirdly, for any output data item corresponding to at least two function blocks, first determine whether any output data item has a direct connection relationship or an indirect connection relationship At least one output data item of , if it exists, obtain any output data item and at least one output data item that appears first in the output data item as the output data item to be extracted, and between the output data item to be extracted and any input data item In the case of connection, if the output data item to be extracted appears before any of the input data items, the output data item to be extracted is not extracted as part of the interface corresponding to the combination function block; if the output data item to be extracted appears after any input data item or The output data item to be extracted and any input data item belong to the same function block, and the output data item to be extracted
  • the corresponding The output data item of the interface can be manually selected by the user whether to extract it as a part of the interface corresponding to the combined function block.
  • the process of artificial selection can be carried out at any time after the interface extraction is completed. For example, when using PF, it is found that the output data item Not enough time. For example, among any output data item and at least one output data item, other output data items except the output data item to be extracted are not extracted as part of the interface corresponding to the combination function block.
  • the output data item to be extracted appears after any input data item or the output data item to be extracted and any input data item belong to the same function block, and the output data item to be extracted is extracted as the corresponding
  • the connection relationship between the output data item to be extracted and any input data item needs to be represented on the interface corresponding to the combination function block.
  • the data type attribute is a combined data type, and can be an input data item or an output data item
  • the combined structure of the combined data item is broken up, and each data item in the combined data item is reassembled. All outer composite types of the composite data item are removed to expose the remaining data items extracted as interfaces in the composite data item, and then these data items are reassembled according to the composite rules.
  • Fig. 6 is a schematic diagram of a combined function block provided by some embodiments of the present disclosure.
  • the combined function block includes a function block PF10 and a function block PF11, the function block PF10 has two input data items a13 and a14 and an output data item b10, and the function block PF11 has three input data items a15, a16 and a17 and two output data items b11 and b12.
  • the XML representation of the calculation sequence part in the XML schema corresponding to the combined function block is as follows:
  • the first input pin in the function block PF11 that is, the input data item a15
  • the transfer line from the output to the input is connected to the input data item a15.
  • the input data item a15 is not extracted as an interface, so when the interface corresponding to the combined function block is generated, the combined data of the input part in the interface corresponding to the function block PF11 Type input data items are broken up, that is, the outer combination structure of the input part is removed, and the remaining data items in the combination structure (ie, input data item a16 and input data item a17) are exposed, and the remaining data items are reassembled and extracted as Combine a part of the interface corresponding to the function block, and then recombine the data items according to the combination rules, that is, the input data item in the interface corresponding to the function block PF10 (the combined data item formed by the combination of input data items a13 and a14), and the function block PF11
  • the input data item a16 and the input data item a17 in the corresponding interface are recombined to obtain the input part of the interface corresponding to the combined function block.
  • the combined input data item formed by combining the input data items a13 and a14 corresponding to the function block PF10 is not broken up, the combined structure of the combined input data item remains unchanged.
  • the input data item a15 corresponding to the function block PF11 is not extracted as a part of the interface corresponding to the combined function block, and the combined input data item formed by combining the input data items a15, a16 and a17 corresponding to the function block PF11 is broken up, and the input The data items a16 and a17 are recombined with the combined input data items corresponding to the function block PF10 to obtain the input data items of the combined function block.
  • the XML representation of the interface part in the XML schema corresponding to the composite function block is:
  • the data type attribute of the input data item of the input part of the interface corresponding to the combined function block is int2 (intint)
  • the input part includes a three-layer structure
  • the first layer of the input part includes An input data item int2 (intint) of a combined data type, in the first layer of the input part, the relative address attribute of the input data item int2 (intint) is 0
  • the second layer of the input part includes the combined input data item int2 (the data type attribute is a combination data type, such as int2, i.e.
  • the third layer of the input part includes the input data item a13 in the combined input data item int2 (the data type attribute is basic data type, such as int) and input data item a14 (data type attribute is a basic data type, such as int), and also includes input data item a16 in the combined input data item intint (data type attribute is a basic data type, such as int) and Input data item a17 (data type attribute is a basic data type, such as int), in the third layer of the input part, the relative address attribute of input data item a13 is 0, the relative address attribute of input data item a14 is 1, input The relative address attribute of
  • the data type attribute of the output data item of the output part of the interface corresponding to the combined function block is int2.
  • the output part includes a two-layer structure.
  • the first layer of the output part includes an output data item int2 of the combined data type.
  • the relative address attribute of the output data item int2 is 0;
  • the second layer of the output part includes the output data item b11 (data type attribute is a basic data type, such as int) and output data item b12 (data type The attribute is a basic data type, such as int).
  • the relative address attribute of the output data item b11 is 0, and the relative address attribute of the output data item b12 is 1.
  • the circles representing input data item a13, input data item a14, input data item a16 and input data item a17, output data item b10, output data item b11 and output data item b12 are solid circles, That is, the storage similar attributes of input data item a13, input data item a14, input data item a16, input data item a17, output data item b10, output data item b11 and output data item b12 are all real storage;
  • the circle is a hollow circle, that is, the storage-like attribute of the input data item a15 is virtual storage.
  • the input data item a15 and the output data item b10 are connected by a data transfer connection (line with an arrow, and the arrow points to the input data item a15).
  • the method provided by the present disclosure further includes: selecting at least one basic function block representing an assignment expression and at least one basic function block representing a relational expression from the basic function blocks as at least two function blocks.
  • the basic function blocks representing arithmetic expressions include a basic function block representing integer addition and a basic function block representing integer subtraction
  • the method provided by the present disclosure further includes: selecting from the basic function blocks representing integer At least one basic function block of addition and/or at least one basic function block representing integer subtraction and at least one basic function block representing relational expressions are at least two basic function blocks.
  • combining at least two function blocks according to at least one combination normal form in a plurality of combination normal forms includes: selecting at least one of sequential combination normal forms, conditional combination normal forms, cyclic combination normal forms and when-type cyclic combination normal forms as at least one Combined normal forms: combine at least two function blocks according to at least one combined normal form.
  • FIG. 7A is a schematic diagram of a method for combining function blocks based on the sequential combination paradigm provided by some embodiments of the present disclosure
  • FIG. 7B is a schematic diagram of a graphical expression form of at least two function blocks provided by some embodiments of the present disclosure
  • FIG. 7C A schematic diagram of a graphical expression form of a constant data item provided by some embodiments of the present disclosure.
  • At least one function block is used to gradually fill the structural template of the sequential compositional paradigm.
  • the method for combining function blocks based on the sequential combination paradigm includes steps S50-S56.
  • step S50 includes: selecting a sequential combination paradigm.
  • step S51 includes: selecting at least two function blocks and organizing a calculation sequence.
  • At least two function blocks can be selected from the function block library, and the at least two function blocks can be arranged based on sequential combination paradigm and permutation operation to form a corresponding calculation sequence .
  • the sequential composition paradigm at least two function blocks can be composed sequentially.
  • the id values of the data items in at least two function blocks can be specified, that is, the id values of the data items can be modified as required, so that the calculation sequence is easier to understand.
  • the number of at least two function blocks is 2, that is, two function blocks F/PF13 and F/PF14 are selected from the function block library, and FIG. 7B shows the two function blocks.
  • function block F/PF13 includes input data items r11 and r12, etc., and also includes output data item e11, etc.
  • function block F/PF14 includes input data items r13, r14, etc., and also includes output data item e12, etc.
  • Function blocks F/PF13 and F/PF14 can be basic function blocks or combined function blocks. It should be noted that the present disclosure is not limited thereto, and the number of at least two function blocks may also be 3, 5, etc. more or less.
  • the name attribute of the function block F/PF13 represents the global address (namely the system number) of the function block F/PF13 in the function block library, and remains unchanged.
  • the name attribute of the function block F/PF14 represents the global address (namely the system number) of the function block PF12 in the function block library, and remains unchanged.
  • the XML of the function block F/PF13 or function block F/PF14 is included between ⁇ F> and ⁇ /F>
  • the XML of the function block F/PF13 or function block F/PF14 is included between ⁇ PF> and ⁇ /PF>.
  • Step S52 includes: constant setting.
  • Attribute setting includes: select a data item, and initialize the attribute value of the data item in the attribute area.
  • attribute setting can include constant setting, for example, if there is a data item in the calculation sequence that is a constant data item, then modify the constant attribute of the constant data item, as shown in Figure 7C, for example, an int type data item a is A constant data item, and the value of the data item a is set to 5.
  • the user can modify the id of the input/output data item in the calculation sequence according to the requirement.
  • the "variable name" is the id of the data item.
  • the id of the data item can be set to a, the data item a is selected as a constant, and the constant value is set to 5.
  • the value of a constant data item is stored directly in the value attribute of that data item.
  • Fig. 8A is a schematic diagram of a graphical expression form of a calculation sequence provided by some embodiments of the present disclosure
  • Fig. 8B is a schematic diagram of a graphical expression form of the constant data items shown in Fig. 8A;
  • the addition function block expaddI includes two input data items g11 and g12 and an output data item k11
  • the division function block expdivI includes two input data items g13 and g14 and an output data item k12
  • the assignment function block assignint It includes an input data item g15 and an output data item k13.
  • the input data item g14 corresponding to the second input pin of the division function block expdivI is a constant data item, and the value of the constant data item g14 may be 2.
  • the value of the constant data item g14 is set to 2
  • the variable name corresponding to the constant data item g14 is g14
  • the data type attribute of the constant data item g14 is int type
  • each of the addition function block expaddI, the division function block expdivI and the assignment function block assignint XML is enclosed between ⁇ F> and ⁇ /F>.
  • the division function block expdivI includes an input data item g14 of constant type, and the value of the input data item g14 of constant type is 2, the value attribute of the input data item g14 is set to 2.
  • step S53 includes performing a connection operation to generate a VMS, that is, performing operations of data transfer connection and auxiliary merging connection.
  • step S53 according to the calculation sequence, it is determined which data items (input data items and/or output data items) in at least two function blocks can be connected through data transfer lines and/or auxiliary merging lines, that is, after obtaining After the sequence is calculated, the connection between the internal data items of the function block can be combined according to the connection rule, so as to generate the VMS corresponding to the combined function block.
  • the data item can be expanded.
  • the expansion action has no effect on the data type attribute and data class attribute of the data item and the data items contained in it.
  • the type matching judgment can be performed on the data items contained in it.
  • the connection action can be performed on the data items contained in it.
  • the expansion action can be continuously applied to the data items contained inside, until the type of the data item meets the type matching rule or the data item is a basic data type, a general pointer type, Generics.
  • the output data item when the output data item and the input data item satisfy the type matching rule, the output data item is connected to the input data item through the output input transfer line in the data transfer connection, if the output data item appears before the input data item , then set the storage type attribute of the input data item to virtual storage, do not change the storage type attribute of the output data item, and record the connection relationship between the output data item and the input data item.
  • the output-input transfer line is graphically represented by connecting the output data item to the input data item through a connection line with an arrow pointing to the input data item, which will represent the graph of the input data item (for example, circle) becomes a hollow figure without changing the figure representing the output data item;
  • the output-input transmission line is reflected in the XML of the VMS part as follows: in the XML of the VMS part, the second relative path of the input data item is stored in the connection input In the path attribute of the destination tag of the directed line segment end point of the data item, store the second relative path of the output data item in the path attribute of the source tag of the directed line segment connecting the output data item, and set the value of memory of the input data item If it is 0, keep the memory value of the output data item unchanged.
  • the output data item when the output data item and the input data item meet the type matching rule, the output data item is connected to the input data item through the output input transfer line in the data transfer connection, if the output data item appears in the input data item Afterwards, or if the output data item and the input data item belong to the same function block, set the storage type attribute of the output data item to virtual storage without changing the storage type attribute of the input data item, and record the connection relationship.
  • the output-input transfer line is represented graphically by connecting the output data item to the input data item through a connection line with an arrow pointing to the input data item, which will represent the graphic of the output data item (for example, circle) becomes a hollow figure without changing the figure representing the input data item;
  • the output-input transfer line is reflected in the XML of the VMS part as follows: in the XML of the VMS part, the second relative path of the input data item is stored in the connection input In the path attribute of the destination tag of the directed line segment end point of the data item, store the second relative path connecting the output data item in the path attribute of the source tag of the directed line segment start point of the output data item, and set the value of memory of the output data item If it is 0, keep the memory value of the input data item unchanged.
  • the output data item k11 corresponding to the output pin of the addition function block expaddI and the input data item g13 corresponding to the first input pin of the division function block expdivI are connected through the output-input transmission line, and the division function
  • the output data item k12 corresponding to the output pin of the block expdivI and the input data item g15 corresponding to the input pin of the assignment function block assignint are connected through the output-input transfer line.
  • the lines with arrows indicate the output-input transmission line, and the arrows indicate the data flow direction of the output-input transmission line.
  • the output data item k11 is connected to the input data item g13 through the output-input transfer line with arrows, and the output data item k11 transfers to input data item g13; connected to input data item g15 by an output-input transfer line with an arrow from output data item k12, which is passed to input data item g15.
  • the storage type attributes of the input data item g13 of the division function block expdivI and the input data item g15 of the assignment function block assignint are all modified to virtual storage, as shown in FIG. 8C: the solid circle representing the input data item g13 of the division function block expdivI becomes a hollow circle, indicating that the solid circle of the input data item g15 of the assignment function block assignint becomes a hollow circle.
  • the relative address attribute of the output data item k11 of the addition function block expaddI is the second relative path of the output data item k11 of the addition function block expaddI, namely 0.out.0;
  • the division function The relative address attribute of the input data item g13 of the block expdivI is the second relative path of the input data item g13 of the division function block expdivI, namely 1.in.0.0;
  • the relative address attribute of the output data item k12 of the division function block expdivI is the division function
  • the second relative path of the output data item k12 of the block expdivI is 1.out.0;
  • the relative address attribute of the input data item g15 of the assignment function block assignint is the second relative path of the input data item g15 of the assignment function block assignint, namely 2.in.0.
  • the storage type attributes of the input data item g13 of the division function block expdivI and the input data item g15 of the assignment function block assignint are all modified to virtual storage, that is, the memory corresponding to the input data item g13 of the division function block expdivI and the input of the assignment function block assignint
  • the memory corresponding to the data item g15 is set to 0.
  • the two output data items are connected through the output output transfer line in the data transfer connection line, and the output data item that appears in the front is defined as Out1, and the output data item that appears later is Out1.
  • the output data item of is expressed as Out2, and the output data item Out2 is connected to the output data item Out1 through the output output transmission line.
  • set the storage type attribute of the output data item Out2 to virtual storage, and do not change the storage type of the output data item Out1 Attribute, which records the connection relationship between the output data item Out1 and the output data item Out2.
  • the output-output transmission line is graphically represented as: connecting the output data item Out2 to the input data item Out1 through a connection line with an arrow, and the arrow points to the output data item Out1, which will represent the output data item Out2 Graphics (for example, circles) become hollow graphics, do not change the graphics representing the output data item Out1; this output output transfer line is reflected in the XML of the VMS part as: in the XML of the VMS part, the second part of the output data item Out1
  • the relative path is stored in the path of the destination tag, the second relative path of the output data item Out2 is stored in the path of the source, the value of the memory of the output data item Out2 is set to 0, and the value of the memory of the output data item Out1 is kept unchanged. Change.
  • D2 is a data item of any type other than pointers and generics
  • the value of the data type attribute of D1 becomes the same as the value of the data type attribute of D2
  • the value of the data type attribute of D1 becomes Same value as D2's DataType property.
  • establishing a connection between two data items of pointer type also has the following pointer type-related rules:
  • one or more pointer-type data items REFk connected to the data item REF1 through a data transfer connection and/or an auxiliary merging connection, wherein k is any positive integer, k>0, if the data item REFk is general pointer type, then the data item REFk also gets the pointing type of the data item REF2;
  • the data item REFm on the other side of the assignment function assignref to which the data item REFk belongs if the data item REFk obtains the pointing type of the data item REF2, then the data item REFm also gets the pointing type of the data item REF2, so that the assignment function assignref
  • the data type of the input data item is the same as the data type of the output data item.
  • the assignment function assignref if the data item REFk is the input data item, then the data item REFm is the output data item, and if the data item REFk is the output data item, then The data item REFm is the input data item, m>0;
  • the data item REFn on the other side of the addAddress function block to which the data item REFk belongs if the data item REFk gets the pointing type of the data item REF2, then the data item REFm also gets the pointing type of the data item REF2, so that the addAddress function block
  • the data type pointed to by the input pointer type data item is the same as the data type pointed to by the output pointer type data item.
  • the data item REFn is the input data item, n>0;
  • the input data item of the function block getName is generic (that is, any data type)
  • the output data item of the function block getName is a general pointer type, when the input data item matches a specific data type
  • the input data item gets the data type attribute of the data item T, that is, the data type attribute of the input data item is the same as the data type attribute of the data item T
  • the output data item of the general pointer type obtains the pointed-to type, and the pointed-to type of the output data item is the same as the data type attribute of the data item T, and the above-mentioned first to third described rules continue to be applied.
  • the data item connected with the data item REFm through the data transfer connection and/or the auxiliary merging connection (for example, the data type of the data item is the same as the pointing type of the data item REF2), continue to apply the above-mentioned first to second Three described rules.
  • the data type attribute of the first pointer data item is a general pointer type
  • the second pointer data item is a non-universal pointer type, that is, the second pointer data item has a pointed data item
  • the first pointer data is set
  • the data item pointed to by item is the same data item pointed to by the second pointer data item.
  • the determined type format of the data item pointed to by the pointer type is recorded inside the general pointer data item.
  • the pointer data item whose id is r contains the type description of the data item d it points to, and the XML representation of the pointer part is:
  • the data item can be expanded, and the expansion action has no effect on the data type attribute and data category attribute of the data item and the data items contained in it.
  • the type matching judgment can be performed on the data items contained inside.
  • the connection action can be performed on the data items contained inside.
  • the data item contained inside the pointer data item is also a combined data type (basic combined data type, XOR type, array type, non-universal pointer type)
  • the expansion operation can continue to be applied to the data item contained inside, until the type of the data item satisfies Type matching rules or data items are basic data types, general pointer types, and generic types.
  • step S54 includes: generating an interface.
  • the XML representation of the interface part corresponding to each composite function block is:
  • the interface part of a composite function block consists of the name, input part and output part of the composite function block.
  • the names of combined function blocks can include: user-defined names, represented by id; system-defined names, represented by name, and the coding rules are the same as those of basic function blocks.
  • the input part of the combined function block is represented by the ⁇ in> ⁇ /in> structure
  • the output part of the combined function block is represented by the ⁇ out> ⁇ /out> structure
  • the specific input data items are between ⁇ in> and ⁇ /in> , between ⁇ out> and ⁇ /out> are specific output data items.
  • data items input data items and output data items
  • input data items and output data items are represented as:
  • typevalue represents the data of the data item
  • the type attribute that is, the type label of the combined data item, follows the type naming rules; id indicates the comment description of the data item, which can be specifically named by the user; name indicates the physical address of the data item (that is, the physical address where the data item is located when the algorithm is running) address); value can represent the value of the data item, and if the data value is not empty, it means that the data item is a constant data item.
  • the constant data item is represented as a yellow solid circle
  • typeclass represents the data category of the data item Attribute, determined by the combined paradigm used
  • typeid represents the name of the user-defined data type attribute, such as linknode, treenode, etc.
  • memory represents the storage type attribute of the data item, and the value of memory is 0 to represent virtual storage, and the graphical representation is hollow
  • typeclass can be represented by numbers.
  • typeclass When typeclass is 0, it indicates the basic data type; when typeclass is 1, it indicates the basic combined data type; when typeclass is 2, it indicates that the data structure is an array structure; when typeclass When it is 3, it means a 2-to-1 structure type; when the typeclass is 4, it means a pointer type; when the typeclass is 5, it means a generic type.
  • the combination function block is a combination function block of a sequential structure
  • at this time at least two function blocks are encapsulated into a combination function block, and an interface combination process corresponding to the combination function block is generated
  • the data items in the interface corresponding to the combined function block are generated by the data items in the interface corresponding to at least two function blocks according to the calculation sequence, and each function block in the at least two function blocks can be obtained according to the interface extraction rules after the connection action is completed.
  • Extract a data item that is, extract all input data items that can be extracted as interfaces in the function block as one data item, and extract all output data items that can be extracted as interfaces in the function block as one data item
  • the data category attribute of the data item in the interface corresponding to the combined function block is the basic combined data type.
  • n data items d1, d2, ... dn the data categories of n data items are extracted from the calculation sequence They are respectively tc1, tc2,...tcn, and the data types are t1, t2,...tn respectively, among them, if n>1, the formed interface data items (that is, interface data items) are data of the basic combined data type item, the interface data item contains descriptions of n data items d1, d2,...dn, and the xml description of the interface data item is as follows:
  • a data item d1 is extracted from the calculation sequence, the data category of the data item is tc1, and the data type is t1, Then the basic combined data type originally applied to the formed interface data item can be omitted, and the data item d1 is directly used as the interface data item.
  • the xml description of the interface data item is as follows:
  • FIG. 8D is a schematic diagram of a graphical representation of the interface corresponding to the combination function block determined based on the connection relationship shown in FIG. 8C
  • FIG. 8E is a storage hierarchy diagram of the interface shown in FIG. 8D .
  • FIG. 8D shows a graphical representation of the interface corresponding to the combination function block, (a+b)/2 can be the name of the combination function block, defined by the user, and the input part of the interface includes two input data items , the output section of the interface includes an output data item.
  • Figure 8E in the storage hierarchy structure diagram of the interface corresponding to the combined function block, the total level of the input part is 2, the total level of the output part is 1, the current display level of the input part is 2, and the current display level of the output part is 2. The display level is 1, at this time, the input part shows two input data items, and the output part shows one output data item.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)
  • Stored Programmes (AREA)

Abstract

一种构造组合函数块的方法及装置、组合函数、存储介质,该方法应用于函数块库,且包括:从多个组合范式中选择至少一个组合范式;获取对多个函数块中的至少两个函数块的排列操作,得到计算序列;基于计算序列,进行拼接操作确定至少两个函数块之间的连接关系;基于至少两个函数块中每个函数块的接口以及至少两个函数块之间的连接关系,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口。每个函数块包括与该函数块对应的接口对应的至少一个输入数据项和至少一个输出数据项,至少一个输入数据项和至少一个输出数据项在函数块中以存储的形式存在,拼接操作包括将至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。

Description

构造组合函数块的方法及装置、组合函数块、存储介质
本申请要求于2021年9月28日递交的中国专利申请第202111142660.X号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。
技术领域
本公开的实施例涉及一种通过嵌套使用组合范式来构造组合函数块的方法、构造组合函数块的装置、组合函数块和非瞬时性计算机可读存储介质。
背景技术
软件设计有两个基本设计思想,模块化和抽象。模块化可以使软件易设计、易理解、易维护。抽象可以使代码更复用。实现软件设计的模块化和抽象都没有统一的方法,需要根据不同的应用具体选择。
发明内容
本公开至少一个实施例提供一种通过嵌套使用组合范式来构造组合函数块的方法,应用于函数块库,所述函数块库包括多个函数块,其中,所述方法包括:从多个组合范式中选择至少一个组合范式;获取对所述多个函数块中的至少两个函数块的排列操作,得到计算序列;基于所述计算序列,进行拼接操作确定所述至少两个函数块之间的连接关系;基于所述至少两个函数块中每个函数块的接口以及所述至少两个函数块之间的连接关系,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口;其中,所述多个函数块中的每个函数块包括与该函数块对应的接口对应的至少一个输入数据项和至少一个输出数据项,所述至少一个输入数据项和所述至少一个输出数据项在该函数块中以存储的形式存在,所述拼接操作包括将所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。
本公开至少一个实施例提供一种根据本公开任一实施例所述的方法得到的组合函数块,该组合函数块包括:一个或多个函数块,所述一个或多个函数块通过数据传递连线和/或辅助合并连线进行连接。
本公开至少一个实施例提供一种构造组合函数块的装置,包括:存储器,用于非瞬时性地存储计算机可读指令;处理器,用于运行所述计算机可读指令,所述计算机可读指令被所述处理器运行时实现根据本公开任一实施例所述的方法。
本公开至少一个实施例提供一种非瞬时性计算机可读存储介质,其中,所述非瞬时性计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现根据本公开任一实施例所述的方法。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例的附图作简单地介绍,显而易见地,下面描述中的附图仅仅涉及本公开的一些实施例,而非对本公开的限制。
图1为本公开一些实施例提供的一种构造组合函数块的方法的示意图;
图2A为本公开一些实施例提供的两个计算的图形化的表达形式的示意图;
图2B为对图2A所示的两个计算进行组合的示意图;
图2C为对图2A所示的两个计算进行组合得到的新计算的图形化的表达形式的示意图;
图2D为对图2A所示的两个计算进行组合得到的新计算的接口的图形化的表达形式的示意图;
图3A为本公开一些实施例提供的一种数据项的图形化的表达形式的示意图;
图3B为本公开一些实施例提供的一种整型的数据项的图形化的表达形式的示意图;
图3(1)A~3(1)F为本公开一些实施例提供的函数块的接口的存储层级结构图;
图4A为本公开一些实施例提供的一个基本函数块的接口的图形化的表达形式的示意图;
图4B为本公开一些实施例提供的一个基本函数块的接口的存储层级结构图;
图4C为本公开一些实施例提供的一个加法函数块的接口的图形化的表达形式的示意图;
图4D(1)为本公开一些实施例提供的一个加法函数块的接口的一种存储层级结构图;
图4D(2)为本公开一些实施例提供的一个加法函数块的接口的另一种存储层级结构图;
图4E为本公开一些实施例提供的一个表示关系表达式的基本函数块的图形化的表达形式的示意图;
图4F为本公开一些实施例提供的一个表示关系表达式的基本函数块的一个具体示例的图形化的表达形式的示意图;
图4G为本公开一些实施例提供的一个表示关系表达式的基本函数块的接口的存储层级结构图;
图4H为本公开一些实施例提供的一个表示逻辑表达式的基本函数块的图形化的表达形式的示意图;
图4I为本公开一些实施例提供的一个表示逻辑与表达式的基本函数块的一个具体示例的图形化的表达形式的示意图;
图4J为本公开一些实施例提供的一个表示逻辑与表达式的基本函数块的接口的存储层级结构图;
图4K为本公开一些实施例提供的一个表示算术表达式的基本函数块的图形化的表达形式的示意图;
图4L为本公开一些实施例提供的一个表示加法表达式的基本函数块的图形化的表达形式的示意图;
图4M为本公开一些实施例提供的表示加法表达式的基本函数块的接口的一种存储层级结构图;
图4N为本公开一些实施例提供的表示加法表达式的基本函数块的接口的另一种存储层级结构图;
图4O为本公开一些实施例提供的一个表示赋值表达式的基本函数块的图形化的表达形式的示意图;
图4P为本公开一些实施例提供的一个表示赋值表达式的基本函数块的一个具体示例的图形化的表达形式的示意图;
图4Q为本公开一些实施例提供的表示赋值表达式的基本函数块的接口的存储层级结构图;
图4R为本公开一些实施例提供的一个表示getname函数的基本函数块的图形化的表达形式的示意图;
图4S为本公开一些实施例提供的表示getname函数的基本函数块的接口的存储层级结构图;
图5A为本公开一实施例提供的一种输出输出传递线的示意图;
图5B为本公开一实施例提供的一种输出输入传递线的示意图;
图5C为本公开一实施例提供的另一种输出输入传递线的示意图;
图5D为本公开一实施例提供的又一种输出输入传递线的示意图;
图5E为本公开一实施例提供的一种辅助合并连线的示意图;
图6为本公开一些实施例提供的一种组合函数块的示意图;
图7A为本公开一些实施例提供的一种基于顺序组合范式组合函数块的方法的示意图;
图7B为本公开一些实施例提供的至少两个函数块的图形化的表达形式的示意图;
图7C为本公开一些实施例提供的一种常量数据项的图形化的表达形式的示意图;
图7D为本公开一些实施例提供的两个函数块的图形化的表达形式的示意图;
图8A为本公开一些实施例提供的一种计算序列的图形化的表达形式的示意图;
图8B为图8A所示的常量数据项的图形化的表达形式的示意图;
图8C为对图8A所示的计算序列进行连线之后的图形化的表达形式的示意图;
图8D为基于图8C所示的连线关系确定的组合函数块对应的接口的图形化的表达形式的示意图;
图8E为图8D所示的接口的存储层级结构图;
图9A为本公开一些实施例提供的一种if结构的组合函数块的示意图;
图9B为本公开一些实施例提供的一种基于if组合范式组合函数块的方法的示意图;
图9C为本公开一些实施例提供的一种if结构的组合函数块的图形化的表达形式的示意图;
图9D为对图9C所示的组合函数块中的数据项进行连线之后的图形化的表达形式的示意图;
图9E为本公开一些实施例提供的一种条件结构的组合函数块的示意图;
图9F为图9E所示的if结构的组合函数块对应的接口的图形化的表达形式的示意图;
图10A为本公开一些实施例提供的一种for结构的组合函数块的示意图;
图10B为本公开一些实施例提供的一种基于for组合范式组合函数块的方法的示意图;
图10C为本公开一些实施例提供的一种for结构的组合函数块的图形化的表达形式的示意图;
图10D为对图10C所示的计算序列进行连线之后的一种图形化的表达形式的示意图;
图10E为对图10C所示的计算序列进行连线之后的另一种图形化的表达形式的示意图;
图10F为对图10C所示的计算序列进行连线之后的又一种图形化的表达形式的示意 图;
图10G为图10F所示的for结构的组合函数块对应的接口的图形化的表达形式的示意图;
图10H示出了包括数组类型的数据项的函数块的接口的一种存储层级结构图;
图10I示出了对数组类型的数据项进行第一层展开时的存储层级结构图;
图10J示出了对数组类型的数据项进行第二层展开时的存储层级结构图;
图11A为本公开一些实施例提供的一种计算函数的示意图;
图11B为本公开一些实施例提供的另一种for结构的组合函数块的图形化的表达形式的示意图;
图11C为本公开一些实施例提供的一种计算函数的另一种示意图;
图11D为对图11B所示的计算序列进行连线之后的一种图形化的表达形式的示意图;
图11E为对图11C所示的计算序列进行连线之后的另一种图形化的表达形式的示意图;
图11F为图11E所示的for结构的组合函数块对应的接口的图形化的表达形式的示意图;
图12A为本公开一些实施例提供的一种while结构的组合函数块的示意图;
图12B为本公开一些实施例提供的一种基于while组合范式组合函数块的方法的示意图;
图13为本公开一些实施例提供的一种构造组合函数块的装置;
图14为本公开至少一实施例提供的一种非瞬时性计算机可读存储介质的示意图;
图15A为本公开一些实施例提供的一种用于组合的多个函数块的示意图;
图15B为对图15A所示的多个函数块进行连线操作的示意图;
图15C为基于图15A所示的多个函数块组合生成的大函数块的接口的示意图;
图15D为基于图15A所示的多个函数块组合生成的大函数块的示意图。
具体实施方式
为了使得本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例的附图,对本公开实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于所描述的本公开的实施例,本领域普通技术人员在无需创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
除非另外定义,本公开使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本公开中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。
为了保持本公开实施例的以下说明清楚且简明,本公开省略了部分已知功能和已知 部件的详细说明。
算法是一个组合体系,由有限个基本结构单元和有限个组合规则形成算法闭包。任何算法都是可以由基本结构单元的反复使用和有限个组合规则演化而来。模块化软件设计方法是一种可以提高软件开发效率和维护效率的方法,一方面,软件的结构还不能100%模块化,还存在大量的非模块化的语句层的开发行为;另一方面,现有的软件设计应用和算法没有实现分离,使得不同软件使用的算法虽然本质上是一样的,但是却因为算法中使用的变量名称不同,而不能共用。
高级语言中的语句都是包含在一个函数结构内,函数结构包括数据区和计算区,数据区包括函数的输入参数,在函数内部定义语句所用到的变量(包含输出变量和中间变量)和函数会使用到的函数外变量,计算区由语句构成。语句类型包括:复合语句(语句中可包含语句,if、for、while)、函数(调用)语句和基本语句(实现加(+)、减(-)、乘(*)、除法(/)、赋值、逻辑计算等的语句,即除变量定义语句、复合语句、函数语句外实现语言定义的计算的其它语句)。
把高级语言中的基本语句看作是一个计算单元,计算单元包含计算的输入和输出两个部分,高级语言通过语句将一个小的计算单元编制成一个大的计算单元;而在高级语言组织函数时,需要先确定数据区,为数据区的每个存储起名(即:定义变量名),而语句是通过引用数据区的变量名表示对数据区中的数据的计算,故高级语言是通过描述每个语句和数据区存储的关系组织计算,而不是通过描述每个语句之间的交互关系组织计算,每个语句之间是不存在直接关系的。也就是说,现有技术中所提到的软件模块化,其实是将实现一定功能的多条语句封装成一个软件模块,即通过先定义数据,然后表示小计算和数据的关系组织大计算的方式,本质上不是模块化的组织方式,不能彻底实现模块化的主要原因是高级语言中包含语句和数据区的函数结构的实现方式。
本公开至少一个实施例提供一种通过嵌套使用组合范式来构造组合函数块的方法、构造组合函数块的装置、组合函数块、非瞬时性计算机可读存储介质。该通过嵌套使用组合范式来构造组合函数块的方法应用于函数块库,该函数块库包括多个函数块,该方法包括:从多个组合范式中选择至少一个组合范式;获取对多个函数块中的至少两个函数块的排列操作,得到计算序列;基于计算序列,进行拼接操作确定至少两个函数块之间的连接关系;基于至少两个函数块中每个函数块的接口以及至少两个函数块之间的连接关系,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口。多个函数块中的每个函数块包括与该函数块对应的接口对应的至少一个输入数据项和至少一个输出数据项,至少一个输入数据项和至少一个输出数据项在该函数块中以存储的形式存在,拼接操作包括将至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。
本公开提供的构造组合函数块的方法解决了使用现有高级语言实现软件所产生的模块化和抽象不彻底的问题。在本公开实施例提供的构造组合函数块的方法中,通过组织小的函数块之间的计算交互关系形成较大的组合函数块,能够实现软件结构的100%模块化,在组合过程中只需要考虑逻辑实现,不再需要非模块化的语句层的开发行为,同时也实现了算法的抽象化,解决了使用现有高级语言实现软件所产生的模块化和抽象不彻底的问题。
在该方法中,不再描述语句与数据之间的关系,而是通过描述各个函数块之间的关 系,把数据项以存储的形式附载在函数块上使得计算间的关系描述可以转换为输入输出存储间的关系的描述;利用连线的方式使函数块与函数块之间建立联系,构建实现一定功能的算法程序,即组合函数块,从根本上实现了模块化,因为每个函数块都带有各自的存储,不需要定义变量,每个变量也不再具有实际的含义,从本质上实现了算法的高度抽象化和规范化,可移植性高,因为变量不具有实际的含义,从而打破了不同行业之间的代码墙。
在本公开的一个实施中,高级语言的基本计算(例如赋值表达式、条件表达式、算术表达式、逻辑表达式等)按被计算的数据的类型进行细分,对每个细分的基本语句附载上和其数据的类型相匹配的输入输出存储,例如,把加法语句细分为两个整数类型的存储的值相加输出到另一个整数类型的存储,两个浮点类型的存储的值相加输出到另一个浮点类型的存储,等等。对所有基本语句进行类似的处理,则可以得到多个对多种基本数据类型的数据项的基本计算。例如,在一些实施例中,基本计算的数量可以为67,基本数据类型的数量可以为10,但本公开不限于此,基本计算的数量和基本数据类型的数量可以根据实际情况确定。把存储附载在函数块上使得函数块之间的关系描述可以转换为函数块的输入输出存储之间的关系的描述,从而实现模块化。
在本公开中,如果把函数块(基本函数块和组合函数块)看作芯片,类型存储(输入数据项和输出数据项)看作芯片(带类型的)的管脚,在本公开提供的方法中,函数块的组合操作变成了与硬件设计雷同的连接管脚的操作,因而可以实现函数块的可视化设计。可视化操作不涉及给存储起名,所以可视化的函数块(即,计算)表示是抽象的。可视化的类似硬件的组织逻辑使得抽象计算更容易理解。
图1为本公开一些实施例提供的一种构造组合函数块的方法的示意图。
例如,函数块库包括多个函数块。例如,多个函数块包括多个基本函数块和多个组合函数块。多个基本函数块表示组成任一组合函数块的最小单位,也就是说,在本公开中,基本函数块是最小的函数块,不能再分割。在多个基本函数块上附加上存储(即数据项),然后将多个基本函数块和/或组合函数块进行组合以得到新的组合函数块,在函数块库中,所有的组合函数块都是由这些最小的基本函数块组成的。任一组合函数块最终可以被拆分为多个基本函数块,例如,对于任一组合函数块A,该组合函数块A由一个组合函数块B和一个基本函数块C1组成,该组合函数块B由两个基本函数块C2和C3组成,也就是说,实际上,该组合函数块A是由三个基本函数块(即基本函数块C1、C2和C3)构成的。
例如,每个组合函数块由至少一个基本函数块和/或至少一个组合函数块组成。
如图1所示,构造组合函数块的方法包括以下步骤S10至步骤S13。
步骤S10:从多个组合范式中选择至少一个组合范式;
步骤S11:获取对多个函数块中的至少两个函数块的排列操作,得到计算序列;
步骤S12:基于计算序列,进行拼接操作确定至少两个函数块之间的连接关系;
步骤S13:基于至少两个函数块中每个函数块的接口以及至少两个函数块之间的连接关系,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口。
本公开提供的构造组合函数块的方法具有以下特点:
1、支持可视化操作,直观,方便,易学。
2、算法和应用分离,形成公共的统一的算法表示空间,为全行业间的100%算法共 享建立了理论基础。
3、标准化的规范产出,例如,通过可视化操作,生成python代码。
4、组合函数块能够实现高度抽象化,可移植性高;
5、不需要再进行任何语句的编写,符号语言(例如,可扩展标记语言(XML))在构建组合函数块时自动形成。
例如,多个函数块中的每个函数块包括与该函数块对应的接口对应的至少一个输入数据项和至少一个输出数据项,至少一个输入数据项和至少一个输出数据项在该函数块中以存储的形式存在,也就是说,输入数据项和输出数据项具有数据类型,且无需指定变量名称,即至少一个输入数据项和所述至少一个输出数据项无需指定变量名称。
例如,在步骤S11中,排列操作可以表示至少两个函数块的排列顺序、排列位置等信息。排列操作可以基于需要组合得到的组合函数块的计算功能确定的。
例如,在步骤S12中,拼接操作包括将至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。
在获取至少两个函数块的拼接操作的过程中,即可确定至少两个函数块之间的连接关系。
组合函数块是由多个函数块拼接组合得到的,多个函数块之间的连接方式决定了构造的组合函数块的计算功能。也就是,组合函数块的输入输出数据项(即输入输出参数)可以由多个函数块的输入数据项和输出数据项和多个函数块的输入数据项和输出数据项之间的连接关系生成,基于这个原则实现小函数块到大函数块(即组合函数块)的形成过程,这个原则可以被称为组合形成原则。
例如,计算(即函数块)的基本组合方式是:如果一个计算的输出数据项的数据类型属性和另一计算的输入数据项的数据类型属性(后续将会描述)满足类型匹配规则(后续将会描述),则可以把两个数据项(即存储)进行连线,形成两个计算的组合。组合形成的新计算(组合函数块)的输入输出数据项可以根据该两个计算的输入输出数据项和该两个计算的连接关系生成。
例如,如图2A所示,计算A1包括三个输入数据项t11、t12和t13,以及两个输出数据项t14和t15,计算A2包括两个输入数据项t14和t16,以及两个输出数据项t17和t18。例如,计算A1的输出数据项t14的数据类型属性和计算A2的输入数据项t14的数据类型属性匹配(例如,计算A1的输出数据项t14的数据类型属性和计算A2的输入数据项t14的数据类型属性相同),从而,如图2B所示,计算A1的输出数据项t14和计算A2的输入数据项t14可以连线,由此得到图2C所示的组合形成的新计算A3,例如,如图2C所示,新计算A3可以包括计算A1和计算A2,在新计算A3的内部,计算A1的输出数据项t14和计算A2的输入数据项t14彼此连线,新计算A3的输入输出数据项可以根据计算A1和计算A2的输入输出数据项和计算A1和计算A2的连接关系生成,如图2D所示,计算A3包括四个输入数据项t11、t12、t13和t16,以及三个输出数据项t15、t17和t18,计算A1的输出数据项t14和计算A2的输入数据项t14在内部进行了连线,由此,计算A1的输出数据项t14和计算A2的输入数据项t14不作为计算A3的输入输出数据项。
例如,在一些实施例中,在步骤S11中,拼接操作按照以下步骤顺序执行:按照多个组合范式中的至少一个组合范式,对至少两个函数块进行组合;对组合后的至少两个 函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。
例如,在另一些实施例中,在步骤S11中,拼接操作按照以下步骤顺序执行:将至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接;按照多个组合范式中的至少一个组合范式,对连接数据项之后的至少两个函数块进行组合。
基于该至少两个函数块可以得到与该至少两个函数块对应的计算序列。
在本公开的实施例中,函数块的组合过程是一个循环递归的过程,依据确定的且唯一的连线规则,遵循类型匹配规则,选择组合多个函数块的组合范式,随着组合范式的嵌套使用,最终形成各种功能的组合函数。例如,函数块循环递归生成,数据类型是函数块的一部分,也同时循环递归生成。
在本公开中,组合多个函数块的组合规则的连接规则为:将一个函数块的输出数据项或子数据项按一对多连接到其他算法类型相同的输入或输出数据项或子数据项。
例如,在本公开的实施例提供的方法中,针对函数块的操作方式(即组合范式)包括4种,即上述多个组合范式包括4种组合范式,针对存储的操作方式遵循数据传递连线规则,数据传递连线规则是4种组合范式组织函数块的过程中都必须遵循,并且都是由输出数据项发出的连线。在函数块的组织过程中,考虑技术及实用方面,增加了一种实用连线规则。数据传递连线规则包括数据传递连线,数据传递连线是有向线段,从一个数据项开始,到另一个数据项结束。实用连线规则包括辅助合并连线,辅助合并连线是无向线段,辅助合并连线的两端连接两个数据项。数据传递连线包括输出到输出的数据传递连线(简称输出输出连线)和输出到输入的数据传递连线(简称输出输入连线),输出输出连线用于连接至少两个输出数据项,输出输入连线用于连接至少一个输入数据项和至少一个输出数据项;辅助合并连线表示多个输入数据项之间进行连接的线。辅助合并连线的意义等同于在外部对存在辅助合并连线的输入数据项存储被数据传递连线连接到同一个输出项上。
多个组合范式和连线规则(数据传递连线规则和实用连线规则)共同施加于函数块,从而能够实现由小函数块构造大函数块。4种针对函数块的操作方式(即四种组合范式:顺序组合范式、条件组合范式(if组合范式)、循环组合范式(for组合范式)、当型循环组合范式(while组合范式))和2种针对存储的操作方式(即数据传递连线和辅助合并连线)在组合规则的基础上能够反复嵌套作用于基本函数块和构造出的组合函数块,从而产生更多的组合函数块。由组合规则构造而成的函数块均叫作组合函数块,使用符号PF表示。基本函数块和组合函数块都属于函数块库集合。
函数的组合,可以由图形化操作加某种语言存储数据(本公开中以XML为例)实现,使用者使用图形可视化操作,简单便捷,易于理解。函数的组合也可以单独由XML语言实现。
例如,多个组合范式包括顺序组合范式、条件组合范式(if组合范式)、循环组合范式(for组合范式)、当型循环组合范式(while组合范式)。这些组合范式可以实现将小函数块组合成大函数块的过程。if组合范式是将true函数块和false函数块组合成一个组合函数块并形成组合函数块的输入数据项和输出数据项。while组合范式和for组合范式是将条件函数块和循环体函数块(例如,循环体函数块可能会运行多次)进行组合以形成一个组合函数块并形成该组合函数块的输入数据项和输出数据项。顺序组合范式是将执行顺序确定好的多个函数块组合成一个组合函数块并形成该组合函数块的输入数 据项和输出数据项。例如,顺序组合范式、if组合范式、while组合范式和for组合范式的结构框架是固定的。
需要说明的是,顺序组合范式、if组合范式、while组合范式为基本范式,for组合范式为附加的组合范式,以便于进行函数块的组合。
例如,在步骤S13中,当至少一个组合范式为顺序组合范式,组合得到的组合函数块为顺序结构的组合函数块;当至少一个组合范式为条件组合范式,组合得到的组合函数块为条件结构(if结构)的组合函数块;当至少一个组合范式为循环组合范式,组合得到的组合函数块为循环结构(for结构)的组合函数块,当至少一个组合范式为当型循环组合范式,组合得到的组合函数块为当型循环结构(while结构)的组合函数块。
例如,在一些实施例中,本公开实施例提供的方法还包括:将组合函数块作为函数块存储在函数块库中,以扩展函数块库。通过函数块库中的函数块组合得到的组合函数块可以被用作函数块以生成新的组合函数块。也就是说,在本公开的实施例中,利用多个函数块的组织成相应的组合函数块,然后可以将组合得到的组合函数块再用于其他组合函数块的组织,以形成新的组合函数块,该新的组合函数块可以被再次应用于下一层组合函数块的组织,依次一层一层组织和嵌套,最终实现具有相应功能的组合函数块,即实现最终的软件设计。
每个组合范式包括三个部分,分别为范式组合区、大函数接口区、大函数接口类型和小函数接口类型关系区,大函数的接口的数据项的数据类型是由范式组合区中的所有数据项的数据类型和/或将范式组合区中的所有数据项的数据类型进行打散并重新组合得到数据类型组成的集合的子集,数据类型/接口不独立存在,不需要独立设计,由组合范式产生,实现存算一体。范式组合区又包括小函数块区和组合动作区,小函数块区由用户从函数块库选择的至少一个函数块的接口构成,组合动作区记录用户对小函数块区中的函数块的拼接动作;大函数接口区由组合范式在范式组合区完成后自动生成,包含输入部分和输出部分,输入部分的数据项是小函数块区的所有输入数据项和/或小函数块区的所有输入数据项被打散并重新组合得到的数据项组成的集合的子集,输出部分的数据项是小函数块区的所有输出数据项和/或小函数块区的所有输出数据项被打散并重新组合得到的数据项组成的集合的子集,所有组合范式生成的大函数接口区遵循相同的函数接口规范;大函数接口类型和小函数接口类型关系区记录组合范式生成的大函数接口区与小函数块区的函数接口之间的数据项关系,该大函数接口类型和小函数接口类型关系区也是由组合范式在范式组合区完成后自动生成。
现有技术在进行算法编程时,一般采用自上而下的方式,构思整个算法,先设计算法的接口部分,以变量名方式定义各个数据项,然后在算法内部进行算法语句编写,语句引用所定义的变量表示对变量的计算。编写过程中,反复确认算法过程与算法接口间的引用关系,算法编写过程中,一般同时产生算法内的局部变量,编写过程中反复确认算法语句与局部变量、局部变量与接口定义变量间的关系,整个过程完全人工操作。本申请采用自下而上的方式,构思算法的过程就是人工选择组合范式、选择存算一体的函数块以及函数块之间的拼接连线动作,完成算法逻辑的同时,自动生成函数接口、函数接口与内部函数块的数据项的关系,不需要人工编写和确认局部变量、接口变量以及各变量与算法的关系。
例如,多个函数块中的每个函数块具有其对应的计算功能,本公开实施例提供的方 法还包括:基于至少两个函数块的计算功能和连接关系来确定组合函数块的计算功能。
例如,多个基本函数块中的每个基本函数块具有其对应的计算功能,每个组合函数块的计算功能为基于至少一个基本函数块和/或至少一个组合函数块的计算功能和连接关系来确定每个组合函数块的计算功能。即在本公开中,每个组合函数块的计算功能可以基于组合该组合函数块的多个函数块的计算功能和连接关系确定。也就是说,在本公开中,可以根据已知算法(至少两个函数块的计算功能)和已知算法之间的作用关系(至少两个函数块的连接关系)而得到所形成的组合算法(组合函数块)的输入(组合函数块的接口的输入部分)和输出(组合函数块的接口的输出部分)关系。需要说明的是,相同的计算序列中的多个函数块进行不同的连接,则可以表达不同的计算功能。
例如,在本公开的实施例中,组合具有相应的计算功能的组合函数块的过程包括:根据相应的计算功能的要求,可以确定需要实现该相应的计算功能所需的函数块和组合范式,然后可以从函数块库中选择所需的多个函数块,该多个函数块可以包括基本函数块,也可以包括组合函数块。然后,基于相应的计算功能和组合范式,可以确定该选择的多个函数块的执行顺序和排列位置等,即对多个函数块进行组合,从而得到该多个函数块对应的计算序列;然后,对该计算序列进行拼接连线操作,从而得到中间组合函数块;判断中间组合函数块是否实现相应的计算功能,响应于中间组合函数块实现相应的计算功能,将中间组合函数块作为与相应的计算功能对应的组合函数块;响应于中间组合函数块不能实现相应的计算功能,继续从函数块库中选取函数块进行组合,直到组合得到的中间组合函数块能够实现相应的计算功能,将中间组合函数块作为实现待设计功能的组合函数块,由此实现组合得到实现相应的计算功能的组合函数块。该组合函数块可以被存储在函数块库中,以进行后续的组合。如此反复,函数块库中实现特定算法功能的函数块会越来越多,当要组合的函数块中所包含的各个函数块都存在于函数块库中时,直接使用相应的函数块来进行组合即可。
例如,多个函数块中的每个函数块(基本函数块和组合函数块)可以通过图形化的形式呈现,图形化可以简单、方便、直观地向用户呈现该函数块。在计算机后台,图形化的形式对应有符号语言。也就是说,在本公开中,每个函数块可以具有二维的表现形式,即两种形式化方式,分别为图像化和对应的符号语言,从而丰富函数块的表现形式,基于图形化的表达形式可以实现可视化操作。该两种表现形式都能够独立完整的表达函数块的语法和编程过程。用户可以通过对函数块对应的图形进行可视化操作,简单便捷且易于理解,或者,也可以通过对函数块对应的符号语言进行编辑,从而实现对该函数块进行操作。
例如,在本公开中,每个数据项(输入数据项和输出数据项)也可以具有图形化和符号语言两种表现形式。
例如,在一些实施例中,符号语言包括可扩展标记语言(XML)和json(JavaScript Object Notation,JS对象简谱)。在本公开下面的描述中,以XML和json描述各个函数块为例进行说明,但本公开包括但不限于此。
此外,在本公开的实施例中,可以给函数块和/或函数块的每个存储(输入数据项和输出数据项等)起(应用)名,这个行为被称为具体化。这些名称不介入函数块的组织行为,只是作为注释,增加函数块及其输入数据项和输出数据项的可读性。如果将组合得到的组合函数块编译成高级语言,有些名称会成为变量名称。如果将组合得到的组合 函数块编译成机器码这些名称不被使用。此外,组合函数块的符号表示是用来存储可视化设计的结果和为编译器提供输入。用户可以不需要操作组合式语言的符号表示。
例如,对于多个函数块中的每个函数块,该函数块对应的接口包括输入部分和输出部分,该函数块对应的接口的输入部分对应该函数块的至少一个输入数据项,该函数块对应的接口的输出部分对应该函数块的至少一个输出数据项。也就是说,在本公开的实施例中,每个函数块对应一个接口,该接口包括输入部分和输出部分,输入部分对应至少一个输入数据项,输出部分对应至少一个输出数据项。在一些实施例中,每个接口的输入部分中的各个输入数据项可以组合成一个组合数据类型的输入数据项,每个接口的输出部分中的各个输出数据项可以组合成一个组合数据类型的输出数据项。
例如,至少一个输入数据项和至少一个输出数据项每个包括数据类型属性、数据类别属性、存储类型属性、值属性、物理地址属性、相对地址属性和名称属性等等。
需要说明的是,在本公开中,输入数据项和输出数据项可以被统称为数据项,根据数据项所在的位置,则该数据项可以为输入数据项或输出数据项,例如,若一个数据项处于函数块对应的接口的输入部分,则该数据项为输入数据项;若一个数据项处于函数块对应的接口的输出部分,则该数据项为输出数据项。例如,在本公开中,数据项具有存储功能。
例如,名称属性(id属性)用于对名称属性对应的数据项进行注释说明,且不参与对名称属性对应的数据项所属的函数块的拼接操作。本公开提供的技术方案可以实现抽象算法设计,即本公开提供的函数块的组合过程不涉及变量名称,是抽象算法表示和设计,是所有不同应用公共的算法表示和设计方式,从而实现不同应用之间的算法共享。应用的体现是在数据项的id属性,id属性的值可以是应用名称以方便以应用的概念描述算法,但id属性不介入算法设计和运行,只作为注释。如果需要将每个函数块对应的可扩展标记语言编译为传统的高级语言,名称属性被编译为高级语言中的变量名称。数据项的相对地址由算法自动处理。
例如,物理地址属性(name属性)用于表示算法(基于函数块确定的算法)实际运行时该数据项所在的物理地址。
例如,相对地址属性用于表示数据项的顺序编码值,且可以由算法自动计算得到。在数据项的XML表达形式中,可以不体现相对地址属性。
例如,数据类别属性包括基本数据类型、组合数据类型、指针类型和泛型,组合数据类型又包含基本组合数据类型、异或类型、数组类型等,指针类型包括通用指针类型和非通用指针类型,通用指针类型的数据项不具有具体指向的数据项,即该通用指针类型的数据项的指向为空,非通用指针类型的数据项具有具体指向的数据项。数据类型属性指数据项的类型,存储类型属性包括虚拟存储和真实存储。例如,在一些实施例中,在可扩展标记语言(XML)架构中,存储类型属性可以表示为memory,当memory为1时,则表示真实存储,当memory为0时,则表示虚拟存储,默认情况下memory为1,memory可以由拼接动作决定。例如,在一些实施例中,在图形化中,若数据项的存储类型属性为真实存储,则表示该数据项的圆为实心圆;若数据项的存储类型属性为虚拟存储,则表示该数据项的圆为空心圆。需要说明的是,在图形化中,本公开不限于采用圆表示数据项,还可以采用矩形、菱形等表示数据项。在本公开的说明中,以在图形化中采用圆表示数据项为例描述本公开的实施例。
需要说明的是,在下面的描述中,为了便于描述,若数据项的数据类别属性为组合数据类型,则该数据项可以被称为组合数据项;若数据项的数据类别属性为基本数据类型,则该数据项可以被称为基本数据项;若数据项的数据类别属性为指针类型,该数据项可以被称为指针数据项;若数据项的数据类别属性为泛型,该数据项可以被称为泛型数据项。
例如,对于数据类别属性为组合数据类型的数据项(该数据项可以为输入数据项或输出数据项),组合数据类型的数据项包括数据类别属性为基本数据类型的多个数据项,或者,包括数据类别属性为组合数据类型的多个数据项,或者,包括数据类别属性为指针类型的多个数据项,或者,包括数据类别属性为泛型的多个数据项,或者,该组合数据类型的数据项包括的数据项的数据类别属性至少为以下数据类别属性的至少两种:基本数据类型、组合数据类型、指针类型和泛型。也就是说,组合数据类型的数据项是由一个或多个基本数据类型的数据项和/或一个或多个组合数据类型的数据项一个或多个指针类型的数据项和/或一个或多个泛型的数据项组合而成的。
例如,数据类别属性为基本数据类型的数据项、数据类别属性为组合数据类型的数据项、数据类别属性为指针类型的数据项和数据类别属性为泛型的数据项的结构格式是相同且规范的,数据类别属性为组合数据类型的数据项的结构是一个嵌套结构,嵌套结构的每一层数据项的结构格式相同。
例如,基本数据类型包括但不限于字节数据类型(byte)、短整型(short)、整型(int)、长整型(long)、单精度浮点型(float)、双精度浮点型(double)、布尔型(boolean)、字符类型(char)、字符串类型(string)。需要说明的是,基本数据类型不限于上面的数据类型,可以选择高级语言的基本数据类型,也可以只选择比特(bit,0、1)等,为了实用,可以选择与高级语言对应的基本数据类型。需要说明的是,基本数据类型还可以包括常量类型,常量类型的数据项具有具体的常量数值。
基本数据类型之外还有指针类型(ref)和泛型(*),指针类型的数据项表示存储在实际运行时的物理地址,泛型的数据项是对不确定数据类型的表示,它可以表示任意数据类型。
数据项存储的表示形式可以有多种,比如xml、json或者有特定规则的任何格式,表示如下:
例如,某个数据项(输入数据项或输出数据项)的XML表达形式可以为如下所示:<type id=""name=""value=""typeclass=""typevalue=""typeid=""memory=""/>。
其中,id表示该数据项的注释说明名称(即具体化名称),表示该数据项在该数据项对应的数据结构中的含义,可由用户具体化命名,不参与函数块的组织计算;name用于表示算法(基于函数块确定的算法)实际运行时该数据项所在的物理地址,数据项的相对位置由xml结构决定;value表示该数据项的值属性,对于组合数据类型的数据项的value由组合数据类型的数据项的内部的数据项的value共同决定;typeclass表示该数据项的数据类别属性;typevalue表示数据类型属性,即该数据项的实际数据类型,比如int、char等基本数据类型,int2等组合数据类型;typeid表示用户自定义的数据类型名,也就是说,在本申请中,用户可以自定义一些数据类型,在一些实施例中,typeid和typevalue可以相同;memory表示该数据项的存储类型,memory的值为0,则表示该数据项为虚拟存储,memory的值为1,则表示该数据项为真实存储。例如,typeclass可以采用数字 表示,当typeclass为0时,其表示基本数据类型;当typeclass为1时,其表示基本组合数据类型;当typeclass为2时,其表示该数据结构为数组类型;当typeclass为3时,其表示异或类型;当typeclass为4时,其表示指针类型ref;当typeclass为5时,其表示泛型。需要说明的是,基本组合数据类型、数组类型和异或类型均为组合数据类型,基本组合数据类型的数据项可以为由基本数据类型、指针类型、泛型组成,例如,由两个int类型的数据项组合得到一个数据项int2,该数据项int2的类型为基本组合数据类型。例如,由一个char类型和一个指针类型的数据项组合得到一个数据项charref,该数据项charref的类型为基本组合数据类型。指针类型ref和泛型既不属于基本数据类型,也不属于组合数据类型。
只有id、typeid、基本数据类型的数据项的value可以由用户进行设置,所以只提供这三个属性(即id、typeid、基本数据类型的数据项的value)设置相关的图形化表示,从而用户可以在图形化表示中修改或设置上述三个属性。
例如,下面示出了一些基本数据类型的数据项的XML架构:
<type id=""name=""value=""typeclass="0"typevalue="byte"typeid="byte"/>
<type id=""name=""value=""typeclass="0"typevalue="short"typeid="short"/>
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
<type id=""name=""value=""typeclass="0"typevalue="long"typeid="long"/>
<type id=""name=""value=""typeclass="0"typevalue="float"typeid="float"/>
<type id=""name=""value=""typeclass="0"typevalue="double"typeid="double"/>
<type id=""name=""value=""typeclass="0"typevalue="boolean"typeid="boolean"/>
<type id=""name=""value=""typeclass="0"typevalue="char"typeid="char"/>
<type id=""name=""value=""typeclass="0"typevalue="string"typeid="string"/>
例如,下面示出了指针类型和泛型的数据项的XML架构:
<type id=""name=""value=""typeclass="4"typevalue="ref"typeid="ref"/>
<type id=""name=""value=""typeclass="5"typevalue="*"typeid="*"/>
例如,若指针类型的数据项具有指向的数据项,则指针类型的数据项的typevalue为符号“&”在加上指针类型的数据项所指向的数据项的数据类型,例如一个指向int2类型的数据项的指针,该指针数据项的typevalue为&int2。若指针类型的数据项没有指向任何数据项,该指针类型的数据项为通用指针类型的数据项,通用指针类型的数据项的内部结构为空,不包含任何其他数据描述。若数据项的数据类型为指针类型,又指向其他数据项,该指针类型的数据项为非通用指针类型的数据项,则该非通用指针类型的数据项内部包含其他数据项的描述,其他数据项可以是基本数据类型、基本组合数据类型、数组类型和异或类型。例如,若某个指针类型的数据项指向的数据项为整型类型的数据项,则该指针类型的数据项为非通用指针类型的数据项,该非通用指针类型的数据项的XML描述:
<type id=""name=""value=""typeclass="4"typevalue="&int"typeid="ref">
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>。
例如,基本数据类型、指针类型、泛型的数据项可以组合成组合数据类型的数据项。组合数据类型的数据项还可以进一步与其他数据项(组合数据类型的数据项、基本数据 类型的数据项、指针类型或者泛型)进行组合以得到新的组合数据类型的数据项。例如,在本公开的实施例中,基本数据类型的数据项具有基本数据结构,组合数据类型的数据项具有组合数据结构,即组合数据类型的数据项的数据结构被称为组合数据结构,基本数据类型的数据项的数据结构被称为基本数据结构,通用指针类型的数据项和泛型数据项(即其数据类别属性为泛型)具有与基本数据结构一致的数据结构,非通用指针类型的数据项具有与组合数据结构一致的数据结构。
数据项的JSON表达形式如下所示:
Figure PCTCN2022125382-appb-000001
标签代表属性与XML格式相同。例如,在JSON表达形式中,"name"用于表示算法(基于函数块确定的算法)实际运行时该数据项所在的物理地址。数据项在该数据项对应的数据结构中的相对地址属性可以由算法自动计算,且可以不体现在数据项的JSON表达形式。
数据项的其他具有特定规则的格式表示,例如,如下:
<"","","","","","",""/>
规定尖括号<>中的7个属性值按顺序排列,按照顺序代表XML中id、name、value、typeclass、typevalue、typeid、memory对应的值。
数据项以及后面出现的所有新的概念的格式表示均具有多种表示形式,本实施例中均以xml形式表示,但本公开不限于此。
如果数据项是非通用指针类型,即typeclass=4并且内部包含其他数据项,可以对该数据项进行展开动作,展开动作对该数据项及其内部包含的数据项的数据类型属性、数据类别属性没有影响。如果指针数据项内部包含的数据项也是组合数据类型(基本组合数据类型、异或类型、数组类型)或者非通用指针类型的数据项,可对内部包含的数据项继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型、通用指针类型、泛型。
图3A为本公开一些实施例提供的一种数据项的图形化的表达形式的示意图;图3B为本公开一些实施例提供的一种整型的数据项的图形化的表达形式的示意图。
例如,图3A示出了一个数据项id的图形化表达形式,如图3A所示,一个实心圆可以表示一个基本数据类型的数据项,即存储。变量名称id表示该数据项的注释说明名称;该数据项的属性可以包括:数据类型属性、是否为常量(常量数据的value是确定的值,并且在其后的运算中不能对它进行修改,若为常量,还有常量值属性)等。
例如,在一些示例中,图3B示出了一个int型数据项a的图形化表达形式,该数据项a的XML架构表示为:
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid="int"/>。
该数据项a的JSON表示为:
Figure PCTCN2022125382-appb-000002
例如,常量数据项a的XML架构表示为:
<type id="a"name=""value="1"typeclass="0"typevalue="int"typeid="int"/>。
其中,value=1,则表示该常量数据项a的值为1。
例如,在图形化表达形式中,可以采用蓝色的实心圆表示非常量的数据项,可以采用黄色的实心圆表示常量数据项。
常量数据项a的其他表示形式可以为:
<"a","","1","0","int","int",""/>
例如,两个int类型的数据项分别为IdName1和IdName2。该两个int类型的数据项组合得到组合数据项int2,组合数据项int2的XML架构表示为(需要说明的是,int2类型的数据项只存在于基本函数块中):
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="int2">
<type id="IdName1"name=""value=""typeclass="0"typevalue="int"typeid="int"/>
<type id="IdName2"name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>。
例如,在函数块的组合过程中按照组合规则形成的输入输出数据项,在基本数据类型、指针类型和泛型范围以外的是组合数据类型,组合数据类型的数据项(即组合数据项)是组合函数块的接口中输入输出数据项的有序集合,在组合函数块中可展开至基本数据类型、通用指针类型、泛型的数据项。
例如,组合数据项为在函数块的组合过程中按照组合规则形成的数据项(输入数据项和输出数据项),组合数据项可以表示组合函数块的接口中的输入数据项的有序集合和输出数据项的有序集合。
例如,在一些示例中,一个组合数据类型的数据项(即组合数据项)的XML表示为:
<type id="(int2)int"name=""value=""typeclass="1"typevalue="(int2)int"typeid="(int2)int">
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="int2">
<type id="11"name=""value=""typeclass="0"typevalue="int"typeid="int"/>
<type id="12"name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>
<type id="21"name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>
例如,该组合数据项的嵌套结构能够表示该组合数据项在数据结构中的相对位置,数据项的相对位置的生成规则包括:在同层数据结构中,相对位置值的取值从0开始编码,按整数顺序递增。例如,上述XML中,对于组合数据类型的数据项(int2)int,数据项int2和数据项21为数据项(int2)int的同一层数据结构中的两个数据项,数据类型属性为int2的数据项int2是在组合数据项(int2)int的数据结构中的第一个数据项,因此,数据项int2的相对位置值为0,数据项21是在组合数据项(int2)int的数据结构中的第二个数据项,因此,数据项21的相对位置值为1;对于数据项int2,数据项11是数据项int2的第一个数据项,数据项11的相对位置值为0,数据项12是数据项int2的第二个数据项,数据项12的相对位置值为1,以此类推,每一层数据结构的相对位置编码规则相同。相对位置不需要使用属性符号描述,它由数据项的结构决定,可由算法根据相对位置编码规则自动计算和获取。
例如,数据项的定位包括:对数据项x的定位,从该数据项所在的组合数据项的组合数据结构的最外层开始,沿着数据项x在该组合数据结构中的路径,使用相对位置值加上“.”的方式进行表达。例如,上述XML中,数据项12的定位从最外层的数据项(int2)int开始,沿着数据项(int2)int到数据项int2的路径进行遍历并使用相对位置值,从而得到数据项12在该数据结构中的相对路径为0.0.1,其中,在该相对路径0.0.1中的第一个0表示数据项(int2)int的相对位置值,在该相对路径0.0.1中的第二个0表示数据项int2的相对位置值,在该相对路径0.0.1中的1表示数据项12的相对位置值;类似地,数据项int2的相对路径为0.1;数据项(int2)int的相对路径为0。需要说明的是,由于数据项11和数据项12为同一层的数据项,因此,数据项11的相对位置值并不被包含在数据项12的相对路径中。
例如,组合数据项中typevalue的值可以省略表示,当使用typevalue属性时,基本组合数据类型的数据项中的typevalue(即类型标签)的命名规则包括:对于基本函数块中的组合数据结构的数据项,数据项的typevalue由该数据项内部包含的基本数据类型、指针类型、泛型组成。数据项的typevalue的表示形式为:(基本数据类型、指针类型、泛型)+数量。例如,int类型的加法函数块的接口的输入部分由两个int类型的输入数据项组成,即组合得到的组合数据项的数据类型属性表示为int2,例如,该输入部分的XML表示为:
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="int2">
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>
例如,基本组合数据类型的数据项中的typevalue的命名规则还包括:对于组合函数块中的组合数据结构的数据项,数据项的typevalue由该数据项内部包含的组合数据类型或基本数据类型或指针类型或泛型组成。数据项的typevalue的表示形式:基本数据类型/指针类型/泛型1+(组合数据类型1)+......;其中,()表示组合数据类型。
例如,组合数据结构的数据项T的XML表示为:
<type id=""name=""value=""typeclass=""typevalue="T"typeid="">
<type id=""name=""value=""typeclass=""typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass=""typevalue="t2"typeid=""/>......
<type id=""name=""value=""typeclass=""typevalue="tn"typeid=""/>
</type>
如上面XML所示,假定基本组合数据结构的数据项T由数据类型属性t1,t2,......,tn构成,则数据项T的实际数据类型属性为t1t2......tn,对于1≤k≤n,如果tk为组合数据类型或非通用指针类型,则在数据项T的实际数据类型属性的命名中,tk由它内部数据项的数据类型属性替代并加括号,按照此规则依次递归直到数据项为基本数据类型、通用指针类型或泛型的数据项。
例如,对于表示函数(a>b)&&c的组合函数块对应的接口的输入部分的XML表示为:<type id=""name=""value=""typeclass="1"typevalue="(int2)(boolean2)"typeid="(int2)(boolean2)">
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="int2">
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>
<type id=""name=""value=""typeclass="1"typevalu="boolean2"typeid="boolean2">
<type id=""name=""value=""typeclass="0"typevalue="boolean"typeid="boolean"/>
<type id=""name=""value=""typeclass="0"typevalue="boolean"typeid="boolean"/></type>
</type>
参见上述XML,该组合函数块包括一个关系表达式的基本函数块和一个逻辑表达式的基本函数块。该输入部分对应的组合数据类型的数据项(int2)(boolean2)的typevalue的表示形式为:(int2)(boolean2)。数据项(int2)(boolean2)由两个组合数据类型的数据项int2和boolean2组成,数据项int2由两个基本数据类型(int)的数据项组成,数据项boolean2由两个基本数据类型(boolean)的数据项组成。需要说明的是,若在经过连线处理之后,数据项boolean2中的一个数据项boolean不被提取作为接口的输入部分,此时,数据项boolean2被打散,将数据项boolean2中的不被提取作为接口的输入部分的数据项则不体现在接口处,将数据项boolean2中的被提取作为接口的输入部分的数据项和数据项int2进行组合以得到输入部分,此时,该输入部分对应的组合数据类型的数据项的typevalue的表示形式为:(int2)boolean。
例如,拼接操作还包括数据项展开规则、类型匹配规则和连线要求规则,对应于数据项展开动作和连线动作(即连线操作),即基于数据项展开规则可以对数据项进行展开动作,基于类型匹配规则和/或连线要求规则,可以对数据项进行连线动作。如果数据项的数据类别属性是基本组合数据类型,即typeclass=1,可以对该数据项进行展开动作,展开动作对该数据项及其内部包含的数据项的数据类型属性、数据类别属性没有影响。如果组合数据项内部包含的数据项也是组合数据类型(基本组合数据类型、异或类型、数组类型)、非通用指针类型,可对内部包含的数据项继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型、通用指针类型或者泛型。
假定数据项d由n个数据项d1,d2,...dn组成,且n个数据项的数据类别分别为tc1,tc2,...tcn,n个数据项的类型分别为t1,t2,...tn,其中,n>1,该数据项d为一个基本组 合数据类型的数据项,假定数据项s由m个数据项s1,s2,...sm组成,且m个数据项的数据类别分别为tcf1,tcf2,...tcfm,n个数据项的类型为tf1,tf2,...tfm,其中,m>1,然后数据项d和数据项s以异或方式进行组合,形成一个异或类型的组合数据项,该异或类型的组合数据项的typeclass为3,异或类型的组合数据项的typevalue为数据项d的typevalue与数据项s的typevalue以xor符号连接在一起形成,该异或类型的组合数据项内部包含数据项d和数据项s,该异或类型的组合数据项对应的xml描述如下:
<type id=""name=""value=""typeclass="3"typevalue="t1t2...tnxortf1tf2...tfm"typeid="">
<type id="d"name=""value=""typeclass="1"typevalue="t1t2...tn"typeid="">
<type id=""name=""value=""typeclass="tc1"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="tc2"typevalue="t2"typeid=""/>
......
<type id=""name=""value=""typeclass="tcn"typevalue="tn"typeid=""/>
</type>
<type id="s"name=""value=""typeclass="1"typevalue="tf1tf2...tfm"typeid="">
<type id=""name=""value=""typeclass="tcf1"typevalue="tf1"typeid=""/>
<type id=""name=""value=""typeclass="tcf2"typevalue="tf2"typeid=""/>
......
<type id=""name=""value=""typeclass="tcfm"typevalue="tfm"typeid=""/>
</type>
</type>
该异或类型的组合数据项内部的数据项d和数据项s可以是基本数据类型、基本组合数据类型、异或类型、数组类型、指针类型、泛型等。需要说明的是,异或类型的数据项具有异或结构。异或类型的数据项的typevalue的值可以省略表示,由算法自动计算得到。
异或类型的组合数据项的图形化表达方式可以为在实心圆(例如,蓝色)中带有‘+’符号(例如,如图9F所示)。例如,一个异或类型的组合数据项由数据项T1和数据项T2异或形成,则该异或类型的组合数据项的XML表示如下:
<type id=""name=""value=""typeclass="3"typevalue="T1xorT2"typeid="">
<type id=""name=""value=""typeclass=""typevalue="T1"typeid=""/>
<type id=""name=""value=""typeclass=""typevalue="T2"typeid=""/>
</type>
上述异或类型的组合数据项的JSON表示为:
Figure PCTCN2022125382-appb-000003
Figure PCTCN2022125382-appb-000004
对于异或类型的组合数据项,即typeclass=3,可以对该异或类型的组合数据项进行展开动作,展开动作对该异或类型的组合数据项及其内部包含的数据项的数据类型属性、数据类别属性没有影响。如果异或类型的组合数据项内部包含的数据项也是组合数据类型(基本组合数据类型、异或类型、数组类型)、非通用指针类型,可对内部包含的数据项继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型、通用指针类型、泛型。
例如,数组数据项a是一个内部包含n个T类型的数据项的数据项,n可以是任意常数,也可以是一个变量,T类型可以是基本数据类型、基本组合数据类型、异或类型、数组类型、指针类型、泛型,对n个T类型的数据项进行简化表示,只给出一个数据项描述即可,数组数据项a的数据类型属性为T[],数据类别属性为2,T[]类型的数组数据项的xml表示如下:
<type id="a"name=""value=""typeclass="2"typevalue="T[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="T"typeid=""/>
</type>
数组类型的数据项的typevalue的值可以省略表示,由算法自动计算得到。
允许对组合数据类型的数组数据项进行展开动作,展开动作对该数组数据项及其内部包含的数据项的数据类型属性、数据类别属性有影响,展开动作的操作过程如下:如果展开后的数据项内部包含的数组数据项也是组合数据类型的数组数据项,可对内部包含的组合数据类型的数组数据项继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型数组或指针类型数组或泛型数组。
假定一个数组数据项T[],该数组数据项T[]的数据类别属性为2,该数组数据项T[] 的数据类型属性为T[],如果T是一个组合数据类型,数组数据项T[]内部包含一个类型为T的组合数据项,该组合数据项内部包含k个数据项,k个数据项的数据类型属性分别为t1、t2、...、tk,则T的数据类别属性可能为1、3(除基本数据类型以外),T的数据类型属性为t1t2...tk,对数组数据项T[]进行展开动作,对k个数据项进行N化,形成k个数组数据项t1[]、t2[]、...tk[],k个数组数据项中的每个数组数据项的数据类别属性为2,同时遵循数据类型的组合规则,数组数据项T[]变成由t1[]、t2[]、...tk[]组合形成的组合数据项D,即取消T[]的N化,组合数据项D的数据类别属性与数组数据项T的数据类别属性相同(可能为1、3),组合数据项D的数据类型属性为t1[]t2[]...tk[]。如果t1、t2、...、tk中存在组合数据类型,可以对该组合数据类型数组继续递归应用展开动作,直到满足下面两个条件,终止展开操作:第一、此时的数据项为基本类型数组,不可展开;第二、满足用户连线操作要求时,可选择不再展开操作。数组逻辑等同变换规则表示:数组数据项T[]可以表示为由t1[]、t2[]、...tk[]组合形成的组合数据项D。
假定一个数组数据项T[],该数组数据项T[]的数据类别属性为2,该数组数据项T[]的数据类型属性为T[],如果T是一个组合数据类型的数组,即T本身是一个数组,该数组内部包含m个数据项t1、t2、...、tm,则T的数据类型属性为(t1t2...tm)[],T的数据类别属性为2,数组数据项T[]的数据类型属性为((t1t2...tm)[])[],对数组数据项T[]进行展开动作需要先对T进行展开,即先对(t1t2...tm)[]数据项进行展开,展开动作如上描述,把(t1t2...tm)[]展开为t1[]t2[]...tm[],此时数组数据项T[]的数据类型属性为(t1[]t2[]...tm[])[],数据类别属性为2,如果t1、t2、...、tm中也存在组合数据类型的数组,则先对t1、t2、...、tm中的组合数据类型的数组进行展开,再对上层数组进行展开动作。
例如,对于数组逻辑等同规则,具体操作表示为:数组结构的展开规则,即针对数组类型的数据项所在的函数块,对于数组类型的数据项可做逻辑等同的展开操作,需按照以下描述操作:假设函数块的当前层的输出数据项为数组类型的数据项,数组类型的数据项的数据类别属性为2,数据类型属性为((t1t2)t3)[],该数组类型的数据项是一个组合数据类型数组,内部包含一个组合数据类型的数据项D1(数据类型属性为t1t2)和一个基本数据类型的数据项D2(数据类型属性为t3),组合数据类型为((t1t2)t3),数据类别属性为1。对于该数组类型的数据项进行展开时,对于该数据项内部包含的数据项D1、D2,逻辑上N化为每个数据项的数组形式,形成数据类型属性为(t1t2)[]和t3[]的两个数组数据项,数组数据项的数据类别属性为2,同时把原数据项T[]进行取消N化操作,根据typevalue的生成规则,生成数据类型属性为(t1t2)[]t3[]以及数据类别属性为1的数据项;对于展开后形成的数据类型属性为(t1t2)[]的数组数据项,可根据用户意愿选择继续展开,对于数据类型属性为t3[]的数据项,因为是基本数据类型的数组,不满足展开条件,不能对该数据类型属性为t3[]的数据项继续展开。对于输入数据项,可以参考上述对于输出数据项的相关说明。数组数据项被展开后,可以按照上述步骤的逆动作进行合并,直到数据项的第一层级。
图3(1)A~3(1)F为本公开一些实施例提供的函数块的接口的存储层级结构图。如图3(1)A是带有基本组合数据类型的数组数据项的函数块,图3(1)A为该函数块的接口在未展开时的存储层级结构图,图3(1)B是对该数组数据项进行展开动作后的形式,图3(1)B为该函数块的接口在展开到第二层的存储层级结构图,图3(1)A是图3(1)B的数组数据项合并后的形式。图3(1)C是带有异或组合数据类型的数组数 据项的函数块,图3(1)D是对该数组数据项进行展开动作后的形式,图3(1)C是图3(1)D的数组数据项合并后的形式。图3(1)E是内部含有数组类型的数据项的函数块,图3(1)F对该数组进行展开动作后的形式,图3(1)E是图3(1)F的数组合并后的形式。需要说明的是,关于图3(1)A~3(1)F所示的存储层级结构图中各个部分的具体含义将在下面进行描述。
例如,对于数据类型属性为((t1t2)t3)[]的数组类型的数据项,其XML表示为:
<type id=""name=""value=""typeclass="2"typevalue="((t1t2)t3)[]"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="((t1t2)t3)"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="t1t2"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t2"typeid=""/>
</type>
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t3"typeid=""/>
</type>
</type>
图10H示出了包括上述数组类型的数据项的函数块的接口的一种存储层级结构图,图10I示出了对上述数组类型的数据项进行第一层展开时的存储层级结构图,图10J示出了对上述数组类型的数据项进行第二层展开时的存储层级结构图。
如图10H所示,在矩形框中,该函数块PF的输入部分一共有一层,输入部分当前显示到第一层,该函数块PF的输出部分一共有三层,输出部分当前显示到第一层。如图10I所示,对该函数块的输出数据项进行第一层展开时的操作为:对输出数据项的第一层的内部类型,逻辑上修改为(t1t2)[]t3[],XML表示为:
<type id=""name=""value=""typeclass="1"typevalue="((t1t2)[]t3[])"typeid="">
<type id=""name=""value=""typeclass="2"typevalue="(t1t2)[]"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="t1t2"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t2"typeid=""/>
</type>
</type>
<type id=""name=""value=""typeclass="2"typevalue="t3[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t3"typeid="">
</type>
</type>
例如,如图10I所示,在矩形框中,该函数块PF的输入部分当前显示到第一层,该函数块PF的输出部分当前显示到第二层。
如图10J所示,对该函数块的输出数据项进行第二层展开时的操作为:对输出数据项的第二层的内部类型,逻辑上修改为t1[]t2[]t3[],XML表示为:
<type id=""name=""value=""typeclass="1"typevalue="((t1[]t2[])t3[])"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="t1[]t2[]"typeid="">
<type id=""name=""value=""typeclass="2"typevalue="t1[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t1"typeid="">
</type>
<type id=""name=""value=""typeclass="2"typevalue="t2[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t2"typeid="">
</type>
</type>
<type id=""name=""value=""typeclass="2"typevalue="t3[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t3"typeid="">
</type>
</type>
例如,如图10J所示,在矩形框中,该函数块PF的输入部分当前显示到第一层,该函数块PF的输出部分当前显示到第三层。
例如,把高级编程语言的各种表达式转换成基本函数块(在XML架构中,基本函数块可以表示为F,组合函数块可以表示为PF),并按照基本数据类型对基本函数块进行细分,则可以形成134个基本函数块。在本公开中,通过有限个(即134个)基本函数块,把具有不同数据类型的数据项附载在基本函数块上,从而在进行组合时,只需考虑算法间的连接(线)不再需要进行存储设计。需要说明的是,基本函数块的数据项的数据类型是基本数据类型或者基本组合数据类型或者通用指针类型或者泛型。
需要说明的是,对于基本函数块,可以使用name(不使用value)标识不同的基本函数块,比如,可以定义name的值为0的基本函数块是expaddI(后续将描述,expaddI表示int类型的加法函数块),name的值为1的基本函数块是expsubI(后续将描述,expsubI表示int类型的减法函数块)等,只要与函数块库中与其他函数块的name的值不同即可。在每个函数块对应的XML中,F/PF中的name的值表示函数块在函数块库中的相对地址,全局唯一。
例如,基本函数块是组合函数块方法使用的最小函数块,基本函数块可以有多种选择,可以选择一个硬件体系的指令集来构建基本函数块,也可以基于高级语言的基本语句构建基本函数块,本公开的实施例是基于高级语言的基本语句块来说明的,包括但不限于共有6大类,分别为表示关系表达式的基本函数块、表示逻辑表达式的基本函数块、表示算术表达式的基本函数块、表示赋值表达式的基本函数块、表示数据类型转换功能的基本函数块和范式基本函数块。范式基本函数块包括对指针操作的基本函数块,范式基本函数块包括用于获取数据项的地址的基本函数块getname。也就是说,函数块库中的多个基本函数块包括表示关系表达式的基本函数块、表示逻辑表达式的基本函数块、表示算数表达式的基本函数块、表示赋值表达式的基本函数块、表示数据类型转换功能的基本函数块、getname。需要说明的是,基本函数块、基本类型等包括但不限于上述具体情况。
图4A为本公开一些实施例提供的一个基本函数块的接口的图形化的表达形式的示意图,图4B为本公开一些实施例提供的一个基本函数块的接口的存储层级结构图。
例如,基本函数块可以通过图形化和XML进行表示。
例如,基本函数块的表示是以接口的形式存在,图4A示出了一个基本函数块的接口的图形化表示,如图4A所示,id表示基本函数块的名称,由用户定义;位于表示基本函数块id的矩形框的左侧的带箭头的线表示基本函数块的输入引脚,该输入引脚所对应的实心圆(表示真实存储)和空心圆(表示虚拟存储)表示基本函数块的输入数据项,i1表示基本函数块的第i1个输入数据项,i2表示基本函数块的第i2个输入数据项,以此类推,基本函数块的接口的输入部分的全部输入数据项按顺序编码,编码规则为0、1、2、3...,也就是说,例如,i1可以为0,i2可以为1;位于表示基本函数块id的矩形框的右侧的带箭头的线表示基本函数块的输出引脚,该输出引脚所对应的实心圆(或者空心圆)表示基本函数块的输出数据项,j1表示基本函数块的第j1个输出数据项,基本函数块的接口的输出部分的全部输出数据项按顺序编码,编码规则为0、1、2、3...,也就是说,例如,j1可以为0。基本函数块id的矩形框内可以对基本函数块id的相关描述进行注释,例如,可以注释说明该基本函数块可以实现的功能等。基本函数块id的矩形框内还设置有接口调整按钮,在对基本函数块进行组织的过程中,可根据需要点击接口调整按钮,从而展示基本函数块的接口的存储层级结构图,如图4B所示。
在图形化形式表达的存储层级结构图中,对数据项使用树形嵌套结构展示,使用户对数据项的总体结构有更直观的观察,用户可选择某个数据项,例如,点击图4B所示的函数块F对应的存储层级结构图中的操作按钮“+”和“-”进行该函数块F对应的接口中的数据项的展开和合并,存储层级结构图中函数块F的id“F”的左侧数字为该函数块F对应的接口中的输入数据项的总层级数,右侧数字为该函数块F对应的接口中的输出数据项的总层级数。
如图4B所示,在矩形框中,第一行的第一个格子代表输入部分的level(level表示该输入部分对应的输入数据项的组合类型的最大嵌套层级值),第一行的第二个格子表示基本函数块F的id标识,第一行的第三个格子代表输出部分的level(level表示该输出部分对应的输出数据项的组合类型的最大嵌套层级值)。
第二行的第一个格子和第三个格子代表层级递减按钮和递增按钮,通过点击该递减按钮和递增按钮,可以对选中的数据项进行合并或者展开操作,若选中的数据项不包含子数据项,即选中数据项是基本数据类型、通用指针类型或者基本数据类型的数组,选中数据项不能再进行展开,若选中的数据项已经被合并,则对选中数据项再使用合并操作不起作用。
例如,在基本函数块id的图形化表达形式中,该基本函数块id的接口的输入部分的数据项和输出部分的数据项均为默认展示到第2级,若输入部分或者输出部分总层级为1,则只显示到第1级。
图4C为本公开一些实施例提供的一个加法函数块的接口的图形化的表达形式的示意图,图4D(1)为本公开一些实施例提供的一个加法函数块的接口的一种存储层级结构图,图4D(2)为本公开一些实施例提供的一个加法函数块的接口的另一种存储层级结构图。
例如,加法函数块addI的接口的XML架构表示为:
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">-----level1
<type id="1"name=""value=""typeclass="0"typevalue="int"typeid=""/>-----level2
<type id="2"name=""value=""typeclass="0"typevalue="int"typeid=""/>-----level2
</type>
例如,以加法函数块addI对应的接口的输入部分为例,输入部分包括2级,分别为level1和level2,level1对应的输入数据项的数据类型为int2,表示一个组合数据类型的数据项;level2对应的输入数据项的数据类型为int和int,表示两个基本数据类型的数据项。如图4D(1)所示,在一种当前存储层级结构图中,输入部分当前展开到第2级,从而接口的输入部分示出两个输入数据项(int和int),输出部分当前展开到第1级。而当点击图4D(1)所示的结构图中的第二行的第一个‘-’号,表示将输入部分的级别降低1个级别以得到图4D(2)所示结构图,在图4D(2)所示的当前存储层级结构图中,输入部分当前展开到第1级,此时,接口的输入部分仅示出一个输入数据项(int2)。图4D(1)所示的当前存储层级结构图为默认的存储层级结构图。
例如,加法函数块addI的JSON表示为:
Figure PCTCN2022125382-appb-000005
Figure PCTCN2022125382-appb-000006
其中,children为int2数据项的下级数据项。
例如,基本函数块的接口的XML架构表示为:
Figure PCTCN2022125382-appb-000007
如上所示,基本函数块F具有id、name、value三个属性,其中,id表示基本函数块的名称,由用户定义;name表示该基本函数块在函数块库中的全局地址,由计算机按照规则定义,全局地址从0开始顺序编号,name为数字,函数块库是所有函数块(包括基本函数块和组合函数块)的集合;value表示基本函数块的操作符号,例如,“+”、“-”。基本函数块F的接口包含两个部分,<in>和</in>之间的部分表示输入部分,<out>和</out>之间的部分表示输出部分,输入部分的输入数据项和输出部分的输出数据项是附载在基本函数块上的存储,存储是承载数据的载体;<in>和</in>以及<out>和</out>中的T表示数据项的数据类型,可以是基本数据类型、组合数据类型、指针类型或者泛型。
需要说明的是,在构建组合函数块的过程中,任一函数块(包括基本函数块和组合函数块)的name保持不变。
基本函数块的接口的JSON表示为:
Figure PCTCN2022125382-appb-000008
Figure PCTCN2022125382-appb-000009
例如,基本函数块的接口的第三种表示形式为:
Figure PCTCN2022125382-appb-000010
其中,<"F","","","">,F表示该函数块为基本函数块,后面的三个值依次表示函数块的id、name、value属性值,第一个<"","","","","","",""/>表示函数块的输入部分,格式与数据项相同,第二个<"","","","","","",""/>表示函数块的输出部分。
下面简单介绍各种基本函数块。
例如,关系表达式用于实现关系运算,关系运算包含相等(==)、大于(>)、小于(<)、大于等于(>=)、小于等于(<=)和不等于(!=)。关系运算是针对int、float、double、long、char、byte、short七种基本数据类型的数据项的操作,关系表达式的输入都是二元数据项(即两个输入数据项),关系表达式的输出都是一元boolean类型的数据项(即一个输出数据项)。下面的表格1示出了各种关系表达式。
表格1
Figure PCTCN2022125382-appb-000011
除此之外,本公开的实施例还包括与指针相关的2个基本函数块,即equalref:判断指针类型的数据项是否相等、isnull:判断指针类型的数据项是否为空。isnull包括一个输入数据项和一个输出数据项,输入数据项的数据类型属性为ref,输出数据项的数据类型属性为boolean。
图4E为本公开一些实施例提供的一个表示关系表达式的基本函数块的图形化的表达形式的示意图。
例如,如图4E所示,表示关系表达式的基本函数块的名称为RE,该表示关系表达 式的基本函数块RE具有两个输入数据项,分别为idName1和idName2,该表示关系表达式的基本函数块RE具有一个输出数据项idName3,且该输出数据项idName3为boolean类型的数据项。表示关系表达式的基本函数块RE的XML架构表示为:
Figure PCTCN2022125382-appb-000012
其中,两个输入数据项idName1和idName2的数据类型属性表示为T,T可以为int、float、double、long、char、byte、short中的任意一种,输出数据项idName3的数据类型属性为boolean。例如,在一些示例中,T为int,即输入数据项idName1和idName2的数据类型均为整型,此时,两个输入数据项idName1和idName2组合而成的组合数据项的数据类型T2为int2。在将该表示关系表达式的基本函数块被封装以形成接口时,两个输入数据项idName1和idName2可以被组合成一个组合数据项,该组合数据项被封装为该表示关系表达式的基本函数块对应的接口的输入部分,输出数据项idName3则被封装为该表示关系表达式的基本函数块对应的接口的输出部分。
例如,参考上述表示关系表达式的基本函数块RE的XML架构,输入数据项idName1的相对地址为0,即该输入数据项idName1在由输入数据项idName1和idName2组合得到的组合数据项中的相对地址为0,输入数据项idName2的相对地址为1,即该输入数据项idName2在由输入数据项idName1和idName2组合得到的组合数据项中的相对地址为1,依次类推。输入数据项idName1和idName2组合得到的组合数据项的相对地址为0,即输入数据项idName1和idName2组合得到的组合数据项在该表示关系表达式的基本函数块RE对应的接口的输入部分的相对地址为0。需要说明的是,数据项的相对地址属性不使用name表示,由该数据项的数据结构隐含,且由算法自动计算得到。
图4E所示的表示关系表达式的基本函数块RE的JSON表示为:
Figure PCTCN2022125382-appb-000013
Figure PCTCN2022125382-appb-000014
图4F为本公开一些实施例提供的一个表示关系表达式的基本函数块的一个具体示例的图形化的表达形式的示意图,图4G为本公开一些实施例提供的一个表示关系表达式的基本函数块的接口的存储层级结构图。
例如,在一个实施例中,图4F示出了一个表示int类型的关系表达式的基本函数块的图形化的表达形式,图4G为int类型的关系表达式的基本函数块的接口的存储层级结构图,例如,该int类型的关系表达式为int类型大于表达式,其他数据类型的表达形式 与此类似。如图4F所示,表示int类型的关系表达式的基本函数块的名称为moreint,表示int类型的关系表达式的基本函数块moreint包括两个输入数据项a1和a2以及一个输出数据项b1,该输入数据项a1和a2的数据类型属性均为int类型,输出数据项b1的数据类型属性为boolean类型。基本函数块moreint的XML架构表示为:
<F id="moreint"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="a1"name=""value=""typeclass="0"typevalue="int"typeid=""/>
<type id="a2"name=""value=""typeclass="0"typevalue="int"typeid=""/>
</type>
</in>
<out>
<type id="b1"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
</out>
</F>。
例如,如上面的XML所示,基本函数块moreint对应的接口的输入部分包括2级,分别为第1级(即int2)和第2级(即int和int),基本函数块moreint对应的接口的输出部分包括1级(即boolean),由此,如图4G所示,在该基本函数块moreint的接口的存储层级结构图中,输入部分的总层级为2,输出部分的总层级为1,输入部分的当前显示层级为2,输出部分的当前显示层级为1,此时,输入部分示出了两个输入数据项a1和a2,输出部分示出了一个输出数据项b1。
例如,逻辑表达式用于实现逻辑运算,逻辑运算包括三种:&&逻辑与expand、||逻辑或expor、!逻辑非expnot。逻辑与和逻辑或是二元逻辑运算,逻辑非是一元逻辑运算。
一元逻辑运算的输入是一个数据项,且该数据项的数据类型必须为boolean类型,二元逻辑运算的输入是由两个boolean类型的数据项组合形成的组合数据项,一元逻辑运算的输出和二元逻辑运算的输出都是一个boolean类型的数据项。
图4H为本公开一些实施例提供的一个表示逻辑表达式的基本函数块的图形化的表达形式的示意图。
例如,如图4H所示,该表示逻辑表达式的基本函数块的名称为LE,该表示逻辑表达式的基本函数块LE具有两个输入数据项,分别为idName4和idName5,该表示逻辑表达式的基本函数块LE具有一个输出数据项idName6。该两个输入数据项idName4和idName5以及输出数据项idName6均为boolean类型的数据项。例如,表示逻辑表达式的基本函数块LE的XML架构表示为:
<F id="LE"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="boolean2"typeid="">
<type id="idName4"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
<type id="idName5"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
</type>
</in>
<out>
<type id="idName6"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
</out>
</F>,
其中,两个输入数据项idName4和idName5的数据类型属性为boolean,两个输入数据项idName4和idName5组合而成的组合数据项的数据类型属性为boolean2,输出数据项idName6的数据类型属性为boolean。在将该表示逻辑表达式的基本函数块封装成接口时,两个输入数据项idName4和idName5可以被组合成一个组合数据项,该组合数据项被封装为该表示逻辑表达式的基本函数块对应的接口的输入部分,输出数据项idName6则被封装为该表示逻辑表达式的基本函数块对应的接口的输出部分。
图4I为本公开一些实施例提供的一个表示逻辑与表达式的基本函数块的一个具体示例的图形化的表达形式的示意图,图4J为本公开一些实施例提供的一个表示逻辑与表达式的基本函数块的接口的存储层级结构图。
例如,在一个实施例中,图4I示出了表示两个布尔类型的数据项的逻辑与表达式的基本函数块的图形化的表达形式,图4J为逻辑与表达式的基本函数块的接口的存储层级结构图。如图4I所示,表示逻辑与表达式的基本函数块的名称为expand,表示逻辑与表达式的基本函数块expand包括两个输入数据项a3和a4以及一个输出数据项b2,该输入数据项a3和a4以及输出数据项b2的数据类型属性均为boolean类型。表示逻辑与表达式的基本函数块expand的XML架构表示为:
<F id="expand"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="boolean2"typeid="">
<type id="a3"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
<type id="a4"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
</type>
</in>
<out>
<type id="b2"name=""value=""typeclass="0"typevalue="boolean"typeid=""/>
</out>
</F>。
例如,如上面的XML所示,基本函数块expand对应的接口的输入部分包括2级,分别为第1级(即boolean2)和第2级(即boolean和boolean),基本函数块expand对应的接口的输出部分包括1级(即boolean),由此,如图4J所示,在该基本函数块expand的接口的存储层级结构图中,输入部分的总层级为2,输出部分的总层级为1,输入部分的当前显示层级为2,输出部分的当前显示层级为1,此时,输入部分示出了两个输入数据项a3和a4,输出部分示出了一个输出数据项b2。
例如,算术表达式用于实现算术运算,算术运算有5种:加法(+)、减法(-)、乘法(*)、除法(/)、取余运算(%),这5种算术运算都是二元运算。算术运算是针对基本数据类型(即:int、float、double、long、byte、short)的数据项的操作。下面的表格2示出了各种算术表达式。
表格2
Figure PCTCN2022125382-appb-000015
图4K为本公开一些实施例提供的一个表示算术表达式的基本函数块的图形化的表达形式的示意图。
例如,如图4K所示,该表示算术表达式的基本函数块的名称为AE,该表示算术表达式的基本函数块AE具有两个输入数据项,分别为idName7和idName8,该表示算术表达式的基本函数块AE具有一个输出数据项idName9。该两个输入数据项idName7和idName8以及输出数据项idName9的数据类型属性均相同。表示算术表达式的基本函数块AE的XML架构表示为:
<F id="AE"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="T2"typeid="">
<type id="idName7"name=""value=""typeclass="0"typevalue="T"typeid=""/>
<type id="idName8"name=""value=""typeclass="0"typevalue="T"typeid=""/>
</type>
</in>
<out>
<type id="idName9"name=""value=""typeclass="0"typevalue="T"typeid=""/>
</out>
</F>,
其中,两个输入数据项idName7和idName8的数据类型属性均表示为T,T可以为int、float、double、long、byte、short中的任意一种,输出数据项idName9的数据类型属性也表示为T。例如,在一些示例中,T为int,即输入数据项idName7和idName8以及输出数据项idName9的数据类型属性均为int类型,此时,两个输入数据项idName7和idName8组合而成的组合数据项的数据类型属性T2为int2。在将该表示算术表达式的基本函数块AE封装成接口时,两个输入数据项idName7和idName8可以被组合成一个组合数据项,该组合数据项被封装为该表示算术表达式的基本函数块AE对应的接口的输入部分,输出数据项idName9则被封装为表示算术表达式的基本函数块AE对应的接口的输出部分。
图4L为本公开一些实施例提供的一个表示加法表达式的基本函数块的图形化的表达形式的示意图,图4M为本公开一些实施例提供的表示加法表达式的基本函数块的接口的一种存储层级结构图,图4N为本公开一些实施例提供的表示加法表达式的基本函数 块的接口的另一种存储层级结构图。
例如,在一个实施例中,算术表达式包括加法表达式,图4L示出了表示int类型的加法表达式的基本函数块的图形化的表达形式,图4M和图4N示出了int类型的加法表达式的基本函数块的接口的存储层级结构,其他数据类型的算术表达形式与此类似。如图4L所示,表示加法表达式的基本函数块的名称为expaddI,表示加法表达式的基本函数块expaddI包括两个输入数据项a5和a6以及一个输出数据项b3,该输入数据项a5和a6以及输出数据项b3的数据类型属性均为int类型。
例如,表示加法表达式的基本函数块expaddI的XML架构表示为:
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="a5"name=""value=""typeclass="0"typevalue="int"typeid=""/>
<type id="a6"name=""value=""typeclass="0"typevalue="int"typeid=""/>
</type>
</in>
<out>
<type id="b3"name=""value=""typeclass="0"typevalue="int"typeid=""/>
</out>
</F>。
例如,如上面的XML所示,基本函数块expaddI对应的接口的输入部分包括2级,分别为第1级(即int2)和第2级(即int和int),基本函数块expaddI对应的接口的输出部分包括1级(即int),由此,如图4M和图4N所示,在该基本函数块expaddI的接口的存储层级结构图中,输入部分的总层级为2,输出部分的总层级为1,如图4M所示,输入部分的当前显示层级为2(默认值),输出部分的当前显示层级为1,此时,输入部分示出了两个输入数据项a5和a6(int和int),输出部分示出了一个输出数据项b3,如图4N所示,输入部分的当前显示层级为1,输出部分的当前显示层级为1,此时,输入部分示出了一个输入数据项(int2),输出部分示出了一个输出数据项b3。需要说明的是,图4L所示的输入部分和输出部分与图4M所示的存储层级结构对应。
例如,赋值表达式用于实现赋值运算,赋值表达式具有一个输入数据项和一个输出数据项,且输入数据项的数据类型属性和输出数据项的数据类型属性必须是一致的,且均为基本数据类型,赋值运算表示把输入数据项的value赋值给输出数据项的value。
赋值算法对于10种基本数据类型,具有相对应的赋值基本函数块。下面的表格3示出了各种赋值表达式。
表格3
Figure PCTCN2022125382-appb-000016
图4O为本公开一些实施例提供的一个表示赋值表达式的基本函数块的图形化的表达形式的示意图。
例如,如图4O所示,该表示赋值表达式的基本函数块的名称为assignid,该表示赋值表达式的基本函数块assignid具有一个输入数据项idName10和一个输出数据项idName11。该输入数据项idName10的数据类型属性和输出数据项idName11的数据类型属性相同。表示赋值表达式的基本函数块assignid的XML架构表示为:
<F id=""name="">
<in>
<type id="idName10"name=""value=""typeclass="0或者4"typevalue="T"typeid=""/>
</in>
<out>
<type id="idName11"name=""value=""typeclass="0或者4"typevalue="T"typeid=""/>
</out>
</F>,
其中,输入数据项idName10和输出数据项idName11的数据类型属性均表示为T,T可以为10种基本数据类型中的任意一种。在将该表示赋值表达式的基本函数块封装成接口时,输入数据项idName10被封装为该表示赋值表达式的基本函数块对应的接口的输入部分,输出数据项idName11则被封装为该表示赋值表达式的基本函数块对应的接口的输出部分。
图4P为本公开一些实施例提供的一个表示赋值表达式的基本函数块的一个具体示例的图形化的表达形式的示意图,图4Q为本公开一些实施例提供的表示赋值表达式的基本函数块的接口的存储层级结构图。
例如,在一个实施例中,图4P示出了表示Char类型的赋值表达式的基本函数块的图形化的表达形式,图4Q示出了表示Char类型的赋值表达式的基本函数块的接口的存储层级结构,其他数据类型的表达形式与此类似。如图4P所示,表示Char类型的赋值表达式的基本函数块的名称为assignchar,表示Char类型的赋值表达式的基本函数块assignchar包括一个输入数据项a7和一个输出数据项b4,该输入数据项a7和输出数据项b4的数据类型属性均为Char类型。基本函数块assignchar的XML架构表示为:
<F id="assignchar"name="">
<in>
<type id="a7"name=""value=""typeclass="0"typevalue="char"typeid=""/>
</in>
<out>
<type id="b4"name=""value=""typeclass="0"typevalue="char"typeid=""/>
</out>
</F>。
例如,如上所示,基本函数块assignchar对应的接口的输入部分包括1级(即char),基本函数块assignchar对应的接口的输出部分包括1级(即char),由此,如图4Q所示,在该基本函数块assignchar的接口的存储层级结构图中,输入部分的总层级为1,输出部分的总层级为1,输入部分的当前显示层级为1,输出部分的当前显示层级为1,此时, 输入部分示出了输入数据项a7,输出部分示出了输出数据项b4。
例如,基本数据类型转换包括自动类型转换、基本类型转字符串和强制类型转换。下面的表格4示出了自动类型转换,表格5示出了基本类型转字符串,表格6示出了强制类型转换。
表格4
Figure PCTCN2022125382-appb-000017
表格5
Figure PCTCN2022125382-appb-000018
表格6
Figure PCTCN2022125382-appb-000019
Figure PCTCN2022125382-appb-000020
对于10种基本数据类型的数据项,分别对应着不同类型的基本函数块,如下表7所示:
表格7
Figure PCTCN2022125382-appb-000021
例如,除了以上五类基本函数块,范式基本函数块包括getname、addAddress。getname表示获取其他数据项的地址,该地址数据项的数据类型属性为指针类型ref。该getname的输出数据项(指针类型)所指向的数据的类型与该getname的输入数据项的类型相同,当输入数据项的类型确定时,输出数据项所指向的数据项的类型也随之确定。getname函数表示获取存储实际运行时的物理地址,使用组合技术形成的算法最终需要在计算机上运行,在算法中出现的每个数据项(真实存储)在运行时都被分配到某个硬件载体上,分配及运行的过程需要对硬件载体进行管理,给每个硬件载体一个标识是管理硬件资源的前提条件,getname函数获取的是某个数据项所在的硬件资源的标识,一般被叫做物理地址。对地址进行加减运算表示硬件载体的地址是有序、可加的。addAddress表示进行地址加法操作,加法公理定义了自然数的有序概念,地址加法同样代表了地址是有序的。addAddress的输入数据项的数据类型是地址/指针和int类型,输出数据项的数据类型是地址/指针。addAddress对数据项的数据类别有约束,后续说明。getValueFromAddr表示获取地址(指针类型)指向的数据项。
图4R为本公开一些实施例提供的一个表示getname函数的基本函数块的图形化的表达形式的示意图,图4S为本公开一些实施例提供的表示getname函数的基本函数块的接口的存储层级结构图。
如图4R所示,该表示getname函数的基本函数块的名称为getname,该基本函数块getname具有一个输入数据项idName12和一个输出数据项idName13。该输入数据项idName12的数据类型属性可以为任意类型,该输出数据项idName13的数据类型属性为指针类型ref(若输入数据项的类型不确定时,该输出数据项为通用指针类型,即可以指向任意类型的数据项)。
基本函数块getname的XML架构表示为:
Figure PCTCN2022125382-appb-000022
使用getname函数进行组合时,输入数据项的数据类型实际上可以是基本数据类型、基本组合数据类型、数组类型、异或类型。
指向数据类别为x、数据类型为t的指针的数据结构的xml描述如下:
<type id=""name=""value=""typeclass="4"typevalue="&t"typeid="ref">
<type id="a"name=""value=""typeclass="x"typevalue="t"typeid="t"/>
</type>
其中,x可以是0、1、2、3。t的具体描述由id为a的数据项的内部数据结构决定,参考后续typevalue生成规则。
例如,如上所示,基本函数块getname对应的接口的输入部分包括1级(即数据类型T),基本函数块getname对应的接口的输出部分包括1级(即ref),由此,如图4S所示,在该基本函数块getname的接口的存储层级结构图中,输入部分的总层级为1,输出部分的总层级为1,输入部分的当前显示层级为1,输出部分的当前显示层级为1,此时,输入部分示出了输入数据项idName12,输出部分示出了输出数据项idName13。
需要说明的是,当基本函数块getname的输入数据项进行连线之后,则该输入数据项的数据类型就被确定了。
连线展开与图形查看展开是不相同,连线展开表示为了类型匹配规则进行数据项的内部数据项连线的准备工作;图形查看展开则是为了让用户查看数据项的内部组成,数据项的内部组成部分不会进行变换处理。在基本组合数据类型、异或类型、非通用指针类型等类型的数据项的连线展开和图形查看展开在结果上没有区别,但是连线展开和图形查看展开在数组类型的数据项上的操作有区别,对于数组类型的数据项,在进行连线展开时应用数组逻辑等同变换规则,数组类型的数据项的数据结构发生了变化,在进行图形查看展开时不应用数组逻辑等同变换规则,只是单纯查看数组类型的数据项的内部结构,例如,对数据项(intint)[]进行连线展开时,用户将看到该数据项(intint)[]的第一层数据项的数据类型属性是int[]int[],该数据项(intint)[]的第二层数据项是两个数据类型属性为int[]的数据项;对数据项(intint)[]进行图形查看展开时,用户将看到该数据项(intint)[]的第一层数据项的数据类型属性为(intint)[],而该数据项(intint)[]的第二层数据项是一个 数据类型属性为intint的数据项,其表示该数组类型的数据项的内部是由多个intint类型的数据项形成的数组。需要说明的是,在此处,为了简化描述,只描述了数组类型的数据项对应的连线展开和图形查看展开。需要说明的是,本公开的实施例中所有的展开动作均是表示连线展开。
例如,多个函数块中的任一函数块对应的可扩展标记语言包括计算序列部分、接口部分、连线关系部分和接口与序列对照部分。
计算序列部分用于描述任一函数块所包括的函数块的接口,在该计算序列部分,任一函数块的内部的函数块的接口序列按顺序排列;接口部分用于描述任一函数块的接口;连线关系部分用于描述任一函数块所包括的函数块之间的数据传递关系、输入合并关系;接口与序列对照部分用于描述任一函数块所包括的函数块中的数据项与任一函数块的接口中的数据项的对照关系,还描述任一函数块中的由辅助合并连线进行连接的输入数据项之间的连线关系。对照关系通过任一函数块的接口中的数据项的第一相对路径和第二相对路径体现。
需要说明的是,当该任一函数块的数据项之间不具有连线关系,则该任一函数块对应的连线关系部分为空。
例如,若该任一函数块为顺序结构的组合函数块,此时,该任一函数块的完整结构对应的XML表示为:
Figure PCTCN2022125382-appb-000023
如上所示,顺序结构的组合函数块的完整结构(由<PF></PF>包起来)由三部分组成:范式组合区、大函数接口区、大函数接口类型和小函数接口类型关系区。范式组合区的小函数块区(即计算序列部分)用于示出至少一个小函数块,每个小函数块由<PF></PF>或者<F></F>包起来,由顺序结构的组合函数块的内部的各个函数块的接口序 列按顺序排列,小函数块区可以包括多个<F/PF></F/PF>部分,即包括多个小函数块;范式组合区的组合动作区包含连线关系部分,范式组合区的连线关系部分(即VMS),由<VMS></VMS>包起来,用于存储由各个函数块组成的计算序列之间的数据传递关系、输入合并关系;在大函数接口区(即接口部分)中,接口的输入部分用<in></in>包起来,接口的输出部分用<out></out>包起来,大函数接口区用于描述顺序结构的组合函数块的接口,输入部分和输出部分内部包含各自的基本数据项或者组合数据项或者泛型或者指针数据项,数据项由组合范式通过组合规则自动生成,遵循数据项的描述规范,函数块的接口的数据项都由相对路径进行标识,取代了传统软件开发中使用变量名标识数据项的技术手段,数据项及函数块的含义不依赖变量名,不产生带有具体行业特点的数据项及算法,从而产生纯抽象算法,从本质上实现了算法的高度抽象化和规范化。大函数接口类型和小函数接口类型关系区(即接口与序列对照部分,PFVMS),用<PFVMS></PFVMS>包起来,用于描述由各个函数块组成的计算序列中的对应数据项与该组合函数块的接口中的数据项的对照关系和各个函数块组成的计算序列中的由辅助合并连线进行连接的输入数据项之间的连线关系。
顺序结构的组合函数块的完整结构的JSON表示为:
Figure PCTCN2022125382-appb-000024
其中,PFList为组合函数块的计算序列部分。
例如,若该任一函数块为条件结构的组合函数块,此时,该任一函数块的完整结构对应的XML表示为:
Figure PCTCN2022125382-appb-000025
Figure PCTCN2022125382-appb-000026
例如,如上所示,条件结构的组合函数块的完整结构由三部分组成:范式组合区、大函数接口区、大函数接口类型和小函数接口类型关系区。范式组合区的小函数块区(即计算序列部分)是由三部分构成的:第一部分、判断条件部分,由<exp></exp>包起来,判断条件部分包括输出数据项为boolean数据类型的函数块,在判断条件部分,每个小函数块由<PF></PF>或者<F></F>包起来;第二部分、条件为真时的分支结构(第一分支部分),由<doTrue></doTrue>包起来,在第一分支部分,每个小函数块由<PF></PF>或者<F></F>包起来;第三部分、条件为假时的分支结构(第二分支部分),<doFalse></doFalse>包起来,在第二分支部分,每个小函数块由<PF></PF>或者<F></F>包起来;范式组合区的连线关系部分(即VMS,组合动作区),由<VMS></VMS>包起来,用于存储由各个 函数块组成的计算序列之间的数据传递关系、输入合并关系;在大函数接口区(即接口部分)中,接口的输入部分用<in></in>包起来,接口的输出部分用<out></out>包起来,大函数接口区用于描述条件结构的组合函数块的接口;大函数接口类型和小函数接口类型关系区(即接口与序列对照部分,PFVMS),用<PFVMS></PFVMS>包起来,用于描述由各个函数块组成的计算序列中的对应数据项与该组合函数块的接口中的数据项的对照关系和各个函数块组成的计算序列中的由辅助合并连线进行连接的输入数据项之间的连线关系。
需要说明的是,在条件结构的组合函数块中,doTrue分支和doFalse分支中可有一个分支为空。
条件结构的组合函数块的完整结构的JSON表示为:
Figure PCTCN2022125382-appb-000027
Figure PCTCN2022125382-appb-000028
例如,若该任一函数块为循环结构的组合函数块,此时,该任一函数块的完整结构对应的XML表示为:
Figure PCTCN2022125382-appb-000029
Figure PCTCN2022125382-appb-000030
例如,如上所示,循环结构的组合函数块的完整结构由三部分组成:范式组合区、大函数接口区、大函数接口类型和小函数接口类型关系区。其中,范式组合区的小函数块区(即计算序列部分)又分为两部分:第一部分、单次表达式的部分,由<exp1></exp1>包起来;第二部分、循环体的部分,由<loopN></loopN>包起来,其中,循环体包括至少一个循环部分,<IFloop></IFloop>描述一个循环部分,每一个循环部分的内部结构都相同,上面默认显示一个循环部分,可根据需要自行增加循环部分,其中,在每个循环部分中,<exp2></exp2>部分表示条件表达式,<loop></loop>部分表示中间循环表达式,<exp3></exp3>末尾循环表达式部分;范式组合区的组合动作区包含连线关系部分(即VMS),由<VMS></VMS>包起来,用于存储由各个函数块组成的计算序列之间的数据传递关系、输入合并关系;大函数接口区的输入部分用<in></in>包起来,输出部分用<out></out>包起来,用于描述循环结构的组合函数块的接口;大函数接口类型和小函数接口类型关系区(接口与序列对照部分,即PFVMS),用<PFVMS></PFVMS>包起来,用于描述由各个函数块组成的计算序列中的对应数据项与该组合函数块的接口中的数据项的对照关系和各个函数块组成的计算序列中的由辅助合并连线进行连接的输入数据项之间的连线关系。例如,在上述循环结构的组合函数块对应的XML中,每个小函数块由<PF></PF>或者<F></F>包起来。
循环结构的组合函数块的完整结构的JSON表示为:
Figure PCTCN2022125382-appb-000031
Figure PCTCN2022125382-appb-000032
例如,若该任一函数块为当型循环结构的组合函数块,此时,该任一函数块的完整结构对应的XML表示为:
Figure PCTCN2022125382-appb-000033
Figure PCTCN2022125382-appb-000034
例如,如上所示,当型循环结构的组合函数块的完整结构由三部分组成:范式组合区、大函数接口区、大函数接口类型和小函数接口类型关系区。其中,范式组合区的小函数块区(即计算序列部分)包括:当型循环体的部分,由<loopN></loopN>包起来,其中,当型循环体包括至少一个当型循环部分,<IFloop></IFloop>描述一个当型循环部分,每个当型循环部分由<IFLoop></IFLoop>包起来,其中,<exp></exp>部分表示当型条件表达式,<loop></loop>部分表示当型循环表达式;当范式组合区的小函数块区包括多个当型循环部分时,多个当型循环部分的内部结构是相同;范式组合区的连线关系部分(即VMS),由<VMS></VMS>包起来,用于存储由各个函数块组成的计算序列之间的数据传递关系、输入合并关系;在大函数接口区中,接口的输入部分用<in></in>包起来,接口的输出部分用<out></out>包起来,大函数接口区用于描述当型结构的组合函数块的接口;大函数接口类型和小函数接口类型关系区(接口与序列对照部分,即PFVMS),用<PFVMS></PFVMS>包起来,用于描述由各个函数块组成的计算序列中的对应数据项与该组合函数块的接口中的数据项的对照关系和各个函数块组成的计算序列中的由辅助合并连线进行连接的输入数据项之间的连线关系。例如,在上述当型循环结构的组合函数块对应的XML中,每个小函数块由<PF></PF>或者<F></F>包起来。
例如,在本公开中,对于至少两个函数块中的任一函数块对应的任一输入数据项,任一输入数据项被提取作为组合函数块对应的接口的一部分。任一输入数据项对应有第一相对路径,任一输入数据项的第一相对路径表示任一输入数据项在组合函数块对应的接口的输入部分中的相对路径。数据项的相对位置描述数据项的输出输入关系,不需要名称标注,具体表示为路径。
例如,在一些实施例中,任一输入数据项的第一相对路径的表现形式如下:
in.Path(data_in1)(1)
其中,in表示任一输入数据项处于组合函数块对应的接口的输入部分;Path(data_in1)是按照以下方式计算的任一输入数据项的相对路径:基于组合函数块的拼接结构(即组合函数块对应的计算序列),在从组合函数块所对应的接口的输入部分的与任一输入数据项对应的最外层的输入数据项至任一输入数据项之间,逐层获取与任一输入数据项相关的相对地址属性,并根据与任一输入数据项相关的相对地址属性计算得到任一输入数据项的相对路径。
例如,对于任一函数块对应的任一输出数据项,任一输出数据项被提取作为组合函数块对应的接口的一部分,任一输出数据项对应有第一相对路径,任一输出数据项的第一相对路径表示任一输出数据项在组合函数块对应的接口的输出部分中的相对路径。
例如,在一些实施例中,任一输出数据项的第一相对路径的表现形式如下:
out.Path(data_out1)(2)
其中,out表示任一输出数据项处于组合函数块对应的接口的输出部分;Path(data_out1)是按照以下方式计算的任一输出数据项的相对路径:基于组合函数块的拼接结构,在从组合函数块所对应的接口的输出部分的与任一输出数据项对应的最外层的输出数据项至任一输出数据项之间,逐层获取与任一输出数据项相关的相对地址属性,并根据与任一输出数据项相关的相对地址属性计算得到任一输出数据项的相对路径。
例如,在一些实施例中,可以用点符号(即:.)将与任一输入数据项相关的相对地址属性连接以得到该任一输入数据项的相对路径,即,输入数据项在该输入数据项所在的组合函数块对应接口的输入部分中的相对路径可以通过以下方式得到:按照嵌套结构从输入部分的与该输入数据项对应的最外层的输入数据项至该输入数据项之间的所有输入数据项(包括最外层的输入数据项和该输入数据项)的相对地址属性以点符号连接起来。类似地,可以用点符号(即:.)将与任一输出数据项相关的相对地址属性连接以得到该任一输出数据项的相对路径,即,输出数据项在该输出数据项所在的组合函数块对应接口的输出部分中的相对路径可以通过以下方式得到:按照嵌套结构从输出部分的与该输出数据项对应的最外层的输出数据项至该输出数据项之间的所有输出数据项(包括最外层的输出数据项和该输出数据项)的相对地址属性以点符号连接起来。Path(data_in1)和Path(data_out1)的具体计算过程可以参考下面描述的数据项的定位的过程。
需要说明的是,在XML架构中,任一数据项(输入数据项或输出数据项)的第一相对路径在该任一数据项对应的组合函数块对应的PFVMS中体现。只有被提取为组合函数块对应的接口的一部分的数据项才会计算相应的第一相对路径。
例如,在一些实施例中,在组合函数块对应的PFVMS的XML架构中,line标签内部的source标签的path属性(见后面对PFVMS的描述)可以用于存储任一输入数据项的第一相对路径,line标签内部的source标签的path属性(见后面对PFVMS的描述) 可以用于存储任一输出数据项的第一相对路径。
在将至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接时,连接的两个数据项的数据类型属性满足类型匹配规则或连接的两个数据项满足连线要求规则,类型匹配规则为两个数据项的数据类型属性匹配。
例如,连线要求规则包括两个数据项中的一个数据项的数据类型属性是泛型,两个数据项中的另一个数据项是基本数据类型、组合数据类型或泛型,即两个数据项中的另一个数据项是除指针类型之外的任何数据类型,或者,连线要求规则包括两个数据项中的一个数据项的数据类型属性是通用指针类型,两个数据项中的另一个数据项的数据类型属性是非通用指针类型。
例如,类型匹配规则包括两个数据项的数据类型属性匹配,两个数据项的数据类型属性匹配可以表示两个数据项的数据类型属性相同。两个数据项的数据类型属性相同表示两个数据项的数据类型属性均为相同的基本数据类型或相同的组合数据类型或相同的指针类型。两个数据项的数据类型属性匹配还可以表示两个数据项中的一个数据项的数据类型属性为泛型,两个数据项中的另一个数据项的数据类型属性为除指针类型之外的其余数据类型,此时,则该两个数据项满足类型匹配规则或者连线要求。
例如,在本公开中,组合数据类型的数据项、指针类型的数据项的数据类型属性可以不为空,当数据类型属性不为空时,可以直接基于两个数据项的数据类型属性判断两个数据项是否满足类型匹配规则,在两个数据项的数据类型属性的值相同的情况下,确定两个数据项为满足类型匹配规则的两个数据项。
例如,在本公开中,组合数据类型的数据项、指针类型的数据项的数据类型属性可以为空,当组合数据类型的数据项和指针类型的数据项的数据类型属性为空时,判断两个数据项的数据类型属性是否匹配的步骤如下。此外,对于基本数据类型的数据项和泛型的数据项,判断两个数据项的数据类型属性是否匹配的步骤也如下所示。
例如,确定满足类型匹配规则的两个数据项,包括:对于至少部分输出数据项和/或至少部分输入数据项中的被选择的第一数据项和第二数据项:判断第一数据项的数据类别属性和第二数据项的数据类别属性是否相同,响应于第一数据项的数据类别属性和第二数据项的数据类别属性相同,判断第一数据项的数据类别属性和第二数据项的数据类别属性是基本数据类型、组合数据类型、指针类型或泛型,响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为基本数据类型,判断第一数据项的数据类型属性和第二数据项的数据类型属性是否相同,响应于第一数据项的数据类型属性和第二数据项的数据类型属性相同,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项。
例如,组合数据类型包括基本组合数据类型、异或类型和数组类型,确定满足类型匹配规则的两个数据项,还包括:响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为组合数据类型,判断第一数据项的数据类别属性和第二数据项的数据类别属性是异或类型、基本组合数据类型、还是数组类型,响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为异或类型,循环对在第一数据项和第二数据项的相同位置的数据项进行类型匹配规则的判断,以得到多个异或判断结果,响应于多个异或判断结果中的每个均指示满足类型匹配规则,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项。
例如,确定满足类型匹配规则的两个数据项,还包括:响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为数组类型,循环判断在第一数据项和第二数据项的相同位置的数据项是否满足类型匹配规则,以得到至少一个数组判断结果,响应于至少一个数组判断结果中的每个均指示满足类型匹配规则,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项。
例如,确定满足类型匹配规则的两个数据项,还包括:响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为基本组合数据类型,循环判断在第一数据项和第二数据项的相同位置的数据项是否满足类型匹配规则,以得到至少一个基本组合判断结果,响应于至少一个基本组合判断结果中的每个均指示满足类型匹配规则,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项。
例如,确定满足类型匹配规则的两个数据项,还包括:响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为指针类型,如果第一数据项和第二数据项均为通用指针类型,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项;如果第一数据项和第二数据项均为非通用指针类型,循环判断在第一数据项和第二数据项的相同位置的数据项是否满足类型匹配规则,以得到至少一个非通用指针判断结果,响应于至少一个非通用指针判断结果中的每个均指示满足类型匹配规则,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项。
例如,确定满足类型匹配规则的两个数据项,还包括:响应于第一数据项的数据类别属性和第二数据项的数据类别属性均为泛型,确定第一数据项和第二数据项为满足类型匹配规则的两个数据项。
下面举例详细说明类型匹配规则。
在类型匹配规则中,两个数据项的数据类型属性相同可以包括基本类型相同、组合类型相同、指针类型相同、泛型相同。
例如,基本类型相同表示两个数据项均为基本数据类型(即9种基本数据类型,byte、short、int、long、float、double、boolean、char、string),且具体的数据类型相同。例如,两个数据项的数据类型分别是基本数据类型t1、t2(t1、t2是这9种基本数据类型中的一种),当t1=t2时,该两个数据项满足类型匹配规则的要求。例如,多个int类型的数据项为数据类型相同的数据项。
例如,组合类型相同表示两个数据项均为组合数据类型,且具体的数据类型相同。例如,两个数据项的数据类型分别是组合数据类型T1和T2,当T1和T2内部的任一对应的数据类型都相等,并且任一对应的数据类型的typeclass也相同时,该两个数据项满足类型匹配规则的要求。例如,若T1表示为t1t2,若T2表示为t3t4,则当t1和t3相同,且t2和t4相同时,该两个数据项满足类型匹配规则的要求。
例如,指针类型相同表示两个数据项均为通用指针类型,或者两个数据项均为非通用指针类型且其所指向的具体数据项的数据类型相同。例如,两个数据项的数据类型属性是非通用指针类型,且两个数据项的数据类型分别表示为&T1和&T2,当&T1和&T2内部的任一对应的两个内部数据项的数据类型都相等,并且任一对应的两个内部数据项的数据类型的typeclass也相同时,该两个数据项满足类型匹配规则的要求。例如,若T1表示为t1t2,若T2表示为t3t4,则当t1和t3相同,且t2和t4相同时,该两个数据项满足类型匹配规则的要求。
对于任意两个数据项T1和T2:
步骤1、假定数据项T1的数据类型属性为type1,数据项T1的数据类型的类别(typeclass)为class1,数据项T2的数据类型属性为type2,数据项T2的数据类型的类别为class2。
步骤2、判断数据项T1的数据类型的类别class1与数据项T2的数据类型的类别class2是否相等(即,判断class1==class2),若相等,则执行步骤3,若不相等,则执行步骤16。
步骤3、判断数据项T1和数据项T2是否为基本数据类型的数据项(即,判断class1和class2是否为0),若是,则执行步骤4,若否,则执行步骤5。
步骤4、基本数据类型的类型匹配判断,其包括以下两个步骤4.1~4.2:
步骤4.1、判断两个数据项T1和T2的数据类型属性是否相同,若相同,则执行步骤4.2,如不同,则执行步骤16。
步骤4.2、确定数据项T1和数据项T2满足类型匹配规则,执行步骤15。
步骤5、判断数据项T1的数据类型的类别class1与数据项T2的数据类型的类别class2是否为异或类型,若是,则执行步骤6,若否,则执行步骤7。
步骤6、异或类型的类型匹配判断,其包括以下五个步骤6.1~6.5:
步骤6.1、假定异或类型的数据项T1的类型值为t1xort2,异或类型的数据项T2的类型值为t3xort4;
步骤6.2、对数据项t1和数据项t3进行数据类型的匹配判断,递归跳转到步骤1,并记录返回结果r1;
步骤6.3、对数据项t2和数据项t4进行数据类型的匹配判断,递归跳转到步骤1,并记录返回结果r2;
步骤6.4、判断r1和r2是否都为真(r1/r2为真表示被判断的两个数据项(数据项t1和t3/数据项t2和t4)的数据类型匹配成功),若是,则执行步骤6.5,若否,则执行步骤16;
步骤6.5、确定数据项T1与数据项T2满足异或类型的类型匹配规则,执行步骤15。
步骤7、判断数据项T1的数据类型的类别class1和数据项T2的数据类型的类别class2是否为数组类型,若是,则执行步骤8,若否,则执行步骤9;
步骤8、数组类型的类型匹配判断,其包括以下四个步骤8.1~8.4:
步骤8.1、假定数组类型的数据项T1的内部数据项t1的类型值为d1d2d3...,数组类型的数据项T2的内部数据项t2的类型值为d4d5d6...;
步骤8.2、对数据项t1和数据项t2进行数据类型的匹配判断,递归跳转到步骤1,并记录返回结果;
步骤8.3、判断8.2中所有返回结果是否都为真,若是,则执行步骤8.4,若否,则执行步骤16;
步骤8.4、确定数据项T1与数据项T2满足数组类型的类型匹配规则,执行步骤15。
步骤9、判断数据项T1的数据类型的类别class1和数据项T2的数据类型的类别class2是否为基本组合数据类型,若是,则执行步骤10,若否,则执行步骤11。
步骤10、基本组合数据类型的类型匹配判断,其包括以下四个步骤10.1~10.4:
步骤10.1、假定组合数据类型的数据项T1的类型值为h1h2h3...,组合数据类型的数 据项T2的类型值为h4h5h6...;
步骤10.2、循环判断相同位置的数据项(例如,数据项T1中的h1和数据项T2中的h4为相同位置的两个数据项)的数据类型是否匹配,递归跳转到步骤1,并记录返回结果;
步骤10.3、判断10.2中所有返回结果是否都为真,若是,则执行步骤10.4,若否,则执行步骤16;
步骤10.4、确定数据项T1与数据项T2满足组合类型的类型匹配规则,执行步骤15。
步骤11、判断数据项T1的数据类型的类别class1和数据项T2的数据类型的类别class2是否为指针类型,若是,则执行步骤12,若否,则执行步骤13。
步骤12、指针类型的类型匹配判断,其包括以下四个步骤12.1~12.5:
步骤12.1、假定指针类型的数据项T1的类型值为ref,指针类型的数据项T2的类型值为ref,确定数据项T1与数据项T2满足组合类型的类型匹配规则,执行步骤15;
步骤12.2、假定指针类型的数据项T1的类型值为&h1h2h3...,指针类型的数据项T2的类型值为&h4h5h6...;
步骤12.3、循环判断相同位置的数据项(例如,数据项T1中的h1和数据项T2中的h4为相同位置的两个数据项)的数据类型是否匹配,递归跳转到步骤1,并记录返回结果;
步骤12.4、判断12.3中所有返回结果是否都为真,若是,则执行步骤12.5,若否,则执行步骤16;
步骤12.5、确定数据项T1与数据项T2满足指针类型的类型匹配规则,执行步骤15。
步骤13、判断数据项T1的数据类型的类别class1和数据项T2的数据类型的类别class2是否为泛型,若是,则执行步骤14,若否,则执行步骤16。
步骤14、泛型的类型匹配判断,如果两个数据项的数据类型属性为泛型,确定数据项T1与数据项T2满足类型匹配规则,执行步骤15。
步骤15、确定数据项T1和数据项T2的数据类型属性满足类型匹配规则,即数据项T1和数据项T2匹配成功,匹配结果flag=true。
步骤16、确定数据项T1和数据项T2的数据类型属性不满足类型匹配规则,即数据项T1和数据项T2匹配失败,匹配结果flag=false。
步骤17、返回匹配结果flag。
例如,若数据项T1和数据项T2均为基本数据类型的数据项,此时,class1和class2均为0,若该两个数据项的数据类型属性分别是type1和type2,当type1和type2相同时,例如,type1和type2均为int,则基本数据类型的数据项T1的数据类型属性和基本数据类型的数据项T2的数据类型属性相同。
例如,若数据项T1和数据项T2均为组合数据类型的数据项,若class1和class2均为3,则数据项T1和数据项T2均为异或类型的数据项,此时,可以执行异或类型的类型匹配判断(即上述步骤6),例如,若数据项T1的类型值为t1xort2,数据项T2的类型值为t3xort4,若数据项t1的数据类型属性和数据项t3的数据类型属性相同,数据项t2的数据类型属性和数据项t4的数据类型属性相同,例如,数据项t1和数据项t3均为int类型的数据项,数据项t2和数据项t4也均为int类型的数据项,此时,异或类型的数据项T1的数据类型属性和异或类型的数据项T2的数据类型属性相同。
对于数组类型的两个数据项的类型匹配规则的判断,需要是比较数组类型的两个数据项的内部含有的数据项t1、t2的数据类型是否匹配,t1、t2可能是基本数据类型、基本组合数据类型、异或类型、数组类型、指针类型或泛型,对t1、t2的比较需要递归到步骤1进行比较。例如,若class1和class2均为2,则数据项T1和数据项T2均为数组类型的数据项,此时,可以执行数组类型的类型匹配判断(即上述步骤8),例如,数据项T1包括数据项t1,数据项T2包括数据项t2,则对数据项t1和数据项t2进行数据类型的匹配判断(返回执行步骤1),具体过程参见关于各个步骤的具体描述。例如,在一些示例中,若数据项t1和数据项t2均为基本数据类型的数据项,则执行步骤4,判断两个数据项t1和数据项t2的数据类型属性是否相同,若相同,则确定数据项t1和数据项t2满足类型匹配规则,从而确定数组类型的数据项T1的数据类型属性和数组类型的数据项T2的数据类型属性相同;在另一些示例中,若数据项t1和数据项t2均为基本组合数据类型的数据项,数据项t1的类型值为d1d2d3...,数据项t2的类型值为d4d5d6...,则执行步骤10,例如,若数据项d1的数据类型属性和数据项d4的数据类型属性相同,数据项d2的数据类型属性和数据项d5的数据类型属性相同,且数据项d3的数据类型属性和数据项d6的数据类型属性相同,例如,数据项d1和数据项d4的数据类型属性均为(int2),数据项d2和数据项d3的数据类型属性均为int,数据项d3和数据项d6的数据类型属性均为long,此时,数据项t1和数据项t2满足类型匹配规则,从而确定数组类型的数据项T1的数据类型属性和数组类型的数据项T2的数据类型属性相同,依次类推。
若class1和class2均为1,则数据项T1和数据项T2均为基本组合数据类型的数据项,此时,可以执行基本组合数据类型的类型匹配判断(即上述步骤10),例如,若数据项T1的类型值为h1h2h3,数据项T2的类型值为h4h5h6,若数据项h1的数据类型属性和数据项h4的数据类型属性相同,数据项h2的数据类型属性和数据项h5的数据类型属性相同,且数据项h3的数据类型属性和数据项h6的数据类型属性相同,例如,数据项h1和数据项h4的数据类型属性均为(int2),数据项h2和数据项h3的数据类型属性均为int,数据项h3和数据项h6的数据类型属性均为long,此时,组合类型的数据项T1的数据类型属性和组合类型的数据项T2的数据类型属性相同。
例如,若class1和class2均为4,则数据项T1和数据项T2均为指针类型的数据项,此时,可以执行指针类型的类型匹配判断(即上述步骤12),当且仅当数据项T1所指向的地址存储的数据项(基本数据类型或组合数据类型)的数据类型属性和数据项T2所指向的地址存储的数据项(基本数据类型或组合数据类型)的数据类型属性相同或者数据项T1和数据项T2没有指向任何数据项时,该数据项T1和数据项T2的数据类型属性相同。
例如,若class1和class2均为5,则数据项T1和数据项T2均为泛型数据项,此时,可以执行泛型的类型匹配判断(即上述步骤14),当数据项T1和数据项T2的数据类型属性均为泛型时,该数据项T1和数据项T2满足类型匹配规则。
对于任意两个数据项T1和T2,该两个数据项T1和T2的数据类型属性满足类型匹配规则或该两个数据项T1和T2满足连线要求规则,例如,该两个数据项T1和T2的拼接操作(连线动作)如下:
步骤一:对两个数据项T1和T2应用类型匹配规则,匹配成功后执行步骤六,匹配不成功可执行步骤二;
步骤二:如果两个数据项T1和T2中的一个数据项的数据类型属性是泛型,两个数据项T1和T2中的另一个数据项是除指针类型之外的任何数据类型,确定两个数据项满足连线要求规则,执行步骤六;
步骤三:如果两个数据项T1和T2中的一个数据项的数据类型属性是通用指针类型,两个数据项T1和T2中的另一个数据项是非通用指针类型,确定两个数据项满足连线要求规则,执行步骤六;
步骤四:如果在步骤一中两个数据项T1和T2的类型匹配不成功、在步骤二、三中两个数据项T1和T2不满足连线要求规则并且两个数据项T1和T2均是组合数据类型的数据项,可以尝试对两个数据项T1和T2进行展开动作;
步骤五:展开后的数据项及内部数据项返回执行步骤一;
步骤六:步骤一中的两个数据项T1和T2的类型匹配成功,或步骤二、三中的两个数据项满足连线要求规则,可对两个数据项T1和T2应用连线动作。
需要说明的是,在本公开的实施例中,在进行拼接操作时,当两个数据项满足类型匹配规则和连线要求规则中的任一个,则可以对两个数据项应用连线动作,即若两个数据项不满足类型匹配规则但是满足连线要求规则,则可以对两个数据项应用连线动作。
例如,至少部分输入数据项包括第一部分输入数据项。在步骤S11中,在拼接操作中,将至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接,包括:基于类型匹配规则和/或连线要求规则,通过数据传递连线将至少部分输出数据项和第一部分输入数据项进行连接。连线动作的结果等同于存储合并,表示连线连接的两个数据项(即存储)合并为一个数据项。
例如,通过数据传递连线连接的两个数据项的数据类型属性满足类型匹配规则或连接的两个数据项满足连线要求规则,类型匹配规则或连线要求规则是连线操作必须遵守的前提条件,通过数据传递连线进行连接的数据项必须满足类型匹配规则或连线要求规则才能连线成功。
例如,数据传递连线规则是在组织函数块的过程中都必须遵循的,数据传递连线规则包括:若两个数据项的数据类型属性满足类型匹配规则,则该两个数据项可以进行连线。此外,在函数块的组织过程中,考虑技术及实用方面,增加了一种实用连线规则。实用连线规则包括:若两个输入数据项的数据类型属性满足类型匹配规则,则该两个输入数据项可以进行辅助合并连线。
例如,数据传递连线表示由输出数据项连接至输入数据项或输出数据项的线,数据传递连线包括输出输出传递线和输出输入传递线,输出输出传递线用于连接至少两个输出数据项,输出输入传递线用于将至少一个输出数据项连接至至少一个输入数据项。输出输出传递线和输出输入传递线均是由输出数据项发出的连线。数据传递连线为带有方向性的连线,例如,在图形化的形式呈现中,可以采用带有箭头的线表示数据传递连线。
例如,至少部分输出数据项包括第一输出数据项、第二输出数据项和第三输出数据项,第一部分输入数据项包括第一输入数据项。
在拼接操作中,通过数据传递连线将至少部分输出数据项和第一部分输入数据项进行连接包括以下至少一项:通过输出输出传递线将第二输出数据项连接至第一输出数据项,第二输出数据项出现在第一输出数据项之后,将第二输出数据项的存储类型属性设置为虚拟存储,不改变第一输出数据项的存储类型属性,记录第一输出数据项和第二输 出数据项的连接关系,第二输出数据项所在的函数块在第一输出数据项所在的函数块之后进行计算,计算得到的第二输出数据项的数值传递给第一输出数据项;通过输出输入传递线将第三输出数据项连接至第一输入数据项;响应于第三输出数据项出现在第一输入数据项之后或者第三输出数据项和第一输入数据项属于同一个函数块,将第三输出数据项的存储类型属性设置为虚拟存储,不改变第一输入数据项的存储类型属性,记录第一输入数据项和第三输出数据项的连接关系,第三输出数据项所在的函数块在第一输入数据项所在的函数块之后进行计算,计算得到的第三输出数据项的数值传递给第一输入数据项;响应于第三输出数据项出现在第一输入数据项之前,将第一输入数据项的存储类型属性设置为虚拟存储,不改变第三输出数据项的存储类型属性,记录第一输入数据项和第三输出数据项的连接关系,第三输出数据项所在的函数块在第一输入数据项所在的函数块之前进行计算,计算得到的第三输出数据项的数值传递给第一输入数据项,作为第一输入数据项所在的函数块的输入数据。拼接连线操作由用户操作,存储类型属性是否设置为虚拟存储可以由可视化工具根据上述规则自动实现,简化用户操作步骤。
例如,第一输出数据项、第二输出数据项、第三输出数据项和第一输入数据项以第二相对路径的形式定位,第一输出数据项和第二输出数据项的连接关系通过第一输出数据项和第二输出数据项的第二相对路径体现,并记录在所选择的组合范式的连线关系部分,第一输入数据项和第三输出数据项的连接关系通过第一输入数据项和第三输出数据项的第二相对路径体现。
例如,至少部分输入数据项还包括第二部分输入数据项。
例如,在步骤S11中,在拼接操作中,至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接还包括:基于类型匹配规则和/或连线要求规则,通过辅助合并连线将第二部分输入数据项进行连接。
例如,第二部分输入数据项包括第二输入数据项和第三输入数据项,通过辅助合并连线将第二部分输入数据项进行连接包括:通过辅助合并连线将第三输入数据项连接至第二输入数据项,将第三输入数据项的存储类型属性设置为虚拟存储,不改变第二输入数据项的存储类型属性,记录第二输入数据项和第三输入数据项的连接关系。
例如,第二输入数据项和第三输入数据项以第二相对路径的形式定位,第二输入数据项和第三输入数据项的连接关系通过第二输入数据项和第三输入数据项的第二相对路径体现,并记录在所选择的组合范式的接口与序列对照部分。
例如,对于至少两个函数块中的任一函数块对应的接口中的任一输入数据项,任一输入数据项对应有第二相对路径,任一输入数据项的第二相对路径表示任一输入数据项在组合函数块中的相对路径,任一输入数据项的第二相对路径的表现形式为:
Path(PF).in.Path(data_in2)(3)
其中,Path(PF)是按照以下方式计算的该任一输入数据项所属的任一函数块在组合函数块中的相对路径:基于组合函数块的拼接结构(即组合函数块对应的计算序列,规定函数块在计算序列中按顺序内置相对地址编码,编码规则按照0、1、2...编码),在从组合函数块的与任一函数块对应的最外层的函数块至任一函数块之间,逐层获取与任一函数块相关的相对地址属性,并根据与任一函数块相关的相对地址属性计算得到任一函数块的相对路径;in表示任一输入数据项处于任一函数块对应的接口的输入部分,Path(data_in2)是按照以下方式计算的任一输入数据项在任一函数块对应的接口的输入部分中的相对路 径:在从任一函数块所对应的接口的输入部分的与任一输入数据项对应的最外层的输入数据项至任一输入数据项之间,逐层获取与任一输入数据项相关的相对地址属性,并根据与任一输入数据项相关的相对地址属性计算得到任一输入数据项的相对路径。
例如,对于任一函数块对应的接口中的任一输出数据项,任一输出数据项对应有第二相对路径,任一输出数据项的第二相对路径表示任一输出数据项在组合函数块中的相对路径,任一输出数据项的第二相对路径的表现形式为:
Path(PF).out.Path(data_out2)(4)
其中,Path(PF)表示该任一输出数据项所属的任一函数块在组合函数块中的相对路径:out表示任一输出数据项处于任一函数块对应的接口的输出部分,Path(data_out2)是按照以下方式计算的任一输出数据项在任一函数块对应的接口的输出部分中的相对路径:在从任一函数块所对应的接口的输出部分的与任一输出数据项对应的最外层的输出数据项至任一输出数据项之间,逐层获取与任一输出数据项相关的相对地址属性,并根据与任一输出数据项相关的相对地址属性计算得到任一输出数据项的相对路径。
例如,在一些实施例中,可以用点符号(即:.)将与任一函数块相关的相对地址属性连接以得到该任一函数块在该任一函数块组合得到的组合函数块中的相对路径,即,函数块在该函数块组成的组合函数块中的相对路径可以通过以下方式得到:按照嵌套结构从组合函数块的与该任一函数块对应的最外层的函数块至任一函数块之间的所有函数块(包括最外层的函数块和该任一函数块)的相对地址属性以点符号连接起来。类似地,输入数据项在该输入数据项所在的函数块对应接口的输入部分中的相对路径可以通过以下方式得到:按照嵌套结构从输入部分的与该输入数据项对应的最外层的输入数据项至该输入数据项之间的所有输入数据项的相对地址属性以点符号连接起来;输出数据项在该输出数据项所在的函数块对应接口的输出部分中的相对路径可以通过以下方式得到:按照嵌套结构从输出部分的与该输出数据项对应的最外层的输出数据项至该输出数据项之间的所有输出数据项(包括最外层的输出数据项和该输出数据项)的相对地址属性以点符号连接起来。Path(data_in2)和Path(data_out2)的具体计算过程可以参考下面描述的数据项的定位的过程。
需要说明的是,在XML架构中,任一数据项(输入数据项或输出数据项)的第二相对路径在该任一数据项对应的组合函数块对应的PFVMS和VMS中体现。
例如,在一些实施例中,在组合函数块对应的PFVMS/VMS的XML架构中,PFVMS中的line标签内部的destination标签内部的path属性、VMS中的line标签内部的source标签或者destination标签内部的path属性可以用于存储任一输入数据项的第二相对路径或存储任一输出数据项的第二相对路径。
例如,在组织好至少两个函数块对应的计算序列之后,遵循连线规则进行至少两个函数块的内部数据项之间的连接,从而生成组合函数块对应的VMS部分。
例如,在XML中,计算序列中的数据传递连线关系以第二相对路径的方式存储于组合函数块对应的VMS中,数据项在计算序列中的第二相对路径的计算公式参考上述(3)和(4)。计算序列中的辅助合并连线的连线关系以第二相对路径的方式暂存于VMS中,数据项在计算序列中的第二相对路径的计算公式同样计算公式参考上述(3)和(4),待接口生成后,辅助合并连线的关系将存储于PFVMS区域,VMS区域中该辅助合并连线的关系记录将删除。
例如,在一些实施例中,VMS的XML表示为:
Figure PCTCN2022125382-appb-000035
在上述VMS的XML中,该VMS的XML用于记录数据传递连线的关系,即存储由输出数据项发出的有方向的连线,每一条连线使用一组line标签存储,line标签内部由source和destination标签组成,source标签的path属性存储有向线段的起点所在数据项在计算序列中的第二相对路径,destination标签的path属性存储有向线段的终点所在数据项在计算序列中的第二相对路径。memory(未示出)属性表示起点或者终点所在数据项的存储类型属性,memory=0表示该数据项的存储类型属性为虚拟存储,memory=1表示该数据项的存储类型属性为真实存储,存储类型修改发生在有向线段的两个端点所在数据项的memory属性中。需要说明的是,任意数据项的存储类型属性默认是真实存储,在连线的过程中根据连线规则(数据传递连线规则和实用连线规则)进行更改。
VMS的JSON表示为:
Figure PCTCN2022125382-appb-000036
例如,undirected属性用于区分连线关系的类型,没有undirected属性表示记录数据传递连线,是存储由输出数据项发出的有方向的连线,有undirected属性则表示暂存辅助合并连线,是存储输入数据项与输入数据项之间的无方向的连线。
例如,数据传递连线对应的VMS的XML表示为:
<VMS>
</VMS>
例如,辅助合并连线对应的VMS的XML表示为:
<VMS undirected="">
</VMS>
例如,在一些示例中,记录第一输出数据项和第二输出数据项的连接关系可以包括:在图形化的表达形式中,利用输出输出传递线将第二输出数据项连接至第一输出数据项, 输出输出传递线的箭头指向第一输出数据项;在组合函数块的VMS的XML的表达形式中,通过source标签的path属性存储第二输出数据项的第二相对路径,通过destination标签的path属性存储第一输出数据项的第二相对路径。
例如,在一些示例中,记录第一输入数据项和第三输出数据项的连接关系可以包括:在图形化的表达形式中,利用输出输入传递线将第三输出数据项连接至第一输入数据项,输出输入传递线的箭头指向第一输入数据项;在组合函数块的VMS的XML的表达形式中,通过source标签的path属性存储第三输出数据项的第二相对路径,通过destination标签的path属性存储第一输入数据项的第二相对路径。
例如,在一些示例中,记录第二输入数据项和第三输入数据项的连接关系包括:在图形化的表达形式中,利用不带箭头的辅助合并连线将第二输入数据项和第三输入数据项连接。对于辅助合并连线的关系,在函数块的组织过程中,辅助合并连线的关系暂存于属性为undirected=""的VMS区域,在形成接口后,更新于PFVMS中,并把VMS中的辅助合并连线的关系所对应的部分删除,即属性为undirected=""的部分。第二输入数据项和第三输入数据项的连接关系可以在组合函数块的VMS的XML的表达形式中暂时存储,例如,通过source标签的path属性存储第二输入数据项的第二相对路径,通过destination标签的path属性存储第三输入数据项的第二相对路径。或者,通过source标签的path属性存储第三输入数据项的第二相对路径,通过destination标签的path属性存储第二输入数据项的第二相对路径。
例如,在图形化的表达形式中,将数据项的存储类型属性设置为虚拟存储表示将表示该数据项的圆设置为空心圆,将数据项的存储类型属性设置为真实存储表示将表示该数据项的圆设置为实心圆;在组合函数块的XML的表达形式中,将数据项的存储类型属性设置为虚拟存储表示将表示该数据项的memory的值设置为0,将数据项的存储类型属性设置为真实存储表示将表示该数据项的memory的值设置为1。例如,对于第一输出数据项和第二输出数据项,将第二输出数据项的存储类型属性设置为虚拟存储,不改变第一输出数据项的存储类型属性包括:在图形化的表达形式中,将表示第二输出数据项的圆设置为空心圆,保持表示第一输出数据项的圆不变;在组合函数块的XML的表达形式中,设置第二输出数据项的存储类型属性memory的值为0,保持第一输出数据项的存储类型属性memory的值不变。也就是说,若在图形化的表达形式中,表示第一输出数据项的圆为实心圆,在组合函数块的XML的表达形式中,第一输出数据项的存储类型属性memory的值为1,则在对第一输出数据项进行连线之后,该表示第一输出数据项的圆仍然为实心圆,第一输出数据项的存储类型属性memory的值仍然为1。
图5A为本公开一实施例提供的一种输出输出传递线的示意图。
例如,如图5A所示,一个组合函数块包括函数块F1/PF1和函数块F2/PF2,按照计算顺序,函数块F1/PF1位于函数块F2/PF2之前,函数块F1/PF1包括输出数据项b5(例如,上述第一输出数据项),函数块F2/PF2包括输出数据项b6(例如,上述第二输出数据项),按照计算顺序,输出数据项b6出现在输出数据项b5之后,可以通过输出输出传递线将输出数据项b6连接至输出数据项b5,此时,输出数据项b6的存储类型属性可以被设置为虚拟存储,即表示输出数据项b6的圆被设置为空心圆,输出数据项b5的存储类型属性则不变,即表示输出数据项b5的圆仍然为实心圆。图5A所示的输出输出传递线对应的XML如下所示:
<PF id=""name="">
<PF id="F1/PF1"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b5"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
<PF id="F2/PF2"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b6"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</out>
</PF>
</PF>
例如,可以在该组合函数块的XML架构中的VMS部分中记录输出数据项b5和输出数据项b6的连接关系,即记录图5A所示的输出输出传递线。在该组合函数块的XML架构中,图5A所示的输出输出传递线对应的VMS如下所示:
Figure PCTCN2022125382-appb-000037
例如,输出数据项b5和输出数据项b6均为int类型的数据项,VMS中的line标签内的destination标签的path属性为0.out.0,其表示输出数据项b5的第二相对路径,VMS中的line标签内的source标签的path属性为1.out.0,其表示输出数据项b6的第二相对路径。输出数据项b5的memory为1,其表示输出数据项b5为真实存储,输出数据项b6的memory为0,其表示输出数据项b6为虚拟存储。图5A所示的输出输出传递线对应的JSON表示如下:
Figure PCTCN2022125382-appb-000038
Figure PCTCN2022125382-appb-000039
图5B为本公开一实施例提供的一种输出输入传递线的示意图。
例如,如图5B所示,一个组合函数块包括函数块F3/PF3和函数块F4/PF4,按照计算顺序,函数块F3/PF3位于函数块F4/PF4之前,函数块F3/PF3包括输入数据项a8(例如,上述第一输入数据项),函数块F4/PF4包括输出数据项b7(例如,上述第三输出数据项),按照计算顺序,输出数据项b7出现在输入数据项a8之后,且输出数据项b7和输入数据项a8不属于同一个函数块,可以通过输出输入传递线将输出数据项b7连接至输入数据项a8,此时,输出数据项b7的存储类型属性可以被设置为虚拟存储,即表示输出数据项b7的圆被设置为空心圆,输入数据项a8的存储类型属性则不变,即表示输入数据项a8的圆仍然为实心圆。图5B所示的输出输入传递线对应的XML如下所示:
<PF id=""name="">
<PF id="F3/PF3"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="a8"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
<PF id="F4/PF4"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b7"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</out>
</PF>
</PF>
例如,可以在该组合函数块的XML架构中的VMS部分中记录输出数据项b7和输入数据项a8的连接关系,即记录图5B所示的输出输入传递线。在该组合函数块的XML架构中,图5B所示的输出输入传递线对应的VMS如下所示:
Figure PCTCN2022125382-appb-000040
例如,输出数据项b7和输入数据项a8均为int类型的数据项,VMS中的line标签内的source标签的path属性为1.out.0,其表示输出数据项b7的第二相对路径,VMS中的line标签内的destination标签的path属性为0.in.0.0,其表示输入数据项a8的第二相对路径。输出数据项b7的memory为0,其表示输出数据项b7为虚拟存储,输入数据项a8的memory为1,其表示输入数据项a8为真实存储。
图5C为本公开一实施例提供的另一种输出输入传递线的示意图。
例如,如图5C所示,一个组合函数块包括函数块F5/PF5和函数块F6/PF6,按照计算顺序,函数块F5/PF5位于函数块F6/PF6之前,函数块F5/PF5包括输出数据项b8(例如,上述第三输出数据项),函数块F6/PF6包括输入数据项a9(例如,上述第一输入数据项),按照计算顺序,输出数据项b8出现在输入数据项a9之前,且输出数据项b8和输入数据项a9不属于同一个函数块,可以通过输出输入传递线将输出数据项b8连接至输入数据项a9,此时,输入数据项a9的存储类型属性可以被设置为虚拟存储,即表示输入数据项a9的圆被设置为空心圆,输出数据项b8的存储类型属性则不变,即表示输出数据项b8的圆仍然为实心圆。图5C所示的输出输入传递线对应的XML如下所示:
<PF id=""name="">
<PF id="F5/PF5"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b8"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
<PF id="F6/PF6"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="a9"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</PF>
例如,可以在该组合函数块的XML架构中的VMS部分中记录输出数据项b8和输入数据项a9的连接关系,即记录图5C所示的输出输入传递线。在该组合函数块的XML架构中,图5C所示的输出输入传递线对应的VMS如下所示:
Figure PCTCN2022125382-appb-000041
例如,输出数据项b8和输入数据项a9均为int类型的数据项,VMS中的line标签内的source标签的path属性为0.out.0,其表示输出数据项b8的第二相对路径,VMS中的line标签内的destination标签的path属性为1.in.0.0,其表示输入数据项a9的第二相对路径。输出数据项b8的memory为1,其表示输出数据项b8为真实存储,输入数据项a9的memory为0,其表示输入数据项a9为虚拟存储。
图5D为本公开一实施例提供的又一种输出输入传递线的示意图。
例如,如图5D所示,一个组合函数块包括函数块F7/PF7,函数块F5/PF5包括输出数据项b9(例如,上述第三输出数据项)和输入数据项a10(例如,上述第一输入数据项),按照计算顺序,输出数据项b9出现在输入数据项a10之后,且输出数据项b9和输入数据项a10属于同一个函数块,可以通过输出输入传递线将输出数据项b9连接至输入数据项a10,此时,输入数据项a10的存储类型属性不变,即表示输入数据项a10的圆仍然为实心圆,输出数据项b9的存储类型属性设置为虚拟存储,即表示输出数据项b9的圆被设置为空心圆。图5D所示的输出输入传递线对应的XML如下所示:
<PF id=""name="">
<PF id="F7/PF7"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="a10"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b9"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</out>
</PF>
</PF>
例如,可以在该组合函数块的XML架构中的VMS部分中记录输出数据项b9和输入数据项a10的连接关系,即记录图5D所示的输出输入传递线。在该组合函数块的XML架构中,图5D所示的输出输入传递线对应的VMS如下所示:
Figure PCTCN2022125382-appb-000042
例如,输出数据项b9和输入数据项a10均为int类型的数据项,VMS中的line标签内的source标签的path属性为0.out.0,其表示输出数据项b9的第二相对路径,VMS中的line标签内的destination标签的path属性为0.in.0.1,其表示输入数据项a10的第二相对路径。输出数据项b9的memory为0,其表示输出数据项b9为虚拟存储,输入数据项a10的memory为1,其表示输入数据项a10为真实存储。
图5E为本公开一实施例提供的一种辅助合并连线的示意图。
例如,如图5E所示,一个组合函数块包括函数块F8/PF8和函数块F9/PF9,按照计算顺序,函数块F8/PF8位于函数块F9/PF9之前,函数块F8/PF8包括输入数据项a11(例如,上述第二输入数据项),函数块F9/PF9包括输入数据项a12(例如,上述第三输入数据项),按照计算顺序,输入数据项a11出现在输入数据项a12之前,输入数据项a11和输入数据项a12不属于同一个函数块,可以通过辅助合并连线将输入数据项a11和输入数据项a12进行连接,此时,输入数据项a11的存储类型属性则不变,即表示输入数据项a11的圆仍然为实心圆,输入数据项a12的存储类型属性可以被设置为虚拟存储,即表示输入数据项a12的圆被设置为空心圆。图5E所示的输出输入传递线对应的XML如下所示:
<PF id=""name="">
<PF id="F8/PF8"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="a11"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
<PF id="F9/PF9"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="a12"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</PF>
例如,可以在该组合函数块的XML架构中的VMS部分中暂时记录输入数据项a11和输入数据项a12的连接关系,即记录图5E所示的辅助合并连线。该VMS部分的属性为undirected=""。在形成接口后,将该连接关系更新于PFVMS部分中,并把该VMS部分的相关内容删除。
在该组合函数块的XML架构中,图5E所示的辅助合并连线对应的VMS如下所示:
Figure PCTCN2022125382-appb-000043
例如,输入数据项a11和输入数据项a12均为int类型的数据项,VMS中的line标签内的source标签的path属性为0.in.0.0,其表示输入数据项a11的第二相对路径,VMS中的line标签内的destination标签的path属性为1.in.0.0,其表示输入数据项a12的第二相对路径。输入数据项a11的memory为1,其表示输入数据项a11为真实存储,输入数据项a12的memory为0,其表示输入数据项a12为虚拟存储。
例如,如图1所示,多个函数块中的每个函数块对应的接口包括输入部分和输出部分。在步骤S13中,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口,包括:将组合函数块对应的被提取为接口的至少一个输入数据项进行组合并封装,以得到组合函数块对应的接口的输入部分;将组合函数块对应的被提取为接口的至少一个输出数据项进行组合并封装,以得到组合函数块对应的接口的输出部分。
例如,组合函数块对应的接口存储在所选择的组合范式的接口部分。
计算序列中的所有函数块(即用于组合该组合函数块的至少两个函数块)的输入部分按顺序进行合并以确定该组合函数块对应的接口的输入部分,计算序列中的所有函数块的输出部分按顺序进行合并以确定该组合函数块对应的接口的输出部分。例如,在一些示例中,被提取为接口的输入数据项可以按顺序被组合成一个或多个输入数据项,该 一个或多个输入数据项作为接口的输入部分,例如,该一个或多个输入数据项可以包括除异或类型以外的组合数据类型的数据项,也可以包括基本数据类型的数据项或者指针类型或者泛型的数据项;被提取为接口的输出数据项可以按顺序被组合成一个或多个输出数据项,该一个或多个输出数据项作为接口的输出部分,例如,该一个或多个输出数据项可以包括组合数据类型的数据项,也可以包括基本数据类型的数据项或者指针类型或者泛型的数据项。
例如,在步骤S13中,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口还包括以下至少一项:对于至少两个函数块中的任一个函数块,在任一个函数块对应的任一输入数据项或输出数据项的数据类型属性为组合数据类型的情况下,若不提取任一输入数据项或输出数据项中的某个数据项作为组合函数块对应的接口一部分,则将任一输入数据项或输出数据项打散,不提取该某个数据项,将任一输入数据项或输出数据项中的其余数据项重新组合以作为与组合函数对应的接口的一部分;对于至少两个函数块中的任一个函数块,在任一个函数块对应的任一输入数据项或输出数据项为指针类型的数据项,且提取指针类型的任一输入数据项或输出数据项作为组合函数块对应的接口的一部分的情况下,不打散指针类型的任一输入数据项或输出数据项的数据结构;对于至少两个函数块中的任一个函数块,在任一个函数块对应的任一输入数据项或输出数据项为常量数据项的情况下,不提取该任一常量输入数据项或常量输出数据项作为组合函数块对应的接口的一部分;对于至少两个函数块对应的输入数据项,不提取存储类型属性为虚拟存储的输入数据项作为组合函数块对应的接口的一部分;对于至少两个函数块对应的任一输出数据项,响应于任一输出数据项通过数据传递连线直接或间接连接至少一个输出数据项,获取任一输出数据项和至少一个输出数据项中最先出现的输出数据项作为待提取输出数据项,在待提取输出数据项与任一输入数据项连接的情形下,若待提取输出数据项出现在任一个输入数据项之前,不提取待提取输出数据项作为组合函数块对应的接口的一部分,若待提取输出数据项出现在任一个输入数据项之后或者待提取输出数据项和任一个输入数据项属于同一个函数块,提取待提取输出数据项作为组合函数块对应的接口的一部分;根据需求将至少两个函数块对应的输出数据项的未被提取为接口的部分数据项提取为接口;对于至少两个函数块对应的输出数据项,提取至少两个函数块对应的全部输出数据项作为组合函数块对应的接口。
例如,如被提取为接口的数据项的数据类型为指针类型,则该指针类型的数据项的内部的数据结构不被打散。计算序列中所有函数块的输入部分和输出部分按顺序分别进行合并,同一个函数块的组合结构中若包含不提取为接口的数据项,则该数据项以外的其余数据项重新组合并提取作为接口的一部分,该数据项不参与重新组合,该数据项不作为接口的一部分。
例如,对于至少两个函数块对应的输入数据项,提取存储类型属性为真实存储的输入数据项作为组合函数块对应的接口的一部分,不提取存储类型属性为虚拟存储的输入数据项作为组合函数块对应的接口的一部分,不提取常量类型的输入数据项作为组合函数块对应的接口的一部分。
例如,对于至少两个函数块对应的输出数据项,输出数据项具有三种提取方式:第一、将全部输出数据项提取为组合函数块对应的接口的一部分;第二、可由用户人为选择是否提取输出数据项为组合函数块对应的接口的一部分;第三、对于至少两个函数块 对应的任一输出数据项,首先判断该任一输出数据项是否存在直接连线关系和间接连线关系的至少一个输出数据项,若存在,则获取任一输出数据项和至少一个输出数据项中最先出现的输出数据项作为待提取输出数据项,在待提取输出数据项与任一输入数据项连接的情形下,若待提取输出数据项出现在任一个输入数据项之前,不提取待提取输出数据项作为组合函数块对应的接口的一部分,若待提取输出数据项出现在任一个输入数据项之后或者待提取输出数据项和任一个输入数据项属于同一个函数块,提取待提取输出数据项作为组合函数块对应的接口的一部分,最后,针对至少两个函数块中的不提取到组合函数块对应的接口的输出数据项,可由用户人为选择是否提取为组合函数块对应的接口的一部分,例如,该人为选择的过程可在接口提取完成后的任何时间进行,比如在使用PF时发现输出数据项不够时。例如,在任一输出数据项和至少一个输出数据项中除了该待提取输出数据项之外的其余输出数据项不被提取作为组合函数块对应的接口的一部分。
需要说明的是,在待提取输出数据项出现在任一个输入数据项之后或者待提取输出数据项和任一个输入数据项属于同一个函数块,且待提取输出数据项被提取作为组合函数块对应的接口的一部分的情况下,当该组合函数块被使用时,则需要把该待提取输出数据项与该任一个输入数据项的连线关系表示在组合函数块对应的接口上。
例如,在计算序列中的同一个函数块中,在一个组合数据项(即数据类型属性为组合数据类型,且可以为输入数据项或者输出数据项)中存在一个不提取为组合函数块对应的接口的数据项,那么在提取接口时,该组合数据项的组合结构被打散,将该组合数据项中的各个数据项重新组合。该组合数据项的全部外层组合类型去掉,暴露该组合数据项中其余提取为接口的数据项,然后,按照组合规则,重新组合这些数据项。
图6为本公开一些实施例提供的一种组合函数块的示意图。
例如,如图6所示,组合函数块包括函数块PF10和函数块PF11,函数块PF10具有两个输入数据项a13和a14以及一个输出数据项b10,函数块PF11具有三个输入数据项a15、a16和a17以及两个输出数据项b11和b12。
例如,该组合函数块对应的XML架构中的计算序列部分的XML表示如下:
<PF id="PF10"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="int2"memory="1">
<type id="a13"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
<type id="a14"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
</type>
</in>
<out>
<type id="b10"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
</out>
</PF>
<PF id="PF11"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="intintint"typeid="intintint" memory="1">
<type id="a15"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
<type id="a16"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
<type id="a17"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="int2"memory="1">
<type id="b11"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
<type id="b12"name=""value=""typeclass="0"typevalue="int"typeid="int"memory="1"/>
</type>
</out>
</PF>
例如,函数块PF11中的第一个输入引脚,即输入数据项a15,与函数块PF10中的第一个输出引脚,即输出数据项b10,存在连线关系,即输出数据项b10通过输出到输入的传递线连接至输入数据项a15,此时,该输入数据项a15不提取为接口,从而在生成组合函数块对应的接口时,函数块PF11对应的接口中的输入部分的组合数据类型的输入数据项打散,即该输入部分的外层组合结构去掉,暴露该组合结构中其余数据项(即输入数据项a16和输入数据项a17),并将其余数据项重新组合并提取为组合函数块对应的接口的一部分,之后按照组合规则,重新组合数据项,即将函数块PF10对应的接口中的输入数据项(输入数据项a13和a14组合而成的组合数据项)、函数块PF11对应的接口中的输入数据项a16和输入数据项a17重新组合,以得到该组合函数块对应的接口的输入部分。
将函数块PF11对应的接口中的输出部分的输出数据项b11和输出数据项b12组合,以得到该组合函数块对应的接口的输出部分。
例如,由于函数块PF10对应的输入数据项a13和a14组合而成的组合输入数据项没有被打散,从而该组合输入数据项的组合结构保持不变。
例如,函数块PF11对应的输入数据项a15不被提取为组合函数块对应的接口的一部分,函数块PF11对应的输入数据项a15、a16和a17组合而成的组合输入数据项被打散,输入数据项a16和a17与函数块PF10对应的组合输入数据项重新组合以得到该组合函数块的输入数据项。
例如,该组合函数块对应的XML架构中的接口部分的XML表示为:
Figure PCTCN2022125382-appb-000044
Figure PCTCN2022125382-appb-000045
根据上述接口部分的XML可以看到,该组合函数块对应的接口的输入部分的输入数据项的数据类型属性为int2(intint),该输入部分包括三层结构,该输入部分的第一层包括一个组合数据类型的输入数据项int2(intint),在该输入部分的第一层中,输入数据项int2(intint)的相对地址属性为0;该输入部分的第二层包括组合输入数据项int2(数据类型属性为组合数据类型,例如int2,即a13和a14)和组合输入数据项intint(数据类型属性为组合数据类型,例如intint,即a16和a17),在该输入部分的第二层中,组合输入数据项int2的相对地址属性为0,组合输入数据项intint的相对地址属性为1;该输入部分的第三层包括组合输入数据项int2中的输入数据项a13(数据类型属性为基本数据类型,例如int)和输入数据项a14(数据类型属性为基本数据类型,例如int),还包括组合输入数据项intint中的输入数据项a16(数据类型属性为基本数据类型,例如int)和输入数据项a17(数据类型属性为基本数据类型,例如int),在该输入部分的第三层中,输入数据项a13的相对地址属性为0,输入数据项a14的相对地址属性为1,输入数据项a16的相对地址属性为0,输入数据项a17的相对地址属性为1。
需要说明的是,memory属性由可视化自动设置,默认情况memory=1。
该组合函数块对应的接口的输出部分的输出数据项的数据类型属性为int2,该输出部分包括两层结构,该输出部分的第一层包括一个组合数据类型的输出数据项int2,在该输出部分的第一层中,输出数据项int2的相对地址属性为0;该输出部分的第二层包括输出数据项b11(数据类型属性为基本数据类型,例如int)和输出数据项b12(数据类型属性为基本数据类型,例如int),在该输出部分的第二层中,输出数据项b11的相对地址属性为0,输出数据项b12的相对地址属性为1。
例如,如图6所示,表示输入数据项a13、输入数据项a14、输入数据项a16和输入数据项a17、输出数据项b10、输出数据项b11和输出数据项b12的圆均为实心圆,即输入数据项a13、输入数据项a14、输入数据项a16和输入数据项a17、输出数据项b10、输出数据项b11和输出数据项b12的存储类似属性均为真实存储;表示输入数据项a15的圆为空心圆,即输入数据项a15的存储类似属性为虚拟存储。输入数据项a15和输出数据项b10通过数据传递连线(带箭头的线,且箭头指向输入数据项a15)连接。
例如,在一些实施例中,本公开提供的方法还包括:从基本函数块中选择表示赋值表达式的至少一个基本函数块和表示关系表达式的至少一个基本函数块作为至少两个函数块。例如,在另一些实施例中,表示算数表达式的基本函数块包括表示整数加法的基本函数块和表示整数减法的基本函数块,本公开提供的方法还包括:从基本函数块中选择表示整数加法的至少一个基本函数块和/或表示整数减法的至少一个基本函数块以及表示关系表达式的至少一个基本函数块作为至少两个基本函数块。此时,按照多个组合范式中的至少一个组合范式,对至少两个函数块进行组合包括:选择顺序组合范式、条件组合范式、循环组合范式和当型循环组合范式中的至少一个作为至少一个组合范式;按照至少一个组合范式,对至少两个函数块进行组合。
下面分别描述基于不同的组合范式对至少两个函数块进行组合,并进行拼接操作以最终得到组合函数块的过程。
图7A为本公开一些实施例提供的一种基于顺序组合范式组合函数块的方法的示意图;图7B为本公开一些实施例提供的至少两个函数块的图形化的表达形式的示意图;图7C为本公开一些实施例提供的一种常量数据项的图形化的表达形式的示意图。
例如,在组织顺序结构的组合函数块的过程中,利用至少一个函数块逐步填充顺序组合范式的结构模板。
例如,如图7A所示,基于顺序组合范式组合函数块的方法包括步骤S50-S56。
例如,步骤S50包括:选择顺序组合范式。
例如,步骤S51包括:选择至少两个函数块并组织计算序列。
例如,可以从函数块库中选择至少两个函数块(基本函数块和/或组合函数块),并基于顺序组合范式和排列操作将该至少两个函数块进行排列,以形成对应的计算序列。在顺序组合范式下,至少两个函数块可以顺序组合。可对至少两个函数块中的数据项进行id值具体化,即可按需求修改数据项的id值,以使得该计算序列更易被理解。
例如,如图7B所示,在一些实施例中,至少两个函数块的数量为2,即从函数块库中选择两个函数块F/PF13和F/PF14,图7B示出了该两个函数块F/PF13和F/PF14的图形化的表达形式。例如,函数块F/PF13包括输入数据项r11和r12等,还包括输出数据项e11等;函数块F/PF14包括输入数据项r13和r14等,还包括输出数据项e12等。函数块F/PF13和F/PF14可以为基本函数块,也可以为组合函数块。值得注意的是,本公开不限于此,至少两个函数块的数量也可以为3、5等更多或更少。
例如,两个函数块F/PF13和F/PF14形成的计算序列的XML表示为:
<F/PF id="F/PF13"name="系统编号">
<in>
<type id=""name=""value=""typeclass=""typevalue="T"typeid="">
<type id="r11"name=""value=""typeclass=""typevalue="T1"typeid=""/>
<type id="r12"name=""value=""typeclass=""typevalue="T2"typeid=""/>
...
</type>
</in>
<out>
<type id="e11"name=""value=""typeclass=""typevalue="T3"typeid=""/>
</out>
</F/PF>
<F/PF id="F/PF14"name="系统编号">
<in>
<type id=""name=""value=""typeclass=""typevalue="T"typeid="">
<type id="r13"name=""value=""typeclass=""typevalue="T4"typeid=""/>
<type id="r14"name=""value=""typeclass=""typevalue="T5"typeid=""/>
...
</type>
</in>
<out>
<type id="e12"name=""value=""typeclass=""typevalue="T6"typeid=""/>
</out>
</F/PF>
例如,函数块F/PF13的name属性表示该函数块F/PF13在函数块库中的全局地址(即系统编号),且保持不变。类似地,函数块F/PF14的name属性表示该函数块PF12在函数块库中的全局地址(即系统编号),且保持不变。
例如,当函数块F/PF13或函数块F/PF14为基本函数块时,该函数块F/PF13或函数块F/PF14的XML被包含在<F>和</F>之间,当函数块F/PF13或函数块F/PF14为组合函数块时,该函数块F/PF13或函数块F/PF14的XML被包含在<PF>和</PF>之间。
例如,在形成计算序列之后,可以对数据项进行属性设置。步骤S52包括:常量设置。属性设置包括:选中数据项,可以在属性区域对该数据项进行属性值的初始化。例如,属性设置可以包括常量设置,例如,若计算序列中具有一个数据项是常量数据项,则修改该常量数据项的常量属性,如图7C所示,例如,一个int类型的数据项a为常量数据项,且该数据项a的值设置为5。
例如,用户可按照需求修改计算序列中的输入/输出数据项的id,如图7C所示的图形化的表达方式中,“变量名称”是数据项的id。例如,在图7C所示的示例中,该数据项的id可以设置为a,选择该数据项a为常量,并设置常量值为5。
常量数据项的值直接存储在该数据项的value属性中。
图8A为本公开一些实施例提供的一种计算序列的图形化的表达形式的示意图;图8B为图8A所示的常量数据项的图形化的表达形式的示意图;图8C为对图8A所示的计算序列进行连线之后的图形化的表达形式的示意图。
例如,在一个示例中,需要构建一个组合函数块以实现对两个int类型数据求平均值的计算功能,例如,该计算功能对应的数学函数表达式为:y=(a+b)/2,基于对该计算功能对应的数学函数的分析可知,可以选择加法函数块(实现加法计算功能)、除法函数块(实现除法计算功能)和赋值函数块(实现赋值功能)以实现该计算功能。
首先,如图8A所示,从函数块库中选择三个函数块,分别为加法函数块expaddI、除法函数块expdivI和赋值函数块assignint,基于顺序组合范式和排列操作对该三个函数块进行排列,以得到对应的计算序列,该三个函数块构成的计算序列的图形化的表达方式如图8A所示。如图8A所示,加法函数块expaddI包括两个输入数据项g11和g12以 及一个输出数据项k11,除法函数块expdivI包括两个输入数据项g13和g14以及一个输出数据项k12,赋值函数块assignint包括一个输入数据项g15以及一个输出数据项k13。
例如,如图8A所示,除法函数块expdivI的第二个输入引脚对应的输入数据项g14为常量数据项,且该常量数据项g14的值可以为2。例如,如图8B所示,常量数据项g14的值设置为2,常量数据项g14对应的变量名称为g14,常量数据项g14的数据类型属性为int类型,常量数据项g14对应的存储类型属性为真实存储。
例如,该三个函数块构成的计算序列的XML表示为:
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="g11"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="g12"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="k11"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
<F id="expdivI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="g13"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="g14"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="k12"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
<F id="assignint"name="">
<in>
<type id="g15"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</in>
<out>
<type id="k13"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
例如,在上述计算序列的XML中,由于加法函数块expaddI、除法函数块expdivI和赋值函数块assignint均为基本函数块,因此,加法函数块expaddI、除法函数块expdivI和赋值函数块assignint中的每个的XML被包含在<F>和</F>之间。
由于除法函数块expdivI包括常量类型的输入数据项g14,且该常量类型的输入数据项g14的值为2,因此,输入数据项g14的value属性设置为2。
<F id="expdivI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="g13"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="g14"name=""value="2"typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="k12"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
例如,各个数据项(输入数据项和输出数据项)的存储类型属性默认均设置为1,即memory="1",然而,本公开不限于此,各个数据项的存储类型属性可以设置为空,即不设置任何值,memory=""。
例如,如图7A所示,步骤S53包括执行连线操作,生成VMS,即执行数据传递连线和辅助合并连线的操作。在步骤S53中,根据计算序列,确定至少两个函数块中的哪些数据项(输入数据项和/或输出数据项)可以通过数据传递连线和/或辅助合并连线进行连接,即在得到计算序列之后,可以遵循连线规则组合函数块的内部数据项之间的连接,以生成组合函数块对应的VMS。
例如,对于两个数据类型属性匹配、数据类别属性也相同的数据项,可通过数据传递连线和/或辅助合并连线进行连接。
如果数据项是基本组合数据类型的数据项,即typeclass=1,可以对该数据项进行展开动作,展开动作对该数据项及其内部包含的数据项的数据类型属性、数据类别属性没有影响。组合数据类型展开后,可对内部包含的数据项进行类型匹配判断,类型匹配成功后,可对内部包含的数据项进行连线动作。如果组合数据项内部包含的数据项也是组合数据类型的数据项,可对内部包含的数据项继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型、通用指针类型、泛型。
在一些实施例中,当输出数据项和输入数据项满足类型匹配规则,通过数据传递连线中的输出输入传递线将输出数据项连接至输入数据项,若输出数据项出现在输入数据项之前,则设置输入数据项的存储类型属性为虚拟存储,不改变输出数据项的存储类型属性,并记录输出数据项和输入数据项的连接关系。在这种情况下,该输出输入传递线在图形化中体现为:通过带箭头的连线将输出数据项连接至输入数据项,箭头指向输入数据项,将表示输入数据项的图形(例如,圆)变为空心图形,不改变表示输出数据项的图形;该输出输入传递线在VMS部分的XML中体现为:在VMS部分的XML中,将输入数据项的第二相对路径存储在连接输入数据项的有向线段终点destination标签的path属性中,将输出数据项的第二相对路径存储在连接输出数据项的有向线段起点source标签的path属性中,将输入数据项的memory的值设置为0,保持输出数据项的memory的值不变。
在另一些实施例中,当输出数据项和输入数据项满足类型匹配规则,通过数据传递连线中的输出输入传递线将输出数据项连接至输入数据项,若输出数据项出现在输入数据项之后,或者若输出数据项和输入数据项属于同一个函数块,将输出数据项的存储类型属性设置为虚拟存储,不改变输入数据项的存储类型属性,并记录输入数据项和输出数据项的连接关系。在这种情况下,该输出输入传递线在图形化中体现为:通过带箭头的连线将输出数据项连接至输入数据项,箭头指向输入数据项,将表示输出数据项的图形(例如,圆)变为空心图形,不改变表示输入数据项的图形;该输出输入传递线在VMS部分的XML中体现为:在VMS部分的XML中,将输入数据项的第二相对路径存储在连接输入数据项的有向线段终点destination标签的path属性中,将连接输出数据项的第二相对路径存储在输出数据项的有向线段起点source标签的path属性中,将输出数据项的memory的值设置为0,保持输入数据项的memory的值不变。
例如,如图8C所示,加法函数块expaddI的输出引脚对应的输出数据项k11和除法函数块expdivI的第一个输入引脚对应的输入数据项g13通过输出输入传递线进行连接,除法函数块expdivI的输出引脚对应的输出数据项k12和赋值函数块assignint的输入引脚对应的输入数据项g15通过输出输入传递线进行连接。需要说明的是,在图8C中,通过带箭头的线表示输出输入传递线,箭头表示该输出输入传递线的数据流向。
例如,如图8C所示,在图形化的表达形式中,对数据项进行连线之后,由输出数据项k11通过带箭头的输出输入传递线连接到输入数据项g13,该输出数据项k11传递到输入数据项g13;由输出数据项k12通过带箭头的输出输入传递线连接到输入数据项g15,该输出数据项k12传递到输入数据项g15。除法函数块expdivI的输入数据项g13和赋值函数块assignint的输入数据项g15的存储类型属性均被修改为虚拟存储,在图8C中体现为:表示除法函数块expdivI的输入数据项g13的实心圆变为空心圆,表示赋值函数块assignint的输入数据项g15的实心圆变为空心圆。
例如,在VMS部分的XML的表达形式中,加法函数块expaddI的输出数据项k11的相对地址属性为加法函数块expaddI的输出数据项k11的第二相对路径,即0.out.0;除法函数块expdivI的输入数据项g13的相对地址属性为除法函数块expdivI的输入数据项g13的第二相对路径,即1.in.0.0;除法函数块expdivI的输出数据项k12的相对地址属性为除法函数块expdivI的输出数据项k12的第二相对路径,即1.out.0;赋值函数块assignint的输入数据项g15的相对地址属性为赋值函数块assignint的输入数据项g15的第二相对路径,即2.in.0。除法函数块expdivI的输入数据项g13和赋值函数块assignint的输入数据项g15的存储类型属性均被修改为虚拟存储,即除法函数块expdivI的输入数据项g13对应的memory和赋值函数块assignint的输入数据项g15对应的memory均设置为0。
例如,图8C所示的连线关系对应的VMS的XML表示为:
Figure PCTCN2022125382-appb-000046
Figure PCTCN2022125382-appb-000047
在一些实施例中,当两个输出数据项满足类型匹配规则,该两个输出数据项通过数据传递连线中的输出输出传递线进行连接,定义前面出现的输出数据项表示为Out1,后面出现的输出数据项表示为Out2,输出数据项Out2通过输出输出传递线连接至输出数据项Out1,此时,将输出数据项Out2的存储类型属性设置为虚拟存储,不改变输出数据项Out1的存储类型属性,记录输出数据项Out1和输出数据项Out2之间的连接关系。在这种情况下,该输出输出传递线在图形化中体现为:通过带箭头的连线将输出数据项Out2连接至输入数据项Out1,箭头指向输出数据项Out1,将表示输出数据项Out2的图形(例如,圆)变为空心图形,不改变表示输出数据项Out1的图形;该输出输出传递线在VMS部分的XML中体现为:在VMS部分的XML中,将输出数据项Out1的第二相对路径存储在destination标签的path中,将输出数据项Out2的第二相对路径存储在source的path中,将输出数据项Out2的memory的值设置为0,保持输出数据项Out1的memory的值不变。
图8C所示的示例中不存在输出输出传递线和辅助合并连线。
对于泛型的数据项D1,在泛型和另一个除指针类型外的任意类型的数据项D2之间建立连线(数据传递连线和/或辅助合并连线)之后,还具有以下泛型相关规则:
第一,如果D2是泛型,D1、D2数据类别属性、数据类型属性不变;
第二,如果D2是除指针、泛型之外的其他任意类型的数据项,则D1的数据类别属性的值变为与D2的数据类别属性的值相同、D1的数据类型属性的值变为与D2的数据类型属性的值相同。
对于指针类型的数据项,在两个指针类型的数据项之间建立连线(数据传递连线和/或辅助合并连线),还具有以下指针类型相关规则:
第一、当一个通用指针类型的数据项REF1与一个具有指向类型的指针类型的数据项REF2(即该数据项REF2指向某个具有特定数据类型的数据项,指向类型表示该指针类型的数据项REF2所指向的数据项的类型)进行连线时,数据项REF1得到指向类型,该数据项REF1的指向类型与数据项REF2的指向类型一致;
第二、与数据项REF1通过数据传递连线和/或辅助合并连线进行连接的一个或多个指针类型的数据项REFk,其中,k为任意正整数,k>0,如果数据项REFk为通用指针类型,则该数据项REFk也得到数据项REF2的指向类型;
第三、数据项REFk所属的赋值函数assignref的另一侧的数据项REFm,若数据项REFk得到数据项REF2的指向类型,则数据项REFm也得到数据项REF2的指向类型,从而使得赋值函数assignref的输入数据项的数据类型和输出数据项的数据类型相同,在赋值函数assignref中,若数据项REFk为输入数据项,则数据项REFm为输出数据项,若数据项REFk为输出数据项,则数据项REFm为输入数据项,m>0;
第四、数据项REFk所属的addAddress函数块的另一侧的数据项REFn,若数据项REFk得到数据项REF2的指向类型,则数据项REFm也得到数据项REF2的指向类型,从而使得addAddress函数块的输入指针类型数据项所指向的数据类型和输出指针类型数据项指向的数据类型相同,在addAddress中,若数据项REFk为输入数据项,则数据项 REFn为输出数据项,若数据项REFk为输出数据项,则数据项REFn为输入数据项,n>0;
第五、对于函数块getName,在函数块getName的输入数据项是泛型(即任意数据类型),函数块getName的输出数据项是通用指针类型的情况下,当输入数据项与一个特定数据类型属性(基本数据类型/组合数据类型)的数据项T进行连线时,该输入数据项得到数据项T的数据类型属性,即输入数据项的数据类型属性和数据项T的数据类型属性相同,通用指针类型的输出数据项得到指向类型,且该输出数据项的指向类型和数据项T的数据类型属性相同,继续应用上述第一至第三描述的规则。
第六、与数据项REFm通过数据传递连线和/或辅助合并连线进行连接的数据项(例如,该数据项的数据类型和数据项REF2的指向类型相同),继续应用上述第一至第三描述的规则。
综上,对于至少部分输入数据项和/或至少部分输出数据项中的第一指针数据项和第二指针数据项,第一指针数据项的数据类型属性为通用指针类型,第二指针数据项为非通用指针类型,即第二指针数据项具有指向的数据项,响应于第一指针数据项和第二指针数据项通过数据传递连线或辅助合并连线进行连接,则设置第一指针数据项指向的数据项与第二指针数据项所指向的数据项相同。
当通用指针类型的数据项的指向类型确定后,在该通用指针数据项内部记录该指针类型指向的数据项的确定类型格式。例如id为r的指针数据项内部包含它所指向的数据项d的类型描述,指针部分的XML表示为:
<type id="r"name=""value=""typeclass="4"typevalue="&T1"typeid="">
<type id="d"name=""value=""typeclass=""typevalue="T1"typeid=""/>
</type>
如果数据项是非通用指针类型,可以对该数据项进行展开动作,展开动作对该数据项及其内部包含的数据项的数据类型属性、数据类别属性没有影响。指针类型展开后,可对内部包含的数据项进行类型匹配判断,类型匹配成功后,可对内部包含的数据项进行连线动作。如果指针数据项内部包含的数据项也是组合数据类型(基本组合数据类型、异或类型、数组类型、非通用指针类型),可对内部包含的数据项继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型、通用指针类型、泛型。
例如,如图7A所示,步骤S54包括:生成接口。
例如,每个组合函数块对应的接口部分的XML表示为:
<PF id=""name="">
<in>
输入部分
</in>
<out>
输出部分
</out>
</PF>
组合函数块的接口部分由组合函数块的名称、输入部分和输出部分组成。组合函数块的名称可以包括:用户定义的名称,用id表示;系统定义的名称,用name表示,编码规则与基本函数块相同。组合函数块的输入部分用<in></in>结构表示,组合函数块的 输出部分用<out></out>结构表示,<in>和</in>之间是具体的输入数据项,<out>和</out>之间是具体的输出数据项。
在接口部分的XML中,数据项(输入数据项和输出数据项)表示为:
<type id=""name=""value=""typeclass="类型类别"typevalue="类型标签"typeid="用户自定义类型名称"memory=""/>;其中,typevalue表示数据项的数据类型属性,即组合数据项的类型标签,遵循类型命名规则;id表示数据项的注释说明,可由用户具体化命名;name表示数据项的物理地址(即表示算法运行时的该数据项所在的物理地址);value可以表示数据项的值,数据值不为空,表示该数据项为常量数据项,在图形化表达方式,常量数据项表示为黄色的实心圆;typeclass以表示数据项的数据类别属性,由使用的组合范式决定;typeid表示用户定义的数据类型属性的名称,比如linknode、treenode等等;memory表示数据项的存储类型属性,memory的值为0表示虚拟存储,图形化表示为空心圆,memory的值为1表示真实存储,图形化表示为实心圆。例如,typeclass可以采用数字表示,当typeclass为0时,其表示基本数据类型;当typeclass为1时,其表示基本组合数据类型;当typeclass为2时,其表示该数据结构为数组结构;当typeclass为3时,其表示2选1结构类型;当typeclass为4时,其表示指针类型;当typeclass为5时,其表示泛型。
例如,当至少一个组合范式为顺序组合范式,组合函数块为顺序结构的组合函数块,此时,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口组合过程中,组合函数块对应的接口中的数据项由至少两个函数块对应接口中的数据项按计算序列顺序生成,至少两个函数块中的每一个函数块在完成连线动作后按照接口提取规则可提取出一项数据项(也就是说,将函数块中的所有可以被提取为接口的输入数据项提取为一个数据项,将函数块中的所有可以被提取为接口的输出数据项提取为一个数据项)或者不提取出数据项,组合函数块对应的接口中的数据项的数据类别属性为基本组合数据类型。
假定对于顺序组合范式,在形成顺序结构的组合函数块的接口的输入部分或者输出部分时,从计算序列中提取了n个数据项d1,d2,...dn,n个数据项的数据类别分别为tc1,tc2,...tcn,数据类型分别为t1,t2,...tn,其中,n>1,则形成的接口数据项(即接口的数据项)为基本组合数据类型的数据项,该接口数据项内部包含n个数据项d1,d2,...dn的描述,该接口数据项的xml描述如下:
<type id=""name=""value=""typeclass="1"typevalue=""typeid="">
<type id=""name=""value=""typeclass="tc1"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="tc2"typevalue="t2"typeid=""/>
......
<type id=""name=""value=""typeclass="tcn"typevalue="tn"typeid=""/>
</type>
假定对于顺序组合范式,在形成顺序结构的组合函数块的接口的输入部分或者输出部分时,从计算序列中提取了1个数据项d1,该数据项的数据类别为tc1,数据类型为t1,则形成的接口数据项原本应用的基本组合数据类型可以省略,直接使用数据项d1作为接口数据项,该接口数据项的xml描述如下:
<type id=""name=""value=""typeclass="tc1"typevalue="t1"typeid=""/>
图8D为基于图8C所示的连线关系确定的组合函数块对应的接口的图形化的表达形式的示意图,图8E为图8D所示的接口的存储层级结构图。
例如,图8D示出了组合函数块对应的接口的图形化的表达形式,(a+b)/2可以为组合函数块的名称,由用户定义,该接口的输入部分包括两个输入数据项,该接口的输出部分包括一个输出数据项。如图8E所示,在该组合函数块对应的接口的存储层级结构图中,输入部分的总层级为2,输出部分的总层级为1,输入部分的当前显示层级为2,输出部分的当前显示层级为1,此时,输入部分示出了两个输入数据项,输出部分示出了一个输出数据项。
需要说明的是,关于顺序结构的组合函数块的接口的提取规则可以参考上述提取接口的相关说明,在此不再赘述。
例如,如图8D所示的接口的XML表示为:
<PF id="(a+b)/2"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid=""memory="1">
<type id="g11"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="g12"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="k13"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>。
例如,如图7A所示,步骤S55包括:生成PFVMS。在生成组合函数块对应的接口之后,可以生成组合函数块对应的PFVMS部分的XML,PFVMS部分用于描述由各个函数块组成的计算序列中的对应数据项与该组合函数块的接口中的数据项的对照关系,同时还描述输入数据项之间辅助合并连线的关系。PFVMS生成后,删除VMS中带有undirected属性的部分内容。需要说明的是,在PFVMS中,输入数据项之间的辅助合并连线的关系表示为:接口中的一个数据项与小函数块中被辅助合并连线连接起来的多个输入数据项之间的VMS关系。例如,小函数块中的输入数据项a、b、c之间通过辅助合并连线进行连接,输入数据项a、b、c被提取作为接口的数据项m,则PFVMS中最终形成(m,a)、(m,b)、(m,c)三条线的信息。
PFVMS部分的XML表示为:
Figure PCTCN2022125382-appb-000048
在上述PFVMS部分的XML中,一组line标签表示一个数据项的对照关系;source标签的path属性表示大函数接口区的数据项的第一相对路径,destination标签的path属 性表示计算序列中该对应数据项的第二相对路径。
PFVMS部分的JSON表示为:
Figure PCTCN2022125382-appb-000049
图8D所示的接口对应的PFVMS部分的XML表示如下:
Figure PCTCN2022125382-appb-000050
图7D为本公开一些实施例提供的两个函数块的图形化的表达形式的示意图。
例如,辅助合并连线的关系描述表示为,将一组存储辅助合并连线的数据项中的第一个输入数据项提取为接口,则除了第一个输入数据项之外,其他的输入数据项均与该第一个输入数据项创建对应关系。例如,图7D示出了函数块PF20和函数块PF21,对函数块PF20和函数块PF21进行组织以得到一个组合函数块,函数块PF20包括一个输入数据项a20,函数块PF21包括一个输入数据项a21,输入数据项a20和输入数据项a21通过辅助合并连线进行连接,此时,该辅助合并连线的关系存储在该组合函数块的带有undirected属性的VMS部分,VMS部分如下所示:
Figure PCTCN2022125382-appb-000051
在函数块PF20中的输入数据项a20(即第一个输入数据项)提取为接口后,更新该组合函数块的PFVMS部分,需要把与输入数据项a20有辅助合并连线关系的输入数据项a21均建立与输入数据项a20的对应关系。例如,上述组合函数块对应的接口部分表示为:
<in>
<type id=""name=""value=""typevalue="int2int"typeclass="1"typeid="">
<type id=""name=""value=""typevalue="int2"typeclass="1"typeid=""memory="1">
<type id=""name=""value=""typevalue="int"typeclass="0"typeid=""memory="1"/>
<type id=""name=""value=""typevalue="int"typeclass="0"typeid=""memory="1"/>
</type>
<type id=""name=""value=""typevalue="int"typeclass="0"typeid=""memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typevalue="intint"typeclass="1"typeid="">
<type id=""name=""value=""typevalue="int"typeclass="0"typeid=""memory="1"/>
<type id=""name=""value=""typevalue="int"typeclass="0"typeid=""memory="1"/>
</type>
</out>
上述组合函数块对应的PFVMS部分为:
Figure PCTCN2022125382-appb-000052
需要说明的是,在更新组合函数块对应的PFVMS部分之后,带有undirected属性的VMS部分需要被删除。
例如,如图7A所示,步骤S56包括:形成顺序结构的组合函数块。由此,经过步骤S50-S56,顺序结构的组合函数块组织完成,并生成顺序结构的组合函数块的完整结构。 例如,组合函数块(a+b)/2对应的完整的XML表示为:
Figure PCTCN2022125382-appb-000053
Figure PCTCN2022125382-appb-000054
图9A为本公开一些实施例提供的一种if结构的组合函数块的示意图;图9B为本公开一些实施例提供的一种基于if组合范式组合函数块的方法的示意图;图9C为本公开一些实施例提供的一种if结构的组合函数块的图形化的表达形式的示意图。
例如,基于if组合范式组合至少两个函数块以得到if结构的组合函数块,如图9A所示,条件组合范式包括判断条件部分exp、第一分支部分doTrue和第二分支部分doFalse。第一分支部分doTrue表示判断条件部分exp的判断条件的结果为真时的分支,第二分支部分doFalse表示判断条件部分exp的判断条件的结果为假时的分支。判断条件部分exp包括至少一个函数块,第一分支部分doTrue包括至少一个函数块,第二分支部分doFalse也包括至少一个函数块。需要说明的是,在条件结构的组合函数块中,第一分支部分doTrue和第二分支部分doFalse中可有一个分支为空,即第一分支部分doTrue或第二分支部分doFalse可以不包括任何函数块。
例如,在组织if结构的组合函数块的过程中,利用至少一个函数块逐步填充if组合范式的结构模板。
任意的if结构的组合函数块对应的计算序列部分的XML表示为:
<exp name="">
<F/PF id=""name="">
<in>
</in>
<out>
</out>
</F/PF>
</exp>
<doTrue name="">
<F/PF id=""name="">
<in>
</in>
<out>
</out>
</F/PF>
</doTrue>
<doFalse name="">
<F/PF id=""name="">
<in>
</in>
<out>
</out>
</F/PF>
</doFalse>
例如,if结构的组合函数块对应的计算序列部分包括:判断条件部分exp,由<exp></exp>结构表示;条件为真时的分支结构,即第一分支部分doTrue,由<doTrue></doTrue>结构表示;条件为假时的分支结构,即第二分支部分doFalse,由<doFalse></doFalse>结构表示。如图9A所示,exp部分通过一个二选一模块与第一分支部分doTrue和第二分支部分doFalse连接,当该exp部分的输出为1,则执行doTrue分支;当该exp部分的输出为0,则执行doFalse。
例如,判断条件部分exp、第一分支部分doTrue和第二分支部分doFalse的相对地址,基于编码规则,相对地址分别为0、1、2。每个部分中的函数块的相对地址按照序号0、1、…进行编码。上述相对地址和编码规则用于辅助说明在第一相对路径、第二相对路径中数据项的定位,在实际操作中,该相对地址属性可以不存在、不设置,结构体本身的组成即代表了数据项所在的嵌套路径,由算法根据编码规则自动计算即可。例如,判断条件部分exp的函数块的输出数据项为boolean类型的数据项。当doTrue部分和doFalse部分均存在时,doTrue部分包括至少一个函数块,doFalse部分包括至少一个函数块。例如,doTrue部分或doFalse部分可以为空,即不包括任何函数块。
例如,如图9B所示,基于if组合范式组合函数块的方法包括步骤S60-S66。例如,如图9B所示,步骤S60包括:选择if组合范式。
例如,步骤S61包括:选择至少两个函数块并组织计算序列。
例如,对于if结构的三个部分(判断条件部分exp、第一分支部分doTrue和第二分支部分doFalse),按照需求从函数块库中分别为每个部分选择至少一个函数块(在本公开的实施例中,以每个部分包括一个函数块为例),并基于if组合范式将选择的函数块 进行排列,以形成对应的计算序列。可对选择的函数块组成的计算序列中的数据项进行id值具体化,即可按需求修改数据项的id值,以使得该计算序列更易被理解。
例如,在形成计算序列之后,可以对数据项进行属性设置。步骤S62包括:常量设置。组织好计算序列后可以根据需要对数据项进行常量设置,并设置在数据项的value属性中。
例如,在一些实施例中,需要实现的功能为:比较两个int类型的数据项(即第一数据项和第二数据项)的大小,如果第一数据项大于第二数据项则执行减法,如果第一数据项小于第二数据项则执行加法。基于该功能,从函数块库中选择三个函数块,分别为表示小于关系表达式的函数块lessint(用于实现小于比较)、加法函数块expaddI和减法函数块expsubI。如图9C所示,基于if组合范式,函数块lessint设置在if结构中的判断条件部分exp,if结构中的条件为真时的第一分支部分doTrue设置一个加法函数块expaddI和条件为假时的第二分支部分doFalse设置一个减法函数块expsubI。
例如,图9C所示的三个函数块形成的计算序列的XML表示为:
<exp name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclass="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp>
<doTrue name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int3"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int4"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="int5"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</doTrue>
<doFalse name="">
<F id="expsubI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int3"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int4"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="int6"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</doFalse>
例如,如图9B所示,步骤S63包括执行连线操作,生成VMS。在步骤S61中,根据计算序列,确定该三个函数块中的哪些数据项(输入数据项和/或输出数据项)可以通过数据传递连线和/或辅助合并连线进行连接,即在得到计算序列之后,可以遵循连线规则进行if结构的组合函数块的内部数据项之间的连接,以生成if结构的组合函数块对应的VMS。例如,对于if组合范式,在组织函数块的过程中,存在辅助合并连线以及输出数据项连向输出数据项的数据传递连线,因为判断条件部分exp中的函数块的输出部分用于做判断操作,不参与连线操作,doTrue和doFalse两个分支的输出数据项不会同时存在,同类型的输出数据项可以进行数据传递连线。
例如,在图9C所示的示例中,数据项之间的连线关系仅为辅助合并连线关系。但本公开不限于此,在if结构,数据项之间的连接关系可以包括数据传递连线关系和/或辅助合并连线关系。需要说明的是,连线操作的具体连线规则可以参考上面对于连线规则中的相关描述,在此不再赘述。
图9D为对图9C所示的组合函数块中的数据项进行连线之后的图形化的表达形式的示意图。
例如,如图9D所示,在图形化的表达形式中,doTrue分支中的加法函数块expaddI的输入数据项int3、int4分别和dofalse分支中的减法函数块expsubI的输入数据项int3、int4通过辅助合并连线进行连接,doFalse分支中的减法函数块expsubI的输入数据项对应的圆变为空心圆。
例如,图9D所示的连线关系对应的VMS的XML表示为:
Figure PCTCN2022125382-appb-000055
例如,在VMS部分的XML的表达形式中,doTrue分支中的加法函数块expaddI的输入数据项int3、int4的source path分别为输入数据项int3、int4的第二相对路径,即1.0.in.0.0和1.0.in.0.1,doTrue分支中的加法函数块expaddI的输入数据项int3、int4的memory均为1,即doTrue分支中的加法函数块expaddI的输入数据项int3、int4为真实存储;doFalse分支中的减法函数块expsubI的输入数据项int3、int4的destination path分别为输入数据项int3、int4的第二相对路径,即2.0.in.0.0和2.0.in.0.1,doFalse分支中的减法函数块expsubI的输入数据项int3、int4的memory为0,即doFalse分支中的减法函数块expsubI的输入数据项int3、int4为虚拟存储。
例如,如图9B所示,步骤S64包括:生成接口。生成接口时的规则可以参考前述关于步骤S13中的将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口的相关描述。
例如,条件结构的组合函数块可以包括异或类型的数据项。异或类型是if结构的组合函数块在形成输出接口时按照接口提取规则生成的组合数据类型。
doTrue分支结构和doFalse分支结构内部各包含一个顺序范式的小函数区(计算序列),拼接操作完成后,假定doTrue分支的输出按照提取规则提取出n个输出数据项d1,d2,...dn,n个数据项的数据类别为tc1,tc2,...tcn,数据类型为t1,t2,...tn,其中n>1,形成一个基本组合数据类型的数据项d,假定doFalse分支的输出按照提取规则提取出m个输出数据项s1,s2,...sm,m个数据项的数据类别为tcf1,tcf2,...tcfm,数据类型为tf1,tf2,...tfm,其中m>1,形成一个基本组合数据类型的数据项s,然后数据项d和s以异或方式进行组合,形成一个异或类型的组合数据项,该数据项的typeclass为3,typevalue为数据项d的typevalue与数据项s的typevalue以xor符号连接在一起形成,该数据项内部包含数据项d和s,该异或类型的组合数据项的xml描述如下:
<type id=""name=""value=""typeclass="3"typevalue="t1t2...tnxortf1tf2...tfm"typeid="">
<type id="d"name=""value=""typeclass="1"typevalue="t1t2...tn"typeid="">
<type id=""name=""value=""typeclass="tc1"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="tc2"typevalue="t2"typeid=""/>
......
<type id=""name=""value=""typeclass="tcn"typevalue="tn"typeid=""/>
</type>
<type id="s"name=""value=""typeclass="1"typevalue="tf1tf2...tfm"typeid="">
<type id=""name=""value=""typeclass="tcf1"typevalue="tf1"typeid=""/>
<type id=""name=""value=""typeclass="tcf2"typevalue="tf2"typeid=""/>
......
<type id=""name=""value=""typeclass="tcfm"typevalue="tfm"typeid=""/>
</type>
</type>
异或类型的数据项的图形化的表达方式可以为在实心圆(例如,蓝色)中带有‘+’符号。异或类型的数据项的XML表示如下:
<type id=""name=""value=""typeclass="3"typevalue="T1xorT2"typeid="">
<type id=""name=""value=""typeclass=""typevalue="T1"typeid=""/>
<type id=""name=""value=""typeclass=""typevalue="T2"typeid=""/>
</type>
异或类型的数据项的typevalue的命名规则为异或结构中的两个数据项的数据类型属性用xor符号连接起来。例如,T1xorT2表示数据类型T1和T2是异或关系。异或类型的数据项的typeclass值为3。
异或类型的数据项的JSON表示为:
Figure PCTCN2022125382-appb-000056
Figure PCTCN2022125382-appb-000057
在if结构的组合函数块的组织的过程中,最后形成接口的输出部分时,按照异或接口提取规则来提取数据项。
条件结构的组合函数块的接口的生成规则还包括下述特殊提取规则(包括异或结构提取规则),例如,对于条件结构的组合函数块,在步骤S13中,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口还包括:不提取条件结构的组合函数块中的属于判断条件部分的函数块的输出数据项作为条件结构的组合函数块对应的接口的一部分;响应于条件结构的组合函数包括至少两个输入数据项,将属于判断条件部分的函数块对应的接口的输入数据项、属于第一分支部分中的函数块对应的接口的输入数据项和属于第二分支部分中的函数块的对应的接口的输入数据项提取为条件结构的组合函数块的输入部分,形成一个基本组合数据类型的输入接口,条件结构的组合函数块对应的接口的输入部分的数据类别属性为基本组合数据类型;响应于条件结构的组合函数包括至少两个输出数据项,至少两个输出数据项具有异或结构,至少两个输出数据项包括属于第一分支部分中的函数块的第一输出异或部分和属于第二分支部分中的函数块的第二输出异或部分,在至少两个输出数据项中的任一输出数据项中的部分数据项被数据传递连线连接的情况下,提取任一输出数据项中的部分数据项作为条件结构的组合函数块的公共输出部分,在至少两个输出数据项中的第一输出异或部分的所有输出数据项被提取为公共输出部分的情况下,第一输出异或部分的所有输出数据项不作为异或结构的一部分,将第二输出异或部分中除被提取为公共输出部分以外的其他输出数据项单独作为异或结构的一部分。
例如,至少两个输出数据项具有异或结构表示该至少两个输出数据项组成一个具有异或类型的数据项。
需要说明的是,对于条件结构的组合函数块,在提取接口的输出部分时,不提取条件部分的函数块的输出数据项,只提取第一分支部分或第二分支部分的函数块的输出数据项。
图9E为本公开一些实施例提供的一种条件结构的组合函数块的示意图。下面结合附图9E描述异或结构提取规则。
如图9E所示,该条件结构的组合函数块包括函数块PF15、函数块PF16和函数块PF17,函数块PF15位于判断条件部分exp,函数块PF16位于第一分支部分doTrue,函数块PF17位于第二分支部分doFalse。
图9E所示的三个函数块形成的计算序列的XML表示为:
<exp name="">
<PF id="PF15"name="">
<in>
<type id="T0"name=""value=""typeclass=""typevalue="t0"typeid=""memory="1"/>
</in>
<out>
<type id=""name=""value=""typeclass=""typevalue="boolean"typeid=""memory="1"/>
</out>
</PF>
</exp>
<doTrue name="">
<PF id="PF16"name="">
<in>
<type id="T11"name=""value=""typeclass=""typevalue="t11"typeid=""memory="1"/>
</in>
<out>
<type id="T12"name=""value=""typeclass=""typevalue="t12"typeid=""memory="1"/>
</out>
</PF>
</doTrue>
<doFalse name="">
<PF id="PF17"name="">
<in>
<type id="T21"name=""value=""typeclass=""typevalue="t21"typeid=""memory="1"/>
</in>
<out>
<type id="T22"name=""value=""typeclass=""typevalue="t22"typeid=""memory="1"/>
</out>
</PF>
</doFalse>
例如,在提取接口时,判断条件部分exp的函数块PF15的输入数据项T0、函数块PF16的输入数据项T11和函数块PF17的输入数据项T21都提取为组合函数块对应的接口的输入部分,构成一个基本组合数据项,该基本组合数据项的typeclass值为1,若输入数据项T0的数据类型为t0,输入数据项T11的数据类型为t11,输入数据项T21的数据类型为t21,则该基本组合数据项的数据类型表示为t0t11t21;函数块PF16的输出数据项T12和函数块PF17的输出数据项T22具有异或结构,即构成一个异或结构的组合数据项,且输出数据项T12作为第一输出异或部分,输出数据项T22作为第二输出异或部分,若输入数据项T12的数据类型为t12,输入数据项T22的数据类型为t22,则该异或结构的组合数据项的数据类型表示为t12xort22。
最后组合得到的条件结构的组合函数块的接口部分的XML表示为:
<PF id="IF"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="t0t11t21"typeid="">
<type id="T0"name=""value=""typeclass=""typevalue="t0"typeid=""memory="1"/>
<type id="T11"name=""value=""typeclass=""typevalue="t11"typeid=""memory="1"/>
<type id="T21"name=""value=""typeclass=""typevalue="t21"typeid=""memory="1"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclass="3"typevalue="t12xort22"typeid="">
<type id="T12"name=""value=""typeclass=""typevalue="t12"typeid=""memory="1"/>
<type id="T22"name=""value=""typeclass=""typevalue="t22"typeid=""memory="1"/>
</type>
</out>
</PF>
如果输出数据项的第一输出异或部分和第二输出异或部分之间有数据传递连线存在,则把该输出数据项提取作为公共输出部分的一部分。公共输出部分与异或部分组合形成基本组合数据类型的数据项。
如果有异或结构的数据项的一个异或部分的数据项全部提取为公共输出部分的数据项,则另一个异或部分的剩余数据项保持异或结构,即把另一个异或部分的原有数据项中除提取为公共输出部分的数据项以外的其他数据项作为异或结构的一部分,typeclass为基本组合数据类型,例如,具有异或结构的数据项的第一个异或部分的数据项的数据类型为t1,第二个异或部分的数据项的数据类型为t1t2,其中两个数据类型为t1的数据项之间有数据传递连线存在,则把数据类型为t1的数据项提取为公共输出部分,第一个异或部分没有剩余数据项,第二个异或部分的剩余数据项为数据类型为t2的数据项c,数据项c单独形成异或部分数据项b,数据项b的typevalue为xort2,typeclass为3,数据项b与公共输出部分共同组合形成输出数据项,格式如下:
<type id=""name=""value=""typeclass="1"typevalue="t1(xort2)"typeid="">
<type id="a"name=""value=""typeclass=""typevalue="t1"typeid=""memory="1"/>
<type id="b"name=""value=""typeclass="3"typevalue="xort2"typeid="">
<type id="c"name=""value=""typeclass=""typevalue="t2"typeid=""memory="1"/>
</type>
</type>
异或结构的某个异或部分只有常量数据项,则把另外一个异或部分的数据项作为输出接口,不保留异或结构。
需要说明的是,在生成if结构的组合函数块的接口时,如果前述生成接口时的提取规则(即前述关于步骤S13中生成接口的相关规则)与此处描述的if结构对应的特殊的规则有冲突时,以if结构对应的特殊提取规则为优先规则。
例如,在连线操作完成之后,则可以生成接口。
条件结构的组合函数块的接口XML格式与顺序结构的组合函数块的接口格式相同,此处不再赘述。
图9F为图9E所示的if结构的组合函数块对应的接口的图形化的表达形式的示意图。如图9F所示,Ifelse为if结构的组合函数块的名称,由用户定义,该接口的输入部分包括输入数据项int2int2,输入数据项int2int2包括输入数据项int2和输入数据项int2,第一个输入数据项int2包括输入数据项int1和输入数据项int2,第二个输入数据项int2包括输入数据项int3和输入数据项int4,该接口的输出部分包括输出数据项intxorint,该输出数据项intxorint包括输出数据项int5和输出数据项int6。
例如,图9F所示的接口的XML表示为:
<PF id="ifelse"name="">
<in>
<type typevalue="int2int2"typeclass="1"typeid=""id=""name="">
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int3"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int4"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</type>
</in>
<out>
<type id=""name=""value=""typeclass="3"typevalue="intxorint"typeid="">
<type id="int5"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int6"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</out>
</PF>
例如,如图9B所示,步骤S65包括:生成PFVMS。在生成组合函数块对应的接口之后,可以生成if结构的组合函数块对应的PFVMS部分的XML。图9C所示的if结构的组合函数块对应的XML架构中的PFVMS部分表示为:
<PFVMS>
<line>
<source path="in.0.0"/>
<destination path="0.0.in.0"/
</line>
<line>
<source path="in.0.1"/>
<destination path="1.0.in.0"/>
</line>
<line>
<source path="in.0.1"/>
<destination path="2.0.in.0"/>
</line>
<line>
<source path="out.0.0"/>
<destination path="1.0.out.0"/>
</line>
<line>
<source path="out.0.1"/>
<destination path="2.0.out.0"/>
</line>
</PFVMS>
例如,如图9B所示,步骤S66包括:形成if结构的组合函数块。由此,经过步骤S60-S66,if结构的组合函数块组织完成,并生成if结构的组合函数块的完整结构。
例如,组合函数块ifelse对应的完整的XML表示为:
<PF id="ifelse"name="">
<exp name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclass="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp>
<doTrue name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int3"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int4"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="int5"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</doTrue>
<doFalse name="">
<F id="expsubI"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int3"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
<type id="int4"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="int6"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</doFalse>
<in>
<type typevalue="int2int2"typeclass="1"typeid=""id=""name="">
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="int3"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int4"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</type>
</in>
<out>
<type id=""name=""value=""typeclass="3"typevalue="intxorint"typeid="">
<type id="int5"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="int6"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</out>
<PFVMS>
<line>
<source path="in.0.0"/>
<destination path="0.0.in.0"/
</line>
<line>
<source path="in.0.1"/>
<destination path="1.0.in.0"/>
</line>
<line>
<source path="in.0.1"/>
<destination path="2.0.in.0"/>
</line>
<line>
<source path="out.0.0"/>
<destination path="1.0.out.0"/>
</line>
<line>
<source path="out.0.1"/>
<destination path="2.0.out.0"/>
</line>
</PFVMS>
</PF>
例如,两个异或类型的数据项进行连线时,该两个异或类型的数据项需满足异或类型匹配规则。异或类型匹配规则包括:异或类型相同,遵循类型相同中组合类型相同规则,t1、t2组成异或结构的数据项t1xort2,如果两个异或类型的数据项T1和T2,其按顺序的每个异或分支的数据项的类型都相同,则这两个异或类型的数据项的数据类型相同。例如,若异或类型的数据项T1表示为t1xort2,异或类型的数据项T2表示为t3xort4,当数据项t1的数据类型和数据项t3的数据类型相同,数据项t2的数据类型和数据项t4的数据类型相同,则数据项T1和数据项T2满足异或类型相同。需要说明的是,数据项t1的数据类型和数据项t2的数据类型可以相同,也可以不同,类似地,数据项t3的数据类型和数据项t4的数据类型可以相同,也可以不同。例如,若数据项t1的数据类型为int,数据项t2的数据类型为int,则数据项T1的数据类型为intxorint。
对于异或类型的组合数据项,即typeclass=3,可以对该数据项进行展开动作,展开动作对该数据项及其内部包含的数据项的数据类型属性、数据类别属性没有影响。异或类型的组合数据项展开后,可对内部包含的数据项进行类型匹配判断,类型匹配成功后,可对内部包含的数据项进行连线动作。如果异或类型的组合数据项内部包含的数据项也是组合数据类型的数据项,可对内部包含的组合数据类型的数据项继续应用展开动作, 直到数据项的类型满足类型匹配规则或者数据项为基本数据类型、通用指针类型、泛型。例如,若异或类型的数据项为XOR1,且数据项XOR1为输出数据项,数据项XOR1所在的函数块为PF。如果数据项XOR1的子结构全部都与函数块PF所在的计算序列中该函数块PF之前的数据项建立连线,那么数据项XOR1的子结构可单独与函数块PF所在的计算序列中该函数块PF之后的数据项建立连线。例如,若异或类型的数据项T1位于函数块PF2中,且为函数块PF2中的输出数据项,函数块PF2所在的计算序列包括顺序排列的函数块PF1、函数块PF2、函数块PF3、函数块PF4,此时,对于异或类型的数据项T1,之前的数据项为函数块PF1中的数据项,之后的数据项为函数块PF3和函数块PF4中的数据项。如果数据项XOR1的某个子结构与函数块PF所在的计算序列中该函数块PF之前的数据项未建立连线,数据项XOR1的另一个子结构与函数块PF所在的计算序列中该函数块PF之前的数据项建立连线,此时,异或类型的数据项XOR1必须以整体结构与函数块PF所在的计算序列中该函数块PF之后的数据项建立连线。例如,异或类型的数据项T1表示为t1xort2,位于函数块PF2中,且为函数块PF2中的输出数据项,若数据项t5与函数块PF2所在的计算序列中该函数块PF2之前的数据项未建立连线,若数据项t6与函数块PF2所在的计算序列中该函数块PF2之前的数据项建立连线,则后续使用时,必须将异或类型的数据项T1整体进行连线操作。
图10A为本公开一些实施例提供的一种for结构的组合函数块的示意图;图10B为本公开一些实施例提供的一种基于for组合范式组合函数块的方法的示意图;图10C为本公开一些实施例提供的一种for结构的组合函数块的图形化的表达形式的示意图。
例如,基于for组合范式组合至少两个函数块以得到for结构的组合函数块,如图10A所示,for组合范式包括单次表达式exp1和至少一层循环体loopN。在loopN中,默认有一层循环部分IFloop,每个IFloop包括条件表达式、中间循环表达式和末尾循环表达式,当一层IFloop不足以描述整个计算组织过程时,可按需求添加IFloop,直到能够完全描述整个计算含义。图10A展示了具有两层IFloop的for组合范式,每一层IFloop的内部结构都相同,在每层IFloop中,exp2表示条件表达式,loop表示中间循环表达式,exp3表示末尾循环表达式。单次表达式表示对循环的控制。单次表达式exp1包括至少一个函数块,一层IFloop中的条件表达式exp2包括至少一个函数块,中间循环表达式loop包括至少一个函数块,末尾循环表达式exp3包括至少一个函数块。
需要说明的是,在一层IFloop中,条件表达式exp2和中间循环表达式loop具有if结构,中间循环表达式loop为if结构中的第一分支部分doTrue。在循环范式和当型循环范式中,为了表达的简洁性,省略了IFloop中所含有的if结构提取输出数据项为异或类型的形式,即在循环范式和当型循环范式中提取接口时不产生异或类型。
例如,在组织for结构的组合函数块的过程中,利用至少一个函数块逐步填充if组合范式的结构模板。
任意的for结构的组合函数块对应的计算序列部分的XML表示为:
<exp1name="">
<F/PF id=""name="">
<in></in>
<out></out>
</F/PF>
</exp1>
<loopN name="">
<IFLoop name="">
<exp2name="">
<F/PF id=""name="">
<in></in>
<out></out>
</F/PF>
</exp2>
<loop name="">
<F/PF id=""name="">
<in></in>
<out></out>
</F/PF>
</loop>
<exp3name="">
<F/PF id=""name="">
<in></in>
<out></out>
</F/PF>
</exp3>
</IFLoop>
</loopN>
例如,for结构的组合函数块对应的计算序列部分包括:单次表达式exp1,由<exp1></exp1>结构表示;循环体loopN,由<loopN></loopN>表示,其中,每层IFloop包括条件表表达式exp2,由<exp2></exp2>结构表示,中间循环表达式loop,由<loop></loop>结构表示,以及末尾循环表达式exp3,由<exp3></exp3>结构表示。
例如,在for结构中,每层IFloop的条件表达式exp2通过一个二选一模块与当前层循环的循环表达式loop连接,当该条件表达式exp2的输出为1,则执行for结构的第一中间循环表达式loop中的函数块;当条件表达式exp2的输出为0,则跳出循环。
例如,在for结构中,exp1部分、loopN部分的相对地址值分别为0、1,并且每层IFLoop按照顺序自动编码(按照0、1、2),IFLoop中exp2、loop和exp3均相对其父级结构的相对地址值相对地址为0、1、2。每个部分中的函数块的相对地址按照序号0、1、…进行编码。上述相对地址和编码规则用于辅助说明在第一相对路径、第二相对路径中数据项的定位,在实际操作中,该相对地址属性可以不存在、不设置,结构体本身的组成即代表了数据项所在的嵌套路径,由算法根据编码规则自动计算即可。
例如,for组合范式的计算序列中exp1、exp2、exp3、loop四个部分各有一个函数块。
例如,如图10B所示,基于for组合范式组合函数块的方法包括步骤S70-S76。
步骤S70包括:选择for组合范式。
步骤S71包括:选择至少两个函数块并组织计算序列。
例如,对于for结构的四个部分exp1、exp2、exp3、loop,按照需求从函数块库中分别为每个部分选择至少一个函数块(在本公开的实施例中,以每个部分包括一个函数块为例),并基于for组合范式将选择的函数块进行排列,以形成对应的计算序列。例如,exp2部分的函数块的输出数据项必须为boolean类型的数据项。可对选择的函数块中的数据项进行id值具体化,即可按需求修改数据项的id值,以使得该计算序列更易被理解。
例如,在一些实施例中,需要实现的功能为:求一组int类型数据的合计值。基于该功能,从函数块库中选择四个函数块,分别为赋值函数块assignint、表示小于关系表达式的函数块lessint、加法函数块addint和加法函数块addint。如图10C所示,基于for组合范式,for结构中的单次表达式exp1部分设置赋值函数块assignint,for结构中的每层IFLoop的exp2部分设置表示小于关系表达式的函数块lessint,for结构中每层IFLoop的末尾循环表达式exp3部分、每层IFLoop的循环表达式loop部分各设置一个加法函数块addint。两层IFLoop足以表达整个循环结构组织过程,只需要在基础的for组合范式中增加一层IFLoop即可。
例如,图10C所示的函数块形成的计算序列的XML表示为:
<PF id="PF_For"name="">
<exp1name="">
<F id="assignint"name="">
<in>
<type id="0"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp1>
<loopN name="">
<IFLoop name="">
<exp2name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="n"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclass="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="sum1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="sum2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</exp3>
</IFLoop>
<IFLoop name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="n"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclass="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="sum1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="sum2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</exp3>
</IFloop>
</loopN>
</PF>
例如,在形成计算序列之后,可以对数据项进行属性设置。如图10B所示,步骤S72包括:常量设置。组织好计算序列后可以对数据项进行常量设置,并记录在数据项的value属性。在图10C所示的计算序列中,单次表达式exp1中的赋值函数块assignint的输入数据项为常量数据项,且值为0;每层IFloop的末尾循环表达式exp3中的加法函数块addint的第二个输入数据项为常量数据项,且值为1。如果常量设置是在循环部分IFLoop内,则表示对每个IFLoop的相应数据项都设了相同的常量。例如,如图10C中的末尾循环表达式exp3中的常量数据项1,每个IFLoop的末尾循环表达式exp3的相同位置均设置一个常量数据项1。如下xml描述:
<exp1name="">
<F id="assignint"name="">
<in>
<type id="0"name=""value="0"typeclass="0"typevalue="int"typeid=""memory="1"/>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp1>
<exp3name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value="1"typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</exp3>
例如,如图10B所示,步骤S73包括执行连线操作。在步骤S74中,根据计算序列,确定该for结构中的各个函数块中的哪些数据项(输入数据项和/或输出数据项)可以通过数据传递连线和/或辅助合并连线进行连接,即在得到计算序列之后,可以遵循连线规则进行for结构的组合函数块的内部数据项之间连接,以生成for结构的组合函数块对应的VMS。
需要说明的是,在for组合范式中,存在输出数据项连向输入数据项的数据传递连线,存在输出数据项连向输出数据项的数据传递连线,存在输入数据项连向输入数据项的辅助合并连线。因为,每层IFloop的exp2部分的函数块的输出数据项用于实现判断操作,所以每层IFloop的exp2部分的输出数据项不参与连线操作。
例如,在for结构中,对于两层IFloop,该两层IFloop的层级分别是第k层IFloop和第m层IFloop,对第k层IFloop中的某个数据项d1和第m层IFloop中的某个数据项d2进行连线表示:对k+n层IFloop对应的数据项d1和m+n层IFloop对应的数据项d2自动进行连线,k+n>0,并且k+n<=IFloop的总层数,m+n>0,m+n<=IFloop的总层数,k和m可以相同也可以不同。例如,在一些示例中,当k与m相同时,数据项d1和数据项d2在同一个IFloop中,对数据项d1和数据项d2进行连线则表示对每一个IFloop中的数据项d1和数据项d2进行自动连线;例如,在另一些示例中,当k与m不相同时,数据项d1和数据项d2之间是跨IFloop层的连线,即在不同IFloop层之间的连线,可以 跨一层IFloop也可以跨多层IFloop,即k-m的绝对值可以等于1,也可以大于1,当k-m的绝对值大于1时,数据项d1和数据项d2跨层(假设跨了c层,即k-m=c)连线,对于第k层IFloop之后的每一层IFloop的数据项d1,都与跨c层的IFloop的数据项d2进行连线。
图10D为对图10C所示的计算序列进行连线之后的一种图形化的表达形式的示意图,图10E为对图10C所示的计算序列进行连线之后的另一种图形化的表达形式的示意图,图10F为对图10C所示的计算序列进行连线之后的又一种图形化的表达形式的示意图。
例如,如图10D所示,首先,对for结构中的用于实现循环控制的数据项(数据项i)进行连线,例如,exp1部分的函数块assignint的输出数据项i和循环体loopN的第一层IFloop中的exp2部分的函数块lessint的第一个输入数据项i通过数据传递连线进行连接,exp1部分的函数块assignint的输出数据项i和循环体loopN的第一层IFloop中的exp3部分的函数块addint的输入数据项i通过数据传递连线进行连接;循环体loopN的第一层IFloop中的exp3部分的函数块addint的输出数据项i和循环体loopN的第二层IFloop中的exp2部分的函数块lessint的第一个输入数据项i、循环体loopN的第二层IFloop中的exp3部分的函数块addint的第一个输入数据项i通过数据传递连线进行连接。如图10D所示,在进行连线之后,每层IFloop中的exp2部分的函数块lessint的第一个输入数据项i、exp3部分的函数块addint的输入数据项i对应的圆变为空心圆,即表示这些数据项为虚拟存储。
此时,图10D所示的连线关系对应的VMS表示为:
Figure PCTCN2022125382-appb-000058
例如,如图10E所示,然后,对两层IFLoop之间进行数据传递连线,并保存到VMS中,例如,第一层IFLoop中的loop部分的函数块addint的输出数据项sum2连接到第二层IFLoop中的loop部分的函数块addint的第一个输入数据项sum1,即,第一层IFLoop 中的loop部分的函数块addint的输出数据项sum2通过数据传递连线进行连接至第二层IFLoop中的loop部分的函数块addint的第一个输入数据项sum1。如图10E所示,在进行连线之后,第二层IFLoop中的loop部分的函数块addint的第一个输入数据项sum1对应的圆变为空心圆,即表示该第二层IFLoop中的loop部分的函数块addint的第一个输入数据项sum1为虚拟存储。
此时,图10E所示的连线关系(包括数据项i相关的连线)对应的VMS表示为:
Figure PCTCN2022125382-appb-000059
例如,如图10F所示,为了组织函数过程中的实用性考虑,两层IFLoop的输入数据项之间可以选择使用辅助合并连线进行连线,例如,第一层IFloop中的exp2部分的函数块lessint的第二个输入数据项n和第二层IFloop中的exp2部分的函数块lessint的第二个输入数据项n通过辅助合并连线进行连接,并把连线关系记录在带属性undirected的VMS中。如图10F所示,在进行连线之后,第二层IFloop中的exp2部分的函数块lessint的第二个输入数据项n对应的圆变为空心圆,即表示该IFloop中的exp2部分的函数块lessint的第二个输入数据项n为虚拟存储。
此时,图10F所示的辅助合并连线对应的VMS表示为:
Figure PCTCN2022125382-appb-000060
Figure PCTCN2022125382-appb-000061
例如,在上述VMS的XML的表达形式中,exp1部分的函数块assignint的输出数据项i的第二相对路径为0.0.out.0;第一层IFLoop的exp2部分的函数块lessint的第一个输入数据项i的第二相对路径为1.0.0.0.in.0.0;第一层IFLoop的exp3部分的函数块addint的第一个输入数据项i的第二相对路径为1.0.2.0.in.0.0;第一层IFLoop的exp3部分的函数块addint的输出数据项i的第二相对路径为1.0.2.0.out.0;第二层IFLoop的exp2部分的函数块lessint的第一个输入数据项i的第二相对路径为1.1.0.0.in.0.0;第二层IFLoop的exp3部分的函数块addint的第一个输入数据项i的第二相对路径为1.1.2.0.in.0.0;第一层IFLoop的loop部分的函数块addint的输出数据项sum2的第二相对路径为1.0.1.0.out.0;第二层IFLoop的loop部分的函数块addint的第一个输入数据项sum1的第二相对路径为1.1.1.0.in.0.0;第一层IFLoop的exp2部分的函数块lessint的第二个输入数据项n的第二相对路径为1.0.0.0.in.0.1;第二层IFLoop的exp2部分的函数块lessint的第二个输入数据项n的第二相对路径为1.1.0.0.in.0.1。
例如,如图10B所示,步骤S74包括:生成接口。
循环结构的组合函数块的接口的生成规则还包括下述N化提取规则:
当至少一个组合范式包括循环组合范式,每个循环体loopN包括多个循环部分IFloop时,N化条件为:在多个循环部分IFloop之间具有相同位置的数据项没有被连线。当至少一个组合范式包括当型循环组合范式,当型循环体包括多个当型循环部分时,N化条件为:多个当型循环部分之间具有相同位置的数据项没有被连线。
在对数据项连线完成后,按照N化提取规则,待N化数据项可以根据预先设定的N化条件自动确定。
对数据项D进行N化提取,假定数据项D的类型属性为T,将产生一个数组数据项a,其中a是由与数据项D的数据类型、数据类别属性相同的多个数据项逻辑上顺序排列形成的数据结构,a的数据类型属性为T[],数据类别属性为2。
数组数据项a的内部包含n个T类型的数据项,n可以是任意常数,也可以是一个变量,对n个T类型的数据项进行简化表示,只给出一个数据项描述即可,T[]类型的数组数据项的xml表示如下:
<type id="a"name=""value=""typeclass="2"typevalue="T[]"typeid="">
<type id="d"name=""value=""typeclass="0、1、2、3、4或者5"typevalue="T"typeid=""/>
</type>
N化后的数据项被提取作为接口的组成部分,PFVMS中建立一条连接数据项d和数据项D的连线关系,其中数据项d是大函数接口中N化数据a的内部数据项,数据项D是小函数组合区被N化的原始数据项。
例如,由于每层IFloop的结构是相同的,因此,每层IFloop具有的输入数据项和输出数据项是相同的。如图10C所示,第一层IFloop具有两个输入数据项i、输入数据项n、输入数据项sum1、输入数据项a、常量类型的输入数据项1,第一层IFloop具有输出数据项boolean、输出数据项sum2和输出数据项i;同样地,第二层IFloop也具有两个输入数据项i、输入数据项n、输入数据项sum1、输入数据项a、常量类型的输入数据项1, 第二层IFloop也具有输出数据项boolean、输出数据项sum2和输出数据项i。
循环结构的组合函数块的接口的生成规则还包括下述N化提取规则:
例如,在N化提取规则中,对于循环结构的组合函数块中的任一输入数据项,如果在多层IFloop中的一些IFloop中的该任一输入数据项被连线连接,在多层IFloop中的另一些IFloop中的该任一输入数据项没有被连线,提供与多层IFloop对应的多个任一输入数据项的存储属性为真实存储的输入数据项对应的接口,也就是说,在提取接口时,只提取存储属性为真实存储的输入数据项,且该输入数据项不做N化提取。
例如,在N化提取规则中,对于循环结构的组合函数块中的任一输出数据项,如果在多层IFloop中的一些IFloop中的任一输出数据项被连线连接,在多层IFloop中的另一些IFloop中的任一输出数据项没有被连线,只提供多层IFloop中的第一层IFloop中的任一输出数据项为对应的接口或者对多层IFloop中的多个任一输出数据项进行N化提取,也就是说,在提取接口时,可选择只提取第一个IFloop中的该输出数据项为接口其他IFloop中的该输出数据项不进行提取,或者对该输出数据项做N化提取。
如果前述生成接口时的提取规则(即前述关于步骤S13中生成接口的相关规则)与此处描述的特殊提取规则有冲突时,以此处描述的特殊提取规则为优先规则。
循环结构的组合函数块的接口的生成规则还包括下述特殊提取规则,对于循环结构的组合函数块,在步骤S13中,将至少两个函数块封装为组合函数块,并生成组合函数块对应的接口还包括:不提供与循环结构的组合函数块中的位于单次表达式、每层IFloop的条件表达式、每层IFloop的末尾循环表达式中的函数块的输出数据项对应的接口,常量数据项不提取作为接口的一部分。例如,对于循环结构的组合函数块,在提取接口时,以N化提取规则为优先级别高的规则,顺序组合范式对应的接口提取规则为优先级别低的规则。
N化结构的数据项不存在于计算序列中,只存在于for组合范式的大函数接口区中,例如,循环结构的组合函数块的接口的生成规则还包括下述特殊提取规则:当循环组合范式中的每一个IFloop的相同位置上的任一个数据项d(例如,输入数据项或输出数据项)没有被连线(数据传递连线或辅助合并连线)连接,那么,对于多层IFloop,则具有相同的多个数据项d,把多个数据项d提取为组合得到的组合函数块的接口时,接口上形成了一个由多个数据项d形成的N化数组d[],此时,N化数组d[]对应于循环组合范式中的多层IFloop中的多个数据项d。N化数组d[]为数组类型的数组数据项。
由单次表达式提取出来的输入数据项和由循环体loopN中提取出来的输入数据项组合形成for组合范式的输入部分,数据项的数据类别为1即基本组合数据类型,输入部分的数据项的内部可能包含有数组类型的数据项,特殊情况下,如果单次表达式没有提取出数据项并且循环体loopN中只提取出一个数组类型的数据项,则该数组类型的数据项作为最终形成的for组合范式的输入部分,不需要再组合成基本组合数据,此时输入部分的数据项的数据类别属性为2即数组类型。
for组合范式的输出部分是由循环体loopN中的部分提取的输出数据进行组合,最终形成的数据项的数据类别为1即基本组合数据类型,输出部分的数据项的内部可能包含有数组类型的数据项,特殊情况下,如果循环体只提取出一个数组类型的数据项则该数组类型的数据项做为最终形成的for组合范式的输出部分,不需要再组合成基本组合数据,此时输出部分的数据项的数据类别属性为2即数组类型。
需要说明的是,在生成for结构的组合函数块的接口时,如果前述生成接口时的提取规则(即前述关于步骤S13中生成接口的相关规则)与此处描述的for结构对应的特殊的规则有冲突时,以for结构对应的特殊提取规则为优先规则。另外,在生成for结构的组合函数块的接口时,可以自由地选择是否提取输出数据项为for结构组合函数块对应的接口的一部分。
图10G为图10F所示的for结构的组合函数块对应的接口的图形化的表达形式的示意图。
如图10G所示,PF_For为组合函数块的名称,由用户定义,该接口的输入部分包括输入数据项n和intint[](数组数据项),该接口的输出部分包括输出数据项sum2[](数组数据项)。输入数据项intint[]包括数据项sum1和数组数据项a[],数据项a[]是根据提取接口规则由数据项a提取出来的N化数据项,数据项sum2[]是根据提取接口规则由输出数据项sum2进行N化提取得到。
例如,如图10G所示的接口的XML表示为:
<PF id="PF_for"name="">
<in>
<type id=""name=""value=""typeclass="1"typevalue="int(intint[])"typeid="">
<type id="n"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="intint[]"name=""value=""typeclass="1"typevalue="intint[]"typeid=""memory="1">
<type id="sum1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="a[]"name=""value=""typeclass="2"typevalue="int[]"typeid=""memory="1">
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</type>
</type>
</in>
<out>
<type id="sum2[]"name=""value=""typeclass="2"typevalue="int[]"typeid=""memory="1">
<type id="sum2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</out>
</PF>
例如,在上述接口的XML中,数组数据项a[]的typevalue为int[],数组数据项a[]的typeclass为2;数组数据项sum2[]的typevalue为int[],数组数据项sum2[]的typeclass为2。
例如,在for结构的组合函数块的组织过程中,如果对某个数据项进行N化提取接 口,则在for结构的组合函数块对应的接口对应的数据项被提取到接口时变化为数组结构的数据项。
例如,数组类型可以由对基本数据类型的数据项进行N化提取得到,也可以由对组合数据类型的数据项进行N化提取得到,数组类型属于组合数据类型的一种。例如,数组类型的数据项可以被称为数组数据项。
例如,数组类型的数据项的typevalue表示方式为:类型+[]。数组类型的数据项的XML表示为:
<type id=""name=""value=""typeclass="2"typevalue="T[]"typeid="T[]">
<type id=""name=""value=""typeclass=""typevalue="T"typeid=""/>
</type>
例如,数组数据项的typevalue表示为T[],T为数据类型属性,例如,T可以为int或int2等,数组类型的数据项的typeclass为2。
例如,int类型的数组数据项的数组结构的XML表示为:
<type id=""name=""value=""typeclass="2"typevalue="int[]"typeid="int[]">
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>
例如,int 2类型的数组数据项的数组结构的XML表示为:
<type id=""name=""value=""typeclass="2"typevalue="int2[]"typeid="int2[]">
<type id=""name=""value=""typeclass="1"typevalue="int2"typeid="int2">
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
<type id=""name=""value=""typeclass="0"typevalue="int"typeid="int"/>
</type>
</type>
例如,在int 2类型的数组数据项中的每一个数据项包括两个int类型的数据项。
使用getname函数时,假定输入数据项是一个数组类型的数据项,类型属性为T[],则输出数据项是一个指向T类型数组数据项的指针,该指针指向数组数据项的第一个数据项:
<F id="getname"name="">
<in>
<type id=""name=""value=""typeclass="2"typevalue="T[]"typeid="T[]">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="T"typeid="T"/>
</type>
</in>
<out>
<type id=""name=""value=""typeclass="4"typevalue="&T[]"typeid="ref">
<type id=""name=""value=""typeclass="2"typevalue="T[]"typeid="T[]">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="T"typeid="T"/>
</type>
</type>
</out>
</F>
使用addAddress函数时,两个输入数据项的类型分别是指向数组的指针类型和int类型,输出数据项是与输入的指针数据项的数据类型相同,使用该addAddress函数表示输入数据项的指针是指向某数组数据项中的某一个数据项的地址。
addAddress函数具有两个约束,约束一:输入的指针数据项指向某数组数据项中的某一个数据项,该指针数据项的来源一是getname对某个数组数据项获取第一个数据项的地址的输出,来源于二是addAddress函数的输出,数组数据项中的每个数据项在逻辑上是依次有序排列,满足地址可加性;约束二:数组数据项中的每一个数据项的数据类别属性相同、数据类型属性相同,每个数据项的类型属性相同保证了逻辑上每个数据项的存储大小是规则的、一致的,即数组数据项中相邻的数据项之间的逻辑间隔是相等的,满足地址可加性。假定addAddress函数的第一个输入数据项是一个指向为数组t[]的指针数据项,第二个输入数据项是常量1,则该addAddress函数表示获取当前输入指针数据项所指向的数据项的后一个数据项的地址指针,该数据项的类型也是t,隐含约束为当前指针及其后的1个数据项都属于同一个数组数据项范围;假定addAddress函数的第一个输入数据项是一个指向为数组t[]的指针数据项,第二个输入数据项是int类型的数据项n,则该定addAddress函数表示获取当前输入指针数据项所指向的数据项的后第n个数据项的地址指针,该数据项的类型也是t,隐含约束为当前指针及其后的n个数据项都属于同一个数组数据项范围。
数组类型的数据项进行连线需满足数组类型匹配规则和连线要求规则。
允许对组合数据类型数组的数据项进行展开动作,展开动作对该数据项及其内部包含的数据项的数据类型属性、数据类别属性有影响,展开动作的操作过程遵循如下数组逻辑等同变换规则,如果展开后的数据项内部包含的数组数据项也是组合数据类型数组,可对内部包含的组合数据类型数组继续应用展开动作,直到数据项的类型满足类型匹配规则或者数据项为基本数据类型数组、指针类型数组、泛型数组。
假定一数组类型数据项T[],该数组类型数据项的数据类别属性为2,数据类型属性为T[],如果T是一个组合数据类型,内部包含k个数据项,k个数据项的数据类型分别为t1、t2、...、tk,则T的数据类别属性可能为1、3(除基本数据类型以外),T的数据类型属性为t1t2...tk。对数组类型数据项T[]进行展开动作,对k个数据项进行N化,形成k个数组数据项t1[]、t2[]、...tk[],k个数组数据项中的每个数组数据项的数据类别属性为2,同时遵循数据类型的组合规则,数组数据项T[]变成由t1[]、t2[]、...tk[]组合形成的组合数据项D,即取消T[]的N化,D的数据类别属性与T的数据类别属性相同(可能为1、3),D的数据类型属性为t1[]t2[]...tk[]。如果t1、t2、...、tk中存在组合数据类型,可以对该组合数据类型数组继续递归应用展开动作,直到满足下面两个条件,终止展开操作:第一、此时的数据项为基本类型数组,不可展开;第二、满足用户连线操作要求时,可选择不再展开操作。
假定一个数组数据项T[],该数组数据项T[]的数据类别属性为2,该数组数据项T[]的数据类型属性为T[],如果T是一个组合数据类型的数组,即T本身是一个数组,该数组内部包含m个数据项t1、t2、...、tm,则T的数据类型属性为(t1t2...tm)[],T的数据类 别属性为2,数组数据项T[]的数据类型属性为((t1t2...tm)[])[],对数组数据项T[]进行展开动作需要先对T进行展开,即先对(t1t2...tm)[]数据项进行展开,展开动作如上描述,把(t1t2...tm)[]展开为t1[]t2[]...tm[],此时数组数据项T[]的数据类型属性为(t1[]t2[]...tm[])[],数据类别属性为2,如果t1、t2、...、tm中也存在组合数据类型的数组,则先对t1、t2、...、tm中的组合数据类型的数组进行展开,再对上层数组进行展开动作。
例如,对于数组逻辑等同规则,具体操作表示为:数组结构的展开规则,即针对数组类型的数据项所在的函数块,对于数组类型的数据项可做逻辑等同的展开操作,进行展开操作时,需按照以下描述操作:假设函数块的当前层的输出数据项为数组类型的数据项,数组类型的数据项的数据类别属性为2,数据类型属性为((t1t2)t3)[],该数组类型的数据项是一个组合数据类型数组,内部包含一个组合数据类型的数据项D1(数据类型属性为t1t2)和一个基本数据类型的数据项D2(数据类型属性为t3),组合数据类型为((t1t2)t3),数据类别属性为1。对于该数组类型的数据项进行展开时,对于该数据项内部包含的数据项D1、D2,逻辑上N化为每个数据项的数组形式,形成数据类型属性为(t1t2)[]和t3[]的两个数组数据项,数组数据项的数据类别属性为2,同时把原数据项T[]进行取消N化操作,根据typevalue的生成规则,生成的数据类型属性为(t1t2)[]t3[]以及数据类别属性为1的数据项;对于展开后形成的数据类型属性为(t1t2)[]的数组数据项,可根据用户意愿选择继续展开,对于数据类型属性为t3[]的数据项,因为是基本数据类型的数组,不满足展开条件,不能对该数据类型属性为t3[]的数据项继续展开。对于输入数据项,可以参考上述对于输出数据项的相关说明。数组数据项被展开后,可以按照上述步骤的逆动作进行合并,直到数据项的第一层级。
如图3(1)A是带有基本组合数据类型的数组数据项的函数块,如图3(1)A所示,基本组合数据类型的数组数据项表示为(int(intstring))[];图3(1)B是对该数组数据项进行连线展开动作后的形式,如图3(1)B所示,将数组数据项(int(intstring))[]进行连线展开后,可以形成数组数据项int[]和数组数据项(intstring)[];图3(1)A是图3(1)B的数组数据项合并后的形式。
图3(1)C是带有异或组合数据类型的数组数据项的函数块,如图3(1)C所示,带有异或组合数据类型的数组数据项表示为(intxorfloat)[],其为输出数据项;图3(1)D是对该数组数据项进行连线展开动作后的形式,如图3(1)D所示,将数组数据项(intxorfloat)[]进行连线展开后,可以形成数组数据项int[]和数组数据项float[];图3(1)C是图3(1)D的数组数据项合并后的形式。
图3(1)E是内部含有数组类型的数据项的函数块,如图3(1)E所示,内部含有数组类型的数组数据项表示为(int[]string)[],图3(1)F对该数组进行连线展开动作后的形式,如图3(1)F所示,将数组数据项(int[]string)[]进行连线展开后,可以形成数组数据项int[][]和数组数据项string[];图3(1)E是图3(1)F的数组合并后的形式。
例如,对于数据类型属性为((t1t2)t3)[]的数组数据项,其XML表示为:
<type id=""name=""value=""typeclass="2"typevalue="((t1t2)t3)[]"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="((t1t2)t3)"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="t1t2"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t2"typeid=""/>
</type>
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t3"typeid=""/>
</type>
</type>
图10H示出了包括上述数组类型的数据项的函数块的接口的一种存储层级结构图,图10I示出了对上述数组类型的数据项进行第一层连线展开时的存储层级结构图,图10J示出了对上述数组类型的数据项进行第二层连线展开时的存储层级结构图。
如图10H所示,在矩形框中,该函数块PF的输入部分的总层级为1,输入部分的当前展示层级为1,该函数块PF的输出部分的总层级为3,输出部分的当前展示层级为1。如图10I所示,对该函数块的输出数据项进行第一层连线展开时的操作为:对输出数据项的第一层的内部类型,逻辑上修改为(t1t2)[]t3[],XML表示为:
<type id=""name=""value=""typeclass="1"typevalue="(t1t2)[]t3[]"typeid="">
<type id=""name=""value=""typeclass="2"typevalue="(t1t2)[]"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="t1t2"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t1"typeid=""/>
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t2"typeid=""/>
</type>
</type>
<type id=""name=""value=""typeclass="2"typevalue="t3[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t3"typeid="">
</type>
</type>
如图10J所示,对该函数块的输出数据项进行第二层连线展开时的操作为:对输出数据项的第二层的内部类型,逻辑上修改为(t1[]t2[])t3[],XML表示为:
<type id=""name=""value=""typeclass="1"typevalue="(t1[]t2[])t3[]"typeid="">
<type id=""name=""value=""typeclass="1"typevalue="t1[]t2[]"typeid="">
<type id=""name=""value=""typeclass="2"typevalue="t1[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t1"typeid="">
</type>
<type id=""name=""value=""typeclass="2"typevalue="t2[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t2"typeid="">
</type>
</type>
<type id=""name=""value=""typeclass="2"typevalue="t3[]"typeid="">
<type id=""name=""value=""typeclass="0、1、2、3、4或者5"typevalue="t3"typeid="">
</type>
</type>
之后按照类型匹配规则或者连线要求规则,对数据项t1[]、数据项t2[]和数据项t3[]进行创建连线关系。
例如,如图10B所示,步骤S75包括:生成PFVMS。在生成组合函数块对应的接口之后,创建提取为接口的数据项与计算序列中的数据项之间的对照关系以及提取为接口的数据项与辅助合并连线、数据传递连线的数据项之间的对照关系,以生成PFVMS,例如,可以生成for结构的组合函数块对应的PFVMS部分的XML,图10G所示的for结构的组合函数块对应的XML架构中的PFVMS部分表示为:
Figure PCTCN2022125382-appb-000062
例如,如图10B所示,步骤S76包括:形成for结构的组合函数块。由此,经过步骤S70-S76,for结构的组合函数块组织完成,并生成for结构的组合函数块的完整结构。
例如,组合函数块PF_For对应的完整的XML表示为:
<PF id="PF_For"name="">
<exp1name="">
<F id="assignint"name="">
<in>
<type id="0"name=""value="0"typeclass="0"typevalue="int"typeid=""memory="1"/>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp1>
<loopN name="">
<IFLoop name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
<type id="n"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclass="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="sum1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="sum2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
<type id="1"name=""value="1"typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</exp3>
</IFLoop>
<IFLoop name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
<type id="n"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclass="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="sum1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="sum2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<PF id="addint"name="">
<in>
<type id="int2"name=""value=""typeclass="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="0"/>
<type id="1"name=""value="1"typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</exp3>
</IFloop>
</loopN>
<VMS>
<line>
<source path="0.0.out.0"/>
<destination path="1.0.0.0.in.0.0"/>
</line>
<line>
<source path="0.0.out.0"/>
<destination path="1.0.2.0.in.0.0"/>
</line>
<line>
<source path="1.0.2.0.out.0"/>
<destination path="1.1.0.0.in.0.0"/>
</line>
<line>
<source path="1.0.2.0.out.0"/>
<destination path="1.1.2.0.in.0.0"/>
</line>
<line>
<source path="1.0.1.0.out.0"/>
<destination path="1.1.1.0.in.0.0"/>
</line>
</VMS>
<in>
<type id=""name=""value=""typeclass="1"typevalue="int(intint[])"typeid="">
<type id="n"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="intint[]"name=""value=""typeclass="1"typevalue="intint[]"typeid=""memory="1">
<type id="sum1"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
<type id="a[]"name=""value=""typeclass="2"typevalue="int[]"typeid=""memory="1">
<type id="a"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</type>
</type>
</in>
<out>
<type id="sum2[]"name=""value=""typeclass="2"typevalue="int[]"typeid=""memory="1">
<type id="sum2"name=""value=""typeclass="0"typevalue="int"typeid=""memory="1"/>
</type>
</out>
<PFVMS>
<line>
<source path="in.0.0"/>
<destination path="1.0.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.1.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.1.0"/>
<destination path="1.0.1.0.in.0.0"/>
</line>
<line>
<source path="in.0.1.1.0"/>
<destination path="1.0.1.0.in.0.1"/>
</line>
<line>
<source path="out.0.0"/>
<destination path="1.0.1.0.out.0"/>
</line>
</PFVMS>
</PF>
图11A为本公开一些实施例提供的一种计算函数的示意图;图11B为本公开一些实施例提供的另一种for结构的组合函数块的图形化的表达形式的示意图。例如,图11B所示的for结构的组合函数块用于实现图11A所示的计算函数。
例如,在另一些实施例中,可以基于for组合范式组合至少两个函数块以得到for结构的组合函数块以实现图11A所示的计算函数。
例如,如图11A所示,该计算函数包括四层loop,分别为loop1、loop2、loop3和loop4。第一层循环loop1用于计算b3,其中,b3=b2+b1+b0,第二层循环loop2用于计算b4,其中,b4=b3+b2+b1,第三层循环loop3用于计算b5,其中,b5=b4+b3+b2,第四层循环loop4 用于计算b6,其中,b6=b5+b4+b3。例如,b0可以被赋值pf1,b1可以被赋值pf2,b2可以被赋值pf3。
例如,如图11B所示,基于图11A所示的计算函数,可以从函数块库中选择四个函数块,基于for组合范式将选择的四个函数块进行排列,以形成对应的计算序列。选择的四个函数块分别为赋值函数块assignint、表示小于关系表达式的函数块lessint、第一加法函数块add3和第二加法函数块expaddI。第一加法函数块add3具有三个输入数据项,用于对三个输入数据项进行相加操作,第二加法函数块expaddI具有两个输入数据项,用于对该两个输入数据项进行相加操作。由于图11A所示的计算函数具有四层循环,因此,如图11B所示,可以在for结构中设置四层IFloop,分别为第一层IFloop(对应于图11A中的loop1)、第二层IFloop(对应于图11A中的loop2)、第三层IFloop(对应于图11A中的loop3)和第四层IFloop(对应于图11A中的loop4)。基于for组合范式,for结构中的单次表达式exp1部分设置赋值函数块assignint,for结构中的每层IFloop的exp2部分设置表示小于关系表达式的函数块lessint,for结构中每层IFloop的循环表达式loop部分设置第一加法函数块add3,每层IFloop的末尾循环表达式exp3部分设置第二加法函数块expaddI。
例如,11B所示的函数块形成的计算序列的XML表示为:
<PF id="for"name="">
<exp1name="">
<F id="assignint"name="">
<in>
<type id="3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp1>
<loopN name="">
<IFLoop id=""name="">
<exp2name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b0"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
<IFLoop id=""name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b4"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
<IFLoop id=""name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b4"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b5"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
<IFLoop id=""name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b4"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b5"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b6"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
</loopN>
</PF>
例如,在上述计算序列的xml中,数据项的memory表示已经进行连线操作之前的memory。已经进行连线操作之后的各个数据项的memory根据连线操作而定。
例如,在形成计算序列之后,可以对数据项进行属性设置。属性设置包括:常量设置。组织好计算序列后可以对数据项进行常量设置,并记录在数据项的value属性。如图11B所示,赋值函数块assignint的输入数据项为常量数据项,且该常量数据项的值为3,第二加法函数块expaddI的一个输入数据项为常量数据项,且该常量数据项的值为1。在图形化中,常量数据项通过带图案的圆圈表示,非常量的数据项通过实心圆圈表示。
例如,在for结构中,组织好计算序列之后,根据计算序列,确定该for结构中的各个函数块中的哪些数据项(输入数据项和/或输出数据项)可以通过数据传递连线和/或辅助合并连线进行连接,即在得到计算序列之后,可以遵循连线规则进行for结构的组合函数块的内部数据项之间连接,以生成for结构的组合函数块对应的VMS。
例如,在for结构中,存在输出数据项连向输入数据项的数据传递连线,存在输出数据项连向输出数据项的数据传递连线,存在输入数据项连向输入数据项的辅助合并连线。因为每层IFloop的exp2部分中的函数块的输出数据项用于实现判断操作,所以每层IFloop的exp2部分中的输出数据项不参与连线操作。
图11C为本公开一些实施例提供的一种计算函数的另一种示意图。
例如,如图11C所示,带箭头的虚线表示:对于第一层循环(loop1)的第一个输出数据项(即第一输出存储)与第二层循环(loop2)的第一个输入数据项之间创建连线关系,那么loop2和loop3之间的具有相同位置的数据项之间自动创建连线;loop3和loop4之间的具有相同位置的数据项之间自动创建连线。带箭头的虚线表示相邻循环层之间连线,例如,loop1中的b3连接到loop2中的b3,loop2中的b4连接到loop3中的b4,上述相邻循环层之间的连线操作自动重复。
例如,如图11C所示,带箭头的实线表示:对于第一层循环(loop1)的第一个输出数据项与第三层循环(loop3)的第二个输入数据项之间创建连线关系,那么loop2和loop4之间的具有相同位置的数据项之间自动创建连线。带箭头的实线表示跨层连线,例如,loop1中的b3连接到loop3中的b3,loop2中的b4连接到loop4中的b4,上述跨层之间的连线操作自动重复。
图11D为对图11B所示的计算序列进行连线之后的一种图形化的表达形式的示意图。
例如,如图11D所示,首先,对for结构中的用于实现循环控制的数据项(数据项i)进行连线,例如,exp1部分的函数块assignint的输出数据项i和第一层IFloop中的exp2 部分的函数块lessint的第一个输入数据项i通过数据传递连线进行连接,exp1部分的函数块assignint的输出数据项i和第一层IFloop中的exp3部分的函数块expaddI的第一个输入数据项i通过数据传递连线进行连接;第一层IFloop中的exp3部分的函数块expaddI的输出数据项i和第二层IFloop中的exp2部分的函数块lessint的第一个输入数据项i通过数据传递连线进行连接,第一层IFloop中的exp3部分的函数块expaddI的输出数据项i和第二层IFloop中的exp3部分的函数块expaddI的第一个输入数据项i通过数据传递连线进行连接。上述对于第一层IFloop与第二IFloop之间的数据项i进行连线时,第二层IFloop与第三层IFloop之间相同位置的数据项i自动创建连线,第三层IFloop与第四层IFloop之间相同位置的数据项i自动创建连线。例如,第二层IFloop中的exp3部分的函数块expaddI的输出数据项i和第三层IFloop中的exp2部分的函数块lessint的第一个输入数据项i通过数据传递连线进行连接,第二层IFloop中的exp3部分的函数块expaddI的输出数据项i和第三层IFloop中的exp3部分的函数块expaddI的第一个输入数据项i通过数据传递连线进行连接。
例如,如图11D所示,在进行连线之后,每层IFloop中的exp2部分的函数块lessint的第一个输入数据项i、每层IFloop中的exp3部分的函数块expaddI的第一输入数据项i对应的圆变为空心圆,即表示这些数据项为虚拟存储。
此时,图11D所示的连线关系对应的VMS表示为:
Figure PCTCN2022125382-appb-000063
Figure PCTCN2022125382-appb-000064
图11E为对图11C所示的计算序列进行连线之后的另一种图形化的表达形式的示意图。
例如,如图11E所示,对各个IFLoop之间进行数据传递连线,并保存到VMS中。例如,第一层IFLoop中的loop部分的函数块add3的输出数据项b3通过数据传递连线连接到第二层IFLoop中的loop部分的函数块add3的输入数据项b3,第一层IFLoop中的loop部分的函数块add3的输入数据项b2通过辅助合并连线连接到第二层IFLoop中的loop部分的函数块add3的输入数据项b2,第一层IFLoop中的loop部分的函数块add3的输入数据项b1通过辅助合并连线连接到第二层IFLoop中的loop部分的函数块add3的输入数据项b1;第一层IFLoop中的exp2部分的函数块lessint的输入数据项n通过辅助合并连线连接到第二层IFLoop中的exp2部分的函数块lessint的输入数据项n。如图11E所示,在进行连线之后,第二层IFLoop中的loop部分的函数块add3的输入数据b1-b3对应的圆变为空心圆,即表示该第二层IFLoop中的loop部分的函数块add3的输入数据b1-b3为虚拟存储,第二层IFLoop中的exp2部分的函数块lessint的输入数据n对应的圆变为空心圆,即表示该第二层IFLoop中的exp2部分的函数块lessint的输入数据n为虚拟存储。
需要说明的是,对于第二层IFLoop和第三层IFLoop之间的连线操作以及第三层IFLoop和第四层IFLoop之间的连线操作可以参考上述对于第一层IFLoop和第二层IFLoop之间的连线操作的说明,重复之处不再赘述。
图11E所示的辅助合并连线所连接的数据项之间的关系记录在带属性undirected的VMS表示为:
Figure PCTCN2022125382-appb-000065
Figure PCTCN2022125382-appb-000066
Figure PCTCN2022125382-appb-000067
例如,在连线操作完成之后,则可以生成接口。
for结构的组合函数块的接口XML格式与顺序结构的组合函数块的接口格式相同,此处不再赘述。
图11F为图11E所示的for结构的组合函数块对应的接口的图形化的表达形式的示意图。
如图11F所示,for为组合函数块的名称,由用户定义,该接口的输入部分包括输入数据项n和输入数据项int2int,该接口的输出部分包括输出数据项b6,b6的数据类型属性为int数组类型的数据项,该输出数据项由用户选择每层IFloop中add3函数块的输出数据项作为最终的输出数据项,即由输出数据项b3、b4、b5、b6被N化提取形成。输入数据项int2int包括输入数据项int2和输入数据项b2,输入数据项int2包括输入数据项b0和输入数据项b1。
例如,如图11F所示的接口的XML表示为:
<PF id="for"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int(int2int)"typeid="">
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid=""memory="1">
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid=""memory="1">
<type id="b0"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</type>
</in>
<out>
<type id="b6"name=""value=""typeclasss="2"typevalue="int[]"typeid=""memory="1">
<type id="b"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</out>
</PF>
例如,在生成组合函数块对应的接口之后,创建提取为接口的数据项与计算序列中的数据项之间的对照关系以及提取为接口的数据项与辅助合并连线、数据传递连线的数据项之间的对照关系,以生成PFVMS。
例如,可以生成for结构的组合函数块对应的PFVMS部分的XML,图11E所示的for结构的组合函数块对应的XML架构中的PFVMS部分表示为:
<PFVMS>
<line>
<source path="in.0.0"/>
<destination path="1.0.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.1.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.2.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.3.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.1.0.0"/>
<destination path="1.0.1.0.in.0.0.0"/>
</line>
<line>
<source path="in.0.1.0.1"/>
<destination path="1.0.1.0.in.0.0.1"/>
</line>
<line>
<source path="in.0.1.0.1"/>
<destination path="1.1.1.0.in.0.0.0"/>
</line>
<line>
<source path="in.0.1.1"/>
<destination path="1.0.1.0.in.0.1"/>
</line>
<line>
<source path="in.0.1.1"/>
<destination path="1.1.1.0.in.0.0.1"/>
</line>
<line>
<source path="in.0.1.1"/>
<destination path="1.2.1.0.in.0.0.0"/>
</line>
<line>
<source path="out.0.0"/>
<destination path="1.0.1.0.out.0"/>
</line>
</PFVMS>
例如,该实例中的组合函数块for对应的完整的XML表示为:
<PF id="for"name="">
<exp1name="">
<F id="assignint"name="">
<in>
<type id="3"name=""value="3"typeclasss="0"typevalue="int"typeid=""memory="1"/>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp1>
<loopN name="">
<IFLoop id=""name="">
<exp2name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3""name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b0"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="1"name=""value="1"typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
<IFLoop id=""name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="b4"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="1"name=""value="1"typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
<IFLoop id=""name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
<type id="b4"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="b5"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="1"name=""value="1"typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
<IFLoop id=""name="">
<exp2 name="">
<F id="lessint"name="">
<in>
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="boolean"name=""value=""typeclasss="0"typevalue="boolean"typeid=""memory="1"/>
</out>
</F>
</exp2>
<loop name="">
<PF id="add3"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid="">
<type id="int2"name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="b3"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="b4"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
<type id="b5"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
</type>
</in>
<out>
<type id="b6"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</PF>
</loop>
<exp3 name="">
<F id="expaddI"name="">
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid="">
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="0"/>
<type id="1"name=""value="1"typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</in>
<out>
<type id="i"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</out>
</F>
</exp3>
</IFloop>
</loopN>
<VMS>
<line>
<source path="0.0.out.0"/>
<destination path="1.0.0.0.in.0.0"/>
</line>
<line>
<source path="0.0.out.0"/>
<destination path="1.0.2.0.in.0.0"/>
</line>
<line>
<source path="1.0.2.0.out.0"/>
<destination path="1.1.0.0.in.0.0"/>
</line>
<line>
<source path="1.0.2.0.out.0"/>
<destination path="1.1.2.0.in.0.0"/>
</line>
<line>
<source path="1.1.2.0.out.0"/>
<destination path="1.2.0.0.in.0.0"/>
</line>
<line>
<source path="1.1.2.0.out.0"/>
<destination path="1.2.2.0.in.0.0"/>
</line>
<line>
<source path="1.2.2.0.out.0"/>
<destination path="1.3.0.0.in.0.0"/>
</line>
<line>
<source path="1.2.2.0.out.0"/>
<destination path="1.3.2.0.in.0.0"/>
</line>
<line>
<source path="1.0.1.0.out.0"/>
<destination path="1.1.1.0.in.0.1"/>
</line>
<line>
<source path="1.0.1.0.out.0"/>
<destination path="1.2.1.0.in.0.0.1"/>
</line>
<line>
<source path="1.0.1.0.out.0"/>
<destination path="1.3.1.0.in.0.0.0"/>
</line>
<line>
<source path="1.1.1.0.out.0"/>
<destination path="1.2.1.0.in.0.1"/>
</line>
<line>
<source path="1.1.1.0.out.0"/>
<destination path="1.3.1.0.in.0.0.1"/>
</line>
<line>
<source path="1.2.1.0.out.0"/>
<destination path="1.3.1.0.in.0.1"/>
</line>
</VMS>
<in>
<type id=""name=""value=""typeclasss="1"typevalue="int(int2int)"typeid="">
<type id="n"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id=""name=""value=""typeclasss="1"typevalue="int2int"typeid=""memory="1">
<type id=""name=""value=""typeclasss="1"typevalue="int2"typeid=""memory="1">
<type id="b0"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
<type id="b1"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
<type id="b2"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</type>
</in>
<out>
<type id="b6"name=""value=""typeclasss="2"typevalue="int[]"typeid=""memory="1">
<type id="b"name=""value=""typeclasss="0"typevalue="int"typeid=""memory="1"/>
</type>
</out>
<PFVMS>
<line>
<source path="in.0.0"/>
<destination path="1.0.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.1.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.2.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.0"/>
<destination path="1.3.0.0.in.0.1"/>
</line>
<line>
<source path="in.0.1.0.0"/>
<destination path="1.0.1.0.in.0.0.0"/>
</line>
<line>
<source path="in.0.1.0.1"/>
<destination path="1.0.1.0.in.0.0.1"/>
</line>
<line>
<source path="in.0.1.0.1"/>
<destination path="1.1.1.0.in.0.0.0"/>
</line>
<line>
<source path="in.0.1.1"/>
<destination path="1.0.1.0.in.0.1"/>
</line>
<line>
<source path="in.0.1.1"/>
<destination path="1.1.1.0.in.0.0.1"/>
</line>
<line>
<source path="in.0.1.1"/>
<destination path="1.2.1.0.in.0.0.0"/>
</line>
<line>
<source path="out.0.0"/>
<destination path="1.0.1.0.out.0"/>
</line>
</PFVMS>
</PF>
图12A为本公开一些实施例提供的一种while结构的组合函数块的示意图;图12B为本公开一些实施例提供的一种基于while组合范式组合函数块的方法的示意图。
例如,while组合范式包括至少一层当型循环体loopN,每个当型循环体包括至少一个当型循环部分IFloop,每个当型循环部分包括当型条件表达式exp和当型循环表达式。基于while组合范式组合至少两个函数块以得到while结构的组合函数块,如图12A所示,在一些示例中,while组合范式包括第一个当型循环部分IFloop和第二个当型循环部分IFloop,第一个当型循环部分IFloop包括第一当型条件表达式exp和第一当型循环表达式loop,第二个当型循环部分IFloop包括第二当型条件表达式exp和第二当型循环表达式loop。第一个当型循环部分IFloop的结构和第二个当型循环部分IFloop的结构相同,也就是说,第一当型条件表达式exp和第二当型条件表达式exp的结构相同,第一当型循环表达式loop和第二当型循环表达式loop的结构相同。第一个当型循环部分IFloop中的第一当型条件表达式exp包括至少一个函数块,第一个当型循环部分IFloop中的第一当型循环表达式loop包括至少一个函数块,第二个当型循环部分IFloop中的第二当型条件表达式exp包括至少一个函数块,第二个当型循环部分IFloop中的第二当型循环表达式loop包括至少一个函数块。while组合范式默认有一层当型循环部分,当一层当型循环部分不足以描述整个计算组织过程时,可按需求添加循环层次,直到能够完全描述整个计算含义,每一层循环部分的结构相同。也就是说,while组合范式可以包括多层当型循环部分IFloop。
需要说明的是,在第一个当型循环部分IFloop中,第一当型条件表达式exp和第一当型循环表达式loop具有if结构,第一当型循环表达式loop为if结构中的第一分支部分doTrue,类似地,在第二个当型循环部分IFloop中,第二当型条件表达式exp和第二当型循环表达式loop具有if结构,第二当型循环表达式loop为if结构中的第一分支部分doTrue。
任意的while结构的组合函数块对应的计算序列部分的XML表示为:
Figure PCTCN2022125382-appb-000068
Figure PCTCN2022125382-appb-000069
例如,while结构的组合函数块对应的计算序列部分包括:当型循环体由<loopN></loopN>表示,当型循环体中的每个当型循环部分由<IFLoop></IFLoop>表示,其中,每个当型循环部分IFloop包括第一当型条件表达式exp,由<exp></exp>结构表示,且表示循环的控制条件,以及当型循环表达式loop,由<loop></loop>结构表示。每一个当型循环部分具有相对地址,多层当型循环部分的相对地址按照依次递增的方式进行编码。
例如,在while结构中,exp部分和loop部分的相对地址值分别为0、1。每个部分中的函数块的相对地址按照序号0、1、…进行编码。
例如,在while结构的组合函数块中,第一当型条件表达式exp/第二当型条件表达式exp、第一当型循环表达式loop/第二当型循环表达式loop的每一个中至少包括一个函数块。
exp部分的函数块的输出数据项必须为boolean类型的数据项。
例如,如图12B所示,基于while组合范式组合函数块的方法包括步骤S80-S86。
步骤S80包括:选择while组合范式;步骤S81包括:选择至少两个函数块并组织计算序列;步骤S82包括:常量设置;步骤S83包括:执行连线操作;步骤S84包括:生成接口;步骤85包括:生成PFVMS;步骤S86包括:形成while结构的组合函数块。经过步骤S80-S86,while结构的组合函数块组织完成,并生成while结构的组合函数块的完整结构。
需要说明的是,while结构的组合函数块的构建过程及有关规则和for结构的组合函数块的构建过程及有关规则相似,重复之处不再赘述。
当型循环结构的组合函数块的接口的生成规则还包括下述特殊提取规则,例如,对于当型循环结构的组合函数块,在步骤S13中,将至少两个函数块封装为组合函数块, 并生成组合函数块对应的接口还包括:不提供与当型循环结构的组合函数块中的位于当型条件表达式中的函数块的输出数据项对应的接口,常量数据项不提取作为接口的一部分。
当型循环结构的组合函数块的接口的生成规则还包括N化提取规则:
例如,每个当型循环体包括多个当型循环部分,在N化提取规则中,对于当型循环结构的组合函数块中的任一输入数据项,如果在多个当型循环部分中的一些当型循环部分中的任一输入数据项被连线连接,在多个当型循环部分中的另一些当型循环部分中的任一输入数据项没有被连线,提供与多个当型循环部分对应的多个任一输入数据项的存储属性为真实存储的输入数据项对应的接口。
例如,在N化提取规则中,对于当型循环结构的组合函数块中的任意一个输出数据项,如果在多层当型循环部分中的一些当型循环部分中的任一输出数据项被连线连接,在多层当型循环部分中的另一些当型循环部分中的任一输出数据项没有被连线,只提供多层当型循环部分中的第一层当型循环部分中的任一输出数据项为对应的接口或者对多层当型循环部分中的多个任一输出数据项进行N化提取。
N化结构的数据项不存在于计算序列中,只存在于while组合范式的大函数接口区中,例如,当型循环结构的组合函数块的接口的生成规则还包括下述特殊提取规则:当该当型循环组合范式中的每一个当型循环部分的相同位置上的任一个数据项d(例如,输入数据项或输出数据项)没有被连线(数据传递连线或辅助合并连线)连接,那么,对于多层当型循环部分,则具有相同的多个数据项d,把多个数据项d提取为组合得到的组合函数块的接口时,接口上形成了一个由多个数据项d形成的N化数组d[],此时,N化数组d[]对应于while组合范式中的多层当型循环部分中的多个数据项d。N化数组d[]为数组类型的数组数据项。
例如,在while结构的组合函数块的组织过程中,如果对某个数据项进行N化提取,则在while结构的组合函数块对应的接口对应的数据项包括数组结构的数据项。
需要说明的是,循环结构或当型循环结构的组合函数块对应的接口中的数据项的数据类别属性为数组类型。
需要说明的是,在生成while结构的组合函数块的接口时,如果前述生成接口时的提取规则(即前述关于步骤S13中生成接口的相关规则)与此处描述的while结构对应的特殊的规则有冲突时,以while结构对应的特殊提取规则为优先规则。
while组合范式的连线规则、N化提取与for组合范式相同。
本公开一些实施例还提供一种组合函数块,该组合函数块根据上述任一实施例所述的方法组合得到。
例如,组合函数块可以包括一个或多个函数块,一个或多个函数块通过数据传递连线和/或辅助合并连线进行连接。
需要说明的是,关于该组合函数块的组合过程、数据传递连线和辅助合并连线等可以参考上面的相关描述,重复之处不再赘述。
图13为本公开一些实施例提供的一种构造组合函数块的装置。例如,如图13所示,构造组合函数块的装置10包括处理器100和存储器110。处理器100和存储器110通过通信总线实现相互通信,处理器100和存储器110等组件之间也可以通过网络连接进行通信。本公开对网络的类型和功能在此不作限制。
例如,存储器110用于非瞬时性地存储计算机可读指令。处理器100用于运行计算机可读指令时,计算机可读指令被处理器100运行时实现根据上述任一实施例所述构造组合函数块的方法。关于该构造组合函数块的方法的各个步骤的具体实现以及相关解释内容可以参见上述构造组合函数块的方法的实施例,在此不作赘述。
例如,处理器100执行存储器110上所存储的程序而实现上述实施例提供的方法的实现方式,与前述方法的实施例部分所提及的实现方式相同,这里也不再赘述。
例如,通信总线可以是外设部件互连标准(PCI)总线或扩展工业标准结构(EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
例如,处理器100和存储器110可以设置在服务器端(或云端)。
例如,处理器100可以控制装置中的其它组件以执行期望的功能。处理器100可以是中央处理器(CPU)、网络处理器(NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。中央处理元(CPU)可以为X86或ARM架构等。
例如,存储器110可以包括一个或多个计算机程序产品的任意组合,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机可读指令,处理器100可以运行所述计算机可读指令,以实现上述构造组合函数块的装置10的各种功能。在存储介质中还可以存储各种应用程序和各种数据等。
例如,关于上述构造组合函数块的装置10执行构造组合函数块的过程的详细说明可以参考构造组合函数块的方法的实施例中的相关描述,重复之处不再赘述。
图14为本公开至少一实施例提供的一种非瞬时性计算机可读存储介质的示意图。例如,如图14所示,在非瞬时性计算机可读存储介质1100上可以非暂时性地存储一个或多个计算机可读指令1101。例如,当计算机可读指令1101由处理器执行时可以执行根据上文所述的构造组合函数块的方法中的一个或多个步骤。
例如,该非瞬时性计算机可读存储介质1100可以应用于上述构造组合函数块的装置10中。例如,非瞬时性计算机可读存储介质1100可以包括上述构造组合函数块的装置10中的存储器110。
例如,关于非瞬时性计算机可读存储介质1100的说明可以参考构造组合函数块的装置10的实施例中对于存储器110的相关描述,重复之处不再赘述。
现有技术精确的表示计算的主要方式是通过计算机高级语言(C,C++,Java,python等),简称高级语言。高级语言表示计算的基本概念是:变量、函数、语句。变量用来表示(被)计算目标,函数用来组织计算,通过语句引用变量表示对计算目标的计算。函数也需要通过语句调用实现对计算目标的计算。使用函数组织计算时,需要先定义变量,例如,全局变量、类变量、函数参数变量、局部变量等,然后通过语句引用变量进行组织计算。
所有的编程手册都要求变量名称要有含义以增加代码的易读性。对不同的应用领域, 不同的功能就会产生不同的名称体系。不同的企业即使在同一应用领域,由于企业间的代码名称很难协调,也会产生不同的名称体系。不同的名称体系给代码附载了应用含义。应用和计算的不可分会使代码量增加,增加开发和维护成本。计算不能独立的精确表示会影响计算公共知识的形成和共享。不同名称体系的代码混合使用会破坏代码的易读性,给代码共享带来困难。
应用和计算及其混合表示(即应用和计算的不可分)是起源于现有高级语言的语法表示规则(变量和语句对变量的引用),是不能通过设计方法消除的。
组件化软件设计是软件业追求的一种设计思想,组件化设计思想是把软件看做是由组件构成,小组件组合大组件,大组件组合成更大的组件从而形成软件。软件的完全组件化隐含着存在(理想情况下是有限个)基本组件,基本组件反复组合形成各种大小的组件和软件。目前,软件生产的主要方式还是编码。
现有高级语言计算的技术特点为:由于需要先宣布变量,然后通过语句引用变量实现计算,变量代表存储,所以在高级语言里,存储和计算是分离的,存储可以单独定义;通过函数组织计算需要先表示函数的参数,然后语句才能引用,所以高级语言表示计算是top-down的。
本公开提出了一种计算存储一体,bottom-up(由底端到顶端)的计算表示方式和组织方式,可以实现计算完全组合化,计算和应用分离,同时实现了对计算组织的简单直观的可视化操作。
下面通过一个例子说明本公开的基本设计思想。
对于一段现有的高级语言的代码,如下所示:
Figure PCTCN2022125382-appb-000070
将“+”和“–”当作函数块,“+”函数块(即add函数块)表示为:(int)add(int,int),“–”函数块(即sub函数块)表示为:(int)sub(int,int)。
对于“–”函数块,该“–”函数块的输入的从左往右的第一个参数为被减数,第二个参数为减数。函数块的参数不使用参数变量,只表示参数的类型和参数位置。例如,add函数块的输入类型in为(int,int),输入类型in包含两个int子类型;add函数块的输出类型out为int。从而,基于本公开的思想,把上面的计算表示为:
Figure PCTCN2022125382-appb-000071
Figure PCTCN2022125382-appb-000072
图15A为本公开一些实施例提供的一种用于组合的多个函数块的示意图;图15B为对图15A所示的多个函数块进行连线操作的示意图;图15C为基于图15A所示的多个函数块组合生成的大函数块的接口的示意图;图15D为基于图15A所示的多个函数块组合生成的大函数块的示意图。
实现步骤包括:
步骤1、列出需要使用的至少一个函数块。把需要先执行的函数块放在前面。如上所示,在该示例中,函数块包括3个add函数块,即(int)add(int,int);以及,1个sub函数块,即(int)sub(int,int)。如图15A所示,选择三个add函数块和1个sub函数块,该三个add函数块分别为函数块adda、函数块addb和函数块addc,该1个sub函数块为函数块sub1,并将该三个add函数块和1个sub函数块按照一定顺序排列。
例如,如图15A所示,函数块adda包括第一输入参数1.in.1和第二输入参数1.in.2以及一个输出参数1.out;函数块addb包括第一输入参数2.in.1和第二输入参数2.in.2以及一个输出参数2.out;函数块addc包括第一输入参数3.in.1和第二输入参数3.in.2以及一个输出参数3.out;函数块sub1包括第一输入参数4.in.1和第二输入参数4.in.2以及一个输出参数4.out。
步骤2、使用步骤1中函数块的序列号和函数块的参数的序列号,表示各函数块之间的输出和输入的关系。如图15B所示,对各个函数块的输入参数和输出参数进行连接,例如,函数块adda的输出参数1.out与函数块addb的第一个输入参数2.in.1通过例如数据传递连线连接,函数块addb的输出参数2.out与函数块sub1的第一个输入参数4.in.1通过例如数据传递连线连接,函数块addc的输出参数3.out与函数块sub1的第二个输入参数4.in.2通过例如数据传递连线连接。
步骤3、生成所设计的函数块的接口。步骤1中有些函数块的输入参数已经基于步骤2的连接操作提供具体数值,例如,函数块addb的第一个输入参数2.in.1、函数块sub1的第一个输入参数4.in.1和即函数块sub1的第二个输入参数4.in.2,除此外,其余的参数需要外部提供数值,从而需要成为组合得到的大函数块的输入参数,例如,1.in(即函数块adda的两个输入参数)、2.in.2(即函数块addb的第二个输入参数)和3.in(即函数 块addc的两个输入参数)。大函数块的输出参数一定包含在步骤1中的各函数块的输出参数中。确定大函数块的输出参数的策略包括:a、选择步骤1的所有输出参数做为大函数块的输出参数,在大函数块参与进一步组合时再做具体选择;b、在生成大函数块的过程中就选择4.out作为大函数块的输出参数(即函数块sub1的输出参数)。
步骤4、根据步骤3的接口生成组合接口和函数块所需函数块和接口之间关系。
如图15C所示,生成的大函数块的接口的输入部分包括五个输入参数,分别为函数块adda的两个输入参数1.in.1和1.in.2、函数块addb的第二个输入参数2.in.2和函数块addc的两个输入参数3.in.1和3.in.2;生成的大函数块的接口的输出部分包括一个输出参数,该输出参数为函数块sub1的输出参数4.out。如图15D所示,最终,生成的大函数块可以进行封装以简化表示,即不表示该大函数块内部的各个小函数块及其连接关系,仅仅表示大函数块的接口的输入参数和输出参数。
步骤1和步骤2是独立选择的,例如,在步骤3中,若选择策略a,则步骤3和步骤4可根据步骤1和步骤2的选择固定规则生成。例如,在步骤3中,若选择策略b,则大函数块的接口的输入参数可自动生成,则大函数块的接口的输出参数可简单选择生成。步骤4中的函数块和接口之间关系可自动生成。
本公开中,函数块的形成方式的符号表示比高级语言表示复杂,但本公开提供了一个简单直观的图示。如果按可视化操作本公开提供的方法,则该方法变得简单直观。如图15A~15D所示,设计者只需要选择4个函数和3条连接线,或简单输出选择,其它都有规则自动生成。步骤1和2已完成组合函数的确定,步骤3和4是将组合函数表示为标准形式,以方便进一步参与后续的组合。存储被设置在函数块的输入参数(即上述输入数据项)和输出参数(即上述输出数据项)上,函数块之间的连线可被看作是存储合并和数据传递,所以连接也被称作是数据传递连线。形成标准接口可看作是把小函数块的存储提取到大函数块的输入参数和输出参数上。存储具有类型,例如,图15A~15D中的存储的类型都是int。存储存在于大函数块的输入参数和输出参数上和大函数块内部的小函数块的输入参数和输出参数之间的连线上。大函数块的输入参数和输出参数的存储(输入数据项和输出数据项)可看作是小函数块的输入参数和输出参数的存储的组合。
因为设计者需要操作的主要步骤是选择小函数块,连接小函数块,所以本公开提供的构造组合函数块的方法被称作组合式设计方法。因为大函数块的接口是被生成的,所以本公开提供的构造组合函数块的方法是bottom-up的设计方式,而不是先设计接口然后实现计算的方式。本公开提供的构造组合函数块的方法没有使用变量表示存储,所表示的计算是纯计算。
图15A~15D表示的由小函数块形成大函数块的方式为按顺序方式,也被称为使用顺序范式(即上述顺序组合范式)。除顺序组合范式外,本公开还包括提供if组合范式,for组合范式和while组合范式等。
任何函数都是由更小的函数组成,其隐含着有一组最小的函数做为组合的起始。最小函数的选择可以是图灵基本操作级别的理论上的最小函数,可以是硬件指令集级别的最小函数,也可以是高级语言基本计算语句级别的最小函数。最小函数被称做基本函数。在本公开的描述中,选择了高级语言基本计算语句级别的基本函数。
对于本公开,还有以下几点需要说明:
(1)本公开实施例附图只涉及到与本公开实施例涉及到的结构,其他结构可参考通 常设计。
(2)为了清晰起见,在用于描述本发明的实施例的附图中,层或结构的厚度和尺寸被放大。可以理解,当诸如层、膜、区域或基板之类的元件被称作位于另一元件“上”或“下”时,该元件可以“直接”位于另一元件“上”或“下”,或者可以存在中间元件。
(3)在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合以得到新的实施例。
以上所述仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,本公开的保护范围应以所述权利要求的保护范围为准。

Claims (32)

  1. 一种通过嵌套使用组合范式来构造组合函数块的方法,应用于函数块库,所述函数块库包括多个函数块,其中,所述方法包括:
    从多个组合范式中选择至少一个组合范式;
    获取对所述多个函数块中的至少两个函数块的排列操作,得到计算序列;
    基于所述计算序列,进行拼接操作确定所述至少两个函数块之间的连接关系;
    基于所述至少两个函数块中每个函数块的接口以及所述至少两个函数块之间的连接关系,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口;
    其中,所述多个函数块中的每个函数块包括与该函数块对应的接口对应的至少一个输入数据项和至少一个输出数据项,所述至少一个输入数据项和所述至少一个输出数据项在该函数块中以存储的形式存在,
    所述拼接操作包括将所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。
  2. 根据权利要求1所述的方法,其中,所述多个函数块包括多个基本函数块和多个组合函数块,每个所述组合函数块由至少一个基本函数块和/或至少一个组合函数块组成,
    所述多个基本函数块表示组成任一组合函数块的最小单位;
    所述多个基本函数块中的每个基本函数块具有其对应的计算功能,
    每个所述组合函数块的计算功能为基于所述至少一个基本函数块和/或所述至少一个组合函数块的计算功能和连接关系来确定每个所述组合函数块的计算功能;
    将所述组合函数块作为函数块存储在所述函数块库中,以扩展所述函数块库。
  3. 根据权利要求2所述的方法,其中,
    所述拼接操作按照以下步骤顺序执行:按照多个组合范式中的至少一个组合范式,对所述至少两个函数块进行组合;对组合后的所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接。
  4. 根据权利要求2所述的方法,其中,
    所述拼接操作按照以下步骤顺序执行:将所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接;按照多个组合范式中的至少一个组合范式,对连接数据项之后的所述至少两个函数块进行组合。
  5. 根据权利要求3或4所述的方法,其中,
    所述多个组合范式包括顺序组合范式、条件组合范式、循环组合范式、当型循环组合范式;
    所述条件组合范式包括判断条件部分、第一分支部分和第二分支部分;
    所述循环组合范式包括单次表达式和至少一层循环体,每个循环体包括至少一个循环部分,每个循环部分包括条件表达式、中间循环表达式和末尾循环表达式;
    所述当型循环组合范式包括至少一层当型循环体,每个当型循环体包括至少一个当型循环部分,每个当型循环部分包括当型条件表达式和当型循环表达式。
  6. 根据权利要求5所述的方法,其中,所述多个基本函数块包括表示关系表达式的基本函数块、表示逻辑表达式的基本函数块、表示算数表达式的基本函数块、表示赋值 表达式的基本函数块、表示数据类型转换功能的基本函数块和范式基本函数块,
    其中,所述范式基本函数块包括对指针操作的基本函数块,
    所述范式基本函数包括用于获取数据项的地址的基本函数块、用于获取数据项的数据类型值的基本函数块和用于进行数组操作的基本函数块。
  7. 根据权利要求5或6所述的方法,其中,对于所述多个函数块中的每个函数块,所述函数块对应的接口包括输入部分和输出部分,所述函数块对应的接口的输入部分对应所述函数块的至少一个输入数据项,所述函数块对应的接口的输出部分对应所述函数块的至少一个输出数据项,
    所述至少一个输入数据项和所述至少一个输出数据项每个包括数据类型属性、数据类别属性、存储类型属性、值属性、名称属性、物理地址属性和相对地址属性,
    所述数据类别属性包括基本数据类型、组合数据类型、指针类型和泛型,所述指针类型包括通用指针类型和非通用指针类型;
    所述数据类型属性指数据项的类型;
    所述存储类型属性包括虚拟存储和真实存储,
    所述相对地址属性用于表示数据项的顺序编码值,
    对于数据类别属性为所述组合数据类型的数据项,所述数据项包括数据类别属性为所述基本数据类型的多个数据项,或者,所述数据项包括数据类别属性为所述组合数据类型的多个数据项,或者,所述数据项包括数据类别属性为所述指针类型的多个数据项,或者,所述数据项包括数据类别属性为所述泛型的多个数据项,或者,所述数据项包括的数据项的数据类别属性至少为以下数据类别属性的至少两种:所述基本数据类型、所述组合数据类型、所述指针类型和所述泛型;
    所述数据类别属性为所述基本数据类型的数据项、所述数据类别属性为所述组合数据类型的数据项、所述数据类别属性为所述指针类型的数据项和所述数据类别属性为泛所述型的数据项的结构格式是相同且规范的,所述数据类别属性为所述组合数据类型的数据项的结构是一个嵌套结构,所述嵌套结构的每一层数据项的结构格式相同。
  8. 根据权利要求7所述的方法,其中,所述拼接操作包括类型匹配规则和连线要求规则,
    在将所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接时,连接的两个数据项的数据类型属性满足所述类型匹配规则或连接的所述两个数据项满足所述连线要求规则,所述类型匹配规则为所述两个数据项的数据类型属性匹配,所述连线要求规则包括所述两个数据项中的一个数据项的数据类型属性是所述泛型,所述两个数据项中的另一个数据项是所述基本数据类型、所述组合数据类型或所述泛型,或者,包括所述两个数据项中的一个数据项的数据类型属性是所述通用指针类型,所述两个数据项中的另一个数据项的数据类型属性是所述非通用指针类型,
    其中,确定满足所述类型匹配规则的所述两个数据项,包括:
    对于所述至少部分输出数据项和/或所述至少部分输入数据项中的被选择的第一数据项和第二数据项:
    判断所述第一数据项的数据类别属性和所述第二数据项的数据类别属性是否相同,响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性相同,判断所述第一数据项的数据类别属性和所述第二数据项的数据类别属性是所述基本数据类型、 所述组合数据类型、所述指针类型或所述泛型,
    响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为所述基本数据类型,判断所述第一数据项的数据类型属性和所述第二数据项的数据类型属性是否相同,响应于所述第一数据项的数据类型属性和所述第二数据项的数据类型属性相同,确定所述第一数据项和所述第二数据项为满足所述类型匹配规则的所述两个数据项。
  9. 根据权利要求8所述的方法,其中,所述组合数据类型包括基本组合数据类型、异或类型和数组类型,
    确定满足所述类型匹配规则的两个数据项,还包括:
    响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为组合数据类型,判断所述第一数据项的数据类别属性和所述第二数据项的数据类别属性是所述异或类型、所述基本组合数据类型、还是所述数组类型,
    响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为异或类型,循环对在所述第一数据项和所述第二数据项的相同位置的数据项进行所述类型匹配规则的判断,以得到多个异或判断结果,
    响应于所述多个异或判断结果中的每个均指示满足所述类型匹配规则,确定所述第一数据项和所述第二数据项为满足所述类型匹配规则的所述两个数据项。
  10. 根据权利要求8所述的方法,其中,确定满足所述类型匹配规则的两个数据项,还包括:
    响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为所述数组类型,循环判断在所述第一数据项和所述第二数据项的相同位置的数据项是否满足所述类型匹配规则,以得到至少一个数组判断结果,响应于所述至少一个数组判断结果中的每个均指示满足所述类型匹配规则,确定所述第一数据项和所述第二数据项为满足所述类型匹配规则的所述两个数据项。
  11. 根据权利要求8所述的方法,其中,确定满足所述类型匹配规则的两个数据项,还包括:
    响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为所述基本组合数据类型,循环判断在所述第一数据项和所述第二数据项的相同位置的数据项是否满足所述类型匹配规则,以得到至少一个基本组合判断结果,
    响应于所述至少一个基本组合判断结果中的每个均指示满足所述类型匹配规则,确定所述第一数据项和所述第二数据项为满足所述类型匹配规则的所述两个数据项。
  12. 根据权利要求8所述的方法,其中,确定满足所述类型匹配规则的两个数据项,还包括:响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为所述指针类型,如果所述第一数据项和所述第二数据项均为通用指针类型,确定所述第一数据项和所述第二数据项为满足类型匹配规则的所述两个数据项;如果所述第一数据项和所述第二数据项均为非通用指针类型,循环判断在所述第一数据项和所述第二数据项的相同位置的数据项是否满足所述类型匹配规则,以得到至少一个非通用指针判断结果,响应于所述至少一个非通用指针判断结果中的每个均指示满足所述类型匹配规则,确定所述第一数据项和所述第二数据项为满足类型匹配规则的两个数据项;
    响应于所述第一数据项的数据类别属性和所述第二数据项的数据类别属性均为所述泛型,确定所述第一数据项和所述第二数据项为满足所述类型匹配规则的所述两个数据 项。
  13. 根据权利要求8-12任一项所述的方法,其中,所述至少部分输入数据项包括第一部分输入数据项,
    将所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接,包括:
    基于所述类型匹配规则和/或所述连线要求规则,通过数据传递连线将所述至少部分输出数据项与所述第一部分输入数据项进行连接,
    所述数据传递连线表示由输出数据项连接至输入数据项或输出数据项的线,所述数据传递连线包括输出输出传递线和输出输入传递线,所述输出输出传递线用于连接至少两个输出数据项,所述输出输入传递线用于将至少一个输出数据项连接至至少一个输入数据项。
  14. 根据权利要求13所述的方法,其中,所述至少部分输出数据项包括第一输出数据项、第二输出数据项和第三输出数据项,所述第一部分输入数据项包括第一输入数据项,
    通过数据传递连线将所述至少部分输出数据项和所述第一部分输入数据项进行连接包括以下至少一项:
    通过所述输出输出传递线将所述第二输出数据项连接至所述第一输出数据项,所述第二输出数据项出现在所述第一输出数据项之后,将所述第二输出数据项的存储类型属性设置为虚拟存储,不改变所述第一输出数据项的存储类型属性,记录所述第一输出数据项和所述第二输出数据项的连接关系;
    通过所述输出输入传递线将所述第三输出数据项连接至所述第一输入数据项;
    响应于所述第三输出数据项出现在所述第一输入数据项之后或者所述第三输出数据项和所述第一输入数据项属于同一个函数块,将所述第三输出数据项的存储类型属性设置为虚拟存储,不改变所述第一输入数据项的存储类型属性,记录所述第一输入数据项和所述第三输出数据项的连接关系,
    响应于所述第三输出数据项出现在所述第一输入数据项之前,将所述第一输入数据项的存储类型属性设置为虚拟存储,不改变所述第三输出数据项的存储类型属性,记录所述第一输入数据项和所述第三输出数据项的连接关系,
    其中,所述第一输出数据项、所述第二输出数据项、所述第三输出数据项和所述第一输入数据项以第二相对路径的形式定位,
    所述第一输出数据项和所述第二输出数据项的连接关系通过所述第一输出数据项和所述第二输出数据项的第二相对路径体现,并记录在所选择的组合范式的连线关系部分,
    所述第一输入数据项和所述第三输出数据项的连接关系通过所述第一输入数据项和所述第三输出数据项的第二相对路径体现。
  15. 根据权利要求13所述的方法,其中,所述至少部分输入数据项还包括第二部分输入数据项,
    将所述至少两个函数块的至少部分输入数据项和/或至少部分输出数据项进行连接,还包括:
    基于所述类型匹配规则和/或所述连线要求规则,通过辅助合并连线将所述第二部分输入数据项进行连接;
    所述第二部分输入数据项包括第二输入数据项和第三输入数据项,
    通过辅助合并连线将所述第二部分输入数据项进行连接包括:
    通过所述辅助合并连线将所述第三输入数据项连接至所述第二输入数据项,将所述第三输入数据项的存储类型属性设置为虚拟存储,不改变所述第二输入数据项的存储类型属性,记录所述第二输入数据项和所述第三输入数据项的连接关系,
    其中,所述第二输入数据项和所述第三输入数据项以第二相对路径的形式定位,所述第二输入数据项和所述第三输入数据项的连接关系通过所述第二输入数据项和所述第三输入数据项的第二相对路径体现,并记录在所选择的组合范式的接口与序列对照部分。
  16. 根据权利要求15所述的方法,其中,对于所述至少部分输入数据项和/或至少部分输出数据项中的第一指针数据项和第二指针数据项,所述第一指针数据项的数据类型属性为所述通用指针类型,所述第二指针数据项为所述非通用指针类型,
    响应于所述第一指针数据项和所述第二指针数据项通过所述数据传递连线或所述辅助合并连线进行连接,则设置所述第一指针数据项的数据类型属性为所述第二指针数据项所指向的数据项的数据类型属性。
  17. 根据权利要求7-16任一项所述的方法,其中,当所述至少一个组合范式包括所述循环组合范式、所述当型循环组合范式中的至少一个时,
    当所述至少一个组合范式包括所述循环组合范式,每个循环体包括多个循环部分时,所述N化条件为:所述多个循环部分之间具有相同位置的数据项没有被连线;
    当所述至少一个组合范式包括所述当型循环组合范式,每个当型循环体包括多个当型循环部分时,所述N化条件为:所述多个当型循环部分之间具有相同位置的数据项没有被连线。
  18. 根据权利要求8-16任一项所述的方法,其中,所述多个函数块中的每个函数块对应的接口包括输入部分和输出部分,
    将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口,包括:
    将所述组合函数块对应的被提取为接口的至少一个输入数据项进行组合并封装,以得到所述组合函数块对应的接口的输入部分;
    将所述组合函数块对应的被提取为接口的至少一个输出数据项进行组合并封装,以得到所述组合函数块对应的接口的输出部分;
    所述组合函数块对应的接口存储在所选择的组合范式的接口部分。
  19. 根据权利要求18所述的方法,其中,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口还包括以下至少一项:
    对于所述至少两个函数块中的任一个函数块,在所述任一个函数块对应的任一输入数据项或输出数据项的数据类型属性为组合数据类型的情况下,若不提取组合数据类型的所述任一输入数据项或输出数据项中的某个数据项作为所述组合函数块对应的接口一部分,则将所述任一输入数据项或输出数据项打散,不提取所述某个数据项,将所述任一输入数据项或输出数据项中的其余数据项重新组合以作为与所述组合函数对应的接口的一部分;
    对于所述至少两个函数块中的任一个函数块,在所述任一个函数块对应的任一输入数据项为常量数据项的情况下,不提取所述任一输入数据项作为所述组合函数块对应的 接口的一部分;
    对于所述至少两个函数块对应的输入数据项,不提取存储类型属性为虚拟存储的输入数据项作为所述组合函数块对应的接口的一部分;
    对于所述至少两个函数块对应的任一输出数据项,响应于所述任一输出数据项通过所述数据传递连线直接或间接连接至少一个输出数据项,获取所述任一输出数据项和所述至少一个输出数据项中最先出现的输出数据项作为待提取输出数据项,在所述待提取输出数据项与任一输入数据项连接的情形下,若所述待提取输出数据项出现在所述任一个输入数据项之前,不提取所述待提取输出数据项作为所述组合函数块对应的接口的一部分,若所述待提取输出数据项出现在所述任一个输入数据项之后或者所述待提取输出数据项和所述任一个输入数据项属于同一个函数块,提取所述待提取输出数据项作为所述组合函数块对应的接口的一部分,根据需求将所述至少两个函数块对应的输出数据项的未被提取为接口的部分数据项提取为接口;
    对于所述至少两个函数块对应的输出数据项,提取所述至少两个函数块对应的全部输出数据项作为所述组合函数块对应的接口。
  20. 根据权利要求19所述的方法,其中,当所述至少一个组合范式为所述顺序组合范式,所述组合函数块为顺序结构的组合函数块,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口组合过程中,所述组合函数块对应的接口中的数据项由所述至少两个函数块对应接口中的数据项按顺序生成,所述组合函数块对应的接口中的数据项的数据类别属性为基本组合数据类型。
  21. 根据权利要求20所述的方法,其中,当所述至少一个组合范式为所述条件组合范式,所述组合函数块为条件结构的组合函数块,
    对于所述条件结构的组合函数块,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口还包括:
    不提取所述条件结构的组合函数块中的属于所述判断条件部分的函数块的输出数据项作为所述条件结构的组合函数块对应的接口的一部分;
    响应于所述条件结构的组合函数包括至少两个输入数据项,将属于所述判断条件部分的函数块对应的接口的输入数据项、属于所述第一分支部分中的函数块对应的接口的输入数据项和属于所述第二分支部分中的函数块的对应的接口的输入数据项提取为所述条件结构的组合函数块对应的接口的输入部分,所述条件结构的组合函数块对应的接口的输入部分的数据类别属性为基本组合数据类型;
    响应于所述条件结构的组合函数包括至少两个输出数据项,所述至少两个输出数据项具有异或结构,所述至少两个输出数据项包括属于所述第一分支部分中的函数块的第一输出异或部分和属于所述第二分支部分中的函数块的第二输出异或部分,
    在所述至少两个输出数据项中的任一输出数据项中的部分数据项被所述数据传递连线连接的情况下,提取所述任一输出数据项中的部分数据项作为所述条件结构的组合函数块的公共输出部分,
    在所述至少两个输出数据项中的第一输出异或部分的所有输出数据项被提取为所述公共输出部分的情况下,所述第一输出异或部分的所有输出数据项不作为所述异或结构的一部分,将所述第二输出异或部分中除被提取为所述公共输出部分以外的其他输出数据项单独作为所述异或结构的一部分。
  22. 根据权利要求21所述的方法,其中,当所述至少一个组合范式为所述循环组合范式,所述组合函数块为循环结构的组合函数块,每个循环体包括多个循环部分,
    对于所述循环结构的组合函数块,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口还包括:
    不提供与所述循环结构的组合函数块中的位于所述单次表达式、每个循环部分的条件表达式和末尾循环表达式中的函数块的输出数据项对应的接口;
    对于所述循环结构的组合函数块中的任一输入数据项,如果在所述多个循环部分中的一些循环部分中的所述任一输入数据项被连线连接,在所述多个循环部分中的另一些循环部分中的所述任一输入数据项没有被连线,提供与所述多个循环部分对应的多个所述任一输入数据项的存储属性为真实存储的输入数据项对应的接口;
    对于所述循环结构的组合函数块中的任意一个输出数据项,如果在所述多个循环部分中的一些循环部分中的所述任一输出数据项被连线连接,在所述多个循环部分中的另一些循环部分中的所述任一输出数据项没有被连线,只提供所述多个循环部分中的第一个循环部分中的所述任一输出数据项为对应的接口或者对所述多个循环部分中的多个所述任一输出数据项进行N化提取;
    当所述至少一个组合范式为所述当型循环组合范式,所述组合函数块为当型循环结构的组合函数块,每个当型循环体包括多个当型循环部分,
    对于所述当型循环结构的组合函数块,将所述至少两个函数块封装为组合函数块,并生成所述组合函数块对应的接口还包括:
    不提供与所述当型循环结构的组合函数块中的位于所述当型条件表达式中的函数块的输出数据项对应的接口;
    对于所述当型循环结构的组合函数块中的任一输入数据项,如果在所述多个当型循环部分中的一些当型循环部分中的所述任一输入数据项被连线连接,在所述多个当型循环部分中的另一些当型循环部分中的所述任一输入数据项没有被连线,提供与所述多个当型循环部分对应的多个所述任一输入数据项的存储属性为真实存储的输入数据项对应的接口;
    对于所述当型循环结构的组合函数块中的任意一个输出数据项,如果在所述多个当型循环部分中的一些当型循环部分中的所述任一输出数据项被连线连接,在所述多个当型循环部分中的另一些当型循环部分中的所述任一输出数据项没有被连线,只提供所述多个当型循环部分中的第一层当型循环部分中的所述任一输出数据项为对应的接口或者对所述多个当型循环部分中的多个所述任一输出数据项进行N化提取;
    所述循环结构或当型循环结构的组合函数块对应的接口中的数据项的数据类别属性为数组类型。
  23. 根据权利要求7-22任一项所述的方法,其中,所述多个函数块中的每个函数块通过图形化的形式呈现,所述图形化对应有符号语言,所述符号语言包括可扩展标记语言。
  24. 根据权利要求23所述的方法,其中,所述多个函数块中的任一函数块对应的可扩展标记语言包括计算序列部分、接口部分、连线关系部分和接口与序列对照部分,
    所述计算序列部分用于描述所述任一函数块所包括的函数块的接口;
    所述接口部分用于描述所述任一函数块的接口;
    所述连线关系部分用于描述所述任一函数块所包括的函数块之间的数据传递关系、输入合并关系;
    所述接口与序列对照部分用于描述所述任一函数块所包括的函数块中的数据项与所述任一函数块的接口中的数据项的对照关系,还描述任一函数块中的由辅助合并连线进行连接的输入数据项之间的连线关系,
    所述对照关系通过所述任一函数块的接口中的数据项的第一相对路径和第二相对路径体现。
  25. 根据权利要求24所述的方法,
    其中,对于所述至少两个函数块中的任一函数块对应的任一输入数据项,所述任一输入数据项被提取作为所述组合函数块对应的接口的一部分,
    所述任一输入数据项对应有第一相对路径,所述任一输入数据项的第一相对路径表示所述任一输入数据项在所述组合函数块对应的接口的输入部分中的相对路径,
    所述任一输入数据项的第一相对路径的表现形式如下:
    in.Path(data_in1)
    其中,in表示所述任一输入数据项处于所述组合函数块对应的接口的输入部分;
    Path(data_in1)是按照以下方式计算的所述任一输入数据项的相对路径:基于所述组合函数块的拼接结构,在从所述组合函数块所对应的接口的输入部分的与所述任一输入数据项对应的最外层的输入数据项至所述任一输入数据项之间,逐层获取与所述任一输入数据项相关的相对地址属性,并根据与所述任一输入数据项相关的相对地址属性计算得到所述任一输入数据项的相对路径;
    其中,对于所述任一函数块对应的任一输出数据项,所述任一输出数据项被提取作为所述组合函数块对应的接口的一部分,
    所述任一输出数据项对应有第一相对路径,所述任一输出数据项的第一相对路径表示所述任一输出数据项在所述组合函数块对应的接口的输出部分中的相对路径,
    所述任一输出数据项的第一相对路径的表现形式如下:
    out.Path(data_out1)
    其中,out表示所述任一输出数据项处于所述组合函数块对应的接口的输出部分;
    Path(data_out1)是按照以下方式计算的所述任一输出数据项的相对路径:基于所述组合函数块的拼接结构,在从所述组合函数块所对应的接口的输出部分的与所述任一输出数据项对应的最外层的输出数据项至所述任一输出数据项之间,逐层获取与所述任一输出数据项相关的相对地址属性,并根据与所述任一输出数据项相关的相对地址属性计算得到所述任一输出数据项的相对路径。
  26. 根据权利要求14或15所述的方法,
    其中,对于所述至少两个函数块中的任一函数块对应的接口中的任一输入数据项,所述任一输入数据项对应有第二相对路径,所述任一输入数据项的第二相对路径表示所述任一输入数据项在所述组合函数块中的相对路径,所述任一输入数据项的第二相对路径的表现形式为:
    Path(PF).in.Path(data_in2)
    其中,Path(PF)是按照以下方式计算的所述任一函数块在所述组合函数块中的相对路径:基于所述组合函数块的拼接结构,在从所述组合函数块的与所述任一函数块对应的 最外层的函数块至所述任一函数块之间,逐层获取与所述任一函数块相关的相对地址属性,并根据与所述任一函数块相关的相对地址属性计算得到所述任一函数块的相对路径;
    in表示所述任一输入数据项处于所述任一函数块对应的接口的输入部分,
    Path(data_in2)是按照以下方式计算的所述任一输入数据项在所述任一函数块对应的接口的输入部分中的相对路径:在从所述任一函数块所对应的接口的输入部分的与所述任一输入数据项对应的最外层的输入数据项至所述任一输入数据项之间,逐层获取与所述任一输入数据项相关的相对地址属性,并根据与所述任一输入数据项相关的相对地址属性计算得到所述任一输入数据项的相对路径;
    其中,对于所述任一函数块对应的接口中的任一输出数据项,所述任一输出数据项对应有第二相对路径,所述任一输出数据项的第二相对路径表示所述任一输出数据项在所述组合函数块中的相对路径,所述任一输出数据项的第二相对路径的表现形式为:
    Path(PF).out.Path(data_out2)
    其中,out表示所述任一输出数据项处于所述任一函数块对应的接口的输出部分,
    Path(data_out2)是按照以下方式计算的所述任一输出数据项在所述任一函数块对应的接口的输出部分中的相对路径:在从所述任一函数块所对应的接口的输出部分的与所述任一输出数据项对应的最外层的输出数据项至所述任一输出数据项之间,逐层获取与所述任一输出数据项相关的相对地址属性,并根据与所述任一输出数据项相关的相对地址属性计算得到所述任一输出数据项的相对路径。
  27. 根据权利要求1-26任一项所述的方法,其中,所述至少一个输入数据项和所述至少一个输出数据项无需指定变量名称。
  28. 根据权利要求6所述的方法,还包括:
    从所述基本函数块中选择表示所述赋值表达式的至少一个基本函数块和表示所述关系表达式的至少一个基本函数块作为所述至少两个函数块,
    按照所述多个组合范式中的至少一个组合范式,对所述至少两个函数块进行组合包括:
    选择所述顺序组合范式、所述条件组合范式和所述当型循环组合范式中的至少一个作为所述至少一个组合范式;
    按照所述至少一个组合范式,对所述至少两个函数块进行组合。
  29. 根据权利要求28所述的方法,其中,在将每个基本函数块对应的可扩展标记语言编译为高级语言的情况下,所述名称属性被编译为所述高级语言中的变量名称。
  30. 一种根据权利要求1~29任一项所述的方法得到的组合函数块,包括:一个或多个函数块,其中,所述一个或多个函数块通过数据传递连线和/或辅助合并连线进行连接。
  31. 一种构造组合函数块的装置,包括:
    存储器,用于非瞬时性地存储计算机可读指令;
    处理器,用于运行所述计算机可读指令,所述计算机可读指令被所述处理器运行时实现根据权利要求1~29任一项所述的方法。
  32. 一种非瞬时性计算机可读存储介质,其中,所述非瞬时性计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现根据权利要求1~29中任一项所述的方法。
PCT/CN2022/125382 2021-09-28 2022-10-14 构造组合函数块的方法及装置、组合函数块、存储介质 WO2023051832A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
GB2404687.2A GB2625954A (en) 2021-09-28 2022-10-14 Method and apparatus for constructing composite function block, composite function block, and storage medium
NO20240309A NO20240309A1 (en) 2021-09-28 2024-04-02 Method and apparatus for constructing composite function block, composite function block, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111142660.XA CN113867696A (zh) 2021-09-28 2021-09-28 构造组合函数块的方法及装置、组合函数块、存储介质
CN202111142660.X 2021-09-28

Publications (1)

Publication Number Publication Date
WO2023051832A1 true WO2023051832A1 (zh) 2023-04-06

Family

ID=78991901

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/125382 WO2023051832A1 (zh) 2021-09-28 2022-10-14 构造组合函数块的方法及装置、组合函数块、存储介质

Country Status (4)

Country Link
CN (1) CN113867696A (zh)
GB (1) GB2625954A (zh)
NO (1) NO20240309A1 (zh)
WO (1) WO2023051832A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867696A (zh) * 2021-09-28 2021-12-31 山东程序元软件有限公司 构造组合函数块的方法及装置、组合函数块、存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100205205A1 (en) * 2009-02-06 2010-08-12 Greg Hamel Computing platform based on a hierarchy of nested data structures
CN103838574A (zh) * 2014-02-20 2014-06-04 浪潮集团山东通用软件有限公司 一种对数据表进行分组汇总的通用方法
CN105224309A (zh) * 2015-09-02 2016-01-06 青岛中星微电子有限公司 一种调取函数的方法和装置
CN105468373A (zh) * 2015-11-23 2016-04-06 郑州悉知信息科技股份有限公司 一种分支合并方法及装置
CN113867696A (zh) * 2021-09-28 2021-12-31 山东程序元软件有限公司 构造组合函数块的方法及装置、组合函数块、存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100205205A1 (en) * 2009-02-06 2010-08-12 Greg Hamel Computing platform based on a hierarchy of nested data structures
CN103838574A (zh) * 2014-02-20 2014-06-04 浪潮集团山东通用软件有限公司 一种对数据表进行分组汇总的通用方法
CN105224309A (zh) * 2015-09-02 2016-01-06 青岛中星微电子有限公司 一种调取函数的方法和装置
CN105468373A (zh) * 2015-11-23 2016-04-06 郑州悉知信息科技股份有限公司 一种分支合并方法及装置
CN113867696A (zh) * 2021-09-28 2021-12-31 山东程序元软件有限公司 构造组合函数块的方法及装置、组合函数块、存储介质

Also Published As

Publication number Publication date
NO20240309A1 (en) 2024-04-02
GB202404687D0 (en) 2024-05-15
GB2625954A (en) 2024-07-03
CN113867696A (zh) 2021-12-31

Similar Documents

Publication Publication Date Title
CN102243608B (zh) 基于全局数据结构描述的软件安全测试方法
Allaki et al. A NEW TAXONOMY OF INCONSISTENCIES IN UML MODELS WITH THEIR DETECTION METHODS FOR BETTER MDE.
NO20240309A1 (en) Method and apparatus for constructing composite function block, composite function block, and storage medium
US11107028B2 (en) Numerical graphical flow diagram conversion and comparison
US9785412B1 (en) Methods and systems for object-oriented modeling of networks
CN112214210A (zh) 后勤业务规则引擎及其配置方法、装置、设备和存储介质
US20180364986A1 (en) Extensible meta model for capturing solution patterns
CN114428728A (zh) 信息物理测试协议处理系统及方法
Handley et al. Maintaining the consistency of sysml model exports to XML metadata interchange (XMI)
CN112926109B (zh) 一种复杂嵌入式系统虚拟运行环境可视化建模方法
US8423977B2 (en) Implementing a class oriented data flow program on a programmable hardware element
CN113705143A (zh) 一种自动化仿真系统和自动化仿真方法
US8375355B2 (en) Conversion of a class oriented data flow program to a structure oriented data flow program
US11025526B2 (en) Control of event-driven software applications
US8356290B2 (en) Conversion of a class oriented data flow program with inheritance to a structure oriented data flow program
CN102902519B (zh) 一种基于动态系统实现复合断言计算的方法
US8458682B2 (en) Conversion of a class oriented data flow program to a structure oriented data flow program with dynamic interpretation of data types
WO2024046458A1 (zh) 层次化系统、运算方法、装置、电子设备及存储介质
WO2024046459A1 (zh) 模型管理装置及用于神经网络运算的层次化系统
Li et al. Managing intra-class complexity with axiomatic design and design structure matrix approaches
CN117435177A (zh) 应用程序接口构建方法、系统、设备及存储介质
Song A general model for component-based software
Mishra et al. Role of UML in Object Oriented Design
CN118278355A (zh) 电路层级结构图的生成方法
CN117667112A (zh) 一种基于babel的前端开发文档自适应生成方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22875212

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE