WO2020134633A1 - 一种应用程序的开发方法、装置及集成开发工具 - Google Patents

一种应用程序的开发方法、装置及集成开发工具 Download PDF

Info

Publication number
WO2020134633A1
WO2020134633A1 PCT/CN2019/116291 CN2019116291W WO2020134633A1 WO 2020134633 A1 WO2020134633 A1 WO 2020134633A1 CN 2019116291 W CN2019116291 W CN 2019116291W WO 2020134633 A1 WO2020134633 A1 WO 2020134633A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
project
code
function
project file
Prior art date
Application number
PCT/CN2019/116291
Other languages
English (en)
French (fr)
Inventor
刘小强
朱剑虹
张方方
洪斌
Original Assignee
百富计算机技术(深圳)有限公司
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 百富计算机技术(深圳)有限公司 filed Critical 百富计算机技术(深圳)有限公司
Publication of WO2020134633A1 publication Critical patent/WO2020134633A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Definitions

  • This application relates to the field of software technology, and in particular, to an application development method, device, and integrated development tool.
  • An application corresponds to a project file.
  • the project file may contain multiple sub-project files, and each sub-project file may contain multiple code files.
  • the code file may also need to call multiple function files.
  • embodiments of the present application provide an application development method, device, and integrated development tool to solve the problem of low application development efficiency in the prior art.
  • the first aspect of the embodiments of the present application provides an application development method, including:
  • the project file includes at least one sub-project file, and the sub-project file includes at least one code file;
  • a second aspect of the embodiments of the present application provides an application development device, including:
  • a project management unit configured to receive a new request from a user and create a new project file according to the new request, the project file includes at least one sub-project file, and the sub-project file includes at least one code file;
  • the file wizard unit is used to receive a user's selection instruction, obtain a template code file corresponding to the selection instruction from a preset template library, and add the template code file to the newly created project file;
  • the code editing unit is used to receive the user's editing instruction, and perform corresponding editing on the content of the code file in the engineering file according to the editing instruction to obtain the edited engineering file;
  • the compilation unit is used to compile the edited project file to generate an application program.
  • a third aspect of the embodiments of the present application provides an integrated development tool, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program To implement the steps of the method provided in the first aspect of the embodiments of the present application.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium that stores a computer program that is executed by one or more processors to implement the first embodiment of the present application Aspects provide the steps of the method.
  • the embodiment of the present application receives a user's new request and creates a new project file according to the new request; receives a user's selection instruction, obtains a template code file corresponding to the selection instruction from a preset template library, and deletes
  • the template code file is added to the newly created project file; you can select the existing template code file and add the existing template code file to the newly created project file.
  • the developer can directly add the template code file
  • the code is written on the basis of, which effectively improves the efficiency of code writing.
  • FIG. 1 is a schematic diagram of an implementation process of an application development method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of an application development device provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of an integrated development tool provided by an embodiment of the present application.
  • the term “if” may be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context .
  • the phrase “if determined” or “if [described condition or event] is detected” may be interpreted in the context to mean “once determined” or “in response to a determination” or “once detected [described condition or event ]” or “In response to detection of [the described condition or event]”.
  • An application background of the embodiments of the present application is to provide a WMLS (Wireless Mark Languane Script (Wireless Markup Language Script) application IDE (Integrated Development Environment) integrated development tool
  • the integrated development tool includes the following functional modules: project management, file generation wizard, code editor, compiler , Debugger and simulator.
  • project management Use the project management function to manage the information required by the installation package, use the file generation wizard and code editor to assist developers in writing code, use the compiler to compile the project file to generate the installation package, and use the debugger to perform the generated installation package debugging.
  • the specific functions of each part are shown in the following embodiments.
  • FIG. 1 is a schematic diagram of an implementation process of an application development method provided by an embodiment of the present application. As shown in the figure, the method may include the following steps:
  • Step S101 Receive a user's new request and create a new project file according to the new request.
  • the project file includes at least one sub-project file, and the sub-project file includes at least one code file.
  • project file 1 contains code files a, b, c, and d
  • project file 2 contains code files b, c, d, and e. Because the code files b, c, and d appear in the two project files respectively, it is not suitable to divide the code files in the project file 1 and the project file 2 into two folders for storage.
  • project management can be introduced, that is, the code file lists a, b, c, and d are placed in the project file 1, and the code file lists b, c, d, and e are placed in the project file 2.
  • a project file can contain multiple sub-project files, and a sub-project file can contain multiple code files.
  • a large functional module can contain multiple small functional modules.
  • a large function module is represented as a sub-project file X, which can be split into many small function modules respectively represented as sub-project files x1, x2, x3, where the small function module x1 can be in another large function module Z It can also be used as an independent module directly in a project. Then a single sub-project file X can no longer meet the needs, we need to add sub-project files x1, x2, x3, they can be included in the sub-project file X, can also be included in the project file independently. Therefore, sub-project files may exist side by side or may be included in each other.
  • code reuse can be achieved, and the management of code files is facilitated.
  • the creating a new project file according to the new construction request includes:
  • the modification request includes adding a sub-project instruction, modifying a sub-project instruction, and deleting Sub-engineering instructions.
  • users can customize the project file according to their own needs, that is, add, modify or delete the project file. For example, the user can create a basic subproject file and then add the subproject file to the newly created project file; the user can also modify any subproject file in the newly created project file; of course, the user can also delete the project file Any one of the sub-project files in the file will be deleted from the project file after deletion.
  • the project file may contain multiple sub-project files, and a sub-project file may contain multiple code files
  • visualization can be provided Graphical interface, use this graphical interface to display all code files in the project file.
  • all the code files in the project file can be arranged into a tree structure according to their inclusion relationship, and then the tree structure can be displayed to the user through a visual interface.
  • the user needs to update the tree structure accordingly, and display the updated tree structure to the user through the visual interface. In this way, the user can understand the current project file timely and intuitively.
  • Step S102 Receive a user's selection instruction, obtain a template code file corresponding to the selection instruction from a preset template library, and add the template code file to the newly created project file.
  • a template library is provided, and template code files are stored in the template library.
  • templates code files are stored in the template library.
  • users can add, modify or delete template code files to the template library at any time.
  • the user When creating a new code file, the user first creates a new project, then opens the file generation wizard, and opens the template library. The user can select a template code file from the template library (you can rename the template code file) and add the template code file Into the new project.
  • the selection instruction includes the file type.
  • the file types include code file types and non-code file types.
  • the acquiring the template code file corresponding to the selection instruction from a preset template library includes:
  • the file type in the selection instruction is a code file type, determine whether there is a template code file corresponding to the selection instruction in the template library;
  • the file type in the selection instruction is a non-code file type
  • obtain a non-code file corresponding to the selection instruction and use a preset tool to open the non-code file, the preset tool and the non-code
  • the suffix name of the file is associated.
  • an embodiment of the present application provides a configuration file in which the file suffix is bound to the opening tool. Every time you need to open the file with the suffix, you call the bound tool to open it. When creating a new file, create a new empty file, and then open it by calling the binding tool.
  • the user can select a template code file from the template library or write a new code file; if the user selects a non-code file, you need to use it from the location where the non-code file is saved
  • the preset tool opens the non-code file.
  • step S103 the user's editing instruction is received, and the content of the code file in the engineering file is correspondingly edited according to the editing instruction to obtain the edited engineering file.
  • the code files are all text files. The difference is that there are many rules in the code itself. If you don't write according to the rules, it will cause the final compilation to fail and you will not get the installation package. Therefore, you must write the code according to the grammar rules of the code itself.
  • a specific code editor is provided to improve coding efficiency.
  • the code editor has functions such as keyword highlighting, automatic function completion, expansion and contraction of code segments, automatic completion of line breaks, and jump to a specific function definition.
  • the editing the content of the code file in the project file according to the editing instruction includes:
  • the first function is displayed to the user in a drop-down list.
  • the two functions are displayed to the user in a pull-down list. Assuming that the user wants to write main, then simply select the function from the drop-down list; assuming that the user does not want to write these two functions, the user can continue keyboard input. Of course, after the user continues to write, the function newly written by the user can be automatically added to the function list database, that is, as the user writes, the function list database is updated in time to ensure the validity of the function list database.
  • the editing the content of the code file in the project file according to the editing instruction further includes:
  • the target file is opened, and the cursor position is jumped to the position of the second function in the target file, so
  • the target file is a file containing the definition of the second function.
  • the method further includes:
  • the invalid content includes comment content and string reference content.
  • the function name included in the function definition statement is added to the function list database.
  • the code editor in the embodiment of the present application can also provide different contents in the code file to give different display functions.
  • different content refers to a code file that contains comments, string constants, keywords, and code segments.
  • the content of different attributes should be displayed in different fonts, which helps users to read the code.
  • keywords and special characters are placed in the configuration file of the integrated development environment to display the code file
  • the configuration is read from the configuration file and then displayed.
  • the specific implementation method is:
  • this state is set in 2), then no other special characters are matched, only the end special characters of the block comment are matched. If no ending special character is found, the state is retained in the next line until the match is successful, and then the special state is ended.
  • step 6 If it is currently in the code block, then mark the beginning of the code block (counting plus 1), and then as in step 1) so the operation continues to search, during the search process, if the end of the code block is encountered, then cancel the code Block mark (count down by one). Because code blocks can be nested, you may encounter multiple code segment start special characters, and then encounter multiple end characters, so you need to use the code block layer count, each time you encounter a start tag to increase the number of layers, meet An end tag reduces the number of layers by one and then reduces to zero, and officially exits the code segment attribute and returns to no special state.
  • Step S104 Compile the edited project file to generate an application program.
  • a debugger is set on the IDE, which encapsulates the debugging instructions, and sends the debugging instructions to the WMLS script parser of the WMLS application through TCP/IP and other communication methods.
  • the WMLS script parser executes the debugging instructions after receiving the debugging instructions. And return the debugging results to the IDE's debugger.
  • the specific debugging method can have the following steps:
  • Step S41 Before running each operation instruction in the program to be debugged, determine whether the preset pause condition is satisfied.
  • determining whether the preset pause condition is satisfied includes:
  • the preset flag bit is used to indicate that the operation instruction at the code position corresponding to the preset flag bit is suspended.
  • the debugger in the IDE sets a breakpoint during the running of the program to be debugged. Specifically, during the running of the program to be debugged, the script parser obtains the debugger through remote communication with the debugger Pre-set breakpoint information. Therefore, the program to be debugged needs to be started first so that the communication process can start to work. However, the breakpoint in the initial running stage of the program to be debugged may be ignored, then a flag bit needs to be set at the initial position of the program to be debugged (the flag bit indicates that a pause is required). While the program to be debugged is paused at the initial position, the IDE sends all pre-set breakpoint information to the script parser. After all the breakpoint information is sent, the IDE sends a command to complete the initialization, and the script parser starts to run the program to be debugged. And clear the flag bit.
  • the nth operation instruction Before running the nth operation instruction, first determine whether the preset suspension condition is met. If the preset suspension is met, the nth operation instruction is suspended. If the preset suspension condition is not met, the nth operation instruction is directly run. Operation instructions.
  • the judging whether the preset pause condition is satisfied may be judging whether the breakpoint has been set, and specifically includes the following steps:
  • the preset database includes all the breakpoints in the program to be debugged Code location.
  • the user can set a breakpoint during the running of the program to be debugged through the preset debugger.
  • the communication process of the script parser will add new breakpoint information (that is, the breakpoint is in the Add the code location in the program to be debugged to the preset database (the preset database can be the storage space in the script parser or a third-party storage space), or delete the existing breakpoint information in the preset database.
  • the running process of the script parser matches the code position of the current operation instruction with the breakpoint information in the current preset database before running each operation instruction of the program, if there is a code in the preset database that matches the current operation instruction
  • the position-matching breakpoint information indicates that the current operation instruction code position is the breakpoint position, that is, the pause condition is satisfied.
  • the establishing a remote communication connection with the preset debugger includes:
  • the user may also send an interrupt command at any time, and the judgment whether the preset pause condition is met may be an interrupt command sent by the user, which specifically includes the following steps:
  • nth operation instruction when the nth operation instruction is executed and the user's interruption command is not received, it means that the user has not sent the interruption command, and then directly runs the n+1th operation instruction; if the user's interruption command is received, it means that the user has sent If the command is interrupted, the n+1th operation instruction will be suspended.
  • step S42 if the preset pause condition is satisfied, the operation instruction is suspended, and it is monitored whether the debug instruction sent by the preset debugger is received.
  • the communication process of the script parser is responsible for communicating with the preset debugger and monitoring the debugging instructions sent by the debugger; the running process of the script parser is responsible for running the program to be debugged and debugging work.
  • the communication process and the running process work in parallel, so that you can use the IDE debugger to set the breakpoint of the debug program at any time, and send the breakpoint setting information to the script parser through communication.
  • the running process of the script parser can also be updated according to the latest The breakpoint setting scheme performs interrupt processing on the program to be debugged. The two threads work independently without affecting each other.
  • IDE debugger and script parser to communicate the breakpoint information, you can implement remote debugging or cross-platform debugging.
  • users can set breakpoint information on the IDE debugger without writing debugging code directly in the program to be debugged, which simplifies the debugging process and improves debugging efficiency.
  • Step S43 If a debugging instruction sent by a preset debugger is received, the debugging instruction is executed, and the debugging instruction is used to obtain a first debugging result.
  • the debugging instruction is not limited to the running instruction, the query instruction and the jump-in and jump-out instruction, and the debugging instruction may also include other instructions.
  • the first debugging result is a result corresponding to the debugging instruction.
  • the first debugging result may be a certain value, a certain data or information, or a certain execution action.
  • the first debugging result is a running operation instruction
  • the first debugging result is the variable value of the queried operation instruction
  • the debugging instruction is a single-step jump instruction
  • the first debugging result is the calculated position of the next breakpoint.
  • the execution of the debugging instruction includes:
  • debugging instruction is a query instruction, query the variable value in the operation instruction and monitor the next debugging instruction.
  • variable value in the operation instruction is set to the expected value.
  • the preset result refers to the result when the program to be debugged runs normally to the current position.
  • the execution of the debugging instruction is to observe whether the running state of the program meets expectations at a certain position of the program to be debugged. Therefore, the first debugging instruction may also be the running state of the current program.
  • Step S44 after executing the debugging instruction, run the operation instruction, and monitor whether an abnormal result is generated during the operation of the operation instruction.
  • the method further includes:
  • a mark is made at the code position, and the mark is used to indicate that the operation instruction at the code position has been suspended for execution.
  • Step S45 if it is detected that an abnormal result is generated during the operation of the operation instruction, the abnormal result is reported to the preset debugger as a second debugging result.
  • step S101 is repeated, that is, debugging the next operation instruction is continued.
  • the work of reporting abnormal results can be performed by the communication process of the script parser.
  • the integrated development tool in the embodiments of the present application further includes a simulator.
  • the device needs to be resent due to program upgrade, equipment damage, etc.
  • a method for simulating the running of POS applications is needed, that is, the user can customize the emulator of the hardware environment, which can realize the application development without the POS device and can demonstrate the updated applications in time.
  • the simulator may include two parts: a simulation software system and a simulation hardware.
  • the simulation software system is responsible for loading the specified POS application package, executing functions according to the instructions in the package, and simulating the hardware display and printing;
  • the simulation hardware is responsible for simulating the hardware system of the POS device, such as the screen and keyboard. To operate the entire system, just like operating a real device, enter the card number, password, etc.
  • the simulation hardware communicates with the simulation software system, informing the simulation software system of user input, and at the same time calling the simulation screen display and printout according to the function of the simulation software system.
  • the simulation software system can be divided into a script parser and a simulation operating system:
  • Script parser The parser of the POS application program, which parses the application program into function calls, and then calls the corresponding functions.
  • the POS application is compiled by WMLS, so you can use the existing WMLS parser to integrate it into the simulator system.
  • Simulated operating system The operating system that emulates a real device is located in the lower layer of the script parser and provides functions for the script parser to call. At the same time, the simulation operating system is also responsible for communicating with the simulation hardware. In real scenarios, the simulation operating system often needs to install different drivers to use different devices. In this method, the implementation can be simplified, and the hardware can be directly implemented and simulated in the function call Just communicate.
  • the core module of the simulated hardware is the screen, timer and key management. These three are necessary for each POS machine.
  • the relatively important modules are the keyboard, printer, card emulation and serial port. These are some POS applications for certain models Necessary for the program, you can configure the presence or absence of these modules by modifying the configuration file.
  • Other modules such as wired and wireless network connection modules can be solved using the network module of the operating system where the simulator is located.
  • All hardware configuration information is saved in a file, which is saved in the directory where the POS application is located, and is bound to the POS application instead of being placed in the directory where the emulator program is located, so loading POS application A does not Will interfere with the next run of POS application B.
  • the user can start the emulator by double-clicking the application icon or command line. If you double-click the icon, the directory where the target POS application is located is obtained from the configuration file of the directory where the simulator application is located. If the command line is used, the directory where the target POS application is located is obtained from the command line. In the directory where the target POS application is located, obtain the hardware configuration information, and generate the simulated hardware module based on the configuration information, such as the size of the simulated screen, which serial port should be used. After the initialization of the simulated hardware information is completed, the application starts to load the target POS application and runs.
  • the script parser parses the POS application program, calls the corresponding operating system function, and the operating system function calls the simulated hardware interface.
  • the user turns off the emulator.
  • the simulator In the real environment, although the POS machine is related to the operation of the machine, after the shutdown, the device is still real. Therefore, when the simulator is running, it will not be closed because the POS machine application is finished, and it will only wait for the user to close the simulator window to end the operation. At the end of the run, when the user closes the simulator, exit the simulator application.
  • the embodiment of the present application receives a user's new request and creates a new project file according to the new request; receives a user's selection instruction, obtains a template code file corresponding to the selection instruction from a preset template library, and deletes Copy the content of the template code file to the newly created project file; you can select the existing template code file and add the existing template code file to the newly created project file.
  • the developer can directly enter the template Code writing based on the code file effectively improves the efficiency of code writing.
  • Receive the user's editing instruction and edit the content of the code file in the project file according to the editing instruction to obtain the edited project file; compile the edited project file to generate the program installation Developers can add, delete, and modify code files and other editing operations.
  • the flexibility of code editing is increased. Through the above methods, the efficiency of application development is effectively improved.
  • FIG. 2 is a schematic diagram of an application development device provided by an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
  • the application program development device shown in FIG. 2 may be a software unit, a hardware unit, or a combination of software and hardware built into an existing terminal device, or may be integrated into the terminal device as an independent pendant, or It exists as an independent terminal device.
  • the application development device 2 includes:
  • the project management unit 21 is configured to receive a user's new request and create a new project file according to the new request.
  • the project file includes at least one sub-project file, and the sub-project file includes at least one code file.
  • the file wizard unit 22 is configured to receive a user's selection instruction, obtain a template code file corresponding to the selection instruction from a preset template library, and add the template code file to the newly created project file.
  • the code editing unit 23 is configured to receive a user's editing instruction and perform corresponding editing on the content of the code file in the project file according to the editing instruction to obtain the edited project file.
  • the compiling unit 24 is used to compile the edited project file to generate an application program.
  • the project management unit includes:
  • the judgment module is used to judge whether there is a running project file in the current process.
  • the closing module is used to close all code files contained in the running project file if there is a running project file in the current process, and after closing all code files contained in the running project file, according to The new request creates a new project file.
  • the modification module is used to monitor a user's modification request after creating a new project file according to the new request, and make corresponding modifications to the project file according to the modification request.
  • the modification request includes adding sub-project instructions and modification Sub-project instructions and delete sub-project instructions.
  • the display module is used to arrange each sub-project file in the modified project file in a tree structure to obtain a sub-project file list of the project file, and display the sub-project file list to the user through a visual interface .
  • the selection instruction includes the file type.
  • the file types include code file types and non-code file types.
  • the file wizard unit 22 includes:
  • the file judgment module is used to judge whether the template code file corresponding to the selection instruction exists in the template library if the file type in the selection instruction is a code file type.
  • the first obtaining module is configured to obtain the template code file if there is a template code file corresponding to the selection instruction in the template library.
  • a second obtaining module configured to obtain a non-code file corresponding to the selection instruction and open the non-code file using a preset tool if the file type in the selection instruction is a non-code file type Assume that the tool is associated with the suffix name of the non-code file.
  • the code editing unit 23 includes:
  • the first search module is used to obtain the character currently input by the user, and search for the first function matching the character in the preset function list database.
  • the function display module is used to display the first function to the user by using a drop-down list if the first function matching the character is found in the preset function list database.
  • the code editing unit 23 further includes:
  • the third obtaining module is used to obtain the current cursor position of the code file and obtain the function name corresponding to the cursor position.
  • the second search module is used to search for the second function corresponding to the function name in the function list database.
  • a jump module used to open a target file if the second function corresponding to the function name is found in the function list database, and jump the cursor position to the second function in the target file Where the function is located, the target file is a file containing the definition of the second function.
  • the development device 2 further includes:
  • a reading unit used to read the content of each code file in the project file and delete the code file before searching for the first function matching the character in the preset function list database
  • Invalid content the invalid content includes comment content and string reference content.
  • the searching unit is used for searching function definition keywords in the code file after deleting invalid content.
  • the sentence judgment unit is used to judge whether the context of the function definition keyword contains the function definition sentence if the function definition keyword is found.
  • the adding unit is configured to add the function name included in the function definition statement to the function list database if the context of the function definition keyword includes the function definition statement.
  • each functional unit and module is used as an example for illustration.
  • the above-mentioned functions may be allocated by different functional units
  • Module completion means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
  • the functional units and modules in the embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit may use hardware It can also be implemented in the form of software functional units.
  • the specific names of each functional unit and module are only for the purpose of distinguishing each other, and are not used to limit the protection scope of the present application.
  • the integrated development tool 3 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30.
  • the processor 30 executes the computer program 32, the steps in the embodiment of the development method of each program installation package described above are implemented, for example, steps S101 to S104 shown in FIG. 1.
  • the processor 30 executes the computer program 32, the functions of each module/unit in the foregoing device embodiments are realized, for example, the functions of the modules 21 to 24 shown in FIG. 2.
  • the computer program 32 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 31 and executed by the processor 30 to complete This application.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the integrated development tool 3.
  • the computer program 32 may be divided into a project management unit, a file guidance unit, a code editing unit, and a compilation unit. The specific functions of each unit are as follows:
  • the project management unit is configured to receive a new request from a user and create a new project file according to the new request.
  • the project file includes at least one sub-project file, and the sub-project file includes at least one code file.
  • the file wizard unit is used to receive a user's selection instruction, obtain a template code file corresponding to the selection instruction from a preset template library, and add the template code file to the newly created project file.
  • the code editing unit is used to receive the user's editing instruction and perform corresponding editing on the content of the code file in the project file according to the editing instruction to obtain the edited project file.
  • the compilation unit is used to compile the edited project file to generate an application program.
  • the project management unit includes:
  • the judgment module is used to judge whether there is a running project file in the current process.
  • the closing module is used to close all code files contained in the running project file if there is a running project file in the current process, and after closing all code files contained in the running project file, according to The new request creates a new project file.
  • the modification module is used to monitor a user's modification request after creating a new project file according to the new request, and make corresponding modifications to the project file according to the modification request.
  • the modification request includes adding sub-project instructions and modification Sub-project instructions and delete sub-project instructions.
  • the display module is used to arrange each sub-project file in the modified project file in a tree structure to obtain a sub-project file list of the project file, and display the sub-project file list to the user through a visual interface .
  • the selection instruction includes the file type.
  • the file types include code file types and non-code file types.
  • the file wizard unit includes:
  • the file judgment module is used to judge whether the template code file corresponding to the selection instruction exists in the template library if the file type in the selection instruction is a code file type.
  • the first obtaining module is configured to obtain the template code file if there is a template code file corresponding to the selection instruction in the template library.
  • a second obtaining module configured to obtain a non-code file corresponding to the selection instruction and open the non-code file using a preset tool if the file type in the selection instruction is a non-code file type Assume that the tool is associated with the suffix name of the non-code file.
  • the code editing unit includes:
  • the first search module is used to obtain the character currently input by the user, and search for the first function matching the character in the preset function list database.
  • the function display module is used to display the first function to the user by using a drop-down list if the first function matching the character is found in the preset function list database.
  • the code editing unit further includes:
  • the third obtaining module is used to obtain the current cursor position and obtain the function name corresponding to the cursor position.
  • the second search module is used to search for the second function corresponding to the function name in the function list database.
  • a jump module used to open a target file if the second function corresponding to the function name is found in the function list database, and jump the cursor position to the second function in the target file Where the function is located, the target file is a file containing the definition of the second function.
  • the computer program further includes:
  • a reading unit used to read the content of each code file in the project file and delete the code file before searching for the first function matching the character in the preset function list database
  • Invalid content the invalid content includes comment content and string reference content.
  • the searching unit is used for searching function definition keywords in the code file after deleting invalid content.
  • the sentence judgment unit is used to judge whether the context of the function definition keyword contains the function definition sentence if the function definition keyword is found.
  • the adding unit is configured to add the function name included in the function definition statement to the function list database if the context of the function definition keyword includes the function definition statement.
  • the integrated development tool 3 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server.
  • the integrated development tool may include, but is not limited to, the processor 30 and the memory 31.
  • FIG. 3 is only an example of the integrated development tool 3 and does not constitute a limitation on the integrated development tool 3, and may include more or less components than the illustration, or a combination of certain components, or different
  • the components, for example, the integrated development tool may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 30 may be a central processing unit (Central Processing Unit (CPU), can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 31 may be an internal storage unit of the integrated development tool 3, such as a hard disk or a memory of the integrated development tool 3.
  • the memory 31 may also be an external storage device of the integrated development tool 3, for example, a plug-in hard disk equipped on the integrated development tool 3, a smart memory card (Smart Media Card, SMC), or secure digital (Secure Digital, SD) card, flash memory card (Flash Card) etc.
  • the memory 31 may also include both an internal storage unit of the integrated development tool 3 and an external storage device.
  • the memory 31 is used to store the computer program and other programs and data required by the integrated development tool.
  • the memory 31 can also be used to temporarily store data that has been or will be output.
  • the disclosed device/integrated development tool and method may be implemented in other ways.
  • the device/integrated development tool embodiments described above are only schematic.
  • the division of the module or unit is only a logical function division, and in actual implementation, there may be additional division methods, such as multiple Units or components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the present application can implement all or part of the processes in the methods of the above embodiments, or it can be completed by a computer program instructing related hardware.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form, etc.
  • the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals and software distribution media, etc.

Landscapes

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

Abstract

适用于软件技术领域,提供了一种应用程序的开发方法、装置及集成开发工具,包括:接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件(S101);接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中(S102);接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件(S103);对所述编辑后的工程文件进行编译,生成应用程序(S104)。通过上述方法,能够有效提高应用程序的开发效率。

Description

一种应用程序的开发方法、装置及集成开发工具 技术领域
本申请涉及软件技术领域,尤其涉及一种应用程序的开发方法、装置及集成开发工具。
背景技术
一个应用程序对应一个工程文件,工程文件中可能包含多个子工程文件,每个子工程文件又可能包含多个代码文件,代码文件中还可能需要调用多个函数文件。
现有技术中,通常是由开发人员逐一编写工程文件中的代码文件,再对工程文件中包含的每个代码文件进行手动编译。现有的应用程序的开发方式,开发人员的工作量较大,导致人工开发应用程序的效率较低。
技术问题
有鉴于此,本申请实施例提供了一种应用程序的开发方法、装置及集成开发工具,以解决现有技术中应用程序的开发效率较低的问题。
技术解决方案
本申请实施例的第一方面提供了一种应用程序的开发方法,包括:
接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件;
接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中;
接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件;
对所述编辑后的工程文件进行编译,生成应用程序。
本申请实施例的第二方面提供了一种应用程序的开发装置,包括:
工程管理单元,用于接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件;
文件向导单元,用于接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中;
代码编辑单元,用于接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件;
编译单元,用于对所述编辑后的工程文件进行编译,生成应用程序。
本申请实施例的第三方面提供了一种集成开发工具,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本申请实施例第一方面提供的所述方法的步骤。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被一个或多个处理器执行时实现本申请实施例第一方面提供的所述方法的步骤。
有益效果
本申请实施例与现有技术相比存在的有益效果是:
本申请实施例通过接收用户的新建请求,并根据所述新建请求新建一个工程文件;接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中;可以选择现有的模板代码文件,将现有的模板代码文件添加到新建的工程文件中,通过上述方法,开发人员可以直接在模板代码文件的基础上进行代码编写,有效提高了代码编写的效率。接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件;对所述编辑后的工程文件进行编译,生成应用程序;开发人员可以对代码文件进行添加、删除和修改等编辑操作,在提高代码编辑效率的基础上,增加了代码编辑的灵活性。通过上述方法,有效提高了应用程序的开发效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的应用程序的开发方法的实现流程示意图;
图2是本申请实施例提供的应用程序的开发装置的示意图;
图3是本申请实施例提供的集成开发工具的示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
本申请实施例的一个应用背景是,提供了一款用于开发WMLS(Wireless Mark Languane Script,无线标记语言脚本)应用程序的IDE(Integrated Development Environment,集成开发环境)集成开发工具,该集成开发工具包括以下几个功能模块:工程管理、文件生成向导、代码编辑器、编译器、调试器和模拟器。利用工程管理功能来管理安装包所需要的信息,利用文件生成向导和代码编辑器来辅助开发人员进行代码编写,利用编译器对工程文件进行编译生成安装包,利用调试器对生成的安装包进行调试。各部分的具体功能如下实施例所示。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1是本申请实施例提供的应用程序的开发方法的实现流程示意图,如图所示,所述方法可以包括以下步骤:
步骤S101,接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件。
在实际应用中,一个文件夹下可能有很多代码文件,例如工程文件1中包含代码文件a、b、c、d,工程文件2中包含代码文件b、c、d、e。因为代码文件b、c、d分别出现在了两个工程文件中,所以不适合将工程文件1和工程文件2中的代码文件分成两个文件夹存放。这时,可以引入工程管理,即将代码文件列表a、b、c、d放到工程文件1中,将代码文件列表b、c、d、e放到工程文件2中。
进一步的,假如代码文件b、c、d都是为了实现同一个功能模块X,那么当该功能模块需要修改时,工程文件1和工程文件2都需要做相应的修改。如果操作频繁且修改的代码文件数量太多,可能会导致工程文件中的文件列表不准确。这时,可以引入子工程文件,即将代码文件b、c、d都放入到子工程文件X中,然后工程文件1和工程文件2均可以包含该子工程文件X。如果需要修改代码文件b、c、d,只需要修改子工程文件X即可。一个工程文件中可以包含多个子工程文件,而一个子工程文件中可以包含多个代码文件。
另外,一个大的功能模块可以包含多个小的功能模块。例如,一个大的功能模块表示为子工程文件X,可以被拆分成很多小功能模块分别表示为子工程文件x1,x2,x3,其中小功能模块x1又可以在另外一个大功能模块Z中使用,也可以直接在某个工程中单独作为一个独立的模块存在。那么单纯的一个子工程文件X已经无法满足需求,我们再需要添加子工程文件x1,x2,x3,他们既可以被包含在子工程文件X中,也可以独立的被包含在工程文件中。所以,子工程文件之间可以是并列存在的,也可以是互相包含的。
利用工程管理功能,可以实现代码的复用,且便于代码文件的管理。
在一个实施例中,所述根据所述新建请求新建一个工程文件,包括:
判断当前进程中是否存在正在运行的工程文件。
若当前进程中存在正在运行的工程文件,则关闭所述正在运行的工程文件包含的所有代码文件,并在关闭了所述正在运行的工程文件包含的所有代码文件之后,根据所述新建请求新建一个工程文件。
在根据所述新建请求新建一个工程文件之后,监测用户的修改请求,并根据所述修改请求对所述工程文件进行相应的修改,所述修改请求包括添加子工程指令、修改子工程指令和删除子工程指令。
将修改后的工程文件中的各个子工程文件按照树形结构进行排列,得到所述工程文件的子工程文件列表,并将所述子工程文件列表通过可视界面显示给用户。
在实际应用中,在工程文件A已经打开的情况下,要想打开工程文件B,需要先关闭工程文件A,再去打开工程文件B。关闭工程文件A时,如果中间有一个步骤用户取消关闭,那么工程文件A仍然处于打开状态,取消工程文件B的打开(即关闭时用户取消,则停止关闭)。已经关闭的文件不重新打开。另外,关闭一个工程文件,需要关闭属于这个工程文件的所有文件,包括这个工程文件中的所有代码文件和非代码文件。
新建了工程文件之后,用户可以根据自己的需求对工程文件进行定制,即可以对工程文件进行添加、修改或删除。例如,用户可以建立一个基础的子工程文件,然后将该子工程文件加入到新建的工程文件中;用户还可以修改新建的工程文件中的任意一个子工程文件;当然,用户也可以删除工程文件中的任意一个子工程文件,删除之后,即将该子工程文件从工程文件中移除。
因为工程文件可能包含多个子工程文件,一个子工程文件又可能包含多个代码文件,无法通过记事本等工具直观地查看一个工程文件中包含的所有代码文件,所以在实际应用中,可以提供可视化图形界面,利用该图形界面展示工程文件中的所有代码文件。具体的,可以将工程文件中的所有代码文件按照它们之间的包含关系,排列成树形结构,让后将该树形结构通过可视化界面显示给用户。当然,在用户每次修改工程文件之后,都需要对该树形结构进行相应的更新,并将更新后的树形结构通过可视化界面显示给用户。这样,可以使用户能够及时、直观地了解当前的工程文件。
步骤S102,接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中。
在开发人员实际编码过程中,很多代码文件中有相当大一部分的内容是一致的,所以在开发过程中增加了代码开发的工作量,降低开发效率。为了解决这个问题,在本申请实施例中,提供了一个模板库,模板库中存储有模板代码文件。当然,用户可以随时向模板库中添加、修改或删除模板代码文件。用户在新建代码文件时,先新建工程,然后打开文件生成向导,打开模板库,用户可以从模板库中选择一个模板代码文件(可以给该模板代码文件重命名),并将该模板代码文件添加到新建工程中。
其中,所述选择指令包括文件类型。所述文件类型包括代码文件类型和非代码文件类型。
在一个工程文件中,并不是全是代码文件,还有很多资源文件,这些资源文件统称为非代码文件。
在一个实施例中,所述从预设的模板库中获取与所述选择指令对应的模板代码文件,包括:
若所述选择指令中的文件类型为代码文件类型,则判断所述模板库中是否存在与所述选择指令对应的模板代码文件;
如果所述模板库中存在与所述选择指令对应的模板代码文件,则获取所述模板代码文件;
若所述选择指令中的文件类型为非代码文件类型,则获取与所述选择指令对应的非代码文件,并利用预设工具打开所述非代码文件,所述预设工具与所述非代码文件的后缀名相关联。
在开发过程中,有些非代码文件,它们有些可以在文本编辑器中编辑,有些则不行,但有他们一个共同的特性,如果用其他工具打开编辑的话,会更加简单。
为了解决这个问题,本申请实施例中提供一个配置文件,在该配置文件中,将文件后缀和打开工具绑定。每次需要打开该后缀的文件时,都调用绑定的工具打开。新建文件时,新建一个空文件,然后在调用绑定工具打开。
换句话说,如果用户选择的是代码文件,那么用户可以从模板库中选择模板代码文件或编写新的代码文件;如果用户选择的是非代码文件,则需要从保存该非代码文件的位置处利用预设工具打开该非代码文件。
步骤S103,接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件。
代码文件都是文本文件,不同的是代码本身有很多规则在里面,不按照规则写的话,会导致最后编译失败,得不到安装包,因此一定要按照代码本身的语法规则来写代码。在步骤S103实施例中,提供特定的代码编辑器来提升编码效率。该代码编辑器具有关键字高亮、函数自动补全、扩展收缩代码段、换行时自动补齐以及跳转到特定的函数定义等功能。
在开发人员编码的过程中,是不可能记住所有的变量以及函数名称,并且也不可能记住变量以及函数所在代码行数,但是这两个元素是编程过程中最重要的两个元素。为了帮助开发人员更好的使用这两个元素,本申请实施例提供了自动补全以及跳转到定义功能。
其中,函数自动补全功能如下实施例所示。在一个实施例中,所述根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,包括:
获取用户当前输入的字符,并在预设的函数列表数据库中查找与所述字符相匹配的第一函数。
若在预设的函数列表数据库中查找到与所述字符相匹配的第一函数,则用下拉列表的方式将所述第一函数显示给用户。
示例性的,假设用户当前输入的字符为ma,函数列表数据库中与ma匹配的第一函数有main、max,则将这两个函数以下拉列表的方式显示给用户。假设用户想要编写的是main,那么直接从下拉列表中选择该函数即可;假设用户想要编写的不是这两个函数,用户可以继续键盘输入。当然,用户继续编写之后,可以自动地将用户新编写的函数添加到函数列表数据库中,即随着用户的编写,及时对函数列表数据库进行更新,以保证函数列表数据库的有效性。
跳转到函数定义的功能如下实施例所示。在一个实施例中,所述根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,还包括:
获取所述代码文件当前的光标位置,并获取所述光标位置对应的函数名称。
在所述函数列表数据库中查找与所述函数名称对应的第二函数。
若在所述函数列表数据库中查找到与所述函数名称对应的第二函数,则打开目标文件,并将所述光标位置跳转到所述目标文件中所述第二函数所在的位置,所述目标文件为包含所述第二函数的定义的文件。
当然,要实现上述函数自动补全功能和跳转到函数定义功能,需要的前提条件是创建一个函数列表数据库。基于该函数列表数据库,才能有效实现上述两个功能。创建函数列表数据库的方法如下实施例所示。
在一个实施例中,所述方法还包括:
读取所述工程文件中各个代码文件的内容,并删除所述代码文件中的无效内容,所述无效内容包括注释内容和字符串引用内容。
在删除无效内容后的代码文件中,查找函数定义关键字。
若查找到函数定义关键字,则判断所述函数定义关键字的上下文是否包含函数定义语句。
若所述函数定义关键字的上下文包含函数定义语句,则将所述函数定义语句中包含的函数名称添加到所述函数列表数据库中。
除了上述功能,本申请实施例中的代码编辑器还可以提供代码文件中的不同内容给予不同显示的功能。其中,不同的内容是指一个代码文件中,包含注释、字符串常量、关键字以及代码段。不同属性的内容,要给予不同的字体显示,这样有助于帮助用户阅读代码。
在目前主流的编程语言中,虽然各自的关键字以及各自的语法都不一样,但也有不少相同的地方,比如大部分编程语言都支持注释,都用大括号”{“,”}”来表示代码块,同时各种语言本身也在不断发展。
为了支持尽可能多的语言,同时也为了让语言发生变化后,不用重新修改代码编辑器的实现,本申请实施例中将关键字以及特殊字符放入集成开发环境的配置文件中,显示代码文件时从配置文件中读取配置,然后开始显示。
具体的实现方法为:
1. 逐行读取文件,将每一行的内容从头到尾和预设的关键字以及特殊字符匹配,匹配成功后在该位置加以标记,标明当前处于什么状态。根据当前的状态来查找关键字以及特殊字符的步骤如下:
1)如果当前行文本内容没有任何属性,那么开始查找匹配关键字,以及特殊字符(比如块注释的开始特殊字符,以及代码块的开始特殊字符)。如果当前行没有任何匹配,那么转入下一行,继续查找。如果当前行匹配成功关键字,那么对关键字加以标注,然后继续查找。
2)在上述查找中,如果匹配到的是块注释,行注释,代码块等的开始特殊字符,那么除了对匹配到的内容加以标记外,对后续的内容也加以标记,标明当前处于块注释,或者行注释或者代码块等特殊状态中。
3)如果当前处于块注释中(该状态在2)中设置),那么不在匹配其它特殊字符,只匹配块注释的结束特殊字符。如果没有查找到结束特殊字符,那么该状态保留到下一行中,直到匹配成功,然后结束该特殊状态。
4)如果当前处于字符串常量中,那么处理逻辑和3)类似,向后查找字符串结束特殊字符,直到结束该特殊状态。
5)如果当前行注释中,那么将该行的后续内容标记成注释,然后转入到下一行,该特殊状态消失。
6)如果当前在代码块中,那么对代码块开始的地方加以标记(计数加1),然后如步骤1)所以操作继续查找,查找过程中,如果碰到代码块的结束标记,那么取消代码块标记(计数减一)。因为代码块可以嵌套,所以可能碰到多个代码段开始特殊字符,接着碰到多个结束字符,因此需要使用代码块层数计数,每碰到一个开始标记将层数加一,碰到一个结束标记,将层数减一,减到零后,正式退出代码段属性,回到无特殊状态。
2. 标记完成后,根据标记的内容属性,在编辑器中使用用户配置的字体,加以显示。
3. 当用户修改代码文件时,对修改的行重新解析,重新加以标记。注意:部分标记会影响到后续内容的解析(比如块注释标记),如果出现这种情况,那么也需要对后续行重新解析加以标记。
步骤S104,对所述编辑后的工程文件进行编译,生成应用程序。
在实际应用中,生成应用程序之后,还需要对应用程序进行调试。IDE上设置有一个调试器,在调试器中封装调试指令,通过TCP/IP等通信方式将调试指令发送到WMLS应用的WMLS脚本解析器中,WMLS脚本解析器接收到调试指令后执行该调试指令,并将调试结果返回给IDE的调试器。
具体的调试方法可以有如下步骤:
步骤S41,在运行待调试程序中的每一条操作指令之前,判断是否满足预设的暂停条件。
在一个实施例中,所述在运行待调试程序中的每一条操作指令之前,判断是否满足预设的暂停条件,包括:
在运行所述待调试程序中的第一条操作指令之前,判断是否存在预设标志位,所述预设标志位用于表示暂停运行所述预设标志位对应的代码位置处的操作指令。
若存在预设标志位,则暂停运行所述待调试程序中的第一条操作指令,并与所述预设调试器建立远程通信连接,接收所述预设调试器发送的预设断点信息。
在接收到所有的预设断点信息后,将所述预设断点信息存储到预设数据库中。
清除所述预设标志位,并判断是否满足预设的暂停条件。
在实际应用中,IDE中的调试器是在待调试程序运行的过程中设置断点,具体的,是在待调试程序的运行过程中,脚本解析器通过与调试器进行远程通信来获取调试器中预先设置的断点信息。因此需要先启动待调试的程序,这样通信进程才能开始工作。但是在待调试程序的初始运行阶段的断点可能被忽略,那么就需要在待调试程序的初始位置设置一个标志位(该标志位表示需要暂停)。待调试程序在初始位置暂停的同时,IDE向脚本解析器发送所有预先设置的断点信息,当所有断点信息发送完毕后,IDE发送一个初始化完成的命令,脚本解析器开始运行待调试程序,并将该标志位清除。
在运行第n条操作指令之前,先判断是否满足预设的暂停条件,如果满足预设的暂停,则暂停运行第n条操作指令,如果不满足预设的暂停条件,则直接运行第n条操作指令。
如何判断是否满足预设的暂停条件,可以有两种方法,一种是匹配预设数据库中已设置的断点,另一种是用户发送中断指令。具体步骤如下所示。
在一个实施例中,所述判断是否满足预设的暂停条件,可以是判断是否匹配已设置的断点,具体包括以下步骤:
获取当前的操作指令在所述待调试程序中的代码位置,并判断预设数据库中是否存在与所述代码位置匹配的信息,所述预设数据库包括所述待调试程序中的所有断点的代码位置。
若预设数据库中存在与所述代码位置匹配的信息,则判定满足预设的暂停条件。
在实际应用中,用户可以通过预设调试器在待调试程序运行的过程中设置断点,脚本解析器的通信进程根据预设调试器的设置断点指令将新增断点信息(即断点在待调试程序中的代码位置)添加到预设数据库(预设数据库可以是脚本解析器中的存储空间,也可以是第三方存储空间),或将预设数据库中已有的断点信息删除。脚本解析器的运行进程在运行程序的每个操作指令之前,将当前的操作指令的代码位置与目前预设数据库中的断点信息进行匹配,若预设数据库中存在与当前的操作指令的代码位置匹配的断点信息,说明当前的操作指令的代码位置为断点位置,即满足暂停条件。
在一个实施例中,所述与所述预设调试器建立远程通信连接,包括:
基于传输控制协议与所述预设调试器建立远程通信连接。
当然,在实际应用中,除了基于传输控制协议于预设调试器建立远程通信连接之外,还可以有其他的方式于预设调试器建立远程通信连接,如串口通信等。
在一个实施例中,用户也可以随时发送中断命令,所述判断是否满足预设的暂停条件,可以是用户发送的中断指令,具体包括以下步骤:
在运行上一条操作指令后,检测是否接收到中断命令。
若在运行上一条操作指令后,接收到中断命令,则判定满足预设的暂停条件。
例如,当执行第n条操作指令后,未接收到用户的中断命令,则说明用户未发送中断命令,则直接运行第n+1条操作指令;若接收到用户的中断命令,则说明发送了中断命令,则暂停运行第n+1条操作指令。
步骤S42,若满足预设的暂停条件,则暂停运行所述操作指令,并监测是否接收到预设调试器发送的调试指令。
在暂停运行操作指令后,始终保持与IDE的调试器的远程通信,监测调试器发送的调试指令。
脚本解析器的通信进程负责与预设调试器进行通信,监测调试器发送的调试指令;脚本解析器的运行进程负责运行待调试程序和调试工作。通信进程和运行进程并行工作,这样,可以随时利用IDE调试器对待调试程序进行断点设置,并通过通信进行将断点设置信息发送给脚本解析器,脚本解析器的运行进程也可以随时根据最新的断点设置方案对待调试的程序进行中断处理。两个线程各自工作,互不影响。利用IDE调试器与脚本解析器通信的方式传递断点信息,可以实现远程调试,也可以是实现跨平台调试。另外,用户可以在IDE调试器上设置断点信息,而无需直接在待调试程序中编写调试代码,简化了调试过程,提高了调试效率。
步骤S43,若接收到预设调试器发送的调试指令,则执行所述调试指令,所述调试指令用于获得第一调试结果。
调试指令不限于运行指令、查询指令和跳入跳出指令,调试指令还可以包括其他的指令。第一调试结果是与调试指令对应的结果,第一调试结果可以是某个值、某个数据或信息,也可以是某个执行动作。
例如,当调试指令为单步运行指令时,第一调试结果为运行操作指令;当调试指令为查询指令时,第一调试结果为查询到的操作指令的变量值;当调试指令为单步跳入指令或单步跳出指令时,第一调试结果为计算出的下一个断点的位置。
在一个实施例中,所述执行所述调试指令,包括:
S431,若所述调试指令为单步运行指令,则运行所述操作指令。
S432,若所述调试指令为查询指令,则查询所述操作指令中的变量值,并监测下一个调试指令。
在一个实施例中,所述查询所述操作指令中的变量值之后,包括:
判断所述待调试程序当前的运行结果是否符合预设结果。
若所述待调试程序当前的运行结果不符合预设结果,则将所述操作指令中的变量值设置为预期值。
可以根据局部变量在内存中的位置来查找局部变量,然后通过WMLS脚本解析器自带的函数接口进行查询或设置。对于全局变量,可以直接使用WMLS脚本解析器自带的函数接口进行查询或设置。
当待调试程序当前的运行结果不符合预设结果时,可以临时改变变量值,再查看相应的运行结果。其中,预期值可以由用户输入。预设结果是指当待调试程序正常运行到当前位置时的结果。
S433,若所述调试指令为单步跳入指令或单步跳出指令,则计算下一个断点的代码位置,并将该代码位置存储到所述预设数据库中。
执行调试指令是为了在待调试程序的某个位置,观察程序的运行状态是否符合预期,因此,第一调试指令也可以是当前程序的运行状态。
步骤S44,在执行所述调试指令之后,运行所述操作指令,并监测运行所述操作指令的过程中是否产生异常结果。
在一个实施例中,在执行所述调试指令之后,还包括:
在所述代码位置处进行标记,所述标记用于表示所述代码位置处的操作指令已经被执行暂停。
步骤S45,若监测到运行所述操作指令的过程中产生异常结果,则将所述异常结果作为第二调试结果上报给所述预设调试器。
若运行操作指令的过程中产生异常结果,则捕获异常结果,并将异常结果上报给IDE。若无异常,则重复步骤S101,即继续调试下一条操作指令。
为了不影响程序的运行,上报异常结果的工作可以由脚本解析器的通信进程执行。
在实际应用中,本申请实施例中的集成开发工具还包括模拟器。
示例性的,在开发POS机应用程序的过程中,经常出现设备没有就位的情况。比如:
1.由于程序升级,设备损坏等原因需要重新发送设备;
2.针对新机型需要新开发程序,然而新机型尚未完成。
在演示POS机应用程序时,如果该应用程序只能运行在POS上的话,那么不利于所有开发人员的沟通交流,以及对应用程序开发调试,降低工作效率。
因此,需要一个模拟运行POS应用程序的方法,即用户可以自定义硬件环境的模拟器,能实现在没有POS设备的情况下也能进行应用程序的开发,并能及时演示已更新的应用程序。
在一个实施例中,模拟器可以包括两个部分:模拟软件系统和模拟硬件。其中,模拟软件系统负责加载指定的POS应用程序包,根据程序包里的指令执行函数,命令模拟硬件显示以及打印;模拟硬件负责模拟POS设备的硬件系统,如屏幕,键盘等,用户通过模拟硬件来操作整个系统,如同操作真实设备一样,输入卡号,密码等。模拟硬件和模拟软件系统通信,告知模拟软件系统用户的输入,同时根据模拟软件系统的函数调用模拟屏幕显示以及打印输出。
模拟软件系统可分为脚本解析器和模拟操作系统:
1. 脚本解析器:POS应用程序的解析器,将应用程序解析成一个个的函数调用,然后调用对应的函数。POS应用程序由WMLS编译而成,所以可以利用现有WMLS的解析器,将其集成到模拟器系统中。
2. 模拟操作系统:仿真真实设备的操作系统,位于脚本解析器的下层,提供函数给脚本解析器调用。同时,模拟操作系统还负责和模拟硬件通信,在真实场景中,模拟操作系统往往需要安装不同的驱动来使用不同的设备,在该方法中,可以简化实现,在函数调用中直接实现和模拟硬件通信即可。
模拟硬件的核心模块为屏幕、定时器和秘钥管理,这三个为每个POS机必备,相对重要的模块为键盘、打印机、刷卡模拟和串口,这几个为某些型号的POS应用程序所必需的,可以通过修改配置文件的方式来配置有没有这些模块。其它模块比如有线、无线网络连接模块,可以利用模拟器所在的操作系统的网络模块解决。
所有的硬件配置信息,都保存在一个文件中,该文件保存在POS应用程序所在的目录下,和POS应用程序绑定,而不是放到模拟器程序所在的目录,这样加载POS应用程序A不会干扰下次运行POS应用程序B。
在模拟器启动时,用户可以通过双击应用程序图标或者命令行的方式启动模拟器。如果通过双击图标的方式,那么从模拟器应用程序所在目录的配置文件中,获取目标POS应用程序所在目录。如果通过命令行,那么从命令行中获取目标POS应用程序所在目录。在目标POS应用程序所在目录下,获取硬件配置信息,根据配置信息来初始化生成模拟硬件模块,如模拟屏幕大小,该使用哪个串口。完成模拟硬件信息的初始化后,应用程序开始加载目标POS应用程序,并运行。运行过程中,脚本解析器解析POS应用程序,调用对应的操作系统函数,操作系统函数调用模拟硬件接口。用户关闭模拟器,在真实环境中,虽然POS机有关机操作,但关机后,设备也仍然是真实存在的。因此模拟器运行时,并不会因为POS机应用程序运行结束而关闭,永远只会等待用户关闭模拟器窗口来结束运行。运行结束,当用户关闭模拟器时,退出模拟器应用程序。
本申请实施例通过接收用户的新建请求,并根据所述新建请求新建一个工程文件;接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件的内容复制到新建的所述工程文件中;可以选择现有的模板代码文件,将现有的模板代码文件添加到新建的工程文件中,通过上述方法,开发人员可以直接在模板代码文件的基础上进行代码编写,有效提高了代码编写的效率。接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件;对所述编辑后的工程文件进行编译,生成程序安装包;开发人员可以对代码文件进行添加、删除和修改等编辑操作,在提高代码编辑效率的基础上,增加了代码编辑的灵活性。通过上述方法,有效提高了应用程序的开发效率。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图2是本申请实施例提供的应用程序的开发装置的示意图,为了便于说明,仅示出与本申请实施例相关的部分。
图2所示的应用程序的开发装置可以是内置于现有的终端设备内的软件单元、硬件单元、或软硬结合的单元,也可以作为独立的挂件集成到所述终端设备中,还可以作为独立的终端设备存在。
所述应用程序的开发装置2包括:
工程管理单元21,用于接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件。
文件向导单元22,用于接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中。
代码编辑单元23,用于接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件。
编译单元24,用于对所述编辑后的工程文件进行编译,生成应用程序。
可选的,所述工程管理单元包括:
判断模块,用于判断当前进程中是否存在正在运行的工程文件。
关闭模块,用于若当前进程中存在正在运行的工程文件,则关闭所述正在运行的工程文件包含的所有代码文件,并在关闭了所述正在运行的工程文件包含的所有代码文件之后,根据所述新建请求新建一个工程文件。
修改模块,用于在根据所述新建请求新建一个工程文件之后,监测用户的修改请求,并根据所述修改请求对所述工程文件进行相应的修改,所述修改请求包括添加子工程指令、修改子工程指令和删除子工程指令。
显示模块,用于将修改后的工程文件中的各个子工程文件按照树形结构进行排列,得到所述工程文件的子工程文件列表,并将所述子工程文件列表通过可视界面显示给用户。
可选的,所述选择指令包括文件类型。
所述文件类型包括代码文件类型和非代码文件类型。
可选的,所述文件向导单元22包括:
文件判断模块,用于若所述选择指令中的文件类型为代码文件类型,则判断所述模板库中是否存在与所述选择指令对应的模板代码文件。
第一获取模块,用于如果所述模板库中存在与所述选择指令对应的模板代码文件,则获取所述模板代码文件。
第二获取模块,用于若所述选择指令中的文件类型为非代码文件类型,则获取与所述选择指令对应的非代码文件,并利用预设工具打开所述非代码文件,所述预设工具与所述非代码文件的后缀名相关联。
可选的,所述代码编辑单元23包括:
第一查找模块,用于获取用户当前输入的字符,并在预设的函数列表数据库中查找与所述字符相匹配的第一函数。
函数显示模块,用于若在预设的函数列表数据库中查找到与所述字符相匹配的第一函数,则用下拉列表的方式将所述第一函数显示给用户。
可选的,所述代码编辑单元23还包括:
第三获取模块,用于获取所述代码文件当前的光标位置,并获取所述光标位置对应的函数名称。
第二查找模块,用于在所述函数列表数据库中查找与所述函数名称对应的第二函数。
跳转模块,用于若在所述函数列表数据库中查找到与所述函数名称对应的第二函数,则打开目标文件,并将所述光标位置跳转到所述目标文件中所述第二函数所在的位置,所述目标文件为包含所述第二函数的定义的文件。
可选的,所述开发装置2还包括:
读取单元,用于在所述在预设的函数列表数据库中查找与所述字符相匹配的第一函数之前,读取所述工程文件中各个代码文件的内容,并删除所述代码文件中的无效内容,所述无效内容包括注释内容和字符串引用内容。
查找单元,用于在删除无效内容后的代码文件中,查找函数定义关键字。
语句判断单元,用于若查找到函数定义关键字,则判断所述函数定义关键字的上下文是否包含函数定义语句。
添加单元,用于若所述函数定义关键字的上下文包含函数定义语句,则将所述函数定义语句中包含的函数名称添加到所述函数列表数据库中。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
图3是本申请实施例提供的集成开发工具的示意图。如图3所示,该实施例的集成开发工具3包括:处理器30、存储器31以及存储在所述存储器31中并可在所述处理器30上运行的计算机程序32。所述处理器30执行所述计算机程序32时实现上述各个程序安装包的开发方法实施例中的步骤,例如图1所示的步骤S101至S104。或者,所述处理器30执行所述计算机程序32时实现上述各装置实施例中各模块/单元的功能,例如图2所示模块21至24的功能。
示例性的,所述计算机程序32可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器31中,并由所述处理器30执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序32在所述集成开发工具3中的执行过程。例如,所述计算机程序32可以被分割成工程管理单元、文件向导单元、代码编辑单元、编译单元,各单元具体功能如下:
工程管理单元,用于接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件。
文件向导单元,用于接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中。
代码编辑单元,用于接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件。
编译单元,用于对所述编辑后的工程文件进行编译,生成应用程序。
可选的,所述工程管理单元包括:
判断模块,用于判断当前进程中是否存在正在运行的工程文件。
关闭模块,用于若当前进程中存在正在运行的工程文件,则关闭所述正在运行的工程文件包含的所有代码文件,并在关闭了所述正在运行的工程文件包含的所有代码文件之后,根据所述新建请求新建一个工程文件。
修改模块,用于在根据所述新建请求新建一个工程文件之后,监测用户的修改请求,并根据所述修改请求对所述工程文件进行相应的修改,所述修改请求包括添加子工程指令、修改子工程指令和删除子工程指令。
显示模块,用于将修改后的工程文件中的各个子工程文件按照树形结构进行排列,得到所述工程文件的子工程文件列表,并将所述子工程文件列表通过可视界面显示给用户。
可选的,所述选择指令包括文件类型。
所述文件类型包括代码文件类型和非代码文件类型。
可选的,所述文件向导单元包括:
文件判断模块,用于若所述选择指令中的文件类型为代码文件类型,则判断所述模板库中是否存在与所述选择指令对应的模板代码文件。
第一获取模块,用于如果所述模板库中存在与所述选择指令对应的模板代码文件,则获取所述模板代码文件。
第二获取模块,用于若所述选择指令中的文件类型为非代码文件类型,则获取与所述选择指令对应的非代码文件,并利用预设工具打开所述非代码文件,所述预设工具与所述非代码文件的后缀名相关联。
可选的,所述代码编辑单元包括:
第一查找模块,用于获取用户当前输入的字符,并在预设的函数列表数据库中查找与所述字符相匹配的第一函数。
函数显示模块,用于若在预设的函数列表数据库中查找到与所述字符相匹配的第一函数,则用下拉列表的方式将所述第一函数显示给用户。
可选的,所述代码编辑单元还包括:
第三获取模块,用于获取当前的光标位置,并获取所述光标位置对应的函数名称。
第二查找模块,用于在所述函数列表数据库中查找与所述函数名称对应的第二函数。
跳转模块,用于若在所述函数列表数据库中查找到与所述函数名称对应的第二函数,则打开目标文件,并将所述光标位置跳转到所述目标文件中所述第二函数所在的位置,所述目标文件为包含所述第二函数的定义的文件。
可选的,所述计算机程序还包括:
读取单元,用于在所述在预设的函数列表数据库中查找与所述字符相匹配的第一函数之前,读取所述工程文件中各个代码文件的内容,并删除所述代码文件中的无效内容,所述无效内容包括注释内容和字符串引用内容。
查找单元,用于在删除无效内容后的代码文件中,查找函数定义关键字。
语句判断单元,用于若查找到函数定义关键字,则判断所述函数定义关键字的上下文是否包含函数定义语句。
添加单元,用于若所述函数定义关键字的上下文包含函数定义语句,则将所述函数定义语句中包含的函数名称添加到所述函数列表数据库中。
所述集成开发工具3可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述集成开发工具可包括,但不仅限于,处理器30、存储器31。本领域技术人员可以理解,图3仅仅是集成开发工具3的示例,并不构成对集成开发工具3的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述集成开发工具还可以包括输入输出设备、网络接入设备、总线等。
所称处理器30可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器31可以是所述集成开发工具3的内部存储单元,例如集成开发工具3的硬盘或内存。所述存储器31也可以是所述集成开发工具3的外部存储设备,例如所述集成开发工具3上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器31还可以既包括所述集成开发工具3的内部存储单元也包括外部存储设备。所述存储器31用于存储所述计算机程序以及所述集成开发工具所需的其他程序和数据。所述存储器31还可以用于暂时地存储已经输出或者将要输出的数据。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/集成开发工具和方法,可以通过其它的方式实现。例如,以上所描述的装置/集成开发工具实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种应用程序的开发方法,其特征在于,包括:
    接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件;
    接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中;
    接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件;
    对所述编辑后的工程文件进行编译,生成应用程序。
  2. 如权利要求1所述的应用程序的开发方法,其特征在于,所述根据所述新建请求新建一个工程文件,包括:
    判断当前进程中是否存在正在运行的工程文件;
    若当前进程中存在正在运行的工程文件,则关闭所述正在运行的工程文件包含的所有代码文件,并在关闭了所述正在运行的工程文件包含的所有代码文件之后,根据所述新建请求新建一个工程文件;
    在根据所述新建请求新建一个工程文件之后,监测用户的修改请求,并根据所述修改请求对所述工程文件进行相应的修改,所述修改请求包括添加子工程指令、修改子工程指令和删除子工程指令;
    将修改后的工程文件中的各个子工程文件按照树形结构进行排列,得到所述工程文件的子工程文件列表,并将所述子工程文件列表通过可视界面显示给用户。
  3. 如权利要求1所述的应用程序的开发方法,其特征在于,所述选择指令包括文件类型;
    所述文件类型包括代码文件类型和非代码文件类型;
    所述从预设的模板库中获取与所述选择指令对应的模板代码文件,包括:
    若所述选择指令中的文件类型为代码文件类型,则判断所述模板库中是否存在与所述选择指令对应的模板代码文件;
    如果所述模板库中存在与所述选择指令对应的模板代码文件,则获取所述模板代码文件;
    若所述选择指令中的文件类型为非代码文件类型,则获取与所述选择指令对应的非代码文件,并利用预设工具打开所述非代码文件,所述预设工具与所述非代码文件的后缀名相关联。
  4. 如权利要求1所述的应用程序的开发方法,其特征在于,所述根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,包括:
    获取用户当前输入的字符,并在预设的函数列表数据库中查找与所述字符相匹配的第一函数;
    若在预设的函数列表数据库中查找到与所述字符相匹配的第一函数,则用下拉列表的方式将所述第一函数显示给用户。
  5. 如权利要求1所述的应用程序的开发方法,其特征在于,所述根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,还包括:
    获取所述代码文件当前的光标位置,并获取所述光标位置对应的函数名称;
    在所述函数列表数据库中查找与所述函数名称对应的第二函数;
    若在所述函数列表数据库中查找到与所述函数名称对应的第二函数,则打开目标文件,并将所述光标位置跳转到所述目标文件中所述第二函数所在的位置,所述目标文件为包含所述第二函数的定义的文件。
  6. 如权利要求4或5所述的应用程序的开发方法,其特征在于,所述方法还包括:
    读取所述工程文件中各个代码文件的内容,并删除所述代码文件中的无效内容,所述无效内容包括注释内容和字符串引用内容;
    在删除无效内容后的代码文件中,查找函数定义关键字;
    若查找到函数定义关键字,则判断所述函数定义关键字的上下文是否包含函数定义语句;
    若所述函数定义关键字的上下文包含函数定义语句,则将所述函数定义语句中包含的函数名称添加到所述函数列表数据库中。
  7. 一种应用程序的开发装置,其特征在于,包括:
    工程管理单元,用于接收用户的新建请求,并根据所述新建请求新建一个工程文件,所述工程文件包括至少一个子工程文件,所述子工程文件包括至少一个代码文件;
    文件向导单元,用于接收用户的选择指令,从预设的模板库中获取与所述选择指令对应的模板代码文件,并将所述模板代码文件添加到新建的所述工程文件中;
    代码编辑单元,用于接收用户的编辑指令,并根据所述编辑指令对所述工程文件中所述代码文件的内容进行相应的编辑,得到编辑后的工程文件;
    编译单元,用于对所述编辑后的工程文件进行编译,生成应用程序。
  8. 如权利要求7所述的应用程序的开发装置,其特征在于,所述工程管理单元包括:
    判断模块,用于判断当前进程中是否存在正在运行的工程文件;
    关闭模块,用于若当前进程中存在正在运行的工程文件,则关闭所述正在运行的工程文件包含的所有代码文件,并在关闭了所述正在运行的工程文件包含的所有代码文件之后,根据所述新建请求新建一个工程文件;
    修改模块,用于在根据所述新建请求新建一个工程文件之后,监测用户的修改请求,并根据所述修改请求对所述工程文件进行相应的修改,所述修改请求包括添加子工程指令、修改子工程指令和删除子工程指令;
    显示模块,用于将修改后的工程文件中的各个子工程文件按照树形结构进行排列,得到所述工程文件的子工程文件列表,并将所述子工程文件列表通过可视界面显示给用户。
  9. 一种集成开发工具,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至6任一项所述方法的步骤。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述方法的步骤。
