[go: up one dir, main page]

CN109558121B - Interface driver development method, device, equipment and storage medium - Google Patents

Interface driver development method, device, equipment and storage medium Download PDF

Info

Publication number
CN109558121B
CN109558121B CN201811417891.5A CN201811417891A CN109558121B CN 109558121 B CN109558121 B CN 109558121B CN 201811417891 A CN201811417891 A CN 201811417891A CN 109558121 B CN109558121 B CN 109558121B
Authority
CN
China
Prior art keywords
program
interface
interface driver
version
source code
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.)
Active
Application number
CN201811417891.5A
Other languages
Chinese (zh)
Other versions
CN109558121A (en
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.)
Shanghai Dameng Database Co Ltd
Original Assignee
Shanghai Dameng Database 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 Shanghai Dameng Database Co Ltd filed Critical Shanghai Dameng Database Co Ltd
Priority to CN201811417891.5A priority Critical patent/CN109558121B/en
Publication of CN109558121A publication Critical patent/CN109558121A/en
Application granted granted Critical
Publication of CN109558121B publication Critical patent/CN109558121B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a development method, a development device, development equipment and a development storage medium of an interface driver. The method comprises the following steps: acquiring a program running environment version of a user terminal where an interface driver is located and a program running environment reference version supported by the interface driver, wherein the user terminal accesses external data through the interface driver; determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to a program running environment reference version supported by the interface driver; and packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driver. By the technical scheme, the compatibility of the interface driving program is improved, and the development and maintenance cost is reduced.

Description

