CN118363597A - Packaging layer generation method, device, terminal and storage medium - Google Patents

Packaging layer generation method, device, terminal and storage medium Download PDF

Info

Publication number
CN118363597A
CN118363597A CN202410354034.4A CN202410354034A CN118363597A CN 118363597 A CN118363597 A CN 118363597A CN 202410354034 A CN202410354034 A CN 202410354034A CN 118363597 A CN118363597 A CN 118363597A
Authority
CN
China
Prior art keywords
python
data type
interface
autosar
autosar standard
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202410354034.4A
Other languages
Chinese (zh)
Inventor
彭毅超
何涛
齐智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Reach Automotive Technology Shenyang Co Ltd
Original Assignee
Neusoft Reach Automotive Technology Shenyang Co Ltd
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 Neusoft Reach Automotive Technology Shenyang Co Ltd filed Critical Neusoft Reach Automotive Technology Shenyang Co Ltd
Priority to CN202410354034.4A priority Critical patent/CN118363597A/en
Publication of CN118363597A publication Critical patent/CN118363597A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application discloses a packaging layer generation method, a device, a terminal and a storage medium, wherein the method comprises the following steps: obtaining ARXML a file, wherein the ARXML file is used for describing the configuration of interfaces and data types generated in an AUTOSAR standard; analyzing ARXML files to obtain interfaces and data types in an AUTOSAR standard; acquiring a python interface and a data type; and generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing the conversion of the data type and the python data type in the AUTOSAR standard. According to the application, by constructing the conversion packaging layer for realizing the data types in the AUTOSAR standard and the python data types, the time spent on data type packaging by packaging personnel of other AUTOSAR interfaces is saved, and the conversion and calling efficiency between the data types of the AUTOSAR AP platform and the data types of the python terminal is improved.

Description

