Development method and device of cross-platform mobile APP
Patent Information
- Application Number
- CN202211048356.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2042-08-30
AI Technical Summary
[0004]综上所述,目前技术主要面临的问题升级过程繁琐、周期长、成本高以及代码量大的问题
[0014]采用本发明实施例,跨平台移动APP的业务模块发布快,升级快,删除快,业务模块之间解耦合,不需要重新发布APP就能满足所有的平台和场景。
Smart Images

Figure CN115408028B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of mobile terminal technology, and in particular to a method and apparatus for developing cross-platform mobile apps. Background Technology
[0002] In existing technologies, due to the complexity and diversity of mobile APP platforms, cross-platform mobile APP development often requires the design of many different business functions. For example, when developing a mobile application, it is necessary to design multiple business modules such as tasks, scenarios, and functions across platforms. If each business module needs to delete or add some business modules during the iterative upgrade process, and if each business module is upgraded and iterated very frequently and there are reference relationships between modules, then it becomes very necessary to achieve rapid updates of module iterations and reduce the impact of modifications and adjustments to business modules on other business modules.
[0003] Currently, the management of business modules in cross-platform mobile apps involves pre-writing each module and providing it to other business applications. These other modules only need to reference the corresponding external interfaces. If a module needs iteration, the app must be re-released, upgraded, and installed. Furthermore, dependencies between business modules require a complete app upgrade to reduce reliance and enable use. If a business module is deleted or updated, the code modifications are substantial, and the upgrade process is cumbersome. Therefore, improving the management of business modules in mobile apps, reducing coupling between modules, and increasing efficiency while reducing costs are the key issues that need to be addressed in this scenario.
[0004] In summary, the main problems currently facing the technology are the cumbersome upgrade process, long cycle, high cost, and large amount of code. Summary of the Invention
[0005] The purpose of this invention is to provide a method and apparatus for developing cross-platform mobile apps, aiming to solve the aforementioned problems in the prior art.
[0006] This invention provides a method for developing cross-platform mobile apps, comprising:
[0007] Step 1: Package multiple business modules in a cross-platform mobile APP with predefined access interfaces into multiple module files, upload them to the management platform, and record the business module information.
[0008] Step 2: Access the access interface through the cross-platform mobile APP to obtain a list of business module information and obtain the viewable business modules based on the list of business module information. Select the current business module. If it is determined that the cross-platform mobile APP does not have the current business module, automatically download the module file of the current business module, save the business module information, and store the module file in the sandbox area business module directory of the cross-platform mobile APP.
[0009] Step 3: When it is necessary to update and modify the current business module, repackage the modified business module into a module file, upload the new module file to the management platform, and update the business module version number and business module update content in the business module information.
[0010] This invention provides a cross-platform mobile app development apparatus, comprising:
[0011] The packaging and uploading module is used to package multiple business modules in a cross-platform mobile APP with predefined access interfaces into multiple module files, upload them to the management platform, and record the business module information.
[0012] The download module is used to access the access interface through a cross-platform mobile APP, obtain a list of business module information, obtain viewable business modules based on the list of business module information, select the current business module, and automatically download the module file of the current business module when it is determined that the cross-platform mobile APP does not have the current business module, save the business module information, and store the module file in the sandbox area business module directory of the cross-platform mobile APP.
[0013] The update module is used to repackage the modified business module into a module file, upload the new module file to the management platform, and update the business module version number and update content in the business module information when the current business module needs to be updated and modified.
[0014] Using the embodiments of the present invention, the business modules of cross-platform mobile apps can be released, upgraded, and deleted quickly. The business modules are decoupled from each other, and the app can meet the needs of all platforms and scenarios without needing to be re-released. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of a cross-platform mobile app development method according to an embodiment of the present invention;
[0017] Figure 2 This is a schematic diagram of a cross-platform mobile APP development apparatus according to an embodiment of the present invention;
[0018] Figure 3 This is a flowchart of loading the target business module according to an embodiment of the present invention. Detailed Implementation
[0019] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0020] Method Implementation Examples
[0021] According to an embodiment of the present invention, a method for developing a cross-platform mobile app is provided. Figure 1 This is a flowchart of a cross-platform mobile app development method according to an embodiment of the present invention, such as... Figure 1 As shown, the cross-platform mobile app development method according to an embodiment of the present invention specifically includes:
[0022] Step 101: Package multiple business modules in a cross-platform mobile APP with predefined access interfaces into multiple module files, upload them to the management platform, and record the business module information.
[0023] Step 102: Access the access interface through the cross-platform mobile APP to obtain a list of business module information and, based on the list, obtain the viewable business modules. Select the current business module. If it is determined that the cross-platform mobile APP does not have the current business module, automatically download the module file of the current business module and save the business module information. Store the module file in the business module directory of the sandbox area of the cross-platform mobile APP. In this embodiment of the invention, the business module information specifically includes: a unique identifier for the business module, the name of the business module, the version number of the business module, and the update content of the business module.
[0024] Step 102 specifically includes the following processing:
[0025] Obtain a list of business module information, convert the obtained list of business module information into a list of JSON objects, and store the list of JSON objects in the terminal memory;
[0026] Iterate through the list of JSON objects in memory, display the information of each JSON object, and convert this information into a viewable business module.
[0027] Select one of the business modules as the current business module, check whether the cross-platform mobile APP already has the module file of the current business module, and if it is determined that the module file does not exist, automatically download the module file of the current business module, and download and store the module file in the sandbox area of the mobile APP via HTTP protocol, and save the business module name, business module version number and business module unique identifier in the business module information to the management platform.
[0028] Release the currently selected module file using the UNIAPP open-source tool for cross-platform mobile apps, and store the released module file in the business module directory of the sandbox area of the cross-platform mobile app.
[0029] Open the business module directory to browse and view the contents of the business modules.
[0030] Step 103: When it is necessary to update and modify the current business module, repackage the modified business module into a module file, upload the new module file to the management platform, and update the business module version number and business module update content in the business module information.
[0031] The above method further includes:
[0032] Close the current business module and select a new business module. Access the predefined access interface to obtain the business module information of the business module. Convert the business module information into a JSON object and obtain the unique identifier and version number of the business module in the JSON object. Determine whether the version number of the business module is the same as the version number of the current business module stored in the terminal's local management file. If the version number of the current business module stored in the terminal's local management file is lower than the version number of the business module, determine to download the business module file again.
[0033] The downloaded new module file overwrites the local module file in the cross-platform mobile app, and the new module file is then released to the local business module directory of the cross-platform mobile app.
[0034] Open the business module directory file using the UNIAPP open-source tool for cross-platform mobile apps to browse and view new content in the business module;
[0035] When it is necessary to delete the business module, the pre-defined business module is deleted in the management platform, the business module is closed, the access interface of multiple business modules is accessed again, the current business module information list is traversed, and if the business module is not detected, the local business module directory of the cross-platform mobile APP is automatically deleted.
[0036] When a new business module needs to be added, a new business module is predefined, and the access interface of the new business module is predefined. The new business module is packaged into a module file, uploaded to the management platform, and step 102 is executed.
[0037] The technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0038] In a first aspect, embodiments of the present invention provide a method for managing business modules of a cross-platform mobile app, which improves efficiency and reduces costs.
[0039] The cross-platform mobile app is pre-divided into multiple business modules;
[0040] Predefine access interfaces for multiple business modules;
[0041] Package multiple business modules into multiple module files;
[0042] Upload multiple module files to the management platform;
[0043] For multiple uploaded module files, you need to fill in a unique identifier, business module name, business module version number, and business module update content;
[0044] Launch the cross-platform mobile app and access the access interface that is pre-divided into multiple business modules;
[0045] The interface is used to obtain the unique identifier, name, and version number of the business module for multiple module files.
[0046] The obtained list of business module information is converted into a list of JSON objects, and the list of objects is stored in the phone's memory;
[0047] Iterate through the list of JSON objects in memory and display the information of each JSON object, converting it into a viewable business module.
[0048] Click to select one of the business modules. If the mobile app does not contain the file for that business module, such as... Figure 3 As shown, the current business module is automatically downloaded, and the file is downloaded and stored in the sandbox area of the mobile app via the HTTP protocol. The business module name, business module version number, and business module unique identifier are also saved in the management file.
[0049] The currently selected module file is released using the uniapp open-source tool for cross-platform mobile apps, and the package file is released and stored in the business module directory of the sandbox area of the cross-platform mobile app.
[0050] Open the business module directory to browse and view the contents of the aforementioned business modules;
[0051] To update or modify the current business module, simply repackage the modified business module into a module file, upload the new module file to the management platform, and do not modify the unique identifier and business package name of the new module file. Only the version number and update content of the business package need to be added.
[0052] Close the currently described business module and click on the business module again. Access the pre-defined business module interface to obtain the information of the business module. Convert the information into a JSON object and obtain the unique identifier and version number of the business module in the JSON object. Compare the version number of the business module with the version number of the current business module stored in the local management file of the mobile phone. If the version number of the current business module stored in the local management file of the mobile phone is lower than the version number of the business module, the business module file needs to be downloaded again.
[0053] Repeat the above process of downloading module files, download new module files to overwrite the module files on the mobile app, and release the new module files to the business module directory on the mobile app.
[0054] The business module directory file can be opened and new content of the business module can be viewed by using the uniapp open-source tool for cross-platform mobile apps, thereby solving the problem of updating the business module.
[0055] Regarding the deletion of the aforementioned business module, we need to delete the pre-defined business module in the management platform, close the currently defined business module, access the access interface of multiple business modules again, traverse the current business module information list, and if the currently defined business module is not detected, automatically delete the local business module directory of the cross-platform mobile app to achieve dynamic management of business module deletion.
[0056] To add a new business module, repeat the above method to predefine a new business module and its access interface. Package the new business module into a module file, upload it to the management platform, and repeat the methods of accessing the interface and downloading the module file to add a new business module.
[0057] It should be noted that in the implementation of this invention, hotfix technology and plug-in technology can be used to upgrade and install mobile APP applications, hybrid technologies such as React Native and Weex can be used to upgrade and install APP, new versions of APP can be released using native code to upgrade and install APP, and H5 webpages can be loaded using a browser.
[0058] System Implementation Examples
[0059] According to an embodiment of the present invention, a cross-platform mobile app development apparatus is provided. Figure 2 This is a schematic diagram of a cross-platform mobile app development apparatus according to an embodiment of the present invention, such as... Figure 2 As shown, the cross-platform mobile app development apparatus according to an embodiment of the present invention specifically includes:
[0060] The packaging and uploading module 20 is used to package multiple business modules in a cross-platform mobile APP with predefined access interfaces into multiple module files, upload them to the management platform, and record the business module information.
[0061] Download module 22 is used to access the access interface through a cross-platform mobile APP, obtain a list of business module information, and obtain viewable business modules based on the list of business module information. It selects the current business module, and if it is determined that the cross-platform mobile APP does not have the current business module, it automatically downloads the module file of the current business module, saves the business module information, and stores the module file in the sandbox area business module directory of the cross-platform mobile APP. The business module information specifically includes: a unique identifier for the business module, the business module name, the business module version number, and the business module update content.
[0062] The download module 22 is specifically used for:
[0063] Obtain a list of business module information, convert the obtained list of business module information into a list of JSON objects, and store the list of JSON objects in the terminal memory;
[0064] Iterate through the list of JSON objects in memory, display the information of each JSON object, and convert this information into a viewable business module.
[0065] Select one of the business modules as the current business module, check whether the cross-platform mobile APP already has the module file of the current business module, and if it is determined that the module file does not exist, automatically download the module file of the current business module, and download and store the module file in the sandbox area of the mobile APP via HTTP protocol, and save the business module name, business module version number and business module unique identifier in the business module information to the management platform.
[0066] Release the currently selected module file using the UNIAPP open-source tool for cross-platform mobile apps, and store the released module file in the business module directory of the sandbox area of the cross-platform mobile app.
[0067] Open the business module directory to browse and view the contents of the business modules.
[0068] The update module 24 is used to repackage the modified business module into a module file, upload the new module file to the management platform, and update the business module version number and business module update content in the business module information when the current business module needs to be updated and modified.
[0069] The update module 24 is further used for:
[0070] Close the current business module and select a new business module. Access the predefined access interface to obtain the business module information of the business module. Convert the business module information into a JSON object and obtain the unique identifier and version number of the business module in the JSON object. Determine whether the version number of the business module is the same as the version number of the current business module stored in the terminal's local management file. If the version number of the current business module stored in the terminal's local management file is lower than the version number of the business module, determine to download the business module file again.
[0071] The downloaded new module file overwrites the local module file in the cross-platform mobile app, and the new module file is then released to the local business module directory of the cross-platform mobile app.
[0072] Open the business module directory file using the UNIAPP open-source tool for cross-platform mobile apps to browse and view new content in the business module;
[0073] When it is necessary to delete the business module, the pre-defined business module is deleted in the management platform, the business module is closed, the access interface of multiple business modules is accessed again, the current business module information list is traversed, and if the business module is not detected, the local business module directory of the cross-platform mobile APP is automatically deleted.
[0074] When a new business module needs to be added, a new business module is predefined, and the access interface of the new business module is predefined. The new business module is packaged into a module file, uploaded to the management platform, and the download module 22 is called.
[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for developing a cross-platform mobile app, characterized in that, include: Step 1: Package multiple business modules in a cross-platform mobile APP with predefined access interfaces into multiple module files, upload them to the management platform, and record the business module information. Step 2: Access the access interface through the cross-platform mobile APP to obtain a list of business module information and obtain the viewable business modules based on the list of business module information. Select the current business module. If it is determined that the cross-platform mobile APP does not have the current business module, automatically download the module file of the current business module, save the business module information, and store the module file in the sandbox area business module directory of the cross-platform mobile APP. Step 3: When it is necessary to update and modify the current business module, repackage the modified business module into a module file, upload the new module file to the management platform, and update the business module version number and business module update content in the business module information. Close the current business module and select a new business module. Access the predefined access interface to obtain the business module information of the business module. Convert the business module information into a JSON object and obtain the unique identifier and version number of the business module in the JSON object. Determine whether the version number of the business module is the same as the version number of the current business module stored in the terminal's local management file. If the version number of the current business module stored in the terminal's local management file is lower than the version number of the business module, determine to download the business module file again. The downloaded new module file overwrites the local module file in the cross-platform mobile app, and the new module file is then released to the local business module directory of the cross-platform mobile app. Open the business module directory file using the UNIAPP open-source tool for cross-platform mobile apps to browse and view new content in the business module; When it is necessary to delete the business module, the pre-defined business module is deleted in the management platform, the business module is closed, the access interface of multiple business modules is accessed again, the current business module information list is traversed, and if the business module is not detected, the local business module directory of the cross-platform mobile APP is automatically deleted. When a new business module needs to be added, a new business module is predefined, and the access interface of the new business module is predefined. The new business module is packaged into a module file, uploaded to the management platform, and step 2 is executed.
2. The method according to claim 1, characterized in that, The business module information specifically includes: the unique identifier of the business module, the name of the business module, the version number of the business module, and the update content of the business module.
3. The method according to claim 1, characterized in that, Obtaining a list of business module information and, based on that list, retrieving viewable business modules specifically includes: Obtain a list of business module information, convert the obtained list of business module information into a list of JSON objects, and store the list of JSON objects in the terminal memory; Iterate through the list of JSON objects in memory, display the information of each JSON object, and convert this information into a viewable business module.
4. The method according to claim 1, characterized in that, Selecting the current business module, if it is determined that the cross-platform mobile app does not have the current business module, automatically downloading the module file of the current business module, saving the business module information, and storing the module file in the business module directory of the cross-platform mobile app's sandbox area specifically includes: Select one of the business modules as the current business module, check whether the cross-platform mobile APP already has the module file of the current business module, and if it is determined that the module file does not exist, automatically download the module file of the current business module, and download and store the module file in the sandbox area of the mobile APP via HTTP protocol, and save the business module name, business module version number and business module unique identifier in the business module information to the management platform. Release the currently selected module file using the UNIAPP open-source tool for cross-platform mobile apps, and store the released module file in the business module directory of the sandbox area of the cross-platform mobile app. Open the business module directory to browse and view the contents of the business modules.
5. A cross-platform mobile app development device, characterized in that, include: The packaging and uploading module is used to package multiple business modules in a cross-platform mobile APP with predefined access interfaces into multiple module files, upload them to the management platform, and record the business module information. The download module is used to access the access interface through a cross-platform mobile APP, obtain a list of business module information, obtain viewable business modules based on the list of business module information, select the current business module, and automatically download the module file of the current business module when it is determined that the cross-platform mobile APP does not have the current business module, save the business module information, and store the module file in the sandbox area business module directory of the cross-platform mobile APP. The update module is used to repackage the modified business module into a module file, upload the new module file to the management platform, and update the business module version number and business module update content in the business module information when the current business module needs to be updated and modified. The update module is further used for: Close the current business module and select a new business module. Access the predefined access interface to obtain the business module information of the business module. Convert the business module information into a JSON object and obtain the unique identifier and version number of the business module in the JSON object. Determine whether the version number of the business module is the same as the version number of the current business module stored in the terminal's local management file. If the version number of the current business module stored in the terminal's local management file is lower than the version number of the business module, determine to download the business module file again. The downloaded new module file overwrites the local module file in the cross-platform mobile app, and the new module file is then released to the local business module directory of the cross-platform mobile app. Open the business module directory file using the UNIAPP open-source tool for cross-platform mobile apps to browse and view new content in the business module; When it is necessary to delete the business module, the pre-defined business module is deleted in the management platform, the business module is closed, the access interface of multiple business modules is accessed again, the current business module information list is traversed, and if the business module is not detected, the local business module directory of the cross-platform mobile APP is automatically deleted. When a new business module needs to be added, a new business module is predefined, and the access interface of the new business module is predefined. The new business module is packaged into a module file, uploaded to the management platform, and the download module is called.
6. The apparatus according to claim 5, characterized in that, The business module information specifically includes: the unique identifier of the business module, the name of the business module, the version number of the business module, and the update content of the business module.
7. The apparatus according to claim 5, characterized in that, The download module is specifically used for: Obtain a list of business module information, convert the obtained list of business module information into a list of JSON objects, and store the list of JSON objects in the terminal memory; Iterate through the list of JSON objects in memory, display the information of each JSON object, and convert this information into a viewable business module.
8. The apparatus according to claim 5, characterized in that, The download module is specifically used for: Select one of the business modules as the current business module, check whether the cross-platform mobile APP already has the module file of the current business module, and if it is determined that the module file does not exist, automatically download the module file of the current business module, and download and store the module file in the sandbox area of the mobile APP via HTTP protocol, and save the business module name, business module version number and business module unique identifier in the business module information to the management platform. Release the currently selected module file using the UNIAPP open-source tool for cross-platform mobile apps, and store the released module file in the business module directory of the sandbox area of the cross-platform mobile app. Open the business module directory to browse and view the contents of the business modules.
Citation Information
Patent Citations
Cross-platform honeycomb engine system and development method thereof
CN106959843A