Program data package generation method, device and storage medium
A program data package generation method, the method includes: obtaining configuration information of a target application program, the configuration information including an identifier of a platform to which the target application program is applicable; obtaining a data package of a target component in the target application program according to the configuration information, each target component being adapted to the platform; and calling a preset automated construction script, and generating a data package of the target application program according to the configuration information and the data package of the target component.
1 . A program data package generation method applied to an electronic device, the method comprising:
obtaining, by the electronic device, configuration information of a target application program, the configuration information including an identifier of an application platform to which the target application program is applicable;
obtaining, by the electronic device, a data package of at least one target component in the target application program according to the configuration information, the at least one target component being adapted to the application platform;
calling, by the electronic device, a preset automated construction script, and generating a data package of the target application program according to the configuration information and the data package of the at least one target component;
obtaining, by the electronic device, an identifier of the at least one target component based on a preset plug-in; and
registering, by the electronic device, the at least one target component based on the identifier of the at least one target component;
wherein the electronic device stores a corresponding relationship between the identifier of the at least one target component and the data package of the at least one target component;
the at least one target component includes a first component and a second component; both the first component and the second component inherit from a same parent class;
the method further comprising:
generating, by the electronic device, routing information between components in the target application program according to the identifier of the at least one target component; the routing information between components 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;
generating, by the electronic device, a call request in the first component to call the second component to perform a target task in response to a target instruction; wherein the call request includes an identifier of the first component and an identifier of the second component;
locating, by the electronic device, the call request to the second component to perform the target task according to the second relationship; and
calling back, by the electronic device, an execution result of the target task to the first component according to the first relationship.
2 . The method according to claim 1 , wherein obtaining the data packages of the at least one target component in the target application program according to the configuration information includes:
determining candidate components corresponding to the configuration information, the candidate components being adapted to the application platform;
in response to a first preset operation on at least one candidate component of the candidate components, using an identifier of the at least one candidate component corresponding to the first preset operation as an identifier of the at least one target component; and
obtaining the data package of the at least one target component according to the identifier of the at least one target component.
3 . The method according to claim 1 , wherein the configuration information further includes a placeholder and a value corresponding to the placeholder, and the data package of the at least one target component in the target application program includes the placeholder; calling the preset automated construction script, and generating the data package of the target application program according to the configuration information and the data package of the at least one target component includes:
calling the preset automated construction script to obtain a type of the at least one target component;
determining positions of different types of target components in the data package of the target application program according to the configuration information and the type of the at least one target component; and
replacing the placeholder in the data package of the 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.
4 . The method according to claim 3 , wherein obtaining the configuration information of the target application program includes:
displaying a configuration page in response to a trigger operation for generating the data package of the target application program, the configuration page including an input control for the placeholder and an input control for an application platform parameter;
obtaining information corresponding to the placeholder in response to a second preset operation on the input control for the placeholder in the configuration page, and using the information corresponding to the placeholder as the value of the placeholder; and obtaining information corresponding to the application platform parameter in response to a third preset operation on the input control for the application platform parameter in the configuration page, and using the information corresponding to the application platform parameter as the identifier of the application platform.
5 . The method according to claim 1 , wherein the call request further includes a generic message object; the generic message object includes the identifier of the second component; and the generic message object is obtained according to a message builder.
6 . An electronic device, comprising:
a processor; and
a memory configured to store instructions capable of being executed by the processor, wherein
the processor is configured to execute the instructions to implement a program data package generation method applied to the electronic device, the method includes:
obtaining, by the electronic device, configuration information of a target application program, the configuration information including an identifier of a application platform to which the target application program is applicable;
obtaining, by the electronic device, a data package of at least one target component in the target application program according to the configuration information, the at least one target component being adapted to the application platform;
calling, by the electronic device, a preset automated construction script, and generating a data package of the target application program according to the configuration information and the data package of the at least one target component;
obtaining, by the electronic device, an identifier of the at least one target component based on a preset plug-in; and
registering, by the electronic device, the at least one target component based on the identifier of the at least one target component;
wherein the electronic device stores a corresponding relationship between the identifier of the at least one target component and the data package of the at least one target component;
the at least one target component includes a first component and a second component; both the first component and the second component inherit from a same parent class;
the method further includes:
generating, by the electronic device, routing information between components in the target application program according to the identifier of the at least one target component; the routing information between components 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;
generating, by the electronic device, a call request in the first component to call the second component to perform a target task in response to a target instruction; wherein the call request includes an identifier of the first component and an identifier of the second component;
locating, by the electronic device, the call request to the second component to perform the target task according to the second relationship; and
calling back, by the electronic device, an execution result of the target task to the first component according to the first relationship.
7 . The electronic device according to claim 6 , wherein obtaining the data package of the at least one target component of the target application program according to the configuration information includes:
determining candidate components corresponding to the configuration information, the candidate components being adapted to the application platform;
in response to a first preset operation on at least one candidate component of the candidate components, using an identifier of the at least one candidate component corresponding to the first preset operation as an identifier of the at least one target component; and
obtaining the data package of the at least one target component according to the identifier of the at least one target component.
8 . The electronic device according to claim 6 , wherein the configuration information further includes a placeholder and a value corresponding to the placeholder, and the data package of the at least one target component in the target application program includes the placeholder; calling the preset automated construction script, and generating the data package of the target application program according to the configuration information and the data package of the at least one target component includes:
calling the preset automated construction script to obtain a type of the at least one target component;
determining positions of different types of target components in the data package of the target application program according to the configuration information and the type of the at least one target component; and
replacing the placeholder in the data package of the 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.
9 . The electronic device according to claim 8 , wherein obtaining the configuration information of the target application program includes:
displaying a configuration page in response to a trigger operation for generating the data package of the target application program, the configuration page including an input control for the placeholder and an input control for an application platform parameter;
obtaining information corresponding to the placeholder in response to a second preset operation on the input control for the placeholder in the configuration page, and using the information corresponding to the placeholder as the value of the placeholder; and
obtaining information corresponding to the application platform parameter in response to a third preset operation on the input control for the application platform parameter in the configuration page, and using the information corresponding to the application platform parameter as the identifier of the application platform.
10 . The electronic device according to claim 6 , wherein the call request further includes a generic message object; the generic message object includes the identifier of the second component; and the generic message object is obtained according to a message builder.
11 . A non-transitory computer-readable storage medium comprising instructions that, when executed by a processor of an electronic device, cause the processor to perform the program data package generation method according to claim 1 .
12 . A computer program product embodied on a non-transitory computer-readable medium, the computer program product comprising computer program instructions that, when run on a computer, cause the computer to perform the program data package generation method according to claim 1 .