Application loading method and system and electronic equipment
By decoupling application configuration, the network mode parameters and login configuration data are used to achieve compatibility between online mode and offline mode, solving the problem of difficult applications in the prior art and reducing development and maintenance costs.
Patent Information
- Application Number
- CN202410157138.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2025-08-05
AI Technical Summary
In the prior art, the same mobile application is difficult to be compatible with both online and offline modes, resulting in the need for redevelopment, increasing R&D costs and maintenance difficulties, and unable to meet customized needs.
By decoupling the application configuration from the application itself, using network mode parameters to determine the loading mode, and determining whether to update the local configuration through the login page and configuration data, generating page configuration parameters, and finally achieving compatibility between online and offline modes.
It realizes compatibility between the online and offline modes of the same application, and does not require additional development, reduces R&D and maintenance costs, and improves application flexibility and adaptability.
Smart Images

Figure CN120429028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of application loading, and in particular to an application loading method, system and electronic equipment. Background Art
[0002] With the development of internet technology, mobile office systems have become an indispensable tool for enterprises. Currently, there are two main delivery and usage models for mobile application services: the traditional offline model, where the entire service is deployed in a private data center to enable network interaction; and the online SaaS (Software as a Service) model, where services are deployed in the cloud and users access corresponding network functions and services as tenants.
[0003] Due to the varying nature and needs of different customers, the same mobile application may require different delivery / usage models for different clients. For example, service providers with strict data security requirements will choose an offline model, which requires high hardware costs to build offline servers; whereas cost-sensitive service providers will choose an online model to minimize service fees. However, within the same application category, these two models need to be integrated, resulting in the need to switch between the two modes within the same application. In real-world scenarios, these applications only need to consider one service model and are not compatible with both online and offline modes. Therefore, achieving these functions is difficult and requires redevelopment. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide an application loading method, system and electronic device, which decouples the application configuration from the application itself, is compatible with both online and offline mode servers, and no longer requires additional development of the application, thereby solving the above-mentioned problems existing in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides an application loading method, the method comprising:
[0006] After detecting the application startup instruction, the network loading mode of the application is determined using the network mode parameters of the application; wherein the network loading mode includes: online mode and offline mode;
[0007] Obtain the login page corresponding to the network loading mode, send a login request to the application's login interface based on the login information entered in the login page, and determine whether the login process corresponding to the login information is successful based on the login response data received from the login interface;
[0008] If the login is successful, the login configuration data and configuration flag bit contained in the login response data are obtained, and the configuration flag bit is determined to be empty;
[0009] If yes, then the page configuration parameters are generated based on the local configuration data included in the application; if no, then the page configuration parameters are generated after updating the local configuration data based on the login configuration data;
[0010] Use the page configuration parameters to render and load the application's homepage.
[0011] In one embodiment, after detecting an application startup instruction, the step of determining the network loading mode of the application using the network mode parameters of the application includes:
[0012] After monitoring the application startup command in real time, obtain the corresponding startup quantity parameters in the application;
[0013] Determine whether the application is opened for the first time based on the startup quantity parameter;
[0014] If yes, the network connection status of the application is determined using the network configuration parameters, and the network loading mode is determined based on the network connection status.
[0015] In one embodiment, the steps of determining the network connection status of the application using network configuration parameters and determining the network loading mode based on the network connection status include:
[0016] Obtain the network parameters and network interface included in the network configuration parameters, and determine whether the network parameters can make a network request to the network interface;
[0017] If yes, then determine the online mode parameters corresponding to the application based on the geographic information of the application; if not, use a network probe to obtain the local area network information of the application, and determine the offline mode parameters corresponding to the application based on the local area network information;
[0018] The network loading mode of the application is determined according to the online mode parameters and the offline mode parameters; wherein the online mode parameters are used to determine the online mode, and the offline mode parameters are used to determine the offline mode.
[0019] In one embodiment, using a network probe to obtain local area network information of an application, and determining offline mode parameters corresponding to the application based on the local area network information, includes:
[0020] Get the request instruction corresponding to the network probe and obtain the device information corresponding to the application;
[0021] Using the request instruction to obtain the local area network information contained in the device information, and determining the local area network name corresponding to the local area network information;
[0022] After formatting the LAN name that meets the preset naming relationship, the network address corresponding to the LAN name is obtained;
[0023] Generate a response instruction corresponding to the network probe according to the network address, and determine the offline mode parameters corresponding to the response instruction.
[0024] In one embodiment, after formatting a local area network name that satisfies a preset naming relationship, the step of obtaining a network address corresponding to the local area network name includes:
[0025] Obtaining a first character string corresponding to the local area network name, and determining a target character string included in the naming relationship;
[0026] For a first character string containing a target character string, after removing the target character string from the first character string, a second character string corresponding to the local area network name is generated; wherein the second character string is a pure numeric character string;
[0027] The network address is calculated using the value of the second string; wherein the network address is calculated as follows:
[0028] M=a*256^3+b*256^2+c*256^1+d*256^0;
[0029] Wherein, M is the value of the second character string; the network address is abcd.
[0030] In one embodiment, the steps of generating a response instruction corresponding to the network probe according to the network address and determining an offline mode parameter corresponding to the response instruction include:
[0031] Generate a response instruction corresponding to the network probe using the network address; wherein the response instruction is used to control the network address to perform a formatting operation;
[0032] Based on the formatting operation, the target address of the network configuration file corresponding to the network address is obtained, and the network configuration file is read using the target address to obtain the offline mode parameters.
[0033] In one embodiment, generating page configuration parameters based on local configuration data included in the application includes:
[0034] Obtaining local configuration data contained in the application and determining configuration parameter tags contained in the local configuration data;
[0035] If the configuration parameter mark is not empty, the page configuration parameters are generated using the local configuration data; if the configuration parameter mark is empty, the corresponding local configuration data is generated using the login information, and the page configuration parameters are generated based on the local configuration data.
[0036] In one embodiment, generating page configuration parameters after updating local configuration data based on login configuration data includes:
[0037] Get the page parameters and function parameters contained in the login configuration data;
[0038] After updating the local configuration data using the page parameters and function parameters, determine whether the local configuration data is complete based on the parameter types contained in the local configuration data;
[0039] If it is incomplete, the corresponding function configuration data is generated using the login information, and the page configuration parameters are determined using the function configuration data; if it is complete, the page configuration parameters are determined using the local configuration data.
[0040] In a second aspect, an embodiment of the present invention provides an application loading system, the system comprising:
[0041] A loading mode confirmation module is used to determine the network loading mode of the application using the network mode parameters of the application after detecting the application startup instruction; wherein the network loading mode includes: online mode and offline mode;
[0042] The login execution module is used to obtain the login page corresponding to the network loading mode, send a login request to the login interface of the application based on the login information entered in the login page, and determine whether the login process corresponding to the login information is successful based on the login response data received from the login interface;
[0043] The page configuration judgment module is used to obtain the login configuration data and the configuration flag bit contained in the login response data if the login is successful, and to judge whether the configuration flag bit is empty;
[0044] A page configuration execution module, configured to generate page configuration parameters based on the local configuration data included in the application if yes; and to generate page configuration parameters after updating the local configuration data based on the login configuration data if no;
[0045] The page loading execution module is used to render and load the application's homepage using page configuration parameters.
[0046] In a third aspect, an embodiment of the present invention further provides an electronic device comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the application loading method provided in the first aspect.
[0047] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the application loading method provided in the first aspect.
[0048] An embodiment of the present invention provides an application loading method, system, and electronic device. During the process of loading an application, after detecting the application's startup instruction, the network mode parameters of the application are used to determine the network loading mode of the application; wherein the network loading mode includes: online mode and offline mode; then, a login page corresponding to the network loading mode is obtained, a login request is sent to the login interface of the application based on the login information entered in the login page, and whether the login process corresponding to the login information is successful is determined based on the login response data received from the login interface; if the login is successful, the login configuration data and the configuration flag bit contained in the login response data are obtained, and it is determined whether the configuration flag bit is empty; if so, page configuration parameters are generated based on the local configuration data contained in the application; if not, page configuration parameters are generated after updating the local configuration data based on the login configuration data; finally, the page configuration parameters are used to render and load the homepage of the application. This method decouples the application configuration from the application itself, and is compatible with both online and offline mode servers. There is no need for additional development of the application, thereby solving the above-mentioned problems existing in the prior art.
[0049] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 A flowchart of an application loading method provided by an embodiment of the present invention;
[0053] Figure 2 A flowchart of step S101 in an application loading method provided in an embodiment of the present invention;
[0054] Figure 3 A flowchart of step S203 in an application loading method provided in an embodiment of the present invention;
[0055] Figure 4A flowchart of an application loading method provided in an embodiment of the present invention, using a network probe to obtain local area network information of an application, and determining offline mode parameters corresponding to the application based on the local area network information;
[0056] Figure 5 A flowchart of step S403 in an application loading method provided in an embodiment of the present invention;
[0057] Figure 6 A flowchart of step S404 in an application loading method provided in an embodiment of the present invention;
[0058] Figure 7 A flowchart of generating page configuration parameters based on local configuration data contained in an application in an application loading method provided by an embodiment of the present invention;
[0059] Figure 8 A flowchart of generating page configuration parameters after updating local configuration data based on login configuration data in an application loading method provided by an embodiment of the present invention;
[0060] Figure 9 A schematic diagram of a login process in an application loading method provided by an embodiment of the present invention;
[0061] Figure 10 A schematic diagram of a probe flow in an application loading method provided by an embodiment of the present invention;
[0062] Figure 11 A page loading flow chart in an application loading method provided by an embodiment of the present invention;
[0063] Figure 12 This is a diagram showing the actual effect of an application loading method provided by an embodiment of the present invention after application loading is completed;
[0064] Figure 13 A schematic diagram of the structure of an application loading system provided by an embodiment of the present invention;
[0065] Figure 14 A schematic structural diagram of an electronic device provided by an embodiment of the present invention.
[0066] icon:
[0067] 1310 - loading mode confirmation module; 1320 - login execution module; 1330 - page configuration judgment module; 1340 - page configuration execution module; 1350 - page loading execution module;
[0068] 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION
[0069] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0070] With the development of internet technology, mobile office systems have become an indispensable tool for enterprises. Currently, there are two main delivery and usage models for mobile application services: the traditional offline model, where the entire service is deployed in a private data center to enable network interaction; and the online SaaS (Software as a Service) model, where services are deployed in the cloud and users access corresponding network functions and services as tenants.
[0071] Due to the varying nature and needs of different customers, the same mobile app may require different delivery / usage models for different clients. For example, service providers with strict data security requirements may choose an offline model, which incurs high hardware costs to build offline servers; whereas cost-sensitive service providers may choose an online model to minimize service fees.
[0072] In real-world scenarios, some large hospitals, for example, choose an offline model due to data security, privacy, and policy requirements; while some small community hospitals, driven by cost and management constraints, choose an online SAAS model. Furthermore, for business reasons, there's a need to switch between the two models. For example, when strict performance indicators are met, customers may request a downgrade from online to offline mode. Furthermore, some hospitals may switch from offline to online to meet physicians' needs for convenient clinical care. In actual implementation, multiple functional modules within a mobile app may operate in different modes. For example, clinical functions may require an offline model, while functions like study notes require an online model.
[0073] In this situation, the traditional model presents numerous drawbacks. Specifically, adopters of the traditional model are forced to abandon a certain market segment and focus on a single model. Giving up a portion of the market means losing customers and opportunities, which is often unacceptable in a highly competitive market. Focusing solely on a single model doubles the product's market risk. When the environment changes, the current model may no longer be suitable, leading to the premature end of the product's lifecycle.
[0074] When application developers need to address both modes, they must maintain two applications simultaneously. Maintaining two applications simultaneously to meet the demands of both offline and online markets results in high R&D costs and maintenance difficulties. Even if the common content of the two applications can be separated technically, they still have to deal with two separate development, testing, launch, and operations environments, and these costs are inescapable.
[0075] There are some customized requirements that cannot be met by either traditional model. For example, some customers require that the login permission system be located in an offline data center with no external interfaces, and that all services be deployed in the cloud. This requirement cannot be met by either traditional model. In some cases, customers may request that some functional modules of the online model be deployed offline, or some functional modules of the offline model be moved online, or both offline and online. Implementing these functions is very difficult with the two traditional application models.
[0076] Therefore, in actual scenarios, such applications only need to consider one service mode and are not compatible with both online and offline modes. Therefore, it is difficult to implement the above functions and they must be redeveloped. Based on this, the present invention provides an application loading method, system, and electronic device. This method decouples application configuration from the application itself, and is compatible with both online and offline server modes, eliminating the need for additional application development, thereby solving the above problems existing in the prior art.
[0077] To facilitate understanding of this embodiment, an application loading method disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, including:
[0078] Step S101: After detecting an application startup instruction, determine the network loading mode of the application using the network mode parameters of the application; wherein the network loading mode includes: online mode and offline mode.
[0079] Specifically, this method decouples application configuration from the application itself. The configuration process includes network configuration, login configuration, page configuration, and feature configuration, each of which has different functions and responsibilities. Specifically, network configuration focuses on selecting the network mode, which includes online and offline modes. When the application starts and obtains its startup instructions, the application's network mode parameters are used to determine the network loading mode.
[0080] Step S102: Obtain a login page corresponding to the network loading mode, send a login request to the login interface of the application based on the login information entered in the login page, and determine whether the login process corresponding to the login information is successful based on the login response data received from the login interface;
[0081] Different network loading modes correspond to different login pages: online mode corresponds to the online mode login page, and offline mode corresponds to the offline mode login page. The login pages for online and offline modes are not necessarily the same, but the login pages will contain the corresponding login form to guide users to complete the login information.
[0082] After the login information is filled in, a corresponding login request will be generated, and the login request instruction corresponding to the login request will be sent to the corresponding login interface. The login response data called back by the login interface will be used to determine whether the login is successful.
[0083] Step S103: If the login is successful, the login configuration data and the configuration flag included in the login response data are obtained, and it is determined whether the configuration flag is empty.
[0084] If the login is successful, the login configuration data and configuration flags contained in the login response are retrieved. The login configuration data is written to the local configuration data and used in the subsequent page rendering process; the configuration flags are used in the subsequent page loading process.
[0085] Step S104: if yes, generate page configuration parameters based on the local configuration data included in the application; if no, generate page configuration parameters after updating the local configuration data based on the login configuration data.
[0086] Specifically, if the configuration flag is empty, it indicates that the local configuration data can be directly used for page loading, and the corresponding page configuration parameters are generated based on the local configuration data already included in the application. If the configuration flag is not empty, the local configuration data needs to be updated. In this case, the local configuration data is updated based on the login configuration data, and the page configuration parameters are generated based on the updated local configuration data.
[0087] Step S105: Render and load the homepage of the application using the page configuration parameters.
[0088] After the page configuration parameters are obtained, the parameters can be used to first render the application page framework, and then combined with the function module configuration information corresponding to the parameters to complete the overall rendering and loading of the application page, thereby realizing the loading process of the application.
[0089] In one embodiment, after detecting the application startup instruction, the network loading mode of the application is determined using the network mode parameters of the application in step S101, such as Figure 2 Shown, including:
[0090] Step S201: After monitoring the application startup instruction in real time, obtain the corresponding startup quantity parameter in the application;
[0091] Step S202, judging whether the application is opened for the first time based on the startup quantity parameter;
[0092] Step S203: If yes, the network connection status of the application is determined using the network configuration parameters, and the network loading mode is determined based on the network connection status.
[0093] In actual scenarios, after the application is launched, it is necessary to determine whether the application is being opened for the first time. This is achieved through the corresponding launch quantity parameter in the application. It is worth mentioning that the launch quantity parameter represents the number of times the application has been launched. It is generally implemented through a built-in counter and is usually not modifiable. If the application is being opened for the first time, the network configuration parameters are used to determine the network connection status of the application, and then the network loading mode is determined. If the application is not being opened for the first time, the subsequent step S102 is executed.
[0094] In one embodiment, the network connection status of the application is determined using the network configuration parameters, and the network loading mode is determined based on the network connection status in step S203, such as Figure 3 Shown, including:
[0095] Step S301, obtaining the network parameters and network interface included in the network configuration parameters, and determining whether the network parameters can make a network request to the network interface;
[0096] Step S302: If yes, determine the online mode parameters corresponding to the application based on the geographic information of the application; if not, obtain the local area network information of the application using a network probe, and determine the offline mode parameters corresponding to the application based on the local area network information;
[0097] Step S303: Determine the network loading mode of the application according to the online mode parameters and the offline mode parameters; wherein the online mode parameters are used to determine the online mode, and the offline mode parameters are used to determine the offline mode.
[0098] The network loading mode corresponds to the online mode and the offline mode, so the corresponding mode parameters can be determined by the connection status of the online network. Specifically, the network configuration parameters are first used to obtain the network parameters and network interface contained therein. The network corresponding to the online network can be implemented using the relevant interfaces of the World Wide Web.
[0099] If it can connect to the World Wide Web, it indicates that the network configuration parameters correspond to the online mode. In this case, the corresponding online mode parameters can be determined by the geographic information of the application. Specifically, the geographic information can be obtained through the device where the application is installed. For example, the GPS module of a mobile phone or tablet can directly obtain the geographic information of the application. If it cannot connect to the World Wide Web, it indicates that the network configuration parameters correspond to the offline mode. In this case, a network probe can be used to obtain the local LAN information, and the offline mode parameters corresponding to the application can be determined based on the local LAN information. Then, the network loading mode can be determined based on the online mode parameters and offline mode parameters described above.
[0100] In one embodiment, a network probe is used to obtain the local area network information of the application, and the offline mode parameters corresponding to the application are determined based on the local area network information, such as Figure 4 Shown, including:
[0101] Step S401: Obtain a request instruction corresponding to the network probe and obtain device information corresponding to the application;
[0102] Step S402: using a request instruction to obtain local area network information contained in the device information, and determining the local area network name corresponding to the local area network information;
[0103] Step S403: Formatting the LAN name that satisfies the preset naming relationship to obtain a network address corresponding to the LAN name;
[0104] Step S404: Generate a response instruction corresponding to the network probe according to the network address, and determine an offline mode parameter corresponding to the response instruction.
[0105] A network probe can be understood as a low-latency request-response process, used to obtain local area network (LAN) information contained in the application device's operating environment. In specific implementations, after receiving a probe request, it uses this request to retrieve all LAN information contained in the application device information. Data parsing can then be used to determine the corresponding LAN name within the LAN information.
[0106] It is worth mentioning that the LAN name is generated according to a specific naming relationship. For example, the LAN name can only be formatted when it contains a specific string. In this case, the LAN name needs to be parsed and then processed when it contains the corresponding specific string to obtain the corresponding network address. Specifically, the formatting process is the process of converting a LAN name string containing specific characters into an IP network address. After the network address is obtained, it can be associated with the response instruction corresponding to the network probe to generate its corresponding offline mode parameters.
[0107] In one embodiment, after formatting the LAN name that meets the preset naming relationship, step S403 of obtaining the network address corresponding to the LAN name is performed. Figure 5 As shown, including:
[0108] Step S501, obtaining a first character string corresponding to a local area network name, and determining a target character string included in the naming relationship;
[0109] Step S502: for a first character string including a target character string, after removing the target character string from the first character string, a second character string corresponding to the local area network name is generated; wherein the second character string is a pure numeric character string;
[0110] Step S503: Calculate and obtain the network address using the value of the second character string.
[0111] For example, if the LAN name is MY+a specific string, such as MY6706322323, the first string of the LAN name is MY6706322323, and the target string is MY. After removing the target string from the first string, the second string corresponding to the LAN name, 6706322323, is obtained. This string is a pure numeric string. In actual scenarios, a check is performed to determine whether it is a number. If so, the subsequent steps are executed; if not, an error message is displayed.
[0112] After obtaining the second string, calculate it according to its corresponding value to get the final network address. The calculation process of the network address is:
[0113] M=a*256^3+b*256^2+c*256^1+d*256^0;
[0114] Where M is the value of the second string; the network address is abcd. For 6706322323, the above formula yields 3232236076 = 192 * 256^3 + 168 * 256^2 + 2 * 256^1 + 44 * 256^0, so the network address is 192.168.2.44.
[0115] In one embodiment, a response instruction corresponding to the network probe is generated according to the network address, and step S404 of determining the offline mode parameter corresponding to the response instruction is performed. Figure 6 As shown, including:
[0116] Step S601: Generate a response instruction corresponding to the network probe using the network address; wherein the response instruction is used to control the network address to perform a formatting operation;
[0117] In step S602 , based on the formatting operation, a target address of a network configuration file corresponding to the network address is obtained, and the network configuration file is read using the target address to obtain offline mode parameters.
[0118] After the network address is obtained, the offline mode parameters are determined through the response instructions corresponding to the network probe; the response instructions are used to control the network address to perform formatting operations. The purpose of this formatting operation is to obtain the configuration file address corresponding to the network address. For example, if the network address is 192.168.2.44, the formatted target address is 192.168.2.44 / config. The corresponding offline mode parameters can be obtained by reading the configuration file under the target address.
[0119] Since this is offline mode, the relevant configuration data cannot be obtained online. Therefore, in actual scenarios, the offline mode parameters can be obtained by scanning the QR code. For example, after the user scans the QR code named MY6706322323 with a mobile phone, the MY6706322323 string corresponding to the QR code is parsed, and the corresponding configuration information is automatically read from 192.168.2.44 / config, and the corresponding offline mode parameters are finally obtained.
[0120] In the process of obtaining the login configuration data and configuration flag bits contained in the login response data, the configuration flag bits can be represented by the corresponding version parameter in the login response data. When the version parameter is empty, the page configuration parameters are directly generated using the local configuration data; when the version parameter is not empty, the local configuration data needs to be updated using the login configuration data to generate the required page configuration parameters.
[0121] Specifically, when the version parameter is empty, in one embodiment, the page configuration parameters are generated based on the local configuration data contained in the application, such as Figure 7 Shown, including:
[0122] Step S701, obtaining local configuration data included in the application, and determining the configuration parameter tags included in the local configuration data;
[0123] Step S702: if the configuration parameter flag is not empty, the page configuration parameters are generated using the local configuration data; if the configuration parameter flag is empty, the corresponding local configuration data is generated using the login information, and the page configuration parameters are generated based on the local configuration data.
[0124] At this point, the local configuration data contained in the application is first obtained from the application, and the configuration parameter tag is used to control the generation process of the page configuration parameters. Specifically, if the configuration parameter tag is not empty, the application contains local configuration data locally, and the page configuration parameters can be generated directly using the local configuration data. If the configuration parameter tag is empty, it indicates that the application does not contain local configuration parameters locally, and it is necessary to combine the user's login information to obtain the local configuration data corresponding to the user, and then use the local configuration data to generate the final page configuration parameters.
[0125] Specifically, when the version parameter is not empty, in one embodiment, the page configuration parameters are generated after the local configuration data is updated based on the login configuration data, such as Figure 8 As shown, including:
[0126] Step S801, obtaining page parameters and function parameters contained in login configuration data;
[0127] Step S802: After updating the local configuration data using the page parameters and the function parameters, determine whether the local configuration data is complete based on the parameter types included in the local configuration data;
[0128] Step S803: If the information is incomplete, the corresponding function configuration data is generated using the login information, and the page configuration parameters are determined using the function configuration data; if the information is complete, the page configuration parameters are determined using the local configuration data.
[0129] First, the page parameters and function parameters contained in the login configuration data are used as update parameters to update the local configuration data, and then the updated local configuration data is used to generate the final page configuration parameters. This process requires combining the type of local configuration data to determine the integrity of the local configuration data; if it is complete, the local configuration data is directly used to generate the corresponding page configuration parameters; if it is incomplete, the login information is used to generate the function configuration data corresponding to the user, and then the corresponding page configuration parameters are determined based on the function configuration data. Finally, the page configuration parameters are used to render and load the application score homepage, thus completing the overall application loading process.
[0130] Specifically, the application loading method mainly involves the login process, probe process and page loading process. The configuration process of the login process is mainly responsible for the implementation of the authentication-related functions of the application, and may include the following parameters: version, login name verification rules, password verification rules, other attributes, other attribute types and login interface. Specifically, the version is the configuration version of the current application; the login name verification rules and password verification rules mainly determine the square method and regular formula for the length of the login name and password, the case of special characters, etc.; other attributes and other attribute types are mainly other related attributes involved in the login process, such as the selection of branches of the group hospital; the presentation attribute is the presentation of this attribute on the login page, such as a drop-down box, such as single selection or multiple selection; the login interface is the corresponding interface for authentication. The output parameters of this interface are standardized, so an application can adapt to the login function of all environments. The login configuration can be set by scanning the QR code, which is very easy to use and popular in offline scenarios. When the login configuration is empty, the mobile phone number is used as the user name by default, and the SaaS login interface of the online environment is called to log in. The login process can be referred to as follows Figure 9 The login process diagram shown is not described in detail.
[0131] The probe process primarily targets probes for network connection environments. Specifically, each environment has a probe that returns the current environment's environment ID, configuration version, and configuration details. When the environment probe deems the environment available, it quickly informs the prober of the relevant information. This indicates that the environment probe has network self-discovery capabilities. Its implementation and working mode are as follows:
[0132] Mobile devices scan for wireless router SSID broadcasts to learn about nearby Wi-Fi networks. This is because wireless routers periodically send out Beacon frames, also known as signal beacon frames in Chinese. One of the most important functions of beacon frames is to announce the presence of a wireless network. This solution uses custom Beacon frames to send encrypted, characteristic environmental information to nearby mobile devices using the wireless router's Wi-Fi name.
[0133] The interface address format for obtaining intranet configuration information is ip / config, for example, 192.168.2.44 / config. / config is fixed for all environments, with only 10.0.0.100 remaining constant. Therefore, the environment probe primarily transmits the IP address. Our algorithm breaks the IP address into four digits, each ranging from 0 to 255, resulting in 8 bits per digit, for a total of 32 bits, or 4 bytes, which can be represented by the unsigned uint data type. For example, 192.168.2.44 can be represented as 192*256^3+168*256^2+2*256^1+44*256^0=3232236076. This uint is then shuffled according to the rules (6706322323) and prefixed with MY to obtain MY6706322323. Then when the user is at the current location, the phone can scan the Wi-Fi named MY6706322323 and then connect to 192.168.2.44 / config to obtain the corresponding configuration information for the user to choose.
[0134] There are several ways to configure a wireless network with the SSID MY6706322323 on a router. For example, you can add an additional wireless router, add an SSID named MY6706322323 to a wireless router that supports multiple SSIDs, or control the wireless network with Beacon frames through an embedded program.
[0135] The function of scanning the code to obtain the configuration is similar to the environment probe. For example, the interface address for obtaining offline configuration is 192.168.2.44 / config. The IP address is converted to MY6706322323 through the above calculation method, and then its QR code is activated; after the user scans the code, 192.168.2.44 will be automatically obtained, and then the configuration will be automatically obtained at 192.168.2.44 / config. The above process can be referred to as follows Figure 10 The probe flow diagram shown is omitted for clarity.
[0136] The page loading process primarily focuses on homepage configuration and functional module configuration. Page configuration can be obtained through a dedicated API or returned via the login API. The login configuration includes a parameter called "version" to check whether the configuration on the current device needs to be updated. If so, the latest configuration will be returned via the login API. The homepage configuration has only two attributes: element and style. These two elements, when combined, render the homepage framework.
[0137] After the homepage frame is rendered, the entire page can be rendered in combination with the function module configuration information. The function module configuration includes function ID, function icon, click event, and click content. The function ID is the globally unique identifier of this function; the click event includes whether to pop up a local window, jump to a page as a whole, or pull up the page of a third-party application; the click content is the relevant parameters after the click event is triggered, such as the pop-up window code, etc. The above process is as follows Figure 11 The page loading flow chart is shown and will not be described in detail.
[0138] The actual effect of the application loading method after the application is loaded is as follows Figure 12 As shown, the app automatically matches online and offline modes after the user logs in, generating a standard app homepage. App users don't experience the complexities of matching online and offline modes; they simply scan the QR code in offline scenarios, eliminating any awkward usage. App developers only need to maintain a single application to achieve online and offline matching, significantly reducing R&D, maintenance, and delivery costs.
[0139] It can be seen from the application loading method in the above embodiment that this method decouples the application configuration from the application itself, is compatible with both online and offline server modes, and no longer requires additional development of the application, thereby solving the above problems existing in the prior art.
[0140] For the application loading method provided in the above embodiment, the embodiment of the present invention provides an application loading system, such as Figure 13 As shown, the system includes:
[0141] The loading mode confirmation module 1310 is configured to determine the network loading mode of the application using the network mode parameters of the application after detecting the application startup instruction; wherein the network loading mode includes: online mode and offline mode;
[0142] Login execution module 1320, configured to obtain a login page corresponding to the network loading mode, send a login request to the application's login interface based on the login information entered on the login page, and determine whether the login process corresponding to the login information is successful based on the login response data received from the login interface;
[0143] The page configuration determination module 1330 is configured to obtain the login configuration data and the configuration flag contained in the login response data if the login is successful, and determine whether the configuration flag is empty;
[0144] The page configuration execution module 1340 is configured to generate page configuration parameters based on the local configuration data included in the application if yes; and to generate page configuration parameters after updating the local configuration data based on the login configuration data if no;
[0145] The page loading execution module 1350 is used to render and load the homepage of the application using the page configuration parameters.
[0146] From the application loading system mentioned in the above embodiment, it can be seen that the system decouples the application configuration from the application itself, and can be compatible with both online and offline server modes. There is no need for additional development of the application, thereby solving the above problems existing in the prior art.
[0147] The application loading system provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned application loading method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned application loading method embodiment.
[0148] This embodiment also provides an electronic device. The structural diagram of the electronic device is as follows: Figure 14 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the steps of the above-mentioned application loading method.
[0149] Figure 14 The electronic device shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .
[0150] The memory 102 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 14 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0151] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.
[0152] The processor 101 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 101 or by instructions in the form of software. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 102, and processor 101 reads information in memory 102 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.
[0153] An embodiment of the present invention further provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the application loading method in the above embodiment are executed.
[0154] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0155] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0156] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0157] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0158] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. An application loading method, characterized in that: The method comprises: After detecting the application startup instruction, determining the network loading mode of the application using the network mode parameters of the application; wherein the network loading mode includes: online mode and offline mode; Obtaining a login page corresponding to the network loading mode, sending a login request to a login interface of the application based on the login information entered in the login page, and determining whether the login process corresponding to the login information is successful based on login response data received from the login interface; If the login is successful, the login configuration data and the configuration flag bit contained in the login response data are obtained, and it is determined whether the configuration flag bit is empty; If yes, generating page configuration parameters based on the local configuration data included in the application; if no, generating the page configuration parameters after updating the local configuration data based on the login configuration data; The homepage of the application is rendered and loaded using the page configuration parameters.
2. The application loading method according to claim 1, characterized in that: The step of determining the network loading mode of the application using the network mode parameters of the application after detecting the application startup instruction includes: After monitoring the startup instruction of the application in real time, obtaining the corresponding startup quantity parameter of the application; Determining whether the application is opened for the first time based on the startup quantity parameter; If yes, the network connection status of the application is determined using network configuration parameters, and the network loading mode is determined based on the network connection status.
3. The application loading method according to claim 2, characterized in that: The step of determining the network connection status of the application using network configuration parameters and determining the network loading mode based on the network connection status includes: Obtaining the network parameters and network interface included in the network configuration parameters, and determining whether the network parameters can make a network request to the network interface; If yes, determining the online mode parameters corresponding to the application based on the geographic information of the application; if no, obtaining the local area network information of the application using a network probe, and determining the offline mode parameters corresponding to the application based on the local area network information; The network loading mode of the application is determined according to the online mode parameters and the offline mode parameters; wherein the online mode parameters are used to determine the online mode, and the offline mode parameters are used to determine the offline mode.
4. The application loading method according to claim 3, characterized in that: Acquiring local area network information of the application using a network probe, and determining the offline mode parameter corresponding to the application based on the local area network information, including: Obtaining a request instruction corresponding to the network probe and obtaining device information corresponding to the application; Obtaining the local area network information contained in the device information using the request instruction, and determining the local area network name corresponding to the local area network information; After formatting the local area network name that meets the preset naming relationship, obtaining the network address corresponding to the local area network name; A response instruction corresponding to the network probe is generated according to the network address, and the offline mode parameter corresponding to the response instruction is determined.
5. The application loading method according to claim 4, characterized in that: The step of formatting the local area network name that satisfies the preset naming relationship and obtaining the network address corresponding to the local area network name includes: Obtaining a first character string corresponding to the local area network name, and determining a target character string included in the naming relationship; For the first character string including the target character string, after removing the target character string from the first character string, a second character string corresponding to the local area network name is generated; wherein the second character string is a pure numeric character string; The network address is calculated and obtained using the value of the second character string; wherein the network address is calculated as follows: M=a*256^3+b*256^2+c*256^1+d*256^0; Wherein, M is the value of the second character string; the network address is abcd.
6. The application loading method according to claim 5, characterized in that: The step of generating a response instruction corresponding to the network probe according to the network address and determining the offline mode parameter corresponding to the response instruction includes: Generating the response instruction corresponding to the network probe using the network address; wherein the response instruction is used to control the network address to perform a formatting operation; Based on the formatting operation, a target address of a network configuration file corresponding to the network address is obtained, and the network configuration file is read using the target address to obtain the offline mode parameter.
7. The application loading method according to claim 1, characterized in that: Generate page configuration parameters based on the local configuration data contained in the application, including: Obtaining the local configuration data contained in the application, and determining a configuration parameter tag contained in the local configuration data; If the configuration parameter flag is not empty, the page configuration parameters are generated using the local configuration data; if the configuration parameter flag is empty, the corresponding local configuration data is generated using the login information, and the page configuration parameters are generated based on the local configuration data.
8. The application loading method according to claim 1, characterized in that: Generating the page configuration parameters after updating the local configuration data based on the login configuration data includes: Obtaining page parameters and function parameters contained in the login configuration data; After updating the local configuration data using the page parameters and the function parameters, determining whether the local configuration data is complete based on parameter types included in the local configuration data; If it is incomplete, the corresponding function configuration data is generated using the login information, and the page configuration parameters are determined using the function configuration data; if it is complete, the page configuration parameters are determined using the local configuration data.
9. An application loading system, characterized in that: The system comprises: A loading mode confirmation module is configured to, upon detecting an application startup instruction, determine a network loading mode of the application using the network mode parameters of the application; wherein the network loading mode includes: an online mode and an offline mode; a login execution module, configured to obtain a login page corresponding to the network loading mode, send a login request to the login interface of the application based on the login information entered in the login page, and determine whether the login process corresponding to the login information is successful based on the login response data received from the login interface; A page configuration judgment module is used to obtain the login configuration data and the configuration flag bit contained in the login response data if the login is successful, and to judge whether the configuration flag bit is empty; a page configuration execution module, configured to, if yes, generate page configuration parameters based on the local configuration data included in the application; and, if no, generate the page configuration parameters after updating the local configuration data based on the login configuration data; The page loading execution module is used to render and load the homepage of the application using the page configuration parameters.
10. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the application loading method according to any one of claims 1 to 8.