Interface driver development method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of software, in particular to a method, a device, equipment and a storage medium for developing an interface driver.
Background
In the age of rapid Development of internet, Java Development environment JDK (Java Development kit) is continuously perfecting and upgrading to release multiple versions, such as JDK1.4, JDK1.5, etc., and Java DataBase connection (JDBC) is increasingly used as a standard interface for communicating with DataBase. With the upgrade of the development environment version, JDBC is also expanded to various functions, on one hand, a related class of an interface is added, and on the other hand, an interface is also added in an existing class, so that developers need to create JDBC engineering files under development environments of different versions respectively and manage and maintain the JDBC engineering files.
The current development method of the interface driver is to create an engineering file in the development environment of the low version to write the basic function of JDBC, and for the development environment of the high version, it is necessary to create an engineering file for each version to write the extension function or the new interface function corresponding to the version, that is, to implement the function of the interface to be written in a plurality of engineering files, and when compiling and packaging, the engineering file of the low version and the engineering file of the corresponding high version need to be packaged together to form a complete interface driver. The method has the disadvantages that the compatibility of the interface driver is poor, a plurality of project files or program packages need to be created and maintained, the project files of different versions have the problem of functional code redundancy, the more and more project files need to be maintained along with the upgrade of the development environment version, the management is complex, and if one expansion function has the problem, the project files of all versions need to be modified.
Disclosure of Invention
The invention provides a development method, a development device, development equipment and a storage medium of an interface driver, which are used for improving the compatibility of the interface driver and reducing the development and maintenance cost.
In a first aspect, an embodiment of the present invention provides a method for developing an interface driver, including:
acquiring a program running environment version of a user terminal where an interface driver is located and a program running environment reference version supported by the interface driver, wherein the user terminal accesses external data through the interface driver;
determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to a program running environment reference version supported by the interface driver;
and packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driver.
Further, the creating a main program and a sub program of the interface driver to be developed according to the program running environment reference version supported by the interface driver includes:
creating a main program and a subprogram of the interface driver to be developed based on a program running environment reference version supported by the interface driver;
writing the function realization code of the interface class into the main program;
generating a source code catalog in the subroutine corresponding to a plurality of source code compiled versions;
and respectively writing the interface classes depended by the main program in the source code compiling versions into corresponding source code catalogs.
Further, the creating a main program and a sub program of the interface driver to be developed according to the program running environment reference version supported by the interface driver further includes:
writing function implementation codes of an extension method of an existing interface class in a program operation environment reference version supported by an interface driver into the main program;
and writing the codes of the newly added interface class of the highest version of the program running environment supported by the interface driver relative to the compiled versions of the source codes into the corresponding source code directory.
Further, the packaging the source codes of the main program and the subprogram according to the source code compilation version to obtain an interface driver includes:
calling a source code under a corresponding source code catalog in the subprogram according to the source code compiling version to serve as a source code of the subprogram;
and packaging the source codes of the main program and the subprograms into an interface driver.
Furthermore, the naming of the newly added interface class is the same as the naming of the class carried by the main program in the program running environment depended on by the corresponding source code compiled version.
In a second aspect, an embodiment of the present invention provides an interface driver development apparatus, including:
the version information acquisition module is used for acquiring a program running environment version of a user terminal where an interface driver is located and a program running environment reference version supported by the interface driver, and the user terminal accesses external data through the interface driver;
the program creating module is used for determining a source code compiling version of the interface driving program to be developed according to the program running environment version and creating a main program and a subprogram of the interface driving program to be developed according to a program running environment reference version supported by the interface driving program;
and the packaging module is used for packaging the source codes of the main program and the subprogram according to the source code compiling version to obtain an interface driver.
Further, the program creation module includes:
the interface driver comprises a program creating unit, a program executing unit and a development unit, wherein the program creating unit is used for creating a main program and a subprogram of the interface driver to be developed based on a program operating environment reference version supported by the interface driver;
a main program compiling unit for writing the interface function implementation code into the main program;
a source code catalog generation unit for generating a source code catalog corresponding to a plurality of source code compiled versions in the subroutine;
and the subprogram writing unit is used for writing the interface classes depended by the main program in the source code compiling versions into corresponding source code catalogs respectively.
Further, the program creating module further includes:
the extension method writing unit is used for writing the extension method function implementation codes of the existing interface classes in the program operation environment reference version supported by the interface driver into the main program;
and the new interface class writing unit is used for writing the codes of the new interface class of the highest version of the program running environment supported by the interface driver relative to the compiled versions of the source codes into the corresponding source code directory.
In a third aspect, an embodiment of the present invention provides an apparatus, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the development method of the interface driver as described in the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the interface driver development method according to the first aspect.
The embodiment of the invention provides a development method and device of an interface driver, a server and a storage medium. The method comprises the following steps: acquiring a program running environment version of a user terminal where an interface is located and a program running environment reference version supported by an interface driving program, wherein the user terminal accesses external data through the interface driving program; determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to a program running environment reference version supported by the interface driver; and packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driver. By the technical scheme, the compatibility of the interface driving program is improved, and the development and maintenance cost is reduced.
Drawings
Fig. 1 is a flowchart of a method for developing an interface driver according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a development interface driver according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for developing an interface driver according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a developer apparatus of an interface driver according to a third embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for developing an interface driver according to an embodiment of the present invention, which can be used in a case of developing an interface driver suitable for different versions of program operating environments. Specifically, the interface driver development method may be executed by an interface driver development device, and the interface driver development device may be implemented in software and/or hardware and integrated in the device. Further, devices include, but are not limited to: desktop computers, notebook computers, tablet computers, and other electronic devices.
Fig. 2 is a schematic diagram of a development interface driver according to an embodiment of the present invention. As shown in fig. 2, the interface driver of this embodiment is developed by using the lowest version (e.g., JDK1.4) of the program operating environment supported by the interface driver as a reference version, and two Java engineering files (Java project) need to be created during development, which are respectively used to write a main program and a sub program of the interface driver to be developed, where the sub program includes codes corresponding to different source code compiled versions. When developing, firstly, the program running environment version (such as JDK1.6) of the user is obtained, and accordingly, the corresponding source codes (src1.6) in the main program and the subprograms are combined, compiled and packaged, so that the user terminal of any program running environment version can be provided with the interface driver which can be compiled.
Referring to fig. 1, the method specifically includes the following steps:
s110, acquiring a program running environment version of a user terminal where an interface driver is located and a program running environment reference version supported by the interface driver, wherein the user terminal accesses external data through the interface driver.
Specifically, the interface is a Java database connection (JDBC) interface, which is an API interface for executing SQL statements in a Java program and can provide uniform access to a plurality of relational databases, and the JDBC is composed of a group of classes written in Java language and specific interfaces. The user terminal can access the data in the external database through the interfaces by compiling and running the interface driver. When an interface driver is developed, a program operating environment version of a user terminal (a use object to which the developed interface driver is oriented) is first acquired, which can be understood as a JDK version used by a user, and a program operating environment reference version supported by the interface driver is determined. Illustratively, the developed interface driver is oriented to a user terminal using JDK1.4-JDK1.8 versions (a higher JDK version may occur during the process of continuous update and upgrade, the method is also applicable), and then the lowest version of the program operating environment supported by the interface driver is JDK1.4, which is used as the reference version; for the user terminal, the versions of the program operating environments may be different, and the version of the program operating environment of the user needs to be acquired first, so as to package the source code applicable to the version of the program operating environment. For example, the program execution environment version of the user terminal is JDK1.6, i.e., the user terminal needs an interface driver jar package suitable for JDK1.6, while the development end writes a program implementing all functions of JDK1.4-JDK1.8 versions in the environment version of JDK1.4, and needs to supplement some relevant interface classes and codes of interface functions when compiling in the JDK1.6 version, and packages the codes that need to be supplemented together to form a complete interface driver.
And S120, determining a source code compiling version of the interface driver to be developed according to the program running environment version.
Specifically, the source code of the developed interface driver is in a java format, the developed interface driver is in a jar format, and when the user terminal runs the interface driver, the user terminal needs to go through a reverse compiling process to obtain the class and the interface contained in the interface driver, namely, the class format, so as to realize the function of the interface. And determining the compiling environment, namely the source code compiling version, to be applied by the source code of the interface driver to be developed according to the program running environment version. Illustratively, the version of the running environment of the user terminal program is JDK1.6, and the compiling environment required by the source code is JDK 1.6.
And S130, creating a main program and a subprogram of the interface driver to be developed according to the program running environment reference version supported by the interface driver.
Specifically, a main program and a subprogram of an interface driver to be developed are created based on a program running environment reference version supported by the interface driver, for example, the interface driver to be developed is oriented to a user terminal using JDK1.4-JDK1.8 versions, the minimum version JDK1.4 of the program running environment supported by the interface driver is used as the reference version, and the main program and the subprogram are created based on JDK1.4, wherein the main program and the subprogram are written in different Java projects, and codes for implementing all functions of the interface are written in the main program, for example, different Java-related classes and different interface classes can be used for accessing different external data, executing different SQL statements, and writing the implementations of the functions in the SQL statements; the implementation of these functions may involve the functions of newly added interface classes that newly appear in higher versions of JDK, and may also be understood as some interface classes, methods and variables that newly appear in higher versions, which cannot be directly recognized and called in the lowest version JDK1.4 of the program operating environment supported by the current interface driver, and the codes of these newly added interface classes are rewritten in the subprogram and have version identifiers, for example, when a subprogram is written for a newly added interface class that appears in JDK1.5, an identifier containing a character of "1.5" is added to these codes, when a subprogram is written for a newly added interface class that appears in JDK1.6, an identifier containing a character of "1.6" is added to these codes, thereby, the codes of all function implementations are included, while the subprogram includes interface classes and variables that need to be relied upon when each version is compiled and run, and the interface classes and variables in the subprogram can be called, all functions of the high version are implemented.
And S140, packaging the source codes of the main program and the subprogram according to the source code compiling version to obtain an interface driver.
Specifically, according to the determined source code compiling version, the main program and the codes of the subprograms corresponding to the source code compiling version are jointly packaged to obtain the interface driver. It should be noted that, the Java project of the main program includes all JDBC interface function implementations including an extended function from the lowest version of the program execution environment supported by the interface driver to the current highest version of the JDK, when the version of the program execution environment of the user terminal is the higher version of the JDK, the corresponding interface classes and variables need to be called, and these interface classes and variables are written in the Java project of the sub-program and have version identifiers. Therefore, the source code of the identifier corresponding to the compiled version of the source code is called in the subprogram, and the source code and the main program are packaged together to form the complete interface driver. The main program already contains codes for realizing all functions of the interface, and with the continuous update of the JDK version, when a new interface class exists, only the codes of the new interface class need to be written in the subprogram and the version identification needs to be added, the corresponding source codes can be packaged according to the version identification according to the needs of a user, a development end only needs to maintain two engineering files, and the workload of modifying and maintaining the engineering codes is greatly reduced; and the two engineering files have better compatibility and can be suitable for different source code compiling environments.
It should be noted that, in this embodiment, the development environment in which the lowest version (for example, JDK1.4) of the program operating environment supported by the interface is used as a reference is used, and in practical applications, other versions may also be used as the development environment of the reference according to requirements, and the development of the interface driver can also be realized by respectively writing the main program and the sub-program and jointly packaging them.
The development method of the interface driver provided by the first embodiment of the invention comprises the following steps: acquiring a program running environment version of a user terminal where an interface is located and a program running environment minimum version supported by an interface driving program, wherein the user terminal accesses external data through the interface driving program; determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to the lowest version of the program running environment supported by the interface driver; and packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driver. By the technical scheme, the compatibility of the interface driving program is improved, and the development and maintenance cost is reduced.
Example two
Fig. 3 is a flowchart of a method for developing an interface driver according to a second embodiment of the present invention, which is embodied on the basis of the second embodiment. Referring to fig. 3, the method specifically includes the following steps:
s210, acquiring a program running environment version of a user terminal where an interface is located and a program running environment reference version supported by an interface driver, wherein the user terminal accesses external data through the interface driver.
It should be noted that technical details that are not described in detail in the present embodiment may be referred to any of the above embodiments.
And S220, determining a source code compiling version of the interface driver to be developed according to the program running environment version.
And S230, creating a main program and a subprogram of the interface driver to be developed based on the program running environment reference version supported by the interface driver.
Specifically, the present embodiment exemplarily creates two Java objects (main object and extended object) based on the JDK of the lowest version supported by the interface of the development program, and writes the main program and the sub program of the interface driver respectively.
And S240, writing the function realization codes of the interface class into the main program.
Specifically, all function implementation codes of the interface class are written in the main program, for example, SQL statements are executed on different databases to implement functions of sorting, querying, duplicate removal, and the like of data, and the implementation codes of these functions are all written in the main program. It should be noted that the main program also includes implementation codes of the extension method of the existing interface class in the lowest version of the program operating environment supported by the interface driver, but these codes are rewritten based on the lowest version of the program operating environment supported by the interface driver, rather than directly adopting the codes of the interface class function in the high-version JDK. The code written based on the lowest version of the program running environment supported by the interface driver can be compiled in any other JDK with higher version, so that the compatibility of the interface driver is improved.
And S250, generating a source code catalog corresponding to a plurality of source code compiling versions in the subprogram.
Specifically, the subroutine includes source codes corresponding to a plurality of source code compilation versions, and a source code directory is first generated according to each compilation environment supported by the interface driver, where each entry in the source code directory corresponds to one JDK version. JDBC, when compiled in a high version JDK, references a new interface class (e.g., the defined interface parameter is a new data type), generates a source code directory in the project of the subroutine, where each entry in the source code directory corresponds to a compiled version of the source code, and the generated source code directory is illustratively in the form of:
extend project:
|——src1.4
|——src1.5
|——src1.6
|——src1.7
|——src1.8
the extended project is a Java project of the subroutine, the subroutine includes source codes suitable for versions of JDK1.4-JDK1.8, the source codes are interface classes and variables that the main program depends on when compiling in the corresponding compilation version, and are all compiled based on the lowest version (JDK1.4) of the program running environment supported by the interface driver, but the source codes can be compiled in the corresponding compilation version to implement new adding functions of different JDK versions, and the corresponding source codes can be selected from the source code directory according to the version of the program running environment of the user terminal. In the process of continuously updating and upgrading the JDK version, a new source code directory can be added in the subprogram.
And S260, respectively writing the interface classes depended by the main program in the source code compiled versions into corresponding source code directories.
Specifically, the main program is a code for implementing all functions, and is an integral framework, and when compiling is performed in different compiling versions, the interface class, which the main program depends on among a plurality of source code compiling versions, is written into the sub program and is written into a source code directory corresponding to the source code compiling versions depending on different interface classes and variables. For example, the code of the interface class on which the main program depends when compiling in JDK1.6 is written in the directory of src 1.6.
Further, the creating a main program and a sub program of the interface driver to be developed according to the lowest version of the program running environment supported by the interface driver further includes:
writing an extended method function implementation code of an existing interface class in a lowest version of a program operation environment supported by an interface driver into the main program;
and writing the codes of the newly added interface class of the highest version of the program running environment supported by the interface driver relative to the compiled versions of the source codes into the corresponding source code directory.
Specifically, when a new interface or an interface method function extension is added to an existing interface class in the lowest version of a program operating environment supported by an interface driver, codes can be written in a main program to realize corresponding functions; for the new interface class in other high versions, the code of the new interface class needs to be written into the subprogram and written into the corresponding source code directory.
Illustratively, the highest version of the program running environment supported by the interface driver is JDK1.8, the main program is written based on JDK1.4, the implemented functions include functions of all versions, and the newly added interface classes stored in the source code directories of the subroutines are:
l-src 1.4: JDK1.5 newly added interface class + JDK1.6 newly added interface class + JDK1.7 newly added interface class + JDK1.8 newly added interface class;
l-src 1.5: JDK1.6 newly added interface class + JDK1.7 newly added interface class + JDK1.8 newly added interface class;
l-src 1.6: JDK1.7 newly added interface class + JDK1.8 newly added interface class;
l-src 1.7: JDK1.8 adds interface class;
l-src 1.8: no new added interface class.
All function implementation codes are written in a main program, and the main program also comprises the function implementation codes of the existing interface extension method in JDK 1.4; in the source code directory corresponding to the source code compiled version JDK1.5, a code of the JDK1.8 new added interface class relative to the JDK1.5 is stored, that is, the JDK1.6 new added interface class + the JDK1.7 new added interface class + the JDK1.8 new added interface class, that is, the content in the source code directory of the subroutine is the interface class that needs to be added additionally in the corresponding source code compiled version in order to implement all functions of all versions.
S270, calling a source code under a source code directory corresponding to the subprogram according to the source code compiling version to serve as a source code of the subprogram;
specifically, according to the source code compiling version, the corresponding source code can be called from the source code catalog of the subprogram, and the source code is used as the source code of the subprogram to be packaged.
S280, packaging the source codes of the main program and the subprograms into an interface driver.
Specifically, the main program and the source codes of the subprograms are packaged to form the complete interface driver which is written based on the program running environment reference version supported by the interface driver and is suitable for the compiled version required by the user. For example, the main program and the source code corresponding to the compiled version of the source code in the sub program are packaged together, for example, if the version of the running environment of the user program is JDK1.6, and the corresponding version of the source code is JDK1.6, the source code under src1.6 in main project and extended project is packaged.
Furthermore, the naming of the new interface class of the dependent interface class is the same as the naming of the self-contained class of the program running environment of the main program in the corresponding source code compiled version.
Specifically, Java class referencing uniquely identifies a class according to a complete class name path, and an interface class in a subroutine is an interface class on which the main program depends in a corresponding source code compiled version. For example, for a main program written based on the lowest version of the program operating environment supported by the interface driver, if there is no definition of a new interface-added class when a higher compiled version of the source code is compiled, a class with the same name is added to the source code directory corresponding to the compiled version of the source code in the sub program, and the new interface-added class can be referred to.
It should be noted that, in the method for developing an interface driver according to this embodiment, the function implementation of the interface is written into the main program, and the interface class corresponding to the different compiled versions is written into the subprogram, only two Java projects need to be maintained, which is convenient for management and maintenance, and can avoid redundancy of function codes. Although the extended project also comprises a plurality of source code directories, the codes in the source code directories are codes written by imitating a newly added interface class in a high-version JDK, are irrelevant to the function realization codes of the interface class, basically do not need to be modified after the completion, have no maintenance cost, and in addition, the application method of the development method of the interface driver is not limited to the development of the JDBC interface and can also be applied to any interface development which needs to support multi-version JDKs.
Further, in the embodiment, the development environment in which the lowest version (for example, JDK1.4) of the program operating environment supported by the interface is used as the reference is used, and in practical applications, other versions can be used as the reference development environment according to the requirements, and the development of the interface driver can also be realized by respectively writing the main program and the sub-program and packaging them together. For example, a development environment in which the highest version of the program operating environment (e.g., JDK1.8) supported by the interface is used as a reference is written based on JDK1.8, and codes of the newly added interface class corresponding to the compiled version of each source code of the highest version of the program operating environment supported by the interface are stored in the source code directory of the subroutine, and similarly, only two Java projects need to be maintained, and functions of all versions can be implemented.
The development method of the interface driver provided by the second embodiment of the invention is optimized on the basis of the second embodiment, the function realization code of the interface class is written into the main program, the dependent interface class is written into the subprogram, and the source code directory is divided, so that the management and the maintenance are convenient; the direct calling of the new interface class is realized by the fact that the name of the new interface class is the same as the name of the class carried by the main program in the program running environment depended on by the main program in the corresponding source code compiling version; by developing the interface driver based on the lowest version, two engineering files are created, and the compatibility of the interface driver is improved.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a device for developing an interface driver according to a third embodiment of the present invention. Referring to fig. 4, the interface driver development apparatus provided in this embodiment includes:
the version information acquiring module 310 is configured to acquire a program running environment version of a user terminal where an interface is located and a program running environment reference version supported by an interface driver, where the user terminal accesses external data through the interface driver;
the program creating module 320 is configured to determine a source code compiling version of the interface driver to be developed according to the program running environment version, and create a main program and a sub program of the interface driver to be developed according to a program running environment reference version supported by the interface driver;
and the packaging module 330 is configured to package the source codes of the main program and the subprogram according to the source code compilation version to obtain an interface driver.
In the device for developing an interface driver provided by the third embodiment of the present invention, the version information obtaining module obtains the version of the program running environment of the user terminal where the interface is located and the lowest version of the program running environment supported by the interface driver, and the user terminal accesses external data through the interface driver; determining a source code compiling version of the interface driver to be developed according to the program running environment version through a program creating module, and creating a main program and a subprogram of the interface driver to be developed according to the lowest version of the program running environment supported by the interface driver; and packaging the source codes of the main program and the subprograms according to the source code compiling version through a packaging module to obtain an interface driving program. By the technical scheme, the compatibility of the interface driving program is improved, and the development and maintenance cost is reduced.
On the basis of the above embodiment, the program creating module 320 includes:
the interface driver comprises a program creating unit, a program executing unit and a development unit, wherein the program creating unit is used for creating a main program and a subprogram of the interface driver to be developed based on a program operating environment reference version supported by the interface driver;
a main program compiling unit for writing the interface function implementation code into the main program;
a source code catalog generation unit for generating a source code catalog corresponding to a plurality of source code compiled versions in the subroutine;
and the subprogram writing unit is used for writing the interface classes depended by the main program in the source code compiling versions into corresponding source code catalogs respectively.
Further, the program creating module 320 further includes:
the extension method writing unit is used for writing the extension method function implementation code of the existing interface class in the lowest version of the program operation environment supported by the interface driver into the main program;
and the new interface class writing unit is used for writing the codes of the new interface class of the highest version of the program running environment supported by the interface driver relative to the compiled versions of the source codes into the corresponding source code directory.
Further, the packing module 330 further includes:
the calling unit is used for calling the source code under the source code directory corresponding to the subprogram according to the source code compiling version to be used as the source code of the subprogram;
and the packaging unit is used for packaging the source codes of the main program and the subprograms into an interface driver.
Furthermore, the naming of the new interface class of the dependent interface class is the same as the naming of the self-contained class of the program running environment of the main program in the corresponding source code compiled version.
The interface driver development device provided by the third embodiment of the present invention can be used to execute the interface driver development method provided by any of the above embodiments, and has corresponding functions and advantages.
Example four
Fig. 5 is a schematic diagram of a hardware structure of an apparatus according to a fourth embodiment of the present invention. As shown in fig. 5, the present embodiment provides an apparatus, including: a processor 410 and a storage 420. The number of the processors in the device may be one or more, fig. 5 illustrates one processor 410, the processor 410 and the storage device 420 in the device may be connected by a bus or in other manners, and fig. 5 illustrates the connection by a bus.
The one or more programs are executed by the one or more processors 410, so that the one or more processors implement the development method of the interface driver described in any of the above embodiments.
The storage device 420 in the apparatus, which is a computer-readable storage medium, can be used to store one or more programs, which may be software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the development method of the interface driver in the embodiment of the present invention (for example, modules in the development device of the interface driver shown in fig. 3, including the version information obtaining module 310, the program creating module 320, and the packaging module). The processor 410 executes various functional applications of the device and data processing by executing software programs, instructions, and modules stored in the storage device 420, that is, implements the development method of the interface driver in the above method embodiment.
The storage device 420 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system and an application program required by at least one function; the stored data area may store data created according to the use of the device, etc. (the main program, the sub program, the source code directory, etc. as in the above-described embodiments). Further, the storage 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage 420 may further include memory located remotely from the processor 410, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
And, when one or more programs included in the above-described apparatus are executed by the one or more processors 410, the programs perform the following operations:
acquiring a program running environment version of a user terminal where an interface is located and a program running environment reference version supported by an interface driving program, wherein the user terminal accesses external data through the interface driving program; determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to a program running environment reference version supported by the interface driver; and packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driver.
The device proposed in this embodiment and the method for developing the interface driver proposed in the above embodiments belong to the same inventive concept, and technical details that are not described in detail in this embodiment can be referred to any of the above embodiments, and this embodiment has the same advantageous effects as the method for developing the interface driver.
On the basis of the above-described embodiments, the present embodiment also provides a computer-readable storage medium on which a computer program is stored, the program, when executed by a development apparatus of an interface driver, implementing a development method of the interface driver in any of the above-described embodiments of the present invention, the method including:
acquiring a program running environment version of a user terminal where an interface is located and a program running environment reference version supported by an interface driving program, wherein the user terminal accesses external data through the interface driving program; determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to a program running environment reference version supported by the interface driver; and packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driver.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present invention is not limited to the above-described operations of the interface driver development method, and may also perform related operations in the interface driver development method provided in any embodiments of the present invention, and has corresponding functions and advantages.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the method for developing an interface driver according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (8)

