A software architecture generation, calling method and device
By configuring the calling relationships between component libraries and components, a software architecture based on the Swift platform is generated, which solves the problem of the limited and scattered Swift platform libraries and simplifies the application development process.
Patent Information
- Application Number
- CN202111351531.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-11-16
AI Technical Summary
Because the Swift platform has been open for a relatively short time, there are few existing libraries, and they are scattered. Application developers need to create a large number of low-level libraries to support the operation of their applications, resulting in high development complexity.
By obtaining the call relationships between component libraries and components, as well as the call relationships between component libraries, and configuring code snippets and file packages for the software architecture, a method for generating software architecture based on the Swift platform is provided, simplifying the development process.
It simplifies the application development process based on the Swift platform, reduces development complexity, and improves development efficiency.
Smart Images

Figure CN113986207B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for generating and calling a software architecture. Background Art
[0002] Apple released the Swift platform at the 2014 Developer Conference and opened up the Swift source code, including the compiler and standard library. Swift is an open source programming language that supports multiple programming paradigms and compilation, and is mainly used to develop applications for systems such as IOS, Mac OSX, and watch OS.
[0003] Since the Swift platform has been open for a short time, there are currently few libraries available for use on the Swift platform, and the libraries available on the Swift platform are also relatively scattered. If application developers need to develop applications based on the Swift platform, they need to create a large number of underlying libraries that can support the application based on the Swift platform to support the operation of the application. Therefore, a software architecture based on the Swift platform is urgently needed. Summary of the invention
[0004] The embodiments of the present application provide a software architecture generation and calling method and device, which are used to provide a way to develop software architecture based on the Swift platform.
[0005] In a first aspect, a software architecture generation method is provided, comprising: obtaining architecture information required for creating a software architecture, the architecture information comprising first calling information and second calling information, the first calling information being used to represent a first calling relationship between a plurality of component libraries and components respectively contained in the plurality of component libraries, the second calling information being used to represent a second calling relationship between the plurality of component libraries, the components being used to represent functional modules required for creating the software architecture; performing the following operations for each of the plurality of component libraries: based on the first calling information, configuring a calling relationship between a code snippet of a component library and a code snippet of a component contained in the component library, and obtaining a code file of the component library, wherein a code snippet of a component library and a code snippet of a component are both generated based on a Swift platform; based on the second calling information, configuring a calling relationship between the code files of the plurality of component libraries respectively, and obtaining an architecture code file package of the software architecture.
[0006] In an embodiment of the present application, based on the calling relationship between the component library included in the software architecture and the components included in the component library, the calling relationship between the code snippets of the component library and the code snippets of the components included therein can be configured; based on the calling relationship between multiple component libraries corresponding to the software architecture, the calling relationship between the code files between multiple component libraries can be configured, thereby creating an architecture code file package corresponding to the software architecture. In this way, a method for creating a software architecture based on the Swift platform is provided, which provides an architectural foundation for the subsequent development of applications based on the Swift platform and simplifies the process of subsequent application development.
[0007] In a possible implementation, the first calling information includes the names of the multiple component libraries and the names of the components contained in each component library; based on the first calling information, configuring a calling relationship between a code snippet of a component library and a code snippet of a component contained in the component library, and obtaining a code file of the component library, including: obtaining a code snippet of a component contained in the component library based on the name of the component contained in the component library, and obtaining a code snippet of the component library based on the name of the component library; encapsulating the code snippet of the component contained in the component library, wherein the encapsulated code snippets of the components contained in the component library provide the same sub-interface to the outside; configuring a calling relationship between the code snippet of the component library and the sub-interface, and obtaining the configured code snippet of the component library; encapsulating the configured code snippet of the component library, and obtaining the code file of the component library, wherein the code file of the component library provides an interface to the outside.
[0008] In this implementation, the code snippets corresponding to the component library can be obtained based on the name of the component library, and the code snippets corresponding to the components contained in the component library can be encapsulated for the code snippets of multiple components under the same component library, so that the component library only needs to call one sub-interface, which is equivalent to calling each component, simplifying the calling method between the component library and each component. In addition, when developing applications based on the software architecture in the future, there is no need to pay attention to the code snippets of the components, reducing the workload of application development.
[0009] In a possible implementation, the code snippet of the component contained in the component library includes the name of the data model corresponding to the component, and the data model name is used to index the data model corresponding to the component.
[0010] In this implementation, since the Swift platform supports reflection, when the architecture code file package of the software architecture is subsequently run, the specific data model can be directly indexed based on the data model name. On the one hand, it can simplify the development of the component code snippet, and on the other hand, it does not introduce overly specific data models in the component code snippet, thus avoiding the need to modify the code during subsequent application development.
[0011] In a possible implementation, based on the second calling information, the calling relationship between the code files of the multiple component libraries is configured to obtain the architecture code file package of the software architecture, including: based on the second calling information, the calling relationship between the interfaces provided to the outside by the code files of the multiple component libraries is configured to obtain the architecture code file package of the software architecture.
[0012] In this embodiment, the code file of a component library can be encapsulated so that other components can directly call the interface of the component library without paying attention to the underlying code of the component library, thereby simplifying the development process of the software architecture.
[0013] In one possible implementation, the multiple component libraries include a basic component library, a public component library, and a main project private integrated component library, wherein: the basic component library includes components for implementing basic functions corresponding to the business; the public component library includes components for implementing general functions corresponding to the business; the main project private integrated component library includes components for composite functions corresponding to the business.
[0014] In this embodiment, several component libraries are provided, including a basic component library, a public component library and a main project private integrated component library, which provide components with respective functions for subsequent development applications to reduce the difficulty of subsequent development applications.
[0015] In a second aspect, an embodiment of the present application provides a software architecture calling method, comprising: obtaining an architecture code file package of a software architecture, wherein the architecture code file package is generated by a software architecture generation method as described in any one of the first aspects; according to an input operation, obtaining a business code file package of an application to be developed; loading the architecture code file package and the business code file package into a setting directory to obtain an application development package for the application.
[0016] In an embodiment of the present application, the corresponding business code file package can be loaded directly based on the developed software architecture to generate a code development package for the application, providing a method for developing applications based on the software architecture of the Swift platform and simplifying the process of developing applications based on the Swift platform.
[0017] In a third aspect, a software architecture generation device is provided, comprising: an acquisition module, used to acquire architecture information required for creating a software architecture, the architecture information comprising first call information and second call information, the first call information being used to represent a first call relationship between multiple component libraries and components respectively contained in the multiple component libraries, and the second call information being used to represent a second call relationship between multiple component libraries, the components being used to represent functional modules required for creating the software architecture; a first configuration module, used to perform the following operations for each of the multiple component libraries: based on the first call information, configuring a call relationship between a code snippet of a component library and a code snippet of a component contained in the component library, to obtain a code file of the component library, wherein a code snippet of a component library and a code snippet of a component are both generated based on the Swift platform; a second configuration module, used to configure a call relationship between the code files of each of the multiple component libraries based on the second call information, to obtain an architecture code file package of the software architecture.
[0018] In a possible implementation, the first calling information includes the names of the multiple component libraries and the names of the components contained in each component library; the first configuration module is specifically used to: obtain the code snippets of the components contained in the one component library based on the names of the components contained in the one component library, and obtain the code snippets of the one component library based on the name of the one component library; encapsulate the code snippets of the components contained in the one component library, wherein the encapsulated code snippets of the components contained in the one component library provide the same sub-interface to the outside; configure the calling relationship between the code snippets of the one component library and the sub-interface to obtain the configured code snippets of the one component library; encapsulate the configured code snippets of the one component library to obtain the code file of the one component library, wherein the code file of the one component library provides an interface to the outside.
[0019] In a possible implementation, the code snippet of the component contained in the component library includes the name of the data model corresponding to the component, and the data model name is used to index the data model corresponding to the component.
[0020] In a possible implementation, the second configuration module is specifically used to: configure the calling relationship between the interfaces provided externally by the code files of the respective component libraries based on the second calling information, and obtain the architecture code file package of the software architecture.
[0021] In one possible implementation, the multiple component libraries include a basic component library, a public component library, and a main project private integrated component library, wherein: the basic component library includes components for implementing basic functions corresponding to the business; the public component library includes components for implementing general functions corresponding to the business; the main project private integrated component library includes components for composite functions corresponding to the business.
[0022] In a fourth aspect, a software architecture calling device is provided, comprising: an acquisition module, used to obtain an architecture code file package of the software architecture, wherein the architecture code file package is generated by any method as described in the first aspect, and based on an input operation, a business code file package of an application to be developed is obtained; a loading module, used to load the architecture code file package and the business code file package into a set directory to obtain an application development package of the application.
[0023] In a fifth aspect, a computer device comprises: at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements a method as described in any one of the first aspect or the second aspect by executing the instructions stored in the memory.
[0024] In a sixth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes the method as described in any one of the first aspect or the second aspect.
[0025] Regarding the beneficial effects of the second to sixth aspects, reference may be made to the beneficial effects of the first aspect and any possible implementation manner, and they are not listed here again. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of an application scenario applicable to the embodiment of the present application;
[0027] Figure 2 A flowchart of a method for generating a software architecture provided in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of an architecture information provided by an embodiment of the present application;
[0029] Figure 4 A schematic diagram of a process of generating a component provided in an embodiment of the present application;
[0030] Figure 5 A flowchart of a software architecture calling method provided in an embodiment of the present application;
[0031] Figure 6A schematic diagram of the structure of a software architecture generation device provided in an embodiment of the present application;
[0032] Figure 7 A schematic diagram of the structure of a software architecture calling device provided in an embodiment of the present application;
[0033] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to better understand the technical solution provided by the embodiments of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0035] The embodiment of the present application provides a software architecture generation method for generating a software architecture based on the Swift platform. In this method, the calling relationship between the component library and the components contained therein can be used to configure the calling relationship between the code snippets of the component library and the code snippets of the components contained in the component library, and the calling relationship between multiple component libraries can be used to configure the calling relationship between the code snippets of each component library to generate an architecture code file package of the software architecture, thereby providing a method for generating a software architecture based on the Swift platform. In addition, the architecture code file package of the software architecture can be directly generated based on the calling relationship between the component library and the components contained therein, and the calling relationship between multiple component libraries, providing a way to simply generate the software architecture.
[0036] The software architecture generation method in the embodiment of the present application can be executed by a software architecture generation device, and the software architecture generation device can be implemented by a device with computing functions, including but not limited to a personal computer or a server, etc. The server can be a virtual server or a physical server, which is not limited in the embodiment of the present application.
[0037] Combine the following Figure 1 The deployment diagram of the computer device shown in the figure provides an example introduction to the deployment of the computer device. Figure 1 It can also be understood as a schematic diagram of an application scenario of the software architecture generation method in the embodiment of the present application. Figure 1 As shown, the application scenario diagram includes a software architecture generation device 110, a storage device 120, and a software architecture calling device 130. The implementation of the software architecture generation device 110 can refer to the above. The storage device 120 can be implemented by a device with storage and transmission functions, such as a server. The implementation of the software architecture calling device 130 can refer to the implementation of the software architecture generation device 110, which is not listed here. Figure 1In the figure, a personal computer is used to implement the software architecture generation device 110 and the software architecture calling device 130 as an example, and a server is used to implement the storage device 120 as an example, but the specific implementation methods of the software architecture generation device 110, the storage device 120 and the software architecture calling device 130 are not actually limited.
[0038] The software architecture generation device 110 is used to generate an architecture code file package corresponding to the software architecture. The method of generating the architecture code file package will be described below. After generating the architecture code file package, the software architecture generation device 110 may store the architecture code file package in the storage device 120. The storage device 120 stores the architecture code file package. Subsequently, the software architecture calling device 130 may obtain the architecture code file package from the storage device 120 or the software architecture generation device 110, and generate an application development package based on the architecture code file package, wherein the process of generating the application development package is described below.
[0039] The following is an introduction to the software architecture generation method in the embodiment of the present application in conjunction with the accompanying drawings.
[0040] Please refer to Figure 2 , is a flowchart of a software architecture generation method provided in an embodiment of the present application. Figure 1 The method for generating a software architecture for a personal computer shown in the figure is introduced as an example.
[0041] Step 21, obtaining the architecture information required to create the software architecture.
[0042] Software architecture can be understood as the functional framework required for developing applications, and software architecture can actually be implemented by multiple components. Components are used to represent the functional modules required to create software architecture, or can be understood as functional units. Therefore, when creating software architecture, the personal computer device needs to first obtain the architecture information corresponding to the software architecture. Among them, the architecture information is used to describe the overall architecture of the software architecture. Among them, the architecture information can be in various forms, such as text, tables or pictures.
[0043] Exemplarily, the architecture information includes first call information and second call information. The first call information is used to indicate a first call relationship between multiple component libraries and components contained in each of the multiple component libraries. The second call information is used to indicate a second call relationship between multiple component libraries. As an example, the first call information includes the names of multiple component libraries and the names of the components contained in each component library. The second call information includes the call relationship between the multiple component libraries.
[0044] As an example, the plurality of component libraries include (1) a basic component library, (2) a public component library, and (3) a main project private integrated component library. The basic component library includes components for implementing basic functions corresponding to the business. The public component library includes components for implementing common functions corresponding to the business. The main project private integrated component library includes components for complex functions corresponding to the business, for example, each component in the main project private integrated component library is obtained by combining the functions of components in the basic component library and / or components in the public component library.
[0045] Furthermore, the plurality of component libraries may also include one or both of (4) main engineering and (5) business components. The main engineering component library includes components for implementing the main business functions of the business. The business components are components for implementing the basic business functions of the business.
[0046] To more clearly illustrate multiple component libraries, Figure 3 A schematic diagram of the architectural information shown is used for introduction.
[0047] (1) The basic component library includes one or more of user interface (UI) components, network components, image loading components, and tool components (such as system classes that encapsulate and / or parse data (date), string, Json, etc.).
[0048] For example, UI components can encapsulate commonly used UI controls into components, provide parameter customization, and improve usability and scalability. Network components are used to implement network request functions. Using unified network components can reduce the difficulty of subsequent maintenance of software architecture. Image loading components can implement functions such as asynchronous loading of images or caching of images.
[0049] (2) Public component library, which can also be called common functional component library. The components in the public component library can be divided into middleware and large components according to the size of the components. The public component library includes, for example, one or more of database components, sharing components, instant messaging (IM) components, and push components. The database component is used to implement various database operations, such as adding, deleting or changing, querying or updating the database. In addition, the public component library can also include third-party functional components, where the third-party functional components are used to process services provided by third parties, for example, to encapsulate and process services provided by third parties to facilitate timely updates of services provided by third parties.
[0050] (3) The main project's private integrated component library, for example, includes integrated basic components and non-component public use parts.
[0051] (4) The business component library may include, for example, one or more of a user component, an invoice management component, a login and registration component, and a setting component.
[0052] (5) Main project components, such as one or more of a home page component, an invoicing component, an invoice query component, and an account management component.
[0053] In a possible embodiment, the calling relationship of multiple component libraries from top to bottom is: main project component, business component library, main project private integration component library, public component library and basic component library. Figure 3 Arrows are used to illustrate the calling relationship between multiple component libraries, where the component library pointed by the arrow represents the called component library.
[0054] The above is an introduction to the architecture information. The following is an example of how a personal computer obtains the architecture information.
[0055] Method 1: Obtain the architecture information according to the user's input operation.
[0056] Specifically, the user may perform input operations on the personal computer, and the personal computer obtains the architecture information according to the input operations.
[0057] Method 2: The personal computer obtains the architecture information from other devices. Other devices refer to devices other than personal computer devices. The method for other devices to obtain architecture information can refer to the method for personal computers to obtain architecture information, which will not be repeated here.
[0058] Step 22, performing the following operations for each of the plurality of component libraries: based on the first calling information, configuring a calling relationship between a code snippet of a component library and a code snippet of a component included in the component library, and obtaining a code file of the component library.
[0059] A personal computer needs to first obtain the code snippets corresponding to each of the multiple component libraries, as well as the code files corresponding to the components contained in each component library, and then configure the calling relationship between the code snippets of the component library and the code snippets of the components contained in the component library. The following is an example of how a personal computer obtains the code snippets corresponding to each of the multiple component libraries, as well as the code files corresponding to the components contained in each component library.
[0060] Example 1: A personal computer may be pre-configured with code snippets corresponding to multiple component libraries and code files corresponding to components contained in each component library. The code snippets of the component library and the code snippets of the components are all developed based on the Swift platform, so that the software architecture subsequently developed based on these components is compatible with the Swift platform.
[0061] In a possible embodiment, a code snippet of a component included in a component library includes a data model name corresponding to the component, and the data model name is used to index the data model corresponding to the component.
[0062] Subsequently, the personal computer can index the data model corresponding to the component according to the data model name. For example, after the code file package corresponding to the software architecture is run, the computer device can search for the data model corresponding to the data model name in its own memory, and obtain and store the searched data model. This can simplify the generation of component code snippets.
[0063] Optionally, the code snippet corresponding to the component library and the code snippet of the component may be obtained by a personal computer according to an input operation of a user.
[0064] For example, see Figure 4 The following figure shows an example of the process of generating components. Figure 4 The schematic diagram of the database component generation is shown in Figure 1. The code snippet of the database component includes creating a database manager (such as Figure 4 SQLiteManager as shown in ), database tools such as Figure 4 SQLitetool) and the database data model (as shown in Figure 4 ) as shown in the SQLiteModel .
[0065] Exemplarily, the code file of a component can be used to implement the complete functions of the component, or can be used to declare the method (or major category) of the component, which is not limited in the embodiments of the present application. For example, for a component that can be directly reused by all businesses, the code file of the component can be used to implement all the functions of the component. For a component that cannot be directly reused by all businesses, the code file of the component can be used to declare the method (or major category) of the component.
[0066] Example 2: Based on the first call information, the personal computer can obtain code snippets corresponding to each of the multiple component libraries from the storage device, as well as code files corresponding to the components contained in each component library. For example, the personal computer can obtain code snippets corresponding to each of the multiple component libraries from the storage device based on the name of the component library, and obtain code files corresponding to the components contained in the component library from the storage device based on the name of the component.
[0067] Example three: The personal computer may obtain the component library and the code snippet corresponding to each component from the network data based on the first calling information.
[0068] The manner in which a personal computer configures the calling relationship between the code snippet of each component library in multiple component libraries and the code snippet of the component contained in the component library is the same. The following is an introduction to the calling relationship between the code snippet of configuring a component library and the code snippet of the component contained in the component library as an example.
[0069] Step 1.1, the personal computer may encapsulate the code fragments of the components contained in the component library, so that the encapsulated code fragments of the components contained in the component library provide the same sub-interface to the outside.
[0070] Specifically, the personal computer is equivalent to encapsulating the code fragments corresponding to the components belonging to the same component library, so that these components only provide one sub-interface to the outside.
[0071] For example, the component includes a database component, a specific example of which is "SQLiteManager.manager.insertModel", and SQLite belongs to the data storage center of the mobile terminal. The personal computer can configure a sub-interface "test" for the database component.
[0072] Step 1.2, the personal computer configures the calling relationship between the code snippet of the component library and the sub-interface, and obtains the configured code snippet of the component library.
[0073] There is originally no calling relationship between the code snippets of the component library and the code snippets of each component. In the embodiment of the present application, the code snippets of the components are encapsulated. After encapsulation, the code snippets of the component library can be used to call the sub-interfaces of these components, thereby establishing a calling relationship between the code snippets of the component library and the code snippets of the components to which they belong.
[0074] Step 1.3, the personal computer encapsulates the configured code fragments of the component library to obtain the code file of the component library, wherein the code file of the component library provides an interface to the outside.
[0075] Similarly, the personal computer encapsulates the configured code fragments of the component library, so that the code file of the encapsulated component library provides an interface to the outside, so that other component libraries can call the code file corresponding to the component library.
[0076] For example, the following is an example of encapsulating a component library.
[0077] / / / Create a database
[0078] func createDB(key:String){}
[0079] / / / Insert data
[0080] func insertModel(tableName:String,model:SQLiteModel){}
[0081] / / / Batch insert data
[0082] func insertList(tableName:String,modelList:[SQLiteModel]){}
[0083] / / / Update data
[0084] func updateModel(tableName:String,model:SQLiteModel){}
[0085] / / / Batch update data
[0086] func updateList(tableName:String,modelList:[SQLiteModel]){}
[0087] / / / Query the data of the corresponding class under a table
[0088] func select <t:sqlitemodel>(tableName:String,modelType:T.Type)->[[String:AnyObject]]{}.
[0089] The following is a detailed description of the interface code implementation for querying data in the public component library.
[0090]
[0091] Among them, select_wrapper is the interface name, the database table name tableName is passed into the interface, the object content in SQLiteModel is used to query, and finally the results (results) are returned.
[0092] Step 23: Based on the second calling information, configure the calling relationship between the code files of the plurality of component libraries to obtain an architecture code file package of the software architecture.
[0093] Similarly, the personal computer can configure the calling relationship between the interfaces provided by the code files of the respective component libraries based on the second calling information, thereby obtaining the architecture code file package of the software architecture. The architecture code file package describes the software architecture in code form. Subsequently, the application developer can develop an application based on the architecture code file package.
[0094] For example, the code snippet of the private integrated component library of the main project can call the interface corresponding to the code file of the public component library.
[0095] In order to more clearly illustrate the process of generating an architecture code file package corresponding to the software architecture, an example is given below.
[0096] Step 2.1, encapsulate each component in the basic component library and the public component library, and expose a unified interface to the business component. In this way, the business side does not need to pay attention to the specific implementation details when calling.
[0097] For example, taking the implementation of payment management business as an example, the component packaging process is illustrated below.
[0098]
[0099] Step 2.2, create a container file (Podfile) in the root directory corresponding to the main project component and business component library, and add components from one or more of the business component library, basic component library, and public component library as required. For example, according to the name of the component library entered by the user, add the corresponding component library to the file. Then execute the pod install command to complete the component library introduction configuration.
[0100] Based on the above embodiments, Figure 5 The flowchart of the software architecture calling method provided in the embodiment of the present application is shown, taking the software architecture calling device as a personal computer as an example, to introduce the process of the software architecture calling method in the embodiment of the present application.
[0101] Step 51, obtaining the architecture code file package of the software architecture.
[0102] The way in which the personal computer obtains the architecture code file package can refer to the contents discussed in the previous embodiment, and will not be repeated here. When obtaining the architecture code file, the architecture code file package can be read according to the instruction.
[0103] The following is an example introduction to the main commands of the build script.
[0104]
[0105]
[0106] Step 52: Obtain the business code file package of the application to be developed according to the input operation.
[0107] Specifically, if the architecture code file package includes code snippets corresponding to the business component library and code snippets corresponding to the main engineering component library, then the application developer can directly input the corresponding code in the code snippets corresponding to the business component library and the code snippets corresponding to the main engineering component library, and the personal computer can thereby obtain the business code file package. Alternatively, if the architecture code file package does not include code snippets corresponding to the business component library and the code snippets corresponding to the main engineering component library, then the application developer can independently develop code snippets corresponding to the business component library and the code snippets corresponding to the main engineering component library, and thereby obtain the business file package.
[0108] Step 53: Load the architecture code file package and the business code file package into the setting directory to obtain an application development kit for the application.
[0109] The personal computer can configure the architecture code file package and the business code file package in a setting directory to obtain an application development kit.
[0110] Based on the same inventive concept, the embodiment of the present application provides a software architecture generation device, which is used to implement the functions of the software architecture generation device discussed above. Figure 6 The structural schematic diagram of the software architecture generation device shown in the figure comprises: an acquisition module 601, which is used to acquire the architecture information required for creating the software architecture, the architecture information comprising first calling information and second calling information, the first calling information being used to represent a first calling relationship between a plurality of component libraries and the components respectively contained in the plurality of component libraries, the second calling information being used to represent a second calling relationship between the plurality of component libraries, and the components being used to represent the functional modules required for creating the software architecture; a first configuration module 602, which is used to respectively perform the following operations for the plurality of component libraries: based on the first calling information, configure the calling relationship between the code snippet of a component library and the code snippet of the component contained in the component library, and obtain the code file of the component library, wherein the code snippet of a component library and the code snippet of a component are both generated based on the Swift platform; a second configuration module 603, which is used to configure the calling relationship between the code files of the plurality of component libraries respectively based on the second calling information, and obtain the architecture code file package of the software architecture.
[0111] In a possible implementation, the first call information includes the names of multiple component libraries and the names of the components contained in each component library; the first configuration module 602 is specifically used to: obtain the code snippet of the component contained in a component library based on the name of the component contained in a component library, and obtain the code snippet of a component library based on the name of a component library; encapsulate the code snippet of the component contained in a component library, wherein the encapsulated code snippet of the component contained in a component library provides the same sub-interface to the outside; configure the calling relationship between the code snippet of a component library and the sub-interface to obtain the code snippet of a configured component library; encapsulate the code snippet of a configured component library to obtain a code file of a component library, wherein the code file of a component library provides an interface to the outside.
[0112] In a possible implementation, a code snippet of a component included in a component library includes a data model name corresponding to the component, and the data model name is used to index the data model corresponding to the component.
[0113] In a possible implementation, the second configuration module 603 is specifically used to: configure the calling relationship between the interfaces provided externally by the code files of the respective component libraries based on the second calling information, and obtain the architecture code file package of the software architecture.
[0114] In one possible implementation, the multiple component libraries include a basic component library, a public component library, and a main project private integrated component library, wherein: the basic component library includes components for implementing basic functions corresponding to the business; the public component library includes components for implementing general functions corresponding to the business; the main project private integrated component library includes components for composite functions corresponding to the business.
[0115] Based on the same inventive concept, the embodiment of the present application provides a software architecture calling device, which is used to implement the functions of the software architecture calling device discussed above. Figure 7 The structural diagram of the software architecture calling device shown in the figure comprises: an acquisition module 701, used to acquire the architecture code file package of the software architecture, wherein the architecture code file package is generated by any of the software architecture generation methods as described above, and based on the input operation, a business code file package of the application to be developed is acquired; a loading module 702, used to load the architecture code file package and the business code file package into a set directory to obtain an application development kit for the application.
[0116] Based on the same inventive concept, the embodiment of the present application provides a computer device, which can realize the functions of the software architecture generation device or software architecture calling device mentioned above. Figure 8 The structural diagram of the computer device shown in the figure comprises: at least one processor 801, and a memory 802 which is communicatively connected to the at least one processor 801; wherein the memory 802 stores instructions which can be executed by the at least one processor 801, and the at least one processor 801 implements any of the software architecture generation methods discussed above or any of the software architecture calling methods discussed above by executing the instructions stored in the memory 802.
[0117] Optionally, the processor 801 and the memory 802 may be coupled or relatively independently arranged.
[0118] Optionally, the processor 801 may be a central processing unit (CPU) or a digital processing unit, etc. The specific connection medium between the memory 802 and the processor 801 is not limited in the embodiment of the present application. Figure 8 In the embodiment, the memory 802 and the processor 801 are connected via a bus (in Figure 8 The connection between the other components is only for illustrative purposes and is not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, and the like.
[0119] The memory 802 may be a volatile memory, such as a random-access memory (RAM); the memory 802 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 802 may be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 802 may be a combination of the above memories.
[0120] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes any of the software architecture generation methods or software architecture calling methods discussed above.
[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0125] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0126] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.< / t:sqlitemodel>
Claims
1. A software architecture generation method, characterized in that: include: Acquire architecture information required for creating a software architecture, the architecture information comprising first call information and second call information, the first call information being used to represent a first call relationship between a plurality of component libraries and components respectively included in the plurality of component libraries, the second call information being used to represent a second call relationship between the plurality of component libraries, the components being used to represent functional modules required for creating the software architecture; For each of the plurality of component libraries, the following operations are performed: based on the first calling information, a calling relationship between a code snippet of a component library and a code snippet of a component included in the component library is configured, and a code file of the component library is obtained, wherein the code snippet of the component library and the code snippet of the component are both generated based on the Swift platform; Based on the second calling information, the calling relationship between the code files of the multiple component libraries is configured to obtain the architecture code file package of the software architecture.
2. The method according to claim 1, characterized in that The first calling information includes the names of the multiple component libraries and the names of the components included in each component library; based on the first calling information, configuring a calling relationship between a code snippet of a component library and a code snippet of the component included in the component library to obtain a code file of the component library, including: Based on the name of the component included in the component library, obtain the code snippet of the component included in the component library, and based on the name of the component library, obtain the code snippet of the component library; Encapsulating the code snippets of the components contained in the component library, wherein the encapsulated code snippets of the components contained in the component library provide a same sub-interface to the outside; Configure a calling relationship between a code snippet of the component library and the sub-interface to obtain a configured code snippet of the component library; The configured code fragment of the component library is encapsulated to obtain a code file of the component library, wherein the code file of the component library provides an interface to the outside.
3. The method according to claim 2, characterized in that The code snippet of the component contained in the component library includes the name of the data model corresponding to the component, and the data model name is used to index the data model corresponding to the component.
4. The method according to claim 2, characterized in that Based on the second calling information, configuring the calling relationship between the code files of the plurality of component libraries to obtain the architecture code file package of the software architecture includes: Based on the second calling information, the calling relationship between the interfaces provided externally by the code files of the respective component libraries is configured to obtain the architecture code file package of the software architecture.
5. The method according to any one of claims 1 to 4, characterized in that: The multiple component libraries include a basic component library, a public component library and a main project private integrated component library, wherein: The basic component library includes components for implementing basic functions corresponding to the business; The public component library includes components for implementing common functions corresponding to the business; The main project private integrated component library includes components for complex functions corresponding to the business.
6. A software architecture calling method, characterized in that: include: Obtaining an architecture code file package of a software architecture, wherein the architecture code file package is generated by the method according to any one of claims 1 to 5; According to the input operation, obtain the business code file package of the application to be developed; The architecture code file package and the business code file package are loaded into a setting directory to obtain an application development kit for the application.
7. A software architecture generation device, characterized in that: include: an acquisition module, configured to acquire architecture information required for creating a software architecture, the architecture information comprising first call information and second call information, the first call information being used to represent a first call relationship between a plurality of component libraries and components respectively contained in the plurality of component libraries, the second call information being used to represent a second call relationship between the plurality of component libraries, the components being used to represent functional modules required for creating the software architecture; The first configuration module is used to perform the following operations for each of the multiple component libraries: based on the first calling information, configure a calling relationship between a code snippet of a component library and a code snippet of a component included in the component library, and obtain a code file of the component library, wherein the code snippet of the component library and the code snippet of the component are both generated based on the Swift platform; The second configuration module is used to configure the calling relationship between the code files of the plurality of component libraries based on the second calling information, and obtain the architecture code file package of the software architecture.
8. A software architecture calling device, characterized in that: include: An acquisition module, used to acquire an architecture code file package of a software architecture, wherein the architecture code file package is generated by the method according to any one of claims 1 to 5, and to acquire a business code file package of an application to be developed according to an input operation; The loading module is used to load the architecture code file package and the business code file package into a setting directory to obtain an application development kit for the application.
9. A computer device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the method according to any one of claims 1 to 5 or 6 by executing the instructions stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 5 or 6.
