CN115562713A - Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium - Google Patents

Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium Download PDF

Info

Publication number
CN115562713A
CN115562713A CN202211193408.6A CN202211193408A CN115562713A CN 115562713 A CN115562713 A CN 115562713A CN 202211193408 A CN202211193408 A CN 202211193408A CN 115562713 A CN115562713 A CN 115562713A
Authority
CN
China
Prior art keywords
configuration file
configuration
script
target
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211193408.6A
Other languages
Chinese (zh)
Inventor
辛超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile 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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202211193408.6A priority Critical patent/CN115562713A/en
Publication of CN115562713A publication Critical patent/CN115562713A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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)

Abstract

The invention provides a method and a device for controlling multiple scripting languages by a single configuration file, electronic equipment and a storage medium, wherein the method for controlling the multiple scripting languages by the single configuration file comprises the following steps: acquiring a configuration file, wherein the configuration file is configured based on a preset configuration rule; reading the configuration file through a compiling script, and analyzing the configuration file according to the configuration rule to obtain configuration information; and carrying out format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to the target script format so as to enable the configuration file to complete adaptation of different script languages. The invention generates the configuration information corresponding to the target script language and the development language by using the single configuration file, and exports the variable and compiling option information. The purpose of unified management and unified configuration of the whole software project is achieved, and the problem that configuration is not unified due to the fact that a plurality of corresponding configuration files need to be modified when a certain function is modified in the software development process is solved.