1. A method for developing an interface driver, comprising:
acquiring a program running environment version of a user terminal where an interface driver is located and a program running environment reference version supported by the interface driver, wherein the user terminal accesses external data through the interface driver;
determining a source code compiling version of the interface driver to be developed according to the program running environment version, and creating a main program and a subprogram of the interface driver to be developed according to a program running environment reference version supported by the interface driver;
packaging the source codes of the main program and the subprograms according to the source code compiling version to obtain an interface driving program;
the creating of the main program and the subprogram of the interface driver to be developed according to the program running environment reference version supported by the interface driver comprises the following steps:
creating a main program and a subprogram of the interface driver to be developed based on a program running environment reference version supported by the interface driver;
writing the function realization code of the interface class into the main program;
generating a source code catalog in the subroutine corresponding to a plurality of source code compiled versions;
and respectively writing the interface classes depended by the main program in the source code compiling versions into corresponding source code catalogs.
2. The method of claim 1, wherein the creating of the main program and the sub program of the interface driver to be developed according to the program running environment reference version supported by the interface driver further comprises:
writing an extended method function implementation code of an existing interface class in a program operation environment reference version supported by an interface driver into the main program;
and writing the codes of the newly added interface class of the highest version of the program running environment supported by the interface driver relative to the compiled versions of the source codes into the corresponding source code directory.
3. The method of claim 1, wherein packaging the source code of the main program and the sub program according to the compiled version of the source code to obtain the interface driver comprises:
calling a source code under a corresponding source code catalog in the subprogram according to the source code compiling version to serve as a source code of the subprogram;
and packaging the source codes of the main program and the subprograms into an interface driver.
4. The method of claim 2, wherein the naming of the newly added interface class is the same as the naming of the class owned by the main program in the program execution environment on which the corresponding compiled version of source code depends.
5. An interface driver development apparatus, comprising:
the version information acquisition module is used for acquiring a program running environment version of a user terminal where an interface driver is located and a program running environment reference version supported by the interface driver, and the user terminal accesses external data through the interface driver;
the program creating module is used for determining a source code compiling version of the interface driving program to be developed according to the program running environment version and creating a main program and a subprogram of the interface driving program to be developed according to a program running environment reference version supported by the interface driving program;
the packaging module is used for packaging the source codes of the main program and the subprogram according to the source code compiling version to obtain an interface driving program;
wherein the program creation module comprises:
the interface driver comprises a program creating unit, a program executing unit and a development unit, wherein the program creating unit is used for creating a main program and a subprogram of the interface driver to be developed based on a program operating environment reference version supported by the interface driver;
a main program compiling unit for writing the interface function implementation code into the main program;
a source code catalog generation unit for generating a source code catalog corresponding to a plurality of source code compiled versions in the subroutine;
and the subprogram writing unit is used for writing the interface classes depended by the main program in the source code compiling versions into corresponding source code catalogs respectively.
6. The apparatus of claim 5, wherein the program creation module further comprises:
the extension method writing unit is used for writing the extension method function implementation codes of the existing interface classes in the program operation environment reference version supported by the interface driver into the main program;
and the new interface class writing unit is used for writing the codes of the new interface class of the highest version of the program running environment supported by the interface driver relative to the compiled versions of the source codes into the corresponding source code directory.
7. A computer device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method for interface driver development as recited in any of claims 1-4.
8. A computer-readable storage medium on which a computer program is stored, the program, when being executed by a processor, implementing a method for developing an interface driver according to any one of claims 1 to 4.
CN201811417891.5A 2018-11-26 2018-11-26 Interface driver development method, device, equipment and storage medium Active CN109558121B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811417891.5A CN109558121B (en) 2018-11-26 2018-11-26 Interface driver development method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811417891.5A CN109558121B (en) 2018-11-26 2018-11-26 Interface driver development method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109558121A CN109558121A (en) 2019-04-02
CN109558121B true CN109558121B (en) 2022-03-11

