CN111708544B - Python development-based cross-platform terminal program compiling system and method - Google Patents

Python development-based cross-platform terminal program compiling system and method Download PDF

Info

Publication number
CN111708544B
CN111708544B CN202010841349.3A CN202010841349A CN111708544B CN 111708544 B CN111708544 B CN 111708544B CN 202010841349 A CN202010841349 A CN 202010841349A CN 111708544 B CN111708544 B CN 111708544B
Authority
CN
China
Prior art keywords
svn
compiling
source code
program
operating system
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
CN202010841349.3A
Other languages
Chinese (zh)
Other versions
CN111708544A (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.)
Nanjing cloud cabinet Network Technology Co.,Ltd.
Original Assignee
Jiangsu Cloudbox Network Technology 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 Jiangsu Cloudbox Network Technology Co ltd filed Critical Jiangsu Cloudbox Network Technology Co ltd
Priority to CN202010841349.3A priority Critical patent/CN111708544B/en
Publication of CN111708544A publication Critical patent/CN111708544A/en
Application granted granted Critical
Publication of CN111708544B publication Critical patent/CN111708544B/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/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a system for compiling a terminal program in a cross-platform manner, which comprises a remote operating system supported by a python language environment, wherein the remote operating system is respectively connected with an SVN source code library and an FTP server; different remote operating systems are all provided with a python language environment, an SVN client, a compiler, an executive program, a packaging program and an FTP client, an http monitoring port is created by using a python web framework, after the http monitoring port is triggered by access, the remote operating systems download source codes from an SVN source code library, execute the compiling, packaging and compressing programs and send generated files to an FTP server. The invention also discloses a method for cross-platform compiling terminal program based on the system. Based on a python language environment, a remote operating system is used as a compiling environment node, an http monitoring port and a parameter transmission standard are uniformly created, no matter what operating system is operated by a remote platform, a compiling task is executed through request access of http, and finally uniform triggering and file filing are completed.

Description

