Application program generation method, device, equipment and storage medium
By obtaining and marking the dependency components of the target application, and executing business logic code only when the result is marked preset, the problem of unreliable business logic code execution in the existing technology is solved, and the operation efficiency of the application is improved.
Patent Information
- Application Number
- CN202010645490.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-06
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-07-06
AI Technical Summary
In the applications generated in the prior art, the general business logic code will contain the business logic code corresponding to the components that the application does not depend on, resulting in these dependency-free business logic codes being executed, reducing the operation efficiency of the application.
By obtaining the identification of the target application, determining the target component information it depends on, marking distinguishes candidate components, and executing the corresponding business logic code only when the marking result is a preset marking result, thereby generating business logic code that only contains the application-dependent components. application.
It avoids executing business logic code corresponding to components that the application does not depend on, improves the operation efficiency of the application, and quickly determines whether the corresponding business logic code needs to be executed by marking the results.
Smart Images

Figure CN113760345B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and in particular to an application generation method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of computers, more and more engineering projects for generating applications are developing in a componentized manner to split the modules and businesses in the project, reduce the coupling of the project, and facilitate the development and maintenance of the application.
[0003] Generally, you can generate various applications that meet different business functions based on the various components in the project. For example, if the project contains four components A, B, C, and D, you can generate applications that meet the corresponding business functions based on the three components A, B, and C that need to be dependent and the common business logic code developed for these four components.
[0004] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] Since the common business logic code used by the generated application will include the business logic code corresponding to the components that the application does not depend on, the business logic code corresponding to the components that do not depend on will also be executed, which greatly reduces the operating efficiency of the application. Summary of the invention
[0006] The embodiments of the present invention provide an application generation method, apparatus, device and storage medium to avoid executing business logic codes corresponding to components that the application does not depend on, thereby improving the operating efficiency of the application.
[0007] In a first aspect, an embodiment of the present invention provides a method for generating an application program, comprising:
[0008] Obtain a target application identifier corresponding to the target application to be generated;
[0009] Determine, according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier, a target application configuration file corresponding to the target application, wherein the target application configuration file includes information of a target component selected from each candidate component and on which the target application depends;
[0010] Mark and distinguish each candidate component according to the information of the target component on which the target application depends, and obtain a marking result corresponding to each candidate component;
[0011] A target application is generated based on the target components, general business logic codes and marking results corresponding to each candidate component on which the target application depends, wherein the general business logic code includes the business logic code corresponding to each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0012] In a second aspect, an embodiment of the present invention further provides an application generation device, including:
[0013] A target application identifier acquisition module, used to acquire a target application identifier corresponding to a target application to be generated;
[0014] a target application configuration file determining module, configured to determine a target application configuration file corresponding to the target application according to a pre-configured application configuration file corresponding to each application identifier and the target application identifier, wherein the target application configuration file includes information of a target component selected from each candidate component and on which the target application depends;
[0015] A candidate component distinguishing module is used to mark and distinguish each candidate component according to the information of the target component on which the target application depends, and obtain a marking result corresponding to each candidate component;
[0016] A target application generation module is used to generate a target application based on the target components on which the target application depends, the general business logic code and the marking results corresponding to each candidate component, wherein the general business logic code includes the business logic code for executing each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0017] In a third aspect, an embodiment of the present invention further provides a device, the device comprising:
[0018] one or more processors;
[0019] A memory for storing one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the application generation method provided by any embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements an application generation method as provided in any embodiment of the present invention.
[0022] The embodiments of the above invention have the following advantages or beneficial effects:
[0023] By configuring the corresponding application configuration file in advance based on the target components that each application needs to depend on selected from each candidate component, when it is necessary to generate a target application, each candidate component can be marked and distinguished based on the information of the target component that the target application depends on in the target application configuration file corresponding to the target application, and the marking result corresponding to each candidate component can be obtained, so as to use the marking result to distinguish the candidate components that the target application depends on and the candidate components that it does not depend on, and then generate the target application according to the target components that the target application depends on, the general business logic code and the marking results corresponding to each candidate component, so that the business logic code corresponding to each candidate component in the general business logic code is executed when the marking result is the preset marking result, so that only the business logic code corresponding to the component that the application depends on will be executed, and the business logic code corresponding to the component that the application does not depend on will not be executed, thereby avoiding the execution of useless business logic code, and based on the marking result, it can be quickly determined whether the corresponding business logic code needs to be executed, thereby improving the operation efficiency of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flowchart of a method for generating an application program provided in the first embodiment of the present invention;
[0025] Figure 2 It is a flowchart of a method for generating an application program provided in Embodiment 2 of the present invention;
[0026] Figure 3 is a schematic diagram of the structure of an application generating device provided by Embodiment 3 of the present invention;
[0027] Figure 4 It is a structural schematic diagram of a device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0029] Embodiment 1
[0030] Figure 1This is a flowchart of a method for generating an application program provided in the first embodiment of the present invention. This embodiment can be applied to the case where an application program is generated based on components in an engineering project, and in particular, can be used to generate an application program running under the iOS operating system. The method can be executed by an application program generation device, which can be implemented by software and / or hardware and integrated into a device with application program development function. Figure 1 As shown, the method specifically comprises the following steps:
[0031] S110. Obtain a target application identifier corresponding to the target application to be generated.
[0032] The target application may refer to any application (Application, App) that needs to be generated currently. The engineering project may include a development project for generating each application. The target application identifier may refer to an identifier used to uniquely mark the target application so as to distinguish different applications. For example, the target application identifier may refer to the identity code (Bundle ID) of the target application.
[0033] Specifically, when a developer wants to develop a target application, he or she may input a target application identifier by way of information input, so that the development device may obtain the target application identifier corresponding to the target application to be generated.
[0034] S120. Determine a target application configuration file corresponding to a target application according to an application configuration file corresponding to each pre-configured application identifier and a target application identifier, wherein the target application configuration file includes information on a target component that a target application selected from each candidate component depends on.
[0035] Among them, the application configuration file can be a file used to configure application generation, such as an xcconfig file. The application configuration file can be used to determine which components can be used at the code level. The candidate component can refer to each developed component in the engineering project. The target component can refer to a candidate component that meets business needs from various candidate components based on business needs. By relying on the candidate component that meets business needs as the target component, the developed application can have the component function of the target component, thereby realizing the corresponding business function. The information of the target component on which the target application depends may include but is not limited to the identification information corresponding to the target component.
[0036] Specifically, developers can pre-configure an application configuration file corresponding to each application based on the information of the target component on which each application depends, and establish a correspondence between each application identifier and the application configuration file. Therefore, when it is necessary to generate a target application, the target application configuration file corresponding to the target application can be determined from the configured application configuration files based on the correspondence and the target application identifier, so that the information of the target component on which the target application depends can be obtained from the target application configuration file.
[0037] S130. Mark and distinguish each candidate component according to the information of the target component on which the target application depends, and obtain a marking result corresponding to each candidate component.
[0038] The marking result corresponding to the candidate component can be used to characterize whether the candidate component is a component that the target application needs to rely on, so as to distinguish the candidate components that the target application relies on and the candidate components that the target application does not rely on. For example, this embodiment can use different identification methods to distinguish the marking results in different situations, and can also use the existence of identification methods to distinguish the marking results in different situations.
[0039] Specifically, based on the information of the target components that the target application depends on in the target application configuration file, a first marking method can be used to mark the target components in all candidate components, and a second marking method different from the first marking method can be used to mark all candidate components except the target components, so as to obtain the marking results corresponding to each candidate component, and the marking results can be used to distinguish the target components that the target application needs to depend on and other candidate components that it does not depend on.
[0040] Exemplarily, S130 may include: based on information about the target component on which the target application depends, detecting whether each candidate component is the target component on which the target application depends; if so, determining that the marking result corresponding to the candidate component is a first preset identifier; if not, determining that the marking result corresponding to the candidate component is a second preset identifier.
[0041] The first preset identifier and the second preset identifier may refer to two different preset identifiers. For example, the first preset identifier and the second preset identifier may be distinguished by true and false, or by a non-empty identifier and an empty identifier. For example, the first preset identifier is a non-empty mark, that is, the preset identifier exists, and the second preset identifier is an empty identifier, that is, the preset identifier does not exist.
[0042] Specifically, for each candidate component, based on the information of the target component on which the target application in the target application configuration file depends, it can be detected whether the target application configuration file contains information of the candidate component. If so, it indicates that the candidate component is the target component, and at this time, it can be determined that the marking result corresponding to the candidate component is the first preset identifier; if not, it indicates that the candidate component is not the target component, and at this time, it can be determined that the marking result corresponding to the candidate component is the second preset identifier, so that the first preset identifier and the second preset identifier can be used to more quickly mark the target components that the target application needs to depend on and other candidate components that it does not depend on.
[0043] S140. Generate a target application based on the target components, general business logic codes and marking results corresponding to each candidate component on which the target application depends, wherein the general business logic code includes the business logic code corresponding to each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0044] Among them, the target component that the target application depends on can be determined based on the target component dependency configuration file. The component dependency configuration file may refer to the information of the target component that needs to be dependent on configured for the target target name (targetName) of the target application in the class library management tool CocoaPods. The component dependency configuration file can be used to determine which components need to be assembled. The information of the target component that needs to be dependent in the component dependency configuration file may include the target component identifier. The general business logic code is the code written by the developer for all candidate components, which can be applied to the generation of each application, thereby improving development efficiency. The preset marking result may refer to the marking result corresponding to the target component that the target application depends on.
[0045] Specifically, the target component dependency configuration file corresponding to the target application can be determined from the pre-configured component dependency configuration files based on the dependent target name corresponding to the target application. Based on the class library management tool CocoaPods, the target component that the target application depends on can be determined based on the target component information that needs to be dependent in the target component dependency configuration file, and the target components can be dependently assembled, thereby avoiding the installation of candidate components that are not dependent and are not needed. The target components, general business logic codes, and the marking results corresponding to the candidate components after the dependency assembly are packaged and processed, so that the target application can be obtained. The target application can be installed on a device equipped with an iOS operating system for operation. During the operation of the target application, that is, during the execution of the business logic code, the business logic code corresponding to each candidate component is executed when the corresponding marking result is a preset marking result, thereby avoiding the execution of the business logic code corresponding to the component that the target application does not depend on, and based on the marking result, it can quickly determine whether the corresponding business logic code needs to be executed, and the judgment logic is simple, thereby improving the operation efficiency of the application.
[0046] Exemplarily, executing the business logic code corresponding to the candidate component when the corresponding marking result is a preset marking result may include: detecting whether the marking result of the current candidate component corresponding to the current business logic code to be executed is a first preset identifier; if so, allowing the execution of the current business logic code corresponding to the current candidate component; if not, prohibiting the execution of the current business logic code corresponding to the current candidate component.
[0047] Specifically, in the process of executing the general business logic code, that is, in the process of executing the business logic code corresponding to each candidate component in sequence based on the business execution order, before executing each business logic code, it is possible to detect whether the marking result of the candidate component corresponding to the business logic code is the first preset identifier. If so, it indicates that the candidate component is a component that the target application depends on. At this time, the business logic code corresponding to the candidate component can be allowed to be executed, for example, the function function of the candidate component is allowed to be called, so as to execute the business logic code corresponding to the component that the target application depends on, and ensure the normal operation of the target program. If the marking result of the candidate component corresponding to the business logic code is not the first preset identifier, it indicates that the candidate component is a component that the target application does not depend on. At this time, the execution of the business logic code corresponding to the candidate component can be prohibited, the business logic code of the candidate component can be skipped, and the business logic code of the subsequent candidate components can be executed, thereby avoiding the execution of the business logic code corresponding to the component that the target application does not depend on, and improving the operation efficiency of the application while ensuring the normal operation of the target program.
[0048] The technical solution of this embodiment configures a corresponding application configuration file in advance based on the target components that each application needs to depend on selected from each candidate component. Therefore, when it is necessary to generate a target application, each candidate component can be marked and distinguished based on the information of the target component that the target application depends on in the target application configuration file corresponding to the target application, and a marking result corresponding to each candidate component can be obtained, so that the candidate components that the target application depends on and the candidate components that it does not depend on can be distinguished by using the marking result, and then the target application is generated according to the target components that the target application depends on, the general business logic code and the marking results corresponding to each candidate component, so that the business logic code corresponding to each candidate component in the general business logic code is executed when the marking result is a preset marking result, so that only the business logic code corresponding to the component that the application depends on will be executed, and the business logic code corresponding to the component that the application does not depend on will not be executed, thereby avoiding the execution of useless business logic code, and based on the marking result, it can be quickly determined whether the corresponding business logic code needs to be executed, thereby improving the running efficiency of the application.
[0049] On the basis of the above technical solution, the information of the target component that the target application depends on is: the macro field information corresponding to the target component that the target application depends on; according to the information of the target component that the target application depends on, detecting whether each candidate component is the target component that the target application depends on, including: according to the macro field information corresponding to the target component that the target application depends on, detecting whether there is macro information corresponding to each candidate component.
[0050] The macro field information may be predefined macro information corresponding to the target component that the target application depends on. For example, the macro information may be defined by assignment. The macro field information may be configured as a parameter value of a GCC precompiled header parameter (GCC_PREPROCESSOR_DEFINITIONS) in the target application configuration file xcconfig. For example, the target application configuration file may be configured as follows:
[0051] APP_DISPLAY_NAME = test configuration
[0052] APP_BUNDLE_ID=com.jd.test.app
[0053] APP_VERSION=1.0.0
[0054] GCC_PREPROCESSOR_DEFINITIONS=$(inhertited)ComponentsA=1 ComponentsB=1 ComponentsC=1
[0055] Among them, APP_DISPLAY_NAME may refer to the application name. APP_BUNDLE_ID may refer to the application identification code, that is, the application identifier. APP_VERSION may refer to the application version information. ComponentsA, ComponentsB, and ComponentsC refer to the target components A, B, and C that the target application depends on. ComponentsA=1 is used to represent the macro information of component A. ComponentsB=1 is used to represent the macro information of component B. ComponentsC=1 is used to represent the macro information of component C.
[0056] Specifically, the characteristics of the target application configuration file xcconfig can be used to control the execution of the business logic code based on the macro information of the component. By detecting whether there is macro information corresponding to the candidate component in the target application configuration file, if so, determining the marking result corresponding to the candidate component as the first preset identifier; if not, determining the marking result corresponding to the candidate component as the second preset identifier, the marking result corresponding to each candidate component can be determined more quickly, so that when the macro information of the candidate component exists, the business logic code corresponding to the candidate component is executed, and when the macro information of the candidate component does not exist, the business logic code corresponding to the candidate component will not be executed, thereby ensuring that no dependent components will be installed or used, effectively improving the operating efficiency of the application.
[0057] On the basis of the above technical solution, before S120, the method may further include: obtaining a preset configuration file using a structured description language corresponding to each application; and generating an application configuration file corresponding to the application according to the preset configuration file using a first preset script.
[0058] Among them, the first preset script may refer to a pre-written Shell script for generating an application configuration file. The structured description language may be, but is not limited to, JavaScript object notation JSON language. The preset configuration file may be a pre-configured file containing basic information of the application and information of each target component on which the application depends. The basic information of the application appInfo may include, but is not limited to: application name appName, application identifier bundleld, application version information version, and application dependent target name targetName. The target component information componentsInfo on which the application depends may include, but is not limited to: target component name, target component identifier, and target component version information. Exemplarily, the preset configuration file may include a two-layer configuration structure, the first layer is used to configure the basic information of the application, and the second layer is used to configure the component information on which the application depends. For example, the preset configuration file may be configured as follows:
[0059]
[0060]
[0061] Among them, ComponentsA, ComponentsB and ComponentsC refer to the three target components A, B and C that the application depends on.
[0062] Specifically, the developer can use the structured description language to write a corresponding preset configuration file for each application in advance, so as to obtain the preset configuration file corresponding to each application. By running the first preset script, the application configuration file corresponding to the application can be automatically generated based on the preset configuration file, so that the developer does not need to manually write the application configuration file, thereby improving the efficiency of generating the application configuration file and improving the efficiency of developing the application.
[0063] Embodiment 2
[0064] Figure 2 This is a flowchart of an application generation method provided in the second embodiment of the present invention. Based on the above embodiments, this embodiment describes in detail the process of generating a target application under a specified target operating environment. On this basis, the step of "generating a target application according to the target components, general business logic codes and marking results corresponding to each candidate component that the target application depends on" is also optimized. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0065] See also Figure 2 The application generation method provided in this embodiment specifically includes the following steps:
[0066] S210: Obtain a target application identifier corresponding to the target application to be generated.
[0067] S220: Obtain a target operating environment corresponding to the target application.
[0068] The target operating environment may refer to the environment in which the target application to be generated needs to run. The target operating environment may refer to the test environment Debug or the release environment Release. Different operating environments may rely on different components to generate applications under different operating environments.
[0069] Specifically, developers can input a specified target operating environment by inputting information based on business needs, so that the development device can obtain the target operating environment corresponding to the target application.
[0070] It should be noted that the execution order of step S220 is not limited here. For example, step S220 can be executed sequentially after step S210, or before step S210, or simultaneously with step S210.
[0071] S230: Determine a candidate application configuration file corresponding to the target application according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier.
[0072] Specifically, an application configuration file corresponding to each application identifier in different operating environments can be pre-configured. Each operating environment corresponds to an application configuration file. For example, for each application, an application configuration file under the test environment Debug and the release environment Release are configured respectively. Based on the target application identifier, multiple candidate application configuration files corresponding to the pre-configured target application can be obtained, that is, the application configuration files configured in each operating environment.
[0073] Exemplarily, before S230, it also includes: obtaining a preset configuration file corresponding to each application described in a structured language; using a first preset script, generating an application configuration file corresponding to the application according to the preset configuration file. Specifically, when distinguishing the operating environment, the preset configuration file also needs to include operating environment information. For example, the preset configuration file may include: basic information of the application and information of each target component that the application depends on under each preset operating environment. The preset operating environment may include a test environment and a release environment. For example, the preset configuration file may be configured as follows:
[0074]
[0075]
[0076] It can be seen from the above preset configuration files that: in the test environment Debug, the components that the application needs to rely on are: ComponentsA, ComponentB and ComponentC. In the release environment Release, the components that the application needs to rely on are: ComponentsA, ComponentC and ComponentdD. By running the first preset script, an application configuration file for each preset operating environment can be automatically generated based on the preset configuration file, such as the application configuration file under the test environment Debug and the application configuration file under the release environment Release. This eliminates the need for developers to manually write application configuration files under different operating environments, further improving the efficiency of generating application configuration files, while also improving the efficiency of application development.
[0077] S240: Determine a target application configuration file corresponding to the target application according to the preset operating environment and the target operating environment corresponding to each candidate application configuration file.
[0078] Specifically, based on the operating environment corresponding to each candidate application configuration file, the candidate application configuration file corresponding to the target operating environment can be determined, that is, the target application configuration file is obtained, so that target applications in different operating environments can be generated based on the target application configuration files in different operating environments. There is no need to add additional code, which is easy to maintain and has high scalability.
[0079] S250: Mark and distinguish each candidate component according to the information of the target component on which the target application depends, and obtain a marking result corresponding to each candidate component.
[0080] S260: Determine a target component dependency configuration file corresponding to a target application program according to a pre-configured component dependency configuration file corresponding to each application program.
[0081] The component dependency configuration file may refer to the information of the target components that need to be dependent on in different operating environments, which is configured for each application's dependency target name (targetName) in the class library management tool CocoaPods. The component dependency configuration file may be used to determine which components need to be assembled in each operating environment. For example, the component dependency configuration file may be configured as follows:
[0082]
[0083]
[0084] Among them, source refers to the address information of the component library; platform refers to the operating system version information supported by the component; TsetTarge refers to the specific dependent target name of the application.
[0085] Specifically, this embodiment can pre-configure a component dependency configuration file corresponding to each application based on business needs, and can establish a correspondence between the dependency target name targetName corresponding to each application and the component dependency configuration file, so that the target component dependency configuration file corresponding to the target application can be determined based on the correspondence and the target dependency target name corresponding to the target application.
[0086] It should be noted that the execution order of step S260 is not limited here. For example, step S260 can be executed sequentially after step S250, or before step S250.
[0087] Exemplarily, before S260, the process may further include: obtaining a preset configuration file using a structured description language corresponding to each application; and generating a component dependency configuration file corresponding to the application according to the preset configuration file using a second preset script.
[0088] Specifically, by running the second preset script, the component dependency configuration file corresponding to the application can also be automatically generated based on the preset configuration file, so that the corresponding application configuration file and component dependency configuration file can be automatically generated based on the preset configuration file, without the need for developers to manually write application configuration files and component dependency configuration files, which greatly improves the configuration file generation efficiency and thus improves the application development efficiency.
[0089] S270. Based on the class library management tool CocoaPods, according to the target component dependency configuration file and the target operating environment, determine the target components that the target application depends on, and perform dependency assembly on each target component.
[0090] Specifically, based on the target component dependency configuration file, the target components that the target application depends on in the target operating environment are obtained, and the class library management tool CocoaPods is used to perform dependency assembly on each target component, so that the class library management tool CocoaPods can install the components required in the target operating environment and will not install components that are not required in the target operating environment, thereby reducing the package size of the target application.
[0091] S280. Package and process the target components after dependency assembly, the general business logic code, and the marking results corresponding to the candidate components to obtain a target application; wherein the general business logic code includes the business logic code corresponding to each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0092] Specifically, by adding operating environment information to the application configuration file and the component dependency configuration file, it is possible to support the generation of target applications in different operating environments, thereby being compatible with multiple business models, and in each operating environment, it is possible to seamlessly shield components and business logic codes that are not required in the operating environment, without causing business confusion and facilitating maintenance.
[0093] The technical solution of this embodiment can obtain the marking results corresponding to each candidate component in the target operating environment based on the target application configuration file in the target operating environment, so as to avoid executing the business logic code corresponding to the component that the target application does not depend on in the target operating environment based on the marking results. And based on the target component dependency configuration file, the target components that the target application needs to depend on in the target operating environment can be dependently assembled, so as to avoid installing components that are not needed in the target operating environment, and further support the generation of target applications in different operating environments, compatible with multiple business models, and will not cause business confusion, which is easy to maintain.
[0094] The following is an embodiment of an application generation device provided in an embodiment of the present invention. The device and the application generation methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the application generation device, please refer to the embodiment of the above-mentioned application generation method.
[0095] Embodiment 3
[0096] Figure 3 This is a schematic diagram of the structure of an application generation device provided by Embodiment 3 of the present invention. This embodiment is applicable to the case where an application is generated based on components in an engineering project. Figure 3 As shown, the device specifically includes: a target application identification acquisition module 310, a target application configuration file determination module 320, a candidate component distinction module 330 and a target application generation module 340.
[0097] Among them, the target application identifier acquisition module 310 is used to obtain the target application identifier corresponding to the target application to be generated; the target application configuration file determination module 320 is used to determine the target application configuration file corresponding to the target application based on the pre-configured application configuration file corresponding to each application identifier and the target application identifier, and the target application configuration file includes information about the target component on which the target application selected from each candidate component depends; the candidate component distinction module 330 is used to mark and distinguish each candidate component based on the information about the target component on which the target application depends, and obtain the marking result corresponding to each candidate component; the target application generation module 340 is used to generate the target application based on the target component on which the target application depends, the general business logic code and the marking result corresponding to each candidate component, wherein the general business logic code includes the business logic code for executing each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0098] Optionally, the candidate component distinguishing module 330 includes:
[0099] A candidate component detection unit, used to detect whether each candidate component is a target component that the target application depends on, based on information about the target component that the target application depends on;
[0100] A first identification unit, configured to determine that, if yes, the marking result corresponding to the candidate component is a first preset identification;
[0101] The second marking unit is used to determine that the marking result corresponding to the candidate component is a second preset identifier if no.
[0102] Optionally, the information of the target component on which the target application depends is: macro field information corresponding to the target component on which the target application depends; the candidate component detection unit is specifically used to: detect whether there is macro information corresponding to each candidate component based on the macro field information corresponding to the target component on which the target application depends.
[0103] Optionally, the device further comprises:
[0104] The code execution control module is used to: detect whether the marking result of the current candidate component corresponding to the current business logic code to be executed is a first preset identifier; if so, allow the execution of the current business logic code corresponding to the current candidate component; if not, prohibit the execution of the current business logic code corresponding to the current candidate component.
[0105] Optionally, the device further comprises:
[0106] A target operating environment acquisition module is used to acquire the target operating environment corresponding to the target application program;
[0107] The target application profile determination module 320 is specifically used to: determine the candidate application profile corresponding to the target application based on the application profile corresponding to each pre-configured application identifier and the target application identifier; determine the target application profile corresponding to the target application based on the preset operating environment and the target operating environment corresponding to each candidate application profile.
[0108] Optionally, the device further comprises:
[0109] A preset configuration file acquisition module, used to acquire a preset configuration file using a structured description language corresponding to each application before determining a target application configuration file corresponding to a target application according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier;
[0110] The application configuration file generation module is used to generate an application configuration file corresponding to the application according to the preset configuration file using the first preset script.
[0111] Optionally, the preset configuration file includes: basic information of the application and information of each target component that the application depends on in each preset operating environment; wherein the preset operating environment includes a test environment and a release environment.
[0112] Optionally, the target application generating module 340 is specifically used for:
[0113] According to the pre-configured component dependency configuration file corresponding to each application, the target component dependency configuration file corresponding to the target application is determined; based on the class library management tool CocoaPods, according to the target component dependency configuration file and the target operating environment, the various target components that the target application depends on are determined, and dependency assembly is performed on each target component; the target components after dependency assembly, the common business logic code and the marking results corresponding to each candidate component are packaged and processed to obtain the target application.
[0114] Optionally, the device further comprises:
[0115] A preset configuration file acquisition module is used to acquire a preset configuration file using a structured description language corresponding to each application before determining a target component dependency configuration file corresponding to a target application according to a pre-configured component dependency configuration file corresponding to each application;
[0116] The component dependency configuration file generation module is used to generate a component dependency configuration file corresponding to the application program according to the preset configuration file using the second preset script.
[0117] The application generation device provided in the embodiment of the present invention can execute the application generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the application generation method.
[0118] It is worth noting that in the embodiment of the above-mentioned application generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0119] Embodiment 4
[0120] Figure 4 A schematic diagram of the structure of a device provided in Embodiment 4 of the present invention. Figure 4 A block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0121] like Figure 4 As shown, device 12 is in the form of a general purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0122] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0123] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.
[0124] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0125] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0126] The device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the device 12, and / or may communicate with any device that enables the device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0127] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the steps of an application generation method provided in the embodiment of the present invention, the method comprising:
[0128] Obtain a target application identifier corresponding to the target application to be generated;
[0129] Determine a target application configuration file corresponding to a target application according to an application configuration file corresponding to each pre-configured application identifier and a target application identifier, wherein the target application configuration file includes information of a target component that the target application selected from each candidate component depends on;
[0130] According to the information of the target component that the target application depends on, each candidate component is marked and distinguished, and a marking result corresponding to each candidate component is obtained;
[0131] A target application is generated based on the target components, general business logic codes and marking results corresponding to each candidate component on which the target application depends, wherein the general business logic code includes the business logic code corresponding to each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0132] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the application generation method provided by any embodiment of the present invention.
[0133] Embodiment 5
[0134] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the application program generation method provided in any embodiment of the present invention are implemented. The method includes:
[0135] Obtain a target application identifier corresponding to the target application to be generated;
[0136] Determine a target application configuration file corresponding to a target application according to an application configuration file corresponding to each pre-configured application identifier and a target application identifier, wherein the target application configuration file includes information of a target component that the target application selected from each candidate component depends on;
[0137] According to the information of the target component that the target application depends on, each candidate component is marked and distinguished, and a marking result corresponding to each candidate component is obtained;
[0138] A target application is generated based on the target components, general business logic codes and marking results corresponding to each candidate component on which the target application depends, wherein the general business logic code includes the business logic code corresponding to each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
[0139] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0140] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0141] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0142] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0143] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0144] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating an application, characterized in that: include: Obtain a target application identifier corresponding to the target application to be generated; Determine, according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier, a target application configuration file corresponding to the target application, wherein the target application configuration file includes information of a target component selected from each candidate component and on which the target application depends; Mark and distinguish each candidate component according to the information of the target component on which the target application depends, and obtain a marking result corresponding to each candidate component; A target application is generated based on the target components, general business logic codes and marking results corresponding to each candidate component on which the target application depends, wherein the general business logic code includes the business logic code corresponding to each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
2. The method according to claim 1, characterized in that According to the information of the target component on which the target application depends, each candidate component is marked and distinguished to obtain a marking result corresponding to each candidate component, including: According to the information of the target component on which the target application depends, detecting whether each candidate component is the target component on which the target application depends; If yes, determining that the marking result corresponding to the candidate component is the first preset identifier; If not, it is determined that the marking result corresponding to the candidate component is the second preset identifier.
3. The method according to claim 2, characterized in that The information of the target component that the target application depends on is: the macro field information corresponding to the target component that the target application depends on; The detecting, based on the information of the target component on which the target application depends, whether each candidate component is the target component on which the target application depends includes: According to the macro field information corresponding to the target component on which the target application depends, it is detected whether there is macro information corresponding to each candidate component.
4. The method according to claim 2, characterized in that: When the corresponding marking result is a preset marking result, the business logic code corresponding to the candidate component is executed, including: Detecting whether the marking result of the current candidate component corresponding to the current business logic code to be executed is a first preset identifier; If yes, then the current business logic code corresponding to the current candidate component is allowed to execute; If not, the execution of the current business logic code corresponding to the current candidate component is prohibited.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining a target operating environment corresponding to the target application; The step of determining the target application configuration file corresponding to the target application according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier comprises: Determine a candidate application configuration file corresponding to the target application according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier; According to the preset operating environment corresponding to each of the candidate application configuration files and the target operating environment, a target application configuration file corresponding to the target application is determined.
6. The method according to claim 1 or 5, characterized in that: Before determining the target application configuration file corresponding to the target application according to the pre-configured application configuration file corresponding to each application identifier and the target application identifier, the method further includes: Obtaining a preset configuration file corresponding to each application using a structured description language; An application configuration file corresponding to the application is generated according to the preset configuration file using the first preset script.
7. The method according to claim 6, characterized in that The preset configuration file includes: basic information of the application and information of each target component that the application depends on in each preset operating environment; wherein the preset operating environment includes a test environment and a release environment.
8. The method according to claim 5, characterized in that Generate a target application according to the target components, common business logic codes and marking results corresponding to each candidate component on which the target application depends, including: Determine the target component dependency configuration file corresponding to the target application according to the pre-configured component dependency configuration file corresponding to each application; Based on the class library management tool CocoaPods, according to the target component dependency configuration file and the target operating environment, each target component that the target application depends on is determined, and dependency assembly is performed on each target component; The target components after dependency assembly, the common business logic code and the marking results corresponding to the candidate components are packaged to obtain the target application.
9. The method according to claim 8, characterized in that Before determining the target component dependency configuration file corresponding to the target application according to the pre-configured component dependency configuration file corresponding to each application, the method further includes: Obtaining a preset configuration file corresponding to each application using a structured description language; A component dependency configuration file corresponding to the application is generated according to the preset configuration file using a second preset script.
10. An application generation device, characterized in that: include: A target application identifier acquisition module, used to acquire a target application identifier corresponding to a target application to be generated; a target application configuration file determining module, configured to determine a target application configuration file corresponding to the target application according to a pre-configured application configuration file corresponding to each application identifier and the target application identifier, wherein the target application configuration file includes information of a target component selected from each candidate component and on which the target application depends; A candidate component distinguishing module is used to mark and distinguish each candidate component according to the information of the target component on which the target application depends, and obtain a marking result corresponding to each candidate component; A target application generation module is used to generate a target application based on the target components on which the target application depends, the general business logic code and the marking results corresponding to each candidate component, wherein the general business logic code includes the business logic code for executing each candidate component, and the business logic code corresponding to the candidate component is executed when the corresponding marking result is a preset marking result.
11. A device, characterized in that: The device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the application generation method as described in any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the application generation method as described in any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Construction method and device of building block type software
CN104778033A
Education development system based on component module
CN108897530A