Family

ID=65867545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811417891.5A Active CN109558121B (en) 2018-11-26 2018-11-26 Interface driver development method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109558121B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111857837A (en) * 2019-04-30 2020-10-30 百度时代网络技术(北京)有限公司 Method and apparatus for driving hardware
CN110221840B (en) * 2019-06-05 2023-04-25 百度在线网络技术(北京)有限公司 Function implementation method and device of application program, equipment and storage medium
CN112559079A (en) * 2020-12-22 2021-03-26 新华三大数据技术有限公司 Data source connection driving self-adaptive loading method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477467A (en) * 2008-12-08 2009-07-08 山东浪潮齐鲁软件产业股份有限公司 Project code releasing method
CN101932999A (en) * 2007-12-20 2010-12-29 汇丰技术股份有限公司 Automated methods and systems for developing and deploying projects in parallel
CN102929630A (en) * 2012-10-31 2013-02-13 中标软件有限公司 Method and system for code management based on distributed collaborative development environment
CN105511933A (en) * 2015-12-03 2016-04-20 深圳市创维软件有限公司 Compiling method of source code and related equipment
CN107908421A (en) * 2017-09-29 2018-04-13 北京创鑫旅程网络技术有限公司 The method and device of software code versions management and issue

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE531389C2 (en) * 2006-03-01 2009-03-17 Abb Ab Method for handling different versions of an application and an automation system
CN102378293B (en) * 2010-08-11 2015-06-10 中兴通讯股份有限公司 Code division multiple access system and A17 interface compatibility realization method
US9116717B2 (en) * 2011-05-27 2015-08-25 Cylance Inc. Run-time interception of software methods
US20130227525A1 (en) * 2012-02-28 2013-08-29 International Business Machines Corporation Delivery of Changesets by Environment
CN103543993B (en) * 2012-07-11 2017-07-28 深圳市华高软件科技有限公司 Application builds method and system
CN104243407A (en) * 2013-06-13 2014-12-24 华为技术有限公司 A method and device for generating signature codes for malware network intrusion detection
CN103324486A (en) * 2013-07-03 2013-09-25 中国船舶重工集团公司第七二四研究所 Method for realizing software version adaptive configuration by utilizing loose-coupling architecture
CN103425512B (en) * 2013-08-19 2016-12-28 曙光信息产业股份有限公司 A kind of software package management method and system
JP6013315B2 (en) * 2013-12-25 2016-10-25 京セラドキュメントソリューションズ株式会社 Application development support program and application development support system
CN105205065B (en) * 2014-06-16 2019-03-26 中国移动通信集团公司 A kind of implementation method and terminal of multi version application
US9519468B2 (en) * 2015-02-13 2016-12-13 Oracle International Corporation Modular co-versioning in a dynamically linked runtime environment
CN105138327A (en) * 2015-08-21 2015-12-09 青岛海信移动通信技术股份有限公司 Cross-platform web application packaging method
CN105183484A (en) * 2015-09-28 2015-12-23 北京奇虎科技有限公司 Method and device for compatibility of multi-version application programming interface
CN105159732B (en) * 2015-10-13 2018-08-03 北京奇虎科技有限公司 In mobile terminal installation or the method and mobile terminal of more new application
US10341409B2 (en) * 2016-05-09 2019-07-02 International Business Machines Corporation Software version control without affecting a deployed container
CN106775730A (en) * 2016-12-21 2017-05-31 深圳Tcl数字技术有限公司 Program dissemination method and system
CN106850976B (en) * 2017-01-13 2019-12-03 努比亚技术有限公司 Using update method and terminal
CN107463417A (en) * 2017-08-28 2017-12-12 山东浪潮通软信息科技有限公司 A kind of application object template installation method and device
CN107870772B (en) * 2017-10-09 2020-10-02 深圳前海微众银行股份有限公司 Cross-environment application deployment method, platform, system and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101932999A (en) * 2007-12-20 2010-12-29 汇丰技术股份有限公司 Automated methods and systems for developing and deploying projects in parallel
CN101477467A (en) * 2008-12-08 2009-07-08 山东浪潮齐鲁软件产业股份有限公司 Project code releasing method
CN102929630A (en) * 2012-10-31 2013-02-13 中标软件有限公司 Method and system for code management based on distributed collaborative development environment
CN105511933A (en) * 2015-12-03 2016-04-20 深圳市创维软件有限公司 Compiling method of source code and related equipment
CN107908421A (en) * 2017-09-29 2018-04-13 北京创鑫旅程网络技术有限公司 The method and device of software code versions management and issue

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云化的业务生成环境设计与实现;张茜;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20131115;I138-342 *