Python development-based cross-platform terminal program compiling system and method
Technical Field
The invention belongs to the technical field of information, and particularly relates to a system and a method for cross-platform compiling terminal program based on Python development.
Background
Along with the rapid development of express business, the intelligent express cabinet is a new thing along with the continuous development of express business, the function of the intelligent express cabinet is mainly to assist a courier to receive and send business, facing users are broad couriers and addressees, the intelligent express cabinet is used as an unattended express temporary storage cabinet for 24 hours, the intelligent express cabinet interacts with a server through an Internet of things card and serves as the application of the Internet of things technology in the modern logistics industry, the intelligent express cabinet is the most effective solution method for the last kilometer of electronic commerce terminal logistics, the delivery efficiency of the couriers is improved, the delivery cost is reduced, the privacy and the safety of the users are guaranteed, and the intelligent express cabinet is gradually widely recognized and popularized.
As for the terminal of the intelligent express cabinet, different terminal operating systems are provided by different vendors, or the terminal operating systems used by users themselves are different, so that the same source code supports installation programs of different platforms, for example, Windows is an exe execution program, and mac is an dmg execution program, and it is necessary to locally compile the installation program to provide version programs and installation packages of corresponding systems for users of different operating systems under different operating environments.
In the existing situation, compiling commands and packing commands are executed by manual operation under different operating systems, after packing is completed, FTP is uploaded, manual misoperation such as naming errors easily occurs, compiling is long, manpower is consumed, tedious processes and time consumption are brought for repacking of subsequent tests, and processes cannot be unified for compiling packages of versions automatically issued subsequently.
Disclosure of Invention
Aiming at the technical problem, the invention provides a cross-platform terminal program compiling system based on Python development, which realizes that a uniform interface issues compiling tasks and files.
In order to achieve the purpose, the invention adopts the technical scheme that: a cross-platform terminal program compiling system based on Python development comprises a remote operating system, wherein the remote operating system is respectively connected with an SVN source code library and an FTP server; different operating systems are all working nodes which need to execute the compiler, and different remote operating systems are all provided with a python language environment, an SVN client, the compiler, an executive program, a packaging program and an FTP client and are used for executing the working nodes of the compiler. And (3) creating an http monitoring port by using a web framework of python, downloading the source codes from the SVN source code library by the remote operating system after the http monitoring port is triggered by access, executing compiling, packaging and compressing programs, and uploading the generated file to an FTP server for subsequent terminal updating and downloading. And creating an http listening port by using a web framework of python, and receiving the parameters transmitted by the remote call. The task issuing mode to different operating systems is unified to http access, and the execution command of the system is not required to be considered.
Further, http monitoring ports on different remote operating systems wait to be called at any time; and transmitting parameters through a get request of the request, and after triggering the http monitoring port, executing subsequent compiling, packaging and compressing operations by the remote operating system.
Furthermore, in order to improve the simplicity and ensure the stability of the system operation and unify the automatic compiling process, the web framework uses a flash module.
Further, triggering a remote operating system to execute a compiling task through an http monitoring port, and transmitting a source code link of an SVN source code library; the access links that trigger the remote operating system to execute the compilation task are: http:// remote IP: Port/terminal/$ { Svn _ url }, where $ { Svn _ url } is the source code link of the delivered SVN source code library.
Furthermore, the python programming language comprises a downloading method, a compiling method, a packaging method and an uploading method; the downloading method generates $ { SVN _ url } of the SVN source code library through the transmitted parameters, and downloads the source code file of the SVN source code library through the SVN client; the compiling method is that an executive program file is generated according to a compiler program installed by executing a current remote operating system, and the packing method packs the executive program file through a ZIP compression tool; and the uploading method uploads the packed executive program file to an FTP server through an FTP client.
The invention also discloses a cross-platform terminal program compiling method based on Python development, which comprises the following steps based on the system:
s1, the remote operating system creates an http monitoring port by using a python web framework, waits to be remotely triggered and called, and executes subsequent operation flows such as compiling and the like;
s2, access by request: port/terminal/$ (Svn _ url), calling of an http monitoring Port is realized, and a parameter variable of source code link $ (Svn _ url) of an SVN source code library is transmitted;
s3, after the http monitoring port is triggered, the source code link of the SVN source code library is received, and the source code file is downloaded to the local appointed directory in the first step;
s4, in the second step, compiling, packing and compressing methods are sequentially executed in the appointed source code directory, the operation flow is executed according to the sequence through the python program language, and the compressed file is placed in the appointed generated directory;
and S5, uploading the files in the generated directory to the FTP file server through the FTP client.
Further, the remote call in S2 is remotely executed, and the parameter $ (Svn _ url) is passed; the parameter $ (Svn _ url) includes the name and version of the source code.
Further, in S3, the triggered http monitor port receives a parameter $ (Svn _ url) in a standard format, and downloads the source code file by accessing $ (Svn _ url); the $ (Svn _ url) canonical format is: http:// SVN Server + APP name + version.
Further, S4 executes python program language, when executing the compiling method, an application compiling directory is created according to the APP name in the parameter, a version directory and a timestamp temporary directory in the parameter are created, each compiling is guaranteed to be the latest version, a terminal installation program corresponding to the parameter is generated after compiling, an execution program corresponding to the current remote operating system is output, and a compression tool is used for packaging into a compressed file.
Further, in S4, the executable program file generated by executing the compiling method is packaged according to a standard naming mode, where the standard naming mode is: local operating system + APP name + version; when the upload method is executed in S5, the packaged execution program is uploaded from the designated directory to the FTP server, and the compressed file of the same name is updated recently. And the terminal downloads the installation package according to the corresponding file name of the FTP server and carries out decompression installation.
The method is mainly based on a cross-platform installation of a python language environment and a monitoring mode of a module self-starting http port, achieves a series of operation flows of compiling, packaging and uploading of each platform through automatic triggering, and can uniformly call the http port through the started http port as long as a remote operation system supporting the python language environment is adopted, so that the triggering mode of the platform is ensured to be http transmission and calling no matter what platform is adopted, and the transmission format is uniform.
Because the execution programs of all the operating systems are different, the integration of the operating commands of all the platforms can be supported through a python language environment, consistent input and output are achieved, no matter what operating system is operated by a remote platform, parameters are transferred through http, the compiled execution files are compressed and packaged and transmitted to an FTP server for filing, uniform triggering and file filing are completed, and preliminary attempts and construction ideas are made for subsequent automatic generation of cross-platform products.
Drawings
Fig. 1 is a schematic diagram of a cross-platform compiling terminal program according to an embodiment of the invention.
FIG. 2 is a flowchart of a cross-platform compiling terminal program according to an embodiment of the invention.
FIG. 3 is a flowchart illustrating downloading, compiling and packaging of source code by the remote operating system according to an embodiment of the present invention.
Detailed Description
In order to facilitate understanding of those skilled in the art, the present invention will be further described with reference to the following embodiments and accompanying drawings.
Fig. 1 is a system for cross-platform compiling a terminal program based on Python development according to this embodiment, and the system is mainly responsible for triggering, in a manner of unifying compiling and packaging processes under different operating systems into port parameter transfer calls through Python language, uploading to an FTP server for a user to update and download.
Fig. 1 mainly includes various remote operating systems 1 supported by python language, and the remote operating systems 1 are respectively connected to an SVN source code library 2 and an FTP server 3.
The method comprises the steps that an http access port is created by a web framework of a locally enabled python language library of a remote operating system 1, monitoring of the http access port is enabled through a flash _ counters module of python, remote call transmission parameters are received, and the received parameters comprise an APP name { Apername } and a version { version }. And when the transmission parameters are received and the port is triggered, downloading the corresponding source code file from the SVN source code library 2 on the remote operating system 1 according to { Apername } and { version }, and simultaneously performing a compiling method, a packing method and an uploading method in an associated manner after downloading.
The method comprises the steps of remotely calling http ports of different operating systems, transmitting { Apername } and { version } parameters to a locally enabled port of a remote operating system 1, accessing http to transfer parameters, and uniformly calling through the http access port enabled by python as long as a python system is supported, so that the triggering mode of the system is http transfer parameters calling and the format of the transfer parameters is uniform no matter what platform is guaranteed.
The method for downloading the remote operating system 1 in the correlated execution mode includes the steps that a designated SVN source code library 2 is spliced according to a standard format through { Apername } and { version } parameters to access $ { Svn _ url }, source code files of corresponding libraries and versions are downloaded to a local downloading directory, preparation is made for subsequent compiling, and an SVN client needs to be installed on the remote operating system 1.
The method for compiling the remote operating system 1 in the correlated execution mode includes the steps of creating an application compiling directory according to the Appname, then creating a version directory and a timestamp temporary directory, guaranteeing that each compiling is the latest version, producing a terminal installation program corresponding to the Appname, namely the version after compiling, enabling Window to be exe and mac to be dmg, and outputting an execution program corresponding to the system. Then, the remote operating system 1 executes a packing method in association, and packs { system } - { Apername } - { version }. zip in a specified naming mode, wherein the remote operating system 1 needs to install a zip compression tool.
As shown in fig. 2, in the case that all environment deployment preparations are made in fig. 1, the remote operating system needs to install a python and flash _ cors module, an SVN client, a ZIP compression tool, an FTP client, and remotely call transfer parameters, and the triggered flow is as follows:
step 4, triggering access by the remote operating system 1, and transmitting parameters { system }, { Apername }, and { version };
step 5, a downloading method is executed in a correlated manner, and $ { Svn _ url } of the SVN source code library 2 is generated through transmitted { Apername } and { version }, namely, the source code library is linked with http:// SVN _ IP/{ Apername }/{ version }/, and is downloaded to the local through the SVN client;
step 6, a compiling method is associated and executed, a compiling output directory is appointed, a { apple }/{ version }/{ timestamp }/, after an execution program file is generated, a packing method is associated and executed, and a name { system } - { apple } - { version }. zip is specified to the appointed directory;
and 7, associating and executing an uploading method, uploading { system } - { Apername } - { version }. zip to the FTP server from the specified directory, wherein the same-name compression packet is subject to the latest update. And the terminal downloads the installation package according to the corresponding file name of the FTP and carries out decompression installation.
The method is mainly based on a cross-platform installation of a python language environment and a monitoring mode of a module self-starting port, a series of processes of compiling, packaging, uploading and archiving of each platform are triggered automatically, because execution programs of each operating system are different, integration of running commands of each platform can be supported through the python language environment, consistent input and output are achieved, no matter how the operating system runs locally, a parameter is called through http, uniform triggering and archiving are completed in a post-FTP uploading compression package mode, and preliminary attempts and construction ideas are made for subsequent automatic generation of cross-platform products.
There are many web frameworks in Python language, and this embodiment uses a simple flash module, which can be replaced by other means, such as the web framework of django.
In this embodiment, a flow chart of downloading source codes, compiling and packaging by a remote operating system is shown in fig. 3. The remote operating system receives parameters a (url of Svn source code library link), b (system user), c (system password), d (time stamp), e (identifier, which is divided into A full package; P single module package).
And judging whether the application catalog exists or not, if not, creating an initial application catalog, and if so, updating the application code.
Creating a time stamp compiling directory, copying the source code to the directory, replacing a version configuration variable to be f (splicing the application name and the version number according to url link of Svn), and compiling in the directory.
And judging whether the compiling command is A or P according to e. If the compile command is A: system executes full compilation commands, Windows for example: system (composite 32.exe), packing the generated executive program into h [ all _ $ { appname } _ version } _ $ system }. zip ], uploading the address i [ FTP ] to the FTP server, ftpIP/terminal/A/all _ $ { appname } _ version } _ zip.
If the compile command is P: system executes single module compilation command, Windows for example: system (qmake) os. system (mingw32-make. exe), packing the generated execution program into g [ patch _ $ { appname } _ version } _ system }. zip ], and uploading the address j [ FTP ] ftpIP/terminal/P/patch _ $ { appname }. zip } to the FTP server.
The above embodiments are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited thereby, and any modification made on the basis of the technical solution according to the technical idea of the present invention falls within the protection scope of the present invention.

