Program data packet generation method, apparatus, device, and storage medium

By acquiring configuration information and generating data packages for the target application using automated build scripts, the inefficiency of traditional development models is solved, achieving efficient decoupling and message passing between components, thus improving development efficiency and shortening the development cycle.

CN115485657BActive Publication Date: 2025-10-17BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202180000660.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-30
Publication Date
2025-10-17
Estimated Expiration
2041-03-30

AI Technical Summary

Technical Problem

Traditional mobile software development models suffer from low development efficiency, long development cycles, and difficulty in efficiently generating data packages for the target application.

Method used

A method for generating program data packets is provided. By obtaining the configuration information of the target application, the target components are identified and data packets are generated. By utilizing automated build scripts and routing information between components, decoupling and message passing between components are achieved.

Benefits of technology

It improves the efficiency of generating target application data packages, shortens the development cycle, and enables efficient reuse of components and automated construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115485657B_ABST
    Figure CN115485657B_ABST
Patent Text Reader

Abstract

A method for generating a program data package, the method comprising: obtaining configuration information of a target application program; the configuration information comprising an identification of a platform to which the target application program is adapted; obtaining data packages of target components of the target application program according to the configuration information; each of the target components being adapted to the platform; and calling a preset automated building script to generate a data package of the target application program according to the configuration information and the data packages of the target components.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of software, and particularly relates to a program package generation method and device, equipment and a storage medium. BACKGROUND

[0002] In recent years, with the development of mobile software, developers more and more use componentization technology to develop mobile software based on mobile platforms such as Android platform or iOS platform. The componentization technology can improve the efficiency of software development. A component is obtained by extracting and merging repeated codes in different software source codes. The component can be reused and is generally used to carry part of independent functions. SUMMARY

[0003] In one aspect, a program package generation method is provided. The method comprises: obtaining configuration information of a target application program; the configuration information comprises an identifier of a platform to which the target application program is adapted; obtaining data packages of target components of the target application program according to the configuration information; each target component is adapted to the platform; and calling a preset automated build script to generate a data package of the target application program according to the configuration information and the data packages of the target components.

[0004] In some embodiments, the above-mentioned obtaining the data packages of the target components of the target application program according to the configuration information comprises: determining candidate components corresponding to the configuration information; the candidate components are adapted to the platform; in response to a first preset operation on at least one of the candidate components, taking an identifier of the at least one candidate component corresponding to the first preset operation as an identifier of a target component; and obtaining a data package of the target component according to the identifier of the target component.

[0005] In other embodiments, the configuration information comprises a placeholder and a value corresponding to the placeholder; the data package of at least one target component comprises the placeholder; and the above-mentioned calling the preset automated build script to generate the data package of the target application program according to the configuration information and the data packages of the target components comprises: calling the preset automated build script to obtain a type of the target component, and determining positions of target components of different types in the data package of the target application program according to the configuration information and the type of the target component; and replacing the placeholder in the data package of at least one target component with the value corresponding to the placeholder according to the configuration information to obtain the data package of the target application program.

[0006] In some embodiments, the configuration information of the target application program is obtained by: displaying a configuration page in response to a trigger operation of generating the application program package; the configuration page comprises an input control of a placeholder and an input control of a platform parameter; in response to a second preset operation on the input control of the placeholder in the configuration page, obtaining information corresponding to the placeholder, and taking the information corresponding to the placeholder as a value of the placeholder; and in response to a third preset operation on the input control of the platform parameter in the configuration page, obtaining information corresponding to the platform parameter, and taking the information corresponding to the platform parameter as an identifier of the platform.

[0007] In some embodiments, the method further comprises: obtaining an identifier of each target component based on a preset plug-in, and registering each target component based on the identifier of each target component.

[0008] In some embodiments, the target application program comprises a first component and a second component. The first component and the second component both inherit from a same parent class. The first component invokes the second component to perform a target task by calling a request. The request comprises an identifier of the first component and an identifier of the second component. The target application program comprises inter-component routing information. The inter-component routing information comprises a first relationship and a second relationship. The first relationship is a corresponding relationship between the identifier of the first component and an address of the first component. The second relationship is a corresponding relationship between the identifier of the second component and an address of the second component, and is used for locating the request to the second component to perform the target task. The first relationship is used for calling back an execution result of the target task to the first component.

[0009] In some embodiments, the request comprises a general message object. The general message object comprises the identifier of the second component. The general message object is obtained according to a message constructor.

[0010] In another aspect, a program package generation apparatus is provided, comprising: a first obtaining module, a second obtaining module and a generation module. The first obtaining module is configured to obtain configuration information of a target application program. The configuration information comprises an identifier of a platform to which the target application program is adapted. The second obtaining module is configured to obtain a data package of a target component of the target application program according to the configuration information. Each target component is adapted to the platform. The generation module is configured to call a preset automated construction script, and generate a data package of the target application program according to the configuration information and the data package of the target component.

[0011] In some embodiments, the second obtaining module is specifically configured to: determine candidate components corresponding to the configuration information; the candidate components are adapted to the platform; in response to a first preset operation on at least one candidate component of the candidate components, take an identifier of the at least one candidate component corresponding to the first preset operation as an identifier of the target component; and obtain a data package of the target component according to the identifier of the target component.

[0012] In some embodiments, the configuration information includes a placeholder and a value corresponding to the placeholder; the data packet of the at least one target component includes the placeholder; and the generating module is specifically configured to: invoke a preset automated build script, obtain the type of the target component, and determine the position of the target component of different types in the data packet of the target application according to the configuration information and the type of the target component; and replace the placeholder in the data packet of the at least one target component with the value corresponding to the placeholder according to the configuration information, to obtain the data packet of the target application.