PCT/CN2019/116291 2018-12-27 2019-11-07 一种应用程序的开发方法、装置及集成开发工具 WO2020134633A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811609643.0A CN109783081A (zh) 2018-12-27 2018-12-27 一种应用程序的开发方法、装置及集成开发工具
CN201811609643.0 2018-12-27

Publications (1)

Publication Number Publication Date
WO2020134633A1 true WO2020134633A1 (zh) 2020-07-02

Family

ID=66498457

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116291 WO2020134633A1 (zh) 2018-12-27 2019-11-07 一种应用程序的开发方法、装置及集成开发工具

Country Status (2)

Country Link
CN (1) CN109783081A (zh)
WO (1) WO2020134633A1 (zh)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783081A (zh) * 2018-12-27 2019-05-21 百富计算机技术(深圳)有限公司 一种应用程序的开发方法、装置及集成开发工具
CN110399132B (zh) * 2019-06-18 2023-12-22 平安科技(深圳)有限公司 项目代码的维护方法、装置、计算机设备和存储介质
CN111124388A (zh) * 2019-11-28 2020-05-08 深圳市世宗自动化设备有限公司 自动化程序的编辑方法、系统、计算机设备及其存储介质
CN111176629A (zh) * 2019-12-24 2020-05-19 中国建设银行股份有限公司 一种应用开发的方法和装置
CN111399840B (zh) * 2020-03-04 2024-03-19 腾讯音乐娱乐科技(深圳)有限公司 一种模块开发方法及装置
CN111552503B (zh) * 2020-05-12 2023-03-31 重庆科技学院 工程文件处理方法、装置、计算机设备及存储介质
CN111736814A (zh) * 2020-06-24 2020-10-02 武汉精立电子技术有限公司 一种测试文件脚本编辑器、测试方法及系统
CN112269579A (zh) * 2020-11-02 2021-01-26 中电凯杰科技有限公司 一种基于stm32处理器的编译型plc控制器系统及实现方法
CN112685045A (zh) * 2020-12-28 2021-04-20 北京达佳互联信息技术有限公司 页面源文件的处理方法、装置、电子设备以及存储介质
CN112632113B (zh) * 2020-12-31 2022-02-11 北京九章云极科技有限公司 一种算子管理方法和算子管理系统
CN113064588B (zh) * 2021-04-07 2024-01-30 浪潮通用软件有限公司 命令编排方法、装置及计算机可读介质
CN113590107A (zh) * 2021-07-02 2021-11-02 远光软件股份有限公司 一种应用程序模板的构建方法及其设备、存储介质
CN113805864A (zh) * 2021-11-19 2021-12-17 北京明略昭辉科技有限公司 一种项目工程的生成方法、装置、电子设备及存储介质
CN114579118A (zh) * 2022-03-15 2022-06-03 上海商汤智能科技有限公司 编程方法和系统、设备、存储介质
CN116225576B (zh) * 2023-05-08 2023-07-28 成都赛力斯科技有限公司 应用程序的数据环境切换方法、装置、电子设备及介质
CN116610359B (zh) * 2023-07-18 2023-10-20 建信金融科技有限责任公司 一种编译信息的展示方法、装置及程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120102385A1 (en) * 2010-10-25 2012-04-26 Konica Minolta Systems Laboratory Inc. Determining heights of table cells
CN104461538A (zh) * 2014-12-08 2015-03-25 畅捷通信息技术股份有限公司 报表生成方法和报表生成系统
CN104881275A (zh) * 2015-02-11 2015-09-02 中国农业银行股份有限公司 一种电子报表生成方法及装置
CN105786460A (zh) * 2014-12-24 2016-07-20 华为技术有限公司 一种基于服务组合的软件开发方法及装置
CN109783081A (zh) * 2018-12-27 2019-05-21 百富计算机技术(深圳)有限公司 一种应用程序的开发方法、装置及集成开发工具

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5966532A (en) * 1997-07-10 1999-10-12 National Instruments Corporation Graphical code generation wizard for automatically creating graphical programs
CN102479079B (zh) * 2010-11-29 2015-04-01 中兴通讯股份有限公司 应用生成方法和装置
CN102436498B (zh) * 2011-11-14 2014-07-23 深圳市华力特电气股份有限公司 一种报表生成方法以及相关装置
CN108446398A (zh) * 2018-03-27 2018-08-24 北京邦邦共赢网络科技有限公司 一种数据库的生成方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120102385A1 (en) * 2010-10-25 2012-04-26 Konica Minolta Systems Laboratory Inc. Determining heights of table cells
CN104461538A (zh) * 2014-12-08 2015-03-25 畅捷通信息技术股份有限公司 报表生成方法和报表生成系统
CN105786460A (zh) * 2014-12-24 2016-07-20 华为技术有限公司 一种基于服务组合的软件开发方法及装置
CN104881275A (zh) * 2015-02-11 2015-09-02 中国农业银行股份有限公司 一种电子报表生成方法及装置
CN109783081A (zh) * 2018-12-27 2019-05-21 百富计算机技术(深圳)有限公司 一种应用程序的开发方法、装置及集成开发工具