Packaging layer generation method, device, terminal and storage medium
Technical Field
The present application relates to the field of packaging technologies, and in particular, to a method and apparatus for generating a packaging layer, a terminal, and a storage medium.
Background
The AUTOSAR architecture mainly uses C, C ++ development languages, which can operate the bottom layer and have better performance, but the development languages have the problems of high complexity, easy error, personnel requirement, long development period, difficult debugging and the like. With the wide-range application of the large-power chip and POSIX system in the automobile field and the wide popularization of the whole automobile OS, a foundation and a trigger are provided for the use of a high-level language, and the use of the Python language can enable the time of a software development project to be shorter, the cost to be lower and the quality to be better.
In order to enable the Python application to quickly access the AUTOSAR framework, a platform interface provided by the AUTOSAR needs to be multiplexed, and when the original C, C ++ interface is multiplexed through the Python end, the problem of high data conversion complexity exists.
Disclosure of Invention
The application mainly aims to provide a method, a device, a terminal and a storage medium for generating a packaging layer, which are used for solving the problem of high data conversion complexity when an original C, C ++ interface is multiplexed through a Python terminal.
To achieve the above object, in a first aspect, the present application provides a packaging layer generating method, including:
Obtaining ARXML a file, wherein the ARXML file is used for describing the configuration of interfaces and data types generated in an AUTOSAR standard;
Analyzing ARXML files to obtain interfaces and data types in an AUTOSAR standard;
Acquiring a python interface and a data type;
And generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing the conversion of the data type and the python data type in the AUTOSAR standard.
In one possible implementation, the wrapper layer includes a first function, a second function, a third function, and a fourth function;
the first function is used to convert the wrapper layer type to a data type in the AUTOSAR standard, the second function is used to convert the data type in the AUTOSAR standard to a wrapper layer type, the third function is used to convert the wrapper layer type to a Python data type, and the fourth function is used to convert the Python data type to a wrapper layer type.
In one possible implementation, after parsing ARXML files to obtain the interface and the data type in the AUTOSAR standard, the method further includes:
The python library is generated based on the interface and data type in the AUTOSAR standard.
In one possible implementation, generating the python library based on the interface and the data type in the AUTOSAR standard includes:
invoking a python interface corresponding to an interface in the AUTOSAR standard;
Acquiring a python data type corresponding to the data type in the AUTOSAR standard;
the python interface and the python data type are compiled to generate a python library.
In one possible implementation, after obtaining the python interface and the data type, the method further includes:
an AUTOSAR library is generated based on the python interface and the data type.
In one possible implementation, generating an AUTOSAR library based on the python interface and data type includes:
calling an interface in an AUTOSAR standard corresponding to the python interface;
Acquiring a data type in an AUTOSAR standard corresponding to the python data type;
And compiling the interface and the data type in the AUTOSAR standard to generate an AUTOSAR library.
In one possible implementation, compiling the python interface and the python data type, after generating the python library, further comprises:
the data type in the AUTOSAR standard is accessed through the python library.
In a second aspect, an embodiment of the present invention provides a packaging layer generating device, including:
A first obtaining module, configured to obtain ARXML files, where ARXML files are used to describe configuration of interfaces and data types generated in an AUTOSAR standard;
The analysis module is used for analyzing the ARXML files to obtain interfaces and data types in the AUTOSAR standard;
the second acquisition module is used for acquiring the python interface and the data type;
And the generating module is used for generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing the conversion of the data type and the python data type in the AUTOSAR standard.
In a third aspect, an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any of the above wrapper generation methods when the computer program is executed.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the wrapper generation methods described above.
The embodiment of the invention provides a method, a device, a terminal and a storage medium for generating a packaging layer, which comprise the following steps: the method comprises the steps of firstly obtaining ARXML files, wherein ARXML files are used for describing configuration of interfaces and data types generated in an AUTOSAR standard, then analyzing ARXML files to obtain the interfaces and the data types in the AUTOSAR standard, obtaining python interfaces and the data types, and further generating a packaging layer based on the interfaces and the data types in the AUTOSAR standard and the python interfaces and the data types, wherein the packaging layer is used for realizing conversion of the data types in the AUTOSAR standard and the python data types. According to the invention, by constructing the conversion packaging layer for realizing the data types in the AUTOSAR standard and the python data types, the time spent on data type packaging by packaging personnel of other AUTOSAR interfaces is saved, and the conversion and calling efficiency between the data types of the AUTOSAR AP platform and the data types of the python terminal is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, are incorporated in and constitute a part of this specification. The drawings and their description are illustrative of the application and are not to be construed as unduly limiting the application. In the drawings:
fig. 1 is a flowchart of an implementation of a method for generating a packaging layer according to an embodiment of the present invention;
FIG. 2 is a flowchart of a data type conversion method according to an embodiment of the present invention;
FIG. 3 is a flow chart of an implementation of a python library generation method provided by an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a packaging layer generating device according to an embodiment of the present invention;
Fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein.
It should be understood that, in various embodiments of the present invention, the sequence number of each process does not mean that the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
It should be understood that in the present invention, "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements that are expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present invention, "plurality" means two or more. "and/or" is merely an association relationship describing an association object, and means that three relationships may exist, for example, and/or B may mean: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. "comprising A, B and C", "comprising A, B, C" means that all three of A, B, C are comprised, "comprising A, B or C" means that one of A, B, C is comprised, "comprising A, B and/or C" means that any 1 or any 2 or 3 of A, B, C are comprised.
It should be understood that in the present invention, "B corresponding to a", "a corresponding to B", or "B corresponding to a" means that B is associated with a, from which B can be determined. Determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information. The matching of A and B is that the similarity of A and B is larger than or equal to a preset threshold value.
As used herein, the term "if" may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context.
The technical scheme of the invention is described in detail below by specific examples. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the following description will be made by way of specific embodiments with reference to the accompanying drawings.
In one embodiment, as shown in fig. 1, there is provided a packaging layer generating method including the steps of:
step S101: a ARXML file is obtained.
The ARXML file is used to describe the configuration of interfaces and data types generated in the AUTOSAR standard, among other things.
AUTOSAR (AUTomotive Open System Architecture, automobile open system architecture) aims to facilitate development and interaction of automobile electronic systems. AUTOSAR is also an industry standard, and therefore also known as AUTOSAR standard, which provides a set of specifications and methods to ensure that automotive electronics of different vendors can interoperate and be reused on different automotive platforms. AUTOSAR includes software components, service interfaces, runtime environments, communication mechanisms, and the like.
Arxml denotes AUTOSAR xml, which is a human-machine readable text format describing the AUTOSAR model in xml language. Inside AUTOSAR is a file in an xml format as a core, and is called Arxml because of AUTOSAR, the AUTOSAR contains all information required in the development process of AUTOSAR, and the switching between different tools is realized through the import and export of such a file.
Step S102: and analyzing the ARXML file to obtain an interface and a data type in the AUTOSAR standard.
The AUTOSAR standard specifies three interfaces, an AUTOSAR interface, a standard AUTOSAR interface, and a standard interface, respectively. The AUTOSAR standard specifies three data types, a base data type, a container data type, and a structure data type, respectively.
Parsing ARXML files may employ any parsing tool, such as a viewing tool that supports xml file formats or software that generates corresponding code files.
Since various kinds of information of the AUTOSAR, such as interfaces, data types, etc., are configured in the ARXML file, the AUTOSAR information configured in the ARXML file can be directly referred to through the above-mentioned parsing tool.
Step S103: the python interface and data type are acquired.
The Python interface is understood in Python as an abstraction that defines a set of methods or functions that a class needs to implement to ensure that they support certain operations, which can be implemented by inheriting or implementing the class of the interface.
The data types of python include Number, string, list, tuple, set, dictionary, etc.
Step S104: the wrapper layer is generated based on the interface and data type in the AUTOSAR standard, as well as the python interface and data type.
The packaging layer is used for realizing conversion of the data type and the python data type in the AUTOSAR standard.
Wherein the wrapper layer comprises a first function, a second function, a third function, and a fourth function; the first function is used to convert the wrapper layer type to a data type in the AUTOSAR standard, the second function is used to convert the data type in the AUTOSAR standard to a wrapper layer type, the third function is used to convert the wrapper layer type to a Python data type, and the fourth function is used to convert the Python data type to a wrapper layer type.
As shown in FIG. 2, the original data type may be converted by a second function in the wrapper layer to generate a wrapper layer type, which is then converted to a python data type by a third function.
Through the functions of the four functions, when a user develops a python expansion interface of the standard AUTOSAR, a packaging layer can be directly used as a parameter or a return value of the interface, so that the quick docking from a C++ interface of the AUTOSAR to a python library interface is realized without concern about the conversion of data types.
Furthermore, due to the nature of the Python weak-type language, the variable data type does not need to be explicitly declared during programming, so that the conversion process from the original AUTOSAR interface to the Python interface will require a great deal of work to check the validity of the entry, and after the packaging layer interface is used, all the steps will be processed by the interface, and once the check fails, a standard error of Python will be returned for use.
The wrapper layer itself may also generate the corresponding data type at the Python end, and other types will be generated as native types of Python, except that the structure type will be mapped to a Python class. For these conversions, python developers can be used directly with great convenience.
For example: in order to realize the conversion of a function String do_ something (Vector < int8_t >) to a Python function defdo_ something (arguments), only a package type variable of an original parameter type Vector < int8_t > (the package type and the original type in an AUTOSAR interface are derived from ARXML files, so that the corresponding type can be found in a package library) needs to be defined, then the parameter of the source Python object type is taken as an input parameter (corresponding to a list str here), and the conversion work of the type variable is called, so that the conversion work of the checksum Python type to the original type (successful return of a result and failure return of abnormal information) can be completed.
By adopting the same way, a package type variable of the original return value type String can be defined, then the return value is used as an input parameter, the conversion work from the original type to the Python type can be completed by calling the conversion method of the type variable, and the return value is returned to the Python end.
In order to access the data type in the AUTOSAR standard through the python library, after the ARXML file is parsed to obtain the interface and the data type in the AUTOSAR standard, the python library is also generated based on the interface and the data type in the AUTOSAR standard.
Wherein generating the python library based on the interface and the data type in the AUTOSAR standard comprises: invoking a python interface corresponding to an interface in the AUTOSAR standard; acquiring a python data type corresponding to the data type in the AUTOSAR standard; the python interface and the python data type are compiled to generate a python library.
As shown in fig. 3, after the ARXML file is parsed by the parsing tool, the function interfaces and (data) types of the AUTOSAR standard, as well as the standard data types, are generated. And then converting the function interface and the (data) type of the AUTOSAR standard by using the function interface and the (data) type of the python encapsulation layer (namely the encapsulation layer) to obtain the python function interface and the (data) type, and converting the standard data type by using the python encapsulation layer data type code to obtain the python data type. And finally compiling the python function interface, the (data) type and the python data type through a compiling tool to generate a python library.
When the python library is generated, the interfaces and data types in the AUTOSAR standard can be accessed directly through the python interface library and the python data type library in the python library.
Similarly, the AUTOSAR library is also generated based on the python interface and data type after the python interface and data type are acquired. Wherein generating an AUTOSAR library based on the python interface and the data type comprises: calling an interface in an AUTOSAR standard corresponding to the python interface; acquiring a data type in an AUTOSAR standard corresponding to the python data type; and compiling the interface and the data type in the AUTOSAR standard to generate an AUTOSAR library.
Through the design of the shielding layer, the data type conversion details between python and C++ in AUTOSAR are hidden, so that the data types in two languages can be mutually accessed, the development process of a developer is simplified, and the application development efficiency is improved.
The embodiment of the invention provides a packaging layer generation method, which comprises the following steps: the method comprises the steps of firstly obtaining ARXML files, wherein ARXML files are used for describing configuration of interfaces and data types generated in an AUTOSAR standard, then analyzing ARXML files to obtain the interfaces and the data types in the AUTOSAR standard, obtaining python interfaces and the data types, and further generating a packaging layer based on the interfaces and the data types in the AUTOSAR standard and the python interfaces and the data types, wherein the packaging layer is used for realizing conversion of the data types in the AUTOSAR standard and the python data types. According to the invention, by constructing the conversion packaging layer for realizing the data types in the AUTOSAR standard and the python data types, the time spent on data type packaging by packaging personnel of other AUTOSAR interfaces is saved, and the conversion and calling efficiency between the data types of the AUTOSAR AP platform and the data types of the python terminal is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
The following are device embodiments of the invention, for details not described in detail therein, reference may be made to the corresponding method embodiments described above.
Fig. 4 shows a schematic structural diagram of a packaging layer generating device according to an embodiment of the present invention, and for convenience of explanation, only a portion related to the embodiment of the present invention is shown, where the packaging layer generating device includes a first obtaining module 401, an analyzing module 402, a second obtaining module 403, and a generating module 404, and specifically is as follows:
a first obtaining module 401, configured to obtain ARXML files, where ARXML files are used to describe configuration of interfaces and data types generated in the AUTOSAR standard;
The parsing module 402 is configured to parse ARXML files to obtain interfaces and data types in the AUTOSAR standard;
a second obtaining module 403, configured to obtain a python interface and a data type;
A generating module 404, configured to generate a wrapper layer based on the interface and the data type in the AUTOSAR standard, and the python interface and the data type, where the wrapper layer is configured to implement conversion between the data type and the python data type in the AUTOSAR standard.
In one possible implementation, the wrapper layer includes a first function, a second function, a third function, and a fourth function;
the first function is used to convert the wrapper layer type to a data type in the AUTOSAR standard, the second function is used to convert the data type in the AUTOSAR standard to a wrapper layer type, the third function is used to convert the wrapper layer type to a Python data type, and the fourth function is used to convert the Python data type to a wrapper layer type.
In one possible implementation, after the parsing module 402, a python library generation module is further included, where the python library generation module is configured to generate a python library based on the interface and the data type in the AUTOSAR standard.
In one possible implementation, the python library generation module is further configured to invoke a python interface corresponding to an interface in the AUTOSAR standard;
Acquiring a python data type corresponding to the data type in the AUTOSAR standard;
the python interface and the python data type are compiled to generate a python library.
In one possible implementation, after the second obtaining module, the method further includes an AUTOSAR library generating module, where the AUTOSAR library generating module is configured to generate an AUTOSAR library based on the python interface and the data type.
In one possible implementation, the AUTOSAR library generation module is further configured to invoke an interface in an AUTOSAR standard corresponding to a python interface;
Acquiring a data type in an AUTOSAR standard corresponding to the python data type;
And compiling the interface and the data type in the AUTOSAR standard to generate an AUTOSAR library.
In one possible implementation, the AUTOSAR library generation module is followed by an access module for accessing the data types in the AUTOSAR standard via the python library.
The embodiment of the invention provides a packaging layer generating device which is used for: the method comprises the steps of firstly obtaining ARXML files, wherein ARXML files are used for describing configuration of interfaces and data types generated in an AUTOSAR standard, then analyzing ARXML files to obtain the interfaces and the data types in the AUTOSAR standard, obtaining python interfaces and the data types, and further generating a packaging layer based on the interfaces and the data types in the AUTOSAR standard and the python interfaces and the data types, wherein the packaging layer is used for realizing conversion of the data types in the AUTOSAR standard and the python data types. According to the invention, by constructing the conversion packaging layer for realizing the data types in the AUTOSAR standard and the python data types, the time spent on data type packaging by packaging personnel of other AUTOSAR interfaces is saved, and the conversion and calling efficiency between the data types of the AUTOSAR AP platform and the data types of the python terminal is improved.
Fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 5, the terminal 5 of this embodiment includes: a processor 501, a memory 502 and a computer program 505 stored in the memory 502 and executable on the processor 501. The steps of the various wrapper layer generating method embodiments described above, such as steps 101-104 shown in fig. 1, are implemented by processor 501 when executing computer program 505. Or processor 501, when executing computer program 505, performs the functions of the modules/units of the various wrapper layer generating device embodiments described above, such as the functions of modules/units 401-404 shown in fig. 4.
The present invention also provides a readable storage medium having a computer program stored therein, which when executed by a processor is configured to implement a wrapper generation method provided in the above various embodiments, including:
Obtaining ARXML a file, wherein the ARXML file is used for describing the configuration of interfaces and data types generated in an AUTOSAR standard;
Analyzing ARXML files to obtain interfaces and data types in an AUTOSAR standard;
Acquiring a python interface and a data type;
And generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing the conversion of the data type and the python data type in the AUTOSAR standard.
In one possible implementation, the wrapper layer includes a first function, a second function, a third function, and a fourth function;
the first function is used to convert the wrapper layer type to a data type in the AUTOSAR standard, the second function is used to convert the data type in the AUTOSAR standard to a wrapper layer type, the third function is used to convert the wrapper layer type to a Python data type, and the fourth function is used to convert the Python data type to a wrapper layer type.
In one possible implementation, after parsing ARXML files to obtain the interface and the data type in the AUTOSAR standard, the method further includes:
The python library is generated based on the interface and data type in the AUTOSAR standard.
In one possible implementation, generating the python library based on the interface and the data type in the AUTOSAR standard includes:
invoking a python interface corresponding to an interface in the AUTOSAR standard;
Acquiring a python data type corresponding to the data type in the AUTOSAR standard;
the python interface and the python data type are compiled to generate a python library.
In one possible implementation, after obtaining the python interface and the data type, the method further includes:
an AUTOSAR library is generated based on the python interface and the data type.
In one possible implementation, generating an AUTOSAR library based on the python interface and data type includes:
calling an interface in an AUTOSAR standard corresponding to the python interface;
Acquiring a data type in an AUTOSAR standard corresponding to the python data type;
And compiling the interface and the data type in the AUTOSAR standard to generate an AUTOSAR library.
In one possible implementation, compiling the python interface and the python data type, after generating the python library, further comprises:
the data type in the AUTOSAR standard is accessed through the python library.
The readable storage medium may be a computer storage medium or a communication medium. Communication media includes any medium that facilitates transfer of a computer program from one place to another. Computer storage media can be any available media that can be accessed by a general purpose or special purpose computer. For example, a readable storage medium is coupled to the processor such that the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an Application SPECIFIC INTEGRATED Circuits (ASIC). In addition, the ASIC may reside in a user device. The processor and the readable storage medium may reside as discrete components in a communication device. The readable storage medium may be read-only memory (ROM), random-access memory (RAM), CD-ROMs, magnetic tape, floppy disk, optical data storage device, etc.
The present invention also provides a program product comprising execution instructions stored in a readable storage medium. At least one processor of the apparatus may read the execution instructions from the readable storage medium, the execution instructions being executed by the at least one processor to cause the apparatus to implement a wrapper layer generating method provided by the various embodiments described above, comprising:
Obtaining ARXML a file, wherein the ARXML file is used for describing the configuration of interfaces and data types generated in an AUTOSAR standard;
Analyzing ARXML files to obtain interfaces and data types in an AUTOSAR standard;
Acquiring a python interface and a data type;
And generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing the conversion of the data type and the python data type in the AUTOSAR standard.
In one possible implementation, the wrapper layer includes a first function, a second function, a third function, and a fourth function;
the first function is used to convert the wrapper layer type to a data type in the AUTOSAR standard, the second function is used to convert the data type in the AUTOSAR standard to a wrapper layer type, the third function is used to convert the wrapper layer type to a Python data type, and the fourth function is used to convert the Python data type to a wrapper layer type.
In one possible implementation, after parsing ARXML files to obtain the interface and the data type in the AUTOSAR standard, the method further includes:
The python library is generated based on the interface and data type in the AUTOSAR standard.
In one possible implementation, generating the python library based on the interface and the data type in the AUTOSAR standard includes:
invoking a python interface corresponding to an interface in the AUTOSAR standard;
Acquiring a python data type corresponding to the data type in the AUTOSAR standard;
the python interface and the python data type are compiled to generate a python library.
In one possible implementation, after obtaining the python interface and the data type, the method further includes:
an AUTOSAR library is generated based on the python interface and the data type.
In one possible implementation, generating an AUTOSAR library based on the python interface and data type includes:
calling an interface in an AUTOSAR standard corresponding to the python interface;
Acquiring a data type in an AUTOSAR standard corresponding to the python data type;
And compiling the interface and the data type in the AUTOSAR standard to generate an AUTOSAR library.
In one possible implementation, compiling the python interface and the python data type, after generating the python library, further comprises:
the data type in the AUTOSAR standard is accessed through the python library.
In the above embodiment of the apparatus, it should be understood that the Processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. A method of generating a packaging layer, comprising:
Obtaining ARXML a file, wherein the ARXML file is used for describing the configuration of interfaces and data types generated in an AUTOSAR standard;
Analyzing the ARXML file to obtain an interface and a data type in an AUTOSAR standard;
Acquiring a python interface and a data type;
And generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing conversion of the data type and the python data type in the AUTOSAR standard.
2. The packaging layer generation method of claim 1, wherein the packaging layer includes a first function, a second function, a third function, and a fourth function;
The first function is used to convert a wrapper layer type to a data type in the AUTOSAR standard, the second function is used to convert a data type in the AUTOSAR standard to the wrapper layer type, the third function is used to convert the wrapper layer type to a python data type, and the fourth function is used to convert the python data type to a wrapper layer type.
3. The method for generating a packaging layer according to claim 1, wherein after parsing the ARXML file to obtain the interface and the data type in the AUTOSAR standard, further comprises:
A python library is generated based on the interface and data type in the AUTOSAR standard.
4. The packaging layer generation method of claim 3, wherein the generating a python library based on the interface and the data type in the AUTOSAR standard comprises:
Invoking a python interface corresponding to an interface in the AUTOSAR standard;
Acquiring a python data type corresponding to a data type in the AUTOSAR standard;
Compiling the python interface and the python data type to generate the python library.
5. The method for generating a packaging layer as claimed in claim 1, wherein after said obtaining the python interface and the data type, further comprising:
an AUTOSAR library is generated based on the python interface and data type.
6. The packaging layer generation method of claim 5, wherein the generating an AUTOSAR library based on the python interface and data type comprises:
Calling an interface in an AUTOSAR standard corresponding to the python interface;
acquiring a data type in an AUTOSAR standard corresponding to the python data type;
And compiling an interface and a data type in the AUTOSAR standard to generate the AUTOSAR library.
7. The method of claim 4, wherein compiling the python interface and the python data type to generate the python library further comprises:
And accessing the data type in the AUTOSAR standard through the python library.
8. A packaging layer generating device, comprising:
A first obtaining module, configured to obtain ARXML a file, where the ARXML file is used to describe a configuration of an interface and a data type generated in an AUTOSAR standard;
The analysis module is used for analyzing the ARXML files to obtain interfaces and data types in an AUTOSAR standard;
the second acquisition module is used for acquiring the python interface and the data type;
And the generating module is used for generating a packaging layer based on the interface and the data type in the AUTOSAR standard and the python interface and the data type, wherein the packaging layer is used for realizing the conversion of the data type and the python data type in the AUTOSAR standard.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the wrapper generation method according to any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the wrapper generation method of any one of claims 1 to 7.
CN202410354034.4A 2024-03-26 2024-03-26 Packaging layer generation method, device, terminal and storage medium Pending CN118363597A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410354034.4A CN118363597A (en) 2024-03-26 2024-03-26 Packaging layer generation method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410354034.4A CN118363597A (en) 2024-03-26 2024-03-26 Packaging layer generation method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN118363597A true CN118363597A (en) 2024-07-19