Claims (6)

1. A cross-platform terminal program compiling system based on Python development is characterized in that:
the system comprises a remote operating system, wherein the remote operating system is respectively connected with an SVN source code library and an FTP server; different remote operating systems are all provided with a python language environment, an SVN client, a compiler, an executive program, a packaging program and an FTP client, an http monitoring port is established by utilizing a python web framework, after the http monitoring port is triggered by access, the remote operating systems download source codes from an SVN source code library, execute the compiler, the packaging program and the compression program, and upload generated files to an FTP server;
the http monitoring ports on different remote operating systems wait to be called at any time; transmitting parameters through a get request of a request, and after triggering an http monitoring port, executing subsequent compiling, packaging and compressing operations by a remote operating system;
triggering a remote operating system to execute a compiling task through an http monitoring port, and transmitting a source code link of an SVN source code library; the access links that trigger the remote operating system to execute the compilation task are: http:// remote IP: Port/terminal/$ { Svn _ url }, where $ { Svn _ url } is the source code link of the delivered SVN source code library.
2. The system for compiling a terminal program across platforms according to claim 1, wherein:
the web framework uses a flash module.
3. The system for compiling a terminal program across platforms according to claim 1 or 2, wherein:
the python program language on the remote operating system comprises a downloading method, a compiling method, a packaging method and an uploading method;
the downloading method generates $ { SVN _ url } of the SVN source code library through the transmitted parameters, and downloads the source code file of the SVN source code library through the SVN client;
the compiling method is that a compiling program installed by a current remote operating system is executed to generate an executive program file;
the packaging method packages the executive program files through a ZIP compression tool;
and the uploading method uploads the packed executive program file to an FTP server through an FTP client.
4. A method for cross-platform terminal program compiling based on Python development, based on the system of any one of claims 1-3, comprising the following steps:
s1, the remote operating system utilizes a python web framework to create an http monitoring port to wait for being remotely triggered and called;
s2, access by request: port/terminal/$ (Svn _ url), calling of an http monitoring Port is realized, and a parameter variable of source code link $ (Svn _ url) of an SVN source code library is transmitted; remotely executing the remote call in S2 and passing the parameter $ (Svn _ url); the parameter $ (Svn _ url) comprises the name and version of the source code;
s3, after the http monitoring port is triggered, receiving a source code link of the SVN source code library, and downloading a source code file to a local appointed directory;
s4, compiling, packing and compressing methods are sequentially executed in the specified source code directory, the operation flow is executed in sequence through the python program language, and the compressed file is placed in the specified generated directory; executing a python program language, when executing a compiling method, creating an application compiling directory according to the APP name in the parameter, then creating a version directory and a timestamp temporary directory in the parameter, ensuring that each compiling is the latest version, generating a terminal installation program corresponding to the parameter after compiling, outputting an execution program corresponding to the current remote operating system, and packaging into a compressed file by using a compression tool;
and S5, executing an uploading method, and uploading the compressed files in the generated directory to the FTP server through the FTP client.
5. The method for compiling a terminal program across platforms according to claim 4, comprising the steps of:
in S3, the triggered http monitor port receives the parameter $ (Svn _ url) in the standard format, and downloads the source code file by accessing $ (Svn _ url); the $ (Svn _ url) canonical format is: http:// SVN Server + APP name + version.
6. The method for cross-platform compiling a terminal program according to claim 4 or 5, further comprising the steps of:
in S4, the executable program file generated by the compiling method is packaged according to the standard naming mode, where the standard naming mode is: local operating system + APP name + version;
s5 uploads the packed compressed file from the designated directory to the FTP server, with the compressed file of the same name subject to the latest update.
CN202010841349.3A 2020-08-20 2020-08-20 Python development-based cross-platform terminal program compiling system and method Active CN111708544B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010841349.3A CN111708544B (en) 2020-08-20 2020-08-20 Python development-based cross-platform terminal program compiling system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010841349.3A CN111708544B (en) 2020-08-20 2020-08-20 Python development-based cross-platform terminal program compiling system and method