Also Published As

Publication number Publication date
CN109783081A (zh) 2019-05-21

Similar Documents

Publication Publication Date Title
WO2020134633A1 (zh) 一种应用程序的开发方法、装置及集成开发工具
US10853060B2 (en) Software refactoring systems and methods
US7694272B2 (en) Method, a language and a system for the definition and implementation of software solutions by using a visualizable computer executable modeling language
EP2098954B1 (en) Systems and methods for template reverse engineering
US11429365B2 (en) Systems and methods for automated retrofitting of customized code objects
US7426717B1 (en) System and method for debugging files in a runtime environment
JP5044139B2 (ja) 移行互換性を維持したままのジェネリック型の具体化
US11579856B2 (en) Multi-chip compatible compiling method and device
US20070074184A1 (en) System and method for creating and using graphical object instances in a statechart environment
US8276118B2 (en) Depicting changes to structures in an integrated development environment
US11294793B1 (en) Robotic process automation (RPA) debugging systems and methods
WO2006065283A1 (en) Applying coding standards in graphical programming environments
US9311077B2 (en) Identification of code changes using language syntax and changeset data
CN107577709B (zh) 一种信息系统资源模型的图形化管理方法
US8700374B1 (en) System and method of using an active link in a state programming environment to locate an element in a graphical programming environment
KR20060044361A (ko) 런타임 전에 코딩 에러를 감소시키는 컴퓨터 구현 방법
JPH06332689A (ja) プログラムの表示方法およびプログラムの編集受付け方法
CN112181483B (zh) 等离子体控制系统软件开发平台及方法
US20230401056A1 (en) Interactive code visualization system
Blunk et al. Efficient Development of Domain-Specific Simulation Modelling Languages and Tools
JP4854058B2 (ja) 汎用入力データ検査装置及びプログラム
CN114816975A (zh) 一种阻止系统函数调用的方法、装置、设备和存储介质
CN117573106A (zh) 前端h5项目构建方法、装置、设备及存储介质
CN117170654A (zh) 图形用户界面应用程序的开发方法、装置及电子设备
JPH06289919A (ja) Nc装置のマンマシンインタフェース装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19903497

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19903497

Country of ref document: EP

Kind code of ref document: A1