Application modular operation method, device, equipment and storage medium
By obtaining and registering module identification information in application modular development and using routing communication modules to transmit target information, cross-module access and interaction problems are solved, and development efficiency and stability are improved.
Patent Information
- Application Number
- CN202111567120.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-12-20
AI Technical Summary
The existing multi-module framework fails to effectively solve the problems of cross-module access and interaction in application modular development, resulting in extended compilation time and increased maintenance costs.
By acquiring the identification information of the native module and the hybrid module for registration, and using the routing communication module for target information transmission, the interaction between the native module and the hybrid module is realized, including obtaining and forwarding the target information to achieve communication between modules.
It improves the development efficiency of application modular development, reduces the coupling degree and maintenance cost between modules, and enhances the stability of the application.
Smart Images

Figure CN114237771B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of application framework, and in particular to a method, device, equipment and storage medium for modular operation of an application. Background Art
[0002] As the complexity of Android applications increases, putting all the code in one module will lead to longer compilation time and greatly increase the cost of code maintenance. In order to solve this problem, more and more applications are beginning to use modular development, putting different functional codes in different modules to improve development efficiency and reduce code maintenance costs. However, most of the multi-module frameworks on the market do not solve the cross-module access and interaction problems. Summary of the invention
[0003] The main purpose of this application is to provide a method, device, equipment and computer storage medium for modular operation of an application, aiming to solve the registration and interaction problems of each module during modular development of an application, thereby improving the development efficiency of modular development of an application.
[0004] In a first aspect, the present application provides a modular operation method for an application, wherein the application includes a first submodule and a second submodule, and the modular operation method for the application includes the following steps:
[0005] Acquire identification information of the first submodule and identification information of the second submodule, so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module;
[0006] Acquire first target information sent by the first submodule, where the first target information includes target identification information;
[0007] When the target identification information is used to indicate the second submodule, sending the first target information to the second submodule;
[0008] Acquire second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule;
[0009] The native module is a submodule developed for the operating system running the application; the hybrid module is a submodule developed using a Web programming language.
[0010] In a second aspect, the present application further provides an application modular operation device, the application modular operation device comprising:
[0011] an initialization module, used for obtaining identification information of the first submodule and identification information of the second submodule, so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module;
[0012] A first information acquisition module, used to acquire first target information sent by the first submodule, wherein the first target information includes target identification information;
[0013] a first information forwarding module, configured to send the first target information to the second submodule when the target identification information is used to indicate the second submodule;
[0014] The second information forwarding module is used to obtain second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule.
[0015] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the modular operation method of the application is implemented as described above.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the above-mentioned modular application operation method is implemented.
[0017] The present application provides a method, device, equipment and computer storage medium for modular operation of an application program. The present application obtains identification information of the first submodule and identification information of the second submodule so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module; obtains first target information sent by the first submodule, the first target information includes target identification information; when the target identification information is used to indicate the second submodule, the first target information is sent to the second submodule; obtains second target information obtained by the second submodule according to the first target information, and sends the second target information to the first submodule; wherein the native module refers to a submodule developed for an operating system running an application program; the hybrid module refers to a submodule including a part developed by a Web programming language. Since the registration and interaction problems of each module during modular development of an application are solved, the development efficiency of modular development of an application is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A flowchart of a modular operation method of an application provided in one embodiment of the present application;
[0020] Figure 2 A usage scenario diagram of a modular application operation method provided in one embodiment of the present application;
[0021] Figure 3 A schematic diagram of data protocol information provided by an embodiment of the present application;
[0022] Figure 4 A schematic block diagram of a modular application program operation device provided in one embodiment of the present application;
[0023] Figure 5 The present invention is a block diagram showing the structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0026] Embodiments of the present application provide a method, apparatus, device, and computer-readable storage medium for modular operation of an application.
[0027] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0028] Please refer to Figure 1 , Figure 1A flowchart of a modular operation method of an application provided in an embodiment of the present application. The modular operation method of the application can be used in a terminal or a server to implement application development for the terminal or the server. The terminal can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device; the server can be an independent server, or a server cluster, 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, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0029] Please refer to Figure 2 , Figure 2 This is a usage scenario diagram provided by an embodiment of the present application. Figure 2 As shown, the application includes a first submodule, a second submodule and a routing communication module, and the routing communication module can obtain the first target information of the first submodule, send the first target information to the second submodule according to the target identification information in the first target information, and obtain the second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule. Of course, it is not limited to this, and the application can also include other submodules; in particular, the application can also include a target service module, which is not limited here.
[0030] like Figure 1 As shown, the modular operation method of the application includes steps S101 to S104.
[0031] Step S101: Obtain identification information of the first submodule and identification information of the second submodule to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module.
[0032] Exemplarily, the native module refers to a module in an application that is developed for a specific operating system (such as Android, iOS, etc.) and based on a language supported by the operating system (such as Eclipse and Java supported by Android, Xcode and Objective-C supported by iOS, etc.). Native modules have advantages such as fast running speed and convenient access to local resources, but the development and maintenance costs of native modules are higher. Therefore, functions in applications that require high running speed or are highly dependent on local resources can be implemented through native modules, such as face recognition, OCR scanning, and scan code payment.
[0033] Exemplarily, the hybrid module includes a script layer, an intermediate layer and a native layer, wherein the script layer refers to a part developed based on Web programming languages such as HTML, JavaScript, and CSS. The script layer can be run on different operating systems without being restricted by the operating system, and the development and maintenance costs are lower, but the script layer runs relatively slowly and cannot directly access local resources. Therefore, functions in the application that require lower running speed can be implemented through the script layer of the hybrid module, such as login, registration, comment and other functions. Since the script layer cannot directly exchange data with the native layer or the native module, the script layer needs to interact with the native layer through the intermediate layer. Exemplarily, the native layer refers to the part of the hybrid module developed for a specific operating system, and the hybrid module can send information to other modules through the native layer, or receive information from other modules; the intermediate layer is used to realize the interaction between the script layer and the native layer. Specifically, the intermediate layer can send information to the native layer and the script layer or receive information sent by the native layer and the script layer by injecting objects through jsbridge. Of course, it is not limited to this, and the intermediate layer can also be implemented in other ways, which is not limited here.
[0034] Exemplarily, an application program including native modules and hybrid modules can combine the advantages of native modules and hybrid modules, thereby reducing the application development cost while maximizing the user experience.
[0035] In some embodiments, obtaining identification information of the first submodule and the second submodule in order to register the first submodule and the second submodule includes: obtaining annotations of the first submodule and the second submodule, and parsing the annotations through an annotation processor; if the annotations are consistent with a preset metacode, obtaining identification information of the first submodule and the second submodule.
[0036] Exemplarily, the submodules in the application need to be pre-registered with the routing communication module so that the interaction between the submodules can be realized through the routing communication module. The submodules that are not registered in the routing communication module are automatically registered by adding annotations, which reduces the complexity of application development and improves development efficiency.
[0037] Exemplarily, during the application development process, the developer can add annotations to the submodules that need to be registered in the communication framework server so that the communication framework server automatically registers the submodules according to the annotations. In some embodiments, the annotations can be predefined metacodes that the communication framework server can recognize.
[0038] Exemplarily, parsing the annotations may be achieved through an annotation processor (APT, Annotation Processing Tool), which can automatically process annotations in module code during compilation and parse the annotations.
[0039] Exemplarily, if the code obtained by the annotation processor parsing the annotation is consistent with the preset meta-code, the communication framework server can automatically obtain the registration information of the sub-module.
[0040] In some embodiments, if the annotation is consistent with a preset metacode, obtaining identification information of the first submodule and the second submodule includes: if the annotation is consistent with a preset metacode, obtaining the module name of the first submodule and the second submodule; and / or if the annotation is consistent with a preset metacode, obtaining the module URL of the first submodule and the second submodule.
[0041] Exemplarily, by processing the annotations of the module code through the annotation processor, quick registration of each sub-module is achieved, which saves the time of registering the sub-modules separately and improves the development efficiency of the application.
[0042] Exemplarily, the identification information may be a module name or a module URL, or a module name and a module URL. A submodule is determined by the module name and the module URL, which is not limited here.
[0043] Step S102: Acquire first target information sent by the first submodule, where the first target information includes target identification information.
[0044] In some implementations, the application further includes a target service identification module, the first target information may be a call request for invoking a target service, and the target identification information may be a target service module identification, wherein the target service module is used to implement the target service.
[0045] In some implementations, the first target information includes target data and preset data protocol information, and the data protocol information can indicate a submodule that receives the target data.
[0046] In some embodiments, the first submodule includes a hybrid layer, an intermediate layer, and a native layer, and obtaining the first target information sent by the first submodule includes: obtaining the first target information sent by the native layer, wherein the first target information is sent from the hybrid layer to the native layer through the intermediate layer.
[0047] Exemplarily, when the first submodule is a hybrid module, since the hybrid layer cannot send information directly to other modules, the first target information of the hybrid layer needs to be sent to the native layer through the intermediate layer so that the native layer sends the first target information to the routing communication module.
[0048] Step S103: When the target identification information is used to indicate the second submodule, the first target information is sent to the second submodule.
[0049] In some embodiments, the application also includes a target service module, and when the first target information is a call request for calling a target service, the target identification information includes identification information of the target service module, and when the target identification information is used to indicate the second sub-module, sending the first target information to the second sub-module includes: determining the second sub-module corresponding to the target service module according to the identification information of the target service module, the second sub-module depending on the target service module; sending the first target information to the second sub-module so that the second sub-module sends the first target information to the target service module and obtains the second target information determined by the target service module based on the first target information.
[0050] Exemplarily, the routing communication module stores a mapping relationship table for determining dependencies between modules. For example, if the second submodule depends on the target service module, the mapping relationship between the module identifier of the target service module and the module identifier of the second submodule is saved in the mapping relationship table of the routing communication module.
[0051] Exemplarily, when the first target information includes identification information of the target service module, the routing communication module can determine the second sub-module corresponding to the target service module by searching the mapping relationship table, and send the first target information to the second sub-module, so that the second sub-module sends the first target information to the target service module and obtains the second target information determined by the target service module based on the first target information.
[0052] For example, if the target service is a face recognition service and the target service module is a face recognition module, the face recognition module can send the face recognition result, such as recognition success or recognition failure, to the second sub-module so that the second sub-module returns the face recognition result to the first sub-module through the routing communication module.
[0053] Exemplarily, forwarding the target service result through the second submodule can reduce the coupling between various modules of the application program and improve the stability of the application program.
[0054] In some embodiments, the first target information includes target data and preset data protocol information; when the target identification information is used to indicate the second submodule, the first target information is sent to the second submodule, including: determining the target module corresponding to the target data according to the data protocol information; when the target module is the second submodule, sending the target data to the second submodule so that the second submodule receives the target data and determines the second target information.
[0055] Exemplarily, the first submodule may be a hybrid module, the target data may be data distributed by the first submodule to other modules, and identification information of a module receiving the target data may be determined according to the data protocol information.
[0056] Exemplarily, the data protocol information is as follows: Figure 3 As shown, scheme is used to represent the name of the data protocol, which is a fixed part in the data protocol information; target identification information is used to represent the identification information of the module receiving the target data, such as the module name and / or module URL of the target module, which is not limited here; method is used to represent the method (method) adopted by the target module to process the target data, and a module may include at least one method; parameter is used to represent the parameter passed by the hybrid module to the target module, and the meaning of the parameter can be preset according to actual needs.
[0057] Step S104: Acquire second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule.
[0058] In some implementations, the second target information may be the target service result. The routing communication module obtains the target service result sent by the second submodule, and forwards the target service result to the first submodule. The target service result is obtained by the target service module based on the internal logic according to the first target information and sent to the second submodule.
[0059] In some embodiments, the second target information may be feedback information generated by the second submodule based on the first target information, and obtaining the second target information generated by the second submodule based on the first target information, and sending the second target information to the first submodule includes: obtaining the second target information determined by the second submodule based on the receiving status of the target data, and sending the second target information to the first submodule, so that the first submodule determines the receiving status of the target data, wherein the receiving status includes successful reception and failed reception.
[0060] Exemplarily, the second submodule determines the second target information based on the reception status of the target data. The reception status may be successful reception or failed reception. The reception status of the second target information may be represented by preset parameters. For example, parameter 0 may represent successful reception of the target data, and parameter 1 may represent failed reception of the target data. Of course, this is not limited to this.
[0061] Exemplarily, the first submodule may determine the receiving state of the target data according to the second target information, and perform corresponding operations according to the receiving state. For example, if the target data fails to be received, the first submodule may send the target data to the second submodule again.
[0062] The modular operation method of the application provided in the above embodiment obtains the identification information of the first submodule and the identification information of the second submodule so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module; obtains the first target information sent by the first submodule, the first target information includes target identification information; when the target identification information is used to indicate the second submodule, the first target information is sent to the second submodule; obtains the second target information obtained by the second submodule according to the first target information, and sends the second target information to the first submodule; wherein the native module is a submodule developed for the operating system running the application; and the hybrid module is a submodule developed by the Web programming language. The registration and interaction problems of each module during the modular development of the application are solved, and the development efficiency of the modular development of the application is improved.
[0063] See also Figure 4 , Figure 4 It is a schematic diagram of an application modular operation device provided in an embodiment of the present application. The application modular operation device can be configured in a server or a terminal to execute the aforementioned application modular operation method.
[0064] like Figure 4As shown, the modular operation device of the application includes: an initialization module 110, a first information acquisition module 120, a first information forwarding module 130, and a second information forwarding module 140.
[0065] An initialization module 110, configured to obtain identification information of the first submodule and identification information of the second submodule, so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module;
[0066] A first information acquisition module 120, configured to acquire first target information sent by the first submodule, wherein the first target information includes target identification information;
[0067] A first information forwarding module 130, configured to send the first target information to the second submodule when the target identification information is used to indicate the second submodule;
[0068] The second information forwarding module 140 is used to obtain second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule.
[0069] Exemplarily, the first information forwarding module 130 includes a module information determination submodule and a first information forwarding submodule.
[0070] The module information determining submodule is used to determine a second submodule corresponding to the target service module according to the identification information of the target service module, wherein the second submodule depends on the target service module.
[0071] The first information forwarding submodule is used to send the first target information to the second submodule, so that the second submodule sends the first target information to the target service module and obtains the second target information determined by the target service module according to the first target information.
[0072] Exemplarily, the first information forwarding module 130 includes a data protocol parsing submodule and a target data sending submodule.
[0073] The data protocol parsing submodule is used to determine the target module corresponding to the target data according to the data protocol information.
[0074] The target data sending submodule is used to send the target data to the second submodule when the target module is the second submodule, so that the second submodule receives the target data and determines the second target information.
[0075] Exemplarily, the second information forwarding module 140 includes a receiving state determination module.
[0076] A receiving status determination module is used to obtain the second target information determined by the second submodule according to the receiving status of the target data, and send the second target information to the first submodule so that the first submodule can determine the receiving status of the target data, wherein the receiving status includes successful reception and failed reception.
[0077] Exemplarily, the first information acquisition module 120 includes a native layer interaction submodule.
[0078] The native layer interaction submodule is used to obtain the first target information sent by the native layer, wherein the first target information is sent from the hybrid layer to the native layer through the intermediate layer.
[0079] Exemplarily, the initialization module 110 includes an annotation parsing submodule and an identification information acquisition submodule.
[0080] The annotation parsing submodule is used to obtain the annotations of the first submodule and the second submodule, and parse the annotations through an annotation processor.
[0081] The identification information acquisition submodule is used to acquire the identification information of the first submodule and the second submodule if the annotation is consistent with the preset meta-code.
[0082] Exemplarily, the identification information acquisition submodule includes a module name acquisition submodule and a module URL acquisition submodule.
[0083] The module name acquisition submodule is used to acquire the module names of the first submodule and the second submodule if the annotation is consistent with the preset metacode.
[0084] The module URL acquisition submodule is used to acquire the module URLs of the first submodule and the second submodule if the annotation is consistent with the preset meta code.
[0085] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0086] The method and apparatus of the present application can be used in many general or special computing system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0087] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in Figure 5 Runs on the computer device shown.
[0088] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in Figure 5 Runs on the computer device shown.
[0089] See also Figure 5 , Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server or a terminal.
[0090] like Figure 5 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a storage medium and an internal memory.
[0091] The storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any application modular operation method.
[0092] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0093] The internal memory provides an environment for the operation of the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any application modular operation method.
[0094] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0095] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0096] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0097] Acquire identification information of the first submodule and identification information of the second submodule, so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module;
[0098] Acquire first target information sent by the first submodule, where the first target information includes target identification information;
[0099] When the target identification information is used to indicate the second submodule, sending the first target information to the second submodule;
[0100] Acquire second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule;
[0101] The native module is a submodule developed for the operating system running the application; the hybrid module is a submodule including a part developed by a Web programming language.
[0102] In one embodiment, when the processor implements the step of sending the first target information to the second submodule when the target identification information is used to indicate the second submodule, the processor implements:
[0103] Determining, according to the identification information of the target service module, a second submodule corresponding to the target service module, wherein the second submodule depends on the target service module;
[0104] The first target information is sent to the second submodule, so that the second submodule sends the first target information to the target service module and obtains second target information determined by the target service module according to the first target information.
[0105] In one embodiment, when the processor implements the step of sending the first target information to the second submodule when the target identification information is used to indicate the second submodule, the processor implements:
[0106] Determine a target module corresponding to the target data according to the data protocol information;
[0107] When the target module is the second submodule, the target data is sent to the second submodule so that the second submodule receives the target data and determines the second target information.
[0108] In one embodiment, when the processor implements the acquiring of the second target information generated by the second submodule according to the first target information and sending the second target information to the first submodule, it is configured to implement:
[0109] The second target information determined by the second submodule according to the receiving status of the target data is obtained, and the second target information is sent to the first submodule so that the first submodule determines the receiving status of the target data, wherein the receiving status includes receiving success and receiving failure.
[0110] In one embodiment, when the processor implements the acquiring of the first target information sent by the first submodule, the processor is used to implement:
[0111] The first target information sent by the native layer is obtained, wherein the first target information is sent from the hybrid layer to the native layer through the intermediate layer.
[0112] In one embodiment, when the processor implements the acquiring of identification information of the first submodule and the second submodule so as to register the first submodule and the second submodule, it is configured to implement:
[0113] Obtaining annotations of the first submodule and the second submodule, and parsing the annotations through an annotation processor;
[0114] If the annotation is consistent with the preset meta-code, identification information of the first sub-module and the second sub-module is obtained.
[0115] It should be noted that technical personnel in the relevant field can clearly understand that, for the convenience and conciseness of description, the specific working process of the modular operation of the application described above can refer to the corresponding process in the aforementioned application modular operation control method embodiment, and will not be repeated here.
[0116] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the modular operation method of the application program of the present application.
[0117] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0118] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0119] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0120] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A modular operation method for an application, wherein the application comprises a first submodule and a second submodule, characterized in that: The method comprises: Acquire identification information of the first submodule and identification information of the second submodule, so as to register the first submodule and the second submodule, wherein one of the first submodule and the second submodule is a native module and the other is a hybrid module; Acquire first target information sent by the first submodule, where the first target information includes target identification information; When the target identification information is used to indicate the second submodule, sending the first target information to the second submodule; Acquire second target information obtained by the second submodule according to the first target information, and send the second target information to the first submodule; Wherein, the native module is a submodule developed for the operating system running the application; the hybrid module is a submodule developed by using a Web programming language; The first target information includes target data and preset data protocol information; when the target identification information is used to indicate the second submodule, sending the first target information to the second submodule includes: Determine a target module corresponding to the target data according to the data protocol information; When the target module is the second submodule, sending the target data to the second submodule so that the second submodule receives the target data and determines the second target information; The first submodule includes a hybrid layer, an intermediate layer, and a native layer, and the obtaining of the first target information sent by the first submodule includes: Acquire the first target information sent by the native layer, wherein the first target information is sent by the hybrid layer to the native layer through the intermediate layer; Wherein, when the first submodule is a hybrid module, the first target information of the hybrid layer is sent to the native layer through the intermediate layer, so that the native layer sends the first target information to the routing communication module.
2. The modular operation method of application according to claim 1, characterized in that: The application further includes a target service module, and the target identification information includes identification information of the target service module; When the target identification information is used to indicate the second submodule, sending the first target information to the second submodule includes: Determining, according to the identification information of the target service module, a second submodule corresponding to the target service module, wherein the second submodule depends on the target service module; The first target information is sent to the second submodule, so that the second submodule sends the first target information to the target service module and obtains second target information determined by the target service module according to the first target information.
3. The modular operation method of application according to claim 1, characterized in that: The acquiring the second target information generated by the second submodule according to the first target information, and sending the second target information to the first submodule includes: The second target information determined by the second submodule according to the receiving status of the target data is obtained, and the second target information is sent to the first submodule so that the first submodule determines the receiving status of the target data, wherein the receiving status includes receiving success and receiving failure.
4. The modular operation method of an application according to any one of claims 1 to 3, characterized in that: The acquiring identification information of the first submodule and the second submodule so as to register the first submodule and the second submodule includes: Obtaining annotations of the first submodule and the second submodule, and parsing the annotations through an annotation processor; If the annotation is consistent with the preset meta-code, identification information of the first sub-module and the second sub-module is obtained.
5. The modular operation method of application according to claim 4, characterized in that: If the annotation is consistent with the preset meta-code, obtaining identification information of the first sub-module and the second sub-module includes: If the annotation is consistent with the preset meta-code, obtaining the module names of the first sub-module and the second sub-module; and / or If the annotation is consistent with the preset meta code, the module URLs of the first submodule and the second submodule are obtained.
6. A modular application running device, characterized in that: The application modular operation device is used to implement the application modular operation method described in any one of claims 1-5.
7. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the application modular operation method as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the modular application operation method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Applet running method and device, electronic equipment and storage medium
CN112433788A
Application processing method and apparatus, computer device, and computer readable storage medium
WO2020093208A1