Also Published As

Publication number Publication date
CN109558121A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
US11467854B2 (en) Method and apparatus for loading multiple differing versions of a native library into a native environment
US10146515B1 (en) Live code updates
US10684846B2 (en) Using semantic annotations to control compatibility behaviors
EP3035191B1 (en) Identifying source code used to build executable files
CN112015491B (en) Method, device and computer storage medium for realizing function jump
US20200089492A1 (en) Software dependency shading
CN109196476B (en) Seamless high performance interoperability between different types of graphs sharing a garbage collector
US20150363195A1 (en) Software package management
CN109558121B (en) Interface driver development method, device, equipment and storage medium
CN111309335A (en) Plug-in application compiling method and device and computer readable storage medium
EP1668498A2 (en) Creating and checking runtime data types
CN108052327A (en) A kind of kernel module compiling, loading method and device
JP6088031B2 (en) Flexible metadata composition
US10496433B2 (en) Modification of context saving functions
US10572275B2 (en) Compatible dictionary layout
US9411618B2 (en) Metadata-based class loading using a content repository
CN116685946A (en) Reloading of updated shared libraries without stopping execution of an application
CN106547519B (en) Information processing method and system
US20140351799A1 (en) Binary interface instrumentation
CN111782248B (en) Updating method and device of terminal application and electronic equipment
US11423148B2 (en) Preventing discovery of unique identifiers in firmware
CN114185556A (en) Intelligent contract deployment method, device, equipment and storage medium
US20230280922A1 (en) Methods and apparatus to deduplicate duplicate memory in a cloud computing environment
CN114860253A (en) Compiling method and device, computer equipment and readable storage medium
CN115292254A (en) File storage method and device, medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant