A method and device for realizing target program generation using static library
By acquiring and modifying the basic static library, it is automatically integrated into the software development program, which solves the problems of cumbersome static library integration steps and low accuracy, and achieves efficient automated integration.
Patent Information
- Application Number
- CN201811518862.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2038-12-12
AI Technical Summary
In the existing technology, the steps for integrating static libraries into software development programs are cumbersome and have low accuracy, and are prone to manual errors leading to integration failures.
By obtaining the basic static library selected by the developer, and using the static library modification script to create modified code, it is automatically added to the target program architecture, and integrated in response to the developer's packaging instructions to achieve automated integration.
It simplifies the static library integration process, improves the accuracy and efficiency of integration, avoids tedious steps and manual errors in manual integration, and realizes automated integration of static libraries into software development programs.
Smart Images

Figure CN109710230B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of development auxiliary tools, and in particular to a method and device for realizing target program generation by utilizing a static library. Background Art
[0002] At present, in the process of software development, there are often some common codes that need to be reused. Usually, these common codes can be compiled into static libraries. When developers need to use these common codes, they can directly integrate the static libraries into the software development program without having to redevelop these common codes.
[0003] In the implementation of the prior art, static libraries are usually integrated into software development programs manually, wherein the method of manually integrating static libraries to generate software development programs includes the following steps: modifying compilation options - introducing system dependencies - modifying project configuration information. In practice, it is found that the first defect of this method of manually integrating static libraries to generate software development programs is that it is too cumbersome, and the second defect is that it is prone to errors and has low integration reliability. These steps are closely linked, and as long as one step is wrong, the final integration will fail. In the process of manual integration, it is difficult to avoid the situation where human errors lead to integration failure.
[0004] In summary, the defect of the prior art is that there is a problem that the steps of generating the software development program are complicated and the accuracy is low due to manually integrating static libraries to generate the software development program. Summary of the invention
[0005] In order to solve the problem in the related art that manually integrating a static library into a software development program leads to complicated steps and low accuracy in generating a software development program, the present invention provides a method and device for generating a target program using a static library.
[0006] A method for generating a target program using a static library, the method comprising:
[0007] In response to a developer's selection of a basic static library involved in the program code, obtaining the selected basic static library, wherein the basic static library is a program segment that appears commonly in the program code;
[0008] In response to a static library modification instruction from a developer, a modification code for a basic static library is created using a modification script corresponding to the static library;
[0009] Add the created modified code to the basic static library and place it in the target program framework;
[0010] In response to the developer's packaging instruction for the target program, all basic static libraries with added and created modified codes in the target program framework are integrated as the target program.
[0011] A device for generating a target program using a static library, the device comprising:
[0012] An acquisition unit, configured to acquire, in response to a developer's selection of a basic static library involved in the program code, a selected basic static library, wherein the basic static library is a program segment that appears commonly in the program code;
[0013] A creation unit, for responding to a static library modification instruction from a developer, and using a modification script corresponding to the static library to create a modification code for a basic static library;
[0014] An adding unit, used for adding the created modified code to the basic static library and placing it in the target program framework;
[0015] The integration unit is used to respond to the developer's packaging instruction for the target program and integrate all the basic static libraries after adding, creating and modifying the codes in the target program framework as the target program.
[0016] An electronic device, comprising:
[0017] processor;
[0018] A memory having computer-readable instructions stored therein, wherein the computer-readable instructions, when executed by the processor, implement the aforementioned method.
[0019] A computer-readable storage medium stores a computer program, which enables a computer to implement the method described above when the computer executes the computer program.
[0020] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:
[0021] The method for generating a target program using a static library provided by the present invention comprises the following steps: in response to a developer's selection of a basic static library involved in a program code, obtaining the selected basic static library, wherein the basic static library is a program segment that appears commonly in the program code; in response to a developer's static library modification instruction, creating a modification code for the basic static library using a modification script corresponding to the static library; adding the created modification code to the basic static library and placing it in a target program framework; in response to a developer's packaging instruction for the target program, integrating all the basic static libraries in the target program framework after adding the created modification code as the target program.
[0022] Under this method, development-assistive technology is used to add the modified code created by the static library modification instruction to the basic static library selected by the developer and the static library modification instruction of the developer, and place it in the target program framework. When the developer triggers the packaging instruction for the target program, the basic static library with all modified codes in the target program framework can be automatically integrated as the target program. This process does not require the integration of the static library first, but can automatically integrate the basic static library with all modified codes in the target program framework when the target program is finally packaged, thereby realizing the automatic integration of the basic static library with all modified codes in the target program framework into the software development program, thereby solving the problem of cumbersome steps and low accuracy in generating the software development program caused by manual integration of the static library into the software development program.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0025] Figure 1 is a schematic diagram showing a device for realizing target program generation by using a static library according to an exemplary embodiment;
[0026] Figure 2 is a flow chart showing a method for generating a target program using a static library according to an exemplary embodiment;
[0027] Figure 3 is a flowchart of a method for generating a target program using a static library according to another exemplary embodiment;
[0028] Figure 4 is a block diagram showing a device for realizing target program generation by using a static library according to an exemplary embodiment;
[0029] Figure 5 The invention is a block diagram showing a device for realizing target program generation by utilizing a static library according to another exemplary embodiment. DETAILED DESCRIPTION
[0030] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0031] The implementation environment of the present invention may be a portable mobile device, such as a smart phone, a tablet computer, or a desktop computer.
[0032] Figure 1 1 is a schematic diagram of a device for generating a target program using a static library according to an exemplary embodiment. The device 100 may be the portable mobile device mentioned above. Figure 1 As shown, the apparatus 100 may include one or more of the following components: a processing component 102 , a memory 104 , a power component 106 , a multimedia component 108 , an audio component 110 , a sensor component 114 , and a communication component 116 .
[0033] The processing component 102 generally controls the overall operation of the device 100, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 102 may include one or more processors 118 to execute instructions to perform all or part of the steps of the method described below. In addition, the processing component 102 may include one or more modules to facilitate the interaction between the processing component 102 and other components. For example, the processing component 102 may include a multimedia module to facilitate the interaction between the multimedia component 108 and the processing component 102.
[0034] The memory 104 is configured to store various types of data to support operations on the device 100. Examples of such data include instructions for any application or method operating on the device 100. The memory 104 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The memory 104 also stores one or more modules, which are configured to be executed by the one or more processors 118 to complete all or part of the steps in the method shown below.
[0035] The power supply component 106 provides power to the various components of the device 100. The power supply component 106 may include a power management device, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 100.
[0036] The multimedia component 108 includes a screen that provides an output interface between the device 100 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. The screen may also include an organic light emitting display (OLED).
[0037] The audio component 110 is configured to output and / or input audio signals. For example, the audio component 110 includes a microphone (MIC), which is configured to receive external audio signals when the device 100 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode. The received audio signal can be further stored in the memory 104 or sent via the communication component 116. In some embodiments, the audio component 110 also includes a speaker for outputting audio signals.
[0038] The sensor assembly 114 includes one or more sensors for providing various aspects of status evaluation for the device 100. For example, the sensor assembly 114 can detect the open / closed state of the device 100, the relative positioning of the components, and the sensor assembly 114 can also detect the position change of the device 100 or a component of the device 100 and the temperature change of the device 100. In some embodiments, the sensor assembly 114 can also include a magnetic sensor, a pressure sensor or a temperature sensor.
[0039] The communication component 116 is configured to facilitate wired or wireless communication between the device 100 and other devices. The device 100 can access a wireless network based on a communication standard, such as WiFi (Wireless-Fidelity). In an exemplary embodiment, the communication component 116 receives a broadcast signal or broadcast-related information from an external broadcast management device via a broadcast channel. In an exemplary embodiment, the communication component 116 also includes a near field communication (NFC) module for facilitating short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth technology and other technologies.
[0040] In an exemplary embodiment, the device 100 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors, digital signal processing devices, programmable logic devices, field programmable gate arrays, controllers, microcontrollers, microprocessors or other electronic components to perform the following method.
[0041] Figure 2 FIG. 1 is a flowchart of a method for generating a target program using a static library according to an exemplary embodiment. Figure 2 As shown, this method includes the following steps:
[0042] Step 201 , in response to a developer's selection of a basic static library involved in a program code, obtaining the selected basic static library, where the basic static library is a program segment that appears commonly in the program code.
[0043] In an embodiment of the present invention, the basic static library may be a program segment for implementing a certain business function, or a program segment for implementing several business functions. This is not limited in the embodiment of the present invention. For example, the static basic library may be a program for generating a blank table, etc.
[0044] Step 202 , in response to the static library modification instruction from the developer, using the modification script corresponding to the static library, creates modification code for the basic static library.
[0045] In an embodiment of the present invention, the developer can trigger the static library modification instruction by writing a corresponding code segment for creating the modification code, and the basic static library can perform different operations according to the difference of the modification code. For example, when the function implemented by the basic static library is to generate a blank table, the table includes both attribute type data (such as financial business type) and digital type data (such as financial business amount). The modification code of the basic static library can be created using the modification script of the basic static library, wherein the data type corresponding to the modification code can include digital type data, attribute type data, or both digital type data and attribute type data. If the data type corresponding to the modified code only includes data of digital type, the basic static library can generate the financial business type corresponding to each digital type of data according to the digital range corresponding to the data of the digital type and the digital unit matching the data of the digital type, and obtain the table corresponding to the data of the digital type by combining each digital type of data and the corresponding financial business type; if the data type corresponding to the modified code only includes data of attribute type, the basic static library after introducing the modified code can generate the table corresponding to the data of the attribute type according to the data of the attribute type; if the data type corresponding to the modified code includes both data of digital type and data of attribute type, the basic static library after introducing the modified code can store the digital type data in the modified code and the attribute type data in the modified code in correspondence with each other and generate a corresponding table.
[0046] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instruction includes the attribute data type of the financial business report, and the basic static library is a program for generating a blank table.
[0047] In response to a developer's static library modification instruction, creating a modification code for the basic static library using a modification script corresponding to the static library may include: according to the attribute data type in the static library modification instruction, using the modification script corresponding to the static library, creating a modification code for adding the attribute data type on a blank table.
[0048] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instruction includes a digital data type of the financial business report, the digital data type includes a digital range and a unit of the digital data, and the basic static library is a program for generating a blank table.
[0049] In response to a static library modification instruction from a developer, using a modification script corresponding to the static library, creating a modification code for the basic static library may include:
[0050] According to the unit of the digital data in the static library modification instruction, the corresponding relationship table between the unit of the digital data and the attribute data type is searched to obtain the attribute data type;
[0051] According to the acquired attribute data type and the numeric range of the numeric data in the static library modification instruction, a modification code for adding the attribute data type and the numeric data type on the blank form is created.
[0052] In an embodiment of the present invention, the table of correspondence between digital data units and attribute data types may store various digital data units and attribute data types that match each unit. By searching the table of correspondence between digital data units and attribute data types, the attribute data type that matches the digital data may be obtained.
[0053] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instructions include attribute data types and digital data types of financial business reports, and the basic static library is a program for generating blank tables.
[0054] In response to the static library modification instruction from the developer, a modification script corresponding to the static library is used to create a modification code for the basic static library, including:
[0055] Create modification codes for adding attribute data types and numeric data types to a blank table according to the attribute data types and numeric data types in the static library modification instructions.
[0056] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instruction includes the attribute data type of the financial business report, and the basic static library is a program for generating a blank table.
[0057] In response to the developer's static library modification instructions, the modification script corresponding to the static library is used to create modification code for the basic static library, including: according to the attribute data type in the static library modification instructions, the modification script corresponding to the static library is used to create modification code for adding the attribute data type on a blank table.
[0058] Step 203, adding the created modified code to the basic static library and placing it in the target program framework.
[0059] Step 204, in response to the developer's packaging instruction for the target program, all basic static libraries added and created with modified codes in the target program framework are integrated as the target program.
[0060] For example, when a life insurance application software developer wants to develop a life insurance application software, the traditional development method is: determine the static library needed to develop the life insurance application software - integrate the static library - introduce the integrated static library into the life insurance application software program. Since the integration of the static library takes a long time and the number of static libraries that need to be integrated is large, the development efficiency of this development method is low. The development method of the present invention is: determine the basic static library needed to develop the life insurance application software - use the modification script of the basic static library to create the modification code of the static library - add the created modification code to the basic static library and place it in the life insurance application software development framework - integrate all the basic static libraries with the created modification code added in the life insurance application software development framework as the life insurance application software program. It can be seen that this development method does not need to manually integrate the static library, and can also add custom modification codes to realize some custom functions, which is more intelligent.
[0061] Under the above method, development assistance technology is used to add the modified code created by the static library modification instruction to the basic static library selected by the developer and the static library modification instruction of the developer, and place it in the target program framework. When the developer triggers the packaging instruction for the target program, the basic static library with all modified codes in the target program framework can be automatically integrated as the target program. This process does not require the integration of the static library first, but can automatically integrate the basic static library with all modified codes in the target program framework when the target program is finally packaged, thereby realizing the automatic integration of the basic static library with all modified codes in the target program framework into the software development program, thereby solving the problem of cumbersome steps and low accuracy in generating the software development program caused by manual integration of the static library into the software development program.
[0062] Figure 3 FIG. 1 is a flowchart of a method for generating a target program using a static library according to another exemplary embodiment. Figure 3 As shown, this method includes the following steps:
[0063] Step 301 , in response to a developer's selection of a basic static library involved in a program code, obtaining the selected basic static library, where the basic static library is a program segment that appears commonly in the program code.
[0064] Step 302, in response to the static library modification instruction of the developer, using the pre-script and post-script in the modification script, respectively create the pre-modification code set in front of the basic static library and the post-modification code set behind it.
[0065] In the embodiment of the present invention, a pre-modification code set in front of the integrated static library can be created by a pre-script, and a post-modification code set behind the integrated static library can be created by a post-script. In addition, the pre-modification code and the post-modification code can be used to perform corresponding parameter configuration on the code segments in the static library.
[0066] Step 303: Add the created pre-modification code and post-modification code to the front and back of the basic static library respectively.
[0067] Step 304: receiving project requirement information input by the developer.
[0068] In the embodiment of the present invention, the project requirement information may include category information of the project to be developed, etc. For example, the project requirement information may include category information of financial statement development projects.
[0069] Step 305: Obtain an index that matches the project requirement information.
[0070] In the embodiment of the present invention, the basic static library contains static code segments, each of which has a corresponding index, and the static code segments required by the project can be extracted according to the index that matches the project requirement information.
[0071] Step 306: Only the static code segment corresponding to the obtained index is retained in the basic data, and the created modified code is added to the retained static code segment and placed in the target program framework.
[0072] In the embodiment of the present invention, only the static code segment corresponding to the index required by the project can be retained, and the modified code can be added to the static code segment and placed in the target program framework. In this process, when the basic static library can realize several functions, a static code segment in the basic static library can be selected to realize the function required by the project requirement information, which is more personalized and meets the development needs of various projects.
[0073] Step 307, in response to the developer's instruction to package the target program, integrate all the basic static libraries with added and modified codes in the target program framework as the target program.
[0074] For example, when a life insurance application software developer wants to develop a life insurance application software, the traditional development method is: determine the static library needed to develop the life insurance application software - integrate the static library - introduce the integrated static library into the life insurance application software program. Since the integration of the static library takes a long time and the number of static libraries that need to be integrated is large, the development efficiency of this development method is low. The development method of the present invention is: determine the basic static library needed to develop the life insurance application software - add the created modification code to the basic static library and place it in the life insurance application software development framework - integrate all the basic static libraries with the created modification code added in the life insurance application software development framework as the life insurance application software program. It can be seen that this development method simplifies the steps of calling the static library, improves the calling efficiency, and thus improves the development efficiency. In addition, custom modification codes can be added to implement some custom functions, which is more intelligent.
[0075] Under the above method, development assistance technology is used to add the modified code created by the static library modification instruction to the basic static library selected by the developer and the static library modification instruction of the developer, and place it in the target program framework. When the developer triggers the packaging instruction for the target program, the basic static library with all modified codes in the target program framework can be automatically integrated as the target program. This process does not require the integration of the static library first, but can automatically integrate the basic static library with all modified codes in the target program framework when the target program is finally packaged, thereby realizing the automatic integration of the basic static library with all modified codes in the target program framework into the software development program, thereby solving the problem of cumbersome steps and low accuracy in generating the software development program caused by manual integration of the static library into the software development program.
[0076] The following are device embodiments of the present invention.
[0077] Figure 4 FIG. 1 is a block diagram showing a device for generating a target program using a static library according to an exemplary embodiment. Figure 4 As shown, the device comprises:
[0078] The acquisition unit 401 is used to acquire the selected basic static library in response to the developer's selection of the basic static library involved in the program code, where the basic static library is a program segment that appears commonly in the program code.
[0079] In an embodiment of the present invention, the basic static library may be a program segment for implementing a certain business function, or a program segment for implementing several business functions. This is not limited in the embodiment of the present invention. For example, the static basic library may be a program for generating a blank table, etc.
[0080] The creation unit 402 is used to create modification codes for the basic static library using the modification script corresponding to the static library in response to the static library modification instruction of the developer.
[0081] In an embodiment of the present invention, the developer can trigger the static library modification instruction by writing a corresponding code segment for creating the modification code, and the basic static library can perform different operations according to the difference of the modification code. For example, when the function implemented by the basic static library is to generate a blank table, the table includes both attribute type data (such as financial business type) and digital type data (such as financial business amount). The modification code of the basic static library can be created using the modification script of the basic static library, wherein the data type corresponding to the modification code can include digital type data, attribute type data, or both digital type data and attribute type data. If the data type corresponding to the modified code only includes data of digital type, the basic static library can generate the financial business type corresponding to each digital type of data according to the digital range corresponding to the data of the digital type and the digital unit matching the data of the digital type, and obtain the table corresponding to the data of the digital type by combining each digital type of data and the corresponding financial business type; if the data type corresponding to the modified code only includes data of attribute type, the basic static library after introducing the modified code can generate the table corresponding to the data of the attribute type according to the data of the attribute type; if the data type corresponding to the modified code includes both data of digital type and data of attribute type, the basic static library after introducing the modified code can store the digital type data in the modified code and the attribute type data in the modified code in correspondence with each other and generate a corresponding table.
[0082] The adding unit 403 is used to add the created modified code to the basic static library and place it in the target program framework.
[0083] The integration unit 404 is used to integrate all the basic static libraries with added and modified codes in the framework of the target program as the target program in response to the developer's packaging instruction for the target program.
[0084] It can be seen that through the implementation Figure 4The described device for generating a target program using a static library is implemented. Development-assistant technology is used to add the modified code created by the static library modification instruction to the basic static library according to the basic static library selected by the developer and the static library modification instruction of the developer, and the modified code is placed in the target program framework. When the developer triggers the packaging instruction for the target program, the basic static library with all modified codes in the target program framework can be automatically integrated as the target program. This process does not require the static library to be integrated first, but the basic static library with all modified codes in the target program framework can be automatically integrated when the target program is finally packaged, thereby realizing the automatic integration of the basic static library with all modified codes in the target program framework into the software development program, thereby solving the problem of cumbersome steps and low accuracy in generating the software development program caused by manually integrating the static library into the software development program.
[0085] Figure 5 The invention is a block diagram showing a device for realizing a target program generation by utilizing a static library according to another exemplary embodiment. Figure 5 is Figure 4 Based on the optimization, Figure 4 Compared with the target program generator using a static library, Figure 5 In the target program generation device shown in the figure, a static library is used to realize the target program generation device:
[0086] The creation unit 402 is used to create the modification code for the basic static library by using the modification script corresponding to the static library. Specifically, the method is as follows:
[0087] The creation unit 402 is used to use the pre-script and post-script in the modification script to respectively create the pre-modification code set in front of the basic static library and the post-modification code set behind it, and the modification script includes the pre-script and the post-script.
[0088] In the embodiment of the present invention, a pre-modification code set in front of the integrated static library can be created by a pre-script, and a post-modification code set behind the integrated static library can be created by a post-script. In addition, the pre-modification code and the post-modification code can be used to perform corresponding parameter configuration on the code segments in the static library.
[0089] The specific method of adding unit 403 to add the created modified code to the basic static library is:
[0090] The adding unit 403 is used to add the created pre-modification code and post-modification code to the front and back of the basic static library respectively.
[0091] Optional, Figure 5 The target program generation device using a static library may also include:
[0092] The receiving unit 405 is used to receive the project requirement information input by the developer before the creating unit 402 adds the created modified code to the basic static library and places it in the target program framework.
[0093] In the embodiment of the present invention, the project requirement information may include category information of the project to be developed, etc.
[0094] The acquisition unit 401 is further used to acquire an index matching the project requirement information.
[0095] In the embodiment of the present invention, the basic static library contains static code segments, each of which has a corresponding index, and the static code segments required by the project can be extracted according to the index that matches the project requirement information.
[0096] The adding unit 403 is used to add the created modified code to the basic static library and place it in the target program framework in the following manner:
[0097] The adding unit 403 is used to retain only the static code segment corresponding to the acquired index in the basic data, add the created modified code to the retained static code segment, and place it in the target program framework.
[0098] In the embodiment of the present invention, only the static code segment corresponding to the index required by the project can be retained, and the modified code can be added to the static code segment and placed in the target program framework. In this process, when the basic static library can realize several functions, a static code segment in the basic static library can be selected to realize the function required by the project requirement information, which is more personalized and meets the development needs of various projects.
[0099] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instruction includes the attribute data type of the financial business report, and the basic static library is a program for generating a blank table.
[0100] The creation unit 402 is used to respond to the static library modification instruction of the developer and use the modification script corresponding to the static library to create the modification code for the basic static library in the following manner:
[0101] The creation unit 402 is used to create a modification code for adding the attribute data type to the blank table according to the attribute data type in the static library modification instruction and using the modification script corresponding to the static library.
[0102] In an embodiment of the present invention, the table of correspondence between digital data units and attribute data types may store various digital data units and attribute data types that match each unit. By searching the table of correspondence between digital data units and attribute data types, the attribute data type that matches the digital data may be obtained.
[0103] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instruction includes a digital data type of the financial business report, the digital data type includes a digital range and a unit of the digital data, and the basic static library is a program for generating a blank table.
[0104] In response to the static library modification instruction of the developer, the creation unit 402 uses the modification script corresponding to the static library to create the modification code for the basic static library in the following manner:
[0105] The creation unit 402 searches the table of correspondence between the unit of the digital data and the attribute data type according to the unit of the digital data in the static library modification instruction, and obtains the attribute data type;
[0106] The creation unit 402 creates a modification code for adding the attribute data type and the digital data type on the blank form according to the acquired attribute data type and the digital range of the digital data in the static library modification instruction.
[0107] In an embodiment of the present invention, the table of correspondence between digital data units and attribute data types may store various digital data units and attribute data types that match each unit. By searching the table of correspondence between digital data units and attribute data types, the attribute data type that matches the digital data may be obtained.
[0108] As an optional implementation, the target program is a program for generating financial business reports, the static library modification instructions include attribute data types and digital data types of financial business reports, and the basic static library is a program for generating blank tables.
[0109] The creation unit 402 responds to the static library modification instruction of the developer and uses the modification script corresponding to the static library to create the modification code for the basic static library, which may include:
[0110] The creation unit 402 creates a modification code for adding the attribute data type and the numeric data type to the blank table according to the attribute data type and the numeric data type in the static library modification instruction.
[0111] It can be seen that through the implementation Figure 5The described device for generating a target program using a static library is implemented. Development-assistant technology is used to add the modified code created by the static library modification instruction to the basic static library according to the basic static library selected by the developer and the static library modification instruction of the developer, and the modified code is placed in the target program framework. When the developer triggers the packaging instruction for the target program, the basic static library with all modified codes in the target program framework can be automatically integrated as the target program. This process does not require the static library to be integrated first, but the basic static library with all modified codes in the target program framework can be automatically integrated when the target program is finally packaged, thereby realizing the automatic integration of the basic static library with all modified codes in the target program framework into the software development program, thereby solving the problem of cumbersome steps and low accuracy in generating the software development program caused by manually integrating the static library into the software development program.
[0112] The present invention also provides an electronic device, the electronic device comprising:
[0113] processor;
[0114] A memory stores computer-readable instructions, which, when executed by a processor, implement the target program generation method using a static library as shown above.
[0115] The electronic device may be Figure 1 The target program generating apparatus 100 shown is implemented using a static library.
[0116] In an exemplary embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for generating a target program using a static library as shown above is implemented.
[0117] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be performed without departing from its scope. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for generating a target program using a static library, characterized in that: The method comprises: In response to a developer's selection of a basic static library involved in the program code, obtaining the selected basic static library, wherein the basic static library is a program segment that commonly appears in the program code and is used to generate a blank table, wherein the basic static library contains static code segments, and each static code segment has a corresponding index; In response to a static library modification instruction from a developer, according to a target data type in the static library modification instruction, a modification code for adding the target data type to the blank table is created by using a modification script corresponding to the static library; the modification script includes a pre-script and a post-script, the created modification code includes a pre-modification code set in front of the basic static library and a post-modification code set behind, and the target data type includes at least one of an attribute data type and a digital data type; Receive project requirement information input by a developer, and obtain an index matching the project requirement information; Only the static code segment corresponding to the obtained index is retained in the basic static library, and the created pre-modification code and post-modification code are added to the front and back of the retained static code segment respectively, and placed in the target program framework; In response to the developer's packaging instruction for the target program, all basic static libraries with added and created modified codes in the target program framework are integrated as the target program, and the target program is used to generate financial business reports containing the target data type.
2. The method according to claim 1, characterized in that The static library modification instruction includes a digital data type of a financial business report, and the digital data type includes a digital range and a unit of the digital data. The method of responding to the static library modification instruction of the developer, creating a modification code for adding the target data type to the blank table by using a modification script corresponding to the static library according to the target data type in the static library modification instruction, includes: According to the unit of the digital data in the static library modification instruction, the corresponding relationship table between the unit of the digital data and the attribute data type is searched to obtain the attribute data type; According to the acquired attribute data type and the numeric range of the numeric data in the static library modification instruction, a modification code for adding the attribute data type and the numeric data type on the blank form is created.
3. The method according to claim 1, characterized in that The static library modification instructions include the attribute data type and digital data type of the financial business report, The method of responding to the static library modification instruction of the developer, creating a modification code for adding the target data type to the blank table by using a modification script corresponding to the static library according to the target data type in the static library modification instruction, includes: Create modification codes for adding attribute data types and numeric data types to a blank table according to the attribute data types and numeric data types in the static library modification instructions.
4. A device for generating a target program using a static library, characterized in that: The device comprises: an acquisition unit, for acquiring the selected basic static library in response to a developer's selection of a basic static library involved in the program code, wherein the basic static library is a program segment commonly appearing in the program code and is used to generate a blank table, wherein the basic static library contains static code segments, each of which has a corresponding index; A creation unit is used to respond to a static library modification instruction of a developer, and create a modification code for adding the target data type to the blank table by using a modification script corresponding to the static library according to the target data type in the static library modification instruction; the modification script includes a pre-script and a post-script, and the created modification code includes a pre-modification code set in front of the basic static library and a post-modification code set behind the basic static library, and the target data type includes an attribute data type and a digital data type; An adding unit is used to receive the project requirement information input by the developer and obtain an index matching the project requirement information; The adding unit is further used to retain only the static code segment corresponding to the acquired index in the basic static library, and to add the created pre-modification code and post-modification code to the front and back of the retained static code respectively, and place them in the target program framework; The integration unit is used to respond to the developer's packaging instruction for the target program, integrate all the basic static libraries after adding, creating and modifying the code in the target program framework as the target program, and the target program is used to generate financial business reports containing the target data type.
5. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium, characterized in that: The computer stores a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 3.