Description

Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium
Technical Field
The application relates to the technical field of computer programming, in particular to a method and a device for controlling multiple scripting languages through a single configuration file, electronic equipment and a storage medium.
Background
In the software development process, various development languages, such as C/C + +, JAVA, and the like, may be used, and various scripting languages and construction scripts are used to control software engineering compilation, link generation library files, or executable files. Multiple development languages and scripting languages generally need multiple configuration files to control respectively, so that modification of a certain function in a software development process needs modification of the corresponding multiple configuration files, or the problem of non-uniform configuration is caused.
Disclosure of Invention
In view of the above drawbacks of the prior art, the present invention provides a method and apparatus for controlling multiple scripting languages with a single configuration file, an electronic device, and a storage medium, so as to solve the above technical problems.
The invention provides a method for controlling multiple scripting languages by a single configuration file, which comprises the steps of obtaining the configuration file, wherein the configuration file is configured based on a preset configuration rule; reading the configuration file through a compiling script, and analyzing the configuration file according to the configuration rule to obtain configuration information; and carrying out format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to the target script format so as to enable the configuration file to complete adaptation of different script languages.
In an embodiment of the invention, the configuration file is in a format of an editable text file.
In an embodiment of the present invention, the reading the configuration file by compiling a script, and analyzing the configuration file according to the configuration rule to obtain the configuration information includes: compiling scripts to read the configuration files line by line; and analyzing the read configuration file according to the configuration rule to obtain the configuration information of the configuration file.
In an embodiment of the present invention, format conversion is performed on the configuration file according to the configuration information, so as to obtain a target configuration file corresponding to a target script format, and meanwhile, variable and compiling option information required by the target script is exported according to the target configuration file.
In an embodiment of the present invention, the object script includes the object configuration file or the variable and the compiling option information derived from the object configuration file, and the object script refers to the variable and the compiling option information to control a software project.
In an embodiment of the present invention, the scripting language includes Shell, perl, cmakelist or Makefile.
In an embodiment of the present invention, the configuration file is converted into at least one target configuration file.
The invention provides a device for controlling multiple scripting languages by a single configuration file, which comprises: the system comprises a configuration file acquisition module, an analysis module and a conversion module, wherein the configuration file acquisition module is used for acquiring a configuration file, and the configuration file is configured based on a preset configuration rule; the analysis module is used for reading the configuration file through a compiling script and analyzing the configuration file according to the configuration rule to obtain configuration information; the conversion module is used for carrying out format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to a target script format, so that the configuration file can complete adaptation of different script languages.
The invention provides an electronic device, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the electronic device to implement the method of single profile control of multiple scripting languages of any of claims 1 to 7.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to execute the method of controlling multiple scripting languages with a single configuration file according to any one of claims 1 to 7.
The invention has the beneficial effects that: the method for controlling multiple scripting languages by the single configuration file enables the single configuration file to be adapted to multiple different scripting languages by compiling the script and analyzing the single configuration file to generate the target configuration file corresponding to the target script format, and achieves the purposes of unified management and unified configuration of the whole software project. If a certain function is modified in the software development process, only the configuration file needs to be correspondingly modified, the problem of non-uniform configuration caused by modifying a plurality of corresponding configuration files in a multi-file configuration mode is solved, and the working efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a flow diagram illustrating a method for a single configuration file to control multiple scripting languages according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart of step S120 in the embodiment shown in FIG. 1 in an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method for a single configuration file to control multiple scripting languages according to another exemplary embodiment of the present application;
FIG. 4 is a block diagram illustrating a single configuration file controlling multiple scripting language devices according to an exemplary embodiment of the present application;
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use to implement the electronic device of the embodiments of the subject application.
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the disclosure herein, wherein the embodiments of the present invention are described in detail with reference to the accompanying drawings and preferred embodiments. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be understood that the preferred embodiments are illustrative of the invention only and are not limiting upon the scope of the invention.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the drawings only show the components related to the present invention rather than being drawn according to the number, shape and size of the components in actual implementation, and the type, amount and proportion of each component in actual implementation can be changed freely, and the layout of the components can be more complicated.
In the following description, numerous details are set forth to provide a more thorough explanation of embodiments of the present invention, however, it will be apparent to one skilled in the art that embodiments of the present invention may be practiced without these specific details, and in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring embodiments of the present invention.
It should be noted that the configuration file of the software is used to store some information of the relevant software, such as initialized information, an initial path, an account number, and the like. The migration of the program is convenient, the characteristics of some software can be customized by modifying the configuration file at any time, and the software does not need to be recompiled when being modified.
The scripting language is a computer programming language created to shorten the traditional programming language "write-compile-link-run" process. Early scripting languages, often referred to as batch processing languages or job control languages, automatically completed a series of simple repetitive tasks, but many of the current scripting languages have greatly enhanced functionality and can write more elaborate and complex automated processing programs.
The scripting languages can be broadly classified into a work control language, a text processing language, an application-customized scripting language, a GUI scripting language, a general dynamic language, and an extensible and embeddable language according to the purpose. The job control language is used as batch processing or job control language, and is especially suitable for system management. Common DOS, windows batch files and Shell scripts under UNX are in this category. Commonly used scripting languages of this type are: DOS batch script, shell, REXX, JCL, etc. Wherein the DOS batch script is configured to automatically execute DOS commands in batches. The batch script file has an extension of bat or md. Shell scripts are similar to DOS batch scripts and generally refer to the fact that various Shell commands or operating system commands are stored in a file in a UNK/Linux operating system, and a script language is executed by a corresponding Shell interpreter. The Shell script utilizes the characteristics of pipeline commands, data stream redirection and the like, and provides rich functions of array, circulation, condition, logic judgment and the like. The Shell scripts are of various types, including bash, sh, csh, ksh, tcsh and the like, and are mainly used for daily management and maintenance of the UNK/Linux system. Processing text-based records is one of the earliest uses of scripting languages. AWK, as under UNIX, was originally used to help system administrators handle configuration text or log files. Common scripting languages of this type are AWK, perl, sed, etc. The customized script language is usually designed for the application program, and has the customized function. Commonly used scripting languages include VBScript Maya Embedded Language, matlab Embedded Language, etc. GUI scripting languages interact between users and graphical interfaces, menus, buttons, etc., often to achieve automated repetitive operations. When interacting via the keyboard, these languages are also referred to as macro languages. Commonly used scripting languages include Expect, autoHotkey, and AutoIt. The general dynamic language is still called a script language due to its properties of interpreted execution, memory management, dynamics, etc., but these languages have been used to write more general applications. Commonly used scripting languages include Lua, perl, PHP, python, ruby, TCL, and the like. There are some languages designed to be embedded in applications, with the advantage that information can be passed between applications. Commonly used extensible, embeddable language scripting languages are: HTML, javaScript, JScript, Z-Script, and the like.
Of course, in many cases, these categories are not strictly mutually exclusive, overlap and are compatible with each other, and the same script language may belong to multiple categories and have multiple purposes.
FIG. 1 is a flow diagram illustrating a method for a single configuration file to control multiple scripting languages according to an exemplary embodiment of the present application. The method is performed by an electronic device, and the specific type of the electronic device is not limited, and for example, the electronic device may be, but not limited to, a smart phone, a Personal Computer (PC), a tablet computer, a Personal Digital Assistant (PDA), a web server, a data server, a computer, a Mobile Internet Device (MID) or other devices having a processing function. As shown in fig. 1, a method for controlling multiple scripting languages by a configuration file at least includes steps S110 to S130, which are described in detail as follows:
step S110: the method comprises the steps of obtaining a configuration file, wherein the configuration file is configured based on a preset configuration rule.
In this embodiment, the configuration file is a file containing information required to successfully operate the program, which is structured in a particular manner. They are not hard coded in the program, but are user configurable. The configuration files comprise default configuration files and user-defined configuration files, the configuration information corresponding to the default configuration files is the configuration information with the modification probability lower than a certain probability, and the configuration information corresponding to the user-defined configuration files is the configuration information customized according to requirements. Typically, the configuration file is in the form of an editable text file, which may be edited and modified. When the configuration file is edited or modified, recording modification information of the configuration file, wherein the modification information comprises one or more of modification time, modification user, modification content and modification reason, and the modification comprises deletion, addition or adjustment. There is no specific requirement on the format and configuration rules of the configuration file, as long as subsequent successful reading and parsing is possible.
Step S120: and reading the configuration file through the compiling script, and analyzing the configuration file according to the configuration rule to obtain configuration information.
In this embodiment, the configuration file is read and analyzed line by the compiling script, specifically, the configuration file is analyzed by the compiling script according to the configuration rule, and the configuration file can be successfully analyzed into the configuration information only by analyzing the configuration file according to the configuration rule by the compiling script. Different compiling scripts can analyze the same configuration file to obtain different configuration information.
Step S130, converting the format of the configuration file according to the configuration information to obtain a target configuration file corresponding to the target script format, so that the configuration file can complete the adaptation of different script languages.
In this embodiment, the configuration file is subjected to format conversion through the configuration information, and an object configuration file corresponding to an object script format is generated. The type and number of the generated target configuration files are not limited, for example, the target configuration file may be any one or more of a Shell configuration file, a Makefile configuration file, a JAVA configuration file, or a Cmake configuration file, and the target configuration file may also be other configuration files than the above types. Shell script variables and C/C + + compilation options can also be derived through configuration information for subsequent build and compilation code usage. The target script comprises a generated target configuration file, or can quote the exported Shell script variable or/and C/C + + compiling option control code to compile, so that the purpose of uniformly controlling the whole software to compile throughout is achieved.
Fig. 2 is a flow chart of step S120 in the embodiment shown in fig. 1 in an exemplary embodiment. As shown in fig. 2, the reading the configuration file through the compiling script and analyzing the configuration file according to the configuration rule to obtain the configuration information includes steps S210 and S220:
step S210: and compiling the script to read the configuration file line by line.
Step S220: and analyzing the read configuration file according to the configuration rule to obtain the configuration information of the configuration file.
Fig. 3 is a flowchart illustrating a method for controlling multiple scripting languages with a single configuration file according to another exemplary embodiment of the present application. As shown in fig. 3, a method for controlling multiple scripting languages by a configuration file at least comprises steps S210 to S230, which are described in detail as follows:
step S310: and acquiring a configuration file according to the configuration rule.
In this embodiment, the configuration rule of the configuration file may be: the configuration file adopts a file in an INI suffix format, is defined in a key = value form, all configuration variables begin with CACFG _ and are defaulted to be Boolean variables (value = true/false), STRING variables begin with CACFG _ STRING _ and combination variables begin with CACFG _ COMB _ which not only generates definitions of the variables, but also combines the key and the value to generate corresponding variables, and begins with "#" as annotation information.
Step S320: and reading and analyzing the configuration file.
In this embodiment, the configuration file is read and analyzed by script compiling. The type of script compiling is not limited, shell script compiling can be adopted for reading and analyzing, and the configuration rules are matched during analyzing, so that the consistency of the analysis rules and the configuration rules is ensured.
Step S330: and generating a target configuration file corresponding to the target script format, and exporting variable and compiling option information.
In this embodiment, the generated target configuration file, the export variables, and the compiling option information may include the following contents:
sh configuration file xxx.sh: export CACFG _ DEBUG = true
Makefile configuration file xxx.mk CACFG _ DEBUG: = true
Cmake configuration File xxx
JAVA, public static final bootean CACFG _ DEBUG = true;
and exporting shell variables for calling of next-level shell scripts: export CACFG _ DEBUG = true
Exporting compilation options for C/C + + compilation, MYCFLAGS + = -DCACFG _ DEBUG, MYCXXFLAGS + = -DCACFG _ DEBUG
The target script contains the generated configuration file corresponding to the script language or refers to the exported variables so as to achieve the purpose of uniformly controlling the compilation of the whole software engineering.
For example, in the next shell script, the generated configuration file is contained, source xxx.sh, and then the generated variable, if [ "$ CACFG _ DEBUG" = "true" ], is used in the script logic of the script; then
xxxxx
fi
The Makefile contains the generated configuration file: include xxx
The generated variables are then used in its Makefile script,
ifneq($(strip$(CACFG_DEBUG)),true)
xxxx
endif
txt contains the generated configuration file: cmake, then use the variable control project in its own Cmake script,
if(CACFG_DEBUG)
xxxx
endif()
similarly, the derived variables can be directly used in the shell script, and in the compiling scripts of Makefile and Cmake, the engineering source code compiling is controlled by using the compiling options derived in the above steps, such as in the Cmake script, set (Cmake _ C _ FLAGS "$ { Cmake _ C _ FLAGS } $ { myclags }) adds the generated compiling options to Cmake _ C _ FLAGS control C code compiling, and in Makefile, CFLAGS + = $ (myclags) is used to control source code compiling.
FIG. 4 is a block diagram illustrating a single configuration file controlling multiple scripting language devices according to an exemplary embodiment of the present application. The device for controlling multiple scripting languages by the single configuration file is specifically configured in the intelligent terminal.
As shown in fig. 4, the exemplary apparatus for controlling multiple scripting languages with a single configuration file includes: the device comprises a configuration file acquisition module 4001, an analysis module 4002 and a conversion module 4003, wherein the configuration file acquisition module 4001 is configured to acquire a configuration file, and the configuration file is configured based on a preset configuration rule; the analysis module 4002 is configured to read the configuration file through a compiling script, and analyze the configuration file according to the configuration rule to obtain configuration information; the conversion module 4003 is configured to perform format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to a target script format, so that the configuration file completes adaptation of different scripting languages.
In another exemplary embodiment, the configuration file may be obtained by the configuration file obtaining module 4001, where the configuration file is configured based on a preset configuration rule, and the configuration file may be correctly parsed only according to a certain configuration rule, and the configuration rule has no explicit provision, as long as the configuration file is set according to a certain rule, so that the configuration file may be successfully read and parsed in the following.
In another exemplary embodiment, the parsing module 4002 parses the configuration file, and the parsing must be performed according to the configuration rule, so that correct configuration information can be obtained only by parsing according to the configuration rule. The parsing module 4002 may be a compiling script, and the type of the compiling script is not limited as long as the compiling script can read the configuration file and parse the configuration file correctly, for example, the compiling script may be a Shell script. And the compiling script analyzes the configuration files one by one according to the configuration rules of the configuration files to obtain the configuration information of the configuration files.
In another exemplary embodiment, the conversion module 4003 performs format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to the target script format, so that the configuration file completes adaptation of different scripting languages. In this embodiment, the type and the number of the target configuration files generated by conversion are not fixed, and the configuration files can be converted into the type and the number corresponding to the required target configuration files by adjusting the compiling script. For example, the target profile may be one or more of a Shell profile, makefile profile, JAVA profile, and Cmake profile. In addition, the conversion module 4003 may also derive Shell script variables and C/C + + compilation options for subsequent build and compilation code usage.
It should be noted that the apparatus for controlling multiple scripting languages with a single configuration file provided in the foregoing embodiment and the method for controlling multiple scripting languages with a single configuration file provided in the foregoing embodiment belong to the same concept, and specific manners in which each module and unit execute operations have been described in detail in the method embodiment, and are not described again here. In practical applications of the device with a single configuration file for controlling multiple scripting languages provided in the above embodiment, the functions may be distributed by different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above, which is not limited herein.
An embodiment of the present application further provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, enable the electronic device to implement the method for controlling multiple scripting languages by using a single configuration file provided in the above embodiments.
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application. It should be noted that the computer system 500 of the electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various suitable actions and processes, such as executing the method described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 502 or a program loaded from a storage portion 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An Input/Output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output section 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. A drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 501.
It should be noted that the computer readable media shown in the embodiments of the present application may be computer readable signal media or computer readable storage media or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may comprise a propagated data signal with a computer-readable computer program embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to execute the method of single profile control of multiple scripting languages as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the method for controlling multiple scripting languages by using the single configuration file provided in the above embodiments.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A method for controlling multiple scripting languages with a single configuration file, the method comprising:
acquiring a configuration file, wherein the configuration file is configured based on a preset configuration rule;
reading the configuration file through a compiling script, and analyzing the configuration file according to the configuration rule to obtain configuration information;
and carrying out format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to the target script format so as to enable the configuration file to complete adaptation of different script languages.
2. The method of claim 1, wherein the configuration file is an editable text file.
3. The method of claim 1, wherein reading the configuration file by compiling a script and parsing the configuration file according to the configuration rule to obtain configuration information comprises:
compiling scripts to read the configuration files line by line;
and analyzing the read configuration file according to the configuration rule to obtain the configuration information of the configuration file.
4. The method according to claim 1, wherein the configuration file is format-converted according to the configuration information, so as to obtain a target configuration file corresponding to a target script format, and the variables and compiling option information required by the target script are derived according to the target configuration file.
5. The method of claim 4, wherein the object script comprises the object configuration file or the variables and the compilation option information derived from the object configuration file, and wherein the object script references the variables and the compilation option information to control a software project.
6. The method of claim 1, wherein the scripting language comprises Shell, perl, cmakelist, or Makefile.
7. The method of claim 1, wherein said configuration file is transformed into at least one of said target configuration files.
8. An apparatus for controlling multiple scripting languages with a single configuration file, the apparatus comprising:
the device comprises a configuration file acquisition module, a configuration file acquisition module and a configuration file management module, wherein the configuration file acquisition module is used for acquiring a configuration file, and the configuration file is configured based on a preset configuration rule;
the analysis module is used for reading the configuration file through a compiling script and analyzing the configuration file according to the configuration rule to obtain configuration information;
and the conversion module is used for carrying out format conversion on the configuration file according to the configuration information to obtain a target configuration file corresponding to the target script format so as to enable the configuration file to complete the adaptation of different script languages.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the electronic device to implement the method of single profile control of multiple scripting languages of any of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to execute the method of controlling a plurality of scripting languages with a single configuration file according to any one of claims 1 to 7.
CN202211193408.6A 2022-09-28 2022-09-28 Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium Pending CN115562713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211193408.6A CN115562713A (en) 2022-09-28 2022-09-28 Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211193408.6A CN115562713A (en) 2022-09-28 2022-09-28 Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115562713A true CN115562713A (en) 2023-01-03

Family

ID=84742074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211193408.6A Pending CN115562713A (en) 2022-09-28 2022-09-28 Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115562713A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117075958A (en) * 2023-10-16 2023-11-17 广东优力普物联科技有限公司 Firmware generation method suitable for multiple models, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117075958A (en) * 2023-10-16 2023-11-17 广东优力普物联科技有限公司 Firmware generation method suitable for multiple models, storage medium and electronic equipment
CN117075958B (en) * 2023-10-16 2024-01-23 广东优力普物联科技有限公司 Firmware generation method suitable for multiple models, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US11422778B2 (en) Development environment for real-time dataflow programming language
US20240045850A1 (en) Systems and methods for database orientation transformation
US8701084B1 (en) Preview of auto-fix changes to software code
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
US11934287B2 (en) Method, electronic device and computer program product for processing data
CN111913741B (en) Object interception method, device, medium and electronic equipment
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN111209001A (en) Method, system, equipment and medium for batch generation of APKs of android channels
CN114153459A (en) Interface document generation method and device
US8875089B2 (en) Workspace model for interrelated projects
CN115562713A (en) Method and device for controlling multiple scripting languages through single configuration file, electronic equipment and storage medium
CN112882703A (en) Online design method and device for user-defined chart plug-in
CN110188308B (en) Client automatic dotting reporting method, storage medium, equipment and system
CN113778405A (en) Cross-platform APP construction method, device, system and medium
CN112346774A (en) Method and device for generating application installation package
CN115964042A (en) Menu generation method and device, storage medium and electronic equipment
CN113641594B (en) Cross-terminal automatic testing method and related device
CN113885841A (en) Script generation method and device, electronic equipment and readable medium
CN115495068A (en) VUE page generation method and device
CN113448874A (en) Method and device for generating unit test script
CN113360410A (en) Test method of C code software and readable storage medium
CN112241505A (en) Page updating method, page updating device, medium and electronic equipment
CN114385947B (en) Webpage publishing method, system, device and medium
CN116775030B (en) Method and device for creating security baseline
CN113253993B (en) Using method of CFlex script language for realizing command sequence and event management

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