Application development support method and application development support system
By dynamically generating the source code for the processing control unit and implementing data type conversion for the application logic and platform input/output unit, the method addresses the challenge of adapting application logic to the execution environment platform, reducing adaptation time and effort.
Patent Information
- Application Number
- PCT/JP2024/035131
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-29
- Filing Date
- 2024-10-01
- Publication Date
- 2025-06-05
AI Technical Summary
The challenge is to reduce the time and effort required for adapting application logic to the execution environment platform, particularly in the AUTOSAR AP platform where platform-specific APIs are dynamically generated, making it difficult to prepare common APIs in advance.
The solution involves configuring the application into three parts: application logic, processing control unit, and platform input/output unit. The processing control unit's source code is dynamically generated to use dynamically generated platform-specific APIs, and data type conversion processing is required for data exchange between the application logic and the platform input/output unit.
This approach reduces the adaptation work to the platform by enabling efficient data type conversion and dynamic generation of source code, facilitating easier adaptation of applications across different platforms without modifying the application logic.
Smart Images

Figure JP2024035131_05062025_PF_FP_ABST
Abstract
Description
Application development support method and application development support system Incorporation by Reference
[0001] This application claims priority from Japanese Patent Application No. 2023-201580, filed on November 29, 2023, the contents of which are incorporated herein by reference.
[0002] The present invention relates to an application development support system that supports the development of applications.
[0003] The development environment for developing an application and the execution environment for the application may have different platforms (PF). For example, an application that runs on a platform (AUTOSAR AP) installed in an in-vehicle electronic control unit may be developed on a different platform (Simulink). In this case, the application developed in the Simulink environment must be ported (adapted) so that it can be executed in the AUTOSAR AP environment.
[0004] Even after an application is released as a production version, it is frequently modified to update or expand its functions. These changes are made in the development environment, and each time the application is modified, it must be adapted to the platform in which it is executed so that it can run on that platform. There is a need to shorten development lead times by reducing the time required for this adaptation work.
[0005] Generally, platform-specific APIs (Application Programming Interfaces) are statically defined. A common method is to prepare a common API that abstracts each platform-specific API in advance, and then implement the processing control unit to call this common API, thereby reducing the time required for adaptation work. Within this common API, there are implementations for each platform that are implemented in a way that calls the statically defined platform-specific API. If an application can use a common API, and the common API is also compatible with different platforms, the application can easily be adapted to those different platforms without modification.
[0006] However, in AUTOSAR AP, which is the platform of the execution environment, platform-specific APIs are dynamically generated by platform-specific tools, so a common API cannot be prepared in advance and modifications must be made to the application side to use the platform-specific APIs.
[0007] Therefore, to reduce the work required for platform adaptation, an application can be configured to consist of three parts: platform-independent application logic, a platform-dependent processing control unit, and a platform input / output unit. The application logic is the part that directly handles the application's main function (computational processing), and the processing control unit controls the execution of the application logic so that it runs on that platform, as well as the sending and receiving of input / output data to and from the application logic. The platform input / output unit is the part that actually communicates input / output data, and is automatically generated by a platform-specific tool. The platform-specific API mentioned above is automatically generated by this platform-specific tool.
[0008] In order to reduce the work of adapting the application configuration to the platform, it is necessary to dynamically generate the source code of the processing control unit so as to utilize the dynamically generated platform-specific API.
[0009] Additionally, within the processing control unit, data must be exchanged between the application logic and the platform I / O unit. However, application logic is implemented in a platform-independent manner, and the data types used on the application logic side are defined. Meanwhile, the data types used on the platform side are also defined by platform-specific tools on the platform I / O unit side. Even if these data types are composed of the same internal elements, they are not compatible because they have different definitions, and the processing control unit cannot pass data directly between the application logic and the platform I / O unit. For this reason, when exchanging data between the application logic and the platform I / O unit, conversion processing from one data type to the other is required.
[0010] For example, Patent Document 1 (JP 2004-38507 A) describes a technology for generating program source code for transferring data. Patent Document 1 (JP 2004-38507 A) describes a program source code generation method for generating program source code for transferring common data. The program source code generation method includes: referencing information defining groups that are units for transferring common data and groups contained in the program source code to be generated; generating program source code for transferring data based on elements contained in the groups contained in the program source code to be generated, for the program source code to be generated defined in the information; and combining the program source code generated based on the elements to generate the program source code to be generated for which the groups are defined. However, Patent Document 1 does not take into account data transfer between different data types.
[0011] An object of the present invention is to reduce the work required to adapt application logic to the platform of the execution environment by generating source code that utilizes dynamically generated platform-specific APIs.
[0012] A representative example of the invention disclosed in the present application is as follows: That is, an application development support method executed by an information processing device, the information processing device having an arithmetic unit that executes predetermined arithmetic processing and a storage device accessible by the arithmetic unit, the information processing device generating source code of an application operable on a first platform based on a data calculation software component that calculates output data based on input data, the source code of the application including the data calculation software component, a platform input / output software component that inputs and outputs data to and from the first platform, and a processing control software component that controls processing of the data calculation software component and the platform input / output software component, The method includes a first step in which the arithmetic device reads the data calculation software component; a second step in which the arithmetic device obtains a first input / output data definition including a data type required in the data calculation software component; a third step in which the arithmetic device generates source code for the platform input / output software component based on the first input / output data definition; a fourth step in which the arithmetic device generates a second input / output data definition including a data type required in the platform input / output software component; and a fifth step in which the arithmetic device generates source code for a processing control software component based on a correspondence between the data type in the first input / output data definition and the data type in the second input / output data definition.
[0013] According to one aspect of the present invention, it is possible to reduce the work required to adapt application logic to the execution environment. Problems, configurations, and effects other than those described above will become apparent from the following description of the preferred embodiment of the present invention.
[0014] 1 is a diagram illustrating a configuration of an application development support system according to a first embodiment. FIG. 2 is a block diagram illustrating a physical configuration of a computer constituting the application development support system according to the first embodiment. FIG. 3 is a diagram illustrating an example of application logic code input to the application development support system according to the first embodiment. FIG. 4 is a flowchart of input / output data specification generation processing executed by an input / output data specification generation unit according to the first embodiment. FIG. 5 is a diagram illustrating an example of input / output data specification information according to the first embodiment. FIG. 6 is a diagram illustrating an example of a configuration of data structure correspondence information according to the first embodiment. FIG. 7 is a diagram illustrating an example of pseudo code of a basic part generated by a processing control unit generation unit according to the first embodiment. FIG. 8 is a diagram illustrating an example of a conversion function generated by a processing control unit generation unit according to the first embodiment. FIG. 9 is a diagram illustrating an example of a conversion function generated by a processing control unit generation unit according to the first embodiment. FIG. 10 is a flowchart of correspondence estimation processing executed by a data structure correspondence estimation unit according to the first embodiment. FIG. 11 is a flowchart illustrating details of input / output data search processing according to the first embodiment. FIG. 12 is a flowchart illustrating details of internal element correspondence search processing according to the first embodiment. FIG. 13 is a diagram illustrating a configuration of an application development support system according to a second embodiment. FIG. 14 is a flowchart of correction processing executed by an application logic code correction unit according to the second embodiment. FIG. 15 is a diagram illustrating conversion of application logic code according to the second embodiment. FIG. 16 is a diagram illustrating an example of a processing control unit according to the third embodiment. 10 is a diagram illustrating an example of a process control unit code output by a process control unit generation unit according to a third embodiment. FIG. 11 is a diagram illustrating an example of a process control setting file according to a third embodiment. FIG.
[0015] First Embodiment FIG. 1 is a diagram showing the configuration of an application development support system 1 according to a first embodiment.
[0016] The application development support system 1 of this embodiment has an input / output data specification generation unit 20, a PF input / output unit generation information generation unit 30, a PF input / output unit generation unit 40, an input / output data specification generation unit 50, a data structure correspondence estimation unit 60, a processing control unit generation unit 70, and a synthesis unit 80.
[0017] The application development support system 1 receives source code (application logic code) of application logic 2 having a calculation API, and outputs source code (application code) of application 3. The application code output from the application development support system 1 is executed as application 3 by an electronic control unit through a build process or the like.
[0018] The input / output data specification generation unit 20 generates input / output data specification information from the application logic code of the application logic 2. As shown in Fig. 3, the application logic code includes a definition of an operation API published by the application logic 2 and a definition of a data type used in an argument of the operation API. Here, the operation API is an API for driving an operation process related to a function provided by the application 3.
[0019] The PF input / output unit generation information generating unit 30 generates PF input / output unit generation information from the input / output data specification information output from the input / output data specification generating unit 20 .
[0020] The PF input / output unit generation unit 40 generates a source code of the PF input / output unit (PF input / output unit code) from the PF input / output unit generation information output from the PF input / output unit generation information generation unit 30 .
[0021] The input / output data specification generating unit 50 generates input / output data specification information from the PF input / output unit code output from the PF input / output unit generating unit 40 .
[0022] The data structure correspondence estimation unit 60 generates data correspondence information from the input / output data specification information output from the input / output data specification generation unit 20 and the input / output data specification information output from the input / output data specification generation unit 50 .
[0023] The process control unit generation unit 70 generates source code for the process control unit (process control unit code) from the data correspondence information output from the data structure correspondence estimation unit 60 .
[0024] The synthesis unit 80 synthesizes the application logic code that is input to the application development support system 1, the PF input / output unit code output from the PF input / output unit generation unit 40, and the process control unit code output from the process control unit generation unit 70, and outputs the application code. The application code is made up of a set of the application logic code, the process control unit code, and the PF input / output unit code.
[0025] 1 , the input / output data specification generation unit 20 extracts input / output data specification information from the application logic code, but the input / output data specification information may also be directly input to the application development support system 1. In this case, the input / output data specification information is directly input to the PF input / output unit generation information generation unit 30 and the data structure correspondence estimation unit 60, and the application logic code is directly input to the synthesis unit 80.
[0026] FIG. 2 is a block diagram showing the physical configuration of the computers that make up the application development support system 1 of this embodiment.
[0027] The application development support system 1 of this embodiment is configured by a computer having a processor (CPU) 101, a memory 102, an auxiliary storage device 103, and a communication interface 104. The application development support system 1 may also have an input interface 105 and an output interface 106.
[0028] The processor 101 is an arithmetic device that executes programs stored in the memory 102. The processor 101 executes various programs to realize various functional units of the application development support system 1 (e.g., an input / output data specification generation unit 20, a PF input / output unit generation information generation unit 30, a PF input / output unit generation unit 40, an input / output data specification generation unit 50, a data structure correspondence estimation unit 60, a processing control unit generation unit 70, a synthesis unit 80, etc.). Note that some of the processing performed by the processor 101 by executing the programs may be executed by another arithmetic device (e.g., hardware such as an ASIC or FPGA).
[0029] The memory 102 includes a ROM, which is a non-volatile storage element, and a RAM, which is a volatile storage element. The ROM stores unchanging programs (e.g., BIOS), etc. The RAM is a high-speed, volatile storage element such as a DRAM (Dynamic Random Access Memory), and temporarily stores programs executed by the processor 101 and data used when the programs are executed.
[0030] The auxiliary storage device 103 is a large-capacity, non-volatile storage device such as a magnetic storage device (HDD) or a flash memory (SSD). The auxiliary storage device 103 also stores data used by the processor 101 when executing a program and the program executed by the processor 101. That is, the program is read from the auxiliary storage device 103, loaded into the memory 102, and executed by the processor 101 to realize each function of the application development support system 1.
[0031] The communication interface 104 is a network interface device that controls communication with other devices in accordance with a predetermined protocol.
[0032] The input interface 105 is an interface to which input devices such as a keyboard 107 and a mouse 108 are connected and which receives input from an operator. The output interface 106 is an interface to which output devices such as a display device 109 and a printer (not shown) are connected and which outputs the results of program execution in a format that can be viewed by a user. Note that a terminal (not shown) connected to the application development support system 1 via a network may provide the input device and the output device. In this case, the application development support system 1 may have a web server function, and the terminal may access the application development support system 1 using a predetermined protocol (for example, http).
[0033] The programs executed by the processor 101 are provided to the application development support system 1 from removable media (such as a CD-ROM or flash memory) or via a network, and are stored in a non-volatile auxiliary storage device 103, which is a non-transitory storage medium. For this reason, the application development support system 1 preferably has an interface for reading data from removable media.
[0034] The application development support system 1 is a computer system configured on a single physical computer or on multiple logically or physically configured computers, and may operate on a virtual computer constructed on multiple physical computer resources. For example, each functional unit may operate on a separate physical or logical computer, or multiple functional units may be combined to operate on a single physical or logical computer.
[0035] FIG. 3 is a diagram showing an example of application logic code input to the application development support system 1. As shown in FIG.
[0036] The application logic code is source code written by a developer in accordance with the programming language specifications for the processes (especially the calculation processes) required to realize the main functions of the application, and is composed of a source file and a header file containing the following definitions: Definition of the calculation API that serves as the interface for the application logic
[0037] The arguments of the calculation API consist of input data required for the calculation process of the application logic and output data that is the result of that calculation process. Definition of data types used in the arguments of the calculation API
[0038] FIG. 4 is a flowchart of the input / output data specification generation process executed by the input / output data specification generation unit 20.
[0039] The input / output data specification generator 20 searches for an API definition based on a specific keyword from the header file of the application logic code (S101). For example, it searches for a calculation API that is open to the outside (processing control unit) using the keyword "public." Based on FIG. 3, runAppLogic is obtained as the result of S101.
[0040] Then, the input / output data specification generator 20 extracts the arguments of each operation API found as a result of the search (S102). Based on Fig. 3, the result of S102 is obtained as an argument pos3d of the app::pos data type and an argument oinfo of the app::obj data type, which are used as arguments of runAppLogic.
[0041] The input / output data specification generation unit 20 then determines whether each argument is input or output (S103). Input refers to the direction into the application logic, and output refers to the direction out of the application logic. For example, the determination may be based on a keyword (e.g., in, out) included in the argument name, or on the way the argument is passed (e.g., input if passed by value, output if passed by reference). Assuming that input data is passed by value and output data is passed by reference, the argument pos3d is determined to be input and the argument oinfo is determined to be output, based on FIG. 3.
[0042] The input / output data specification generation unit 20 then searches the header file for the data type of each argument and outputs the API definition and data type information as input / output data specification information (S104). Referring to Fig. 3, the definitions of app::pos and app::obj (the portions beginning with struct app::pos and struct app::obj) are obtained by searching the header file in S104. Then, the input / output data specification information is output based on this information.
[0043] 4 has been described the input / output data specification generation processing executed by the input / output data specification generation unit 20. The input / output data specification generation unit 50 also performs the same processing on the PF input / output unit code by replacing the application logic code with the PF input / output unit code and the calculation API with the transmission / reception API in the above description.
[0044] FIG. 5 is a diagram showing an example of input / output data specification information output by the input / output data specification generating unit 20. As shown in FIG.
[0045] The input / output data specification information may be in any format, for example, a json file that conforms to the json specification.
[0046] The input / output data specification information is composed of information extracted from the header file of the application logic code, and includes the following information: Interface name (application logic corresponds to the operation API name, and is described as the ifname element in FIG. 5) Input / output data information (corresponding to the argument of the operation API, and is described as the data element in FIG. 5) Data type name of the input / output data (data.type element in FIG. 5), variable name (data.name element in FIG. 5), input / output direction (receive or transmit) of that data type (corresponding to the data.direction element in FIG. 5), and data type name and element name of each internal element included in that data type (data.elements element in FIG. 5)
[0047] The input / output data specification information output by the input / output data specification generator 50 is similarly expressed based on the transmission / reception API definition included in the PF input / output unit code. The interface name corresponds to the transmission / reception API, and the input / output data information corresponds to the data sent / received by the transmission / reception API.
[0048] The PF input / output unit generation information generation unit 30 converts the format of the input / output data specification information output from the input / output data specification generation unit 20 and generates PF input / output unit generation information. The PF input / output unit generation information generation unit 30 converts all information included in the input / output data specification information into a format that is included in the PF input / output unit generation information. This format conversion can be easily achieved using known technology. Furthermore, information not included in the input / output data specification information may be added to the PF input / output unit generation information based on fixed values or setting information.
[0049] The format of the PF input / output unit generation information depends on the input specifications of the PF input / output unit generation unit 40, but for example, there is an ARXML file that conforms to the ARXML specifications (AUTOSAR XML), and the ARXML specifications are configured to include the following information: Interface names of the PF input / output unit (names related to the transmission / reception API) Data types communicated in each of the above interfaces and their internal elements
[0050] The data type to be communicated and its internal elements are included in the input / output data specification information, and are set by the PF input / output unit generation information generating unit 30 through format conversion.
[0051] The PF input / output unit generation unit 40 generates a PF input / output unit code based on the PF input / output unit generation information. The PF input / output unit generation unit 40 is already realized by a tool provided by a PF vendor, and is a known technology.
[0052] The PF input / output unit code is source code written in accordance with programming language specifications for processing data for transmission and reception via the platform. This source code consists of a source file and a header file that contains the following definitions: Definition of the transmission / reception API that serves as the interface for the PF input / output unit
[0053] The arguments of the send / receive API are composed of the data to be sent / received via the PF. Definition of the data type specified in the arguments of the send / receive API
[0054] In the PF input / output unit code output by the PF input / output unit generation unit 40, the transmission / reception API definition is generated based on the information described in the PF input / output unit generation information. At that time, the data type names, internal element names, etc. may match the information included in the PF input / output unit generation information as they are, or may be processed based on predetermined rules.
[0055] The data structure correspondence estimation unit 60 estimates the correspondence between each data structure (each data type and its internal elements) based on the input / output data specification information of the application logic 2 and the input / output data specification information of the PF input / output unit. For example, the data structure correspondence estimation unit 60 may estimate the correspondence between the data structures based on the similarity of names.
[0056] FIG. 6 is a diagram showing an example of the configuration of the data structure correspondence information.
[0057] The data structure correspondence information is information that indicates the correspondence between the input / output data structures of the application logic 2 and the PF input / output unit, and may be created, for example, based on the input / output data specification information on the application logic 2 side and the input / output data specification information on the PF input / output unit side, and may be a json file in which the corresponding input / output data specification information on the PF input / output unit side is added to the input / output data specification information on the application logic 2 side.
[0058] The data structure correspondence information shown in FIG. 6 shows the correspondence by adding input / output data specification information on the PF input / output unit side as a field beginning with "corresponding" to the input / output data specification information shown in FIG. 6. In FIG. 6, the calculation processing API of application logic 2 and the transmission / reception API of the PF input / output unit are not necessarily in one-to-one correspondence, so the corresponding ifname may be indicated within each data. For example, the app::pos and app::obj data types included in the calculation API runAppLogic may be transmitted and received using different transmission / reception APIs on the PF input / output unit side. In FIG. 6, the PF input / output unit side data type corresponding to app::pos is pf::pos, and its variable name is PosData. Furthermore, the internal elements x, y, and z included in the app::pos data type correspond to the internal elements _x, _y, and _z of pf::pos, respectively. Although omitted from FIG. 6, the correspondence between the app::obj data type and the pf::obj data type is similarly described as with the correspondence between app::pos and pf::pos.
[0059] 11 is a flowchart of the correspondence estimation process executed by the data structure correspondence estimation unit 60. The data structure correspondence information shown in FIG.
[0060] The correspondence estimation process can employ an estimation method that estimates the correspondence between data types or their internal elements based on, for example, the similarity of names. 1. With regard to data types (structures), for example, it is possible to use the matching rate of data type names to determine that there is a correspondence between the data type referenced by the calculation API on the application logic side and the data type referenced by the transmission / reception API on the PF input / output unit side, which has the most similar name. 2. With regard to the internal elements included in each data type in 1 above, for example, it is possible to use the matching rate of internal element names of each data type to determine that there is a correspondence between the data types with the most similar names of internal elements of each data type.
[0061] First, the data structure correspondence estimation unit 60 selects one piece of input / output data (A) from the input / output data specification information of the application logic (S111). Then, the data structure correspondence estimation unit 60 searches for input / output data (B) that corresponds to the input / output data (A) from the input / output data specification information of the PF input / output unit (S112). Then, the data structure correspondence estimation unit 60 searches for a correspondence between the internal elements of the input / output data (A) and the internal elements of the input / output data (B) (S113). The processing of steps S111 to S113 is performed for all input / output data included in the input / output data specification information of the application logic.
[0062] FIG. 12 is a detailed flowchart of the input / output data search process (S112).
[0063] The data structure correspondence estimation unit 60 refers to the type information of the input / output data specification information and calculates the match rate between the data type name of each data type included in the input / output data specification information of the PF input / output unit and the data type name of the input / output data (A) (S121). For example, consider the case where the type information of the input / output data (A) is app::pos and the list of type information of each data type included in the input / output data specification information of the PF input / output unit is as follows. In this case, the match rate with "app::pos" is calculated for each of the names below. As a result, since the character string "::pos" is common, pf::pos has the highest match rate. - List of input / output data specifications of the PF input / output unit pf::output pf::pos pf::processStatus
[0064] The data structure correspondence estimation unit 60 then determines whether there are multiple pieces of data with the highest similarity (matching rate) in data type names (S122). S122 takes into account, for example, the case where multiple pieces of input data with the same data type are present in the input of a calculation API. In such a case, all type information will be the same and a unique correspondence cannot be identified, so the determination is made based on the matching rate between argument names (name information).
[0065] If there are multiple data type names with the highest matching rate, the data structure correspondence estimation unit 60 compares the argument names among the data type names with reference to the name information in the input / output data specification information, and selects the one with the highest matching rate as a candidate for input / output data (B) (S123). For example, consider a case where the input / output data specification information of the application logic contains multiple pieces of data of type ara::pos (type information), each with the names sensor1 and sensor2 (name information), while the input / output data specification information of the PF input / output unit also contains multiple pieces of data of type pf::pos, each with the names sensor1 and sensor2. In this case, it is determined that sensor1 of ara::pos and sensor1 of pf::pos correspond to each other based on the matching rate of the name information.
[0066] On the other hand, if there is only one data type name with the highest matching rate, the data structure correspondence estimation unit 60 selects the one with the highest matching rate as a candidate for input / output data (B) (S124).
[0067] Thereafter, the data structure correspondence estimation unit 60 determines whether the input / output directions of the input / output data (A) and the input / output data (B) candidates are the same based on the direction information (S125).
[0068] If the input / output directions of the input / output data (A) and the input / output data (B) candidates are the same, the input / output data search process is terminated. On the other hand, if the input / output directions of the input / output data (A) and the input / output data (B) candidates are different, the current input / output data (B) candidate is excluded (S126), and the process returns to step S121, where iterative processing is performed on unprocessed data types. This is because, assuming data transfer from the platform input / output unit to the application logic, the input / output directions are the same, so data with different input / output directions are excluded.
[0069] FIG. 13 is a detailed flowchart of the internal element correspondence search process (S113).
[0070] The data structure correspondence estimation unit 60 selects one internal element from the input / output data (A) (S131).
[0071] The data structure correspondence estimation unit 60 then calculates the match rate by comparing the element names of each internal element included in the input / output data (B) with the element names of the internal elements of the input / output data (A) selected in S131. Then, it is determined that the internal element included in the input / output data (B) with the highest match rate corresponds to the internal element of the input / output data (A) selected in S131 (S132). For example, if an internal element x on the input / output data (A) side is selected and the following internal element is included on the input / output data (B) side, it is determined that _x of the input / output data (B) has a high match rate. Input / output data (B) _x _y _z
[0072] The data structure correspondence estimation unit 60 then determines whether all internal elements of the input / output data (A) have been examined (S133), and if the examination of all internal elements of the input / output data (A) has been completed, ends the internal element correspondence search process. On the other hand, if the examination of some internal elements of the input / output data (A) has not been completed, the process returns to step S131 and executes processing on the unexamined internal elements.
[0073] Fig. 7 is a diagram showing an example of pseudocode of the basic part of the process control unit generated by the process control unit generation unit 70, and Figs. 8 and 9 are diagrams showing examples of conversion functions generated by the process control unit generation unit 70. Fig. 10 is a diagram showing an example of pseudocode of the process control unit generated by the process control unit generation unit 70 based on Figs. 7 to 9.
[0074] The process control unit generation unit 70 generates the basic part of the process control unit code based on the data structure correspondence information. For example, it generates source code for the basic part shown below, which receives input data required for the application logic calculation process, performs the application logic calculation process, and transmits the output results. The pseudocode is shown in FIG. 7. (1) Start execution. (2) Loop the following process. (2-1) Call the reception API and receive data (in FIG. 7, pf::pos type data is received and the received data is stored in the PosData variable). (2-2) Prepare the variables pos3d and oinfo required as arguments for the application logic calculation API, and call the calculation API while passing them as arguments (at the stage shown in FIG. 7, values have not been set for the variables). (2-3) Prepare the variable objData required for the argument required for the transmission API, and call the transmission API while passing it as an argument (at the stage shown in FIG. 7, values have not been set for the variables).
[0075] The above (2-1) to (2-3) can be generated based on data structure correspondence information. For example, (2-1) can be generated by checking the PF input / output unit side (= information with corresponding added) in the data structure correspondence information and generating it based on that. (2-2) can be generated by preparing corresponding variables based on the information on the application logic side (= information without corresponding added) in the data structure correspondence information and then generating an arithmetic API call. (2-3) can be generated by checking the PF input / output unit side in the same way as (2-1) and generating it based on that. Whether (2-1) or (2-3) is generated can be clearly identified by checking the corresponding direction information of each data.
[0076] At the time of Fig. 7, data transfer has not been performed between the arguments of the calculation API of the application logic and the arguments of the transmission / reception API of the PF input / output unit. In order to perform this data transfer, the functions of Fig. 8 and Fig. 9 described below are generated.
[0077] The process control unit generation unit 70 generates functions for converting data types, such as those shown in FIG. 8, based on the data structure correspondence information. For example, from the data structure correspondence information shown in FIG. 6, functions can be generated using the corresponding application logic and PF input / output unit data types app::pos and pf::pos, their input / output directions, and information on the corresponding internal elements in each data type (e.g., x, _x). In FIG. 6, since the "direction" attribute and the "correspondingdirection" attribute are "in," it is determined that the conversion is from the platform input / output unit side to the application logic side, i.e., from pf::pos to app::pos, and the data type conversion function shown in FIG. 8 is generated. The function generated here performs copy processing between elements using assignment statements, but methods other than assignment statements may be used depending on the data type. For example, the copy() function may be used for the std::string type (character string type) in C++.
[0078] Conversely, if the "direction" attribute and the "correspondingdirection" attribute are set to "out" in Fig. 6, a data type conversion function that converts data from the application logic side to the PF input / output unit side, i.e., from app::pos to pf::pos, can be generated. The data type conversion function in this case is shown in Fig. 9.
[0079] Furthermore, the process control unit generation unit 70 inserts the data type conversion function of FIG. 8 into the basic part of the process control unit of FIG. 7 . The result is shown in FIG. 10 . The insertion position of each function is determined by the direction attribute and the corresponding direction attribute. If the direction attribute and the corresponding direction attribute are set to "in," the function is inserted before the calculation API (runAppLogic); if the direction attribute and the corresponding direction attribute are set to "out," the function is inserted after the calculation API. As described above, the conversion functions for all corresponding pairs are inserted into the appropriate locations of the basic part of the process control unit according to the values of the direction attribute and the corresponding direction attribute. At this time, the arguments set for each data type conversion function are set according to the data type of each argument. As a result, as shown in FIG. 10 , data type conversion from pf::pos type to app::pos is performed between the calculation API on the application logic side and the transmission / reception API of the PF input / output unit, enabling data transfer.
[0080] As described above, according to the first embodiment of the present invention, application logic code, PF input / output unit code dynamically generated by the platform, and processing control unit code corresponding to the transmission / reception API of the PF input / output unit and the calculation API of the application logic are generated, and by combining these, application code is generated, thereby reducing the work of adapting the application logic to the execution environment.
[0081] <Example 2> In Example 1, data conversion was used to achieve compatibility in data exchange between the application logic and the PF input / output unit. However, because assignment processing is performed on an element-by-element basis, performance issues arise regarding data type conversion for structure data consisting of a large number of internal elements. Example 2 of the present invention differs from Example 1 described above in that the data type of an argument in the calculation API of the application logic is defined by an alias reference of the data type of the argument in the transmission / reception API of the PF input / output unit. This alias reference ensures that the data type of the argument in the calculation API and the data type of the argument in the transmission / reception API are considered to be the same, eliminating the need for data type conversion. Note that Example 2 will mainly describe the differences from Example 1, and the same configurations and processes as in Example 1 will be assigned the same reference numerals and their description will be omitted.
[0082] Whether to apply the data conversion method of Example 1 or the alias reference method of Example 2 can be determined based on the number of internal elements of the data type or constraints regarding, for example, modification of application logic, and the method can be specified for each data item in the configuration information.
[0083] FIG. 14 is a diagram illustrating the configuration of an application development support system 1 according to the second embodiment.
[0084] The application development support system 1 of this embodiment includes an input / output data specification generation unit 20, a PF input / output unit generation information generation unit 30, a PF input / output unit generation unit 40, an input / output data specification generation unit 50, a data structure correspondence estimation unit 60, a process control unit generation unit 70, a synthesis unit 80, and an application logic code correction unit 90. The configurations of the input / output data specification generation unit 20, the PF input / output unit generation information generation unit 30, the PF input / output unit generation unit 40, the input / output data specification generation unit 50, and the data structure correspondence estimation unit 60 are the same as those of the first embodiment described above.
[0085] The application logic code correction unit 90 references the data correspondence information output from the data structure correspondence estimation unit 60 and corrects the application logic code of the application logic 2 .
[0086] The process control unit generation unit 70 generates the basic portion of the process control unit code shown in Fig. 7 from the data correspondence information output from the data structure correspondence estimation unit 60. In the second embodiment, unlike the first embodiment, the process control unit generation unit 70 does not generate the conversion functions shown in Fig. 8 and Fig. 9, and does not insert the conversion function shown in Fig. 10. This is because the data definitions used by the arguments of the calculation API of the application logic are defined by alias reference, making data type conversion unnecessary.
[0087] The synthesis unit 80 synthesizes the application logic code corrected by the application logic code correction unit 90, the PF input / output unit code output from the PF input / output unit generation unit 40, and the processing control unit code output from the processing control unit generation unit 70, and outputs the application code.
[0088] FIG. 15 is a flowchart of the modification process executed by application logic code modification unit 90.
[0089] The application logic code modification unit 90 selects one correspondence from the data structure correspondence information (S141). The application logic code modification unit 90 then obtains the name of the data type on the application logic side from that correspondence (S142). The application logic code modification unit 90 then searches the header file of the application logic code for the data type name from S142 and identifies the location where that data type is defined (S143). The application logic code modification unit 90 then rewrites that location so that it references the data type defined on the PF input / output unit side (S144). The processing of steps S141 to S144 is performed for all correspondences.
[0090] By the above-described process of correcting the application logic code, for example, the pre-correction application logic code shown in FIG. 16 is converted into corrected application logic code.
[0091] 16, in S141, the correspondence between app::pos and pf::pos is selected from the data structure correspondence information, and in S142, app::pos is obtained as the data type name on the application logic side. Then, in S143, the data type definition of app::pos included in the application logic code before modification is identified using app::pos as a keyword. Furthermore, in S144, the application logic code is modified so that the data type definition part of app::pos references pf::pos on the PF input / output unit side by an alias, and this becomes the application logic code after modification. As a result, app::pos is treated as the same data type as pf::pos, and data conversion processing between app::pos and pf::pos is not required.
[0092] Depending on predetermined conditions, it may be possible to select, for each data type of the argument of the calculation API of the application code, whether to execute the process of rewriting the application code (S144) as in Example 2, or the process of inserting the data conversion process into the processing control unit code as in Example 1.
[0093] As described above, according to the alias reference method of the second embodiment of the present invention, data type conversion is not required within the processing control unit code, and data can be exchanged directly between the calculation API and the transmission / reception API.
[0094] <Embodiment 3> Embodiment 3 of the present invention is an extension of embodiment 1 and embodiment 2, and executes reception processing and calculation processing at independent timing according to application requirements. Note that in embodiment 3, differences from embodiment 1 will be mainly described, and the same configurations and processes as embodiment 1 will be assigned the same reference numerals and their description will be omitted. The differences between embodiment 3 and embodiment 2 are the same as embodiment 1, and therefore description will be omitted.
[0095] Based on the first embodiment, it is difficult to support cases where reception processing and calculation processing are executed at independent timings according to application requirements (for example, timer-driven, event-driven, etc.). FIG. 17 is a more abstract diagram of FIG. 7 , which shows the basic parts of the processing control unit in the first embodiment, for the purposes of the following explanation. Based on FIG. 17 , the first embodiment can support only cases where data reception processing, calculation processing, and data transmission processing of the calculation results are executed collectively. In the third embodiment, the processing control unit generation unit 70 acquires processing control information including reception timing and calculation execution timing information for each piece of data, and generates processing control unit code that executes reception and calculation processing at specified timings.
[0096] Although not shown, the application development support system 1 of this embodiment has the same configuration as the application development support system 1 of the first or second embodiment (FIGS. 1 and 14), but differs in the function of the process control unit generation unit 70. That is, the process control unit generation unit 70 of the third embodiment generates a process control unit code from the data correspondence information output from the data structure correspondence estimation unit 60 and the process control information input from the outside.
[0097] FIG. 18 is a diagram illustrating an example of a process control unit code output by the process control unit generating unit 70 according to the third embodiment.
[0098] When the process control information includes process control unit setting information such as executing data reception processing upon data arrival and calling a calculation API of the application logic by timer driving at a 100 ms cycle, the process control unit generation unit 70 generates process control unit code as shown in FIG. 18 based on the process control unit setting information. In this process control unit code, as shown by the area enclosed by the dashed line, a callback function registration process is inserted so that the data reception processing is executed upon data arrival. Furthermore, a process is inserted in which a separate thread periodically sends a notification at a 100 ms cycle and waits for that notification. Callback function registration is realized by an API provided by the PF input / output unit and is a well-known technique. These processes are merely examples, and similar processes may be implemented by other processing means. By generating process control unit code including such processes based on the process control unit setting information, data reception processing and calculation processing can be performed at timings consistent with application requirements.
[0099] In Example 3, the process control information input to the process control unit generation unit 70 may be input from an external source, or may be generated by converting a process control setting file (see Figure 19) input from an external source.
[0100] FIG. 19 is a diagram illustrating an example of a process control setting file according to the third embodiment.
[0101] The process control settings file includes information on data reception timing and process execution timing. The process control settings file may be in any format, for example, a json file conforming to the json specification.
[0102] The data reception timing is the timing when the processing control unit calls the data reception API, such as when the data arrives on the PF side or immediately before calling the calculation API. The processing control setting file may include information ("timing": "AtArrival") that specifies the timing of receiving the data for each data type (ara::pos) to be received.
[0103] The process execution timing is the timing at which the process control unit calls the calculation API, such as periodically or when specific data is received. The process control setting file includes information specifying the execution timing (e.g., "periodical", "onDataArrival"), and if the API is to be called periodically, it may also include information specifying the periodic time ("timing": "periodical", "duration": "1sec"). Alternatively, if the API is to be called upon receiving specific data, it may also include information specifying that data (e.g., "app::pos").
[0104] As described above, according to the method of the third embodiment of the present invention, processing can be executed at any timing.
[0105] The present invention is not limited to the above-described embodiments, and includes various modifications and equivalent configurations within the spirit and scope of the appended claims. For example, the above-described embodiments have been described in detail to clearly explain the present invention, and the present invention is not necessarily limited to configurations including all of the described configurations. Furthermore, part of the configuration of one embodiment may be replaced with the configuration of another embodiment. Furthermore, the configuration of another embodiment may be added to the configuration of one embodiment. Furthermore, part of the configuration of each embodiment may be added, deleted, or replaced with other configurations.
[0106] Furthermore, the aforementioned configurations, functions, processing units, processing means, etc. may be realized in part or in whole in hardware, for example by designing them as integrated circuits, or may be realized in software by a processor interpreting and executing a program that realizes each function.
[0107] Information such as programs, tables, and files that realize each function can be stored in a storage device such as a memory, hard disk, or SSD (Solid State Drive), or in a recording medium such as an IC card, SD card, or DVD.
[0108] In addition, the control lines and information lines shown are those that are considered necessary for the explanation, and do not necessarily show all the control lines and information lines that are necessary for implementation. In reality, it can be considered that almost all components are interconnected.
Claims
1. An application development support method executed by an information processing device, the information processing device having a calculation device that executes a predetermined calculation process and a storage device accessible by the calculation device, the information processing device generating source code of an application operable on a first platform based on a data calculation software component that calculates output data based on input data, the source code of the application including the data calculation software component, a platform input / output software component that inputs / outputs data to / from the first platform, and a process control software component that controls processing of the data calculation software component and the platform input / output software component, the application development support method comprising: a first step in which the calculation device reads the data calculation software component; a second step in which the calculation device obtains a first input / output data definition including a data type required by the data calculation software component; a third step in which the calculation device generates source code of the platform input / output software component based on the first input / output data definition; and a fourth step in which the calculation device generates a second input / output data definition including a data type required by the platform input / output software component. and a fifth step in which the arithmetic device generates source code for a processing control software component based on the correspondence between the data type in the first input / output data definition and the data type in the second input / output data definition.
2. An application development support method as described in claim 1, characterized in that the source code of the generated processing control software component includes source code that executes a data conversion process that converts data conforming to the first input / output data definition into data conforming to the second input / output data definition.
3. An application development support method as described in claim 1, further comprising a step of estimating the correspondence between a data type in the first input / output data definition and a data type in the second input / output data definition based on the similarity between element names of the first input / output data definition and the second input / output data definition.
4. An application development support method as claimed in claim 2, further comprising a step of rewriting source code of the data calculation software component so that the data type in the first input / output data definition matches the data type in the second input / output data definition.
5. A method for supporting application development according to claim 4, further comprising a step of selecting whether to execute a step of rewriting the source code of said data calculation software component for at least one of the input data and the output data to be calculated by said data calculation software component, depending on a predetermined condition, or a step of generating source code for a processing control software component which executes said data conversion processing.
6. A method for supporting application development according to claim 1, further comprising the steps of: acquiring processing control specifications including specifications for data processing control required by said data calculation software component; and generating source code for a data calculation processing control software component that controls the processing executed by said data calculation software component and the processing executed by said platform input / output software component in accordance with at least one of the input data reception timing and the output data calculation timing set in said processing control specifications.
7. An application development support system that generates source code for an application operable on a first platform based on a data calculation software component that calculates output data based on input data, the system being configured with a computer having a calculation device that executes a predetermined calculation process and a storage device accessible by the calculation device, the source code for the application including the data calculation software component, a platform input / output software component that performs data input / output with the first platform, and a processing control software component that controls processing of the data calculation software component and the platform input / output software component, the application development support system comprising: an input / output data specification generation unit in which the calculation device reads in the data calculation software component and generates a first input / output data definition including a data type required by the read data calculation software component; a PF input / output unit generation information generation unit in which the calculation device generates source code for the platform input / output software component based on the first input / output data definition; and a PF input / output unit generation unit in which the calculation device generates a second input / output data definition including a data type required by the platform input / output software component. An application development support system characterized in that the arithmetic device comprises a process control unit generation unit that generates source code for a process control software component based on the correspondence between the data type in the first input / output data definition and the data type in the second input / output data definition.
Citation Information
Patent Citations
Zero-code visualization software development platform and development method
CN113268227A
Program synthesizing method
JP1996328840A
Plant monitoring control program
JP2007233957A