Data processing method and apparatus based on multi-end application platform, device, and medium
Through the component configuration and communication channel establishment of the multi-end application platform, the problem of insufficient iOS toolkit functions in multi-end applications is solved, and the business execution success rate and application development flexibility are improved.
Patent Information
- Application Number
- PCT/CN2024/138516
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-12
- Filing Date
- 2024-12-11
- Publication Date
- 2025-07-17
AI Technical Summary
In applet development, when a multi-end framework generates iOS applications, the general iOS toolkit may not be able to provide all the functional services required, resulting in the failure of functional services execution, affecting the success rate of multi-end applications.
Through a multi-end application platform, the component creation interface is displayed, the component configuration information is configured, the component development information is switched to the component development mode, the template component source code is generated that is suitable for the target application, the communication channel between the toolkit and the business component is established, and the business component is built and published, so as to realize the call of the business component.
It improves the business execution success rate of specific applications in multi-end applications, enhances the flexibility and efficiency of application development, breaks through the toolkit's own functional limitations, and realizes business expansion and upgrading.
Smart Images

Figure CN2024138516_17072025_PF_FP_ABST
Abstract
Description
Data processing method, device, equipment and medium based on multi-terminal application platform
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on January 12, 2024, with application number 202410047838X and application name “Data processing method, device, equipment and medium based on multi-terminal application platform”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, device and medium based on a multi-terminal application platform. Background Art
[0003] At present, mini-program developers can compile the source code files of mini-programs (such as application 1) through a multi-terminal framework to obtain multi-terminal applications, such as iOS (a kind of operating environment) mobile applications and Android (a kind of operating environment) mobile applications, to achieve multi-terminal development of applications. Among them, the functional services in application 1 (such as functional service A) are provided by the mini-program toolkit installed in application 1 (a toolkit for installation in mini-programs, the full name of which is software development kit). Correspondingly, when the iOS mobile application corresponding to application 1 (such as application 2) executes functional service A, it also needs to be implemented by calling the iOS toolkit installed in application 2 (that is, the toolkit for installation in iOS applications).
[0004] However, the inventors have found in practice that when the mini-program developer does not simultaneously develop an iOS toolkit adapted for Application 2, the multi-terminal framework usually uses the officially released universal iOS toolkit to generate Application 2. The universal iOS toolkit may not be able to provide all the functional services required by Application 2. For example, when the functional services provided by the universal iOS toolkit itself do not include functional service A, Application 2 cannot use functional service A normally. This means that when a multi-terminal application is obtained through the development of a multi-terminal framework, how to ensure the execution success rate of the functional services on a specific application (for example, Application 2) in the multi-terminal application is a technical problem that needs to be solved urgently. Summary of the Invention
[0005] The embodiments of the present application provide a data processing method, apparatus, device, and medium based on a multi-terminal application platform, which can improve the execution success rate of services on specific applications in multi-terminal applications.
[0006] In one aspect, an embodiment of the present application provides a data processing method based on a multi-terminal application platform, wherein the multi-terminal application platform is configured to develop a multi-terminal application using an application project file of a first application, wherein the multi-terminal application includes the first application, and the method includes:
[0007] Displaying an application processing interface corresponding to the application project file on the multi-terminal application platform, and when the mode in the application processing interface is an application development mode corresponding to the multi-terminal application, displaying a component creation control pre-configured for the application development mode;
[0008] In response to a trigger operation for a component creation control, a component creation interface corresponding to the component creation control is displayed, and component configuration information configured for the business component is displayed on the component creation interface; the component configuration information includes a component identifier of the business component, a component directory address, and a target application identifier bound to the component identifier; the second application corresponding to the target application identifier is an application in the multi-terminal application that is different from the first application;
[0009] In response to a confirmation operation on the component configuration information, the component creation interface is switched back to the application processing interface. In response to a mode switching operation on the application processing interface, the mode in the application processing interface is switched from the application development mode to the component development mode for developing the business component. In the component development mode, the component directory file created for the business component is displayed via the component directory address. The component directory file is used to store the component project file configured for the business component. The component source code in the component project file is the template component source code adapted for the second application and carrying the component identifier.
[0010] In response to a configuration operation on the template component source code, a source code calling statement for calling the business component is configured and obtained, and component configuration source code of the business component is generated through the template component source code and the source code calling statement; the source code calling statement is used to establish a communication channel between a second toolkit of the second application and the business component; the second toolkit is provided by the multi-terminal application platform;
[0011] Compile the component configuration source code to obtain the business component, and publish the business component to display on the multi-terminal application platform;
[0012] A second application is constructed on a multi-terminal application platform based on the application project file, the second toolkit and the business component; the second application is configured to, during runtime, notify the second toolkit to call the business component based on the communication channel and execute the component business provided by the business component, where the component business is configured for the business in the first application.
[0013] On the other hand, an embodiment of the present application provides a data processing method based on a multi-terminal application platform, wherein the multi-terminal application on the multi-terminal application platform includes a first application and a second application, the second application is constructed on the multi-terminal application platform using an application project file, a second toolkit, and a business component of the first application, the second toolkit is provided by the multi-terminal application platform for the second application, and the business component is constructed on the multi-terminal application platform based on a component configuration source code; the component configuration source code is obtained in response to a configuration operation on a template component source code; the source code call statement corresponding to the configuration operation is used to establish a communication channel between the second toolkit and the business component; the template component source code is the component source code in the component project file displayed in the component development mode; the component development mode is the mode in the application processing interface corresponding to the application project file displayed on the multi-terminal application platform; the component project file is stored in a component directory file created for the business component, and the component directory file is determined by the component directory address in the component configuration information configured for the business component. The method includes:
[0014] When the second application is running, in response to a trigger operation on a business control corresponding to the business component, obtaining a business parameter for calling the business component;
[0015] The business parameters are passed to the second toolkit, which, based on the communication relationship indicated by the established communication channel, passes the business parameters to the business component, so that the business component executes the component business based on the business parameters, obtains a business execution result corresponding to the component business, and returns the business execution result to the second toolkit via the communication relationship indicated by the communication channel; the communication channel is established based on source code call statements in the business component when the second toolkit loads the business component, and the component business is configured for the business in the first application;
[0016] Display the service execution result returned by the second toolkit.
[0017] In one aspect, an embodiment of the present application provides a data processing device based on a multi-terminal application platform, wherein the multi-terminal application platform is configured to develop a multi-terminal application using an application project file of a first application, wherein the multi-terminal application includes the first application, and the device includes:
[0018] A data display module is used to display an application processing interface corresponding to the application project file on the multi-terminal application platform, and when the mode in the application processing interface is the application development mode corresponding to the multi-terminal application, display a component creation control pre-configured for the application development mode;
[0019] The data display module is further configured to, in response to a trigger operation for a component creation control, display a component creation interface corresponding to the component creation control, and display component configuration information configured for the business component on the component creation interface; the component configuration information includes a component identifier of the business component, a component directory address, and a target application identifier bound to the component identifier; the second application corresponding to the target application identifier is an application in the multi-terminal application that is different from the first application;
[0020] a component file display module for, in response to a confirmation operation on the component configuration information, switching the component creation interface back to the application processing interface; and, in response to a mode switching operation on the application processing interface, switching the mode in the application processing interface from the application development mode to the component development mode for developing the business component; and, in the component development mode, displaying the component directory file created for the business component via the component directory address; the component directory file is used to store the component project file configured for the business component, the component source code in the component project file being the template component source code adapted for the second application and carrying the component identifier;
[0021] a component source code configuration module configured to obtain, in response to a configuration operation on the template component source code, a source code call statement for calling the business component, and generate component configuration source code for the business component from the template component source code and the source code call statement; the source code call statement is used to establish a communication channel between a second toolkit of the second application and the business component; the second toolkit is provided by the multi-terminal application platform;
[0022] The component construction module is used to compile the component configuration source code to obtain business components, and publish the business components to display on the multi-terminal application platform;
[0023] A multi-terminal application development module is used to build a second application on a multi-terminal application platform based on application project files, a second toolkit and business components; the second application is configured to notify the second toolkit to call the business component based on the communication channel during runtime and execute the component business provided by the business component, which is configured for the business in the first application.
[0024] On the other hand, an embodiment of the present application provides a data processing device based on a multi-terminal application platform, wherein the multi-terminal application on the multi-terminal application platform includes a first application and a second application, the second application being constructed on the multi-terminal application platform using an application project file, a second toolkit, and a business component of the first application, the second toolkit being provided by the multi-terminal application platform for the second application, and the business component being constructed on the multi-terminal application platform based on component configuration source code; the component configuration source code being obtained in response to a configuration operation on a template component source code; the source code call statement corresponding to the configuration operation being used to establish a communication channel between the second toolkit and the business component; the template component source code being the component source code in the component project file displayed in component development mode; the component development mode being the mode in the application processing interface corresponding to the application project file displayed on the multi-terminal application platform; the component project file being stored in a component directory file created for the business component, the component directory file being determined by the component directory address in the component configuration information configured for the business component, and the device comprising:
[0025] A business parameter acquisition module, configured to acquire business parameters for calling a business component in response to a trigger operation on a business control corresponding to the business component when the second application is running;
[0026] a business processing module configured to pass business parameters into the second toolkit, which, based on the communication relationship indicated by the established communication channel, passes the business parameters into the business component, causing the business component to execute the component business based on the business parameters, obtain a business execution result corresponding to the component business, and return the business execution result to the second toolkit via the communication relationship indicated by the communication channel; the communication channel is established based on source code call statements in the business component when the second toolkit loads the business component, and the component business is configured for the business in the first application;
[0027] The result display module is used to display the business execution results returned by the toolkit.
[0028] In one aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method provided in the above aspect of the embodiment of the present application.
[0029] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded and executed by a processor, so that a computer device with a processor executes the method provided in the above aspect of the embodiment of the present application.
[0030] According to one aspect of the present application, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, it implements the method provided in any of the above aspects of the embodiments of the present application.
[0031] In the embodiment of the present application, the multi-terminal application platform is configured to develop a multi-terminal application using the application project file of the first application, where the multi-terminal application can include at least the first application. In this case, the first application refers to the application currently developed by the multi-terminal application platform. For ease of understanding, the first application is taken as an example of a mini-program application. At this time, when the multi-terminal application platform is deployed on a computer device, other applications can be further developed by developing the application project file of the first application obtained by developing the first application. For example, the computer device can display the application processing interface of the application project file on the multi-terminal application platform, and then when the mode in the application processing interface is the application development mode corresponding to the multi-terminal application, the component creation control pre-configured for the application development mode can be displayed. Further, the computer device can respond to the trigger operation for the component creation control and display the component creation interface corresponding to the component creation control, and then configure the component to be created in the component creation interface for the business component to be created with a component identifier for identifying the business component, a component directory address for storing the business component, and an application identifier bound to the component identifier (i.e., the target application identifier). In this way, the computer device can collectively refer to the component identifier, component directory address and target application identifier configured in the component creation interface as the component configuration information configured for the business component displayed on the component creation interface. It can be understood that the second application corresponding to the target application identifier here is an application in the multi-terminal application that is different from the first application (for example, the application running environment of the second application may be different from the application running environment of the second application). It should be noted that by configuring the component identifier and the target application identifier on the component creation interface, the business component corresponding to the current component identifier is bound to the second application corresponding to the target application identifier constructed subsequently, so that when the second application is running, the component loading of the business component can be realized based on the component identifier bound to the target application identifier of the second application.Furthermore, the computer device can, in response to a confirmation operation on the component configuration information, switch the component creation interface currently displayed by the computer device back to the application processing interface, and then perform a mode switching operation on the component processing interface. At this time, the computer device can, in response to the mode switching operation, switch the mode in the application processing interface from the nutritional development mode to the component development mode for developing business components, and then, in the component development mode, display the component directory file created for the business component through the component directory address pre-configured in the component configuration information. The component directory file can be used to store the component project file group configured for the business component. A component project file, wherein the component source code in the component project file is a template component source code adapted to the second application (for example, specifically adapted to the syntax in the application running environment corresponding to the second application) and carrying a component identifier; further, the computer device can respond to the configuration operation on the template component source code and configure a source code calling statement for calling the business component. It should be understood that the source code calling statement can be used to trigger the calling of part of the source code in the template component source code. For example, in one implementable manner, the source code calling statement can be used to establish a communication channel between the second toolkit of the second application and the business component; the second toolkit is provided by the multi-terminal application platform. Thus, the computer device can further generate the component configuration source code of the business component through the template component source code and the source code call statement, and then can compile the component configuration source code to obtain the business component for implementing the specified business (i.e., the component business, which is configured based on the business in the first application). Further, the computer device can publish and display the currently compiled business component on the multi-terminal application platform. Then, the computer device can construct a second application based on the application project file, the second toolkit and the business component on the multi-terminal application platform. The second application here is configured to notify the second toolkit to call the business component based on the communication channel at runtime to execute the component business provided by the business component. The component business is configured for the business in the first application. It can be seen from this that the embodiment of the present application can complete the construction of a business component with a certain business (component business) through a visual interface. In this way, when the second application is running, the second toolkit can call the business component through the communication channel between the second toolkit and the business component pre-established in the process of building the business component, and then the business component can be indirectly called when the second application is running to execute the component business provided by the business component.In other words, in the embodiment of the present application, when a corresponding business component is generated for a certain business (business A), the communication channel between the application toolkit (i.e., the second toolkit) and the business component in the second application can be established, thereby breaking through the limitations of the business provided by the second toolkit itself and helping the second application to use the business A provided by the business component normally through the second toolkit. That is, the embodiment of the present application can conveniently and flexibly implement the business expansion of the application toolkit (i.e., the second toolkit) of the second application through the communication channel established during the construction of the business component. Therefore, when the second application is developed, it can be more convenient to enable the generated second application to implement some customized businesses through flexibly accessed business components. In this way, not only the flexibility of application development can be improved, but also the success rate of business execution can be improved on specific applications (e.g., the second application) in multi-terminal applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] FIG1 is a schematic diagram of a network architecture provided by an embodiment of the present application;
[0033] FIG2 is a schematic diagram of a component generation process provided in an embodiment of the present application;
[0034] FIG3 is a schematic diagram of a component calling process provided by an embodiment of the present application;
[0035] FIG4 is a flow chart of a data processing method based on a multi-terminal application platform provided in an embodiment of the present application;
[0036] FIG5 is a schematic diagram of an application processing interface provided in an embodiment of the present application;
[0037] FIG6 is a schematic diagram of a process for displaying source code of a template component provided by an embodiment of the present application;
[0038] FIG7 is a schematic diagram of a construction process of a business component provided in an embodiment of the present application;
[0039] FIG8 is a schematic diagram of a construction process of another business component provided in an embodiment of the present application;
[0040] FIG9 is a schematic diagram of a construction process of another business component provided in an embodiment of the present application;
[0041] FIG10 is a schematic diagram of a publishing process of a business component provided in an embodiment of the present application;
[0042] FIG11 is a flow chart of another data processing method based on a multi-terminal application platform provided in an embodiment of the present application;
[0043] FIG12 is a schematic diagram of a process for generating a second application according to an embodiment of the present application;
[0044] FIG13 is a schematic diagram of another process for generating a second application provided in an embodiment of the present application;
[0045] FIG14 is a schematic diagram of another process for generating a second application provided in an embodiment of the present application;
[0046] FIG15 is a schematic diagram of a generation scenario of a second application provided in an embodiment of the present application;
[0047] FIG16 is a flow chart of another data processing method based on a multi-terminal application platform provided in an embodiment of the present application;
[0048] FIG17 is a schematic diagram of an interactive process for executing a service according to an embodiment of the present application;
[0049] FIG18 is a schematic structural diagram of a data processing device based on a multi-terminal application platform provided in an embodiment of the present application;
[0050] FIG19 is a schematic structural diagram of another data processing device based on a multi-terminal application platform provided in an embodiment of the present application;
[0051] FIG20 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] Please refer to Figure 1, which is a schematic diagram of a network architecture provided by an embodiment of the present application. As shown in Figure 1, the system architecture may include a business server 100 and a business terminal cluster, wherein the business terminal cluster may include one or more business terminals (such as user terminals), and the number of business terminals in the business terminal cluster will not be limited here. As shown in Figure 1, the multiple business terminals in the business terminal cluster may specifically include: business terminal 200a, business terminal 200b, ..., business terminal 200n, wherein there may be a communication connection between the business terminal clusters, for example, there is a communication connection between business terminal 200a and business terminal 200b, and there is a communication connection between business terminal 200a and business terminal 200n. At the same time, any business terminal in the business terminal cluster may have a communication connection with the business server 100, so that each business terminal in the business terminal cluster can exchange data with the business server 100 through the communication connection, for example, there is a communication connection between business terminal 200a and business server 100. Among them, the above-mentioned communication connection does not limit the connection method. It can be directly or indirectly connected through wired communication, directly or indirectly connected through wireless communication, or through other methods. This application does not limit it here.
[0053] It should be understood that each business terminal in the business terminal cluster shown in FIG1 can install a multi-terminal application (e.g., a second application) developed through a multi-terminal application platform. When the second application runs in each business terminal, it can interact with the business server 100 shown in FIG1 above for data. The second application can be any type of application, such as a social application, a text processing application, an instant messaging application (e.g., a conference application), an entertainment application (e.g., a game application, a live broadcast application), an information application (e.g., a news application), a shopping application, an in-vehicle application, a multimedia application, or the like having the function of displaying data information such as text, images, audio, and video.
[0054] For example, here, the second application is a game application as an example to illustrate the data interaction process between the business terminal 200a and the business server 100. The game application refers to a client that can send and receive Internet messages instantly and has information search functions, etc. The business component (also known as a business plug-in) in the game application can be a payment component for executing payment services. When a payment service (for example, a service for purchasing a certain game equipment) is executed through the game application on the business terminal 200a, the application toolkit in the game application can call the payment component to execute the payment service through a communication channel pre-established between the application toolkit in the game application and the payment component. In this way, when the game application on the business terminal 200a calls the payment component to execute the payment service, it can interact with the business server for data. For example, the payment component can send a payment request to the business server, and the business server returns the payment result after completing the payment based on the payment request.
[0055] It can be understood that the computer device involved in the embodiments of the present application can be a server (for example, the business server 100 shown in Figure 1) or a terminal (for example, any one of the business terminals in the business terminal cluster shown in Figure 1). The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, vehicle terminal, aircraft, etc., but is not limited to this. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.
[0056] It can be understood that Figure 1 is only an example of a possible network architecture of the technical solution of the present application, and does not limit the specific architecture of the technical solution of the present application, that is, the technical solution of the present application can also provide other forms of network architecture.
[0057] For ease of understanding, the embodiments of this application will explain the relevant concepts involved in this application, as follows:
[0058] 1. Mini Programs: The mini programs referred to in the embodiments of this application are independent programs that can be embedded and run on a client. This means that the embodiments of this application can collectively refer to independent programs that run on a client (i.e., the target client, such as the aforementioned social application) using the mini program runtime technology as mini programs.
[0059] 2. Developer Tools: The development tools involved in the embodiments of this application refer to development tools that can be provided to developers for use. For example, in the embodiments of this application, the development tools that developers use to develop applets for the above-mentioned clients (i.e., target clients, such as the above-mentioned social applications) can be collectively referred to as developer tools. In the embodiments of this application, in order to facilitate developers to achieve multi-terminal development through developer tools, a multi-terminal framework (e.g., Donut multi-terminal framework) can be deployed and run on the development tools, so that the developer tools deployed with the multi-terminal framework can be collectively referred to as multi-terminal application platforms. In this case, the multi-terminal application platform is a developer tool that can be deployed on a computer device to support developers in developing multi-terminal applications in a multi-terminal application mode.
[0060] Specifically, developers can develop an application (i.e., a first application, such as a mini-program) through the visual interface provided by the multi-terminal application platform. Then, for a certain business in the first application, they can develop a corresponding business component for another application corresponding to the specified application identifier. Then, they can build a second application based on the application project file of the first application and the application toolkit of another application (i.e., the second application) provided by the multi-terminal application platform and the currently developed business component (which can be essentially understood as a plug-and-play plug-in). In this way, when the second application is running, it can rely on the communication channel between the application toolkit of another application (i.e., the second application) pre-established when building the business component and the business component to realize flexible calling of the business component, and then execute the component business that is the same as a certain business provided by the first application through the called business component.
[0061] 3. Multi-terminal framework: refers to the framework officially launched by the application that supports the development of mobile applications using the native syntax of mini-programs. Developers can use this multi-terminal framework to achieve multi-terminal development through one coding. For example, based on the application project file of a certain application, the multi-terminal framework can be used to compile and obtain mini-programs that can be embedded in a certain client and applications in a certain operating environment (for example, Android applications in an Android operating environment) and applications in another operating environment (for example, iOS applications in an iOS operating environment).
[0062] 4. Multi-terminal application: refers to the application compiled by the Donut multi-terminal framework, for example, the above-mentioned applet, Android application and iOS application, etc. In an embodiment of the present application, if the first application is a applet, the application project file of the first application can be the applet project file of the applet encoded according to the native syntax of the applet. Optionally, if the first application is an Android application, the application project file of the first application can be the Android application project file of the Android application encoded according to the Android native syntax adapted to the Android operating environment. Similarly, if the first application is an iOS application, the application project file of the first application can be the iOS application project file of the iOS application encoded according to the iOS native syntax adapted to the iOS operating environment. In addition, it can be understood that the embodiment of the present application can also refer to the multi-terminal application developed by the multi-terminal framework except the first application (i.e., the currently developed application) as the second application, wherein the second application is an application developed by the multi-terminal application platform installed with the multi-terminal framework using the application project file of the first application.
[0063] 5. Software Development Kit (SDK): In an embodiment of the present application, the SDK provided by the multi-terminal framework (for example, it can also be a developer tool integrated with the multi-terminal framework, that is, a multi-terminal application platform) for assisting multi-terminal applications to realize corresponding business functions can be collectively referred to as an application toolkit. In one implementable manner, each application in the multi-terminal application is mainly composed of an SDK for each application (that is, an application toolkit) + a resource package for each application. Furthermore, in order to realize the business under a specific function, in another implementable manner, a specific application in the multi-terminal application is mainly composed of an SDK for a specific application + a resource package for a specific application + a business plug-in configured for a specific application. It can be understood that the resource package of the specific application (for example, the second application) is encoded for the specific application based on the application project file of the above-mentioned first application (that is, the project file where the resource package of the first application is located).
[0064] For example, the SDK used by mini-program applications (i.e., mini-programs) is the mini-program SDK, the SDK used by iOS applications (e.g., iOS mobile applications) is the iOS SDK, and similarly, the SDK used by Android applications (e.g., Android mobile applications) is the Android SDK.
[0065] 6. Application project files. The application project files involved in the embodiments of the present application refer to the files where the application packages of the corresponding multi-terminal applications (i.e., the resource packages of the corresponding multi-terminal applications) are located. For example, in the case of iOS applications, the file where the application package of the iOS application is located is an IPA (i.e., iPhone Application) file. Among them, IPA refers to a file format of an iOS application package. It should be understood that a file with an IPA file format can be an IPA file, and the IPA file here (i.e., a program package file of an iOS application deployed and installed in an iOS application environment) can specifically include all program codes, resources, metadata, and signatures of the iOS application. In other words, the IPA here refers to the standard format for installing and deploying the application of the iOS application on a computer device whose application environment is iOS.
[0066] Further, please refer to Figure 2, which is a schematic diagram of a component generation process provided in an embodiment of the present application. Among them, the components involved in the embodiment of the present application (for example, the business component 28a shown in Figure 2) are constructed through a multi-terminal application platform deployed on a computer device, wherein the multi-terminal application platform is configured to develop a multi-terminal application using the application project file of a certain application.
[0067] It should be understood that the multi-terminal application platform can be deployed on a computer device, which can be any business terminal in the business terminal cluster in Figure 1 (for example, business terminal 200a); wherein, the interface 1 shown in Figure 2 can be an application processing interface for displaying the application project file of the first application on the multi-terminal application platform. At this time, a developer who needs to develop a business component 28a through the multi-terminal application platform can click on the project control (for example, project 21a shown in Figure 2) displayed in the interface 1 (that is, the application processing interface) when the mode in the interface 1 (that is, the application processing interface) is the application development mode corresponding to the multi-terminal application (for example, the multi-terminal development mode) to display the component creation control pre-configured for the application development mode in the project list of the project 21a (as shown in Figure 2 "Create business component 22a", the "Create business component 22a" displayed in the interface 1 can be a control for creating a new plug-in based on the current multi-terminal application).
[0068] Furthermore, the computer device can display the component creation interface corresponding to the component creation control (for example, the interface 2 for creating a business component shown in Figure 2) in response to the trigger operation for the component creation control, so that the developer can configure the corresponding component configuration information for a plug-in (i.e., a business component) that needs to be created on the component creation interface (for example, the interface 2 shown in Figure 2). For example, as shown in Figure 2, in one implementable manner, the component configuration information here can specifically include the project identifier of the plug-in (i.e., the business component) (such as the identifier of the component project file with the project name "D1"), the component directory address (such as the storage address of the component directory file with the directory "B1"), the target application identifier (such as the identifier of the application with the application ID "C1"), and the component identifier (such as the identifier of the component with the plug-in ID "A1"). Optionally, in another implementable manner, the component configuration information here can also include other configuration information (for example, whether the plug-in is generated locally on the computer device or whether the plug-in is generated in the cloud, etc.).
[0069] Furthermore, the computer device can respond to the confirmation operation on the component configuration information in interface 2 by switching the display interface of the multi-terminal application platform from interface 2 (i.e., the component creation interface) back to interface 1 (i.e., the application processing interface). In this way, the developer can further perform a mode switching operation in interface 1 (i.e., the application processing interface) so that the computer device can respond to the mode switching operation and switch the mode in interface 1 (i.e., the application processing interface) from the application development mode (i.e., the multi-terminal development mode) to the component development mode 25a for developing business components. As shown in Figure 2, at this time, the computer device can display the component directory file 26a created for the business component 28a through the component directory address pre-configured in the above-mentioned component configuration information in the component development mode 25a (for example, "B1" shown in Figure 2). As shown in Figure 2, the component directory file 26a can be used to store the component project file 27a with the project identifier "D1" configured for the business component 28a. At this time, the component source code in the component project file 27a can specifically be a template component source code that is adapted to the application (i.e., the second application) corresponding to the target application identifier (for example, "C1" shown in Figure 2) and carries the component identifier (for example, D1 shown in Figure 2).
[0070] It can be understood that the template component source code here is the source code (i.e., source code) in the development template adaptively selected by the computer device based on the running environment of the application (i.e., the second application) corresponding to the target application identifier (for example, "C1" shown in Figure 2 above).
[0071] Furthermore, the developer can open the component project file by double-clicking the component project file to output a source code output interface for displaying the template component source code. In this way, the computer device can further respond to the configuration operation performed by the developer on the component configuration source code when the template component source code is displayed in the source code output interface to configure a source code call statement for calling the business component, and then generate the component configuration source code of the business component through the template component source code and the source code call statement; in this embodiment of the application, the source code call statement can be used to establish a communication channel between the application toolkit (i.e., the second toolkit) of the second application corresponding to the target application identifier and the business component corresponding to the component identifier; it should be understood that the second toolkit here is provided by the multi-terminal application platform. Further, as shown in Figure 2, the computer device can construct (i.e., compile) the business component 28a through the component configuration source code, and then publish and display the business component 28a on the multi-terminal application platform, so that the developer can see the business component 28a currently developed for a certain business in the first application on the multi-terminal application platform.
[0072] It can be understood that the embodiment of the present application can further generate a second application corresponding to the first application through a business component. The second application refers to a multi-terminal application in a different format from the first application. For example, the first application is a first format application (such as a mini-program application) that can be run in a certain operating environment (for example, the first operating environment), and the second application is a second format application that can be run in another operating environment (for example, the second operating environment) (such as a mobile application in the second format, for example, the second format can be iOS format, that is, the application corresponding to the iOS format can be an iOS mobile application, also known as an iOS application, that is, a mobile application installed in an operating environment adapted to the second format), or, optionally, the second application can also be a third format application (such as a third format mobile application, for example, the third format can be Android format, that is, the application corresponding to the Android format can be an Android mobile application, also known as an Android application, that is, a mobile application installed in an operating environment adapted to the third format). Among them, the operating environment adapted to the second format can be the above-mentioned iOS operating environment, and similarly, the operating environment adapted to the third format can be the above-mentioned Android operating environment.
[0073] It should be understood that the embodiments of the present application will not limit the specific formats of the first format, the second format, and the third format. That is, the first application and the second application can refer to applications installed in any operating environment (such as mini-program applications or mobile applications). As the business develops, other formats may still be used. The generation process of applications in other formats is the same as that of applications in the second format and the third format. At this time, only the first format, the second format, and the third format are taken as examples.
[0074] It is understandable that when independently developing applications of different formats, the programming languages (i.e., development syntax) used are different. For example, the native code of the independently developed second format application (such as iOS application) is programming language 1, the native code of the independently developed first format application (such as applet application) is programming language 2, and the native code used by the independently developed third format application (such as Android application) is programming language 3. At this time, the developer can deploy a computer device with a multi-terminal application platform, and compile the application processing file corresponding to the application of one format (such as a project file with data such as the execution logic and design interface of the application, for example, the application project file of the first application mentioned above) to compile an application of another format. For example, the embodiment of the present application can compile the project file of the applet to obtain iOS application and / or Android application, which means that the embodiment of the present application can realize the development of multi-terminal applications across languages and formats by integrating the multi-terminal application platform of the multi-terminal framework.
[0075] Among them, taking the mini program as an example, all functional services in the mini program rely on the application toolkit. The application toolkit used to provide functional services in the mini program (for example, the mini program SDK mentioned above, that is, the software development toolkit of the mini program) is a toolkit installed in the application in the mini program format, that is, the programming language for developing the mini program SDK should also be programming language 1. All functional services (for example, application native functional services or open functional services (for example: sharing services, payment services, etc.)) in other formats of multi-terminal applications (for example, the above-mentioned second application) generated based on the mini program (that is, the above-mentioned first application) under the multi-terminal application platform also rely on the corresponding application toolkit provided by the multi-terminal application platform to provide.
[0076] It is understood that the application toolkit in a second-format application (such as an iOS application) is a toolkit installed within the second-format application, meaning that the programming language used to develop the second-format SDK should also be programming language 2. The application toolkit in a third-format application (such as an Android application) is a toolkit installed within the third-format application, meaning that the programming language used to develop the third-format SDK should also be programming language 3. The application toolkit can be used to provide services corresponding to the corresponding application.
[0077] It can be understood that when the second application is running and triggers the component service, it can call the service component through the established communication channel to execute the component service that matches (or is the same as) the service in the first application. That is, the second application can implement the component service through the service component.
[0078] It can be understood that this realizes the business expansion of the application toolkit, so that the application toolkit can provide the second application with functions that the application toolkit itself does not have. For example, the second application requires services 1-4, and the application toolkit itself can provide services 1-3. At this time, only business components for service 4 need to be developed. In this way, by establishing a communication channel between the application toolkit and the business component, service 4 can be used normally in the second application, and then the flexibility and efficiency of the corresponding business development and configuration in the second application can be fundamentally improved through the business component.
[0079] Further, please refer to Figure 3, which is a schematic diagram of a component calling process provided by an embodiment of the present application. As shown in Figure 3. On a multi-terminal application platform, developers can construct the second application 30a shown in Figure 3 through the application project file of the first application (for example, the project file of the first format application opened and displayed in the interface 1 by triggering project 21a in the interface shown in Figure 2), the application toolkit (i.e., the above-mentioned second format SDK) provided by the multi-terminal application platform for the application corresponding to the target application identifier configured in the above-mentioned component configuration information (i.e., the second application 30a) and the business component 32a generated by the above-mentioned multi-terminal application platform.
[0080] This means that the second application 30a can generate an application in another format based on the application project file of the first application by jointly compiling an application toolkit 31a and a business component 32a (i.e., the business component 28a generated according to the example of FIG2 ) in the same format as the second application. In this way, after the second application 30a is deployed and installed on a computer device (the computer device can be any business terminal in the business terminal cluster in FIG1 , for example, the business terminal 200a described above), the second application 30a is run on the computer device, so that the business control 33a corresponding to the business component 32a can be displayed on the application interface of the second application 30a (e.g., if the component business is a payment business, the business control 33a corresponding to the business component 32a can specifically be a control that enables payment services for the payment business). At this time, the computer device can respond to the triggering operation of the business control 33a corresponding to the business component 32a, that is, when the component business supporting the payment service is triggered on the application interface of the second application, the computer device can further obtain the business parameters for calling the business component 32a, so as to pass the currently obtained business parameters to the application toolkit in the second application (for example, the application toolkit 31a shown in Figure 3). At this time, the computer device can further pass the business parameters to the business component 32a based on the communication relationship indicated by the communication channel pre-established between the application toolkit in the second application (for example, the application toolkit 31a shown in Figure 3);
[0081] In one implementable manner, the communication channel is established when configuring the source code call statement for loading the business component through the application toolkit 31a during the process of constructing the business component. It can be understood that the application toolkit 31a can load the business component (that is, specifically, it can refer to the test component used to simulate the loading of the business component during the test process) and establish a communication channel when the component business is triggered for the first time (for example, before the business component is compiled through the above-mentioned component configuration source code, the first triggering in the process of testing the test component generated by the component configuration source code) and establish a communication channel. Subsequently, the component business can be executed through the communication channel at any time when the component business is triggered.
[0082] It is understood that triggering component service processing can be triggered by a control, gesture, voice, or other means. For example, it can be triggered by double-clicking or swiping on the second application's application interface; or it can be triggered by voice recognition of service keywords on the second application's application interface. This is not limited here, and the triggering method of component services is determined by the specific scenario.
[0083] It can be understood that, as shown in Figure 3, after the business component 32a obtains the business parameters transmitted by the application toolkit 31a through the communication channel, it can further execute the component business based on the business parameters to obtain the business execution result corresponding to the component business (for example, the business execution result 34a shown in Figure 3). Then, the business component 32a can return the business execution result (for example, the business execution result 34a shown in Figure 3) to the application toolkit 31a through the communication relationship indicated by the pre-established communication channel, so that the application toolkit 31a can further transmit the business execution result (for example, the business execution result 34a shown in Figure 3) back to the second application. In this way, the second application running in the computer device can display the business execution result 34a returned by the application toolkit 31a on the application interface of the second application. In this way, the calling of the business component to execute the corresponding component business is flexibly and conveniently achieved.
[0084] Optionally, in one possible implementation, a computer device may execute the data processing method based on a multi-terminal application platform according to actual business needs to improve the flexibility and efficiency of application development. The technical solution of the present application can be applied to any multi-terminal application development scenario. For example, the first format application (such as a mini-program application) can be a shopping application 1, and a second format application (such as an iOS application) corresponding to the shopping application 1 can be generated through the multi-terminal application platform, namely, shopping application 2. The shopping application 2 can be called a multi-terminal application corresponding to the shopping application 1, and the required business and related logic in the shopping application 2 are the same as those in the shopping application 1. For another example, the first format application (such as a mini-program application) can be a game application 1, and a second format application (such as an iOS application) corresponding to the game application 1 can be generated through the multi-terminal application platform, namely, game application 2. The game application 2 can be called a multi-terminal application corresponding to the game application 1, and the required business and related logic in the game application 2 are the same as those in the game application 1. Optionally, the component business can be any type of business, such as a product sharing business in the shopping application 1, or a payment business in the game application 1. There is no limitation on the component business of the developable business components here. The developer of the first application can develop business components for any business. For ease of distinction, the services required by multi-terminal applications are referred to as application services, the services provided by application toolkits are referred to as toolkit services, and the services developed with service components are referred to as component services. It is understood that in one implementation, the services herein may also be referred to as corresponding network functions.
[0085] It can be understood that the technical solution of the present application can be applied to the business expansion scenario of the application toolkit. For example, the application business (such as business 1-4) of the first application (such as game application 1) needs to be provided by the application toolkit (application toolkit 1) in the first application. That is to say, when the first application triggers a certain business (such as business 4), it executes the triggered business 4 by calling application toolkit 1.
[0086] It can be understood that the toolkit business of the application toolkit of the first application includes businesses 1-4. At this time, the application business of the second application (such as game application 2, it can be understood that the programming languages used by the first application and the second application can be different) generated corresponding to the first application should also include businesses 1-4, and when the second application triggers a certain business (business 4), it can specifically be executed by calling the second toolkit (application toolkit 2) and the application toolkit 2 executes the triggered business 4.
[0087] At this time, in one possible implementation, if the toolkit service of application toolkit 2 does not include service 4, that is, application toolkit 2 cannot provide service 4 for the second application, which means that the user cannot use service 4 in the second application normally, it means that the developer needs to develop a business component for providing service 4 on a multi-terminal application platform for the business 4, and establish a communication channel between the business component and the application toolkit 2 during the construction of the business component. Among them, it can be understood that the programming language used by the business components corresponding to the business 4 generated by the computer device through the multi-terminal application platform is the same as that of the second application. In this way, when the second application is constructed through the application project file, application toolkit 2 and business components of the above-mentioned first application, the second application can be further deployed and installed in the computer device, so that when the computer device runs the second application, it can use the pre-established communication channel between the second toolkit and the business component to enable the second application to call the business component to normally use the business 4. That is, at this time, the business component constructed through the multi-terminal application platform is essentially equivalent to realizing the business extension of the second toolkit (for example, application toolkit 2). In this way, the second toolkit after business expansion (for example, application toolkit 2) can be used to normally provide business 4 to the second application, thereby realizing the business extension of the second toolkit in the second application in the form of business components.
[0088] It can be understood that the technical solution of the present application can also be applied to the business upgrade scenario of a certain application toolkit. For example, the application business in the second application is business 1-4, and the toolkit business of application toolkit 2 includes business 1-4, that is, the application business in the second application can be used normally. If business 4 needs to be upgraded, it is necessary to upgrade the relevant business in application toolkit 2. However, the steps for upgrading the business of application toolkit 2 are relatively cumbersome. Therefore, a business component can be generated for the upgraded business 4. In this way, when the second application needs to use business 4, it can use the upgraded business 4 provided by the business component by calling the business component through application toolkit 2, thereby realizing the business upgrade in the form of a business component. In other words, a business component can be constructed for any component business. When a multi-terminal application needs to use a component business, the component business can be realized through the corresponding business component in the multi-terminal application, so that the business use of the multi-terminal application does not need to be restricted by the business that the application toolkit itself can provide in the multi-terminal application, and the multi-terminal application development experience can be continued. For example, the required native business and extended business can be customized in the multi-terminal application constructed corresponding to the first application.
[0089] It can be understood that multi-terminal applications can include applications in various formats, such as mini-program applications (i.e., the above-mentioned mini-programs), iOS applications, and Android applications. The technical solution of the present application can generate another application (a second application, for example, application B) through the application processing file (i.e., the above-mentioned application project file) of an application (the first application), and add the business component of a business (business X) to application B, so that when application B uses business X, it can call the business component through the application toolkit in application B to execute business X. Even if the application toolkit does not have business X, the business extension of the application toolkit in application B can be implemented through the business component, so that business X can be used in application B in a plug-and-play manner. On a multi-terminal application platform, it is possible to generate another application based on the application processing file of one application. For the sake of convenience of explanation, the technical solution of the present application is described here by taking the generation of a second format application (such as an iOS application) based on a first format application (such as a mini-program application) as an example. In other words, a multi-terminal application platform may refer to a framework that supports the use of the native syntax (i.e., the programming language of the mini-program format) of the first format (e.g., the mini-program format) to develop applications in the second format (e.g., iOS applications, i.e., multi-terminal applications compiled through a multi-terminal framework). That is, for mini-program developers (i.e., the above-mentioned developers), they can develop a mini-program project file once, and further compile it through the multi-terminal framework in the multi-terminal application platform to obtain applications in the mini-program format and applications in other formats (e.g., iOS applications, Android applications), thereby realizing multi-terminal development.
[0090] It can be understood that the multi-terminal application platform can be used to develop the first application, and can also be used to develop the second application. The first application and the second application are in different formats. That is, the multi-terminal application platform (that is, the developer tool with a multi-terminal framework installed as mentioned above) can be used to further generate the second application based on the application processing file of the first application, the application toolkit provided by the multi-terminal application platform that needs to be installed in the second application, and the business components generated by the multi-terminal application platform. At this time, the business and application execution logic of the second application are determined by the application processing file of the first application (when the application processing file of the first application is configured as the target application processing file, the business and application execution logic of the second application can be further determined by the target application processing file).
[0091] In other words, the second application involved in the embodiments of the present application can call a service component through an application toolkit. For example, the first application can be a mini-program application, and the second application can be an iOS application. The first application and the second application are both applications that can implement corresponding services through the corresponding application toolkit (in this case, the service can be provided by the application toolkit itself, or the application toolkit can call a service component to provide the service).
[0092] When developing a first application, you can also configure business components in the existing first application in the same way as developing a second application to obtain a new first application, so as to achieve business expansion of the application toolkit in the first application. That is, at this time, the second application can be an application with the same format as the first application, or an application with a different format. When the first application and the second application are in the same format, the programming language of the application toolkit in the first application and the application toolkit in the second application are the same. When the first application and the second application are in different formats, the programming languages of the application toolkit in the first application and the application toolkit in the second application are different. The services provided by the application toolkit in the first application and the application toolkit in the second application can be the same or different.
[0093] It should be noted that when the multi-terminal application (such as the second application) in the embodiment of the present application obtains the user data (such as the user account, identity information), etc. of the user, a prompt interface or pop-up window can be displayed in the corresponding application. The prompt interface or pop-up window is used to prompt the business object that it is currently collecting user data and other data. Only after the user confirms the prompt interface or pop-up window (such as the user confirms the authorization through the second application) does the relevant steps of data acquisition begin, otherwise the process ends. In addition, when the above embodiments of the present application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the user and other business objects, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant regions.
[0094] Further, please refer to Figure 4, which is a flow chart of a data processing method based on a multi-terminal application platform provided in an embodiment of the present application. As shown in Figure 4, the method can be executed by the computer device mentioned above, and the computer device can be a business terminal configured with a multi-terminal application platform. For example, the business terminal can be the business terminal 200a shown in Figure 1 above. The multi-terminal application platform here is configured to develop a multi-terminal application using the application project file of the first application, wherein the multi-terminal application can include the first application. As shown in Figure 4, the method can specifically include the following steps S101-S106:
[0095] S101. Display an application processing interface corresponding to the application project file on a multi-terminal application platform. When the mode in the application processing interface is an application development mode corresponding to a multi-terminal application, display a component creation control pre-configured for the application development mode.
[0096] Among them, the multi-terminal application platform can be used to develop multi-terminal applications. The multi-terminal applications here can include at least the first application currently developed through the above-mentioned developer tools. It should be understood that in the process of developing the first application, the project file corresponding to the first application can be the above-mentioned application project file, and the application project file includes the application processing file encoded by the above-mentioned developer tools. In other words, in the embodiment of the present application, the first application can specifically be an application that has been developed with an application processing file (the first application can be compiled from the application processing file).
[0097] It can be understood that in the embodiment of the present application, in order to facilitate distinction, other applications subsequently developed on a multi-terminal application platform using the application project file of the first application can be collectively referred to as second applications, that is, the second application here is essentially an application to be developed based on the application project file of the first application (for example, it can specifically be the application processing file in the application project file).
[0098] Specifically, a developer can open the application project file of the first application on a computer device deployed with a multi-terminal application platform, wherein the application project file here specifically refers to the application project file encoded by the above-mentioned developer when developing the project of the first application on the multi-segment application platform (for example, it can be a developer tool installed with a multi-terminal framework). Furthermore, the computer device can display the application processing interface corresponding to the currently opened application project file of the first application on the multi-segment application platform. In one implementable manner, the application processing interface can be used to display a mode selection area, so that the developer can select and display the application development mode for developing the second application (that is, essentially a multi-terminal application mode corresponding to a multi-terminal application) in the mode selection area.
[0099] It should be understood that in this application development mode, if the application toolkit (i.e., the second toolkit) provided by the multi-terminal application platform for the second application can be used to provide users with corresponding services (for example, service 1), then the developer can use the application project file of the first application and the application toolkit (i.e., the second toolkit) provided by the multi-terminal application platform for the second application to construct the second application on the application processing interface.
[0100] Optionally, in this application development mode, if the application toolkit (i.e., the second toolkit) provided by the multi-terminal application platform for the second application cannot be used to provide users with corresponding services (e.g., service 4), the developer needs to develop additional business components that can be dynamically inserted into the second application through the application processing interface for the services (e.g., service 4) that the second toolkit currently cannot provide. In this way, subsequent developers can further construct another second application through the application project file of the first application and the application toolkit (i.e., the second toolkit) provided by the multi-terminal application platform for the second application and the business component, so that the other second application can provide users with corresponding component services (e.g., service 4) by calling the business component through the second toolkit.
[0101] Among them, the application processing interface includes a project control (i.e., a "project" displayed in the form of a control that can be triggered by the developer, for example, project 21a shown in Figure 2 above). The developer can display a project list by touching the project control. The project list may include a component creation control (e.g., a control with the text "Create component" or "New multi-terminal plug-in" displayed in the form of a control). Optionally, the component creation control can be used to create a business component for a certain business of the first application based on the project file (i.e., the above-mentioned application project file) of the currently opened multi-terminal application (i.e., the first application). In other words, in one implementation method, the developer can create a business component for the first application that needs to be upgraded under the project corresponding to the currently opened application project file. It should be understood that the first application that needs to be upgraded here can be equivalent to the new first application (i.e., the second application) that is rebuilt after the business in the first application needs to be upgraded through the business component. At this time, the component creation control can be used to create a business component for the first application based on the project file (i.e., the above-mentioned application project file) of the currently opened multi-terminal application (i.e., the first application) for a certain business of the first application (e.g., a business that needs to be upgraded).
[0102] Optionally, in another possible implementation, the developer can also, when opening the application project file of the first application, trigger the project control for opening the application project file to further display the project list under the project control (for example, each control in the project list can be displayed in the form of a drop-down list). In this way, the developer can flexibly create business components belonging to the second application (multi-terminal application) to be generated by using the component creation control pre-configured for the application development mode displayed in the project list. This means that at this time, the component creation control can be used to create business components for other multi-terminal applications (i.e., other applications to be generated through the multi-terminal application platform) based on the project file (i.e., the above-mentioned application project file) of the currently opened multi-terminal application (i.e., the first application) for a certain business of the first application (for example, the above-mentioned business 4).
[0103] S102. In response to a triggering operation on a component creation control, a component creation interface corresponding to the component creation control is displayed, and component configuration information configured for the business component is displayed on the component creation interface; the component configuration information includes a component identifier of the business component, a component directory address, and a target application identifier bound to the component identifier; the second application corresponding to the target application identifier is an application in the multi-terminal application that is different from the first application;
[0104] Among them, it can be understood that the developer of the first application can configure relevant component configuration information in the component creation interface, and the component creation interface here can be used to display the component configuration information of the business component to be created. Among them, the component configuration information can specifically include the component identifier of the business component, the component directory address and the target application identifier bound to the component identifier. Among them, it can be understood that the component directory address here can be the storage address of the component directory file for storing the business plug-in in the project associated with the application project file in the first application (for example, the storage address can be the address where the application project file of the first application is located). Optionally, the component directory address here can also be another storage address for storing the component directory file of the business component customized by the developer.
[0105] It is understood that the application project files herein are files related to the application project of the first application. For example, the application project files may include application processing files containing data such as the execution logic of the first application, and may also include component-related files of the business component developed for the second application corresponding to the first application (such as component project files containing the execution logic of the business component, etc.; it is understood that component project files are files related to the component project of the business component). It is understood that the application projects and component projects herein are both projects created by developers through the multi-terminal application platform.
[0106] For example, as shown in Figure 5, Figure 5 is a schematic diagram of an application processing interface provided by an embodiment of the present application; wherein, the application processing interface of the first application can be interface 50a shown in Figure 5, and the interface 50a here can specifically be interface 1 in the example of Figure 2 above. As shown in Figure 5, the application processing interface (for example, interface 50a) displays directory information of the application project file of the first application, for example: the directory information here can include the project identifier corresponding to the project of the first application (i.e., the application project) (for example, ABC shown in Figure 5). Among them, in the directory information, the application processing files of the first application under the application project file can include file a1, file a2, and file a3 shown in Figure 5.
[0107] In the embodiment of the present application, developers can view the corresponding application processing file by triggering (e.g., clicking) the directory information (e.g., project identifier), and can view the specific content (e.g., specific execution logic) of an application project file by clicking on an application project file in the application processing file. For example, a developer can click on file a1 on interface 50a to display the content of file a1 on the multi-terminal application platform.
[0108] In addition, as shown in FIG5 , the application processing interface (e.g., interface 50a) also includes a mode selection area that can help developers flexibly switch modes. For example, after opening the application project file of the first application through the computer device, the developer can enter the multi-terminal application mode (e.g., application development mode 51c shown in FIG5 ). This means that at this time, the computer device can display the mode configuration in the application processing interface as application development mode 51c for developing other multi-terminal applications (i.e., second applications) in the mode selection area of interface 50a. In other words, the developer can further develop other multi-terminal applications corresponding to the first application in this application development mode.
[0109] It can be understood that when the first application is a mini-program application, the multi-terminal application of the first application can be an iOS application, etc. Moreover, as shown in FIG5 , the project control deployed and displayed on the application processing interface (e.g., interface 50a) can be item 52c shown in FIG5 . The developer can further display a project list consisting of at least one control in the form of a drop-down list by touching the project control. The project list can include a control for creating a new project (e.g., a new application project) (i.e., a new project control), a control for importing a project (e.g., importing an existing application project) (i.e., an import project control), and a control 53c (i.e., a component creation control) for creating a new multi-terminal plug-in based on the current multi-terminal application (i.e., creating a business component based on the current multi-terminal application). In other words, the component creation control here can be configured as a control for creating a new multi-terminal plug-in.
[0110] Alternatively, in another implementable manner, the component creation control here can also be configured to be used for creating a new multi-terminal plug-in control under the currently opened project when the application project file of the corresponding project (i.e., the corresponding application project) is opened based on the current multi-terminal application. That is to say, the embodiment of the present application can also be used to create a business component belonging to (i.e., stored in) the currently opened project, and it can also be understood that the embodiment of the present application can create a business component belonging to the second application (multi-terminal application) to be generated by the control 53c (i.e., component creation control) for creating a business component. Among them, as shown in Figure 5, the developer can further touch the component creation control (e.g., the control 53c for creating a business component shown in Figure 5) on the interface 50a to display the component creation interface corresponding to the component creation control (e.g., the interface 50b shown in Figure 5, where the interface 50b can be the interface 2 in the example of Figure 2 above). As shown in Figure 5, the component creation interface can be used to create a business component. Specifically, developers can fill in the component configuration information of the business component to be created through the component creation interface. For example, as shown in Figure 5, the component configuration information here can specifically include the component identifier of the business component to be created (such as the component identifier 23a in the example of Figure 2 above), the project identifier of the project (for example, the component project) corresponding to the component project file that needs to be configured for the business component to be created (that is, the project identifier associated with the business component), the application identifier of other multi-terminal applications (that is, the second application to which the business component to be created belongs) that needs to be bound to the business component to be created (that is, the application identifier associated with the business component), and the component directory address of the component directory file to which the component project file that needs to be configured for the business component to be created belongs (that is, the component directory address associated with the business component, such as the component directory address in the example of Figure 2 above).
[0111] It is understandable that, in one implementable manner, the component directory address can specifically be the address associated with the application project file of the first application, that is, the address where the application project of the first application is located. That is to say, at this time, the application processing file of the first application and the component-related files of the business component created for the second application for a certain component business are all under the same component directory address (for example, the component directory address with a project identifier shown in FIG5 ). For example, the embodiment of the present application can automatically enter the address where the application project file is located at the project address (that is, the component directory address) shown in FIG5 based on the address where the application project file of the currently opened application (for example, the first application) is located, so that the component-related files of the business component to be created can be further stored under the address where the application project file of the currently opened application (for example, the first application) is located (for example, the component project file with a project identifier of "ABC" can be further stored under the component directory address).
[0112] Optionally, the project identifier (e.g., ABC) and the component directory address (e.g., abc / def / ABC) in the component creation interface (e.g., interface 50b shown in FIG5 ) can also be automatically filled in by the computer device. For example, when the computer device outputs the component creation interface (e.g., interface 50b ), the project identifier of the currently opened project (e.g., the application project corresponding to the application project file of the first application) can be automatically obtained, and the address of the application project file of the first application (e.g., the address of the directory file to which the application project file of the first application belongs) can be further obtained based on the project identifier of the application project of the first application, so as to automatically fill in the interface 50b .
[0113] Alternatively, in another possible implementation, the address of the component directory file used to store the component project file (e.g., the component directory address shown in FIG5 ) may also be completely unrelated to the address of the aforementioned application project file. For example, the component directory address here may be the address of the component directory file flexibly set or selected by the developer on the computer device for storing the component project file of the business component. Thus, the computer device involved in the embodiment of the present application can quickly access the component directory file configured for the business component through the component directory address here, and further, based on the project address of the component project of the business component carried in the component directory address for uniquely identifying the business component, quickly access the component project file of the business component.
[0114] As shown in Figure 5, the application identifier in the interface 50b (for example, the target application identifier shown in Figure 2 above) can be flexibly configured by the developer involved in the development of the first application, or it can be automatically obtained and pre-configured for the second application, that is, the application identifier is the application identifier configured for the second application when the second application (that is, other multi-terminal applications) is subsequently generated based on the first application (that is, based on the current multi-terminal application). Optionally, it can also be understood that the application identifier can also be automatically generated when the developer opens the application processing interface of the first application on the multi-terminal application platform. It can be seen from this that the computer device can automatically fill in the application identifier generated when the application processing interface of the first application is opened on the multi-terminal application platform, or it can automatically use the previously pre-configured application identifier to automatically fill in the application identifier of the second application when the developer involved in the development of the first application has pre-configured it.
[0115] It can be understood that the component identifier can be manually filled in by the developer of the first application, or it can be obtained by the developer of the first application from the business component that has been created. For example, a business component A has been created before. At this time, the component directory address of the business component A can include the address of the component directory file created for the business component A. Then, when the component directory file previously created for the business component A can be accessed through the component directory address, the component identifier previously configured for the business component A can be further parsed through the component directory file. Therefore, the existing component identifier can be parsed from the component directory file corresponding to the component directory address of the first application. The developer of the first application can choose the existing component identifier to re-create a new business component, that is, re-create a new component directory file (and overwrite the original component directory file at the same time), or can configure a new component identifier by himself to create a new component directory file.
[0116] S103. In response to a confirmation operation on the component configuration information, the component creation interface is switched back to the application processing interface. In response to a mode switching operation on the application processing interface, the mode in the application processing interface is switched from the application development mode to the component development mode for developing business components. In the component development mode, the component directory file created for the business component is displayed through the component directory address; the component directory file is used to store the component project file configured for the business component, and the component source code in the component project file is a template component source code adapted to the second application and carrying a component identifier.
[0117] It should be understood that, during the execution of step S03, the computer device can create component-related files associated with the business component corresponding to the component identifier for the business component to be created based on the project identifier and component directory address configured in the component creation interface. In this way, when the computer device switches the component creation interface back to the application processing interface, it can further display the component-related files created for the business component by the component directory address on the application processing interface of the first application in a component development mode (e.g., a multi-terminal plug-in mode, i.e., a mode for developing plug-ins for other multi-terminal applications). For example, the component-related files here can specifically include a component directory file created for the business component, and the component directory file refers to a file in the component-related files created for the business component, wherein the component directory file can specifically include a component project file of the business component, and the component source code in the component project file here is a template component source code that is configured for the second application (specifically, it can be a programming language adapted to the operating environment corresponding to the second application) and carries the component identifier. Among them, the component project file can be used to define the instantiation operation of the business component (such as the registration statement and initialization statement of the business component, etc.). In other words, the template component source code in the component project file may specifically include the template component registration source code and the template component initialization source code for the business component. In this way, the developer of the first application can further adaptively configure the template component registration source code and the template component initialization source code based on the template component source code.
[0118] That is, in component development mode, the application processing interface may display directory information of component-related files created for the business component, and a component-related file may be opened through the directory information (for example, the addresses of the directory files created for business components adapted to different formats, i.e., the component directory address). For example, the component directory address may be used to open the component directory file corresponding to the directory information, and then the component project file may be further opened under the component directory file. In other words, in an embodiment of the present application, one or more directory files may be stored under the directory information of the component directory file corresponding to the component directory address.
[0119] For example, in one implementable method, the component directory file may include directory files automatically created for business components for developing business components of different formats. For example, the component directory file may specifically include a directory file (for example, called a first directory file) for developing business components in a second format (such as iOS format), and a directory file (for example, called a second directory file) created for the business component for developing business components in a third format (such as Android format). It can be understood that the first directory file includes a component project file (for example, called component project file 1) for developing the second format (such as iOS format), and the second directory file includes another component project file (for example, called component project file 2) for developing the third format (such as Android format). The component source code (referred to as source code for short) in component project file 1 is a template component source code configured for the second format (such as iOS format). For example, the programming language used by the source code in component project file 1 is programming language 1, that is, native code for the second format (such as iOS format). The component source code (referred to as "source code" for short) in component project file 2 is template component source code configured for the third format (e.g., Android format). For example, the source code in component project file 2 is written in programming language 2, which is native code for the third format (e.g., Android format). In this example, the second application is a second format application (e.g., iOS application). Therefore, the component catalog file and component project file mentioned here are both files in the second format (e.g., iOS format).
[0120] Optionally, in another possible implementation, the embodiment of the present application can also automatically configure different component project files for business components created by the business component for developing different formats. For example, a component directory file (for example, called a first directory file) can be configured for a business component for developing a second format (such as an iOS format), and another component directory file (for example, called a first directory file) can be configured for a business component for developing a third format (such as an Android format). In this case, the addresses of the component project files configured for developing business components of different formats (i.e., component directory addresses) can be the same or different, and this is not limited here.
[0121] Similarly, if the second application being developed can be a first format application (such as a mini-program application), then the component directory file will include a directory file (i.e., component directory file) for developing business components in the first format (such as the mini-program format), and the component directory file may include a component project file for developing the first format (such as the mini-program format). The component source code (referred to as source code for short) in the component project file is a template component source code for the first format (such as the mini-program format). For example, the programming language used in the source code in the component project file may be programming language 3, i.e., native code for the first format (such as the mini-program format).
[0122] In addition, it is understood that when the multi-terminal application platform responds to the confirmation operation for the component configuration information, it can automatically switch the component creation interface back to the application processing interface, and then automatically switch the application development mode to the component development mode in the mode selection area in the application processing interface, and display the component directory file created for the business component in the component development mode. It is understood that the application processing file of the first application can still be viewed at this time. It is understood that the mode switching operation here can be automatically triggered by the multi-terminal application platform, or it can be triggered by the developer's selection in the mode selection area on the multi-terminal application platform.
[0123] Optionally, in component development mode, a component debugging area can be displayed. This area can be used to debug the developed business component. This area can include component loading controls and component calling controls. The specific process of debugging a business component using the component debugging area is described below.
[0124] S104. In response to the configuration operation on the template component source code, a source code calling statement for calling the business component is configured, and the component configuration source code of the business component is generated through the template component source code and the source code calling statement; the source code calling statement is used to establish a communication channel between the second toolkit of the second application and the business component; the second toolkit is provided by the multi-terminal application platform.
[0125] It should be understood that in an embodiment of the present application, before executing step S104, the computer device may further execute the following steps: the computer device may display the template component source code in response to a file open operation for the component project file, so that step S104 can be further executed subsequently.
[0126] As shown in FIG6 , FIG6 is a schematic diagram of a process of displaying the source code of a template component provided by an embodiment of the present application; wherein, the developer of the first application can configure the component configuration information of the business component in the component creation interface (for example, the interface 60a shown in FIG6 , where the interface 60a can be the interface 50b shown in FIG5 ). For example, the component configuration information here can include the project identifier (such as “ABC”), the component directory address (such as “abc / def / ABC”), the application identifier (such as “Wxdd1”), and the component identifier (such as Wxdd11) shown in FIG6 . Then, the developer can click the “Confirm” control in the interface 60a to switch the component creation interface back to the application processing interface (for example, the interface 60b, where the interface 60b can be the interface 50a shown in FIG5 ) by the multi-terminal application platform, and then in the mode selection area of the application processing interface, switch the mode in the application processing interface from the application development mode to the component development mode 61c shown in FIG6 .
[0127] It should be understood that the address of the application project file of the first application and the component directory file of the business component can be the same address. For example, both can be project addresses corresponding to the same development project (for example, the application project file obtained by developing the application project of the first application). Specifically, as shown in Figure 6, in the component development mode 61c, the application processing interface (for example, interface 60b) displays the component directory file 62c (for example, directory file b1 shown in Figure 6) and component directory file 63c (for example, directory file b2 shown in Figure 6) of the business component determined by the component directory address, as well as the application project file of the first application. For example, the application processing files of the first application in the application project file shown in Figure 6 can specifically include file a1, file a2, and file a3. For another example, the component directory files displayed on the application processing interface can specifically include a first directory file 62c (directory file b1) created for the business component of the second format and a second directory file 63c (directory file b2) created for the business component of the third format.
[0128] Among them, when the format of the business component required to be developed for a certain component business is the second format, you can click on the directory file b1 shown in Figure 6 to display the component project file 64c deployed under the directory file b1. Then, as shown in Figure 6, the developer can further click on the component project file 64c on the interface 60b to display the template component source code 65c in the second format adapted to the second application and carrying the component identifier of the business component on the source code display interface of the multi-terminal application platform.
[0129] It is understood that the interface 60b shown in FIG6 may also include a component loading control for simulating the loading of a business component and a component calling control for simulating the debugging of a business component. The component loading control and the component calling control can be used to debug the component configuration source code used to construct the business component during the process of simulating the loading and debugging of the business component through the test component. The component configuration source code is generated by the template component source code 65c shown in FIG6 and the source code calling statements obtained by performing relevant calling configurations on the template component source code 65c.
[0130] It can be understood that the computer device can respond to the configuration operation on the template component source code 65c to obtain the source code call statement associated with the template component source code 65c, and then obtain the component configuration source code of the business component based on the template component source code 65c and the source code call statement.
[0131] The source code calling statement may be used to establish a communication channel between the second toolkit (ie, the application toolkit of the second application) and the business component.
[0132] Among them, the template component source code 65c can specifically include the template component registration source code and the template component initialization source code for the business component. The template component registration source code here can be used to perform component registration. For example, the component registration here can specifically include component object registration, component identifier registration, business execution method registration, and so on. In other words, the template component registration source code in the template component source code can be used to define format statements related to business registration involved in the component registration process. For example, the template component registration source code can specifically include relevant template statements for defining the component identifier of the business component, and relevant template statements for defining the business execution method of the component business provided by the business component. Specifically, the developer of the first application can perform relevant configurations on the template component registration source code, such as configuring the component identifier to be the component identifier of the business component to be created, configuring the method name and parameter name of the business execution method, and so on.
[0133] In addition, the template component initialization source code can be used to initialize the component and will be called after the template component registration source code is executed. That is, the computer device can respond to the registration configuration operation on the template component registration source code and obtain the target component registration source code for registering the business component; the target component registration source code can be used to further call the template component initialization source code after completing the component registration of the business component through the component identifier in the template component source code. Furthermore, the computer device can configure the target component registration source code for calling the template component initialization source code as a source code call statement.
[0134] Among them, component initialization can specifically include component object initialization, jump link initialization (jump link registered for component object, the jump link is provided to the application toolkit by the business component for calling the link of the business component), general link initialization (general link registered for component object, the general link is provided to the application toolkit by the business component for calling the link of the business component), etc. The specific initialization data can be determined according to the specific template component initialization source code, and the template corresponding to the template component initialization source code (for example, the template component initialization template) is pre-configured by the developers of the multi-terminal application platform for the corresponding format (for example, the above-mentioned second format).
[0135] Therefore, in response to the configuration operation on the template component source code, the source code call statement associated with the template component source code can be obtained, and in response to the registration source code configuration operation on the template component registration source code, the target component registration source code for the business component is obtained, and then the source code call statement can be determined based on the target component registration source code.
[0136] In other words, the computer device can further configure the source code based on the template component registration source code for the specific services required by the business component, and use the template component registration source code after the source code configuration as the target component registration source code. Furthermore, the target component registration source code adapted to the business component can be used as a source code call statement. In this case, the component configuration source code can specifically include the template component initialization source code and the target component registration source code.
[0137] Among them, the template component source code generated by the multi-terminal application platform based on the component configuration information of the business component carries the business identifier configured by the developer of the first application, that is, the component identifier registration statement for the business identifier is automatically generated. At this time, the developer of the first application can adaptively configure the registration statement of the business execution method of the business component, such as configuring the method registration statement applicable to the business component for the specified method name and method parameters based on the method registration statement in the template component source code. For example, the method registration statement in the template component source code includes the declaration method statement "WEAPP_EXPORT_PLUGIN_METHOD_SYNC(method)", where "method" is the method name of the declared business execution method. At this time, the developer of the first application can configure the declaration method statement for the business execution method of the business component based on the format of the declaration method statement, such as "WEAPP_EXPORT_PLUGIN_METHOD_SYNC(mySyncFunc)", where "mySyncFunc" is the method name of the business execution method for the business component. For example, a method registration statement in the template component source code includes a method definition statement. This method definition statement includes the parameter names "a" and "b" of the method parameters required for the template business execution method. In this case, the developer of the first application can configure the method parameters required for the business execution method of the business component based on the format of the method definition statement, such as changing the parameter names from "a" and "b" to "name" and "age". There is no limitation on the registration source code configuration operation here, which is determined according to the specific development process of the business component. For example, if the component business is a payment component, the business execution method is used to define the specific payment logic.
[0138] Optionally, you can also adaptively configure the object name of the component object. The configuration principle is the same as that for the service execution method. It will be appreciated that once the service execution method name (or component object object name) is configured, all references to the service execution method name (or component object object name) in all component-related files must be uniformly configured.
[0139] In other words, the multi-terminal application platform can provide template component source code, and the developers of the first application can develop native code of the business components based on the template component source code, thereby improving the development convenience and efficiency of the developers of the first application.
[0140] It can be understood that the template component source code in the component project file is an example source code for establishing a communication channel between the second toolkit and the business component. For example, when the computer device simulates loading the business component (in this case, it can be a test component for simulating the business component) through the application toolkit (i.e., the second toolkit) of the second application, the business component will register the component through the template component registration source code in the template component source code, and after the component is registered, the template component initialization source code in the template component source code is called to initialize the component, and when the component initialization is completed, it indicates that the business component is instantiated and an instantiated component object is obtained (that is, the business component needs to register the object and complete the initialization before it indicates that the object instantiation is completed). At this time, the business component will return the instantiated component object to the second toolkit. After obtaining the instantiated component object, the second toolkit indicates that the communication channel between the second toolkit and the business component is completed. At this time, the second application can use the methods exposed by the instantiated component object (i.e., the instantiated object) so that the business component can execute the business execution method to implement the component business.
[0141] That is to say, the target component registration source code includes the object registration statement, component identification registration statement, and method registration statement configured for the business component (the registration operation in the target component registration source code is not limited here). The target component registration source code can be used to register the component, so that after the component is registered, the template component initialization source code can be further called to initialize the component.
[0142] For example, taking the template component source code in the second format (such as iOS format) as an example, the template component source code generated based on the component configuration information in FIG6 may include a template component registration source code and a template component initialization source code, wherein the template component registration source code may be:
[0143] / / Define the relevant statements of the component object and register the component object on the defined MyPlugin class (that is, create the component object, that is, instantiate the component). The resulting component object is defined as "plugin" (which can be pre-configured). After instantiation, it is returned to the second toolkit;
[0144] __attribute__((constructor)) / / Indicates that the following statements are automatically executed when the business component is loaded;
[0145] static void initPlugin(){ / / Define function as "initPlugin";
[0146] [MyPlugin registerPluginAndInit:[[MyPlugin alloc]init]];
[0147] };
[0148] @implementation MyPlugin / / Declare the class as "MyPlugin"
[0149] / / Define the relevant statements of component identification to realize the registration of component identification. "wxdd11" is the component identification in the component configuration information filled in on the component creation interface. This component identification can be automatically filled in by the multi-terminal application platform when generating the template component source code. "WEAPP_DEFINR_PLUGIN_ID" is used to define the component identification;
[0150] WEAPP_DEFINR_PLUGIN_ID(wxdd11)
[0151] / / Define the relevant statements of the synchronous business execution method 1, implement the registration of the business execution method, that is, the declaration statement of the business execution method "method1"; "WEAPP_EXPORT_PLUGIN_METHOD_SYNC" is used to define the synchronous business execution method;
[0152] WEAPP_EXPORT_PLUGIN_METHOD_SYNC(method1,@selector(method1:))
[0153] / / Define the relevant statements of asynchronous business execution method 1, implement the registration of business execution method, that is, the declaration statement of business execution method "method2"; "WEAPP_EXPORT_PLUGIN_METHOD_ASYNC" is used to define asynchronous business execution method;
[0154] WEAPP_EXPORT_PLUGIN_METHOD_ASYNC
[0155] (method2withCallback,@selector(method1:withCallback)))
[0156] / / Define the second statement related to the synchronous business execution method, that is, the method definition statement of the business execution method "method1"
[0157] -(id)method1:(NSDictionary*)param{ / / used to pass parameters;
[0158] NSLog(@"method1&@",param); / / Pass parameters to method "method1" and print the operation log of method "method1";
[0159] return@"method1"; / / Receive the return of method "method1";
[0160] }
[0161] / / Define the second statement related to the asynchronous business execution method, that is, the method definition statement of the business execution method "method2". "a" and "b" are the parameters that need to be passed to the business execution method "method2";
[0162] -(viod)method2:(NSDictionary*param withCallback:(WeAppNativePluginCallback)callback{ / / Used to pass parameters;
[0163] NSLog(@"method2&@",param); / / Pass parameters to method "method2" and print the operation log of method "method1";
[0164] callback(@{@”a”:@”1”,@”b”:@[@1,@2],@”c”:@3}); / / “callback” is the callback function, which processes the parameters “a” and “b” in the callback function, and the callback result is “c”;
[0165] }
[0166] According to the above, the configuration operations for the template component source code can include the method name configuration in the declaration statement of the business execution method and the method parameter configuration in the method definition statement of the business execution method. For example, the business execution method of the business component includes method 1 and method 2. Method 1 is a synchronous business execution method, and the method name is "mySyncFunc". Method 2 is an asynchronous business execution method, and the method name is "myAsyncFunc".
[0167] Therefore, the configured target component registration source code is:
[0168] / / Define the relevant statements of the component object and register the component object on the defined MyPlugin class (that is, create the component object, that is, instantiate the component). The resulting component object is defined as "plugin" (which can be pre-configured). After instantiation, it is returned to the second toolkit;
[0169] __attribute__((constructor)) / / Indicates that the following statements are automatically executed when the business component is loaded;
[0170] static void initPlugin(){ / / Define function as "initPlugin";
[0171] [MyPlugin registerPluginAndInit:[MyPlugin alloc]init]];
[0172] };
[0173] @implementation MyPlugin / / Declare the class as "MyPlugin";
[0174] / / Define the relevant statements of component identification to realize the registration of component identification. "wxdd11" is the component identification in the component configuration information filled in on the component creation interface. This component identification can be automatically filled in by the multi-terminal application platform when generating the template component source code. "WEAPP_DEFINR_PLUGIN_ID" is used to define (or declare) the component identification;
[0175] WEAPP_DEFINR_PLUGIN_ID(wxdd11)
[0176] / / Define (or declare) the relevant statement of the synchronous business execution method. First, register the business execution method. The method name of the business execution method is updated from "method1" to "mySyncFunc"; "WEAPP_EXPORT_PLUGIN_METHOD_SYNC" is used to define (or declare) the synchronous business execution method.
[0177] WEAPP_EXPORT_PLUGIN_METHOD_SYNC(method1,@selector(mySyncFunc:))
[0178] / / Statement 1 for defining (or declaring) an asynchronous business execution method, implementing the registration of the business execution method. That is, the name of the business execution method is updated from "method2" to "myAsyncFunc"; "WEAPP_EXPORT_PLUGIN_METHOD_ASYNC" is used to define (or declare) a synchronous business execution method.
[0179] WEAPP_EXPORT_PLUGIN_METHOD_ASYNC
[0180] (method2withCallback,@selector(mySyncFunc:withCallback)))
[0181] / / Define (or declare) the second statement related to the synchronous business execution method, that is, the method definition statement of the business execution method "mySyncFunc";
[0182] -(id)myAsyncFunc:(NSDictionary*)param{ / / used to pass parameters;
[0183] NSLog(@"method1&@",param); / / Pass parameters to method "method1" and print the operation log of method "method1";
[0184] return@"method1"; / / Receive the return of method "method1";
[0185] }
[0186] / / Define (or declare) the second statement related to the asynchronous business execution method, that is, the method definition statement of the business execution method "myAsyncFunc". The "name" updated by "a" and the "age" updated by "b" are the parameters that need to be passed to the business execution method "myAsyncFunc";
[0187] -(viod)method2:(NSDictionary*)param withCallback:(WeAppNativePluginCallback)callback{ / / Used to pass parameters;
[0188] NSLog(@"method2&@",param); / / Pass parameters to method "method2" and print the operation log of method "method1";
[0189] callback(@{@”name”:@”1”,@”age”:@[@1,@2],@”c”:@3}); / / “callback” is the callback function, which processes the parameters “name” and “age” in the callback function, and the callback result is “c”;
[0190] }
[0191] Among them, the macro definition for declaring the synchronous business execution method is:
[0192] WEAPP_EXPORT_PLUGIN_METHOD_SYNC(methodName,methodSelector)
[0193] The parameter "methodName" is the name of the service execution method and is required. The second application can call this service execution method through the second component processing method (such as pluginInstance.methodName). The parameter "methodSelector" is the defined registration method (also known as the instantiation method). The input parameter "NSDictionary" of the synchronized service execution method is optional and is the parameter passed in by the second application through the second component processing method. The output parameter of the synchronized service execution method is also optional and is the result obtained by the service component calling the service execution method to execute the component service.
[0194] Among them, the macro definition for declaring asynchronous business execution method is:
[0195] WEAPP_EXPORT_PLUGIN_METHOD_ASYNC(methodName,methodSelector)
[0196] Among them, the parameter "methodName" refers to the method name of the business execution method, which is a required parameter. The second application can call the business execution method through the second component processing method (such as pluginInstance.methodName, "pluginInstance" is the defined component object); the parameter "methodSelector" is the defined registration method (also known as the instantiation method). The input parameter 1 "NSDictionary" of the asynchronous business execution method is a non-required parameter. It is the first parameter passed in by the second application through the second component processing method; the input parameter 2 "WeAppNativePluginCallback" of the asynchronous business execution method is a non-required parameter. It is the second parameter passed in by the second application through the second component processing method. It can be called back to the second application through this input parameter 2. The result obtained by the business component calling the business execution method to execute the component business can be used as the callback of this input parameter 2.
[0197] Among them, the template component initialization source code can be:
[0198] / / Used for component initialization. The target component registration source code is triggered and called after execution.
[0199] / / Define the relevant statements for component object initialization, which are used to initialize the registered component objects;
[0200] -(viod)initPlugin{
[0201] NSLog(@"initPlugin"); / / Output the initialization log of "initPlugin";
[0202] }
[0203] Optionally, when initializing a component object, you can also register and initialize proxy methods for business components, such as to enable or maintain business component execution. There is no restriction on the initialization operations in the template component initialization source code. That is, the template component initialization source code can be:
[0204] -(viod)initPlugin{
[0205] NSLog(@"initPlugin");
[0206] [self registerAppDelegateMethod:@selector(application:openURL:options:)]; / / Register the component object's entry "registerAppDelegateMethod" and initialize the link "openURL" used to enable the business component;
[0207] [self registerAppDelegateMethod:@selector(application:continueUserActivity:restorationHandler:)]; / / Register the component object's entry "registerAppDelegateMethod" and initialize the mechanism "continueUserActivity" used to enable the component to continue executing component business after the business component is enabled;
[0208] }
[0209] / / Defined as the initialization statement for the jump link "url scheme" registered by the component object;
[0210] -(viod)application:(UIApplicaiton*)app openURL:(NSURL*)urloptions:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{ / / Used to process the link "openURL", that is, when the business component is called through the "url scheme", it is called back here to detect the incoming business parameters and callback results;
[0211] NSLog(@"url scheme"); / / Output the initialization log of "url scheme";
[0212] }
[0213] / / Defined as the initialization statement for the universal link "universal link" registered for the component object;
[0214] -(viod)application:(UIApplicaiton*)application continueUserActivaty:(NSDictionary*)userActivityrestorationHandler:(void(^)(NSArray <id <uiuseractivityrestoring>>*__nullable
[0215] restorableObjects))restorationHandler{ / / Used to handle the "continueUserActivity" mechanism, that is, when the business component is called through the "universal link", it is called back here to detect the incoming business parameters and callback results;
[0216] NSLog(@"universal link"); / / Output the initialization log of "universal link";
[0217] }
[0218] Optionally, the developer of the first application also needs to define the execution logic of the component business corresponding to the business component, that is, the specific execution process of the business execution method for the component business. Therefore, determining the component configuration source code can be, in response to the execution method configuration operation for the component business, obtaining the business execution method configured for the component business; based on the template component initialization source code, source code call statement and business execution method, obtaining the component configuration source code of the business component. It can be understood that when the component source code in the component project file 1 is the template component source code for the second format (such as iOS format), the programming language used for the business execution method configured under the first directory file is programming language 1, that is, the native code for the second format (such as iOS format). The component source code in the component project file 2 is the template component source code for the third format (such as Android format), and the programming language used for the business execution method configured under the second directory file is programming language 2, that is, the native code for the third format (such as Android format). Similarly, if the component project file is a template component source code for the first format (such as the mini-program format), the programming language used in the business execution method configured under the corresponding component directory file is programming language 3, that is, the native code for the first format (such as the mini-program format).
[0219] It is understood that the template component initialization source code and source code call statements can be in the same component project file as the service execution method, or in different component project files. It is understood that when the communication channel between the second toolkit and the service component is established through the template component initialization source code and source code call statements, the second toolkit can notify the service component through the communication channel and call the service execution method to execute the component service.
[0220] S105: Compile the component configuration source code to obtain the business component, and publish the business component to display on the multi-terminal application platform.
[0221] Among them, in the application processing interface, a component building control is displayed in the component development mode. The component building control includes component building controls of different formats. For example, a component building control for the second format (such as iOS format) (such as a "Build Format 1 Component" control), a component building control for the third format (such as Android format) (such as a "Build Format 2 Component" control). Similarly, it may also include a component building control for the first format (such as mini program format) (such as a "Build Format 3 Component" control). It can be understood that when a component building control of a certain format is triggered, the business component of the corresponding format is constructed based on the component configuration source code under the component directory file corresponding to the format. For example, when the component building control for the iOS format is triggered, the component configuration source code for the iOS native code is obtained from the directory file corresponding to the iOS format, and the business component in the iOS format is constructed based on the component configuration source code for the iOS native code. The business component in the iOS format is used to be installed in the second application in the iOS format.
[0222] It can be understood that after obtaining the component configuration source code, the computer device can also debug the component configuration source code used to construct the test component before executing step S105, and then after the debugging of the test component (that is, the test component refers to the component used to simulate the business component generated by the component configuration source code during the test process) is completed, it can respond to the trigger operation for the component construction control and construct the business component based on the template component initialization source code, source code call statement and business execution method.
[0223] Among them, the application processing interface displays the debugging statement construction control associated with the component development mode (that is, the debugging statement construction control in the component development mode), and the component debugging area in the component development mode; the component debugging area can include the component loading control and the component calling control.
[0224] Therefore, the computer device can generate component debugging source code for component debugging of the component configuration source code on the multi-terminal application platform in response to a trigger operation for building a control for a debug statement. Furthermore, the computer device can construct a test component through the component configuration source code in response to a trigger operation for loading a control for a component. Then, in the component debugging program corresponding to the component debugging area, the test component can be notified based on the component debugging source code to instantiate the component through the component configuration source code, so that when the component instantiation is completed, a test communication channel can be obtained between the component debugging program and the test component; the test communication channel is used to debug the test component. The component debugging program is determined by a second toolkit provided by the multi-terminal application platform for the component debugging source code.
[0225] Among them, the component debugging source code can be used to call the component configuration source code to realize the component instantiation of the business component. It can be understood that the component instantiation of the business component (i.e., the process of creating a component object) includes component registration (including a step in the process of creating a component object, namely, creating a component instance) and component initialization (including a step in the process of creating a component object, namely, initializing the component object, namely, initializing the component instance). That is, the entire component instantiation process can be carried out through the template component initialization source code and source code call statements in the component configuration source code.
[0226] It can be understood that when it is determined that the component configuration source code needs to be debugged, the test component is first built, and then the component debugging source code is executed through the component debugging program corresponding to the component debugging area to notify the test component to instantiate the component. It can be understood that when the test component instantiates the component, it returns the component object of the test component (that is, the component instantiation object, that is, the information returned by the component object defined in the above-mentioned target component registration source code after instantiation, and the returned information can be configured as a fixed parameter, such as "plugin"). When the component debugging program receives the component instantiation object, it indicates that the test communication channel between the component debugging program and the test component has been established, and the test communication channel can be used for data interaction between the component debugging program and the test component.
[0227] Among them, notifying the test component to instantiate the component through the component configuration source code based on the component debugging source code can be: in the component debugging program, loading the test component based on the component debugging source code, and notifying the test component to call the source code call statement to register the component, and after the component is registered, calling the template component initialization source code to initialize the component, where the component initialization is the above-mentioned component instantiation. That is, the component debugging program will load the test component, and when loading the test component, it will trigger the execution of the source code call statement to realize component registration, and then trigger the execution of the template component initialization source code to realize component initialization. When the test communication channel is established, it means that the debugging of the source code call statement and the template component initialization source code is completed. That is to say, the test component is loaded successfully at this time.
[0228] It can be understood that the component configuration source code includes a business execution method for the component business, and the component debugger can call the business execution method by testing the component to determine whether the business execution method is configured correctly.
[0229] Among them, the component debugging area includes a component calling control. A computer device deployed with a multi-terminal application platform can respond to a trigger operation for a component calling control, (call a component debugging program) and obtain the test business parameters for calling the business execution method from the component debugging source code; in the component debugging program, the test communication relationship indicated by the established test communication channel is used to pass the test business parameters into the test component, so that the test component executes the component business based on the test business parameters and obtains the test execution result corresponding to the component business; and then, when the test execution result indicates that the test is successful, it can be determined that the component debugging of the test component is completed, that is, the embodiment of the present application can determine that the test component debugging is completed when it is determined that the test execution result is correct. In other words, it indicates that the business execution method is correct, and then the business component can be constructed based on the component configuration source code.
[0230] The component debugging source code (i.e., component debugging method) can be:
[0231] loadNativePlugin({ / / Component loading method;
[0232] pluginID:'wxdd11', / / Component ID of the test component to be loaded. The component debugger loads the corresponding test component based on the component ID.
[0233] success:(plugin)=>{ / / Execute the following source code when the test component is loaded successfully;
[0234] console.log('load plugin success') / / Output "Component loaded successfully";
[0235] const ret = plugin.mySyncFunc({a:'hello', b:[1,2]}) / / Component usage method, here defines the input parameters (method parameters, that is, test business parameters) that the component debugger needs to obtain for calling the business component method, which needs to be configured by the developer of the first application according to the specific business component. The business component method mySyncFunc is the business component method exposed by the component instantiation object plugin. If the component debugger wants to use this business component method, it is implemented by calling the business component method through the test component, that is, the test business parameters (parameter a (specifically hello) and parameter b (specifically [1,2])) used to call the business component method mySyncFunc are passed to the test component through the test communication channel. The test component executes the business component method mySyncFunc based on the method parameters to obtain the business execution result;
[0236] console.log(mySyncFunc ret:',ret) / / Output the business execution results returned by the test component;
[0237] },
[0238] fail:(e)=>{ / / Execute the following source code when the test component fails to load;
[0239] console.log('load plugin fail',e) / / Output "component loading failed";
[0240] }
[0241] })
[0242] That is to say, in the embodiment of the present application, when generating template debugging source code, the developer of the first application can further obtain component debugging source code based on the template debugging source code configuration. The component debugging source code can define the component identifier of the test component to be loaded, so that the component debugging program loads the test component, and the component debugging source code can define the method for obtaining the test business parameters that need to be passed into the test component (configured by the developer of the first application), and when the test business parameters are obtained, the component debugging program can pass the test business parameters into the test component to call the business execution method and execute the component business.
[0243] For example, as shown in Figures 7 to 9, Figures 7 to 9 are schematic diagrams of a construction process of a business component provided by an embodiment of the present application; wherein, when the component configuration source code is configured, the application processing interface displayed in the component development mode (for example, interface 70a shown in Figure 7, such as interface 60b in the example of Figure 6 above) is switched. At this time, the application processing interface displays a component debugging area 71c and a control for constructing the business component (for example, a construction control 72c). For a detailed description of other elements on the application processing interface, please refer to the relevant description in Figure 6 above; further, the developer can trigger the construction control 72c to display a debug statement construction control 73c for constructing a format 1 debug statement and a component construction control 74c for constructing a format 1 component in the form of a drop-down list on the interface 70a. It can be understood that the embodiments of the present application can have debug statement construction controls and component construction controls indicating different formats for components of different formats. For example, in the second format (such as iOS format), the debug statement construction control can be a control for "constructing format 1 debug statements" and the component construction control can be a control for "constructing format 1 components"; for example, in the third format (such as Android format), the debug statement construction control can be a control for "constructing format 2 debug statements" and the component construction control can be a control for "constructing format 2 components"; for example, in the first format (such as mini program format), the debug statement construction control can be a control for "constructing format 3 debug statements" and the component construction control can be a control for "constructing format 3 components" (Figure 7 here only shows the construction controls under the second format).
[0244] Therefore, as shown in Figure 7, by touching the control for "building format 1 debug statements" on the computer device, the developer can make the computer device respond to the trigger operation of building the control 73c (for example, the control for "building format 1 debug statements") for the debug statement and generate the template debug source code 75c shown in Figure 7. Then, the computer device can respond to the configuration of the template debug source code 75c by the developer of the first application to obtain the component debug source code 76c shown in Figure 7.
[0245] At this time, as shown in FIG8 , after the multi-terminal application platform switches back to the application processing interface 70a, the developer of the first application can touch the component loading control 77c on the component debugging area. In this way, the computer device deployed with the multi-terminal application platform can construct (S81) a test component 79c based on the component configuration source code 78c shown in FIG8 , and cause the component debugging program 710c corresponding to the component debugging area to load (S82) the test component based on the component debugging source code, so as to notify the test component to instantiate the component through the component configuration source code (S83). Thus, after the component instantiation is completed, a test communication channel can be obtained between the component debugging program and the test component. The test communication channel here can be configured to represent the communication channel established between the second toolkit of the second application and the business component after the component debugging of the test component is completed.
[0246] As shown in Figure 8, after the test component is loaded, the computer device can further have the developer of the first application touch the component call control 711c on the component debugging area, so that the component debugging program 710c corresponding to the component debugging area can obtain the test business parameters used to call the business execution method from the component debugging source code, and pass the test business parameters to the test component 79c through the test communication relationship indicated by the established test communication channel. In this way, the test component 79c can call the business execution method based on the test business parameters, execute the component business, and obtain the test execution result corresponding to the component business.
[0247] It is understood that, as shown in FIG9 , the computer device can determine that the component debugging of the test component is complete when it determines that the test execution result is correct. In other words, the developer of the first application can determine that the test component debugging is complete when the test execution result indicates that the test is successful. At this time, the developer of the first application can further touch the control for "Build Format 1 Component" (e.g., component construction control 74c) in the application processing interface (e.g., interface 70a) shown in FIG9 , so that the computer device deployed with the multi-terminal application platform can obtain the component configuration source code 78c in format 1 (e.g., iOS format) from the component directory file 712c (e.g., directory file b1) corresponding to format 1 (e.g., iOS format) to construct the business component 713c in format 1 (e.g., iOS format). It is understood that, similarly, when constructing the test component, the embodiment of the present application also obtains the component configuration source code in format 1 (e.g., iOS format) from the component directory file corresponding to format 1 (e.g., iOS format) to construct the test component in format 1 (e.g., iOS format).
[0248] For another example, as shown in FIG10 , FIG10 is a schematic diagram of a publishing process of a business component provided by an embodiment of the present application; wherein, the application processing interface (for example, interface 100a shown in FIG10 , such as interface 70a in the examples of FIG7 to FIG9 above) may also display a component upload control. After the business component is constructed through the component creation process shown in FIG7 to FIG9 above, the developer of the first application may touch the control for uploading the business component (for example, component upload control 101c) to display a component upload interface (interface 100b) for the business component. The version number of the business component (such as "1.0.0") and component notes (such as "Uploaded by Developer A on May 1, 2050") may be filled in on the component upload interface. And display the component format of the business component (such as "Format 1"). By touching the component upload control 102c, the business component can be uploaded to the multi-terminal application platform. At this time, the uploaded business components can be viewed on the multi-terminal application platform, such as the component identifier of the business component (such as "Wxdd11"), the application identifier of the second application to which it belongs (such as "Wxdd1"), the creation time (such as "2050-5-1"), etc. At this time, by touching the "Details" control, the detailed component information of the business component (such as viewing the developer, viewing the component notes, etc.) can be viewed. The developer of the first application can touch the "Publish" control 103c to publish the business component on the multi-terminal application platform, that is, set the business component to the online version.
[0249] S106, constructing a second application on a multi-terminal application platform based on the application project file, the second toolkit and the business component; the second application is configured to notify the second toolkit to call the business component based on the communication channel during runtime to execute the component business provided by the business component, and the component business is configured for the business in the first application.
[0250] Among them, it can be understood that after the computer device obtains the business component through the multi-terminal application platform, it can further generate a second application through the business component, the application processing file of the first application, and the second toolkit. In this way, after the second application is deployed and installed on the computer device, the second application can be run on the computer device. At this time, when the second application can run, it executes the component business of the business component through the communication relationship indicated by the established communication channel. In other words, at this time, even if the second toolkit itself does not provide component business, the component business can be used normally in the second application. Among them, the specific process of generating the second application can be found in the relevant description of the following embodiment.
[0251] Therefore, the technical solution of the present application is to provide developers with template component source code in different formats, allowing developers to develop component configuration source code for a certain business based on the template component source code, and generate corresponding business components in a resource-based form for uploading to a multi-terminal application platform. Then, the component processing method for the business component can be defined in the application processing file of the first application in a configuration form (that is, the ability to develop component configuration source code for customized business is provided to developers in a resource-based and plug-in-based form, and is connected to the second application in a configuration form). In this way, in the corresponding generated second application, the application toolkit in the second application can establish a communication channel with the business component, thereby realizing communication between the application toolkit and the business component in the second application, that is, the business component exposes the functional services it can provide to the second application, which can be called by the second application at any time, that is, the second application can quickly access native capabilities or open capabilities that the second toolkit itself does not have with one click, without waiting for the official release of a general application toolkit with the capabilities required by the second application, so that the second application has all the services of the corresponding first application in disguise, that is, all the services of the first application are successfully shared with the second application through the application toolkit and business components in the second application, ensuring the successful execution rate of the services in the second application. The technical solution of this application not only helps developers use customized native capabilities or open capabilities in the second application, but also helps developers configure these components into source code resources and components. Developers can specify the business components that need to be compiled into the second application, and can remove a business component from the second application as needed (i.e., by enabling or not enabling a business component), thereby achieving the hot plug and play and version management capabilities of business components. It is understandable that the same business component can have multiple versions, which can be developed and managed separately by different developers of the first application, so that multiple versions of the same business component can coexist through multi-person collaboration.
[0252] In an embodiment of the present application, a computer device can display an application processing interface of an application project file corresponding to a first application on a multi-terminal application platform, and then, when the mode in the application processing interface is an application development mode corresponding to a multi-terminal application (for example, a multi-terminal development mode), a component creation control pre-configured for the application development mode (for example, a multi-terminal development mode) can be displayed on the application processing interface. Furthermore, the computer device may display a component creation interface in response to a trigger operation for a component creation control, and then may use the component configuration information configured for the business component on the component creation interface, where the component configuration information may include at least a component identifier of the business component, a component directory address, and a target application identifier bound to the component identifier; wherein the second application corresponding to the target application identifier may be an application different from the first application in the multi-terminal application; further, the computer device may switch the display interface of the multi-terminal application platform from the component creation interface back to the application processing interface in response to a confirmation operation for the component configuration information (this means that at this time, the computer device may close the component creation interface and then jump to display the application processing interface); then, when the mode in the application processing interface is switched to a component development mode for developing a business component, the computer device may further display the component directory file created for the business component in the component development mode through the component directory address, so that the developer can, when the component directory file includes a component project file, and the component project file includes a template component source code adapted for the second application and carrying the component identifier; open the component project file by double-clicking the component project file to display the template component source code stored in the component project file. Then, the computer device can respond to the configuration operation on the template component source code, obtain the source code call statement associated with the template component source code, configure the source code call statement for calling the business component, generate the component configuration source code of the business component through the template component source code and the source code call statement, and then construct the business component that can implement the specified business through the component configuration source code. It can be seen from this that in the embodiment of the present application, when the multi-terminal application platform is deployed in the computer device, the business component for a certain business (component business) can be quickly configured through the visual interface provided by the multi-terminal application platform, wherein the source code call statement in the component configuration source code for constructing the business component can be used to establish a communication channel between the second toolkit and the business component. In this way, when the second application is constructed by applying the project file, the second toolkit and the business component, the second application can be further deployed and installed in the computer device, so that when the computer device runs the second application, the second toolkit can call the business component through the pre-established communication channel to execute the component business.That is to say, when the embodiment of the present application generates a corresponding business component for a certain business (business A), a communication channel can be established between the application toolkit (i.e., the second toolkit) and the business component in the second application, so that the second application can normally use the business A provided by the business component without being restricted by the business provided by the second toolkit itself, that is, the business expansion of the application toolkit is realized. Therefore, when the second application is developed, it can be more convenient to enable the generated second application to implement some customized businesses, thereby improving the flexibility of application development. There is no need to develop an application toolkit from scratch that can provide all the required businesses for the second application, thereby improving application development efficiency. That is, when generating the second application corresponding to the first application, the business component of the specified business can be developed to ensure the execution success rate of the business on a specific application (for example, the second application) in the multi-terminal application. In other words, the embodiment of the present application can achieve the successful sharing of the business in the first application to the second application through the developed business components.
[0253] Further, please refer to Figure 11, which is a flow chart of a data processing method based on a multi-terminal application platform provided in an embodiment of the present application. As shown in Figure 11, the method can be executed by the computer device mentioned above, and the computer device can be a business terminal configured with a multi-terminal application platform. For example, the business terminal can be the business terminal 200a shown in Figure 1 above. It should be understood that in an embodiment of the present application, after the developer generates the component configuration source code of the business component through the multi-terminal application platform (the component configuration source code includes the business execution method configured for the component business), the developer can further compile the component configuration source code to obtain the business component, and then publish the compiled business component on the multi-terminal application platform. In this way, the developer, on a computer device deployed with a multi-terminal application platform, uses the application project file of the first application (the application project file includes the application processing file of the first application), the second toolkit provided by the multi-terminal application platform for the second application, and the business component to construct a specific method for obtaining the second application, which can include the following steps S201-S206:
[0254] S201 . In a mode selection area of an application processing interface, the mode in the mode selection area is switched from a component development mode to an application development mode, and application processing files are displayed in the application development mode.
[0255] The developer of the first application can switch from component development mode to application development mode to develop the second application. In other words, the developer of the first application can make relevant configurations for the second application, such as adding a business component and configuring the relevant statements for communicating with the business component.
[0256] The application project file includes an application processing file of the first application. In the application development mode, the application can display the application processing file through the application processing interface, and then perform targeted resource configuration on the application processing file in the application development mode.
[0257] S202. Configure the first component processing method corresponding to the source code call statement and the second component processing method corresponding to the business execution method in the application processing file to obtain the target application processing file; the first component processing method is used to instruct the second toolkit to notify the business component to execute the source code call statement; the second component processing method is used to instruct the second toolkit to notify the business component to execute the business execution method; the target application processing file is used to generate the second application.
[0258] Among them, it can be understood that if in the first application, a certain application service is provided by the application toolkit of the first application (in this case, it is called a toolkit service), then when it is necessary to trigger the application service (for example, the toolkit service) provided by the application toolkit, the first application can directly call the application toolkit to execute the toolkit service through the application toolkit of the first application. At this time, if a certain application service needs to be provided by a business component (in this case, it is called a component service), then after obtaining the second application corresponding to the first application, when the component service is triggered, the second application can pass the component identifier of the business component to the second toolkit, so that the second toolkit loads the business component, and then executes the component service by calling the business component. That is to say, at this time, it is necessary to define relevant statements in the application processing file of the first application so that when the component service is triggered, it can communicate with the business component through the second toolkit (it can be understood that at this time the second toolkit needs to have the function of loading the business component and communicating with the business component).
[0259] Among them, the first component processing method can be used to instruct the second toolkit to notify the business component to execute the source code call statement (that is, it can be used to load and instantiate the business component); the second component processing method can be used to instruct the second toolkit to notify the business component to execute the business execution method (that is, it can be used to use the business component); in other words, in an embodiment of the present application, the target application processing file can be further used to generate a second application.
[0260] It can be understood that the first component processing method and the second component processing method are used for data communication between the second application and the business component. That is, the establishment of a communication channel between the second toolkit and the business component can be triggered by the first component processing method, and the method parameters for passing into the business component to call the business execution method can be obtained by the second component processing method. It can be understood that the first component processing method is similar to the component loading method in the above-mentioned component debugging source code, and is used to notify the application toolkit to load the business component. It can be understood that when the business component is loaded, the source code call statement and the template component initialization source code will be triggered to execute. The second component processing method is similar to the component usage method in the above-mentioned component debugging source code, and is used to obtain the method parameters for calling the business execution method of the business component. It can be understood that the business execution method in the business component will be triggered to execute.
[0261] Among them, the first component processing method (loadNativePlugin) can be as follows:
[0262] loadNativePlugin({
[0263] pluginID:'wxdd11', / / Component ID of the service component to be loaded. The second application passes the component ID to the second toolkit, and the second toolkit can load the corresponding service component based on the component ID;
[0264] success:(plugin)=>{ / / Execute the following source code when the business component is loaded successfully;
[0265] console.log('load plugin success', plugin) / / output "component loaded successfully";
[0266] this.setData({
[0267] myPlugin:plugin / / Define the component instantiation object plugin as myPlugin for storage;
[0268] })
[0269] },
[0270] fail:(e)=>{ / / Execute the following source code when the business component fails to load;
[0271] console.log('load Plugin fail',e) / / Output "component loading failed";
[0272] }
[0273] })
[0274] It is understood that the first component processing method can define the component identifier of the business component to be called, so that the second toolkit loads the corresponding business component upon obtaining the component identifier. Furthermore, the first component processing method can define that upon receiving the component instantiation object returned by the business component, the component instantiation object is stored, and the business component can be called at any time to execute the component service through the service execution method exposed by the component instantiation object.
[0275] The second component processing method may be as follows:
[0276] const ret = myPlugin.mySyncFunc({a:'hello', b:[1,2]}) / / This defines the input parameters (method parameters, that is, business parameters) that the second application needs to obtain for calling the business component method, which needs to be configured by the developer of the first application according to the specific business component. The business component method mySyncFunc is the business component method exposed by the stored component instantiation object myPlugin. If the second application wants to use this business component method, it is achieved by having the business component call this business component method. That is, the business parameters (parameter a (specifically hello) and parameter b (specifically [1,2])) used to call the business component method mySyncFunc are transmitted to the business component via the second toolkit through the communication channel. The business component executes the business component method mySyncFunc based on the method parameters to obtain the business execution result;
[0277] console.log(mySyncFunc ret:',ret) / / Output the business execution results returned by the business component;
[0278] It is understood that the second component processing method can define the method parameters of the business execution method to be called, that is, the method for obtaining the input parameters of the business execution method (specifically determined by different component businesses), that is, what business parameters should be passed to the business component when the component business is triggered. It is understood that the business execution method in the second component processing method is the method exposed by the second application, and the method name of the exposed method is consistent with the method name of the business execution method in the component configuration source code of the business component.
[0279] It is understood that the target application processing file can be used to generate a second application. In this case, the generated second application needs to run based on the target application processing file, and when running, if a component service is triggered, the service component can be called through the first component processing method and the second component processing method to implement the component service.
[0280] S203: In the application processing interface, an application configuration area for configuring the second application is displayed; the application configuration area includes a component adding control in the application development mode.
[0281] It can be understood that the target application processing file defines how to use the business component, and at this time it is also necessary to configure the business component to be added to the second application.
[0282] Among them, the application processing file displayed on the application processing interface may specifically include an application configuration file (project.miniapp.json). In this way, a computer device deployed with a multi-terminal application platform can respond to a file open operation for the application configuration file, display the application configuration area corresponding to the application configuration file, and then add and configure business components in the application configuration area.
[0283] Among them, in the application configuration area, a component adding control in the application development mode is displayed. It can be understood that the component adding control can include adding controls for adding business components of different formats, such as adding controls for adding business components in the second format (such as iOS format), adding controls for adding business components in the third format (such as Android format), and so on. Here, taking the second application to be generated in the second format (such as iOS format) as an example, the business components of the corresponding format are added through the adding controls for the business components in the second format (such as iOS format).
[0284] S204: In response to a triggering operation on the component adding control, a component adding interface corresponding to the component adding control is displayed, and a component identifier of the business component is added in the component adding interface.
[0285] The developer may configure the component identifier of the business component to be added in the component adding interface. Optionally, the developer may also configure the version number of the business component to be added in the component adding interface.
[0286] Optionally, the component addition interface may also include an enable switch for the business component. This switch allows you to determine whether to enable the business component. If the enable switch is on, it indicates that the business component can currently be configured in the second application. If the enable switch is off, it indicates that the business component cannot currently be configured in the second application, and only the configuration record of the business component is retained. This allows for hot swapping of business components.
[0287] Optionally, in the Application Configuration area, you can also view the configuration history of business components, that is, the configured enabled business components or the configured disabled business components. At this time, you can touch any business component to enter the component addition interface for that business component, and then determine whether to enable the business component on the component addition interface.
[0288] S205. Displaying an application construction control in the application development mode in the application processing interface;
[0289] S206, in response to the triggering operation for the application building control, obtain the business component from the multi-terminal application platform through the component identifier added in the component adding interface, and generate the second application based on the target application processing file, the second toolkit and the business component.
[0290] Among them, the application processing interface displays the application construction control in the application development mode, and the application construction control may include construction controls for different formats, such as construction controls for the second format (such as iOS format) (such as "Build Format 1 Application" control), and construction controls for the third format (such as Android format) (such as "Build Format 2 Application" control).
[0291] Therefore, when a trigger operation for an application building control is detected, the business component corresponding to the component identifier configured in the component addition interface can be obtained from the multi-terminal application platform (or the business component corresponding to the configured component identifier and version number; optionally, when an enable switch is included in the component addition interface, the obtained business component must be an enabled business component). At this time, the business component for installation in the second toolkit can be obtained, and then the second application can be generated based on the target application processing file, the second toolkit and the business component obtained from the multi-terminal application platform.
[0292] It is understood that when the developer of the first application triggers the "Build Format 1 App" control, the second toolkit can be an officially released toolkit in the second format (such as the iOS format) or a toolkit specified and provided by the developer of the first application through the multi-terminal application platform. When the developer of the first application triggers the "Build Format 2 App" control, the second toolkit can be an officially released toolkit in the third format (such as the Android format) or a toolkit specified and provided by the developer of the first application through the multi-terminal application platform.
[0293] It can be understood that under the Build control of different formats, the business components to be added are obtained according to the configuration of the Add control for each format. For example, if the developer of the first application triggers the "Build Format 1 Application" control, the configured business components to be added in the second format (such as iOS format) are obtained. For another example, if the developer of the first application triggers the "Build Format 2 Application" control, the configured business components to be added in the third format (such as Android format) are obtained.
[0294] It is understood that the second application obtained at this time can achieve data communication with the service component through the component processing method (first component processing method and second component processing method) in the target application processing file and the application toolkit in the second application, so that the second application can normally use the component service. The specific process of using the component service in the second application can be found in the relevant description of the following embodiment.
[0295] The component configuration information includes the application identifier associated with the business component. Therefore, obtaining the business component corresponding to the component identifier configured in the component addition interface from the multi-terminal application platform can be, if the application identifier associated with the business component is consistent with the application identifier of the second application, then obtaining the business component corresponding to the component identifier configured in the component addition interface from the multi-terminal application platform. This means that the business component is determined to belong to the second application to be generated.
[0296] In other words, in one feasible method, the specific implementation method of a computer device obtaining a business component can be described as: obtaining a target application identifier through the component identifier added in the component adding interface; further, if the target application identifier associated with the business component is the application identifier of the second application, then obtaining the business component corresponding to the target application identifier bound to the component identifier from the multi-terminal application platform.
[0297] That is to say, after the developer of the first application has configured the business component to be added, the multi-terminal application platform needs to verify the business component to determine whether the business component belongs to the developer of the first application, that is, whether the application identifier associated with the business component is the application identifier of the second application to be generated. In other words, the embodiment of the present application can determine whether the business component belongs to the second application to be generated by the target application identifier bound to the component identifier of the business component. After the business component is successfully verified, the business component corresponding to the component identifier configured in the component addition interface can be obtained from the published business components. The application identifier of the second application is pre-generated by the multi-terminal application platform or pre-configured by the developer of the first application.
[0298] For example, as shown in Figures 12 to 14, Figures 12 to 14 are schematic diagrams of a process for generating a second application provided by an embodiment of the present application; wherein, as shown in Figure 12, after obtaining the target application processing file, the computer device can switch the display interface of the multi-terminal application platform to an application processing interface (for example, interface 120a shown in Figure 12, such as interface 100a in the example of Figure 10 above), and the application processing interface displays directory information 121c of the application project file of the first application. For example, as shown in Figure 12, the directory information can specifically include the project identifier of the first application recorded (for example, ABC shown in Figure 12), the application processing file of the first application in the recorded application project file (wherein, the application processing file may include file a1, file a2, and file a3 shown in Figure 12), and the directory file b1 and directory file b2 created for the business component (for a detailed description of directory file b1 and directory file b2, please refer to the relevant description of Figure 6 above). For example, here we take the application configuration file a1 shown in Figure 12 as an example. At this time, the developer of the first application can click on the file a1 to display the application configuration area 122c shown in Figure 12 on the application processing interface (at this time, the mode selection area on the application processing interface is in application development mode). It should be understood that the developer can further click on the component configuration control 123c for component configuration to enter the component configuration area, where the component configuration area is the area in the application configuration area 122c. Among them, multiple component addition controls are displayed on the component configuration area. The multiple component addition controls here can specifically include the component addition control 124c for "adding format 1 business component" and the component addition control 125c for "adding format 2 business component" shown in Figure 12. In addition, the component configuration area can also include a configuration record control 126c for viewing configuration records.As shown in FIG12 , the developer can view the configuration record of the business component in the interface 120a by touching the configuration record control 125c. The configuration record can specifically include the configuration records for business components of different formats (such as the configuration record for the format 1 business component and the configuration record for the format 2 business component). At the same time, as shown in FIG12 , the enabled format 1 business components (such as components z1-z3) or the disabled format 1 business components (such as component z4) can be viewed in the configuration record for the format 1 business component. At this time, the developer You can click on a business component (such as component z4) to enter the component adding interface for the component z4 (for example, interface 120b shown in Figure 12), wherein the component adding interface displays the version number of component z4 (such as "1.0.0") and component identifier (such as "Wxdd11"), and a selection box for determining whether to enable the business component in the interface 120b. If the developer needs to enable the business component, the selection box can be triggered to trigger the enable switch for the business component by checking the selection box. At this time, the enable switch is in the on state.
[0299] It can be understood that, as shown in Figure 13, the computer device can also directly display the component addition interface (interface 120b) corresponding to the component addition control in response to the triggering operation of the component addition control 124c on the component configuration area in the application processing interface (interface 120a). In this way, the developer of the first application can configure the component identifier and version number of the business component to be added on the component addition interface, and can also determine whether to enable the business component by checking the selection box. For example, the enable switch for the format 1 business component can be triggered by checking the selection box to determine whether to enable the format 1 business component. Optionally, the developer can also trigger the turn-off of the enable switch for the format 1 business component by unchecking the selection box to determine not to enable the business component. Then, the developer can quickly view the configured business component to be added in the configuration record of the component configuration area after performing the confirmation operation on the "Confirm" control on the component addition interface.
[0300] Therefore, as shown in FIG14 , when the display interface of the multi-terminal application platform switches to the application processing interface (interface 120a), the computer device can configure the mode in the mode selection area of the application processing interface to the application development mode. As shown in FIG14 , in this application development mode, the construction control on the application processing interface can be an application construction control for building a second application. Developers can view application construction controls for different formats by touching the application construction control. For example, the application construction control here can include an application construction control 127c for the second format (e.g., iOS format) (e.g., a control for "building format 1 application") and an application construction control 128c for the second format (e.g., Android format) (e.g., a control for "building format 2 application"). At this time, the developer can touch the "Build Format 1 Application" control (i.e., application building control 127c) to determine the business component 129c of the second format (format 1) to be enabled from the configuration record, and after successfully verifying the business component of the second format (format 1) to be enabled, obtain the corresponding business component of the second format (format 1) from the business components published on the multi-terminal application platform, and generate a second application 1212c of the second format (format 1) based on the target application processing file 1210c, the obtained business component 129c of the second format (format 1), and the second toolkit 1211c (i.e., the application toolkit of format 1). In other words, in the process of generating the second application, the embodiment of the present application can specifically generate an application file (such as an IPA file, a file format of an iOS application package. The IPA file can specifically contain all the code, resources, metadata, and signature of the application. It is a standard format for installing and deploying applications on a second format device (a device with an iOS runtime environment)) corresponding to the second application of the second format (format 1), and compile the obtained business component of the second format (format 1) into the application file. The second format device here can be the computer device deployed with the multi-terminal application platform mentioned above. Optionally, the second format device here can also be other computer devices. The specific computer device for installing and running the second application will not be limited here.
[0301] For another example, as shown in FIG15, FIG15 is a schematic diagram of a generation scenario of a second application provided by an embodiment of the present application; wherein, developer A can open the application processing interface corresponding to the application project file of the first application on the multi-terminal application platform, and develop and obtain the component configuration source code on the application processing interface, and construct (S51) to obtain the business component based on the component configuration source code. Further, developer A can publish (S52) the business component and display it on the multi-terminal application platform; at this time, developer A can configure the target application processing file 152a on the application processing interface, and configure the business component 1 to be added. 51a, as shown in Figure 15, when the computer device builds the second application, it can first verify the business components to be added, and after the verification is successful, obtain (S53) the corresponding business components to be added and the application toolkit from the business components released by the multi-terminal application platform, and then compile and generate (S54) the second application 154a based on the obtained business components 151a, the target application processing file 152a and the application toolkit 153a for installation in the second application (which can also be obtained from the multi-terminal application platform, such as the application toolkit officially released on the multi-terminal application platform).
[0302] It is understood that when the first application is a mini-program, all of the mini-program's services are provided by the mini-program toolkit, and all of the services of the corresponding second application (e.g., an iOS application) are provided by the iOS toolkit. Furthermore, if the services integrated in the application toolkit cannot be hot-swapped, adding new services to the application toolkit will inevitably increase the size of the application toolkit, and thus the package size of the corresponding second application. If the application toolkit in the second application is a general-purpose application toolkit, the new services it provides may not be required by the current second application. Therefore, the services that need to be added can be resourced as components. This way, when generating the second application, developers can choose not to configure the service components corresponding to the new services into the second application. This way, the generated second application's package size is not occupied by unnecessary services, thereby optimizing the package size of the second application. Furthermore, developers can decide at any time to enable or disable service components. This way, when building the second application, the required service components are compiled into the second application according to certain rules and can be invoked at any time while the second application is running. In other words, service components can be added or removed from the second application at any time, enabling hot-swappability of service components, allowing hot-swappability of any native or extended service within the second application.
[0303] In an embodiment of the present application, the developer can switch the mode in the mode selection area of the application processing interface from the component development mode to the application development mode for developing the second application, and then in the application development mode, the target application processing file can be obtained through the first component processing method corresponding to the source code call statement and the second component processing method corresponding to the business execution method configured in the application processing file. Furthermore, the computer device displays the application configuration area associated with the second application in the application processing interface, and then can display the application construction control in the application development mode in the application processing interface. Then, the computer device can respond to the trigger operation for the application construction control, obtain the business component corresponding to the component identifier configured in the component addition interface from the multi-terminal application platform, and generate the second application based on the target application processing file, the second toolkit and the business component obtained from the multi-terminal application platform. Among them, the application toolkit can be used to establish a communication channel with the business component, so that when the second application is running, it can call the business component through the established communication channel to execute the component business. That is to say, a corresponding business component can be generated for a certain business (business A), and after the business component is installed in the second application, the computer device running the second application can use the communication channel between the application toolkit and the business component in the established second application to enable the second application to use the business A provided by the business component without being restricted by the business provided by the second toolkit itself. In this way, not only can the business expansion of the application toolkit be achieved, but also when the second application is developed, it can be more convenient to enable the generated second application to implement some custom businesses, thereby improving the flexibility of application development. This means that the embodiment of the present application does not need to develop an application toolkit from scratch that can provide all the required businesses for the second application. In this way, the application development efficiency can also be improved from the root. That is to say, the embodiment of the present application can ensure the execution success rate of the business on a specific application (for example, the second application) in the multi-terminal application by developing a business component of a specified business when generating the second application corresponding to the first application, so that in the actual use scenario of the multi-terminal application, it can ensure that the business in the first application can be indirectly used by the second application, and then the business component obtained by configuration can be used to successfully share the business in the first application with the second application.
[0304] Further, please refer to Figure 16, which is a flow chart of a data processing method based on a multi-terminal application platform provided in an embodiment of the present application. As shown in Figure 16, the method can be executed by the computer device mentioned above, and the computer device can be a business terminal configured with a second application. For example, the business terminal can be the business terminal 200b shown in Figure 1 above. It should be understood that at this time, the multi-terminal application on the multi-terminal application platform can specifically include a first application and a second application. The second application is constructed on the multi-terminal application platform through the application project file, the second toolkit and the business component of the first application. The second toolkit is provided by the multi-terminal application platform for the second application. The business component is constructed on the multi-terminal application platform based on the component configuration source code; the component configuration source code is obtained in response to the configuration operation on the template component source code; the source code call statement corresponding to the configuration operation is used to establish a communication channel between the second toolkit and the business component; the template component source code is the component source code in the component project file displayed in the component development mode; the component development mode is the mode in the application processing interface corresponding to the application project file displayed on the multi-terminal application platform; the component project file is stored in the component directory file created for the business component, and the component directory file is determined by the component directory address in the component configuration information configured for the business component. As shown in Figure 16, the method can specifically include the following steps S301-step S303:
[0305] S301: When the second application is running, in response to a triggering operation on a business control corresponding to a business component, obtain a business parameter for calling the business component.
[0306] When the second application is running (it is understood that the second application runs based on the target application processing file), the business control corresponding to the business component (for example, the payment control for the payment service described above) can be used on the application interface of the second application to trigger the component service provided by the business component. At this time, the computer device needs to execute the component service through the business component corresponding to the component service. The specific construction method of constructing the second application through the application project file of the first application can be found in the relevant description of the above embodiment and will not be further described here.
[0307] Among them, it can be understood that the business component here is constructed based on the component configuration source code on the multi-terminal application platform; the component configuration source code is obtained in response to the configuration operation on the template component source code; the source code call statement corresponding to the configuration operation can be used to establish a communication channel between the second toolkit and the business component; the template component source code is the component source code in the component project file displayed in the component development mode; the component development mode is the mode in the application processing interface of the first application displayed on the multi-terminal application platform; the component development mode is displayed when creating a component catalog file associated with the business component; the component project file belongs to the component catalog file. The construction method of the business component can refer to the relevant description of the above embodiment and will not be repeated here.
[0308] According to the above embodiment, the component configuration source code includes a business execution method for the component business. The second application determined by the target application processing file can specifically include a second component processing method corresponding to the business execution method. The second component processing method defines a method for obtaining the method parameters required by the business execution method (i.e., input parameters, that is, business parameters for calling the business component, that is, business parameters for calling the business execution method in the business component). Therefore, the business parameters for calling the business component can be obtained from the second component processing method. The business parameters are used to instruct the business component to call the business execution method to execute the component business.
[0309] S302. The business parameters are passed into the second toolkit, which, based on the communication relationship indicated by the established communication channel, passes the business parameters into the business component, so that the business component executes the component business based on the business parameters, obtains the business execution result corresponding to the component business, and returns the business execution result to the second toolkit through the communication relationship indicated by the communication channel; the communication channel is established based on the source code call statement in the business component when the second toolkit loads the business component, and the component business is configured for the business in the first application.
[0310] It is understood that the second application can pass business parameters to the application toolkit within the second application, and the application toolkit within the second application can further pass the business parameters to the business component via the communication relationship indicated by the established communication channel. At this point, the business component can invoke the corresponding business execution method based on the business parameters to execute the component business, thereby obtaining a business execution result corresponding to the component business. The business component can then return the business execution result to the second toolkit via the communication relationship indicated by the communication channel.
[0311] It can be understood that the communication channel is established when the second toolkit loads the business component based on the source code call statements in the business component. In other words, the communication channel must be established when the component service is first triggered. This allows data communication between the second application and the business component to be achieved at any time based on this communication channel.
[0312] The second application includes a first component processing method corresponding to a source code call statement for establishing a communication channel. Specifically, based on the first component processing method, the second toolkit (i.e., the application toolkit of the second application) is called to load a business component and the business component is notified to call the source code call statement to instantiate the component. Upon completion of component instantiation, a communication channel is established between the second toolkit (i.e., the application toolkit of the second application) and the business component.
[0313] Among them, the component configuration source code includes the template component initialization source code in the template component source code, and the component instantiation can be specifically: the computer device can obtain the component identification of the business component from the first component processing method; further, the computer device can pass the component identification into the second toolkit (that is, the application toolkit of the above-mentioned second application) to enable the second toolkit (that is, the application toolkit of the above-mentioned second application) to load the business component based on the component identification, and notify the business component to call the source code call statement to register the component, and after the component is registered, call the template component initialization source code to initialize the component; component initialization is component instantiation.
[0314] It can be understood that the second application executes the first component processing method to pass the component identifier to the second toolkit, so that the second toolkit loads the business component based on the component identifier and notifies the business component to perform component instantiation (including component registration and component initialization). It can be understood that when the business component instantiates the component, it returns the component object of the business component (i.e., the component instantiation object, that is, the information returned by the component object defined in the above-mentioned target component registration source code after instantiation. The returned information can be configured as a fixed parameter, such as "plugin"). When the second toolkit receives the component instantiation object, it can further return the component instantiation object to the second application. The second application can store the component instantiation object to indicate that the communication channel between the second toolkit and the business component is established, that is, the business component is loaded. The communication channel can be used for data interaction between the second application and the business component. At this time, after the second application stores the component instantiation object, it can implement the method exposed by the component instantiation object, that is, obtain the method parameters of the method exposed by the component instantiation object from the second component processing method, so as to use the method exposed by the component instantiation object based on the method parameters.
[0315] S303: Display the service execution result returned by the second toolkit.
[0316] The second application running in the computer device may receive the service execution result returned by the second toolkit (ie, the application toolkit of the second application), and may further output and display the service execution result.
[0317] It is understandable that when the second application triggers a service (toolkit service) that can be executed without calling a service component, the second application can directly execute the toolkit service by calling the second toolkit and display the service execution result of the toolkit service returned by the second toolkit.
[0318] Optionally, when the second application triggers a business (component business) that requires calling a business component to be executed, the second application establishes a communication channel with the business component by calling the second toolkit. The second toolkit triggers the business component to call the business execution method to execute the component business based on the communication channel. At the same time, after obtaining the business execution result, the business component can further return the obtained business execution result to the second toolkit. In this way, the second toolkit can further return the business execution result to the second application.
[0319] For example, as shown in FIG17 , FIG17 is a schematic diagram of an interactive process of business execution provided by an embodiment of the present application; wherein, the computer device can compile the second application through the target application processing file, the application toolkit and the business component, and can run the second application based on the target application processing file in the computer device. At this time: when the second application is running, if the business control corresponding to the business component is triggered (i.e., step S61), the second application can obtain the component identifier of the business component from the first component processing method of the business component corresponding to the component business; further, the second application can pass the component identifier into the second toolkit (i.e., step S62); and then In one step, the application toolkit can load the business component based on the component identifier when executing step S63 to instantiate the business component. The component instantiation here can specifically include component registration and component initialization; further, the business component can further execute step S64 after the component instantiation is completed to return the component instantiation object to the application toolkit; further, the application toolkit can further return the component instantiation object to the second application when executing step S65; at this time, the second application can store the component instantiation object to indicate that the business component loading is complete, and establish a communication channel between the application toolkit and the business component. Then, the second application can use the business execution method exposed by the component instantiation object to obtain the business parameters for calling the business execution method from the second component processing method of the business component corresponding to the component business, and pass the business parameters into the application toolkit (i.e., step S66); further, the application toolkit can execute step S67 based on the communication channel between the application toolkit and the business component to pass the business parameters into the business component; at this time, the business component calls the corresponding business execution method based on the business parameters to execute the component business to obtain the business execution result; further, the business component can execute step S68 and return the business execution result to the application toolkit; in this way, the application toolkit can further execute step S69 and return the business execution result to the second application; finally, the second application can display the business execution result on the computer device running the second application when executing step S610, thereby indicating that the component business execution is completed.
[0320] That is to say, the behavior layer (Javascript layer) of the second application can be used to execute the first component processing method to pass relevant parameters (such as component identification) to the second toolkit, so that the second toolkit can load the business component based on the component identification, so as to facilitate a series of subsequent operations to instantiate the business component, such as component registration, component initialization, etc. When the business component is instantiated, it can return the component instantiation object to the second toolkit, which means that a communication channel has been established between the business component and the second toolkit (that is, the second application can notify the second toolkit to call the business component based on the communication channel). At this time, the behavior layer of the second application can call all business execution methods exposed by the component instantiation object, that is, the business execution method can be used through the second toolkit.
[0321] In an embodiment of the present application, when the second application is running, the computer device can respond to a trigger operation for the component business and obtain the business parameters for calling the business component, and then the business parameters can be passed into the application toolkit (i.e., the second toolkit) in the second application, and the second toolkit can further pass the business parameters into the business component according to the communication relationship indicated by the communication channel established between the second toolkit and the business component, so that the business component can execute the component business based on the business parameters, so that the second application can be used to display the business execution results returned by the application toolkit. Among them, the application toolkit can establish a communication channel with the business component, so that when the second application is running, it can call the business component to execute the component business through the established communication channel. That is to say, when the embodiment of the present application generates a corresponding business component for a certain business (business A), the business component can be installed into the second application, so that by establishing a communication channel between the application toolkit and the business component in the second application, the second application can normally use the business A provided by the business component without being restricted by the business provided by the second toolkit itself, thereby realizing the business expansion of the application toolkit. In addition, when developing a second application, the embodiment of the present application can more conveniently enable the generated second application to be called by the current existing application toolkit through plug-and-play business components to implement some customized services, thereby improving the flexibility of application development. There is no need to develop an application toolkit from scratch that can provide all the required services for the second application. In this way, the efficiency of application development can be improved. That is to say, when generating a second application corresponding to the first application, the embodiment of the present application can ensure the execution success rate of the business on a specific application (for example, the second application) in multi-terminal applications by developing business components for specified businesses.
[0322] Further, please refer to Figure 18, which is a structural diagram of a data processing device based on a multi-terminal application platform provided in an embodiment of the present application. The multi-terminal application platform is configured to use the application project file of the first application to develop a multi-terminal application, and the multi-terminal application includes the first application. As shown in Figure 18, the data processing device 1 based on the multi-terminal application platform may include: a data display module 11, a component file display module 12, a component source code configuration module 13, a component construction module 14, and a multi-terminal application development module 15; wherein:
[0323] The data display module 11 is used to display the application processing interface corresponding to the application project file on the multi-terminal application platform, and when the mode in the application processing interface is the application development mode corresponding to the multi-terminal application, display the component creation control pre-configured for the application development mode;
[0324] The data display module 11 is further configured to, in response to a trigger operation for a component creation control, display a component creation interface corresponding to the component creation control, and display component configuration information configured for the business component on the component creation interface; the component configuration information includes a component identifier of the business component, a component directory address, and a target application identifier bound to the component identifier; the second application corresponding to the target application identifier is an application in the multi-terminal application that is different from the first application;
[0325] The component file display module 12 is configured to, in response to a confirmation operation on the component configuration information, switch the component creation interface back to the application processing interface; in response to a mode switching operation on the application processing interface, switch the mode in the application processing interface from the application development mode to the component development mode for developing the business component; and in the component development mode, display the component directory file created for the business component via the component directory address; the component directory file is used to store the component project file configured for the business component; the component source code in the component project file is the template component source code adapted for the second application and carrying the component identifier;
[0326] The component source code configuration module 13 is configured to obtain a source code call statement for calling a business component in response to a configuration operation on the template component source code, and to generate component configuration source code for the business component from the template component source code and the source code call statement; the source code call statement is used to establish a communication channel between a second toolkit of a second application and the business component; the second toolkit is provided by the multi-terminal application platform;
[0327] The component construction module 14 is used to obtain a business component by compiling the component configuration source code, publish the business component and display it on a multi-terminal application platform, and construct a second application on the multi-terminal application platform based on the application project file, the second toolkit and the business component; the second application is configured to notify the second toolkit to call the business component based on the communication channel during runtime and execute the component business provided by the business component, and the component business is configured for the business in the first application.
[0328] The template component source code includes the template component registration source code and the template component initialization source code for the business component;
[0329] The component source code configuration module 13 includes: a registration source code configuration unit 131 and a configuration source code determination unit 132;
[0330] The registration source code configuration unit 131 is configured to obtain a target component registration source code for registering a business component in response to a registration configuration operation on the template component registration source code; the target component registration source code is configured to call the template component initialization source code after completing component registration of the business component using the component identifier in the template component source code;
[0331] The configuration source code determination unit 132 is configured to configure the target component registration source code for calling the template component initialization source code as a source code calling statement.
[0332] The specific implementation of the registration source code configuration unit 131 and the configuration source code determination unit 132 can refer to the above description of the specific implementation of the get and amama call statements, which will not be further described here.
[0333] The configuration source code determination unit 132 includes: an execution method configuration subunit 1321 and a configuration source code determination subunit 1322;
[0334] The execution method configuration subunit 1321 is configured to obtain the service execution method configured for the component service in response to the execution method configuration operation for the component service;
[0335] The configuration source code determination subunit 1322 is used to obtain the component configuration source code of the business component based on the template component initialization source code, source code call statement and business execution method.
[0336] Among them, the specific implementation of the execution method configuration subunit 1321 and the configuration source code determination subunit 1322 can refer to the description of the specific process of obtaining the component configuration source code above, and will not be further described here.
[0337] The application processing interface displays a debug statement building control in the component development mode and a component debugging area in the component development mode; the component debugging area includes a component loading control;
[0338] Before the component construction module 14 executes the step of obtaining the business component by compiling the component configuration source code, the component construction module 14 further includes: a test component construction unit 141 and a test component debugging unit 142;
[0339] The test component construction unit 141 is configured to generate component debugging source code in response to a trigger operation for constructing a control for a debugging statement;
[0340] The test component construction unit 141 is further configured to construct a test component based on the component configuration source code in response to a trigger operation on a component loading control;
[0341] The test component debugging unit 142 is used to notify the test component to instantiate the component through the component configuration source code based on the component debugging source code in the component debugging program corresponding to the component debugging area;
[0342] The test component debugging unit 142 is further configured to obtain a test communication channel between the component debugging program and the test component when the component instantiation is completed; the test communication channel is used to debug the test component.
[0343] The specific implementation of the test component construction unit 141 and the test component debugging unit 142 can refer to the above description of the specific debugging process of debugging the test component, which will not be further described here.
[0344] The component configuration source code includes the template component initialization source code in the template component source code;
[0345] The test component debugging unit 142 includes: a test component instance subunit 1421;
[0346] The test component instance subunit 1421 is used to load the test component based on the component debugging source code in the component debugging program, and notify the test component to call the source code call statement to register the component, and after the component is registered, call the template component initialization source code to initialize the component; component initialization is component instantiation.
[0347] The component configuration source code includes the business execution method configured for the component business; the component debugging area includes the component call control;
[0348] The test component debugging unit 142 further includes: a test component calling subunit 1422;
[0349] The test component calling subunit 1422 is configured to obtain test service parameters for calling a service execution method from the component debugging source code in response to a trigger operation on the component calling control;
[0350] The test component calling subunit 1422 is further configured to, in the component debugging program, pass the test service parameters to the test component via the test communication relationship indicated by the established test communication channel, so that the test component calls the service execution method based on the test service parameters, executes the component service, and obtains the test execution result corresponding to the component service;
[0351] The test component calling subunit 1422 is further configured to determine whether the test component debugging is completed based on the test execution result.
[0352] The specific implementation of the test component calling subunit 1422 can be found in the above description of the specific process of debugging the test component through the test business parameters, which will not be further described here.
[0353] The component configuration source code includes the template component initialization source code in the template component source code and the business execution method configured for the component business;
[0354] The component construction module 14 includes: a component construction unit 143;
[0355] The component construction unit 143 is used to display the component construction control in the component development mode in the application processing interface;
[0356] The component construction unit 143 is further configured to construct a business component based on the template component initialization source code, source code call statements and business execution method in response to a trigger operation on the component construction control.
[0357] The specific implementation of the component construction unit 143 can refer to the description of the specific process of constructing the business component, which will not be further described here.
[0358] The component configuration source code includes a business execution method configured for the component business; the application project file includes an application processing file of the first application;
[0359] Before the multi-terminal application development module 15 is used to execute the step of constructing the second application based on the application project file, the second toolkit, and the business components on the multi-terminal application platform, the multi-terminal application development module 15 is further used to:
[0360] In the mode selection area of the application processing interface, the mode in the mode selection area is switched from component development mode to application development mode, and the application processing file is displayed in the application development mode;
[0361] Configure the first component processing method corresponding to the source code call statement and the second component processing method corresponding to the business execution method in the application processing file to obtain the target application processing file; the first component processing method is used to instruct the second toolkit to notify the business component to execute the source code call statement; the second component processing method is used to instruct the second toolkit to notify the business component to execute the business execution method; the target application processing file is used to generate a second application.
[0362] The multi-terminal application development module 15 includes: a component adding unit 151 and an application building unit 152;
[0363] The component adding unit 151 is used to display an application configuration area for configuring the second application in the application processing interface; the application configuration area includes a component adding control in the application development mode;
[0364] The component adding unit 151 is further configured to, in response to a triggering operation on the component adding control, display a component adding interface corresponding to the component adding control and add a component identifier of the business component in the component adding interface;
[0365] An application construction unit 152 is configured to display an application construction control in an application development mode in an application processing interface;
[0366] The application construction unit 152 is also used to respond to the trigger operation of the application construction control, obtain the business component from the multi-terminal application platform through the component identifier added in the component addition interface, and generate the second application based on the target application processing file, the second toolkit and the business component.
[0367] The application construction unit 152 is specifically used for:
[0368] Obtain the target application ID through the component ID added in the component addition interface;
[0369] If the target application identifier associated with the business component is the application identifier of the second application, the business component corresponding to the target application identifier bound to the component identifier is obtained from the multi-terminal application platform.
[0370] The specific implementations of the data display module 11, the component file display module 12, the component source code configuration module 13, the component construction module 14, and the multi-terminal application development module 15 can be found in the relevant descriptions of the above embodiments and will not be further elaborated here. It should be understood that the description of the beneficial effects obtained by adopting the same method will not be repeated here.
[0371] Further, please refer to Figure 19, which is a structural diagram of a data processing device based on a multi-terminal application platform provided by an embodiment of the present application. In which, the multi-terminal application on the multi-terminal application platform includes a first application and a second application, the second application is constructed on the multi-terminal application platform through the application project file, the second toolkit and the business component of the first application, the second toolkit is provided by the multi-terminal application platform for the second application, and the business component is constructed on the multi-terminal application platform based on the component configuration source code; the component configuration source code is obtained in response to a configuration operation on the template component source code; the source code call statement corresponding to the configuration operation is used to establish a communication channel between the second toolkit and the business component; the template component source code is the component source code in the component project file displayed in the component development mode; the component development mode is the mode in the application processing interface corresponding to the application project file displayed on the multi-terminal application platform; the component project file is stored in the component directory file created for the business component, and the component directory file is determined by the component directory address in the component configuration information configured for the business component. As shown in FIG19 , a data processing device 2 based on a multi-terminal application platform may include: a business parameter acquisition module 21 , a business processing module 22 , a result display module 23 , and a component loading module 24 ; wherein:
[0372] A business parameter acquisition module 21 is used to acquire business parameters for calling a business component in response to a trigger operation on a business control corresponding to the business component when the second application is running;
[0373] The business processing module 22 is configured to pass business parameters to the second toolkit. The second toolkit, based on the communication relationship indicated by the established communication channel, passes the business parameters to the business component, causing the business component to execute the component business based on the business parameters, obtain a business execution result corresponding to the component business, and return the business execution result to the second toolkit via the communication relationship indicated by the communication channel. The communication channel is established based on source code call statements in the business component when the second toolkit loads the business component. The component business is configured for the business in the first application.
[0374] The result display module 23 is used to display the service execution result returned by the toolkit.
[0375] Wherein, the second application includes a first component processing method corresponding to a source code call statement;
[0376] The apparatus 2 further includes: a component loading module 24;
[0377] The component loading module 24 is used to call the second toolkit to load the business component based on the first component processing method, and notify the business component to call the source code call statement to instantiate the component;
[0378] The component loading module 24 is used to obtain a communication channel between the second toolkit and the business component when the component instantiation is completed.
[0379] The component configuration source code includes the template component initialization source code in the template component source code;
[0380] The component loading module 24 is specifically used for:
[0381] Obtaining a component identifier of the business component from the first component processing method;
[0382] The component identifier is passed into the second toolkit so that the second toolkit loads the business component based on the component identifier, and notifies the business component to call the source code call statement to register the component. After the component is registered, the template component initialization source code is called to initialize the component; component initialization is component instantiation.
[0383] The component configuration source code includes a business execution method for the component business; the second application includes a second component processing method corresponding to the business execution method;
[0384] The service parameter acquisition module 21 is specifically used for:
[0385] A business parameter for calling a business component is obtained from the second component processing method; the business parameter is used to instruct the business component to call a business execution method to execute the component business.
[0386] The specific implementation of the service parameter acquisition module 21, the service processing module 22, the result display module 23, and the component loading module 24 can be found in the relevant descriptions of the above embodiments, and will not be further described here. It should be understood that the description of the beneficial effects obtained by adopting the same method will not be repeated.
[0387] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the functions of the module or unit.
[0388] Further, please refer to Figure 20, which is a structural diagram of a computer device provided in an embodiment of the present application. As shown in Figure 20, the computer device 2000 can be a terminal or a server, and will not be limited here. For ease of understanding, this application takes the computer device as a server as an example. The computer device 2000 may include: a processor 2001, a network interface 2004 and a memory 2005. In addition, the computer device 2000 may also include: a user interface 2003, and at least one communication bus 2002. Among them, the communication bus 2002 is used to realize the connection and communication between these components. Among them, the user interface 2003 may also include a standard wired interface and a wireless interface. The network interface 2004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 2005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage. The memory 2005 may also be at least one storage device located away from the aforementioned processor 2001. As shown in FIG. 20 , the memory 2005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a computer program.
[0389] Among them, the network interface 2004 in the computer device 2000 can also provide a network data interaction function. In the computer device 2000 shown in Figure 20, the network interface 2004 can provide a network data interaction function; the user interface 2003 is mainly used to provide an input interface for the user; and the processor 2001 can be used to call the computer program stored in the memory 2005 to execute the description of the data processing method based on the multi-terminal application platform in the embodiments corresponding to Figures 4, 11, and 16 above. It can also execute the description of the data processing device 1 based on the multi-terminal application platform in the embodiment corresponding to Figure 18 above and the description of the data processing device 2 based on the multi-terminal application platform in the embodiment corresponding to Figure 19, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
[0390] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores the computer program executed by the data processing device 1 based on the multi-terminal application platform and the data processing device 2 based on the multi-terminal application platform mentioned above. When the processor executes the computer program, it can execute the description of the data processing method based on the multi-terminal application platform in the corresponding embodiment of Figure 4, Figure 11 or Figure 16 above, so it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the computer program can be deployed on a computer device for execution, or executed on multiple computer devices located at one location, or executed on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network can constitute a blockchain system.
[0391] In addition, it should be noted that: according to one aspect of the present application, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, it implements the method provided in any of the above aspects of the embodiments of the present application. The processor of the computer device reads the computer program from a computer-readable storage medium, and the processor can execute the computer program so that the computer device executes the description of the data processing method based on the multi-terminal application platform in the embodiments corresponding to Figures 4, 11 or 16 above, and therefore, it will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer program product embodiments involved in this application, please refer to the description of the method embodiments of this application.
[0392] It should be noted that for the aforementioned various method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0393] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0394] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0395] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed, the computer program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0396] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.< / uiuseractivityrestoring>
Claims
1. A data processing method based on a multi-terminal application platform, characterized in that, The multi - terminal application platform is configured to develop a multi - terminal application using the application project file of the first application. The multi - terminal application includes the first application. The method includes: Display an application processing interface corresponding to the application project file on the multi - terminal application platform. When the mode in the application processing interface is the application development mode corresponding to the multi - terminal application, display a component creation control pre - configured for the application development mode; In response to a trigger operation on the component creation control, display a component creation interface corresponding to the component creation control, and display component configuration information configured for the business component on the component creation interface; the component configuration information includes the component identifier of the business component, the component directory address, and the target application identifier bound to the component identifier; the second application corresponding to the target application identifier is an application different from the first application in the multi - terminal application; In response to a confirmation operation on the component configuration information, switch the component creation interface back to the application processing interface. In response to a mode switching operation on the application processing interface, switch the mode in the application processing interface from the application development mode to a component development mode for developing the business component, and in the component development mode, display a component directory file created for the business component through the component directory address; the component directory file is used to store a component project file configured for the business component, and the component source code in the component project file is a template component source code adapted to the second application and carrying the component identifier; In response to a configuration operation on the template component source code, configure a source code call statement for calling the business component. Through the template component source code and the source code call statement, generate the component configuration source code of the business component; the source code call statement is used to establish a communication channel between the second toolkit of the second application and the business component; the second toolkit is provided by the multi - terminal application platform; Compile the business component through the component configuration source code and publish and display the business component on the multi - terminal application platform; Build the second application on the multi - terminal application platform based on the application project file, the second toolkit, and the business component; the second application is configured to, when running, notify the second toolkit to call the business component based on the communication channel and execute the component service provided by the business component, and the component service is configured for the service in the first application.
2. The method according to claim 1, wherein The template component source code includes a template component registration source code and a template component initialization source code for the business component; The response to the configuration operation on the template component source code, configuring a source code call statement for calling the business component, includes: In response to a registration configuration operation for registering source code of the template component, obtain target component registration source code for registering the service component; the target component registration source code is used to call the template component initialization source code after completing component registration of the service component through the component identifier in the template component source code. Configure the target component registration source code for calling the template component initialization source code as the source code call statement.
3. The method according to any one of claims 1-2, characterized in that, Generating the component configuration source code of the service component through the template component source code and the source code call statement includes: In response to an execution method configuration operation for the component service, obtain the service execution method configured for the component service. Based on the template component initialization source code, the source code call statement, and the service execution method, obtain the component configuration source code of the service component.
4. The method according to any one of claims 1 to 3, characterized in that, A debugging statement construction control in the component development mode and a component debugging area in the component development mode are displayed in the application processing interface; the component debugging area includes a component loading control. Before compiling the service component through the component configuration source code, the method further includes: In response to a trigger operation on the debugging statement construction control, generate component debugging source code for component debugging of the component configuration source code on the multi-terminal application platform. In response to a trigger operation on the component loading control, construct a test component through the component configuration source code. In the component debugging program corresponding to the component debugging area, notify the test component to perform component instantiation through the component configuration source code based on the component debugging source code; the component debugging program is determined by the second toolkit provided by the multi-terminal application platform for the component debugging source code. When component instantiation is completed, obtain a test communication channel between the component debugging program and the test component; the test communication channel is used to debug the test component.
5. The method according to any one of claims 1-4, characterized in that, The component configuration source code includes the template component initialization source code in the template component source code. In the component debugging program corresponding to the component debugging area, notifying the test component to perform component instantiation through the component configuration source code based on the component debugging source code includes: In the component debugging program, load the test component based on the component debugging source code, notify the test component to call the source code call statement for component registration, and after component registration, call the template component initialization source code for component initialization; the component initialization is the component instantiation.
6. The method according to any one of claims 1-5, characterized in that, The component configuration source code includes the service execution method configured for the component service; the component debugging area includes a component call control. The method further includes: In response to a trigger operation on the component call control, obtain test service parameters for calling the service execution method from the component debugging source code. In the component debugger, the test service parameters are passed into the test component through the test communication relationship indicated by the established test communication channel, so that the test component calls the service execution method based on the test service parameters, executes the component service, and obtains the test execution result corresponding to the component service; When the test execution result indicates success, it is determined that the component debugging of the test component is completed.
7. The method according to any one of claims 1-6, characterized in that, The component configuration source code includes the template component initialization source code in the template component source code and the service execution method configured for the component service; Compiling the service component from the component configuration source code includes: In the application processing interface, display the component construction control in the component development mode; In response to a trigger operation on the component construction control, the service component is constructed based on the template component initialization source code, the source code call statement, and the service execution method.
8. The method according to any one of claims 1-7, characterized in that, The component configuration source code includes the service execution method configured for the component service; the application project file includes the application processing file of the first application; Before building the second application on the multi-terminal application platform based on the application project file, the second toolkit, and the service component, the method further includes: In the mode selection area of the application processing interface, switch the mode in the mode selection area from the component development mode to the application development mode, and display the application processing file in the application development mode; Configure the first component processing method corresponding to the source code call statement and the second component processing method corresponding to the service execution method in the application processing file to obtain a target application processing file; the first component processing method is used to instruct the second toolkit to notify the service component to execute the source code call statement; the second component processing method is used to instruct the second toolkit to notify the service component to execute the service execution method; the target application processing file is used to generate the second application.
9. The method according to any one of claims 1-8, characterized in that Building the second application on the multi-terminal application platform based on the application project file, the second toolkit, and the service component includes: In the application processing interface, display an application configuration area for configuring the second application; the application configuration area includes a component addition control in the application development mode; In response to a trigger operation on the component addition control, display the component addition interface corresponding to the component addition control, and add the component identifier of the service component in the component addition interface; In the application processing interface, display an application construction control in the application development mode; In response to a trigger operation on the application construction control, obtain the service component from the multi-terminal application platform through the component identifier added in the component addition interface, and generate the second application based on the target application processing file, the second toolkit, and the service component.
10. The method according to any one of claims 1-9, characterized in that, Obtaining the service component from the multi-terminal application platform by using the component identifier added in the component addition interface includes: Obtaining the target application identifier by using the component identifier added in the component addition interface; If the target application identifier associated with the service component is the application identifier of the second application, obtaining the service component corresponding to the target application identifier bound to the component identifier from the multi-terminal application platform.
11. A data processing method based on a multi-terminal application platform, characterized in that The multi-terminal applications on the multi-terminal application platform include a first application and a second application. The second application is constructed on the multi-terminal application platform by using the application project file of the first application, a second toolkit, and a service component. The second toolkit is provided by the multi-terminal application platform for the second application. The service component is constructed on the multi-terminal application platform based on component configuration source code. The component configuration source code is obtained in response to a configuration operation on the template component source code. The source code call statement corresponding to the configuration operation is used to establish a communication channel between the second toolkit and the service component. The template component source code is the component source code in the component project file displayed in the component development mode. The component development mode is a mode in the application processing interface corresponding to the application project file displayed on the multi-terminal application platform. The component project file is stored in a component directory file created for the service component. The component directory file is determined by the component directory address in the component configuration information configured for the service component. The method includes: When the second application is running, in response to a trigger operation on a service control corresponding to the service component, obtaining service parameters for calling the service component; Passing the service parameters into the second toolkit, and based on the communication relationship indicated by the established communication channel, the second toolkit passes the service parameters into the service component, so that the service component executes component services based on the service parameters, obtains a service execution result corresponding to the component services, and returns the service execution result to the second toolkit through the communication relationship indicated by the communication channel. The communication channel is established based on the source code call statement in the service component when the second toolkit loads the service component. The component services are configured for the services in the first application; Displaying the service execution result returned by the second toolkit.
12. The method according to claim 11, wherein The second application includes a first component processing method corresponding to the source code call statement; The method further includes: Based on the first component processing method, calling the second toolkit to load the service component, and notifying the service component to call the source code call statement for component instantiation; When the component instantiation is completed, obtaining the communication channel between the second toolkit and the service component.
13. The method according to any one of claims 11-12, characterized in that, The component configuration source code includes the template component initialization source code in the template component source code; Based on the above first component processing method, call the second toolkit to load the service component, and notify the service component to call the source code call statement for component instantiation, including: Obtain the component identifier of the service component from the first component processing method; Pass the component identifier to the second toolkit, so that the second toolkit loads the service component based on the component identifier, and notify the service component to call the source code call statement for component registration. After component registration, call the template component initialization source code for component initialization; the component initialization is the component instantiation.
14. The method according to any one of claims 11-13, characterized in that, The component configuration source code includes a service execution method for the component service; the second application includes a second component processing method corresponding to the service execution method; The obtaining of the service parameters for calling the service component includes: Obtain the service parameters for calling the service component from the second component processing method; The service parameters are used to instruct the service component to call the service execution method to execute the component service.
15. A data processing device based on a multi-terminal application platform, characterized in that, The multi-terminal application platform is configured to be developed from the application project file of the first application to obtain a multi-terminal application, the multi-terminal application includes the first application, and the device includes: A data display module, configured to display an application processing interface corresponding to the application project file on the multi-terminal application platform. When the mode in the application processing interface is the application development mode corresponding to the multi-terminal application, display a component creation control pre-configured for the application development mode; The data display module is further configured to, in response to a trigger operation on the component creation control, display a component creation interface corresponding to the component creation control, and display component configuration information configured for the service component on the component creation interface; the component configuration information includes the component identifier, component directory address, and target application identifier bound to the component identifier of the service component; the second application corresponding to the target application identifier is an application different from the first application in the multi-terminal application; A component file display module, configured to, in response to a confirmation operation on the component configuration information, switch the component creation interface back to the application processing interface, and in response to a mode switching operation on the application processing interface, switch the mode in the application processing interface from the application development mode to a component development mode for developing the service component, and in the component development mode, display a component directory file created for the service component through the component directory address; the component directory file is used to store a component project file configured for the service component, and the component source code in the component project file is a template component source code adapted to the second application and carrying the component identifier; A component source code configuration module, which is configured to, in response to a configuration operation on the source code of the template component, obtain a source code call statement for invoking the business component, and generate component configuration source code of the business component through the source code of the template component and the source code call statement; the source code call statement is used to establish a communication channel between the second toolkit of the second application and the business component; the second toolkit is provided by the multi-terminal application platform; A component construction module, which is configured to compile the business component through the component configuration source code and publish and display the business component on the multi-terminal application platform; A multi-terminal application development module, which is configured to build the second application on the multi-terminal application platform based on the application project file, the second toolkit, and the business component; the second application is configured to, when running, notify the second toolkit to call the business component based on the communication channel and execute the component service provided by the business component, and the component service is configured for the service in the first application.
16. A data processing device based on a multi-terminal application platform, characterized in that, The multi-terminal applications on the multi-terminal application platform include a first application and a second application. The second application is built on the multi-terminal application platform through the application project file, the second toolkit, and the business component of the first application. The second toolkit is provided by the multi-terminal application platform for the second application. The business component is built on the multi-terminal application platform based on the component configuration source code; the component configuration source code is obtained in response to a configuration operation on the source code of the template component; the source code call statement corresponding to the configuration operation is used to establish a communication channel between the second toolkit and the business component; the source code of the template component is the component source code in the component project file displayed in the component development mode; the component development mode is the mode in the application processing interface corresponding to the application project file displayed on the multi-terminal application platform; the component project file is stored in the component directory file created for the business component, and the component directory file is determined by the component directory address in the component configuration information configured for the business component. The device includes: A service parameter acquisition module, which is configured to, when the second application is running, in response to a trigger operation on the service control corresponding to the business component, obtain service parameters for invoking the business component; A service processing module, which is configured to pass the service parameters into the second toolkit, and the second toolkit passes the service parameters into the business component based on the communication relationship indicated by the established communication channel, so that the business component executes the component service based on the service parameters to obtain a service execution result corresponding to the component service, and returns the service execution result to the second toolkit through the communication relationship indicated by the communication channel; the communication channel is established based on the source code call statement in the business component when the second toolkit loads the business component, and the component service is configured for the service in the first application; A result display module for displaying the business execution result returned by the said toolkit.
17. A computer device, characterized in that, It includes a memory and a processor; The memory is connected to the processor. The memory is used for storing computer programs, and the processor is used for calling the computer programs so that the computer device executes the method according to any one of claims 1-14.
18. A computer-readable storage medium, characterized in that, A computer program is stored in the said computer-readable storage medium. The computer program is suitable for being loaded and executed by a processor so that a computer device with the said processor executes the method according to any one of claims 1-14.
19. A computer program product, characterized in that, It includes a computer program which, when executed by a processor, implements the method according to any one of claims 1-14.
Citation Information
Patent Citations
Platform and implementation method thereof
CN111209010A
Application configuration method and device, equipment and storage medium
CN114217845A
Multi-terminal application development system and method
CN117369777A
Data processing method and device based on multi-terminal application platform, equipment and medium
CN117555645A
API-based software development platform
US20210216288A1