Application running method and device, electronic equipment and storage medium
By determining the application interface on the terminal device and obtaining container configuration information, the problem of application code reuse between different devices is solved, and application code reuse and adaptation across devices is realized, reducing development and maintenance costs.
Patent Information
- Application Number
- CN202311394196.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-04-25
AI Technical Summary
Due to the differences in operating systems and display sizes of different types of terminal devices, code modules with the same application functions and interfaces are difficult to reuse on different devices, resulting in the need to develop and maintain multiple sets of application codes for different devices, which is complex and costly.
By determining the interface to which the application is to be run, and obtaining container configuration information, the information includes the mapping relationship between the device information and the container information, determining the container identity based on this information, and loading application pages and/or application services on the device through the container, cross-device application code reuse is realized.
It realizes the reuse of application code on different types of electronic devices, without the need to develop and maintain multiple sets of codes, reduces the implementation complexity and development and maintenance costs, and adapts to the operation needs of different devices.
Smart Images

Figure CN119883238A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal technology, and in particular to an application running method, device, electronic device and storage medium. Background Art
[0002] With the popularity of smart terminal devices, there are more and more types of smart terminal devices, and it has become a common demand that an application can run on multiple terminal devices. When the same application runs on different types of terminal devices, there are many identical functions and interfaces on various terminal devices, and there are also some functions and interfaces that are different between devices. However, due to the differences in operating systems and display screen sizes of different types of terminal devices, it is difficult to reuse code modules with the same functions and interfaces on different types of terminal devices. Therefore, it is necessary to develop applications for different types of terminal devices separately and maintain multiple sets of application codes at the same time, which is complex and costly to implement. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides an application running method, device, electronic device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an application running method, which is applied to a first device, and the method includes:
[0005] Determining an interface on which a first application is to run, the first application comprising at least one container, each of the containers being used to load at least one application page and / or at least one application service;
[0006] Acquire container configuration information, where the container configuration information includes a mapping relationship between device information and container information;
[0007] Determine a container identifier of the first container according to the container configuration information and the device information of the first device;
[0008] A first application page and / or a first application service is loaded on the first device through the first container.
[0009] In an exemplary embodiment, before obtaining the container configuration information, the method further includes:
[0010] When starting collaborative operation, determining that a collaborative device of the first device is a second device, the collaborative device includes at least one of the second devices;
[0011] After obtaining the container configuration information, the method further includes:
[0012] Determine a container identifier of the second container according to the container configuration information and the device information of the second device;
[0013] The container identifier of the second container is sent to the second device through the connection module, so that the second device loads the second application page and / or the second application service through the second container.
[0014] In an exemplary embodiment, the method further comprises:
[0015] When the collaborative operation is started, the application lifecycle of the first device and the application lifecycle of the second device are synchronized through the connection module.
[0016] In an exemplary embodiment, synchronizing the application lifecycle of the first device and the application lifecycle of the second device by the connection module includes:
[0017] The application life cycle sent by the second device is received through the connection module.
[0018] In an exemplary embodiment, the method further comprises:
[0019] When collaborative operation is started, the container operation information of the first device and the container operation information of the second device are synchronized through the connection module, and the container operation information includes the life cycle of the container and the operation status of the container.
[0020] In an exemplary embodiment, synchronizing the container operation information of the first device and the container operation information of the second device by the connection module includes:
[0021] The container operation information sent by the second device is received through the connection module.
[0022] In an exemplary embodiment, the method further comprises:
[0023] When starting the collaborative operation, if the first application page includes multiple application pages, receiving a first operation instruction;
[0024] According to the first operation instruction, a first target application page is determined, and the first target application page is displayed on the first device.
[0025] According to a second aspect of an embodiment of the present disclosure, there is provided an application running method, which is applied to a second device, and the method includes:
[0026] When starting collaborative operation, determining the second device as a collaborative device of the first device;
[0027] receiving, through a connection module, a container identifier sent by the first device, and determining a second container according to the container identifier;
[0028] A second application page and / or a second application service is loaded on the second device through the second container.
[0029] In an exemplary embodiment, the method further comprises:
[0030] When the collaborative operation is started, the application lifecycle of the second device is sent to the first device through the connection module.
[0031] In an exemplary embodiment, the method further comprises:
[0032] When collaborative operation is started, container operation information of the second device is sent to the first device through the connection module, where the container operation information includes the life cycle of the container and the operation status of the container.
[0033] In an exemplary embodiment, the method further comprises:
[0034] When the collaborative operation is started, if the second application page includes multiple application pages, receiving a second operation instruction;
[0035] According to the second operation instruction, a second target application page is determined, and the second target application page is displayed on the second device.
[0036] According to a third aspect of an embodiment of the present disclosure, there is provided an application running device, applied to a first device, the device comprising:
[0037] A determination module is configured to determine an interface to be run by a first application, wherein the first application includes at least one container, each of which is used to load at least one application page and / or at least one application service;
[0038] An acquisition module is configured to acquire container configuration information, where the container configuration information includes a mapping relationship between device information and container information;
[0039] a processing module, configured to determine a container identifier of the first container according to the container configuration information and the device information of the first device;
[0040] The loading module is configured to load a first application page and / or a first application service on the first device through the first container.
[0041] According to a fourth aspect of an embodiment of the present disclosure, there is provided an application running device, which is applied to a second device, and the device includes:
[0042] A collaboration module, configured to determine that the second device is a collaborative device of the first device when collaborative operation is started;
[0043] a processing module, further configured to receive the container identifier sent by the first device through the connection module, and determine the second container according to the container identifier;
[0044] The loading module is configured to load a second application page and / or a second application service on the second device through the second container.
[0045] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0046] processor;
[0047] a memory for storing processor-executable instructions;
[0048] The processor is configured to execute the method as described in the first aspect or the second aspect of the embodiment of the present disclosure.
[0049] According to the sixth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute a method as described in the first aspect or the second aspect of the embodiment of the present disclosure.
[0050] The above method disclosed in the present invention has the following beneficial effects: the application code of the first application can be reused on different types of electronic devices, without the need to develop and maintain multiple sets of application codes of the first application for different types of electronic devices, thereby reducing implementation complexity and development and maintenance costs, and different types of electronic devices can be adapted when running the first application to meet the requirement that the first application can run on multiple types of electronic devices.
[0051] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0053] Figure 1 is a flow chart of an application running method according to an exemplary embodiment;
[0054] Figure 2 is a schematic diagram of an implementation architecture of a first application according to an exemplary embodiment;
[0055] Figure 3 is a schematic diagram of a development structure of a first application according to an exemplary embodiment;
[0056] Figure 4is a flow chart of an application running method according to an exemplary embodiment;
[0057] Figure 5 is a schematic diagram of cooperative operation according to an exemplary embodiment;
[0058] Fig. 6A is a separate operation schematic diagram shown according to an exemplary embodiment;
[0059] Figure 6B is a schematic diagram of cooperative operation according to an exemplary embodiment;
[0060] Figure 6C is a schematic diagram of cooperative operation according to an exemplary embodiment
[0061] Figure 7 is a schematic diagram showing synchronization of an application lifecycle and a container lifecycle according to an exemplary embodiment;
[0062] Figure 8 is a flow chart of an application running method according to an exemplary embodiment;
[0063] Fig. 9 is an interactive flow chart of an application running method according to an exemplary embodiment;
[0064] Fig.10 is an interactive flow chart of an application running method according to an exemplary embodiment;
[0065] Fig.11 is a block diagram of an application running device according to an exemplary embodiment;
[0066] Fig.12 is a block diagram of an application running device according to an exemplary embodiment;
[0067] Fig.13 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0068] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0069] In an exemplary embodiment of the present disclosure, in order to overcome the problem that application codes cannot be reused on multiple terminal devices in the related art, an application running method is provided, which is applied to a first device, including: determining the interface to be run by the first application, the first application includes at least one container, each container is used to load at least one application page and / or at least one application service; obtaining container configuration information, the container configuration information includes a mapping relationship between device information and container information; determining the container identifier of the first container according to the container configuration information and the device information of the first device; loading the first application page and / or the first application service on the first device through the first container. The method can reuse the application code of the first application on different types of electronic devices, without developing and maintaining multiple sets of application codes of the first application for different types of electronic devices, thereby reducing the implementation complexity and development and maintenance costs, and can adapt to different types of electronic devices when running the first application to meet the requirement that the first application can run on multiple types of electronic devices.
[0070] In an exemplary embodiment of the present disclosure, a method for running an application is provided, which is applied to a first device. Figure 1 is a flowchart of an application running method according to an exemplary embodiment. Figure 1 As shown, the following steps are included:
[0071] Step S101, determining an interface on which a first application is to run, the first application comprising at least one container, each container being used to load at least one application page and / or at least one application service;
[0072] Step S102, obtaining container configuration information, where the container configuration information includes a mapping relationship between device information and container information;
[0073] Step S103, determining a container identifier of the first container according to the container configuration information and the device information of the first device;
[0074] Step S104: load a first application page and / or a first application service on a first device through a first container.
[0075] In this exemplary embodiment, the first device includes electronic devices with display functions, including smart phones, tablets, laptops, desktop computers, smart watches, smart bracelets, car computers and other smart terminal devices.
[0076] In step S101, the first application may be a native application in the operating system of the first device, which is an application created and distributed by the device manufacturer or the creator of the device's operating system; the first application may also be a third-party application provided by a third party, which is an application created by a supplier (which may be a company or an individual) who is different from the device manufacturer and / or the creator of the device's operating system.
[0077] An application page refers to the form in which the functions provided by the application with a display interface are presented in the application, and an application service refers to the form in which the functions provided by the application without a display interface are presented in the application. An application page can contain one or more functions, for example, an application page can be a music playback interface, or a page consisting of a music list and music playback; an application service corresponds to one function, for example, an application service is a timer or counter, and when the application uses the function, it needs to call the application service corresponding to the function.
[0078] In the implementation architecture of the first application, the first application includes at least one container, each container is used to load at least one application page, or to load at least one application service, or to load at least one application page and at least one application service. The container can automatically adapt to different device types when loading application pages or application services, and the container can be represented by aspect. In one example, Figure 2 is a schematic diagram of an implementation architecture of a first application according to an exemplary embodiment. Figure 2 As shown, the first application in the electronic device includes three levels, namely, container, application page / application service, and functions provided by the application. The container includes application page / application service, and the application page / application service includes functions provided by the application.
[0079] According to the user operation instruction, the interface to be run by the first application is determined. For example, when the user opens the first application by clicking the icon of the first application, the interface to be run by the first application is the startup page, and after the startup page runs, the interface to be run is the home page. When the user clicks an icon in the home page, the interface to be run by the first application is the function page corresponding to the icon.
[0080] In step S102, the container configuration information is pre-stored in the program package of the first application by the developer, and the container configuration information includes a mapping relationship between device information and container information. The device information is the type identifier of the electronic device, which is an identifier that can be used to distinguish different types of electronic devices such as mobile phones, tablets, watches, and car computers; the container information includes a container identifier, which is an identifier that can be used to distinguish different containers in the first application such as container 1, container 2, and container 3.
[0081] The container configuration information is used to characterize the containers supported by each type of device. For example, the interface to be run by the first application includes three containers, and the container configuration information includes the following two sets of mapping relationships: mobile phone - container 1, container 2, container 3; tablet - container 1, container 2, which means that the mobile phone supports running container 1, container 2 and container 3, and the tablet supports running container 1 and container 2, but does not support running container 3.
[0082] In one example, Figure 3 is a schematic diagram of a development structure of a first application according to an exemplary embodiment. Figure 3 As shown, when developing the project corresponding to the first application, the first application includes the execution file app, container aspect1 and container aspect2. Among them, the execution file app includes the core configuration file app.js / app.ts of the first application, the container configuration information manifest.json in the first application, and the application resource resouce of the first application. The container configuration information manifest.json in the first application includes the mapping relationship between device information and container information. The application resource resouce of the first application includes image resources such as application icon iccon.jpg, interface layout resources, menu resources, string resources and other static content; container aspect1 and container aspect2 both include the configuration file config.json of the container and the code file src of the container. The code file src of the container includes the front-end code file aspect.ux of the application page in the container, the declaration file manifest.json of the container, the container resource resouce, and the back-end code file pages of the application page in the container. After the development is completed, the execution file app, container aspect1 and container aspect2 of the first application are respectively encapsulated into a data package, and then the entire project project of the first application is encapsulated into a data package, thereby obtaining the first application.
[0083] In step S103, the device information of the first device is obtained, and the container identifier corresponding to the device information of the first device is queried in the container configuration information to determine the container supported by the first device, and then the container identifier of the first container is determined according to the interface to be run by the first application, and the first container to be run is determined according to the container identifier, and the first container is the container supported by the first device in the interface to be run by the first application. The number of containers in the first container is determined according to actual conditions, and the first container may include one or more containers.
[0084] In step S104, the first container loads the first application page in the first container, or loads the first application service in the first container, or loads the first application page and the first application service in the first container, so as to run the interface to be run by the first application. When the first application page includes multiple application pages, one or more application pages of the multiple application pages can be displayed in the interface to be run.
[0085] In the exemplary embodiment of the present disclosure, by adding a container for loading application pages and / or application services in the first application, the application code of the first application can be reused on different types of electronic devices, without developing and maintaining multiple sets of application codes of the first application for different types of electronic devices, thereby reducing implementation complexity and development and maintenance costs. In addition, by determining the first container supported by the first device for running according to the container configuration information, different types of electronic devices can be adapted when running the first application to meet the requirement that the first application can run on multiple types of electronic devices.
[0086] With the development of communication technology, multiple electronic devices can be interconnected to form a network, so that the application page or application service on one device can be used on another device. This scenario is called the collaborative operation of applications. In the related art, since the application code of the first application is developed separately in different types of electronic devices, and the application page is directly loaded to run the first application, when different types of electronic devices are operated in a collaborative manner, a detection function for whether to turn on the collaborative operation needs to be added to the application page of each type of electronic device, and a collaborative business logic needs to be added to the application page, and the collaborative operation mode is pre-set in the collaborative business logic, for example: when the first device and the second device are operated in a collaborative manner, the first condition is met, and the application page 1 is displayed in the first device, and the application page 2 is hidden, and the application page 1 is hidden in the second device; the second condition is met, and the application page 2 is displayed in the first device, and the application page 1 is hidden, and the application page 1 is displayed in the second device, and the application page 2 is hidden. When the application page is determined to start the collaborative operation, the target application page to be displayed by each device can only be determined according to the pre-set collaborative operation mode. Therefore, the implementation complexity of each application page is relatively high. When the number of collaborative devices increases, the complexity of the collaborative business logic code will become more complex. In addition, the collaborative business logic code has great limitations, and it is difficult to achieve a more complex collaborative operation mode. Therefore, the collaborative operation mode of the application is relatively simple.
[0087] In an exemplary embodiment of the present disclosure, in order to overcome the problems existing in the collaborative operation in the related art, a method for running an application is provided and applied to a first device. Figure 4 is a flowchart of an application running method according to an exemplary embodiment. Figure 4 As shown, the following steps are included:
[0088] Step S401, determining an interface on which a first application is to run, the first application comprising at least one container, each container being used to load at least one application page and / or at least one application service;
[0089] Step S402, when starting collaborative operation, determining that the collaborative device of the first device is a second device, and the collaborative device includes at least one second device;
[0090] Step S403, obtaining container configuration information, where the container configuration information includes a mapping relationship between device information and container information;
[0091] Step S404, determining a container identifier of the first container according to the container configuration information and the device information of the first device;
[0092] Step S405, determining a container identifier of the second container according to the container configuration information and the device information of the second device;
[0093] Step S406, loading a first application page and / or a first application service on the first device through the first container;
[0094] Step S407: Send the container identifier of the second container to the second device through the connection module, so that the second device loads the second application page and / or the second application service through the second container.
[0095] The specific implementation of step S401 refers to step S101 and will not be described in detail here.
[0096] In step S402, the first application in the first device detects in real time whether the conditions for starting the collaborative operation are met, such as receiving a start instruction for the collaborative operation, or detecting that the conditions for automatically starting the collaborative operation are met. When it is determined that the conditions for starting the collaborative operation are met, the collaborative operation is started. When the collaborative operation is started, the collaborative device is monitored in real time. The number of collaborative devices can be one or more, and the collaborative device is used as the second device. The device identifier of the second device can be the same as or different from the device identifier of the first device, that is, the device type of the second device can be the same as or different from the device type of the first device.
[0097] In step S403, the container information in the container configuration information also includes the operation characteristics of the container. The identifier of the operation characteristics and the meaning represented are preset values and can be determined according to actual conditions. For example: when the operation characteristics of container 1 are default in the mapping relationship between container 1 and device 1, it means that container 1 runs by default in device 1; when the operation characteristics of container 1 are tog2, it means that container 1 can run on two types of devices at the same time; when the operation characteristics of container 1 are tog2 in the mapping relationship between container 1 and device 1 and in the mapping relationship between container 1 and device 2, it means that container 1 can run on device 1 and device 2 at the same time.
[0098] In step S404 and step S405, according to the device information of the first device and the device information of the second device, the container information corresponding to the device information, that is, the container identification and the container operation characteristics are searched in the container configuration information, and the container identification and the container operation characteristics are combined for judgment, and according to the interface to be run by the first application, the container identification of the first container and the container identification of the second container are respectively obtained. When there are multiple second devices, the container identification of the second container of each second device is determined respectively.
[0099] In one example, the interface to be run by the first application includes container 1, container 2, and container 3, device 1 supports running container 1 and container 2, and device 2 supports running container 2 and container 3. If the running feature of container 2 on device 1 is default, and the running feature of container 2 is tog2, the first container identifier is container 1 and container 2, and the second container identifier can be container 2 and container 3, or container 3.
[0100] It should be noted that when executing step S404 and step S405, the order is not distinguished and they can be executed simultaneously.
[0101] In step S406, the first container loads the first application page in the first container, or loads the first application service in the first container, or loads the first application page and the first application service in the first container, so as to run the interface to be run by the first application. When the first application page includes multiple application pages, one or more application pages of the multiple application pages can be displayed in the interface to be run.
[0102] In some possible implementations, if the first application page includes multiple application pages, a first operation instruction is received, a first target application page is determined according to the first operation instruction, and the first target application page is displayed on the first device.
[0103] The first operation instruction is the user's operation instruction. The user can select the application interface to be displayed when multiple application pages are displayed, that is, the first target application page. The user can also switch to other application pages after selecting the application interface to be displayed. The application page after switching is the first target application page.
[0104] According to the first operation instruction, the first target application page is determined, and personalized settings of the collaborative operation mode can be implemented according to the needs of different users.
[0105] In step S407, the first device and the second device include a connection module, the connection module is used for communication between the devices, and the container identifier of the second container is sent to the second device through the connection module, so that the second device loads the second application page and / or the second application service through the second container, so that the first application runs collaboratively on the first device and the second device. When there are multiple second devices, the container identifiers of the second container are sent to the corresponding second devices respectively.
[0106] It should be noted that when executing step S406 and step S407, the order is not distinguished and they can be executed simultaneously.
[0107] In one example, the interface to be run by the first application includes container aspect1, container aspect2, container aspect3 and container aspect4. The first three containers each include an application page page, and container aspect4 includes an application service. The first application App runs on the first device device A and the second device device B. The first container includes container aspect1 and container aspect2, and the second container includes container aspect3 and container aspect4. Then Figure 5 It is a schematic diagram of cooperative operation according to an exemplary embodiment.
[0108] In one example, the first application is a mailbox application, and the interface to be run by the first application includes the following containers: folderAspect, listAspect, detailAspect, and noticeAspect, wherein folderAspect includes a mailbox folder page folder, listAspect includes a mail list page list, detailAspect includes a mail detail page detail, and noticeAspect includes a mail notification page notice. The first device is a mobile phone, and the second device is a tablet and a watch, wherein both the mobile phone and the tablet support running folderAspect, listAspect, and detailAspect, and the watch supports detailAspect and noticeAspect. Fig. 6Ais a schematic diagram of a separate operation according to an exemplary embodiment, such as Fig. 6A As shown, when the first application is run alone on the mobile phone, the mailbox folder page folder, the email list page list, and the email details page detail are loaded respectively through folderAspect, listAspect, and detailAspect. Figure 6B and Figure 6C is a schematic diagram of cooperative operation according to an exemplary embodiment, such as Figure 6B As shown, when the first application runs on the mobile phone and the tablet in coordination, the first container of the mobile phone is determined to be folderAspect, and the second container of the tablet is listAspect and detailAspect. Then, the mailbox folder page folder is loaded on the mobile phone through folderAspect, and the mail list page list and mail detail page detail are loaded on the tablet through listAspect and detailAspect respectively; as shown in FIG. Figure 6C As shown, when the first application is run collaboratively on a mobile phone, a tablet and a watch, the first container of the mobile phone is determined to be folderAspect, the second containers of the tablet are listAspect and detailAspect, and the second container of the watch is noticeAspect. Then, on the mobile phone, the mailbox folder page folder is loaded through folderAspect, on the tablet, the email list page list and the email details page detail are loaded respectively through listAspect and detailAspect, and on the watch, the email notification page notice is loaded through noticeAspect.
[0109] In the exemplary embodiments of the present disclosure, since the container can be reused on different types of electronic devices, the container can be flexibly transferred and coordinated between multiple electronic devices. The first application determines whether to enable collaborative operation, and when it is determined to enable collaborative operation, the container to be run on each device is determined according to the container configuration information. Therefore, there is no need to add collaborative operation judgment logic code and complex business logic code to the container, which can reduce the implementation complexity of the application page and more simply implement collaborative operation on multiple electronic devices. In addition, by determining the container to be run on each device according to the container configuration information, a variety of flexible collaborative operation modes can be implemented, thereby enriching the collaborative operation mode of the application.
[0110] In some possible implementations, the above embodiment further includes: when the collaborative operation is started, synchronizing the application lifecycle of the first device and the application lifecycle of the second device through the connection module.
[0111] The application lifecycle represents the entire process from the creation to the extinction of the application process of the first application. The application lifecycle of the first device and the application lifecycle of the second device are synchronized by the connection module. When running in collaboration, it can ensure that the application process of the first application on each device is in the same stage to ensure consistency between multiple devices.
[0112] In one example, the application lifecycle sent by the second device is received through the connection module.
[0113] The first device ensures the synchronization of application life cycles of multiple devices, and after knowing the application life cycle of the second device, controls the application life cycle of the second device to be consistent with the application life cycle of the first device.
[0114] In some possible implementations, the above embodiment also includes: when starting collaborative operation, synchronizing container operation information of the first device and container operation information of the second device through a connection module, and the container operation information includes the life cycle of the container and the operation status of the container.
[0115] The life cycle of a container represents the entire process from the creation to the extinction of a container process. The running state of a container represents the start or stop state of a function in the container. For example, the running state of a container on a music playback page includes the music playback state and the music pause state. By synchronizing the container running information of the first device and the container running information of the second device through a connection module, when running in coordination, the coordination of the same container on different devices can be relatively simple, without the need to query the running information of containers on different devices in sequence through communication.
[0116] In one example, the container operation information sent by the second device is received through the connection module.
[0117] The first device ensures the coordination of container operation information of multiple devices. After obtaining the container operation information of the second device, the first device controls the same container to run in coordination with the second device and the first device. For example, when the container of the music playback page is run on the first device and the second device at the same time, one of them is controlled to be in the music playback state and the other is in the paused playback state.
[0118] In one example, Figure 7 FIG. 1 is a schematic diagram showing synchronization of an application life cycle and a container life cycle according to an exemplary embodiment. Figure 7 As shown, the first device and the second device synchronize the application lifecycle and the container lifecycle through the connection module to collaboratively manage them.
[0119] In an exemplary embodiment of the present disclosure, a method for running an application is provided, which is applied to a second device. Figure 8 is a flowchart of an application running method according to an exemplary embodiment. Figure 8 As shown, the following steps are included:
[0120] Step S801, when starting collaborative operation, determining that the second device is a collaborative device of the first device;
[0121] Step S802, receiving the container identifier sent by the first device through the connection module, and determining the second container according to the container identifier;
[0122] Step S803: Load a second application page and / or a second application service on the second device through the second container.
[0123] When the first application is opened in the second device, the first application detects in real time whether the conditions for opening the collaborative operation are met, such as receiving a collaborative operation opening instruction, or detecting that the conditions for automatically opening the collaborative operation are met. When it is determined that the conditions for opening the collaborative operation are met, the collaborative operation is opened. The collaborative operation that can be joined is detected. When it is detected that the first device has opened the collaborative operation, the first device is joined in the collaborative operation. The number of collaborative devices can be one as the collaborative device of the first device.
[0124] After joining the collaborative operation of the first device, the message of the first device is monitored in real time, the container identifier sent by the first device is received through the connection module, and the second container in the first application is determined according to the container identifier. The second container represents the container that the second device supports and can cooperate with the first device in the interface to be run by the first application. The interface to be collaboratively run can be run by loading the second application page in the second container through the second container, or loading the second application service in the second container, or loading the second application page and the second application service in the second container. When the second application page includes multiple application pages, one or more of the multiple application pages can be displayed in the interface to be run.
[0125] In some possible implementations, if the second application page includes multiple application pages, a second operation instruction is received, a second target application page is determined according to the second operation instruction, and the second target application page is displayed on the second device.
[0126] The second operation instruction is the user's operation instruction. When multiple application pages are displayed, the user can select the application interface to be displayed, that is, the second target application page. The user can also switch to other application pages after selecting the application interface to be displayed. The switched application page is the second target application page. According to the second operation instruction, the second target application page is determined, and the personalized setting of the collaborative operation mode can be realized according to the needs of different users.
[0127] In some possible implementations, the method further includes: when starting the collaborative operation, sending the application lifecycle of the second device to the first device through the connection module.
[0128] In some possible implementations, the method further includes: when starting collaborative operation, sending container operation information of the second device to the first device through the connection module, where the container operation information includes the life cycle of the container and the operation status of the container.
[0129] In the exemplary embodiment of the present disclosure, there is no need to add collaborative judgment logic code and complex business logic code in the container, which can reduce the implementation complexity of the application page and make it easier to cooperate with the collaborative operation of the first device.
[0130] In an exemplary embodiment of the present disclosure, in order to overcome the problems existing in the collaborative operation in the related art, a method for running an application is provided. Fig. 9 is an interactive flow chart of an application running method according to an exemplary embodiment. Fig. 9 As shown, the following steps are included:
[0131] Step S901: The first device determines an interface on which a first application is to run, where the first application includes at least one container, and each container is used to load at least one application page and / or at least one application service;
[0132] Step S902, the first device starts collaborative operation and detects the collaborative device;
[0133] Step S903, the second device starts collaborative operation and joins the collaborative operation of the first device;
[0134] Step S904: The first device obtains container configuration information, where the container configuration information includes a mapping relationship between device information and container information;
[0135] Step S905: The first device determines a container identifier of the first container according to the container configuration information and the device information of the first device, and determines a container identifier of the second container according to the container configuration information and the device information of the second device;
[0136] Step S906: The first device loads the first application page and / or the first application service through the first container;
[0137] Step S907, the first device sends the container identifier of the second container to the second device through the connection module;
[0138] Step S908: The second device receives the container identifier sent by the first device through the connection module, and determines the second container according to the container identifier;
[0139] Step S909: the second device loads the second application page and / or the second application service through the second container;
[0140] Step S910, the second device sends the application lifecycle and container lifecycle of the second device to the first device through the connection module;
[0141] Step S911: The first device collaboratively manages an application lifecycle of a first application on the first device and an application lifecycle of the first application on the second device, and collaboratively manages a container lifecycle of a first container on the first device and a container lifecycle of a second container on the second device.
[0142] In one example, Fig.10 is an interactive flow chart of an application running method according to an exemplary embodiment. Fig.10 As shown, device 1 starts the first application, starts the initial container aspect, and starts the collaborative operation; at this time, device 2 starts the first application, starts the initial container aspect, starts the collaborative operation, and joins the collaborative operation of device 1, and device 1 monitors that device 1 has joined; device 1 calculates the display result according to the container configuration information, determines that container aspect1 and container aspect2 are displayed on device 1, and container aspect3 is displayed on device 2; device 1 sends the display result to device 2 through the connection module, and displays aspect1 and aspect2 on device 1; after device 2 receives the display result, it displays aspect3 on device 2 ; At this time, device 3 starts the first application, starts the initial container aspect, starts collaborative operation, and joins the collaborative operation of the device. Device 1 listens to the joining of device 3; Device 1 recalculates the display result according to the container configuration information, and determines that container aspect1 is displayed on device 1, container aspect2 is displayed on device 2, and container aspect3 is displayed on device 3; Device 1 sends the display result to device 2 and device 3 respectively through the connection module, and displays aspect1 on device 1; After receiving the display result, device 2 displays aspect2 on device 2; After receiving the display result, device 3 displays aspect3 on device 3.
[0143] In an exemplary embodiment of the present disclosure, an application running apparatus is provided, which is applied to a first device. Fig.11 is a block diagram of an application running device according to an exemplary embodiment. Fig.11 As shown, the device comprises:
[0144] The determination module 1101 is configured to determine an interface to be run by a first application, wherein the first application includes at least one container, each of which is used to load at least one application page and / or at least one application service;
[0145] An acquisition module 1102 is configured to acquire container configuration information, where the container configuration information includes a mapping relationship between device information and container information;
[0146] The processing module 1103 is configured to determine a container identifier of the first container according to the container configuration information and the device information of the first device;
[0147] The loading module 1104 is configured to load a first application page and / or a first application service on the first device through the first container.
[0148] In an exemplary embodiment, the determination module 1101 is further configured to:
[0149] When starting collaborative operation, determining that a collaborative device of the first device is a second device, the collaborative device includes at least one of the second devices;
[0150] The processing module 1103 is further configured to:
[0151] Determine a container identifier of the second container according to the container configuration information and the device information of the second device;
[0152] The container identifier of the second container is sent to the second device through the connection module, so that the second device loads the second application page and / or the second application service through the second container.
[0153] In an exemplary embodiment, the application execution device further includes a synchronization module 1105 configured to:
[0154] When the collaborative operation is started, the application lifecycle of the first device and the application lifecycle of the second device are synchronized through the connection module.
[0155] In an exemplary embodiment, the synchronization module 1105 is further configured to:
[0156] The application life cycle sent by the second device is received through the connection module.
[0157] In an exemplary embodiment, the synchronization module 1105 is further configured to:
[0158] When collaborative operation is started, the container operation information of the first device and the container operation information of the second device are synchronized through the connection module, and the container operation information includes the life cycle of the container and the operation status of the container.
[0159] In an exemplary embodiment, the synchronization module 1105 is further configured to:
[0160] The container operation information sent by the second device is received through the connection module.
[0161] In an exemplary embodiment, the loading module 1104 is further configured to:
[0162] When starting the collaborative operation, if the first application page includes multiple application pages, receiving a first operation instruction;
[0163] According to the first operation instruction, a first target application page is determined, and the first target application page is displayed on the first device.
[0164] In an exemplary embodiment of the present disclosure, an application running apparatus is provided, which is applied to a second device. Fig.12 is a block diagram of an application running device according to an exemplary embodiment. Fig.12 As shown, the device comprises:
[0165] The collaboration module 1201 is configured to determine that the second device is a collaborative device of the first device when collaborative operation is started;
[0166] The processing module 1202 is configured to receive the container identifier sent by the first device through the connection module, and determine the second container according to the container identifier;
[0167] The loading module 1203 is configured to load a second application page and / or a second application service on the second device through the second container.
[0168] In an exemplary embodiment, the application execution device further includes a synchronization module 1204 configured to:
[0169] When the collaborative operation is started, the application lifecycle of the second device is sent to the first device through the connection module.
[0170] In an exemplary embodiment, the synchronization module 1204 is further configured to:
[0171] When collaborative operation is started, container operation information of the second device is sent to the first device through the connection module, where the container operation information includes the life cycle of the container and the operation status of the container.
[0172] In an exemplary embodiment, the loading module 1203 is further configured to:
[0173] When the collaborative operation is started, if the second application page includes multiple application pages, receiving a second operation instruction;
[0174] According to the second operation instruction, a second target application page is determined, and the second target application page is displayed on the second device.
[0175] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0176] Fig.13 is a block diagram of an electronic device 1300 according to an exemplary embodiment.
[0177] Reference Fig.13 , the electronic device 1300 may include one or more of the following components: a processing component 1302 , a memory 1304 , a power component 1306 , a multimedia component 1308 , an audio component 1310 , an input / output (I / O) interface 1312 , a sensor component 1314 , and a communication component 1316 .
[0178] The processing component 1302 generally controls the overall operation of the electronic device 1300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1302 may include one or more processors 1320 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1302 may include one or more modules to facilitate the interaction between the processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate the interaction between the multimedia component 1308 and the processing component 1302.
[0179] The memory 1304 is configured to store various types of data to support operations on the electronic device 1300. Examples of such data include instructions for any application or method operating on the electronic device 1300, contact data, phone book data, messages, pictures, videos, etc. The memory 1304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0180] The power supply component 1306 provides power to the various components of the electronic device 1300. The power supply component 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1300.
[0181] The multimedia component 1308 includes a screen that provides an output interface between the electronic device 1300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front camera and / or a rear camera. When the electronic device 1300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0182] The audio component 1310 is configured to output and / or input audio signals. For example, the audio component 1310 includes a microphone (MIC), and when the electronic device 1300 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1304 or sent via the communication component 1316. In some embodiments, the audio component 1310 also includes a speaker for outputting audio signals.
[0183] I / O interface 1312 provides an interface between processing component 1302 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0184] The sensor assembly 1314 includes one or more sensors for providing various aspects of status assessment for the electronic device 1300. For example, the sensor assembly 1314 can detect the open / closed state of the electronic device 1300, the relative positioning of components, such as the display and keypad of the electronic device 1300, and the sensor assembly 1314 can also detect the position change of the electronic device 1300 or a component of the electronic device 1300, the presence or absence of user contact with the electronic device 1300, the orientation or acceleration / deceleration of the electronic device 1300, and the temperature change of the electronic device 1300. The sensor assembly 1314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1314 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0185] The communication component 1316 is configured to facilitate wired or wireless communication between the electronic device 1300 and other devices. The electronic device 1300 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1316 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0186] In an exemplary embodiment, the electronic device 1300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0187] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1304 including instructions, and the instructions can be executed by a processor 1320 of the electronic device 1300 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0188] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute an application running method, the method including any of the above methods.
[0189] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0190] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An application running method, applied to a first device, characterized in that: The method comprises: Determining an interface on which a first application is to run, the first application comprising at least one container, each of the containers being used to load at least one application page and / or at least one application service; Acquire container configuration information, where the container configuration information includes a mapping relationship between device information and container information; Determine a container identifier of the first container according to the container configuration information and the device information of the first device; A first application page and / or a first application service is loaded on the first device through the first container.
2. The application running method according to claim 1, characterized in that: Before obtaining the container configuration information, the method further includes: When starting collaborative operation, determining that a collaborative device of the first device is a second device, the collaborative device includes at least one of the second devices; After obtaining the container configuration information, the method further includes: Determine a container identifier of the second container according to the container configuration information and the device information of the second device; The container identifier of the second container is sent to the second device through the connection module, so that the second device loads the second application page and / or the second application service through the second container.
3. The application running method according to claim 2, characterized in that: The method further comprises: When the collaborative operation is started, the application lifecycle of the first device and the application lifecycle of the second device are synchronized through the connection module.
4. The application running method according to claim 3, characterized in that: The synchronizing the application lifecycle of the first device and the application lifecycle of the second device by the connection module includes: The application life cycle sent by the second device is received through the connection module.
5. The application running method according to claim 2, characterized in that: The method further comprises: When collaborative operation is started, the container operation information of the first device and the container operation information of the second device are synchronized through the connection module, and the container operation information includes the life cycle of the container and the operation status of the container.
6. The application running method according to claim 5, characterized in that: The synchronizing the container operation information of the first device and the container operation information of the second device through the connection module includes: The container operation information sent by the second device is received through the connection module.
7. The application running method according to claim 2, characterized in that: The method further comprises: When starting the collaborative operation, if the first application page includes multiple application pages, receiving a first operation instruction; According to the first operation instruction, a first target application page is determined, and the first target application page is displayed on the first device.
8. An application running method, applied to a second device, characterized in that: The method comprises: When starting collaborative operation, determining the second device as a collaborative device of the first device; receiving, through a connection module, a container identifier sent by the first device, and determining a second container according to the container identifier; A second application page and / or a second application service is loaded on the second device through the second container.
9. The application running method according to claim 8, characterized in that: The method further comprises: When the collaborative operation is started, the application lifecycle of the second device is sent to the first device through the connection module.
10. The application running method according to claim 8, characterized in that: The method further comprises: When collaborative operation is started, container operation information of the second device is sent to the first device through the connection module, where the container operation information includes the life cycle of the container and the operation status of the container.
11. The application running method according to claim 8, characterized in that: The method further comprises: When the collaborative operation is started, if the second application page includes multiple application pages, receiving a second operation instruction; According to the second operation instruction, a second target application page is determined, and the second target application page is displayed on the second device.
12. An application running device, applied to a first device, characterized in that: The device comprises: A determination module is configured to determine an interface to be run by a first application, wherein the first application includes at least one container, each of which is used to load at least one application page and / or at least one application service; An acquisition module is configured to acquire container configuration information, where the container configuration information includes a mapping relationship between device information and container information; a processing module, configured to determine a container identifier of the first container according to the container configuration information and the device information of the first device; The loading module is configured to load a first application page and / or a first application service on the first device through the first container.
13. An application running device, applied to a second device, characterized in that: The device comprises: A collaboration module, configured to determine that the second device is a collaborative device of the first device when collaborative operation is started; a processing module, further configured to receive the container identifier sent by the first device through the connection module, and determine the second container according to the container identifier; The loading module is configured to load a second application page and / or a second application service on the second device through the second container.
14. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 7 or claims 8 to 11.
15. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 7 or claims 8 to 11.