[0013] In some embodiments, the first obtaining module is specifically configured to: in response to a triggering operation of generating the data packet of the application, display a configuration page; the configuration page includes an input control of the placeholder and an input control of the platform parameter; in response to a second preset operation on the input control of the placeholder in the configuration page, obtain information corresponding to the placeholder as the value of the placeholder; and in response to a third preset operation on the input control of the platform parameter in the configuration page, obtain information corresponding to the platform parameter as the identifier of the platform.

[0014] In some embodiments, the program data packet generation apparatus further includes a registration module configured to obtain the identifier of each target component based on a preset plug-in, and register each target component based on the identifier of each target component.

[0015] In some embodiments, the target application includes a first component and a second component. The first component and the second component both inherit from a same parent class. The first component invokes the second component to execute a target task by invoking a request. The request includes an identifier of the first component and an identifier of the second component. The target application includes inter-component routing information. The inter-component routing information includes a first relationship and a second relationship. The first relationship is a corresponding relationship between the identifier of the first component and an address of the first component. The second relationship is a corresponding relationship between the identifier of the second component and an address of the second component, and is used to locate the request to the second component to execute the target task. The first relationship is used to call back an execution result of the target task to the first component.

[0016] In some embodiments, the request includes a general message object; the general message object includes the identifier of the second component; and the general message object is obtained according to a message constructor.

[0017] In another aspect, a computer readable storage medium is provided. The computer readable storage medium stores computer program instructions, which, when executed on a processor, cause the processor to perform one or more steps of the program data packet generation method according to any one of the above embodiments.

[0018] In yet another aspect, a computer program product is provided. The computer program product includes computer program instructions that, when executed on a computer, cause the computer to perform one or more steps of the program data packet generation method according to any of the above embodiments.

[0019] In yet another aspect, a computer program is provided. When the computer program is executed on a computer, the computer program causes the computer to perform one or more steps of the program data packet generation method according to any of the above embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present disclosure, the following will briefly introduce the drawings needed to be used in some embodiments of the present disclosure. Obviously, the drawings described in the following description are only the drawings of some embodiments of the present disclosure, and other drawings can also be obtained by those skilled in the art according to these drawings. In addition, the drawings described in the following description can be regarded as schematic diagrams, and are not limited to the actual size, actual flow, actual timing, etc. of the product, method, signal, etc. involved in the embodiments of the present disclosure.

[0021] Figure 1A Structure diagram of an electronic device according to some embodiments;

[0022] Figure 1B Page diagram of a mobile application open platform according to some embodiments;

[0023] Figure 2 Flow diagram of a program data packet generation method according to some embodiments;

[0024] Figure 3 Configuration page diagram according to some embodiments;

[0025] Figure 4A Display page diagram of a candidate component according to some embodiments;

[0026] Figure 4B Display page diagram of a candidate component according to some other embodiments;

[0027] Figure 5A Architecture diagram of a target application program according to some embodiments;

[0028] Figure 5B Home page diagram of a target application program according to some embodiments;

[0029] Figure 5C Inter-component routing management system diagram according to some embodiments;

[0030] Figure 6Flow chart of a method for automatic generation of inter-component message passing in software according to some embodiments;

[0031] Figure 7 Structure diagram of a program data packet generation apparatus according to some embodiments. DETAILED DESCRIPTION

[0032] First, some terms involved in the embodiments of the present disclosure are briefly introduced:

[0033] Unless otherwise required by context, the term "comprise" and its other forms such as "comprises" and "comprising" are to be construed as open-ended, i.e. as "including, but not limited to", in the description and the claims. In the description, the terms "one embodiment", "some embodiments", "exemplary embodiments", "example", "specific example" or "some examples" are not necessarily referring to the same embodiment or example. Furthermore, the described features, structures, materials or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0034] Hereinafter, the terms "first", "second" are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, the meaning of "a plurality of" is two or more, unless otherwise specified.

[0035] In describing some embodiments, "coupled" and "connected", and their derivatives, can be used. For example, the term "connected" can be used in describing some embodiments to indicate that two or more components are in direct physical or electrical contact with each other. For another example, the term "coupled" can be used in describing some embodiments to indicate that two or more components are in direct physical or electrical contact with each other. However, the terms "coupled" or "communicatively coupled" can also mean that two or more components are not in direct contact with each other, but still cooperate or interact with each other. The embodiments disclosed herein are not necessarily limited to the content herein.

[0036] “A, B, and C at least one of” has the same meaning as “at least one of A, B, or C,” and includes the following combinations of A, B, and C: only A, only B, only C, a combination of A and B, a combination of A and C, a combination of B and C, and a combination of A, B, and C.

[0037] “A and / or B” includes the following three combinations: only A, only B, and a combination of A and B.

[0038] As used herein, the term “if’ is optionally interpreted as meaning “when” or “upon” or “in response to a determination” or “in response to a detection” depending on the context. Similarly, the phrase “if determined” or “if detected [a stated condition or event]” is optionally interpreted as meaning “upon a determination” or “in response to a determination” or “upon a detection” or “in response to a detection” depending on the context.

[0039] The use of “adapted to” or “configured to” herein means open and inclusive language that does not exclude devices that are adapted to or configured to perform additional tasks or steps.

[0040] In addition, the use of “based on” or “according to” means open and inclusive, as a process, step, calculation, or other action that is “based on” or “according to” one or more stated conditions or values can in practice be based on additional conditions or values beyond those stated.

[0041] At present, with the popularity of smart mobile devices and the development of mobile Internet services, the demand for mobile software development is also increasing, and the traditional mobile software development mode is that the developer newly creates an application engineering project, and then develops basic functions, such as a basic user interface (UI), a local database, a network configuration, and the like, and then implements business functions according to requirement and design documents, and in the process of implementing the business functions, if a similar component has been developed in other projects, the corresponding code of the component is copied and redeveloped. The development efficiency of this development mode is low, and the development cycle is long. Therefore, the present disclosure provides a program data package generation method to solve the problems of low development efficiency and long development cycle in the traditional development mode.

[0042] The technical solutions in some embodiments of the present disclosure will be described clearly and completely in combination with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all the embodiments. Based on the embodiments provided by the present disclosure, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present disclosure.

[0043] The program packet generation method provided by the embodiments of the present disclosure can be implemented by an electronic device 10 as shown in the accompanying drawings. Figure 1A As shown in the accompanying drawings, Figure 1A As shown in the accompanying drawings, Figure 1A The electronic device 10 includes but is not limited to a processor 101, a memory 102, an input unit 103, an interface unit 104, a power supply 105, and the like.

[0044] The processor 101 is the control center of the electronic device, connects all parts of the electronic device through various interfaces and lines, executes the software programs and / or modules stored in the memory 102 and the data stored in the memory 102, and performs various functions and processes data of the electronic device, thereby monitoring the whole electronic device. The processor 101 can include one or more processing units; optionally, the processor 101 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 101.

[0045] The memory 102 can be used to store software programs and various data. The memory 102 can mainly include a program storage area and a data storage area, wherein the program storage area can store the operating system, the application programs required by at least one functional unit, and the like. In addition, the memory 102 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Optionally, the memory 102 can be a non-temporary computer readable storage medium, for example, the non-temporary computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0046] The input unit 103 can be a keyboard, a touch screen, and the like.

[0047] The interface unit 104 is an interface for connecting an external device to the electronic device 10. For example, the external device can include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input / output (I / O) port, a video I / O port, an earphone port, etc. The interface unit 104 can be used to receive input (e.g., data information, etc.) from the external device and transfer the received input to one or more elements within the electronic device 10 or can be used to transfer data between the electronic device 10 and the external device.

[0048] The power supply 105 (e.g., a battery) can be used to supply power to the various components. Optionally, the power supply 105 can be logically connected to the processor 101 through a power management system, thereby enabling the power management system to perform functions such as management of charging, discharging, and power consumption management.

[0049] Optionally, the computer instructions in the embodiments of the present disclosure can also be referred to as application program codes or systems, which are not specifically limited in the embodiments of the present disclosure.

[0050] It should be noted that, Figure 1A The electronic device shown is only an example, and does not limit the electronic device to which the embodiments of the present disclosure can be applied. In actual implementation, the electronic device can include more or fewer devices or components than those shown in the above. Figure 1A The electronic device shown is only an example, and does not limit the electronic device to which the embodiments of the present disclosure can be applied. In actual implementation, the electronic device can include more or fewer devices or components than those shown in the above.

[0051] Before implementing the program data package generation method provided by the embodiments of the present disclosure, an automated development management system can be constructed, which includes five parts: a mobile application open platform, a component and mobile application management background, a component source code hosting platform, a component package hosting platform, and a program data package generation system. Through the mobile application open platform, specific users are connected, business portals such as component resource pool and component detailed information are displayed, and an operation platform of the program data package generation system is provided.

[0052] The mobile application open platform is an entrance for users to interact with the program data package generation system, which is mainly connected through network interface calling with the component and mobile application management background, and mainly includes user management, component management, program data package generation management, and permission management modules.

[0053] The component and mobile application management background is mainly used to store component and mobile application information and details, and provides business data for the mobile application open platform, and mainly includes component management background, mobile application management background, business service background, and data background.

[0054] The component source code hosting platform is mainly used for component source code storage and management. The component source code hosting platform can also be used as a closed loop system, and can also be used for source code downloading and other operations through the external interface provided thereby. The user management module can be used only for managing users using the component source code hosting platform.

[0055] The component package hosting platform is mainly used for storage and management of component dependency packages. The component package hosting platform can also be used as a closed loop system, and can also be used for downloading component dependency packages and other operations through the external interface provided thereby. The user management module can be used only for managing users using the component package hosting platform.

[0056] The program data package generation system is mainly used for automatic generation of program data packages and workflow management. The program data package generation system can also be used as a closed loop system, and can also provide external interfaces. The component and mobile application management background can call the external interfaces provided by the program data package generation system through network connection to transmit construction parameters to the program data package generation system, so as to realize automatic generation of program data packages.

[0057] For example, the page of the mobile application open platform is shown in FIG. 1. Figure 1B As shown in FIG. 1, the mobile application open platform includes function modules in the left menu bar, such as a component center module, an application center module, a microprogram center module, a development platform module, a management platform module, and a personal center.

[0058] The component center module can display a list of all components stored in the system. Each component can be arranged in a card layout to display component content. The component content includes, but is not limited to, component name, component type, component category, component version, component applicable platform, component developer, component reference times, component support for horizontal and vertical screens, component support for default resolution, and component brief description. Users can perform component collection, component detail query, and component screening on the current page.

[0059] The application center module can display a list of mobile applications that have been successfully constructed. The display content includes application name, application category, application popularity (application download number), application download QR code, application version number, application query detail button, and application local download button. The electronic device can also display detailed information of the application in response to a query operation. The detailed information includes application name, application category, application popularity (application download number), application download QR code, application version number, application release time, application platform support, application screenshots, application short video, application description, application management personnel, application component list, and application microprogram list.

[0060] The microprogram center module can display information of all microprograms stored in the system, and the microprogram is different from the component in that the microprogram is designed based on cross-platform technology, is different from the customized objective condition of the component, and has the characteristics of cross-platform, lightweight, and easy integration. The microprogram center module and the component center module are similar in function and page, and will not be described again. The information of the microprogram includes but is not limited to: microprogram name, release time, microprogram package volume condition, microprogram scene type, responsible person, microprogram support landscape / portrait screen condition, microprogram support default resolution, and microprogram brief description.

[0061] The development platform module mainly includes three parts: a component management module, an application management module, and a microprogram management module.