Family

ID=91877516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410354034.4A Pending CN118363597A (en) 2024-03-26 2024-03-26 Packaging layer generation method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN118363597A (en)

Similar Documents

Publication Publication Date Title
US7346897B2 (en) System for translating programming languages
US8332828B2 (en) System for translating diverse programming languages
US9965259B2 (en) System for translating diverse programming languages
US20140157243A1 (en) System for Translating Diverse Programming Languages
US8954840B2 (en) Annotation processing of computer files
US8464232B2 (en) Compiler compiler system with syntax-controlled runtime and binary application programming interfaces
CN110825385B (en) Method for constructing read Native offline package and storage medium
US20130081004A1 (en) System for Translating Diverse Programming Languages
US20050060693A1 (en) Command string parsing
CN110704064B (en) Method and device for compiling and executing intelligent contract
US20080235661A1 (en) System and method for using annotations to automatically generate a framework for a custom javaserver faces (jsf) component
WO1998002810A1 (en) Method and apparatus for transporting interface definition language-defined data structures between heterogeneous systems
JP2000515281A (en) Method and apparatus for describing interfaces, operations and data types defined by an interface definition language
CN111427583A (en) Component compiling method and device, electronic equipment and computer readable storage medium
CN110457013B (en) Program component configuration device and method
CN111475150A (en) Cross-language binding method, device, equipment and storage medium
CN112905271A (en) Calling method and device of application program interface API and electronic equipment
CN111399842B (en) Code compiling method and device
CN118363597A (en) Packaging layer generation method, device, terminal and storage medium
CN116225450A (en) Text conversion method and apparatus, computing device and readable storage medium
CN115756484A (en) Pre-compiled object code warehouse determination method and device and storage medium
CN117075912B (en) Method for program language conversion, compiling method and related equipment
CN117270962B (en) Method and device for processing coloring language, storage medium and electronic equipment
CN114895921B (en) File processing method and device, electronic equipment and storage medium
CN118567650A (en) Application compiling method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination