A control method and control device for implementing application program running in multiple systems
By obtaining and utilizing the system information and directory structure of the operating system to create the storage partition and associated information of the application, the compatibility problem of the application between multiple operating systems is solved, and the successful operation and operation in different operating systems are realized. Flexible use.
Patent Information
- Application Number
- CN201911376515.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-27
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2039-12-27
AI Technical Summary
Applications on existing mobile terminals are not compatible with multiple operating systems, resulting in inability to run in different operating system environments. Users encounter running errors or incomplete functions when sharing or installing applications.
By obtaining the system information and directory structure of the current operating system, it is determined whether there is associated information. If it does not exist, the storage partition and associated information of the application are created, and the running configuration data is generated, so that the application can run in multiple operating systems, dynamically Adapt to API interfaces and directory structures of different operating systems.
It realizes the compatibility of applications between multiple operating systems, avoids the need to develop different installation packages, and facilitates the upgrade and maintenance of applications and users' use in different operating systems.
Smart Images

Figure CN111176720B
Abstract
Description
[Technical field]
[0001] The present invention relates to a control method, a control device and a mobile terminal for implementing the operation of application programs in multiple systems. [Background technology]
[0002] Current mobile terminals (such as mobile phones) can often install different types or versions of operating systems at the same time. For example, based on the original Android operating system, many different types of other operating systems can be derived, and these operating systems can be installed on the same mobile terminal at the same time. Some of the interfaces between the various systems are inconsistent. For example, some new operating systems have made a lot of deletions or extensions to the native Android operating system, reduced or merged API interfaces, and added many new API interfaces, making the software and hardware functions simpler or richer. However, the application APK package (i.e., installation package) developed based on the standard Android SDK can only run on the native operating system and cannot run on the new operating system. [Summary of the invention]
[0003] In order to better solve the compatibility problem of application programs being incompatible with multiple systems, an embodiment of the present invention provides a control method, a control device, and a mobile terminal for implementing the operation of application programs in multiple systems.
[0004] In one aspect, the present invention provides a control method for implementing running an application program in multiple systems, the control method being applicable to an electronic device including at least a first operating system and a second operating system, and characterized in that the control method comprises:
[0005] When launching an application in any operating system, obtain the system information of the current operating system;
[0006] Determine whether there is association information between the application and the current operating system; if the association information does not exist, create a storage partition for the application in the current operating system according to the system information, and create association information between the application and the current operating system according to the system information;
[0007] Creating running configuration data of the application in the storage partition so that the current operating system can recognize the application;
[0008] The application is run in the current operating system.
[0009] In addition, the above-mentioned obtaining the system information of the current operating system includes: obtaining the system level and directory structure of the current operating system.
[0010] In addition, the above-mentioned creation of the running configuration data of the application in the storage partition includes: creating a running configuration folder required for running the application in the current operating system; and storing the data required for running in the running configuration folder.
[0011] Furthermore, the control method further includes: when the association information exists, and the system level and directory structure of the current operating system do not match the association information, a storage partition of the application is created in the current operating system according to the directory structure in the association information.
[0012] In another aspect, the present invention provides a control device, characterized in that it comprises:
[0013] The acquisition module acquires the system information of the current operating system when the application is started in any operating system;
[0014] a creation module, determining whether there is association information between the application and the current operating system; if the association information does not exist, creating a storage partition for the application in the current operating system according to the system information, creating association information between the application and the current operating system according to the system information; creating running configuration data of the application in the storage partition, so that the current operating system can recognize the application;
[0015] A running module runs the application in the current operating system.
[0016] In addition, the above-mentioned obtaining the system information of the current operating system includes: obtaining the system level and directory structure of the current operating system.
[0017] In addition, the above-mentioned creation of the running configuration data of the application in the storage partition includes: creating a running configuration folder required for running the application in the current operating system; and storing the data required for running in the running configuration folder.
[0018] In addition, the creation module also includes: when the association information exists, and the system level and directory structure of the current operating system do not match the association information, creating a storage partition of the application in the current operating system according to the directory structure in the association information.
[0019] On the other hand, the present invention provides a mobile terminal, characterized by comprising the above-mentioned control device.
[0020] On the other hand, the present invention provides a readable storage medium, characterized in that a computer program is stored in the readable storage medium, and the computer program is used to implement the above-mentioned control method when executed by a processor.
[0021] Through the control method, control device, and mobile terminal of the present invention, an application can be made compatible with multiple operating systems, and the application can obtain system information in different operating system environments, and generate running configuration data for the corresponding operating system based on the system information and related information, so as to meet the requirements of compatibility with multiple operating system environments. There is no need for the application developer to develop different installation packages for different operating systems, which facilitates the upgrade and maintenance of the application and allows users to flexibly use the application in different operating systems.
Brief Description of the Drawings
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 This is a flow chart of a control method according to Embodiment 1 of the present invention;
[0024] Figure 2 This is a schematic diagram of a specific flow chart of a control method according to Embodiment 1 of the present invention;
[0025] Figure 3 Schematic diagram of the structure of the control device of the second embodiment of the present invention. [Specific implementation method]
[0026] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0027] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] Embodiment 1
[0029] An embodiment of the present invention provides a control method for running an application in multiple systems, the control method being applicable to an electronic device including at least a first operating system and a second operating system, such as Figure 1 As shown, the control method includes:
[0030] Step 101, when starting an application in any operating system, obtaining system information of the current operating system; specifically, the system information may be the system level and directory structure of the current operating system;
[0031] Step 102, determining whether there is association information between the application and the current operating system, if there is no association information, creating a storage partition for the application in the current operating system according to the system information, and creating association information between the application and the current operating system according to the system information;
[0032] Step 103, creating running configuration data of the application in the storage partition so that the current operating system can recognize the application;
[0033] Step 104: Run the application program in the current operating system.
[0034] Through the control method of the present invention, the application program can establish the running configuration data required for running in any operating system before running, so as to be compatible with multiple operating systems and can run successfully in multiple operating systems.
[0035] In addition, the control method may also first execute the judgment in step 102, and when the judgment result is that there is no associated information, then execute the above step 101 to obtain the system information.
[0036] Specifically, in step 103, creating the running configuration data of the application in the storage partition includes: creating a running configuration folder required for running the application in the current operating system; and storing the data required for running in the running configuration folder. Setting the running configuration folder of the application in the operating system and storing the data required for running in the running configuration folder can ensure that when the application is not developed according to the API interface mechanism of some operating systems in multiple systems, the folders and files required for running can be established in real time and dynamically according to the directory structure of these operating systems, so that the application is compatible with multiple operating systems.
[0037] In addition, in step 102, when it is possible to create a storage partition of the application in the current operating system based on the acquired system information and the storage partition is created successfully, the association information between the application and the current operating system is created based on the system information; if the storage partition creation fails, it means that the acquired system information may be wrong. For example, when the application is developed according to the first operating system and the application is started in the second operating system, the system information acquired through the standard API interface may include the directory structure of the first operating system, and the directory structure of the second operating system is different from the directory structure of the first operating system, then according to the directory structure of the first operating system, it is impossible to acquire the running configuration data that already exists in the second operating system or to create the running configuration data required for the operation.
[0038] In order to solve the problem that the directory structure obtained above is wrong, the control method of the present invention also includes: when there is associated information, and the system level and directory structure of the current operating system obtained do not match the associated information, a storage partition of the application is created in the current operating system according to the directory structure in the associated information.
[0039] Existing electronic devices have multiple operating systems. After an application has been installed and run in a first operating system, the application can be shared from the first operating system to a second operating system. If the application is developed only for the first operating system, in the prior art, when a user shares the application to a second operating system, the application is often unable to run in the second operating system, causing confusion and inconvenience to the user. Through the embodiments of the present invention, when an application is shared or installed in a second operating system and started in the second operating system, the data required for operation can be established based on the system information of the second operating system obtained, so that the application is compatible with the second operating system.
[0040] Specifically, on a mobile phone with an Android operating system, there are two operating systems, one is the main system and the other is the subsystem. Applications in the main system can be shared to the subsystem. However, in the prior art, when an application developed by a third party is shared to a subsystem, it cannot run successfully, and there will be running errors, running failures, or some functions cannot run. Because when third parties develop applications, most of them only consider mobile phones with only a single system on the market, but the application is to be used on a mobile phone with a dual system, the application is not compatible with the dual system and will not run in a certain operating system.
[0041] In order to solve the above problems, assuming that an application is started in a subsystem, the present invention provides a specific control method, such as Figure 2 As shown, including:
[0042] Step 201, obtain the system information of the current operating system; the system information may be the system level and directory structure, for example, in an Android phone with dual systems, the directory structure of the main system is storage / emulated / 0 / , and the system level of the main system is 1; the directory structure of the subsystem is mnt / sdcard0 / , and the system level is 2. According to the directory structure, the running configuration data of each application that has been successfully run can be found; when starting an application in the subsystem, the system level of the subsystem is obtained, and the directory structure is obtained;
[0043] Step 202, determine whether there is association information between the application and the current operating system; specifically, there are three situations, one is that the existing association information only records the system information of the main system and the name, version, running time and other information of the application, and does not include the association information between the application and the subsystem, that is, the judgment result is no, and the process goes to step 203; another is that the existing association information records the system level and directory structure of the subsystem, the judgment result is yes, and the process goes to step 207; and another situation is that no association information is stored at all, the judgment result is no, and the process goes to step 203;
[0044] Step 203, if there is no association information between the application and the current operating system, then create a storage partition in the subsystem based on the obtained system information, and determine whether the creation is successful; specifically, when the application is started in the subsystem, the directory structure obtained based on the application developed by the main system may be storage / emulated / 0 / , because the main system and the subsystem in the dual system are independent and isolated from each other, the subsystem cannot access the storage area of the main system and cannot create the storage partition of the application based on the directory structure of the main system. This determination step is to solve the problem of failure to create a storage partition due to an incorrect directory structure obtained;
[0045] Step 204, when the storage partition can be created successfully, it means that the acquired system information matches the current subsystem, and the association information between the application and the subsystem is created based on the system information; specifically, an association table or an association file is stored in a public area that the Android phone supports the main system and the subsystem to access together, and the association information between the current operating system and the application is recorded in the association table or the association file, including the system level of the current operating system, the directory structure, the name, version, creation time and other information of the application; in addition, the association information can be stored in a separate storage area for each operating system, or the Android phone can store the association information in an external server, and each time step 202 is to be performed, the association information is searched from the external server, and the storage of the association information can ensure that the application runs successfully in the current operating system according to the correct directory structure, so that after the application can create a storage partition or run successfully for the first time in the current operating system, it can ensure that the application can run the next time it is started again;
[0046] In step 203, when the result of the judgment is that the storage partition creation fails, it means that the acquired system information cannot match the current subsystem, and then the process returns to step 201 to continue acquiring system information through different methods or paths until the storage partition can be created in the current subsystem or can be successfully run;
[0047] Step 205 is the same as the above step 103, and step 206 is the same as the above step 104, and will not be described in detail again;
[0048] Step 207, when there is associated information, and the associated information includes the obtained system level, compare the associated information with the obtained system information to determine whether the obtained system information matches the associated information; specifically, there are two results for determining whether the obtained system information matches the associated information. One is: the system information of the subsystem is recorded in the associated information, but the directory structure obtained in step 201 is different from the directory structure of the subsystem in the associated information. This may be because the application obtains the directory structure of the main system and the system level of the subsystem through the standard API interface. In the prior art, it is precisely because there is an error in the obtained directory structure that makes it impossible to run the application in the subsystem. At this time, the determination If the result is mismatch, the process goes to step 208; in step 208, a storage partition for the application is created based on the associated information, specifically including creating a storage partition for the application based on the directory structure of the subsystem in the associated information; the second is that the associated information completely matches the acquired system information, specifically, the system level and directory structure acquired in the subsystem are consistent with the system level and directory structure of the subsystem stored in the associated information, indicating that the application was able to create a storage partition or run successfully in the subsystem. In this case, the result is a match, and the process goes to step 206. Specifically, in step 206, the application's storage partition in the subsystem is directly entered based on the associated information to run the application's data.
[0049] Through the embodiments of the present invention, when an application is started in any operating system, the system information of any operating system will be obtained, such as the directory structure and system level. The directory structure can represent the storage path of the operation configuration data required for the operation of various applications in each operating system. In a mobile phone with multiple systems, the directory structure of each operating system is different and the storage areas are isolated from each other independently; after obtaining the system information, after comparing the associated information with the system information, different processing is performed according to the comparison results to ensure that the application can run successfully in the current operating system. When the association information records the association information of the application and a certain operating system, it means that the application can run in the operating system or has run in the operating system or the application can correctly obtain the directory structure and other information of the operating system. The operation configuration data required by different applications may be slightly different. For example, when a mobile printing-related application is running on an Android phone, it is necessary to create an initialization folder (such as a config folder) in the operating system and create an initialization file (such as AppDB.db) in the initialization file.
[0050] Embodiment 2
[0051] An embodiment of the present invention provides a control device 30, which includes at least a first operating system and a second operating system. Figure 3As shown, including:
[0052] The acquisition module 301 acquires the system information of the current operating system when starting the application in any operating system; acquiring the system information of the current operating system includes: acquiring the system level and directory structure of the current operating system;
[0053] The creation module 302 determines whether there is association information between the application and the current operating system. If the association information does not exist, a storage partition of the application is created in the current operating system according to the system information, and association information between the application and the current operating system is created according to the system information; and running configuration data of the application is created in the storage partition so that the current operating system can recognize the application.
[0054] The running module 303 runs the application program in the current operating system.
[0055] Through the control device of the embodiment of the present invention, the application can create the data required for operation when it is started, is compatible with multiple operating systems, and can run successfully on devices with multiple operating systems without the need to develop different installation packages for different operating systems, thereby facilitating and quickly maintaining the application.
[0056] Creating the running configuration data of the application in the storage partition includes: creating a running configuration folder required to run the application in the current operating system; and storing the data required for running in the running configuration folder. When the application is started in multiple operating systems, in order to run successfully, it is necessary to obtain system information and set the running configuration folder in the current operating system, and store the running data, so that the application can dynamically create the data required for running according to the system level and directory structure of the current operating system.
[0057] Furthermore, the creation module 302 further includes: when there is association information, and the system level and directory structure of the current operating system do not match the association information, a storage partition of the application is created in the current operating system according to the directory structure in the association information. The control device of the present invention can prevent the problem of failure to run the application when the directory structure obtained is wrong, and can make the application compatible with multiple operating systems without developing different development kits adapted to multiple operating systems.
[0058] The parts of this embodiment that are the same as those of the first embodiment will not be described again.
[0059] The present invention further provides a mobile terminal, characterized by comprising the control device of the above embodiment.
[0060] Through the mobile terminal of the present invention, the application program can be installed on a mobile phone with a single system. When the mobile phone has multiple operating systems, the application program does not need to develop multiple installation packages, which facilitates the maintenance and upgrade of the application program.
[0061] The present invention also provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the methods provided in the above-mentioned various embodiments.
[0062] Among them, the readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general or special-purpose computer. For example, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application-specific integrated circuit (Application Specific Integrated Circuits, abbreviated as: ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the readable storage medium can also exist in a communication device as discrete components.
[0063] The present invention also provides a program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of a device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the device implements the control method provided by the various embodiments described above.
[0064] It should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0065] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A control method for implementing running an application in multiple systems, the control method being applicable to a mobile phone including at least a first operating system and a second operating system, characterized in that: The control method comprises: When starting an application in the second operating system, obtaining system information of the second operating system; the system information at least includes the system level and system directory of the second operating system; determining whether there is association information between the application and the second operating system, and if there is no association information between the application and the second operating system, creating a storage partition of the application in the second operating system according to the system information, and creating association information between the application and the second operating system according to the system information; Creating running configuration data of the application in the storage partition so that the second operating system can recognize the application; Running the application in the second operating system; Among them, when there is association information between the application and the second operating system; if the acquired system information is the system information of the first operating system, resulting in a failure to create a storage partition for the application in the second operating system, then the storage partition for the application is created in the second operating system according to the directory structure in the association information; wherein the first operating system and the second operating system both belong to the Android operating system.
2. The control method according to claim 1, characterized in that: Creating the running configuration data of the application in the storage partition includes: creating a running configuration folder required for running the application in the second operating system; and storing data required for running in the running configuration folder.
3. A control device for running applications in multiple systems, comprising at least a first operating system and a second operating system, characterized in that: include: an acquisition module, which acquires system information of the second operating system when starting an application in the second operating system; The system information includes at least the system level and system directory of the second operating system; a creation module, determining whether there is association information between the application and the second operating system; if there is no association information between the application and the second operating system, creating a storage partition for the application in the second operating system according to the system information, and creating association information between the application and the second operating system according to the system information; Creating running configuration data of the application in the storage partition so that the second operating system can recognize the application; A running module, running the application in the second operating system; Among them, when there is association information between the application and the second operating system; if the acquired system information is the system information of the first operating system, resulting in a failure to create a storage partition for the application in the second operating system, then the storage partition for the application is created in the second operating system according to the directory structure in the association information; wherein the first operating system and the second operating system both belong to the Android operating system.
4. The control device according to claim 3, characterized in that: Creating the running configuration data of the application in the storage partition includes: creating a running configuration folder required for running the application in the second operating system; and storing data required for running in the running configuration folder.
5. A mobile terminal, characterized in that: The control device comprises any one of claims 3 to 4.
6. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the control method described in any one of claims 1 to 2.