[0062] The component management module is mainly used to display all component lists published by the user, collaboratively managed, and / or collected, and the component management module provides the function of adding a component. The detailed information of the component includes: component name, component release time, component version, component category, component reference times, component state, and / or component operation function list, etc. The component state includes but is not limited to: to be put on the shelf, already put on the shelf, already taken off the shelf, and not passed.

[0063] The electronic device needs to obtain the basic information of the component when adding a component, and the basic information of the component includes: component name, component version number, component adaptation platform, display type, component default resolution, component category, component source code storage path, component data package dependency path, component source code version number, component data package version number, component internal dependency condition, component collaborator list, component picture and related short video, and component details. Then, the electronic device transmits the basic information of the component to the component and the mobile application management background through the network interface calling mode, and the background will publish the obtained basic information of the component in the mobile application open platform.

[0064] The application management module provides the function of displaying application information and the function of creating an application. The application information includes: application name, application release time, application version, application category, application support platform, application state, resolution, display type, and application operation function list, etc. The application state includes but is not limited to: already put on the shelf and not completed.

[0065] The electronic device obtains the application information and transmits the application information to the component and the mobile application management background through the network interface calling mode, and the background system will pass the required parameters to the program data package generation system through parameter screening and program data package generation system calling, and the system will generate the data package of the application program by calling the preset automatic construction script of the corresponding mobile application type. Optionally, the electronic device constructs and publishes the generated program data package.

[0066] The management platform module mainly includes two parts: an audit management module and a user management module.

[0067] The user permissions in the system can be divided into: ordinary user, developer, administrator, and the permissions are increased in turn. The administrator can view and use all the functions of the management platform module.

[0068] The audit management module is mainly used to display the state of all components and microprograms, and can perform related approval operations, including: detail query, disapproval, approval, deletion, unloading, re-loading, and viewing reasons.

[0069] The user management module can be used to display all user details and permission types, and can perform related permission modification operations, including: detail query, editing, deletion, batch deletion, and adding users.

[0070] The personal center module is mainly used to display the personal details of the current user, including: account, username, email, organization, phone, and avatar. The user can modify the password, update the information, and upload the avatar on this page.

[0071] The personnel interact with the above mobile application opening platform includes the following scenarios:

[0072] Scenario one: code developers can add new components using the component platform. Adding a component mainly includes three stages: development stage, component packaging stage, and component platform registration stage. After the code developer completes the component development, the component dependency data package is uploaded through the component package hosting platform, and the component source code is uploaded through the component source code hosting platform. After completion, the component enters the component platform registration stage to publish the component through the mobile application opening platform-development platform module-component management module-new component function.

[0073] Scenario two: code developers can use the platform to find and use components. Developers can perform component browsing, viewing, and detail dependency traversal operations. For components that can be reused, developers can perform whole component reuse by querying the details or download the source code for subsequent operations after modifying the source code.

[0074] Scenario three: business personnel can use the mobile application opening platform to generate application data packages. Business personnel can input application configuration information, query components according to the configuration information, select components from the displayed components, and then click the generate button to generate the application data package. Optionally, the application installation package can be built after generating the application data package, and transmitted to the mobile application opening platform to store and publish the software, and generate a release two-dimensional code.

[0075] It should be noted that the above is only an exemplary description of the system, the data packet management of the components, and the operation platform of the program data packet generation method applicable to the program data packet generation method provided by the embodiments of the present disclosure, and the embodiments of the present disclosure do not limit the data packet management of the components, the system applicable to the program data packet generation method, and the operation platform of the program data packet generation method.

[0076] As shown in Figure 2 is a flowchart of a program data packet generation method provided by the embodiments of the present disclosure, applicable to the above scenario 3, which can be applied to Figure 1A the electronic device shown in Figure 2 the method can include the following steps:

[0077] S100: The electronic device obtains the configuration information of the target application program. The configuration information includes the identification of the platform adapted by the target application program.

[0078] In a possible implementation, first, the electronic device displays a configuration page in response to a trigger operation of generating an application data packet. The configuration page includes an input control of a placeholder and an input control of a platform parameter. Then, the electronic device obtains information corresponding to the placeholder in response to a preset operation on the input control of the placeholder in the configuration page, and takes the information corresponding to the placeholder as the value of the placeholder. The electronic device obtains information corresponding to the platform parameter in response to a preset operation on the input control of the platform parameter in the configuration page, and takes the information corresponding to the platform parameter as the identification of the platform.

