Unlock instant, AI-driven research and patent intelligence for your innovation.

A method for automatically calling python scripts based on java

A technology for automatically calling and starting scripts, applied in the creation/generation of source code, instruments, calculations, etc., can solve problems such as high debugging difficulty, impact, and inability to automatically go online, and achieve the effect of convenient deployment and high efficiency

Active Publication Date: 2020-09-04
ZHEJIANG BANGSUN TECH CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] 2. Use Runtime.getRuntime() to execute the script file, but how to call it needs to manually write the code according to the demand
Unable to call all python scripts, unable to go online automatically
[0009] 2.Runtime.getRuntime() Execution of script files is difficult to get started, debugging is difficult, and errors are not easy to solve
[0010] 3. Using java to directly call python will have a great impact on the efficiency
[0011] 4. Once the python version changes, it will have an unknown impact on the program
[0013] 6. The deployment of python web service generally requires the use of web containers and nginx forwarding, which is complicated and troublesome

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method for automatically calling python scripts based on java
  • A method for automatically calling python scripts based on java
  • A method for automatically calling python scripts based on java

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.

[0039] like figure 1 Shown, a kind of method that the present invention provides based on Java automatically calls Python script, comprises the following steps:

[0040] 1. Use the spring-boot framework to build a java service, define the name of the python script to be called, the name of the function to be called in the script, and the function parameters and business in the configuration file or other sources (such as third-party platforms, databases, caches, etc.) The field mapping for the data source. An example is given below:

[0041] model.audit:

[0042] structured_information.get_share_info:s=ALTAF,d=frms_addr

[0043] a.b: a=frms_a, b=frms_b

[0044] structured_information.b:a=frms_a, b=frms_b

[0045] Among them, structured_information is the name of the python script that needs to be called, and get_share_info and b...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for automatically calling a Python script based on Java. The method comprises the following steps of: automatically starting and closing a Python service end by usingjava; java calls a python file through http access, and the python file can integrate all python scripts needing to be called. And meanwhile, the java automatically encapsulates the parameters, callsthe corresponding python script and automatically injects the function parameters. According to the method, all python processes can be self-managed, and the load is balanced. The method can be compatible with python versions, all python scripts and functions in the python scripts can be called through configuration, codes do not need to be modified, and the method is easy to operate, convenient to deploy and free of extra web containers.

Description

technical field [0001] The invention relates to the technical field of software development, in particular to a method for automatically calling Python scripts based on Java. Background technique [0002] Python is an object-oriented interpreted computer programming language with a rich and powerful library. It has become the third largest language after Java and C++. Except for a few things that Python cannot do, it can basically be said to be omnipotent, including system operation and maintenance, graphics processing, mathematical processing, text processing, database programming, network programming, Web programming, multimedia applications, pymo engine, hacker programming, reptile writing, machine learning, artificial intelligence, etc. [0003] In the era of rapid Internet development, corresponding to the emergence of different operating systems (different platforms), then java can run on each platform with a single code. This kind of cross-platform is unmatched by o...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/30
CPCG06F8/31G06F8/315
Inventor 刘国庆鲁萍王新根周志强周佳锋
Owner ZHEJIANG BANGSUN TECH CO LTD