Publications (2)

Publication Number Publication Date
CN111708544A CN111708544A (en) 2020-09-25
CN111708544B true CN111708544B (en) 2021-02-05

Family

ID=72547368

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010841349.3A Active CN111708544B (en) 2020-08-20 2020-08-20 Python development-based cross-platform terminal program compiling system and method

Country Status (1)

Country Link
CN (1) CN111708544B (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9258668B2 (en) * 2013-07-31 2016-02-09 Sap Se Mobile application framework extensibiilty
CN109582316A (en) * 2018-11-15 2019-04-05 北京深思数盾科技股份有限公司 A kind of cross-platform Compilation Method, device, system, server and storage medium

Also Published As

Publication number Publication date
CN111708544A (en) 2020-09-25

Similar Documents

Publication Publication Date Title
CN110377290B (en) Method, device and equipment for compiling target engineering
CN111506322B (en) Automatic integrated construction development deployment platform and method
CN105718251A (en) Multilanguage SDK (software development kit) automatic implementation method and system
CN106325847B (en) Method and device for acquiring application program function based on iOS platform
CN109634612A (en) Continuous integrating method, system, computer equipment and storage medium
CN106371881B (en) Method and system for updating program version in server
CN103294514A (en) System software release integrated method, compiling server and system
CN104063239A (en) Application program update method of mobile terminal, server and client
CN105335173A (en) Method, apparatus and system for initializing intelligent terminal device
CN105487905A (en) Updating method and device of hybrid application
CN111666099A (en) Application service publishing system
CN105867973A (en) Loading method and system for so file in application program
CN104580480A (en) Remote automatic deployment system and method for client end
EP3035644A2 (en) Determined configuration update for edge components
CN114879984B (en) Method for reducing volume of offline file by dynamically constructing docker mirror image
CN108958753B (en) Code packaging deployment method and device
CN113626036A (en) Code integrated management method and system based on Jenkins
CN105468427A (en) Implementation method and system of automatic compilation and release
CN113779477A (en) Assembly line publishing method and system based on PaaS cloud platform
CN115718606A (en) Method and system for automatic and continuous integration and deployment of server
CN113342387A (en) Automatic software upgrading method, updating client and updating server
CN111949276B (en) System and method for automatically deploying application programs based on container mode
CN110795105A (en) Automatic compiling and deploying method and system for power distribution automation master station system
CN110795139A (en) Client batch packaging method and device, computer equipment and storage medium
CN111078265A (en) Jenkins-based web project update patch generation method

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
TR01 Transfer of patent right

Effective date of registration: 20210526

Address after: 210000 Room 301, 3rd floor, 138 Fengtai South Road, Yuhuatai District, Nanjing City, Jiangsu Province

Patentee after: Nanjing cloud cabinet Network Technology Co.,Ltd.

Address before: Room 1501, building 1, Tianhe Plaza, 146 Fengtai South Road, Yuhuatai District, Nanjing, Jiangsu Province 210000

Patentee before: JIANGSU CLOUDBOX NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right