[0079] For example, the electronic device displays the configuration page shown in Figure 3 in response to a trigger operation of generating an application data packet, and the user inputs corresponding configuration information in the configuration page, such as the application engineering name, the application type, the application platform, the application category, the resolution, the display type, and the like in Figure 3 The electronic device obtains the configuration information of the target application program in response to the input operation on the configuration page. The configuration information of the target application program includes the value of the placeholder (such as the content input in the application engineering name text box in Figure 3 The value of the placeholder can be the identification of the target application program. The application type, for example, single-platform application or cross-platform application, and the like. The identification of the platform adapted by the application (such as the content input in the application platform text box in Figure 3 for example, the android platform, the iOS platform, or the windows platform, and the like, and the display type, for example, landscape display or portrait display, and the like.

[0080] In another possible implementation, the electronic device obtains a file including configuration information, and parses the configuration information file to obtain the configuration information of the target application.

[0081] Exemplarily, the electronic device obtains a file including configuration information in response to a file upload operation by a user, and parses the configuration information file to obtain configuration information of a target application.

[0082] S101: The electronic device obtains a data packet of a target component of a target application according to configuration information; each target component is adapted to a platform represented by a platform identifier in the configuration information.

[0083] Specifically, the electronic device first determines a candidate component corresponding to the configuration information; the candidate component is adapted to the platform represented by the platform identifier. Then, in response to a preset operation on at least one of the candidate components, the electronic device uses the identifier of the at least one candidate component corresponding to the preset operation as the identifier of the target component. The electronic device then obtains a data packet for the target component based on the identifier of the target component. The electronic device stores the correspondence between the component identifier and the component data packet.

[0084] based on Figure 3 For example, electronic devices can Figure 3 The configuration information entered in the text box determines the candidate components corresponding to the configuration information. The user Figure 4A Select the target component in the selection box on the candidate component display page shown in the figure, or the user can select the target component in the Figure 4B In the selection box on the candidate component display page shown, the electronic device selects a target component. In response to the selection operation on at least one candidate component, the electronic device selects the candidate component corresponding to the selection operation as the target component. The electronic device then retrieves the data packet of the component corresponding to the target component's identifier from the component library based on the identifier of the target component. The component library includes a correspondence between the component identifiers and the component data packets.

[0085] S102: The electronic device calls a preset automatic construction script to generate a data packet of the target application according to the configuration information and the data packet of the target component.

[0086] Optionally, the configuration information includes a placeholder and a value corresponding to the placeholder. The data packet of at least one target component includes the placeholder in the configuration information.

[0087] Specifically, the electronic device invokes a preset automated build script to obtain the type of the target component and, based on the configuration information and the target component type, determines the location of the different types of target components within the target application's data packet. Based on the configuration information, the electronic device replaces the placeholders in at least one target component's data packet with the value corresponding to the placeholder, thereby obtaining the target application's data packet.

[0088] In the embodiments of the present disclosure, the electronic device can determine candidate components according to the obtained configuration information, and then obtain target components from the candidate components. Finally, the electronic device generates a data packet of the target application according to the target components and a preset automatic construction script. In this way, a non-developer can generate a target application after simple training according to the program data packet generation method provided by the embodiments of the present disclosure, and after inputting the configuration information of the target application and obtaining the target components according to the configuration information, the target application is generated, thereby solving the problems of low efficiency and long development cycle in the traditional development mode for obtaining the data packet of the target application.

[0089] Subsequently, the electronic device can call the automatic construction script to compile the data packet of the target application to obtain an installation package of the target application.

[0090] For example, the electronic device obtains the type of the target component, which can be a layout type, a service type, or a library type, etc. The electronic device determines the position of the data packet of the target component in the data packet of the target application according to the type of the data packet of the target component and the identifier of the platform in the configuration information. In the case that the type of the target component is a front-end layout type and the platform to which the target application is applicable is an Android platform, the electronic device determines that the data packet of the target component is located in a folder where the layout is located in the data packet of the target software. Assuming that the configuration information includes the identifier of the target application and the placeholder corresponding to the identifier of the target application, the electronic device replaces the placeholder corresponding to the identifier of the target application in at least one target component with the identifier of the target application, etc. After the electronic device automatically replaces the placeholders in the data packet of the target component, the data packet of the target application is obtained.

[0091] Optionally, S103: The electronic device obtains the identifier of each target component based on a preset plug-in, and registers each target component based on the identifier of each target component.

[0092] Specifically, the electronic device obtains the identifier of each target component based on the plug-in during the process of packaging the target application, or during the process of publishing the target application, and registers each target component based on the identifier of each target component. The registration information of the target component includes the identifier of the target component and the applicable range of the target component in the target application. Subsequently, the electronic device can generate routing information of the target component according to the registration information of the target component when starting. The routing information of the target component includes the physical address corresponding to the identifier of the target component, and other target components that can be called by the first target component. The first target component is any one of the target components, and the other target components are target components other than the first target component.

[0093] In one example, the architecture of the target application packaged or released by the electronic device is as shown in Figure 5A Figure 5A The target application shown in the figure includes a business module layer 501, an independent service layer 502, a container layer 503, a framework layer 504, a basic service layer 505, and a user interface layer 506. The business module layer 501 includes business components and / or composite business components. In the case of a mobile software target application, the business module layer 501 corresponds to the “business component” category in the mobile application open platform. The container layer 503 corresponds to the “base component” category in the mobile application open platform and is by default dependent on the internal application software. The independent service layer 502 corresponds to the “service component” category in the mobile application open platform. The framework layer 504 corresponds to the “base component” category in the mobile application open platform. The basic service layer 505 corresponds to the “base component” category in the mobile application open platform. The user interface layer 506 corresponds to the “business component” category in the mobile application open platform. The routing information between the target components generated by the electronic device when starting can be stored in the routing management module of the container layer according to the registration information of the target components.

[0094] Subsequently, after the electronic device starts the target application, the inter-component routing information of the target application is generated according to the identification of the target components. The inter-component routing information includes the correspondence between the identification and the address of the components. The inter-component message transmission can be completed according to the inter-component routing information.

[0095] Based on the above Figure 4A example, assuming that the target components include components 1-10, the home page displayed by the target application generated by the electronic device after starting is as shown in Figure 5B The home page includes access control management, vehicle management, visitor management, park management, and device management, etc. It should be noted that the program data package generation method provided by the embodiments of the present disclosure can also generate data packages of composite business components such as access control management, vehicle management, visitor management, park management, or device management. A composite business component includes at least one component. The embodiments of the present disclosure do not limit this.

[0096] Taking the software in the Android platform (referred to as Android software) as an example, generally, the component invocation requests between components in the Android software are divided into four types of invocation requests: invoking a page, invoking a service, obtaining data, and transmitting messages. Therefore, by using a unified component platform specification and a bus routing communication component design method, the inter-component transmission of the four types of invocation requests can be realized to achieve the purpose of decoupling between components.

[0097] ​In the case of calling request for calling page, generally for the management of layout (Fragment) or activity (Activity), the plug-in can be an annotation processing tool (APT) plug-in, the APT plug-in scans and extracts the target component corresponding label information (such as: (@PAGE)), and registers the component identifier in the calling page class information to the routing management module (also known as: bus routing component), and when used, the entity class of the layout or the entity class of the activity represented by the component identifier is returned by directly instantiating.

[0098] In the case of calling request for calling service, the starting mechanism of the service component is based on the content provider of Android. First, the electronic device forms a service table of the target component by the annotation extraction of the APT plug-in, and registers it in the routing management module. In this way, when the annotation of the corresponding service (that is, the identifier of the target component) is used, the electronic device automatically generates a service entity class with the method name in the @Service as a whole name according to the service provider (ServiceProvider) template, which has the corresponding function of starting the service in the service table and automatically registers the information of the provider component in the manifest.xml of the component, and declares the node information (also known as address) of the corresponding provider. Finally, when component A starts the API of service B through the routing component, the routing management module of the electronic device will achieve the purpose of calling the service information method by encapsulating the use of the corresponding content provider.

[0099] Suppose that the above-mentioned packaged and released target application is a mobile software based on Android, the target application encapsulates the business component in the container layer, and communicates data through the bus routing mechanism. The target application calls the content of the underlying basic service, platform framework and platform application component through the bus routing mechanism. For example, the inter-component routing management system 60 in the embodiment of the present disclosure is as follows: Figure 5CAs shown in the figure. The routing management system includes a component automatic registration plug-in 601, a component routing information management module 602, a bus module 603 and a routing module 604. The component automatic registration plug-in 601 is configured to scan the subclass component information of the target parent class in the target application during the compilation of the target application. The subclass component inherits the general interface of the target parent class. The component automatic registration plug-in 601 sends the extracted component information to the component routing information management module 602, and the component information is used for the component routing information management module to register the component. The routing module 604 obtains the authorized component information that meets the authorization strategy from the component routing information management module 602 when the target application is started, and generates the routing information of each authorized component (i.e., the component that can be discovered through the routing module) (for example, the instance corresponding to each component is generated). The bus module 603 is configured to transmit messages between components. Figure 5C The component A sends a call request to the routing module 604 through the bus module 603. The routing management module in the routing module 604 receives the call request and determines the instance of the component B requested by the call request of the component A by judging whether the request is a "page request" or a "service request", and delivers the call request of the component A to the instance of the component B. After the instance of the component B completes the call request of the component A, the instance of the component B returns the callback information to the component A through the same link to complete the whole process of the bus event.

[0100] As shown in the figure. Figure 6 As shown in the figure, the method can be applied to the electronic device shown in the figure, Figure 1A As shown in the figure, Figure 6 As shown in the figure, the method can include the following steps:

[0101] S200: The electronic device generates a call request in the first component in response to a target instruction. The call request is used to request the second component to perform a target task. The call request includes the identification of the first component and the identification of the second component. The first component and the second component are both components in the target application.

[0102] It should be noted that the disclosure does not limit the triggering mode of the target instruction. In one possible implementation, the electronic device responds to a target operation on the first component of the target application. The instruction sent by the electronic device in response to the target operation is the target instruction. In another possible implementation, the electronic device generates the target instruction in the process of running the first component of the target application.

[0103] Optionally, the call request includes a general message object, and the general message object includes the identification of the second component. The general message object is obtained according to a message constructor.

[0104] By way of example, the structure of a generic message object is:

[0105] Public class Bmessage implements serializable{

[0106] Int intentflag;

[0107] Weakreference <context>mContextReference;

[0108] String my componentname;

[0109] Boolean issettimeout=true;

[0110] Int mtimeout=0;

[0111] Actiontype mactiontype=actiontype.service;

[0112] String mactionname;

[0113] Boolean ishaveglobalinterceptor=false;

[0114] Map<string,object>mparams=new hashmap<>();

[0115] Map<string,string>mheaders=new hashmap<>();

[0116] Weakreference <activity>autocancel0nactivitydestroy;

[0117] Weakreference <fragment>autocancel0n fragment destroy;

[0118] String Mmessageid;

[0119] Callback mcallback;

[0120] Bmessage(string componentName){this.mcomponentName=componentName;}

[0121] }

[0122] Exemplary, the message constructor includes the following methods:

[0123] obtainBuilder(String componentName): the component name (ComponentName) is filled in this method, which needs to be filled in the first time when the message object is constructed.

[0124] setContext(Context context): this method is called when the general message is constructed, and the context Context needs to be passed in.

[0125] setActionType(ActionType actionType): this method is used to set the message type (or operation type, including PAGE (page), Service (service), and CUSTOM (custom message) three types.

[0126] setActionName(String actionName): this method is used to set the string identifier of the operation to be executed. The string identifier here corresponds to the value filled in the @Page, @Service annotation. That is, the identifier of the target component.

[0127] setTimeOut(int timeOut): this method is used to set the expiration time.

[0128] setFlag(int intentFlag): this method is used to distinguish the page jump method for the routing module.

[0129] addParam(String key, @NonNull Object value): In this method, key is of String type and value is of Object type, which is used for parameter transmission through messages, and value cannot be null. Moreover, when another setParams() method is used, the parameters added by this method will be cleared.

[0130] setParams(Map<String, Object> params): This method is used to set the parameter set of Map type.

[0131] setCallback(Callback callback): This method is used to set the callback when the result needs to be returned. When the result needs to be returned, set this callback.

[0132] setAutoCancelOnActivityDestroy(Activity activity): This method is used to indicate whether to bind the life cycle with the Activity. The Activity to be bound can be passed in by default.

[0133] setAutoCancelOnFragmentDestroy(Fragment fragment): This method is used to indicate whether to bind the life cycle with the Fragment. The Fragment to be bound can be passed in by default.

[0134] build(): This method is used to build the message object. When this method is called, it means that the message object starts to be built.

[0135] S201: The electronic device locates the second component according to the address corresponding to the identifier of the second component in the routing information, and executes the target task to obtain a response result. The response result includes the identifier of the first component.

[0136] Optionally, the response result can also be a general message object constructed by the above message constructor.

[0137] S202: The electronic device calls back the response result to the first component according to the address corresponding to the identifier of the first component in the routing information.

[0138] Specifically, the electronic device can send the response result to the first component in the reverse direction according to the route of the calling request.

[0139] The above mainly introduces the solution provided by the embodiment of the present disclosure from the perspective of method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0140] The embodiments of the present disclosure can divide the electronic device in the above embodiment into functional modules according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments of the present disclosure is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0141] like Figure 7 As shown, it is a structural diagram of a program data packet generating device 70 provided by an embodiment of the present disclosure. The program data packet generating device 70 includes a first acquisition module 701, a second acquisition module 702 and a generation module 703. The first acquisition module 701 is used to obtain the configuration information of the target application; the configuration information includes the identifier of the platform adapted by the target application; the second acquisition module 702 is used to obtain the data packet of the target component of the target application according to the configuration information; each target component is adapted to the platform; the generation module 703 is used to call a preset automated construction script to generate the data packet of the target application according to the configuration information and the data packet of the target component. For example, in combination Figure 2 The first acquisition module 701 can be used to execute S100, the second acquisition module 702 can be used to execute S101, and the generation module 703 can be used to execute S102.

[0142] Optionally, the second acquisition module 702 is specifically used to: determine the candidate components corresponding to the configuration information; the candidate components are adapted to the platform; in response to a first preset operation on at least one of the candidate components, use the identifier of at least one candidate component corresponding to the first preset operation as the identifier of the target component; and obtain the data packet of the target component based on the identifier of the target component.

[0143] Optionally, the configuration information includes a placeholder and a value corresponding to the placeholder; the data packet of the at least one target component includes the placeholder; and the generation module 703 is specifically configured to: invoke a preset automated build script, obtain a type of the target component, and determine, according to the configuration information and the type of the target component, a position of the target component of different types in the data packet of the target application; and replace the placeholder in the data packet of the at least one target component with the value corresponding to the placeholder according to the configuration information, to obtain the data packet of the target application.

[0144] Optionally, the first obtaining module 701 is specifically configured to: in response to a trigger operation of generating the application data packet, display a configuration page; the configuration page includes an input control of the placeholder and an input control of the platform parameter; in response to a second preset operation on the input control of the placeholder in the configuration page, obtain information corresponding to the placeholder as the value of the placeholder; and in response to a third preset operation on the input control of the platform parameter in the configuration page, obtain information corresponding to the platform parameter as the identifier of the platform.

[0145] Optionally, the program data packet generation apparatus further includes a registration module 704, configured to obtain an identifier of each target component based on a preset plug-in, and register each target component based on the identifier of each target component.

[0146] Optionally, the target application includes a first component and a second component. The first component and the second component both inherit from a same parent class. The first component invokes the second component to execute a target task by invoking a request. The request includes an identifier of the first component and an identifier of the second component. The target application includes inter-component routing information. The inter-component routing information includes a first relationship and a second relationship. The first relationship is a corresponding relationship between the identifier of the first component and an address of the first component. The second relationship is a corresponding relationship between the identifier of the second component and an address of the second component, and is used to locate the request to the second component to execute the target task. The first relationship is used to call back an execution result of the target task to the first component.

[0147] Optionally, the request includes a general message object; the general message object includes the identifier of the second component; and the general message object is obtained according to a message constructor.

[0148] In one example, referring to Figure 1A , the receiving functions of the first obtaining module 701 and the second obtaining module 702 can be implemented by the interface unit 104 in the terminal 100. The processing functions of the first obtaining module 701, the processing functions of the second obtaining module 702, the generation module 703, and the registration module 704 can be implemented by the processor 101 in the terminal 100 invoking the computer program stored in the memory 102. Figure 1A Figure 1A , the receiving functions of the first obtaining module 701 and the second obtaining module 702 can be implemented by the interface unit 104 in the terminal 100. The processing functions of the first obtaining module 701, the processing functions of the second obtaining module 702, the generation module 703, and the registration module 704 can be implemented by the processor 101 in the terminal 100 invoking the computer program stored in the memory 102.​

[0149] For detailed description of the optional manners, refer to the foregoing method embodiments, which will not be repeated here. In addition, the explanation and beneficial effect of any one of the program data packet generation apparatuses 70 provided above can refer to the corresponding method embodiments described above, which will not be repeated here.

[0150] It should be noted that the actions performed by each module are only specific examples, and the actual actions performed by each unit can refer to the actions or steps mentioned in the description of the embodiments based on the foregoing method embodiments. Figure 2 、 Figure 6 The embodiments of the present disclosure provide a computer readable storage medium (for example, a non-transitory computer readable storage medium) having computer program instructions stored therein, which, when executed on a processor, cause the processor to perform one or more steps of the program data packet generation method as described in any of the foregoing embodiments.

[0151] Some embodiments of the present disclosure provide a computer readable storage medium (for example, a non-transitory computer readable storage medium) having computer program instructions stored therein, which, when executed on a processor, cause the processor to perform one or more steps of the program data packet generation method as described in any of the foregoing embodiments.

[0152] Exemplarily, the computer readable storage medium described above can include, but is not limited to, a magnetic storage device (for example, a hard disk, a floppy disk or a magnetic tape, etc.), an optical disk (for example, a CD (Compact Disk, compact disk), a DVD (Digital Versatile Disk, digital versatile disk), etc.), a smart card and a flash memory device (for example, an EPROM (Erasable Programmable Read-Only Memory, erasable programmable read-only memory), a card, a stick or a key drive, etc.). The various computer readable storage media described in the present disclosure can represent one or more devices and / or other machine readable storage media for storing information. The term "machine readable storage medium" can include, but is not limited to, a wireless channel and various other media capable of storing, containing and / or carrying instructions and / or data.

[0153] Some embodiments of the present disclosure also provide a computer program product. The computer program product includes computer program instructions, which, when executed on a computer, cause the computer to perform one or more steps of the program data packet generation method as described in the foregoing embodiments.

[0154] Some embodiments of the present disclosure also provide a computer program. When the computer program is executed on a computer, the computer program causes the computer to perform one or more steps of the program data packet generation method as described in the foregoing embodiments.

[0155] The computer readable storage medium, the computer program product and the computer program have the same beneficial effects as the program data packet generation method described in some embodiments, and will not be repeated here.

[0156] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any person skilled in the art can think of changes or replacements within the technical scope disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.< / fragment> < / activity> < / context>

Claims

1. A method for generating a program data packet, characterized in that: The method comprises: Obtaining configuration information of a target application; the configuration information includes an identifier of a platform adapted by the target application, a placeholder, and a value corresponding to the placeholder; Acquire a data packet of a target component of the target application according to the configuration information; each target component is adapted to the platform; and the data packet of at least one target component includes the placeholder; Calling a preset automated build script to obtain the type of the target component, and determining the locations of different types of target components in the data packet of the target application according to the configuration information and the type of the target component; Replacing a placeholder in a data packet of the at least one target component with a value corresponding to the placeholder according to the configuration information, to obtain a data packet of the target application; Obtaining an identifier of each target component based on a preset plug-in, and registering each target component based on the identifier of each target component; The target application includes a first component and a second component; the first component and the second component both inherit from the same parent class; The first component calls the second component to execute a target task through a call request; the call request includes an identifier of the first component and an identifier of the second component; The target application includes inter-component routing information; the inter-component routing information includes a first relationship and a second relationship; the first relationship is the correspondence between the identifier of the first component and the address of the first component; the second relationship is the correspondence between the identifier of the second component and the address of the second component; the second relationship is used to locate the call request to the second component to execute the target task; the first relationship is used to call back the execution result of the target task to the first component.

2. The method according to claim 1, characterized in that The step of obtaining a data packet of a target component of the target application according to the configuration information includes: Determining a candidate component corresponding to the configuration information; the candidate component is adapted to the platform; In response to a first preset operation on at least one candidate component among the candidate components, using an identifier of the at least one candidate component corresponding to the first preset operation as an identifier of the target component; According to the identifier of the target component, a data packet of the target component is obtained.

3. The method according to claim 1 or 2, characterized in that The obtaining of the configuration information of the target application includes: In response to a triggering operation for generating an application data package, displaying a configuration page; the configuration page includes an input control for the placeholder and an input control for a platform parameter; In response to a second preset operation on an input control of the placeholder in the configuration page, obtaining information corresponding to the placeholder, and using the information corresponding to the placeholder as a value of the placeholder; In response to a third preset operation on the input control of the platform parameter in the configuration page, information corresponding to the platform parameter is acquired, and the information corresponding to the platform parameter is used as an identifier of the platform.

4. The method according to claim 3, characterized in that The call request includes a general message object; the general message object includes the identifier of the second component; and the general message object is obtained according to a message constructor.

5. A program data packet generating device, characterized in that: include: A first acquisition module is used to acquire configuration information of a target application; The configuration information includes an identifier of a platform adapted by the target application, a placeholder, and a value corresponding to the placeholder; A second acquisition module is configured to acquire data packets of target components of the target application according to the configuration information; each target component is adapted to the platform; The data packet of at least one target component includes the placeholder; a generation module configured to call a preset automated build script, obtain the type of the target component, and determine the location of different types of target components in the data packet of the target application based on the configuration information and the type of the target component; and replace the placeholder in the data packet of at least one target component with the value corresponding to the placeholder based on the configuration information to obtain the data packet of the target application; A registration module, configured to obtain an identifier of each target component based on a preset plug-in, and register each target component based on the identifier of each target component; The target application includes a first component and a second component; the first component and the second component are inherited from the same parent class; the first component calls the second component through a call request to perform a target task; the call request includes an identifier of the first component and an identifier of the second component; The target application includes inter-component routing information; the inter-component routing information includes a first relationship and a second relationship; the first relationship is a correspondence between an identifier of the first component and an address of the first component; The second relationship is a correspondence between the identifier of the second component and the address of the second component; The second relationship is used to locate the call request to the second component to execute the target task; The first relationship is used to call back the execution result of the target task to the.

6. The device according to claim 5, characterized in that The second acquisition module is specifically used for: Determining a candidate component corresponding to the configuration information; the candidate component is adapted to the platform; In response to a first preset operation on at least one candidate component among the candidate components, using an identifier of the at least one candidate component corresponding to the first preset operation as an identifier of the target component; According to the identifier of the target component, a data packet of the target component is obtained.

7. The device according to claim 5 or 6, characterized in that The first acquisition module is specifically configured to: In response to a triggering operation for generating an application data package, displaying a configuration page; the configuration page includes an input control for the placeholder and an input control for a platform parameter; In response to a second preset operation on an input control of the placeholder in the configuration page, obtaining information corresponding to the placeholder, and using the information corresponding to the placeholder as a value of the placeholder; In response to a third preset operation on the input control of the platform parameter in the configuration page, information corresponding to the platform parameter is acquired, and the information corresponding to the platform parameter is used as an identifier of the platform.

8. The device according to claim 7, characterized in that The call request includes a general message object; the general message object includes the identifier of the second component; and the general message object is obtained according to a message constructor.

9. An electronic device, characterized in that: include: A processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the executable instructions to implement the method for generating a program data packet according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for generating a program data package according to any one of claims 1 to 4.

11. A computer program product, characterized in that The computer program product includes computer instructions, and when the computer instructions are executed on a computer device, the computer device is caused to execute the method for generating a program data packet according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Program packaging method and device and program installation method and device

    CN107894891A

  • Application installation package generation method and device, server and storage medium

    CN111949314A