Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application. On the contrary, the embodiments of the application include all changes, modifications and equivalents coming within the spirit and terms of the claims appended hereto.
Fig. 1 is a schematic flowchart of an application publishing method according to an embodiment of the present application.
The present embodiment is exemplified in a case where the application distribution method is configured as an application distribution apparatus.
The application program issuing method in this embodiment may be configured in an application program issuing apparatus, and the application program issuing apparatus may be set in a server, or may also be set in a computer device, which is not limited in this embodiment of the application.
The present embodiment takes as an example that the application program distribution method is configured in the computer device.
It should be noted that the execution main body in the embodiment of the present application may be, for example, a cloud server or a Central Processing Unit (CPU) in a computer device in terms of hardware, and may be, for example, a cloud server or a related background service in the computer device in terms of software, which is not limited to this.
Referring to fig. 1, the method includes:
s101: and acquiring a source code file of the application program.
The source code file contains source code written by a developer of the application program by using a corresponding programming language, and the source code encapsulates the functions, parameters, functions and other contents which can be realized by the application program.
Accordingly, the object code file containing the complete machine language code that can be executed by the computer device is a code file obtained by parsing the source code file by the compiler.
Compared with the prior art that the application program is developed by adopting the adaptive programming language aiming at various operating systems or platforms, so that the same functions are repeatedly developed by using various technology stacks, the embodiment of the application can realize multi-end release of the application program by adopting a set of source code files (namely the source code files of the application program), and effectively avoids repeatedly developing the same functions by using various technology stacks.
The source code file may be developed based on a Uni-app front-end framework, and in a specific execution process of the embodiment of the present application, an interface and a function of the application program function may be encapsulated by using the Uni-app front-end framework.
That is, in the present application, the Uni-app front-end framework is used to write the source code in the source code file of the application program to assist in the interface and function development of the application program, or any other possible framework may be used to write the source code in the source code file, which is not limited to this.
In the specific execution process of the embodiment of the application, an Vue single-page development mode of a Uni-app framework can be adopted to generate a first source code file corresponding to a front-end interface of an application program; and generating a second source code file of the background processing logic of the application program based on the Java development language, wherein the first source code file and the second source code file jointly form a source code file.
The source code file corresponding to the front-end interface of the application program may be referred to as a first source code file, and the source code file of the background processing logic of the application program may be referred to as a second source code file.
Referring to fig. 2, fig. 2 is a schematic diagram of Vue single-page development mode in the related art.
In the embodiment of the application, the Vue single-page development mode of the Uni-app frame is adopted to generate the first source code file corresponding to the front-end interface of the application program, and as the Uni-app front-end frame inherits from the Vue single-page development mode, compared with the multi-page development mode, the page jump of the multi-page development mode needs to refresh all resources, each public resource (js, css and the like) needs to be selectively reloaded, and the public resources such as js/css/img of the Vue single-page development mode need to be loaded only when an initial page is loaded, and the common resources do not need to be reloaded during the page jump.
Therefore, in the embodiment of the application, the first source code file corresponding to the front-end interface of the application program is generated by adopting the Vue single-page development mode of the Uni-app framework, so that the switching speed between the front-end pages of the application program is higher, the user experience is better, after the installation package of the application program is installed to the target terminal, the interaction of the source code between the first source code file and the second source code file can be realized to realize the function of the application program, the decoupling of the front-end code and the background processing logic can be realized, and the response efficiency of the application program is improved.
It should be noted that the Uni-app front-end framework provides some commonly used functions, and the commonly used functions are packaged into corresponding components, for example, a mask pop function commonly used for a front-end interface, and the Uni-app front-end framework is packaged into a Uni-pop component.
For another example, when an application program implemented by the Uni-app front-end framework has a requirement for a local album selection and photographing function, the Uni.
S102: and acquiring the installation requirement information of the target terminal.
The target terminal is a terminal to which an application needs to be installed, and the terminal may be, for example, a general electronic device (a mobile phone, a tablet computer, or the like).
The installation requirement information may be input by the developer of the application program on the Hbuilder development platform, which is not limited thereto.
Optionally, the installation requirement information includes a certificate corresponding to an operating system run by the target terminal, or a certificate corresponding to a target application installed by the target terminal, where the target application is an application capable of loading the applet.
Generally, the types of the operating systems of different terminals may be different, and therefore, the installation requirement information may be used to describe the category of the operating system of the target terminal, or may be used to describe the category of a target application installed in the target terminal, where the target application is an application program capable of loading an applet, and the target application is, for example, a WeChat application program.
Optionally, the installation requirement information in the embodiment of the present application may include a certificate corresponding to an operating system run by the target terminal, or a certificate corresponding to a target application installed by the target terminal, where the target application is an application capable of loading an applet.
The certificate corresponding to the operating system can be used to characterize the type of the operating system, and is not limited thereto.
The certificate corresponding to the target application can be used to characterize the type of the target application, and is not limited thereto.
According to the embodiment of the application, after the source code file of the application and the installation requirement information of the target terminal are obtained, the source code file of the application can be converted into the target code file suitable for the target terminal according to the installation requirement information, namely, in the stage of developing the application, a set of source code files are adopted to develop functions related to the application, and in the stage of installation and release, the source code file of the application is converted into the target code file suitable for the target terminal according to the actual installation requirement information of the target terminal, so that the multi-end release of the set of source code files is realized.
S103: and generating a target code file according to the source code file and the installation requirement information by adopting an Hbuilder development platform, wherein the target code file is matched with the target terminal.
The Hbuilder development platform described above is used to compile source code files for an application.
In the embodiment of the application, the Hbuilder development platform can correspondingly compile the source code file of the application program according to the installation requirement information, so that the source code file is compiled into an object code file suitable for running at the object terminal, that is, the Hbuilder development platform is adopted to compile the source code file into an object code file containing a complete machine language code capable of being executed by the object terminal according to the installation requirement information.
For example, when an application needs to be issued to a target terminal installed with an Android operating system, the Hbuilder development platform may receive an operation instruction of a user (the operation instruction of the user is, for example, to select a Uni-App project, and to select "issue" - > native App cloud packaging in the Hbuilder X editor window), receive an own certificate of the Android operating system Android input by the user, or perform packaging using a DCloud public certificate.
For another example, when an application needs to be issued to a target terminal installed with an apple operating system, the Hbuilder development platform may receive an operation instruction of a user (for example, the operation instruction of the user is to select a Uni-App project and select "issue" - > native App cloud packaging in an Hbuilder X editor window), receive an apple operating system (IOS) private key certificate, a certificate private key password, and a certificate profile file input by the user, and perform cloud packaging.
For another example, assuming that the target application is a wechat public platform, an App id of the applet is registered in the wechat public platform, and a wechat developer tool is installed locally, the Hbuilder development platform may receive an operation instruction of a user (the operation instruction of the user is, for example, to select an App project of the present application, and select "issue" - > applet-wechat in an editor window), the Hbuilder development platform receives the App id of the applet input by the user, the editor may automatically convert a Uni-App code (the Uni-App code is a source code in a source code file) into an applet code (the applet code is a code in a target code file), open the wechat developer tool to run the set of applet code, and select an upload operation on the wechat developer tool, and may issue the applet code to a cloud for access by the wechat developer.
In the embodiment, the source code file of the application program is obtained, the installation requirement information of the target terminal is obtained, the target code file is generated according to the source code file and the installation requirement information by adopting the Hbuilder development platform, the target code file is matched with the target terminal, and multi-end release of the application program can be realized by adopting one set of source code file, so that the waste of technical resources is effectively avoided, and the development efficiency of the application program is improved.
Fig. 3 is a flowchart illustrating an application publishing method according to another embodiment of the present application.
Referring to fig. 3, the method includes:
s301: and acquiring a source code file of the application program.
S302: and acquiring the installation requirement information of the target terminal.
S303: and generating a target code file according to the source code file and the installation requirement information by adopting an Hbuilder development platform, wherein the target code file is matched with the target terminal.
The descriptions of the steps S301 to S303 can be referred to the above embodiments, and are not limited thereto.
S304: generating a first installation package of an application program according to the target code file by adopting an Hbuilder development platform; or generating a second installation package of the applet according to the target code file by adopting an Hbuilder development platform; the applet is the same functionality that the application is capable of providing.
The first installation package is a software package that can be directly installed and run on the target terminal, the applet to which the second installation package belongs can be loaded by the target application installed in the target terminal, and the target application is, for example, a wechat application program, and thus, the applet to which the second installation package belongs can be loaded by, for example, the wechat application program, which is not limited to this.
That is, in the embodiment of the present application, the Hbuilder development platform may be used to package the object code file into the first installation package of the application program, or the Hbuilder development platform may be used to package the object code file into the second installation package of the applet.
S305: and sending the first installation package or the second installation package to a cloud end corresponding to the Hbuilder development platform.
S306: and generating a first download address corresponding to the first installation package at the cloud end, or generating a second download address corresponding to the second installation package, and after the first download address or the second download address is generated at the cloud end, issuing the first download address or the second download address to the Hbuilder development platform.
The download address corresponding to the first installation package may be referred to as a first download address, and the download address corresponding to the second installation package may be referred to as a second download address.
In the specific execution process, a first download address corresponding to the first installation package may be generated at the cloud, or a second download address corresponding to the second installation package may be generated, and after the first download address or the second download address is generated, the first download address or the second download address is further issued to the Hbuilder development platform.
S307: and receiving the first download address or the second download address by adopting the Hbuilder development platform, and displaying the first download address or the second download address on a console of the Hbuilder development platform.
In the specific execution process, the Hbuilder development platform is used for receiving the first download address or the second download address, and after the first download address or the second download address is displayed on a console of the Hbuilder development platform, developers of the application program can check the corresponding download address, so that the Hbuilder development platform is used for generating an installation package matched with a target terminal, the download address of the corresponding installation package is provided, one-stop issuing of the application program is realized, and automatic issuing of the application program is effectively realized.
S308: accessing the first download address, thereby sending the first installation package of the application program to the target terminal; or accessing the second download address, and sending the second installation package of the small program to the target terminal.
Referring to fig. 4 and fig. 5 together, fig. 4 is an application schematic diagram in the embodiment of the present application, fig. 5 is another application schematic diagram in the embodiment of the present application, fig. 4 describes a process of generating an installation package of an application program according to an object code file in the embodiment of the present application, fig. 5 describes a flow of issuing multiple ends of the installation package of the application program in the embodiment of the present application, and details of the embodiment of the present application are illustrated in the following manner by combining fig. 4 and fig. 5:
when the application program needs to be issued to a target terminal provided with an Android operating system, and the HBuilder development platform receives an Android certificate of the Android operating system input by a user, or the HBuilder development platform packages the Android certificate by using a DCloud public certificate to obtain an installation package, a download address of an Android operating system apk installation package which can be downloaded and installed by the user can be automatically generated at the cloud end, and the address is returned to a console of the HBuilder X editor.
For another example, when an application needs to be issued to a target terminal installed with an apple operating system, and the Hbuilder development platform receives an apple operating system (IOS) private key certificate, a certificate private key password, and a certificate profile file input by a user, and performs cloud packaging, a download address of an apple system app installation package that can be downloaded and installed by the user is automatically generated at the cloud, and the address is returned to the console of the Hbuilder X editor.
For another example, assuming that the target application is a wechat public platform, an App id of the applet is registered in the wechat public platform, and a wechat developer tool is installed locally, the Hbuilder development platform may receive an operation instruction of a user (the operation instruction of the user is, for example, to select an App project of the present application, and select "issue" - > applet-wechat in an editor window), the Hbuilder development platform receives the App id of the applet input by the user, the editor may automatically convert a Uni-App code (the Uni-App code is a source code in a source code file) into an applet code (the applet code is a code in a target code file), open the wechat developer tool to run the set of applet code, and select an upload operation on the wechat developer tool, and may issue the applet code to a cloud for access by the wechat developer.
Therefore, compared with the APP development method in the related art, the method and the device for developing the APP in the embodiment of the application adopt a set of code multi-end release process and development mode, when the target terminal of the user is different operating systems, the application program can be installed based on the same set of source program codes, in the whole development process, the requirements of an android system, an apple system and even a small program can be met only by one set of source program codes, the same user interface can be presented, and the use experience of the user is improved.
In the embodiment, the source code file of the application program is obtained, the installation requirement information of the target terminal is obtained, the target code file is generated according to the source code file and the installation requirement information by adopting the Hbuilder development platform, the target code file is matched with the target terminal, and multi-end release of the application program can be realized by adopting one set of source code file, so that the waste of technical resources is effectively avoided, and the development efficiency of the application program is improved. The method can be used for developers of the application program to check the corresponding download address, so that the Hbuilder development platform is adopted to generate the installation package of the adaptive target terminal, the download address of the corresponding installation package is provided, the one-stop release of the application program is realized, the automatic release of the application program is effectively realized, and the installation access efficiency of the application program is improved on the application level.
To sum up, aiming at the application program release method, the front-end interface of the application program adopts a Uni-app framework, the development language of the front-end interface is based on Vue.js development language, common functions are packaged, the packaged function modules are called by each page of the system in a component form, the repeated development of the system function is avoided, the style and the user experience of each interface relative to the same function module are more uniform, the back-end of the application program adopts JAVA development language to realize a background interface required to be called by each page function of the front-end, the data in a database on a remote server are read and written through the interface, the data result is returned to the front-end through the interface and is displayed to a system user interface, and the Hbuilder development platform selects a packaging cloud end for a source code file corresponding to the application program and adopts an effective android or IOS certificate, an installation package which can be installed and adopted by a user can be directly generated at the cloud.
In the embodiment of the application, the native function of the application program is encapsulated, so that a more concise grammar can be adopted in the development process, and the function and effect which are the same as those of a native development mode can be realized.
As a more specific example, refer to fig. 6 and fig. 7 together, where fig. 6 is a schematic diagram of an overall architecture of an embodiment of the present application, and fig. 7 is a flowchart of a backend data interface implementation of the embodiment of the present application.
The front-end and back-end data communication of the application refers to FIG. 6, an application program developed by using a Uni-app framework is published in a cloud through an Hbuilder development platform, can be published into an installation package of an android system, an installation package of an apple system and a WeChat applet at the same time, is installed on a mobile phone terminal, a user inputs required functions such as login, query, data uploading and the like through the mobile phone terminal, a function compiled by Vue. js development language is triggered through the operation of a touch screen button and the like, a data request is initiated to an interface designed by a back-end JAVA through an AJAX request, the data input by the user is transmitted to a background in real time, a Controller layer of the background interface takes data transmitted from a front end as an index, a function of a Service layer is called to perform complex logic calculation, the function of the Service layer performs data read-write operation on a database by calling a database operation function of a Dao layer, and after the data is obtained, and the Controller layer returns the data obtained from the database to an Vue interface of the front end through a background interface function, and the front end renders the data obtained from the background on a user interface by using binding grammars such as v-model, v-for and the like, so that the local update of the page data is realized.
In this embodiment of the present application, the back end of the application may be developed and encoded based on an Intellij IDEA editor, and a Spring + SpringMVC + Mybatis back end development framework and a JAVA back end programming language are used, referring to fig. 7, the back end logic is composed of three modules: the system comprises a Controller layer, a Service layer and a Dao layer, wherein the Controller layer is used for basically managing a business module process; the Service layer is used for processing complex logic operation and plays a role in starting and stopping, on one hand, according to the Service logic, the corresponding Dao database operation is quoted, data is processed, and on the other hand, a direct operation result is returned to the Controller layer for use; the essential role of the Dao layer is to support command operations for the database. The JAVA design interface is applied to the front end of the system, the front end of the system can upload and acquire data by accessing the background JAVA interface, and the acquired data is rendered to the corresponding position of a front end page in real time through Vue binding rules.
Using Vue bi-directional binding of data in this application, specifically bi-directional binding between a data model and a view, modifications made by a user on the view will automatically synchronize to the data model, and similarly, if values in the data model change, will also synchronize to the view.
Fig. 8 is a schematic structural diagram of an application distribution apparatus according to an embodiment of the present application.
Referring to fig. 8, the apparatus 800 includes:
a first obtaining module 801, configured to obtain a source code file of an application;
a second obtaining module 802, configured to obtain installation requirement information of a target terminal;
the first generating module 803 generates an object code file according to the source code file and the installation requirement information by using an Hbuilder development platform, and the object code file is adapted to the object terminal.
Optionally, in some embodiments, referring to fig. 9, further comprising:
a second generating module 804, which generates a first installation package of the application program according to the target code file by using the Hbuilder development platform; or generating a second installation package of the applet according to the target code file by adopting an Hbuilder development platform; the applet is the same functionality that the application is capable of providing.
The sending module 805 is configured to send the first installation package or the second installation package to a cloud corresponding to the Hbuilder development platform, so as to generate a first download address corresponding to the first installation package at the cloud, or generate a second download address corresponding to the second installation package, and after the cloud generates the first download address or the second download address, the cloud issues the first download address or the second download address to the Hbuilder development platform.
Optionally, in some embodiments, referring to fig. 9, further comprising:
a receiving module 806, configured to receive the first download address or the second download address using the Hbuilder development platform, and display the first download address or the second download address on a console of the Hbuilder development platform.
Optionally, in some embodiments, referring to fig. 9, the Hbuilder development platform is a Hbuilder development platform further comprising:
an accessing module 807 for accessing the first download address to send the first installation package of the application program to the target terminal; or accessing the second download address, and sending the second installation package of the small program to the target terminal.
Optionally, in some embodiments, the installation requirement information includes:
the certificate corresponding to the operating system run by the target terminal, or the certificate corresponding to the target application installed by the target terminal, wherein the target application is an application capable of loading the applet.
Optionally, in some embodiments, the method further comprises:
the development module 808 generates a first source code file corresponding to a front-end interface of the application program by adopting an Vue single-page development mode of a Uni-app framework, and generates a second source code file of background processing logic of the application program based on a Java development language, wherein the first source code file and the second source code file jointly form a source code file.
It should be noted that the explanation of the embodiment of the application program publishing method in the foregoing embodiments of fig. 1 to fig. 7 also applies to the application program publishing device 800 of this embodiment, and the implementation principle thereof is similar and will not be described again here.
In the embodiment, the source code file of the application program is obtained, the installation requirement information of the target terminal is obtained, the target code file is generated according to the source code file and the installation requirement information by adopting the Hbuilder development platform, the target code file is matched with the target terminal, and multi-end release of the application program can be realized by adopting one set of source code file, so that the waste of technical resources is effectively avoided, and the development efficiency of the application program is improved.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Referring to fig. 10, a computer apparatus 1000 of the present embodiment includes a housing 1001, a processor 1002, a memory 1003, a circuit board 1004, and a power supply circuit 1005, wherein the circuit board 1004 is disposed inside a space surrounded by the housing 1001, and the processor 1002 and the memory 1003 are provided on the circuit board 1004; a power supply circuit 1005 for supplying power to the respective circuits or devices of the computer apparatus 1000; the memory 1003 is used for storing executable program codes; the processor 1002 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 1003, for performing:
acquiring a source code file of an application program;
acquiring installation requirement information of a target terminal;
and generating a target code file according to the source code file and the installation requirement information by adopting an Hbuilder development platform, wherein the target code file is matched with the target terminal.
It should be noted that the explanation of the embodiment of the application program publishing method in the foregoing embodiments of fig. 1 to fig. 7 also applies to the computer device 1000 of this embodiment, and the implementation principle is similar and is not described herein again.
In the embodiment, the source code file of the application program is obtained, the installation requirement information of the target terminal is obtained, the target code file is generated according to the source code file and the installation requirement information by adopting the Hbuilder development platform, the target code file is matched with the target terminal, and multi-end release of the application program can be realized by adopting one set of source code file, so that the waste of technical resources is effectively avoided, and the development efficiency of the application program is improved.
In order to implement the foregoing embodiments, the present application provides a non-transitory computer-readable storage medium, on which a computer program is stored, and the program, when executed by a processor, implements the application program issuing method of the foregoing method embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present application, "a plurality" means two or more unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.