WO2022156535A1 - 分布式应用的处理方法和装置 - Google Patents
分布式应用的处理方法和装置 Download PDFInfo
- Publication number
- WO2022156535A1 WO2022156535A1 PCT/CN2022/070318 CN2022070318W WO2022156535A1 WO 2022156535 A1 WO2022156535 A1 WO 2022156535A1 CN 2022070318 W CN2022070318 W CN 2022070318W WO 2022156535 A1 WO2022156535 A1 WO 2022156535A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- task
- distributed
- module
- request
- function module
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 11
- 230000006870 function Effects 0.000 claims abstract description 438
- 238000012545 processing Methods 0.000 claims abstract description 270
- 238000000034 method Methods 0.000 claims abstract description 171
- 230000008569 process Effects 0.000 claims abstract description 42
- 238000009434 installation Methods 0.000 claims description 272
- 238000012544 monitoring process Methods 0.000 claims description 106
- 238000012217 deletion Methods 0.000 claims description 100
- 230000037430 deletion Effects 0.000 claims description 100
- 230000004044 response Effects 0.000 claims description 96
- 238000004891 communication Methods 0.000 claims description 29
- 238000004590 computer program Methods 0.000 claims description 26
- 239000000725 suspension Substances 0.000 claims description 22
- 238000012790 confirmation Methods 0.000 claims description 4
- 238000007726 management method Methods 0.000 description 303
- 238000013461 design Methods 0.000 description 92
- 238000010586 diagram Methods 0.000 description 29
- 230000005236 sound signal Effects 0.000 description 11
- 210000000988 bone and bone Anatomy 0.000 description 10
- 238000010295 mobile communication Methods 0.000 description 10
- 238000011900 installation process Methods 0.000 description 8
- 238000011161 development Methods 0.000 description 7
- 230000002452 interceptive effect Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000001960 triggered effect Effects 0.000 description 5
- 238000013528 artificial neural network Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 229920001621 AMOLED Polymers 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000036772 blood pressure Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 240000007594 Oryza sativa Species 0.000 description 1
- 235000007164 Oryza sativa Nutrition 0.000 description 1
- 210000000577 adipose tissue Anatomy 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000010009 beating Methods 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 239000004020 conductor Substances 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000005315 distribution function Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000001939 inductive effect Effects 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 235000009566 rice Nutrition 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 238000010408 sweeping Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 230000001755 vocal effect Effects 0.000 description 1
- 238000005406 washing Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Definitions
- the present application relates to the field of communication technologies, and in particular, to a method and apparatus for processing distributed applications.
- a distributed operating system was created. Different from the traditional single-device OS, the distributed OS is a multi-device OS.
- the main functions of distributed OS include: distributed task scheduling, distributed data management, hardware capability virtualization and distributed soft bus. Among them, hardware capabilities are virtualized as shared resources, and distributed soft buses connect different terminals, so as to realize mutual assistance and sharing of capabilities among terminals and bring the best collaborative experience.
- distributed OS can realize the interconnection of mobile phones, tablet computers, TVs, and routers, and multiple interconnected devices can cooperate to complete one or more functions.
- Functions that are performed collaboratively by multiple devices can be called distributed functions.
- distributed functions are prefabricated in devices and belong to the system's own functions, resulting in poor portability of distributed functions.
- the embodiments of the present application provide a method and apparatus for processing distributed applications, which can install the functions of an app on multiple electronic devices in a distributed manner, and the multiple electronic devices can jointly complete the functions of the app, thereby improving the performance of distributed functions. portability.
- an embodiment of the present application provides a method for processing a distributed application, the method is applied to a first device, the first device includes a distributed application, the distributed application includes a plurality of functional modules, the A first-type functional module in the plurality of functional modules is installed on the first device, and a second-type functional module in the plurality of functional modules is installed in a slave device, and the first device and at least one slave device pass through
- the distributed operating system OS communicates, and the first device is a device that downloads the installation file of the distributed application.
- the method includes: monitoring a first task processing request, where the first task processing request is used to request processing of the first task; and determining from the at least one slave device whether the first task is to be processed.
- a target device for processing the first task sending a task processing command to the target device, and receiving the processing result of the first task by the target device.
- the task processing request triggered on the first device with the distributed app installed can be processed by the slave device with the distributed app installed, and the task is returned to the first device.
- the functions of the app are jointly completed by the plurality of electronic devices, which improves the portability of the distributed functions.
- the determining a target device for processing the first task from the at least one slave device includes: when at least two slave devices in the at least one slave device can process all the slave devices When the first task is processed, a first interface is displayed, and the first interface includes the options of the at least two slave devices; the first selection operation by the user on the options of the at least two slave devices is received, and the The slave device corresponding to the first selection operation is the target device.
- the user By displaying the first interface to the user, the user selects a specific device for processing the task processing request through the first interface, which brings a better experience to the user.
- the method further includes: displaying the processing result of the first task.
- the method further includes: determining to perform distributed installation of the distributed application, determining a slave device for installing the distributed application and a function module of the distributed application installed on the slave device , sending the installation file corresponding to the function module of the distributed application to the corresponding slave device.
- the determining to perform distributed installation of the distributed application includes: detecting that the installation file of the distributed application includes first indication information, where the first indication information is used to indicate The distributed application supports distributed functions; according to the first indication information, it is determined to perform distributed installation on the distributed application.
- the determining to perform distributed installation of the distributed application includes: detecting that the installation file of the distributed application includes first indication information, where the first indication information is used to indicate The distributed application supports distributed functions; displays a second interface according to the first indication information, and the second interface includes a distributed installation option; receives a user's confirmation operation for the distributed installation option, according to the The confirming operation determines the distributed installation of the distributed application.
- the determining of the slave device on which the distributed application is installed and the function module of the distributed application installed on the slave device includes: displaying a third interface, where the third interface includes capable of Install candidate devices of the distributed application and options for functional modules that can be installed on each candidate device; receive a second selection operation by the user on the functional modules that can be installed on the candidate device, and determine the installation according to the second selection operation A slave device of the distributed application, and a function module installed on the slave device.
- the determining the slave device on which the distributed application is installed and the function module of the distributed application installed on the slave device includes: displaying a fourth interface, where the fourth interface includes a device capable of an option to install the candidate device of the distributed application; receive a third selection operation of the candidate device by the user, and determine the slave device to install the distributed application according to the third selection operation; display a fifth interface, the The fifth interface displays options of function modules that can be installed on the slave device; receives a fourth selection operation by the user on the function modules that can be installed on the slave device, and determines the slave device according to the fourth operation. Installed function modules.
- the method further includes: when receiving the installation completion response messages returned by all the slave devices, confirming that all The distributed application is installed successfully; a fifth interface is displayed, and the fifth interface is used to notify the distributed application that the installation is complete.
- a second aspect of the present application provides a method for processing a distributed application, where the method is applied to a first device, where the first device includes a distributed application, the distributed application includes multiple functional modules, and the multiple functional modules A first-type functional module in the modules is installed on the first device, and a second-type functional module in the plurality of functional modules is installed in at least one slave device through the first device and the at least one slave device.
- the first device is a device that downloads the installation file of the distributed application
- the method includes: receiving a task status query request input by a user, the task status query request is used to request to query all the status of the task currently being processed in the distributed application; according to the task status query request, determine a second device with a task processing function from the at least one slave device; request the second device from the second device The status of the processed tasks, displaying the status of the tasks processed by the second device.
- the user can query the status of the tasks processed on each device through the query interface, which is convenient for the user to know the status of the task.
- the method further includes: receiving a task deletion request input by the user according to the state of the task processed by the second device; and sending the task deletion request to the second device.
- the method further includes: receiving a task suspension request input by a user according to a state of a task processed by the second device, and sending the task suspension request to the second device.
- a third aspect of the present application provides a method for processing a distributed application, where the method is applied to a first device, where the first device includes a distributed application, the distributed application includes multiple functional modules, and the multiple functional modules A first type of functional module in the modules is installed on the first device, and a second type of functional module in the plurality of functional modules is installed in a slave device, and the first device and at least one slave device operate through distributed operation system OS communication, the first device is a device that downloads the installation file of the distributed application, and the method includes: receiving a management request input by a user, and displaying, according to the management request, a slave device that has installed the distributed application. A device and a functional module installed on the first device.
- the method can flexibly manage the function modules of the distributed application, and flexibly adjust the function modules on each device, for example, add or delete the function modules of a certain device.
- the method further includes: receiving a function module addition request input by a user; when the function module addition request is used to add a function module on the first device, according to the function module addition request The added function module is installed on the first device; when the function module addition request is for adding a function module on the slave device, the function module addition request is sent to the slave device that needs to add the function module.
- the method further includes: updating information of the function module installed on the first device.
- the method further includes: receiving a function module addition response sent by the slave device; and updating the function module addition response according to the function module addition response.
- Information about the function modules installed on the slave device stored on the first device.
- the method further includes: receiving a function module deletion request input by a user; when the function module deletion request is used to delete a function module on the first device, delete the function module according to the function module deletion request. Request to delete the corresponding function module on the first device; when the function module addition request is used to delete the function module on the slave device, send the function module deletion request to the slave device that needs to delete the function module.
- the method further includes: updating information of the function module installed on the first device.
- the method further includes: receiving a function module deletion response sent by the slave device; updating the function module deletion response according to the function module deletion response.
- an embodiment of the present application provides a method for processing a distributed application, where the method is applied to a slave device of a distributed application, where the distributed application includes multiple functional modules, and the first one of the multiple functional modules is One type of functional module is installed in a first device, and a second type of functional module among the plurality of functional modules is installed in a slave device, where the first device is a device that downloads an installation file of the distributed application, and the The first device and at least one slave device communicate through a distributed operating system OS, and the method includes: receiving an installation file of at least one function module of the distributed application sent by the first device, according to the at least one function module installation file to install the corresponding function module.
- the master device sends some functional modules of the distributed application to the slave device, and the slave device completes the installation of the corresponding functional modules, so that the master device and the slave device cooperate to realize the function of the distributed app.
- the method further includes: monitoring a first task processing request, where the first task processing request is used to request processing of the first task; and determining whether to process the first task according to the first task processing request
- the target device that processes the first task, sends a task processing command to the target device, and receives the processing result of the first task by the target device.
- the determining a target device to process the first task according to the first task processing request includes: requesting the first device for a target device capable of processing the first task. slave device; when there are at least two slave devices that can process the first task, display a first interface, and the first interface includes options for the at least two slave devices; receive the user's response to the at least two slave devices The first selection operation of the options of the slave device determines that the slave device corresponding to the first selection operation is the target device.
- the method further includes: receiving a task status query request input by a user, where the task status query request is used to request to query the status of a task currently being processed in the distributed application;
- the status query request determines a second device with a task processing function, requests the second device for the status of the task processed by the second device, and displays the status of the task processed by the second device.
- the method further includes: receiving a task deletion request input by the user according to the state of the task processed by the second device, and sending the task deletion request to the second device.
- the method further includes: receiving a task suspension request input by a user according to a state of a task processed by the second device, and sending the task suspension request to the second device.
- the method further includes: receiving a task processing command sent by the first device, where the task processing command is used to instruct to process the first task; The first task is processed, and the processing result of the first task is sent to the first device.
- the method further includes: receiving a request for adding a function module sent by the first device, installing the added function module on the slave device according to the request for adding a function module, and sending an additional function module to the first device.
- a device sends a function module add response.
- the method further includes: receiving a function module deletion request sent by the first device, deleting a corresponding function module from the slave device according to the function module addition request, and sending a request to the first device to delete a corresponding function module.
- a device sends a function module delete response.
- an embodiment of the present application provides a method for processing a distributed application.
- the method is applied to a first device, where the first device includes a distributed application, a distributed installation management module, and a distributed scheduling module.
- the distributed application includes A plurality of functional modules, a first type of functional module in the plurality of functional modules is installed on a first device, a second type of functional module in the plurality of functional modules is installed in a slave device, the first device and at least one slave device
- the first device is a device that downloads the installation file of the distributed application
- the multiple functional modules include a task monitoring module and a task processing module, the task monitoring module is installed in the first device, and the task processing module is installed at least In a second device, the second device is a slave device.
- the method includes: a task monitoring module monitors a first task processing request, where the first task processing request is used to request processing of the first task; in response to the first task processing request, the task monitoring module sends a request to the distribution
- the distributed installation management module queries the at least one second device installed with the task processing module; the task monitoring module sends a second task processing request to the distributed scheduling module, and the second task processing request includes Information about the target device processed by the first task, the target device is any device in the at least one second device; in response to the second task processing request, the distributed scheduling module sends the target device to the Sending a task processing command; the task monitoring module receives the processing result of the first task by the target device.
- the task processing request triggered on the first device with the distributed app installed can be processed by the second device with the distributed app installed, and returned to the first device
- the functions of the app are jointly completed by the plurality of electronic devices, which improves the portability of the distributed functions.
- the method before the task monitoring module sends the second task processing request to the distributed scheduling module, the method further includes: when the task monitoring module finds that at least two second devices are installed with the task When processing the module, the task monitoring module displays a first interface, and the first interface includes options for the at least two second devices; the task monitoring module sends a second task processing request to the distributed scheduling module , including: in response to a user's first selection operation on options of the at least two second devices, the task monitoring module sends the second task processing request to the distributed scheduling module, and the first selection operation Used to select the target device.
- the user By displaying the first interface to the user, the user selects a specific device for processing the task processing request through the first interface, which brings a better experience to the user.
- the task monitoring module After receiving the processing result of the first task, the task monitoring module displays the processing result of the first task, so that the user can know the status of the task in real time.
- the method further includes: the distributed installation management module determines to perform distributed installation on the distributed application; the distributed installation management module determines the slave devices and slave devices on which the distributed application is installed. The function module of the distributed application installed on the distributed application; the distributed installation management module sends the installation file corresponding to the function module of the distributed application to the corresponding slave device.
- the distributed installation management module determining to perform distributed installation of the distributed application includes: the distributed installation management module detecting that the installation file of the distributed application includes the first indication information, where the first indication information is used to instruct the distributed application to support a distributed function; the distributed installation management module determines to perform a distributed installation of the distributed application according to the first indication information.
- the distributed installation management module determining to perform distributed installation of the distributed application includes: the distributed installation management module detecting that the installation file of the distributed application includes the first indication information, the first indication information is used to instruct the distributed application to support distributed functions; the distributed installation management module displays a second interface according to the first indication information, and the second interface includes distributed functions an installation option; in response to a user confirming the distributed installation option, the distributed installation management module determines to perform a distributed installation of the distributed application.
- users can choose whether to install the application in a distributed manner according to actual needs, so as to meet the different needs of different users.
- the distributed installation management module determines the slave device on which the distributed application is installed and the function module of the distributed application installed on the slave device, including: displaying a third interface, the first The three interfaces include candidate devices that can install the distributed application and options for functional modules that can be installed on each candidate device; in response to the user's second selection operation on the functional modules that can be installed on the candidate device, determine the installation location.
- the slave device of the distributed application, and the functional modules installed on the slave device are examples of the slave device.
- the distributed installation management module determines the slave device on which the distributed application is installed and the function module of the distributed application installed on the slave device, including: displaying a fourth interface, the The fourth interface includes an option for a candidate device capable of installing the distributed application; in response to a third selection operation of the candidate device by the user, determining a slave device to install the distributed application; displaying a fifth interface, the The fifth interface displays options of the function modules that can be installed on the slave device; in response to a fourth selection operation by the user on the function modules that can be installed on the slave device, the function modules installed on the slave device are determined.
- the first device displays to the user the options of the functional modules that can be installed on the slave device, so that the user can select the functional modules installed on each slave device, so as to meet the different needs of different users and improve the user experience. experience.
- the method further includes: after the distributed installation management module receives all the returned information from the slave devices When the installation completes the response message, it is confirmed that the distributed application is installed successfully; a fifth interface is displayed, and the fifth interface is used to notify the distributed application that the installation is complete.
- the distributed application further includes a task management module installed on the first device, and the method further includes: the task management module receives a task status input by a user a query request, the task status query request is used to request to query the status of the task currently being processed in the distributed application; in response to the task status query request, the task management module queries the distributed installation management module for installation information of the at least one second device of the task processing module; the task management module sends a first connection establishment request to the distributed scheduling module according to the information of the second device, and the first connection The establishment request is used to request to establish a connection with the second device; the distributed scheduling module sends a second connection establishment request to the second device; the task management module obtains the information of the task processed by the second device through the connection. status; the task management module displays the status of the tasks processed by the second device.
- the status of the tasks processed on each device can be queried, so that the user can know the status of the tasks.
- the method further includes: the task management module receives a task deletion request input by the user according to the state of the task processed by the second device; the task management module sends a request to the second device through the connection The task deletion request is sent.
- the method further includes: the task management module receives a task suspension request input by the user according to the state of the task processed by the second device; the task management module sends a request to the second device through the connection Send the task suspension request.
- the first device further includes an application management module
- the method further includes: the application management module receives a management request input by a user; in response to the management request, the application management module sends a request to the application management module.
- the distributed installation management module queries the slave device where the distributed application is installed, the function module installed on the slave device and the function module installed on the first device; the application management module displays that the distributed application is installed The slave device and the functional module installed on the first device.
- the application management module realizes flexible management of the function modules of the distributed application, flexibly adjusts the function modules on each device, for example, adds or deletes the function modules of a certain device.
- the specific implementation method refers to the following.
- the application management module receives a function module addition request input by a user; the application management module sends the function module addition request to the distributed installation management module; when the function When the module addition request is for adding a function module on the first device, the distributed installation management module installs the added function module on the first device according to the function module addition request; when the function module is added When the request is for adding a function module on a slave device, the distributed installation management module sends the function module addition request to the slave device that needs to add a function module.
- the method further includes: the distributed installation management module updates the first device. Information of a function module installed on a device; the distributed installation management module sends a function module addition response to the application management module.
- the method further includes: the distributed installation management module receives the function module addition sent by the slave device. response; the distributed installation management module updates the information of the function modules installed on the first device according to the function module addition response; the distributed installation management module sends the function module addition response to the application management module .
- the application management module receives a function module deletion request input by a user; the application management module sends the function module deletion request to the distributed installation management module; when the function When the module deletion request is used to delete a function module on the first device, the distributed installation management module deletes the corresponding function module on the first device according to the function module deletion request; when the function module is added When the request is for deleting a function module on a slave device, the distributed installation management module sends the function module deletion request to the slave device that needs to delete the function module.
- the method further includes: the distributed installation management module updates the first device. Information about a function module installed on a device; the distributed installation management module sends a function module deletion response to the application management module.
- the method further includes: the distributed installation management module receives the function module deletion sent by the slave device. responding; the distributed installation management module updates the information of the function modules installed from the device according to the function module deletion response; the distributed installation management module sends the function module deletion response to the application management module.
- the task monitoring module is also installed in at least one slave device, so that the user may also trigger task processing through the slave device, and the use of the distributed app is more flexible and convenient.
- the task management module is also installed in at least one slave device, so that the user may also query the task status through the slave device, and the use of the distributed app is more flexible and convenient.
- an embodiment of the present application provides a method for processing a distributed application, where the method is applied to a slave device of a distributed application, where the distributed application includes multiple functional modules, and the first one of the multiple functional modules is One type of function module is installed on the first device, and the second type of function module in the plurality of function modules is installed on the slave device, the first device is the device that downloads the installation file of the distributed application, and the first device is the device that downloads the installation file of the distributed application.
- a device and at least one slave device communicate through a distributed operating system OS.
- the method includes: receiving an installation file of at least one function module of the distributed application sent by the first device; and installing a corresponding function module according to the installation file of the at least one function module.
- the master device sends some functional modules of the distributed application to the slave device, and the slave device completes the installation of the corresponding functional modules, so that the master device and the slave device cooperate to realize the function of the distributed app.
- the distributed application includes a task monitoring module, a distributed installation management module, a task processing module, and a distributed scheduling module
- the slave device is installed with the task monitoring module
- the distributed The installation management module and the distributed scheduling module are installed on the first device
- the task processing module is installed on at least one second device
- the second device is a slave device
- the method further includes: the The task monitoring module monitors the first task processing request input by the user, and the first task processing request is used to request processing of the first task; in response to the first task processing request, the task monitoring module sends the distributed
- the installation management module queries the at least one second device on which the task processing module is installed; the task monitoring module sends a second task processing request to the distributed scheduling module, where the second task processing request includes The information of the target device processed by the first task, the target device is any device in the at least one second device; the task monitoring module receives the processing result of the first task by the target device.
- the user can also trigger task processing through the slave device.
- the method before the task monitoring module sends the second task processing request to the distributed scheduling module, the method further includes: when the task monitoring module finds that at least two second devices are installed with the task When processing the module, the task monitoring module displays a first interface, and the first interface includes options for the at least two second devices; the task monitoring module sends a second task processing request to the distributed scheduling module , including: in response to a user's first selection operation on options of the at least two second devices, the task monitoring module sends the second task processing request to the distributed scheduling module, and the first selection operation Used to select the target device.
- the task monitoring module After receiving the processing result of the first task, the task monitoring module displays the processing result of the first task.
- the distributed application includes a task management module, a distributed installation management module, a task processing module and a distributed scheduling module
- the slave device is installed with the task management module
- the distributed The installation management module and the distributed scheduling module are installed on the first device
- the task processing module is installed on at least one second device
- the second device is a slave device
- the method further includes: the The task management module receives a task status query request input by the user, and the task status query request is used to request to query the status of the task currently being processed in the distributed application; in response to the task status query request, the task management module sends The distributed installation management module queries the information of at least one second device installed with the task processing module; the task management module sends a first connection to the distributed scheduling module according to the information of the second device establishment request, the first connection establishment request is used to request to establish a connection with the second device; after the connection is established, the task management module obtains the status of the task processed by the second device through the connection, and displays all Describes the status of the task
- the task management module receives a task deletion request input by the user according to the state of the task processed by the second device; the task management module sends the second device through the connection. Task deletion request.
- the method further includes: the task management module receives a task suspension request input by the user according to the state of the task processed by the second device; the task management module sends a request to the second device through the connection Send the task suspension request.
- the distributed application includes a distributed installation management module, a task processing module and a distributed scheduling module
- the task processing module is installed on the slave device
- the distributed installation management module and The distributed scheduling module is installed on the first device
- the method further includes: the task processing module receives a task processing command sent by the distributed scheduling module, where the task processing command is used to instruct the first
- the task processing module processes the first task according to the task processing command; the task processing module sends the processing result of the first task to the distributed scheduling module.
- the distributed application includes a distributed installation management module
- the distributed installation management module is installed on the first device
- the method further includes: receiving the distributed installation management module sending a function module addition request; installing the added function module on the slave device according to the function module addition request; sending a function module addition response to the distributed installation management module.
- the distributed application includes a distributed installation management module
- the distributed installation management module is installed on the first device
- the method further includes: receiving the distributed installation management module sending a function module deletion request; deleting a corresponding function module on the slave device according to the function module addition request; sending a function module deletion response to the distributed installation management module.
- the task monitoring module is also installed on the first device.
- the task management module is also installed on the first device.
- an embodiment of the present application provides a processing apparatus for a distributed application, including functional modules for implementing the methods described in any one of the first aspect, the second aspect, the third aspect, and the fifth aspect of the present application.
- an embodiment of the present application provides a processing apparatus for a distributed application, including a functional module for implementing the method described in the fourth aspect or the sixth aspect of the present application.
- an embodiment of the present application provides an electronic device, including: a memory and a processor, where the memory is used to store program instructions, and the processor is used to call the program instructions in the memory to cause the electronic device to execute this
- the method for processing a distributed application according to any one of the first aspect to the sixth aspect of the application.
- an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, enables the electronic device to implement any one of the first to sixth aspects of the present application.
- the method for processing a distributed application is described.
- an embodiment of the present application provides a computer program product, including a computer program that, when executed by a processor, implements the distributed application described in any one of the first to sixth aspects of the present application processing method.
- the distributed application processing method and device provided by the present application install the distributed app on multiple electronic devices, and the multiple electronic devices jointly complete the functions of the distributed app.
- the first device that has downloaded and installed the distributed app can monitor the task processing request, find a second device with the task processing function according to the task processing request, and then request the second device to process the task. After the task is processed, the task processing result is returned to the first device, thereby enabling distributed task processing.
- the method realizes distributed functions through distributed apps, improves the portability of distributed functions, and any electronic device installed with distributed OS can install distributed apps to obtain distributed functions provided by distributed apps, It also reduces the development difficulty and cost of distributed services.
- 1 is a schematic structural diagram of an electronic device to which the application is applicable;
- FIG. 2 is a block diagram of a software structure of an electronic device provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of an installation network corresponding to a distributed app in a smart home scenario
- Fig. 4 is a kind of schematic diagram of the installation process of distributed app
- Fig. 5 is another schematic diagram of the installation process of distributed app
- Fig. 6 is a kind of schematic diagram of function module selection in the installation process of distributed app
- Fig. 7 is another schematic diagram of function module selection in the installation process of distributed app.
- Fig. 8 is another schematic diagram of function module selection in the installation process of distributed app.
- Fig. 9 is the interface schematic diagram that the installation of distributed app is completed.
- Fig. 10 is the flow chart of the distributed app execution task
- Fig. 11 is a kind of schematic diagram of download selection page
- Figure 12 is another schematic diagram of the download selection page
- Figure 13 is another schematic diagram of the download selection page
- Figure 14 is another schematic diagram of the download selection page
- 15 is a schematic diagram of a download input box
- 16 is a schematic diagram of a selection interface of a task processing device
- Figure 17 is a schematic diagram of the query flow of task status in a distributed app
- Fig. 18 is the application management flow chart of distributed app
- 19 is a schematic diagram of an application management portal entering a distributed app
- 20 is a schematic diagram of a management page of the functional modules of the distributed app installed on each device;
- 21 is a schematic structural diagram of a processing apparatus for a distributed application provided by an embodiment of the present application.
- 22 is a schematic structural diagram of a processing apparatus for a distributed application provided by an embodiment of the present application.
- FIG. 23 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
- “at least one” refers to one or more, and “multiple” refers to two or more.
- “And/or”, which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
- the character “/” generally indicates that the associated objects are an “or” relationship.
- “At least one item(s) below” or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s).
- At least one (a) of a single a, a single b or a single c can mean: a single a, a single b, a single c, a combination of a and b, a combination of a and c, a combination of b and c, or a combination of a, b and c, where a, b, c can be single or multiple.
- first and second are used for descriptive purposes only and should not be construed to indicate or imply relative importance. The orientation or positional relationship indicated by the terms “center”, “portrait”, “horizontal”, “upper”, “lower”, “left”, “right”, “front”, “rear”, etc.
- An embodiment of the present application provides a method for processing a distributed application.
- a distributed app can run on multiple electronic devices installed with a distributed OS.
- a distributed app refers to an app whose functions can be jointly implemented by multiple devices.
- the devices communicate through a distributed OS.
- the configuration of the application layer and the application framework layer in the software system based on electronic equipment supports the installation, operation and management of distributed apps, and realizes distributed functions or distributed services through distributed apps, which improves the availability of distributed functions.
- any electronic device installed with a distributed OS can install a distributed app to obtain distributed services provided by the distributed app, which also reduces the development difficulty and cost of distributed services.
- electronic devices laptops, wearable devices, in-vehicle devices, augmented reality (AR)/virtual reality (virtual reality devices can be tablet computers, mobile phones (such as folding screen mobile phones, large-screen mobile phones, etc.)) devices, super Mobile personal computer (ultra-mobile personal computer, UMPC), netbook, personal digital assistant (PDA), smart TV, smart screen, high-definition TV, 4K TV, smart speaker, smart projector and other equipment, this application is implemented
- PDA personal digital assistant
- smart TV smart screen, high-definition TV, 4K TV, smart speaker, smart projector and other equipment
- the electronic device involved in the embodiment of the present application is described below with reference to FIG. 1 , taking the electronic device as a tablet computer as an example.
- FIG. 1 is a schematic structural diagram of an electronic device to which this application applies.
- the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D , sensor 180, key 190, motor 191, indicator 192, camera 193, display screen 194, and user identification module (subscriber identification module, SIM) card interface 195 and so on.
- SIM subscriber identification module
- the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (DSP), baseband processor, display process unit (DPU), and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- electronic device 100 may also include one or more processors 110 .
- the controller may be the nerve center and command center of the electronic device 100 .
- the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
- a memory may also be provided in the processor 110 for storing instructions and data.
- the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. This avoids repeated accesses and reduces the latency of the processor 110, thereby increasing the efficiency of the electronic device 100 system.
- the processor 110 may include one or more interfaces.
- the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- PCM pulse code modulation
- UART universal asynchronous transceiver
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB universal serial bus
- the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
- the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
- the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
- the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
- the charging management module 140 is used to receive charging input from the charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
- the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142 , the electronic device 100 can also be powered by the power management module 141 .
- the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
- the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
- the power management module 141 may also be provided in the processor 110 .
- the power management module 141 and the charging management module 140 may also be provided in the same device.
- the wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
- the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
- the mobile communication module 150 may provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 100 .
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier, and the like.
- the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
- at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
- at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
- the modem processor may include a modulator and a demodulator.
- the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
- the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
- the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
- the modem processor may be a separate device.
- the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
- the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), NFC, Infrared technology (infrared, IR) and other wireless communication solutions.
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
- the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2 .
- the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication technology may include GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, GNSS, WLAN, NFC, FM, and/or IR technology, and the like.
- the above-mentioned GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi- zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
- global positioning system global positioning system, GPS
- global navigation satellite system global navigation satellite system
- GLONASS global navigation satellite system
- Beidou navigation satellite system beidou navigation satellite system, BDS
- quasi-zenith satellite system quasi-zenith satellite system
- QZSS quasi-zenith satellite system
- SBAS satellite based augmentation systems
- the electronic device 100 can implement a display function through a GPU, a display screen 194, an application processor, and the like.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- Processor 110 may include one or more GPUs that execute instructions to generate or change display information.
- Display screen 194 is used to display images, videos, and the like.
- Display screen 194 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
- LED diode AMOLED
- flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
- the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
- the electronic device 100 may implement a shooting function through an ISP, one or more cameras 193, a video codec, a GPU, one or more display screens 194, an application processor, and the like.
- the NPU is a neural-network (NN) computing processor.
- NN neural-network
- Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
- the DPU is also called the Display Sub-System (DSS).
- DSS Display Sub-System
- the DPU is used to adjust the color of the display screen 194.
- the DPU can adjust the color of the display screen through a 3D look up table (3D LUT).
- the DPU can also perform processing such as scaling, noise reduction, contrast enhancement, backlight brightness management, hdr processing, and display parameter Gamma adjustment.
- the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .
- the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, data files such as music, photos, videos, etc. are saved in an external memory card.
- Internal memory 121 may be used to store one or more computer programs including instructions.
- the processor 110 may execute the above-mentioned instructions stored in the internal memory 121, thereby causing the electronic device 100 to perform various functional applications, data processing, and the like.
- the internal memory 121 may include a storage program area and a storage data area.
- the stored program area may store the operating system; the stored program area may also store one or more application programs (such as gallery, contacts, etc.) and the like.
- the storage data area may store data (such as photos, contacts, etc.) created during the use of the electronic device 100 and the like.
- the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
- the processor 110 may cause the electronic device 100 to perform various functional applications and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110 .
- the electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
- the audio module 170 is used for converting digital audio information into analog audio signal output, and also for converting analog audio input into digital audio signal. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
- Speaker 170A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
- the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
- the receiver 170B also referred to as "earpiece” is used to convert audio electrical signals into sound signals.
- the microphone 170C also called “microphone” or “microphone”, is used to convert sound signals into electrical signals.
- the user can make a sound by approaching the microphone 170C through a human mouth, and input the sound signal into the microphone 170C.
- the electronic device 100 may be provided with at least one microphone 170C.
- the electronic device 100 may be provided with two microphones 170C, which can implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
- the earphone jack 170D is used to connect wired earphones.
- the earphone port 170D may be the USB port 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard port, or may be a cellular telecommunications industry association of the USA (CTIA) Standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA
- the sensors 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L , Bone conduction sensor 180M and so on.
- the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
- the pressure sensor 180A may be provided on the display screen 194 .
- the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
- the electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
- the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
- touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
- the gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 .
- the angular velocity of electronic device 100 about three axes ie, x, y, and z axes
- the gyro sensor 180B can be used for image stabilization.
- the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse motion to achieve anti-shake.
- the gyro sensor 180B can also be used for navigation, somatosensory game scenes, and the like.
- the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
- the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
- the electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
- Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
- the light emitting diodes may be infrared light emitting diodes.
- the electronic device 100 emits infrared light to the outside through the light emitting diode.
- Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
- the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
- Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
- the ambient light sensor 180L is used to sense ambient light brightness.
- the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
- the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket, so as to prevent accidental touch.
- the fingerprint sensor 180H (also called a fingerprint reader) is used to collect fingerprints.
- the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
- fingerprint sensors please refer to the international patent application PCT/CN2017/082773 entitled “Method and Electronic Device for Processing Notifications", the entire contents of which are incorporated herein by reference.
- the touch sensor 180K may also be referred to as a touch panel or a touch sensitive surface.
- the touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a touch screen.
- the touch sensor 180K is used to detect a touch operation on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- Visual output related to touch operations may be provided through display screen 194 .
- the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
- the bone conduction sensor 180M can acquire vibration signals.
- the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice.
- the bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal.
- the bone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone.
- the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibration bone block obtained by the bone conduction sensor 180M, so as to realize the voice function.
- the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M, and realize the function of heart rate detection.
- the keys 190 include a power-on key, a volume key, and the like.
- the key 190 may be a mechanical key or a touch key.
- the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
- the SIM card interface 195 is used to connect a SIM card.
- the SIM card can be contacted and separated from the electronic device 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195 .
- the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
- the SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card and so on. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
- the SIM card interface 195 can also be compatible with different types of SIM cards.
- the SIM card interface 195 is also compatible with external memory cards.
- the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
- the electronic device 100 employs an eSIM, ie: an embedded SIM card.
- the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiment of the present application does not limit the type of the operating system of the electronic device.
- Android system Linux system, Windows system, iOS system, Hongmeng operating system (harmony operating system, Hongmeng OS), etc.
- the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 100 .
- FIG. 2 is a block diagram of a software structure of an electronic device according to an embodiment of the present application.
- the layered architecture divides the software system into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
- the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer (APP framework), an Android runtime (Android runtime) and system libraries (libraries), and a kernel layer. (kernel).
- APP framework application framework
- Android runtime Android runtime
- libraries system libraries
- kernel layer kernel layer.
- the application layer can include a series of application packages.
- the application package can include email, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, game, chat, shopping, travel, instant messaging (such as SMS), Smart home, device control and other applications (application, APP).
- household equipment may include lights, televisions, and air conditioners.
- household equipment may also include anti-theft door locks, speakers, sweeping robots, sockets, body fat scales, desk lamps, air purifiers, refrigerators, washing machines, water heaters, microwave ovens, rice cookers, curtains, fans, TVs, set-top boxes, windows, etc.
- applications can be divided into system applications and third-party applications.
- the system application can be understood as an application program that is not independent and depends on the software system, such as the Dock and the desktop.
- Third-party applications are applications other than system applications, which may include but are not limited to self-developed applications of equipment manufacturers and applications of non-equipment manufacturers, such as electronic equipment applications and computer applications.
- the application layer is illustrated by taking a distributed APP as an example.
- the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer may include: distributed soft bus, distributed installation management module, distributed scheduling module and application management module.
- the application framework layer is illustrated by taking as an example the distributed installation management module, the distributed scheduling module, and the application management module.
- the distributed soft bus, the distributed installation management module, the distributed scheduling module and the application management module are all software modules.
- the distributed soft bus is used to integrate hardware resources into a hardware pool, which not only realizes hardware interconnection, but also allows hardware resources to be used with each other to provide basic communication functions for other distributed services.
- the distributed installation management module is used to implement the installation, management, uninstallation and data query of distributed apps on multiple devices.
- the distributed scheduling module is used to provide cross-device scheduling capability, and is responsible for communication between application components on multiple devices where the distributed app is installed, and communication between the application components on the multiple devices and the OS.
- the application management module is used to manage the functions installed by the distributed app on multiple devices. For example, after the distributed app is installed, the functions installed on a certain device can be viewed, deleted or added.
- a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGLES), 2D graphics engine (eg: SGL), etc.
- surface manager surface manager
- media library Media Libraries
- 3D graphics processing library eg: OpenGLES
- 2D graphics engine eg: SGL
- the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
- 2D graphics engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
- the software and hardware workflows of the electronic device 100 are exemplarily described below in conjunction with a scenario in which a smart speaker is used to play sound.
- a corresponding hardware interrupt is sent to the kernel layer.
- the kernel layer processes touch operations into raw input events (including touch coordinates, timestamps of touch operations, etc.). Raw input events are stored at the kernel layer.
- the application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the smart speaker icon, for example, the smart speaker application calls the interface of the application framework layer to start the smart speaker application, and then starts the audio driver by calling the kernel layer. , the audio electrical signal is converted into a sound signal through the speaker 170A.
- the structures illustrated in this application do not constitute a specific limitation on the electronic device 100 .
- the electronic device 100 may include more or fewer components than shown, or some components may be combined, or some components may be split, or a different arrangement of components.
- the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
- the processing of a distributed app includes the following four stages in chronological order: app development, app installation, app execution, and app management.
- App development is also known as app packaging.
- Device manufacturers release a distributed OS that supports the interconnection of multiple devices such as mobile phones, tablets, TVs, and routers.
- apps can develop apps with distributed functions that can be installed on the distributed OS according to the developer documents.
- the developer modularizes the installation file of the distributed app according to the functions and requirements provided by the distributed app, so that it can be installed on multiple devices, and the modules on multiple devices cooperate with each other to complete the functions of the app.
- Distributed apps usually include the following modules: basic modules, task management modules, task monitoring modules, task processing modules, resource files, module configuration files, and other modules.
- a base module is used to provide a runtime environment for other modules, and the module itself does not provide functionality.
- the task management module is used to provide the user with a management interface, and the management interface is used to manage and monitor the tasks on the device on which the task processing module is installed. For example, the management interface is used to display the status of the tasks on the device to the user. The status of the tasks includes: Processing, processing failed, processing completed, etc. Users can delete tasks that fail to be processed, and suspend tasks that are being processed.
- the task monitoring module is used to monitor the user's context and provide user experience (UX) interaction that increases task processing.
- UX user experience
- the task processing module is used to execute the processing function of the task on the device to complete the specific task of the distributed app.
- the task processing module is the download module, and the download module is used to complete the download function of the distributed app.
- the resource file is used to describe whether the app supports distributed functions.
- the device that downloaded the app can determine whether the app supports distributed functions according to the configuration file, and perform distributed installation.
- Distributed installation refers to the The functionality of the app is installed on multiple devices.
- the module configuration file is used to store the information of each module, and the information of the module includes the function of the module and so on.
- the electronic device can be a user equipment (UE), such as a mobile phone, a computer, or a cellular phone, a cordless phone, or a session initiator.
- UE user equipment
- Session initiation protocol (SIP) phones smart phones, personal digital assistants (PDAs), computers, laptops, handheld communication devices, handheld computing devices, satellite wireless devices, wireless modem cards , TV set top box (STB for short), in-vehicle devices, wearable devices (such as smart watches, smart bracelets, smart glasses), smart home devices, other devices for communicating on wireless systems, etc.
- SIP Session initiation protocol
- PDAs personal digital assistants
- STB TV set top box
- wearable devices such as smart watches, smart bracelets, smart glasses
- smart home devices other devices for communicating on wireless systems, etc.
- an application store or an application market is provided to users.
- the application store or application market provides a variety of apps for users to download, such as various social apps, news apps, shopping apps, game apps, etc.
- Use the search function provided by the application store or the application market to find the distributed app to be installed click the download control to download, and then click the installation control to install it after the download is complete.
- the two functions of download and installation are usually combined, and an installation control is usually displayed below the installable app icon displayed to the user in the application market. After the user clicks the installation control, the download and installation operations can be completed.
- the user can also search for the installation file of the app through a browser to install it.
- the distributed installation service module on the electronic device parses the installation file of the app, and the installation file of the app carries first indication information, and the first indication information is used to indicate whether the app supports distribution function.
- the first indication information may be carried in the above-mentioned resource file, and the distributed installation service module reads the first indication information from the resource file. If the first indication information indicates that the app does not support the distributed function, the Single-device app for analysis and installation. If the first indication information indicates that the app supports the distributed function, the distributed installation management module determines to perform distributed installation of the distributed app.
- the device that downloads the distributed app and performs the distributed installation is called the master device, and the other device that has installed some modules of the distributed app is called the slave device.
- the distributed installation management module on the master device is used to install all distributed apps on the master device, and to manage, uninstall, and query the installed distributed apps. In the case of determining that the app supports the distributed function, the distributed installation management module determines which devices (slave devices) can install the distributed app.
- the distributed installation management module can determine the slave devices that can install the distributed app according to the information of the devices connected in the current network, so as to form the installation network of the distributed app.
- the devices in the installation network need to be connected to the same wireless network. Therefore, the distributed management service first detects the devices located in the same wireless network as the master device.
- FIG. 3 is a schematic diagram of an installation network corresponding to a distributed app in a smart home scenario, as shown in Figure 3:
- the distributed installation management module detects that a total of 8 devices are currently connected to the same wireless network, including: the mobile phone 210 (main device ), mobile phone 220, tablet computer 230, TV 240, speaker 250, speaker 260, router 270, laptop 280.
- FIG. 3 is only an exemplary description, and more smart devices may be connected in the wireless network, for example, wireless chargers, smart desk lamps, air conditioners, etc. may also be connected.
- the mobile phone 210 is used as the master device, and which devices can be used as slave devices are determined from the remaining 7 devices except the master device.
- the distributed installation management module in the mobile phone 210 can determine whether the device can act as a slave device according to the OS type and the memory size of the device.
- the distributed management service determines whether the OS type of the device is the same as the OS type of the master device. If the OS type of the device is different from the OS type of the master device, it is determined that the device cannot be used as a slave device.
- the OS type of the device is the same as the OS type of the master device, then judge whether the memory of the device is greater than the preset memory threshold. If the memory of the device is greater than the memory threshold, then determine that the device is a slave device. memory threshold, it is determined that the device cannot be used as a slave device.
- the device types of the master device and the slave device may be the same or different, which is not limited in this embodiment. For example, when the master device is a mobile phone, the slave device may also be a mobile phone, a tablet, a TV, a speaker, or a router. Wait.
- the slave device determined in the above manner satisfies the following conditions: it is located in the same network as the master device, the OS type is the same as that of the master device, and the memory is greater than the preset memory threshold.
- OS type can be type, Android system, Hongmeng system, etc.
- the distributed installation management module determines from the mobile phone 220, the tablet computer 230, the TV 240, the speaker 250, the speaker 260, the router 270, and the laptop 280 that the tablet computer 230, the TV 240, the speaker 250 and the router 270 can be used as slaves.
- mobile phone 210, tablet computer 230, TV 240, speaker 250 and router 270 together form a distributed app installation network, and all devices in the installation network have the same OS type, for example, mobile phone 210, tablet computer 230, TV 240, Both the speaker 250 and the router 270 use the Android system or the Hongmeng system.
- the distributed installation management module may also determine whether the device can serve as a slave device according to the OS type and processor parameters, or determine whether the device can serve as a slave device according to the OS type, memory size, and processor parameters. This is not limited.
- the master device after the master device determines to perform distributed installation of the distributed app according to the first indication information, it can determine the slave device to install the distributed app according to the above process, and after determining the slave device to install the distributed app and each device.
- distributed installation can be performed directly, that is, the distributed installation management module sends the installation files of the function modules that need to be installed on each slave device to the slave devices, and each slave device completes the installation according to the received installation files. Install.
- the master device displays the second interface shown in FIG. 4( c ) or FIG. 5( d ), in the second interface Includes a distributed installation option.
- the user installs the distributed download app through the "App Store”
- the user opens the interface shown in Fig. 4(b) through the "App Store”
- the icon of the distributed download app is displayed in the boutique application
- the page can jump to the second interface shown in Figure 4(c).
- the icon of the distributed download app may not be displayed in the interface shown in FIG. 4(b), and the user searches for the distributed download app through the search function in the interface shown in FIG. 4(b), and then installs it.
- the user installs the distributed download app through "File Management", and the user opens the interface shown in Figure 5(b) through “File Management”.
- the installation package option includes installation packages of multiple downloaded but not installed applications.
- the installation packages of applications can be Android application package (android application package, APK) or Hongmen system application package, etc.
- Uninstalled application packages can be arranged in the interface according to the time of download.
- the figure also shows the icon of the application, the name of the installation package, such as AAAAAAAA.apk, and the name of the application (such as distributed download). ), version number, and installation package size.
- the user can trigger the installation operation by clicking on the name or icon of the installation package. After the user triggers the installation operation, it will jump to the interface shown in Figure 5(c). If "File Management" is allowed to install the application, jump to Figure 5 ( d) the interface shown.
- the user can also directly jump to the interface shown in FIG. 5(d).
- the second interface displays a distributed installation option for the user to choose whether to perform distributed installation.
- the application has distributed multi-device interaction capabilities, whether to configure the application on other devices", and two selection controls "Yes” and “No” are displayed. If the user selects "Yes”, the interface shown in Figure 6 will pop up. If the user selects "No", the installation is performed according to the single-device app.
- the single-device app means that all functional modules of the app are installed on one device. For the single-device app installation process, please refer to the installation process of the existing app.
- the functional modules installed on each device are determined by the distributed installation management module according to the functional modules divided by the distributed app and the types of each device in the installation network.
- the task management module must be installed on the main device, and whether to install the task management module on other devices can be selected by the user.
- a mobile phone, a tablet, and a TV usually have a screen, and a management interface is displayed on the screen, which is convenient for users to manage distributed apps, so the task management can be installed on a device with a screen.
- task management modules can be deployed on mobile phones, tablets and TVs.
- the TV is usually installed in a fixed position, which is inconvenient to interact with the user. Therefore, the task management module can be deployed on mobile phones and tablets.
- the task monitoring module is mainly used to monitor user operations, and is usually bound with the function of the task management module.
- the task monitoring module is also deployed on mobile phones and tablets.
- the task processing module provided by the distributed app can be deployed on some devices that are not commonly used by users or some devices with low load, so as to avoid the task processing module occupying too many computing resources and storage resources when processing tasks, which will affect the performance of the main device. Too much influence.
- the task processing module is a download module
- deploying the download module on the speakers and routers can prevent the download function from occupying a large bandwidth of the mobile phone and affect the use of the mobile phone by the user.
- the mobile phone provides task management and task monitoring functions
- the tablet and TV both provide task management, task monitoring and download module functions
- the speaker provides a download module. It can be understood that when there are multiple devices in the installation network, one page of the display screen may not be able to display the functional modules provided by all the devices, and it needs to be displayed on multiple screens. Functional modules provided by all devices.
- the functional modules installed on each device are determined by the main device and cannot be adjusted by the user.
- the installation configuration interface shown in FIG. 6 is only for the user to understand the functional modules installed on each device.
- the functional modules installed on each device can be adjusted by the user, and the user can select the functional modules that need to be installed on each device. Press and hold on the blank space of , and the third interface shown in Figure 7(a) will be displayed.
- the third interface includes candidate devices that can install distributed apps and options for functional modules that can be installed on each candidate device. That is, after the user long presses on the blank space of the interface shown in FIG. 6 , a selection control is added to each functional module on the basis of the interface shown in FIG. 6 .
- the user selects the "Yes" control in the second interface shown in Fig. 4(c) or Fig. 5(d), the user directly jumps to the third interface shown in Fig. 7(a).
- the slave device on which the distributed app is installed and the function modules installed on the slave device are determined.
- the selection control can use the circular control shown in Figure 7.
- the selection control is not selected by default after the third interface is displayed. If the user needs to install a certain function on a certain device, select the corresponding control. After the control is selected It will lighten or change color to distinguish it from the unselected control, for example, the selected control will be white when not selected, and will become blue or gray after being selected by the user, as shown in Figure 7(b).
- This embodiment does not limit the form of the selection control, and the selection control may also adopt other forms of controls.
- the mobile phone provides a task management module and a task monitoring module.
- the user can choose to install these two functional modules on the mobile phone.
- the tablet and TV provide the task management module, task monitoring module and download module.
- the user can choose to install the task management module and the task monitoring module on the tablet, and install the task monitoring module on the TV.
- Both the speaker and the router (not shown) provide a download module, and the user can choose to install the download module only on the speaker, or install the download module only on the router.
- Table 1 is a schematic diagram of the functional modules installed on each device in the distributed network finally selected by the user.
- the user can simultaneously select the slave device to install the distributed app and the function modules installed on each slave device. For example, if the user does not select any function module on the TV, it means that the user does not select the TV as the slave device. If the user selects a function module on a certain device, it is equivalent to selecting the device as a slave device.
- a fourth interface is displayed, where the fourth interface includes options for candidate devices that can install the distributed app, in response to the user's selection of the candidate device.
- the third selection operation is to determine the slave device on which the distributed application is installed, and display a fifth interface.
- the fifth interface displays options of function modules that can be installed on the slave device.
- the fourth selection operation determines the functional modules installed on the slave device. In this method, the user first selects the slave device, and then selects the function modules installed on the slave device.
- the user directly jumps to the fourth interface shown in FIG. Including 8 candidate devices, the user selects the 5 devices shown in Figure 8(b) from the 8 devices: mobile phone 1, TV, tablet, router and speaker 2, among which, mobile phone 1 is the main device (that is, the fourth device is displayed. interface device).
- the master device may not be displayed, and only candidate devices that can be slave devices are displayed for the user to select.
- the user clicks the "Confirm" control shown in Fig. 8(b) he can jump to the fifth interface shown in Fig. 8(c) or the interface shown in Fig. 7(a), and the user can further select the installation on each device. function.
- the user cannot select the function module installed on the master device, and the user can only select the function module installed on the slave device.
- the master device After the user confirms the functions installed on each slave device, the master device sends the installation file (or installation package) corresponding to the function module installed on each slave device to the corresponding slave device according to the function modules that need to be installed on each slave device.
- the mobile phone sends the installation file corresponding to the task management module to the tablet, the installation file corresponding to the task monitoring module to the tablet and the TV, and the installation file corresponding to the download module to the speaker and router.
- each slave device After receiving the installation file, each slave device parses the installation file and installs the corresponding function module.
- the installation files sent by the master device to the two slave devices that install the same function module are the same, but due to the differences in the hardware (such as screen size) and the operating system of the two slave devices themselves, the same function is caused.
- the interface that the module presents to the user on the two slave devices may differ, but the functionality will not change.
- the installation files corresponding to the task monitoring module sent by the mobile phone to the tablet and the TV are the same, but due to the differences in the hardware and operating systems of the tablet and the TV, the task monitoring module is finally displayed to the user on the TV and the tablet.
- the monitoring function of the task monitoring module is the same on the tablet and TV.
- each slave device After each slave device completes its installation, it returns an installation completion response message to the master device.
- the master device After receiving the installation completion response message returned by all slave devices, the master device confirms that the distributed app installation is complete, and a pop-up image can be displayed. The interface shown in 9 prompts the user that the distributed app installation is complete.
- each device in the installation network starts to run to jointly complete the functions of the distributed app.
- FIG. 10 is a flowchart of a distributed app executing tasks.
- the first device ie, the main device
- the first device includes a task monitoring module, a distributed installation management module, and a distributed scheduling module, wherein the task monitoring module belongs to a distributed
- the function module of the app, the distributed installation management module and the distributed scheduling module belong to the system services of the main device.
- the process includes the following steps:
- a task monitoring module monitors a first task processing request.
- the task monitoring module is used to provide the user with an interactive interface to complete the interaction between the device and the user.
- the user inputs a first task processing request through the interactive interface, and the first task processing request is used to request processing of the first task.
- the first task is a download task, and the user can trigger the task download in the following ways.
- the task monitoring module monitors the user's operation on the video in the webpage.
- the webpage includes one or more videos, some videos can be downloaded, and some videos cannot be downloaded.
- a download selection page as shown in Figure 12 will pop up. The selection page is used to prompt the user that the video can be downloaded. The current video is available for download, do you want to start downloading?".
- the task monitoring module will determine whether there is a video that can be downloaded in the webpage, and if there is a video that can be downloaded, the prompt information shown in Figure 13 will pop up, and the prompt information is used to remind the user that this
- the prompt information is: it is detected that there are the following X videos available for download in the current page, and information such as the name and type of each video may also be displayed on the page, which is not limited in this embodiment.
- the user can learn which videos can be downloaded according to the prompt information, further open the link of the video in the webpage, and copy the link of the video to the download app for downloading.
- the download selection page shown in FIG. 14 can also pop up.
- the download selection page also displays after each video information. A selection control is displayed, and the user can select one or more videos through the selection control. After selecting the video, the user clicks "Yes" on the page to confirm the download, and the user selects "No" to cancel the download.
- the above methods (1) and (2) are to pop up the download selection page when triggered by the user, and the method (3) does not require user triggering, and the device where the task monitoring module is located automatically pops up the download selection page.
- the user After the user selects to download a certain video on the webpage, in an exemplary manner, the user is required to manually copy and paste the link of the video (also referred to as an address or a website address) into the download page of the download app, and the user first clicks Find the address of the video to be downloaded on the page displaying the download resources, copy the address of the video to be downloaded, then open the download app, and paste the address of the video to be downloaded into the download page.
- the link of the video also referred to as an address or a website address
- the download page is shown in Figure 15, the download page includes a download address input box, the link of the video is pasted into the download address input box, and a "download” control is also set on the right side of the download input box, and the user clicks After the "download” control, the download app starts downloading the video.
- the location and form of the "Download” control are not limited to those shown in Figure 15, and the "Download” control can also be set below the download address input box.
- prompt information is also displayed in the download input box, prompting the user to input the download address.
- the monitoring module automatically copies and pastes the link of the video into the download page of the download app, as shown in FIG. 15 for the download page, this method does not Requires the user to manually copy the link from the web page to download the app.
- the task download is triggered, and the task monitoring module receives the task download request.
- the task monitoring module sends a first query request to the distributed installation management module, where the first query request is used to request at least one second device on which the task processing module is installed.
- the distributed installation management module sends a first query request response to the task monitoring module, where the first query request response includes information of at least one second device on which the task processing module is installed.
- the task monitoring module queries the distributed installation management module for at least one second device installed with the task processing module.
- the task monitoring module obtains the installation of the task processing module through the steps of S102 and S103. information of at least one second device. It can be understood that, in a possible implementation manner, the task monitoring module may request information from at least one second device installed with the task processing module through more steps, which is not limited in this embodiment.
- the task monitoring module displays a first interface, where the first interface includes options for at least two second devices.
- step S104 is an optional step, that is, after the task monitoring module receives the at least one second device installed with the task processing module, it can process the first task according to preset rules or randomly select a second device, without the need for Displayed to the user, selected by the user.
- the task monitoring module determines that multiple devices are installed with task processing services, it automatically selects one device from multiple devices to process the first task, and the task monitoring module can randomly select one device from multiple devices to process the first task.
- the task is processed, or a device with a lighter load can be selected to process the first task according to the load conditions of multiple devices, or a performance can be selected according to the size of the processing resources required by the first task and the performance of multiple devices.
- the matched device processes the first task, which is not limited in this embodiment.
- the task monitoring module when the task monitoring module finds that at least two second devices are installed with task processing modules, the task monitoring module displays a first interface, where the first interface includes options for at least two second devices, and the user selects the options from the second device.
- One of the at least two second devices is selected to process the first task, and in response to the user's first selection operation on the options of the at least two second devices, a target device to process the first task is determined, and the first selection operation Used to select the target device.
- the task monitoring module can display the second electronic device with the task processing function to the user in the form of a list.
- the processing device list includes multiple devices, and the user can select a target device from the multiple devices to process the first task.
- the task monitoring module acquires that two second devices are installed with task processing modules, and an interactive interface as shown in FIG. 16 pops up.
- the interactive interface displays two second devices: a router and a speaker.
- the router is selected to process the first task. After the user selects the router, the user can click the "Confirm" button, and the router starts to process the first task.
- the interactive interface shown in FIG. 16 may not pop up, and the device is used for processing by default.
- the first device determines a target device for processing the first task from at least one slave device according to the first task processing request. It can be understood that the above is only an example.
- the task monitoring module sends a second task processing request to the distributed scheduling module, where the second task processing request includes information on the target device for processing the first task.
- the first device After determining the target device for processing the first task, the first device sends a task processing command to the target device, specifically, the task monitoring module and the distributed scheduling module can send the task processing command to the target device.
- the target device is any one of the at least one second device, and the target device may be selected by the user from multiple second devices, or may be independently selected by the task monitoring module from multiple second devices.
- the distributed scheduling module sends a task processing command to the target device.
- the distributed scheduling module In response to the second task processing request, the distributed scheduling module sends a task processing command to the target device, where the processing command is used to instruct the target device to execute the first task. After receiving the second task processing request, the distributed scheduling module acquires from the second task processing request that the target device executes the first task, and sends a task processing command to the target device.
- the target device executes the first task according to the task processing command.
- the task processing module in the target device After receiving the task processing command, the task processing module in the target device processes the first task according to the task processing command.
- the target device returns the processing result of the first task to the task monitoring module.
- the target device processes the first task to obtain a processing result, and returns the processing result to the task monitoring module.
- the task monitoring module displays the processing result of the first task to the user.
- the second processing request includes the address of the download task
- the distributed scheduling module carries the address of the download task in the download command and sends it to the target device, and the target device sends the download task address according to the download command in the download command. address to download, and send the downloaded video or other files to the task monitoring module, and the task monitoring module displays the downloaded video or other files to the user.
- a distributed app is installed on multiple electronic devices, and the functions of the distributed app are jointly completed by the multiple electronic devices.
- the first device that has downloaded and installed the distributed app can monitor the task processing request, find the second device with the task processing module of the distributed app installed according to the task processing request, and then request the second device to perform the task processing, the second device returns the task processing result to the first device after processing the task, so that distributed task processing can be implemented.
- the method realizes distributed functions through distributed apps, improves the portability of distributed functions, and any electronic device installed with distributed OS can install distributed apps to obtain distributed functions provided by distributed apps, It also reduces the development difficulty and cost of distributed services.
- This embodiment is described by taking the task monitoring module on the master device (ie, the first device) as an example to monitor tasks and trigger task execution. It can be understood that the above process in this embodiment is also applicable to the task monitoring module on the slave device.
- the task monitoring module on the master device and the task monitoring module on the slave device have the same functions, and there is no difference in the task monitoring and triggering process.
- the task monitoring modules on the master device and the slave device need to communicate with the master device through the distributed soft bus
- the distributed installation management module or the distributed scheduling module on the device communicates. For the distributed installation management module and the distributed scheduling module, it is not necessary to distinguish whether the task monitoring module belongs to the master device or the slave device.
- FIG. 17 is a schematic diagram of a query flow of task status in a distributed app.
- the task status query performed by the task management module on the main device ie, the first device
- the query flow includes: The following steps:
- the task management module receives a task status query request input by a user.
- the task status query request is used to request to query the status of tasks currently being processed in the distributed app, that is, query the status of tasks on each second electronic device on which the task processing module is installed.
- the task management module can be triggered by the user to initiate a task status query.
- a mobile phone is the main device, the user enters the query function page through a distributed app on the mobile phone, and initiates a task status query through the query function page.
- the first device determines a second device with a task processing function from at least one slave device according to the task status query request.
- the second device with a task processing function is determined by the method shown in step S202 below.
- the task management module queries the distributed installation management module for information about at least one second device on which the task processing module is installed.
- the task management module can use the steps of steps S102 and S103 in the embodiment shown in FIG. 10 to query the information of at least one second device installed with the task processing module. Of course, it can also use different tasks from the task monitoring module in the embodiment shown in FIG. 10 .
- the information of the second device is queried in the manner of , which is not limited in this embodiment.
- the task management module sends a first connection establishment request to the distributed scheduling module, where the first connection establishment request is used to request to establish a connection with the second device.
- the task management module displays an interactive interface to the user, the interactive interface displays the multiple second devices, and the user can select one or more The status of tasks on multiple second devices is queried.
- the task management module sends a first connection establishment request to the distributed scheduling module according to the user's selection, the first connection establishment request includes information of the second device that needs to establish a connection, and the distributed scheduling module according to the first connection establishment request, Only establish a connection with the second device included in the first connection establishment request.
- the task management module does not display the user interaction interface, and queries the task status of all second devices installed with the task processing module by default.
- the first connection establishment request may include the information of the second device, or may The information of the second device is not included.
- the distributed scheduling module finds that the first connection establishment request does not include the information of the second device, and sends the connection establishment request to all the second devices by default.
- the distributed scheduling module sends a second connection establishment request to the second device.
- the second connection establishment request is used to request to establish a request with the second device.
- the second device returns a connection establishment response to the task management module.
- Step S205 is an optional step. After the task management module sends the first connection establishment request to the distributed scheduling module, the connection with the second device is established after a preset time by default. In S205, the second device directly returns the connection establishment response to the task management module. It can be understood that, in practice, the second device may first return the second connection establishment response to the distributed scheduling module, and the distributed scheduling module then returns the first connection establishment response to the task management module. A connection establishment response.
- the task management module acquires the status of the task processed by the second device through the connection.
- the task management module obtains the status of the task processed on the second device through the connection established with the second device. Specifically, the task management module can interact with the second device through one or more pieces of information to obtain the status of the task processed on the second device. state.
- the method of steps S203-S206 can be used to request the second device for the status of the task processed by the second device. It can be understood that this is just an example. does not constitute a limitation.
- the task management module displays the status of the task processed by the second device.
- the task status information is, for example, processing completed, processing, processing failure, etc.
- the processing progress of the task can also be displayed. For example, the processing progress of the task is 60% completed, and it will take X minutes to complete.
- the task management module receives a task deletion/suspend request input by the user according to the state of the task processed by the second device.
- steps S208 and S209 are optional steps, and the user may not perform any operation after seeing the status of the task processed on the second device, and accordingly steps S208 and S209 will not be executed.
- the user can choose to delete the task, and for tasks that are being processed, the user can choose to suspend or delete the task.
- the task management module sends a task deletion/suspend request to the second device through the connection.
- the second device deletes the corresponding task according to the task deletion request, and stops executing the corresponding task according to the task suspension request.
- the second device may also return a task deletion/pause response to the task management module.
- the task deletion response is used to notify the task deletion success or deletion failure.
- the task suspension request is used to notify the task suspension success or suspension failure.
- Task management The module may display the processing result to the user according to the task deletion/suspend response returned by the second device.
- This embodiment takes the task status query performed by the task management module on the master device (ie, the first device) as an example for description. It can be understood that the task status query can also be performed by the task management module on the slave device.
- the functions of the management module and the task management module on the slave device are the same, and there is no difference in the query process between the two.
- the task management module on the master device and the slave device both need to be managed through the distributed soft bus and the distributed installation management on the master device.
- the modules communicate with the distributed scheduling module. For the distributed installation management module and the distributed scheduling module, it is not necessary to distinguish whether the task management module belongs to the master device or the slave device.
- Fig. 18 is the application management flow chart of the distributed app. As shown in Fig. 18, the application management flow includes the following steps:
- the application management module receives a management request input by a user.
- the application management module on the main device can provide a management portal to the user, and the user inputs a management request through the portal to be managed.
- the main device as a mobile phone as an example
- the user opens the management portal through the operation process shown in FIG. 19 , as shown in the figure.
- the setting page shown in Figure 19(a) is opened, and some setting options on the mobile phone are displayed on the setting page, and the setting options include "WLAN”, “Bluetooth”, "Mobile Network”, “Desktop and Wallpaper”, “Display and Brightness”, “Sound and Vibration”, “Apply” and “Battery”, etc.
- the application setting page shown includes setting options such as "application management”, “application startup management”, and “permission management”.
- the application management page shown in Figure 19(c) is entered.
- the application management page includes the entries of all the applications installed on the device.
- the application is managed in detail, for example , rights management, traffic usage management, storage management, etc.
- a distributed management function is added, and users trigger management requests through the distributed management function.
- the application management module queries the distributed installation management module for the slave device on which the distributed app is installed, the function module installed on the slave device, and the function module installed on the first device.
- the application management module sends a fourth query request to the distributed installation management module according to the management request, where the fourth query request is used to request to query each device on which the distributed app is installed and the function modules installed on each device.
- the distributed installation management module sends a fourth query response to the application management module, where the fourth query response includes information on slave devices and function modules installed on each slave device according to the distributed app.
- the fourth query request may include the ID of the distributed app to be queried.
- the distributed installation management module may, according to the ID of the distributed app included in the fourth query request, query whether the app is installed.
- the slave device of the distributed app and the function of querying the master device and the installation on each slave device.
- the application management module displays the slave device on which the distributed application is installed and the function modules installed on the first device.
- FIG. 20 is a schematic diagram of a management page of the function modules of the distributed app installed on each device, the management page displays the function modules of the distributed app installed on the master device and the slave device, exemplarily, installed on a mobile phone
- the task management module and task monitoring module of the distributed app are installed, the task management module and task monitoring module of the distributed app are installed on the tablet, and the download module of the distributed app is installed on the router and speakers.
- the application management module receives a function module addition/deletion request input by the user.
- step S304 is an optional step. After querying the function modules of the distributed app installed on each device, the user may not need to adjust the function modules installed on each device, and the query process ends, and step S304 is not executed.
- the user can delete the installed functional modules on each device shown in Figure 20(a), or add functional modules on each device. Add download modules to your computer.
- the user can perform a long-press operation on the area where the installed functional modules on each device shown in FIG. 20(a) are located, and enter the page shown in FIG. 20(b) in response to the long-press operation
- a dialog box pops up on the page shown in Figure 20(a).
- the dialog box displays prompt information to prompt the user whether to uninstall the A1 function on the device A. If the user can select "Yes”, the A1 function on the device A will be uninstalled. , if the user selects "No", the A1 function on device A will not be uninstalled.
- the page shown in FIG. 20(a) also displays a function increase control, and a function increase control may be displayed below the installed functions of each device.
- a dialog box or a jump is displayed. Go to another page, the dialog box or the page after jumping displays all the functions that can be added by the user, and the user can choose to add one or more functions.
- function addition controls can also be displayed at the bottom of the entire page or in other blank areas.
- the function module addition request is used to add a function module on the first device or the slave device
- the function module deletion request is used to delete the function module on the first device or the slave device.
- the application management module sends a function module addition/deletion request to the distributed installation management module.
- the distributed installation management module After the distributed installation management module receives the function module addition/deletion request, if the function module addition/deletion request is used to add/delete the function module on the first device, the distributed installation management module will add/delete the function module according to the function module addition request on the first device. Install the added function module on the first device, or delete the corresponding function module on the first device according to the function module deletion request. After the modules are added/deleted successfully, the distributed installation management module updates the information of the function modules installed on the first device. Optionally, the distributed installation management module sends a function module addition/deletion response to the application management module, where the function module addition/deletion response is used to notify the function module addition/deletion success. In this embodiment, the distributed installation management module records information of function modules installed on each device.
- the distributed installation management module does not update the information of the function modules installed on the first device.
- the distributed installation management module sends a function module addition/deletion response to the application management module, where the function module addition/deletion response is used to notify the function module addition/deletion failure.
- step S306 is executed.
- the distributed installation management module sends a function module addition/deletion request to the slave device that needs to add/delete functions.
- the function module addition request includes the installation file of the function module to be added, and the function deletion request includes the identifier of the function module to be deleted or the installation address of the function module to be deleted.
- the slave device performs a function module addition/deletion operation according to the function module addition/deletion request.
- the slave device parses the installation file of the function module to be added included in the function module addition request, completes the installation of the function module, and installs the function module to be deleted according to the identification of the function module to be deleted included in the function module deletion request or the installation of the function module to be deleted. address, delete or uninstall the corresponding function module.
- the slave device sends a function module addition/deletion response to the distributed installation management module.
- a function module addition/deletion response is returned to the distributed installation management module.
- the function module addition response is used to notify the success or failure of the module addition
- the function module deletion response is used to notify the module. Deletion succeeded or failed. If the function module addition/deletion response indicates that the function module addition/deletion on the slave device is successful, go to step S309; if the function module add/delete response indicates that the function module addition/deletion fails on the slave device, go to step S310.
- the distributed installation management module updates the information of the function modules installed on the slave device.
- the distributed installation management module updates the information of the function modules installed on the slave device, and after the update, executes step S310.
- the distributed installation management module sends a function module addition/deletion response to the application management module.
- the method of this embodiment can add or delete function modules on each device on which the distributed app is installed according to user requirements, realize flexible management of the distributed app, and enable each device to better perform the functions of the distributed app .
- the apparatus 300 includes: a distributed application 31, a distributed installation management module 32, and a distributed scheduling module 33.
- the distributed application The application 31 includes multiple functional modules, the multiple functional modules are installed in the first device and at least one slave device, the first device and the at least one slave device communicate through the distributed OS, and the first device downloads the installation of the distributed application 31 file device, the multiple functional modules include a task monitoring module 311 and a task processing module 312, the task monitoring module 311 is installed in the first device, the task processing module 312 is installed in at least one second device, and the second device is slave device.
- the task monitoring module 311 is configured to: monitor the first task processing request input by the user, where the first task processing request is used to request processing of the first task; in response to the first task processing request, to the distributed installation
- the management module 32 queries the at least one second device installed with the task processing module 312; sends a second task processing request to the distributed scheduling module 33, where the second task processing request includes The information of the target device of the task processing, the target device is any device in the at least one second device;
- the distributed scheduling module 33 is configured to send a task processing command to the target device in response to the second task processing request;
- the task monitoring module 311 is further configured to receive the processing result of the first task by the target device.
- the task monitoring module 311 is further configured to: before sending the second task processing request to the distributed scheduling module 33, when it is queried that at least two second devices are installed with the task processing module is displayed, the first interface includes options of the at least two second devices; in response to the user's first selection operation on the options of the at least two second devices, the distributed The scheduling module sends the second task processing request, and the first selection operation is used to select the target device.
- the task monitoring module 311 is further configured to: after receiving the processing result of the first task, display the processing result of the first task.
- the distributed installation management module 32 is further configured to: determine the distributed installation of the distributed application; determine the slave device on which the distributed application is installed and the slave device installed on the slave device. The function module of the distributed application; sending the function module of the distributed application to the corresponding slave device.
- the distributed installation management module 32 determines to perform distributed installation of the distributed application, specifically: detecting that the installation file of the distributed application includes first indication information, the The first indication information is used to indicate that the distributed application supports a distributed function; according to the first indication information, it is determined to perform distributed installation on the distributed application.
- the distributed installation management module 32 determines to perform distributed installation of the distributed application, specifically: detecting that the installation file of the distributed application includes first indication information, the The first indication information is used to indicate that the distributed application supports distributed functions; a second interface is displayed according to the first indication information, and the second interface includes a distributed installation option; The confirmation operation of the option determines the distributed installation of the distributed application.
- the distributed installation management module 32 determines the slave device on which the distributed application is installed and the function module of the distributed application installed on the slave device, specifically: displaying a third interface, all The third interface includes candidate devices that can install the distributed application and options for functional modules that can be installed on each candidate device; in response to the user's second selection operation on the functional modules that can be installed on the candidate device, determine A slave device on which the distributed application is installed, and a function module installed on the slave device.
- the distributed installation management module 32 determines the slave device on which the distributed application is installed and the function module of the distributed application installed on the slave device, specifically: displaying a fourth interface, The fourth interface includes an option for a candidate device capable of installing the distributed application; in response to the user's third selection operation on the candidate device, determining a slave device to install the distributed application; displaying a fifth interface, The fifth interface displays options of the function modules that can be installed on the slave device; in response to the user's fourth selection operation on the function modules that can be installed on the slave device, the functions installed on the slave device are determined. module.
- the distributed installation management module 32 is further configured to: after sending the function modules of the distributed application to the corresponding slave devices, when receiving all the installation completion response messages returned by the slave devices, Confirm that the distributed application is installed successfully; and display a fifth interface, where the fifth interface is used to notify the distributed application that the installation is complete.
- the distributed application 31 further includes a task management module 313, the task management module is installed 313 on the first device, and the task management module 313 is used for: receiving tasks input by the user Status query request, the task status query request is used to request to query the status of the task currently being processed in the distributed application; in response to the task status query request, query the distributed installation management module 32 for the installation of the Information of the at least one second device of the task processing module 312; according to the information of the second device, send a first connection establishment request to the distributed scheduling module 33, where the first connection establishment request is used to request and The second device establishes a connection.
- the distributed scheduling module 33 is configured to send a second connection establishment request to the second device; the task management module 313 is further configured to obtain the status of the task processed by the second device through the connection, and display The status of the task being processed by the second device.
- the task management module 313 is further configured to receive a task deletion request input by the user according to the state of the task processed by the second device; send the task deletion request to the second device through the connection Task deletion request.
- the task management module 313 is further configured to receive a task suspension request input by the user according to the state of the task processed by the second device; send the task suspension request to the second device through the connection Task suspension request.
- an application management module 34 is also included, configured to receive a management request input by a user; in response to the management request, query the distributed installation management module 32 for the slave device on which the distributed application is installed , the function modules installed on the slave device and the function modules installed on the first device; the slave device installed with the distributed application and the function modules installed on the first device are displayed.
- the application management module is further configured to receive a function module addition request input by a user; send the function module addition request to the distributed installation management module 32; the distributed installation management module 32 is further used for, when the function module addition request is for adding a function module on the first device, install the added function module on the first device according to the function module addition request; when the function module is added
- the module addition request is used to add a function module on a slave device, the function module addition request is sent to the slave device that needs to add a function module.
- the distributed installation management module 32 is further configured to update the installed function module on the first device after installing the added function module on the first device according to the function module addition request. information of the function module; send a function module addition response to the application management module.
- the distributed installation management module 32 is further configured to receive the function module addition response sent by the slave device after sending the function module addition request to the slave device that needs to add a function module; according to the The function module addition response updates the information of the function module installed on the first device; the function module addition response is sent to the application management module 34 .
- the application management module 34 is further configured to receive a function module deletion request input by a user, and send the function module deletion request to the distributed installation management module; the distributed installation management module 32 is further used for, when the function module deletion request is used to delete the function module on the first device, delete the corresponding function module on the first device according to the function module deletion request; When the module addition request is used to delete the function module on the slave device, the function module deletion request is sent to the slave device that needs to delete the function module.
- the distributed installation management module 32 is further configured to update the software installed on the first device after deleting the corresponding function module on the first device according to the function module deletion request. information of the function module, and send a function module deletion response to the application management module 34 .
- the distributed installation management module 32 is further configured to, after sending the function module deletion request to the slave device that needs to delete the function module, receive the function module deletion response sent by the slave device, according to the The function module deletion response updates the information of the function module installed on the slave device, and sends the function module deletion response to the application management module.
- the task monitoring module 311 is also installed in at least one slave device.
- the task management module 313 is also installed in at least one slave device.
- the apparatus 300 provided in this embodiment can be used to perform the method steps performed by the first device (or the main device) mentioned above, and the implementation principles and technical effects thereof are similar, and details are not repeated here.
- FIG. 22 is a schematic structural diagram of a distributed application processing apparatus provided by an embodiment of the present application.
- the apparatus 400 provided by this embodiment includes:
- a receiving module 41 configured to receive an installation file of at least one function module of the distributed application sent by the first device
- the installation module 42 is configured to install the corresponding function module according to the installation file of the at least one function module.
- the distributed application includes a task monitoring module, a distributed installation management module, a task processing module and a distributed scheduling module
- the device 400 is installed with the task monitoring module 43
- the distributed The distributed installation management module and the distributed scheduling module are installed on the first device
- the task processing module is installed on at least one second device
- the second device is a slave device.
- the task monitoring module 43 is configured to monitor the first task processing request input by the user, and the first task processing request is used to request processing of the first task;
- the distributed installation management module queries the at least one second device installed with the task processing module; sends a second task processing request to the distributed scheduling module, where the second task processing request includes a request for the first task Information of a processed target device, where the target device is any one of the at least one second device; and receiving a processing result of the first task by the target device.
- the task monitoring module 43 is further configured to, before sending the second task processing request to the distributed scheduling module, when it is queried that at least two second devices are installed with the task processing module , displaying a first interface, where the first interface includes options of the at least two second devices; in response to the user's first selection operation on the options of the at least two second devices, send a message to the distributed scheduling The module sends the second task processing request, and the first selection operation is used to select the target device.
- the task monitoring module 43 is further configured to, after receiving the processing result of the first task, display the processing result of the first task.
- the distributed application includes a task management module 44, the task management module is installed on the device 400, and the task management module 44 is configured to receive a task status query request input by a user, The task status query request is used to request to query the status of the task currently being processed in the distributed application; in response to the task status query request, query the distributed installation management module for all the tasks in which the task processing module is installed.
- information of at least one second device according to the information of the second device, send a first connection establishment request to the distributed scheduling module, where the first connection establishment request is used to request to establish a connection with the second device;
- the connection acquires the status of the task processed by the second device, and displays the status of the task processed by the second device.
- the task management module 44 is further configured to receive a task deletion request input by the user according to the state of the task processed by the second device, and send the task deletion request to the second device through the connection Task deletion request.
- the task management module 44 is further configured to receive a task suspension request input by the user according to the state of the task processed by the second device, and send the task suspension request to the second device through the connection Task suspension request.
- the device 400 is provided with the task processing module 45, and the task processing module is configured to receive a task processing command sent by the distributed scheduling module, and the task processing command is used to Instruct to process the first task; process the first task according to the task processing command, and send the processing result of the first task to the distributed scheduling module.
- the receiving module 41 is further configured to receive a function module addition request sent by the distributed installation management module; the installation module 42 is further configured to, according to the function module addition request, The added function module is installed on the device, and a function module addition response is sent to the distributed installation management module.
- the receiving module 41 is further configured to receive a function module deletion request sent by the distributed installation management module; the installation module 42 is further configured to, according to the function module addition request, The corresponding function module is deleted on the device, and a function module deletion response is sent to the distributed installation management module.
- the task monitoring module is also installed on the first device.
- the task management module is also installed on the first device.
- the apparatus 400 provided in this embodiment can be used to perform the method steps performed by the second device (or the slave device) mentioned above, and the implementation principles and technical effects thereof are similar, and are not repeated here.
- the present application provides an electronic device 500, comprising: a processor 51, a memory 52, and a communication interface 53; the memory 52 is used to store program instructions, the communication interface 53 is used to communicate with other devices, and the processor 51 is used to call The program instructions in the memory 52 cause the electronic device 500 to execute the processing method of the distributed application in the foregoing embodiment.
- the present application provides a chip system, which is applied to an electronic device including a memory, a display screen and a sensor; the chip system includes: a processor; when the processor executes the computer instructions stored in the memory, the electronic device executes the foregoing The processing method of the distributed application in the embodiment.
- the present application provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to cause an electronic device to implement the distributed application processing method in the foregoing embodiments.
- the present application provides a computer program product, comprising: execution instructions, the execution instructions are stored in a readable storage medium, at least one processor of an electronic device can read the execution instructions from the readable storage medium, and at least one processor Executing the execution instruction enables the electronic device to implement the distributed application processing method in the foregoing embodiment.
- all or part of the functions may be implemented by software, hardware, or a combination of software and hardware.
- software When implemented in software, it can be implemented in whole or in part in the form of a computer program product.
- a computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions according to the embodiments of the present application are generated in whole or in part.
- the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
- Computer instructions may be stored in a computer-readable storage medium.
- a computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
- Useful media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.
- the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
- the program When the program is executed , which may include the processes of the foregoing method embodiments.
- the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
- Multi Processors (AREA)
- Computer And Data Communications (AREA)
Abstract
提供了一种分布式应用的处理方法和装置,将分布式app安装在多个电子设备上,由多个电子设备共同完成分布式app的功能。其中,下载并安装了分布式app的第一设备能够监听任务处理请求,并根据任务处理请求查找到具有任务处理功能第二设备,然后请求第二设备对任务进行处理,第二设备对任务进行处理后,向第一设备返回任务处理结果,从而能够实现分布式任务处理。
Description
本申请要求于2021年01月22日提交中国专利局、申请号为202110090270.6、申请名称为“分布式应用的处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,尤其涉及一种分布式应用的处理方法和装置。
为了满足未来对全场景智慧生活的需求,分布式操作系统(operating system,OS)应用而生,不同于传统面向单设备的OS,分布式OS是面向多设备的OS。分布式OS的主要功能包括:分布式任务调度、分布式数据管理、硬件能力虚拟化以及分布式软总线。其中硬件能力虚拟化为共享资源,分布式软总线连接不同终端,从而在终端之间实现能力互助共享,带来最佳协同体验。
常见家庭场景下,分布式OS可以实现手机、平板电脑、电视、路由器的互联,互联的多个设备可以协同完成一个或者多个功能。通过多个设备协同完成的功能可以称为分布式功能,目前分布式功能预制在设备中,属于系统自带的功能,导致分布式功能的可移植性差。
发明内容
本申请实施例提供一种分布式应用的处理方法和装置,能够将app的功能分布式安装在多个电子设备上,由该多个电子设备共同完成该app的功能,提高了分布式功能的可移植性。
第一方面,本申请实施例提供一种分布式应用的处理方法,所述方法应用于第一设备,所述第一设备包括分布式应用,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在所述第一设备上,所述多个功能模块中的第二类功能模块安装在从设备中,所述第一设备和至少一个从设备通过分布式操作系统OS通信,所述第一设备为下载所述分布式应用的安装文件的设备。
所述方法包括:监听第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;根据所述第一任务处理请求,从所述至少一个从设备中确定对所述第一任务进行处理的目标设备;向所述目标设备发送任务处理命令,接收所述目标设备对所述第一任务的处理结果。
通过第一方面提供的方法,在安装有分布式app的第一设备上触发的任务处理请求,可以由安装有该分布式app的从设备对任务处理请求进行处理,并向第一设备返回任务处理结果,通过该多个电子设备共同完成该app的功能,提高了分布式功能的可移植性。
在一种可能的设计中,所述第一类功能模块和所述第二类功能模块中的部分功能模块 相同。
在一种可能的设计中,所述从所述至少一个从设备中确定对所述第一任务进行处理的目标设备,包括:当所述至少一个从设备中有至少两个从设备能够对所述第一任务处理时,显示第一界面,所述第一界面中包括所述至少两个从设备的选项;接收用户对所述至少两个从设备的选项的第一选择操作,确定所述第一选择操作对应的从设备为所述目标设备。
通过向用户展示第一界面,用户通过第一界面选择对任务处理请求进行处理的具体设备,带给用户更好的体验。
在一种可能的设计中,所述方法还包括:显示所述第一任务的处理结果。
在一种可能的设计中,所述方法还包括:确定对所述分布式应用进行分布式安装,确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,将所述分布式应用的功能模块对应的安装文件发送给对应的从设备。
在一种可能的设计中,所述确定对所述分布式应用进行分布式安装,包括:检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;根据所述第一指示信息,确定对所述分布式应用进行分布式安装。
在一种可能的设计中,所述确定对所述分布式应用进行分布式安装,包括:检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;根据所述第一指示信息显示第二界面,所述第二界面中包括分布式安装选项;接收用户对所述分布式安装选项的确认操作,根据所述确认操作确定对所述分布式应用进行分布式安装。
在一种可能的设计中,所述确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,包括:显示第三界面,所述第三界面中包括能够安装所述分布式应用的候选设备以及各候选设备上能够安装的功能模块的选项;接收用户对所述候选设备上能够安装的功能模块的第二选择操作,根据所述第二选择操作确定安装所述分布式应用的从设备,以及所述从设备上安装的功能模块。
在一种可能的设计中,所述确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,包括:显示第四界面,所述第四界面中包括能够安装所述分布式应用的候选设备的选项;接收用户对所述候选设备的第三选择操作,根据所述第三选择操作确定安装所述分布式应用的从设备;显示第五界面,所述第五界面上显示有所述从设备上能够安装的功能模块的选项;接收用户对所述从设备上能够安装的功能模块的第四选择操作,根据所述第四操作确定所述从设备上安装的功能模块。
在一种可能的设计中,所述将所述分布式应用的功能模块对应的安装文件发送给对应的从设备之后,还包括:在接收到所有从设备返回的安装完成响应消息时,确认所述分布式应用安装成功;显示第五界面,所述第五界面用于通知所述分布式应用安装完成。
本申请第二方面提供一种分布式应用的处理方法,所述方法应用于第一设备,所述第一设备包括分布式应用,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在所述第一设备上,所述多个功能模块中的第二类功能模块安装在至少一个从设备中所述第一设备和所述至少一个从设备通过分布式操作系统OS通信,所述第一设备为下载所述分布式应用的安装文件的设备,所述方法包括:接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态; 根据所述任务状态查询请求,从所述至少一个从设备中确定具有任务处理功能的第二设备;向所述第二设备请求所述第二设备处理的任务的状态,显示所述第二设备处理的任务的状态。
通过向用户提供查询接口,用户通过该查询接口能够查询各设备上处理的任务的状态,便于用户了解任务的状态。
在一种可能的设计中,所述第一类功能模块和所述第二类功能模块中的部分功能模块相同。
在一种可能的设计中,所述方法还包括:接收用户根据所述第二设备处理的任务的状态输入的任务删除请求;向所述第二设备发送所述任务删除请求。
在一种可能的设计中,所述方法还包括:接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求,向所述第二设备发送所述任务暂停请求。
本申请第三方面提供一种分布式应用的处理方法,所述方法应用于第一设备,所述第一设备包括分布式应用,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在所述第一设备上,所述多个功能模块中的第二类功能模块安装在从设备中,所述第一设备和至少一个从设备通过分布式操作系统OS通信,所述第一设备为下载所述分布式应用的安装文件的设备,所述方法包括:接收用户输入的管理请求,根据所述管理请求,显示安装了所述分布式应用的从设备以及所述第一设备上安装的功能模块。
该方法能够对分布式应用的功能模块进行灵活管理,灵活调整各个设备上的功能模块,例如增加或者删除某个设备的功能模块,具体实现方式参照下述。
在一种可能的设计中,所述第一类功能模块和所述第二类功能模块中的部分功能模块相同。
在一种可能的设计中,还包括:接收用户输入的功能模块增加请求;当所述功能模块增加请求用于增加所述第一设备上的功能模块时,根据所述功能模块增加请求在所述第一设备上安装增加的功能模块;当所述功能模块增加请求用于增加从设备上的功能模块时,向需要增加功能模块的从设备发送所述功能模块增加请求。
在一种可能的设计中,所述根据所述功能模块增加请求在所述第一设备上安装增加的功能模块之后,还包括:更新所述第一设备上安装的功能模块的信息。
在一种可能的设计中,所述向需要增加功能模块的从设备发送所述功能模块增加请求之后,还包括:接收从设备发送的功能模块增加响应;根据所述功能模块增加响应更新所述第一设备上存储的所述从设备上安装的功能模块的信息。
在一种可能的设计中,所述方法还包括:接收用户输入的功能模块删除请求;当所述功能模块删除请求用于删除所述第一设备上的功能模块时,根据所述功能模块删除请求在所述第一设备上删除对应的功能模块;当所述功能模块增加请求用于删除从设备上的功能模块时,向需要删除功能模块的从设备发送所述功能模块删除请求。
在一种可能的设计中,所述根据所述功能模块删除请求在所述第一设备上删除对应的功能模块之后,还包括:更新所述第一设备上安装的功能模块的信息。
在一种可能的设计中,所述向需要删除功能模块的从设备发送所述功能模块删除请求之后,还包括:接收从设备发送的功能模块删除响应;根据所述功能模块删除响应更新所述第一设备上存储的所述从设备上安装的功能模块的信息。
第四方面,本申请实施例提供一种分布式应用的处理方法,所述方法应用于分布式应用的从设备,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在第一设备中,所述多个功能模块中的第二类功能模块安装在从设备中,所述第一设备为下载所述分布式应用的安装文件的设备,所述第一设备和至少一个从设备通过分布式操作系统OS通信,所述方法包括:接收所述第一设备发送的所述分布式应用的至少一个功能模块的安装文件,根据所述至少一个功能模块的安装文件安装对应的功能模块。
主设备通过将分布式应用的部分功能模块发送给从设备,由从设备完成相应功能模块的安装,从而使得主设备与从设备协同实现分布式app的功能。
在一种可能的设计中,所述第一类功能模块和所述第二类功能模块中的部分功能模块相同。
在一种可能的设计中,所述方法还包括:监听第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;根据所述第一任务处理请求,确定对所述第一任务进行处理的目标设备,向所述目标设备发送任务处理命令,接收所述目标设备对所述第一任务的处理结果。
在一种可能的设计中,所述根据所述第一任务处理请求,确定对所述第一任务进行处理的目标设备,包括:向所述第一设备请求能够对所述第一任务处理的从设备;当有至少两个从设备能够对所述第一任务处理时,显示第一界面,所述第一界面中包括所述至少两个从设备的选项;接收用户对所述至少两个从设备的选项的第一选择操作,确定所述第一选择操作对应的从设备为所述目标设备。
在一种可能的设计中,所述方法还包括:接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;根据所述任务状态查询请求,确定具有任务处理功能的第二设备,向所述第二设备请求所述第二设备处理的任务的状态,显示所述第二设备处理的任务的状态。
在一种可能的设计中,所述方法还包括:接收用户根据所述第二设备处理的任务的状态输入的任务删除请求,向所述第二设备发送所述任务删除请求。
在一种可能的设计中,所述方法还包括:接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求,向所述第二设备发送所述任务暂停请求。
在一种可能的设计中,所述方法还包括:接收所述第一设备发送的任务处理命令,所述任务处理命令用于指示对第一任务进行处理;根据所述任务处理命令对所述第一任务进行处理,向所述第一设备发送所述第一任务的处理结果。
在一种可能的设计中,所述方法还包括:接收所述第一设备发送的功能模块增加请求,根据所述功能模块增加请求在所述从设备上安装增加的功能模块,向所述第一设备发送功能模块增加响应。
在一种可能的设计中,所述方法还包括:接收所述第一设备发送的功能模块删除请求,根据所述功能模块增加请求在所述从设备上删除对应的功能模块,向所述第一设备发送功能模块删除响应。
第五方面,本申请实施例提供一种分布式应用的处理方法,该方法应用于第一设备,该第一设备包括分布式应用、分布式安装管理模块和分布式调度模块,分布式应用包括多个功能模块,该多个功能模块中的第一类功能模块安装在第一设备上,该多个功能模块中 的第二类功能模块安装在从设备中,第一设备和至少一个从设备通过分布式OS通信,第一设备为下载分布式应用的安装文件的设备,该多个功能模块包括任务监听模块和任务处理模块,任务监听模块安装在第一设备中,任务处理模块安装在至少一个第二设备中,第二设备为从设备。
该方法包括:任务监听模块监听第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;响应于所述第一任务处理请求,所述任务监听模块向所述分布式安装管理模块查询安装有所述任务处理模块的所述至少一个第二设备;所述任务监听模块向所述分布式调度模块发送第二任务处理请求,所述第二任务处理请求中包括对所述第一任务处理的目标设备的信息,所述目标设备为所述至少一个第二设备中任一设备;响应于所述第二任务处理请求,所述分布式调度模块向所述目标设备发送任务处理命令;所述任务监听模块接收所述目标设备对所述第一任务的处理结果。
通过第一方面提供的方法,在安装有分布式app的第一设备上触发的任务处理请求,可以由安装有该分布式app的第二设备对任务处理请求进行处理,并向第一设备返回任务处理结果,通过该多个电子设备共同完成该app的功能,提高了分布式功能的可移植性。
在一种可能的设计中,所述第一类功能模块和所述第二类功能模块中的部分功能模块相同。
在一种可能的设计中,所述任务监听模块向所述分布式调度模块发送第二任务处理请求之前,还包括:当所述任务监听模块查询到至少两个第二设备安装有所述任务处理模块时,所述任务监听模块显示第一界面,所述第一界面中包括所述至少两个第二设备的选项;所述任务监听模块向所述分布式调度模块发送第二任务处理请求,包括:响应于用户对所述至少两个第二设备的选项的第一选择操作,所述任务监听模块向所述分布式调度模块发送所述第二任务处理请求,所述第一选择操作用于选择所述目标设备。
通过向用户展示第一界面,用户通过第一界面选择对任务处理请求进行处理的具体设备,带给用户更好的体验。
在一种可能的设计中,所述任务监听模块接收到所述第一任务的处理结果后,显示所述第一任务的处理结果,便于用户实时了解任务的状态。
在一种可能的设计中,还包括:所述分布式安装管理模块确定对所述分布式应用进行分布式安装;所述分布式安装管理模块确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块;所述分布式安装管理模块将所述分布式应用的功能模块对应的安装文件发送给对应的从设备。
在一种可能的设计中,所述分布式安装管理模块确定对所述分布式应用进行分布式安装,包括:所述分布式安装管理模块检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;所述分布式安装管理模块根据所述第一指示信息,确定对所述分布式应用进行分布式安装。
在一种可能的设计中,所述分布式安装管理模块确定对所述分布式应用进行分布式安装,包括:所述分布式安装管理模块检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;所述分布式安装管理模块根据所述第一指示信息显示第二界面,所述第二界面中包括分布式安装选项;响应于用户对所述分布式安装选项的确认操作,所述分布式安装管理模块确定对所述分布式应用进 行分布式安装。
由此,用户可以根据实际需求选择是否对应用进行分布式安装,满足不同用户的差异性需求。
在一种可能的设计中,所述分布式安装管理模块确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,包括:显示第三界面,所述第三界面中包括能够安装所述分布式应用的候选设备以及各候选设备上能够安装的功能模块的选项;响应于用户对所述候选设备上能够安装的功能模块的第二选择操作,确定安装所述分布式应用的从设备,以及所述从设备上安装的功能模块。
在另一种可能的设计中,所述分布式安装管理模块确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,包括:显示第四界面,所述第四界面中包括能够安装所述分布式应用的候选设备的选项;响应于用户对所述候选设备的第三选择操作,确定安装所述分布式应用的从设备;显示第五界面,所述第五界面上显示有所述从设备上能够安装的功能模块的选项;响应于用户对所述从设备上能够安装的功能模块的第四选择操作,确定所述从设备上安装的功能模块。
在分布式app安装过程中,第一设备通过向用户显示从设备上能够安装的功能模块的选项,供用户选择各从设备上安装的功能模块,从而能够满足不同用户的差异性需求,提高用户体验。
在一种可能的设计中,所述分布式安装管理模块将所述分布式应用的功能模块发送给对应的从设备之后,还包括:在所述分布式安装管理模块接收到所有从设备返回的安装完成响应消息时,确认所述分布式应用安装成功;显示第五界面,所述第五界面用于通知所述分布式应用安装完成。
在一种可能的设计中,所述分布式应用还包括任务管理模,所述任务管理模块安装在所述第一设备上,所述方法还包括:所述任务管理模块接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;响应于所述任务状态查询请求,所述任务管理模块向所述分布式安装管理模块查询安装有所述任务处理模块的所述至少一个第二设备的信息;所述任务管理模块根据所述第二设备的信息,向所述分布式调度模块发送第一连接建立请求,所述第一连接建立请求用于请求与第二设备建立连接;所述分布式调度模块向所述第二设备发送第二连接建立请求;所述任务管理模块通过所述连接获取所述第二设备处理的任务的状态;所述任务管理模块显示所述第二设备处理的任务的状态。
通过任务管理模块,能够查询各设备上处理的任务的状态,便于用户了解任务的状态。
在一种可能的设计中,还包括:所述任务管理模块接收用户根据所述第二设备处理的任务的状态输入的任务删除请求;所述任务管理模块通过所述连接向所述第二设备发送所述任务删除请求。
在一种可能的设计中,还包括:所述任务管理模块接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求;所述任务管理模块通过所述连接向所述第二设备发送所述任务暂停请求。
在一种可能的设计中,所述第一设备还包括应用管理模块,所述方法还包括:所述应用管理模块接收用户输入的管理请求;响应于所述管理请求,所述应用管理模块向所述分 布式安装管理模块查询安装所述分布式应用的从设备,从设备上安装的功能模块以及所述第一设备上安装的功能模块;所述应用管理模块显示安装了所述分布式应用的从设备以及所述第一设备上安装的功能模块。
通过应用管理模块实现对分布式应用的功能模块的灵活管理,灵活调整各个设备上的功能模块,例如增加或者删除某个设备的功能模块,具体实现方式参照下述。
在一种可能的设计中,还包括:所述应用管理模块接收用户输入的功能模块增加请求;所述应用管理模块向所述分布式安装管理模块发送所述功能模块增加请求;当所述功能模块增加请求用于增加所述第一设备上的功能模块时,所述分布式安装管理模块根据所述功能模块增加请求在所述第一设备上安装增加的功能模块;当所述功能模块增加请求用于增加从设备上的功能模块时,所述分布式安装管理模块向需要增加功能模块的从设备发送所述功能模块增加请求。
在一种可能的设计中,所述分布式安装管理模块根据所述功能模块增加请求在所述第一设备上安装增加的功能模块之后,还包括:所述分布式安装管理模块更新所述第一设备上安装的功能模块的信息;所述分布式安装管理模块向所述应用管理模块发送功能模块增加响应。
在一种可能的设计中,所述分布式安装管理模块向需要增加功能模块的从设备发送所述功能模块增加请求之后,还包括:所述分布式安装管理模块接收从设备发送的功能模块增加响应;所述分布式安装管理模块根据所述功能模块增加响应更新所述第一设备上安装的功能模块的信息;所述分布式安装管理模块向所述应用管理模块发送所述功能模块增加响应。
在一种可能的设计中,还包括:所述应用管理模块接收用户输入的功能模块删除请求;所述应用管理模块向所述分布式安装管理模块发送所述功能模块删除请求;当所述功能模块删除请求用于删除所述第一设备上的功能模块时,所述分布式安装管理模块根据所述功能模块删除请求在所述第一设备上删除对应的功能模块;当所述功能模块增加请求用于删除从设备上的功能模块时,所述分布式安装管理模块向需要删除功能模块的从设备发送所述功能模块删除请求。
在一种可能的设计中,所述分布式安装管理模块根据所述功能模块删除请求在所述第一设备上删除对应的功能模块之后,还包括:所述分布式安装管理模块更新所述第一设备上安装的功能模块的信息;所述分布式安装管理模块向所述应用管理模块发送功能模块删除响应。
在一种可能的设计中,所述分布式安装管理模块向需要删除功能模块的从设备发送所述功能模块删除请求之后,还包括:所述分布式安装管理模块接收从设备发送的功能模块删除响应;所述分布式安装管理模块根据所述功能模块删除响应更新从设备上安装的功能模块的信息;所述分布式安装管理模块向所述应用管理模块发送所述功能模块删除响应。
在一种可能的设计中,所述任务监听模块还安装在至少一个从设备中,从而使得用户通过从设备也可能触发任务处理,分布式app的使用更加灵活方便。
在一种可能的设计中,所述任务管理模块还安装在至少一个从设备中,从而使得用户通过从设备也可能查询任务状态,分布式app的使用更加灵活方便。
第六方面,本申请实施例提供一种分布式应用的处理方法,所述方法应用于分布式应 用的从设备,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在第一设备上,该多个功能模块中的第二类功能模块安装在从设备上,所述第一设备为下载所述分布式应用的安装文件的设备,所述第一设备和至少一个从设备通过分布式操作系统OS通信。
该方法包括:接收所述第一设备发送的所述分布式应用的至少一个功能模块的安装文件;根据所述至少一个功能模块的安装文件安装对应的功能模块。
主设备通过将分布式应用的部分功能模块发送给从设备,由从设备完成相应功能模块的安装,从而使得主设备与从设备协同实现分布式app的功能。
在一种可能的设计中,所述第一类功能模块和所述第二类功能模块中的部分功能模块相同。
在一种可能的设计中,所述分布式应用包括任务监听模块、分布式安装管理模块、任务处理模块和分布式调度模块,所述从设备上安装有所述任务监听模块,所述分布式安装管理模块和所述分布式调度模块安装在所述第一设备上,所述任务处理模块安装在至少一个第二设备上,所述第二设备为从设备,所述方法还包括:所述任务监听模块监听用户输入的第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;响应于所述第一任务处理请求,所述任务监听模块向所述分布式安装管理模块查询安装有所述任务处理模块的所述至少一个第二设备;所述任务监听模块向所述分布式调度模块发送第二任务处理请求,所述第二任务处理请求中包括对所述第一任务处理的目标设备的信息,所述目标设备为所述至少一个第二设备中任一设备;所述任务监听模块接收所述目标设备对所述第一任务的处理结果。
通过在从设备上安装任务监听模块,使得用户通过从设备也能触发任务处理。
在一种可能的设计中,所述任务监听模块向所述分布式调度模块发送第二任务处理请求之前,还包括:当所述任务监听模块查询到至少两个第二设备安装有所述任务处理模块时,所述任务监听模块显示第一界面,所述第一界面中包括所述至少两个第二设备的选项;所述任务监听模块向所述分布式调度模块发送第二任务处理请求,包括:响应于用户对所述至少两个第二设备的选项的第一选择操作,所述任务监听模块向所述分布式调度模块发送所述第二任务处理请求,所述第一选择操作用于选择所述目标设备。
在一种可能的设计中,所述任务监听模块接收到所述第一任务的处理结果后,显示所述第一任务的处理结果。
在一种可能的设计中,所述分布式应用包括任务管理模块、分布式安装管理模块、任务处理模块和分布式调度模块,所述从设备上安装有所述任务管理模块,所述分布式安装管理模块和所述分布式调度模块安装在所述第一设备上,所述任务处理模块安装在至少一个第二设备上,所述第二设备为从设备,所述方法还包括:所述任务管理模块接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;响应于所述任务状态查询请求,所述任务管理模块向所述分布式安装管理模块查询安装有所述任务处理模块的所至少一个第二设备的信息;所述任务管理模块根据所述第二设备的信息,向所述分布式调度模块发送第一连接建立请求,所述第一连接建立请求用于请求与第二设备建立连接;在所述连接建立之后,所述任务管理模块通过所述连接获取所述第二设备处理的任务的状态,显示所述第二设备处理的任务的状态。
在一种可能的设计中,所述任务管理模块接收用户根据所述第二设备处理的任务的状态输入的任务删除请求;所述任务管理模块通过所述连接向所述第二设备发送所述任务删除请求。
在一种可能的设计中,还包括:所述任务管理模块接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求;所述任务管理模块通过所述连接向所述第二设备发送所述任务暂停请求。
在一种可能的设计中,所述分布式应用包括分布式安装管理模块、任务处理模块和分布式调度模块,所述从设备上安装有所述任务处理模块,所述分布式安装管理模块和所述分布式调度模块安装在所述第一设备上,所述方法还包括:所述任务处理模块接收所述分布式调度模块发送的任务处理命令,所述任务处理命令用于指示对第一任务进行处理;所述任务处理模块根据所述任务处理命令对所述第一任务进行处理;所述任务处理模块向所述分布式调度模块发送所述第一任务的处理结果。
在一种可能的设计中,所述分布式应用包括分布式安装管理模块,所述分布式安装管理模块安装在所述第一设备上,所述方法还包括:接收所述分布式安装管理模块发送的功能模块增加请求;根据所述功能模块增加请求在所述从设备上安装增加的功能模块;向所述分布式安装管理模块发送功能模块增加响应。
在一种可能的设计中,所述分布式应用包括分布式安装管理模块,所述分布式安装管理模块安装在所述第一设备上,所述方法还包括:接收所述分布式安装管理模块发送的功能模块删除请求;根据所述功能模块增加请求在所述从设备上删除对应的功能模块;向所述分布式安装管理模块发送功能模块删除响应。
在一种可能的设计中,所述任务监听模块还安装在所述第一设备上。
在一种可能的设计中,所述任务管理模块还安装在所述第一设备上。
第七方面,本申请实施例提供一种分布式应用的处理装置,包括实现本申请第一方面、第二方面、第三发面和第五方面中任一方面所述方法的功能模块。
第八方面,本申请实施例提供一种分布式应用的处理装置,包括实现本申请第四方面或者第六方面所述方法的功能模块。
第九方面,本申请实施例提供一种电子设备,包括:存储器和处理器,所述存储器用于存储程序指令,所述处理器用于调用所述存储器中的程序指令使得所述电子设备执行本申请第一方面至第六方面中任一方面所述的分布式应用的处理方法。
第十方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时使得所述电子设备实现本申请第一方面至第六方面中任一方面所述的分布式应用的处理方法。
第十一方面,本申请实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现本申请第一方面至第六方面中任一方面所述的分布式应用的处理方法。
本申请提供的分布式应用的处理方法和装置,将分布式app安装在多个电子设备上,由该多个电子设备共同完成分布式app的功能。其中,下载并安装了该分布式app的第一设备能够监听任务处理请求,并根据任务处理请求查找到具有任务处理功能的第二设备,然后请求第二设备对任务进行处理,第二设备对任务进行处理后,向第一设备返回任务处 理结果,从而能够实现分布式任务处理。所述方法,通过分布式app实现分布式功能,提高了分布式功能的可移植性,任何安装了分布式OS的电子设备都能够安装分布式app,以获得分布式app提供的分布式功能,也降低了分布式服务的开发难度和成本。
图1为本申请适用的电子设备的一种结构示意图;
图2为本申请一实施例提供的一种电子设备的软件结构框图;
图3为智能家居场景下分布式app对应的安装网络的示意图;
图4为分布式app的安装过程的一种示意图;
图5为分布式app的安装过程的另一种示意图;
图6为分布式app的安装过程中功能模块选择的一种示意图;
图7为分布式app的安装过程中功能模块选择的另一种示意图;
图8为分布式app的安装过程中功能模块选择的又一种示意图;
图9为分布式app的安装完成的界面示意图;
图10为分布式app执行任务的流程图;
图11为下载选择页面的一种示意图;
图12为下载选择页面的另一种示意图;
图13为下载选择页面的又一种示意图;
图14为下载选择页面的再一种示意图;
图15为下载输入框的示意图;
图16为任务处理设备的选择界面示意图;
图17为分布式app中任务状态的查询流程示意图;
图18为分布式app的应用管理流程图;
图19为进入分布式app的应用管理入口的示意图;
图20为各设备上已安装的分布式app的功能模块的管理页面的示意图;
图21为本申请实施例提供的一种分布式应用的处理装置的结构示意图;
图22为本申请实施例提供的一种分布式应用的处理装置的结构示意图;
图23为本申请实施例提供的电子设备的一种结构示意图。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,单独a,单独b或单独c中的至少一项(个),可以表示:单独a,单独b,单独c,组合a和b,组合a和c,组合b和c,或组合a、b和c,其中a,b,c可以是单个,也可以是多个。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性。术语“中心”、“纵向”、“横向”、“上”、“下”、“左”、“右”、“前”、“后”等指示的方位或位 置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请实施例和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请实施例的限制。
本申请实施例提供一种分布式应用的处理方法,分布式app可以运行在多个安装有分布式OS的电子设备上,分布式app是指功能可以通过多个设备共同实现的app,多个设备之间通过分布式OS进行通信。基于电子设备的软件系统中的应用程序层和应用程序框架层的配置,支持分布式app的安装、运行和管理,通过分布式app实现分布式功能或者分布式服务,提高了分布式功能的可移植性,任何安装了分布式OS的电子设备都能够安装分布式app,以获得分布式app提供的分布式服务,也降低了分布式服务的开发难度和成本。
其中,电子设笔记本电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality设备可以是平板电脑、手机(如折叠屏手机、大屏手机等))设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、智能电视、智慧屏、高清电视、4K电视、智能音箱、智能投影仪等设备,本申请实施例对电子设备的具体类型不作任何限制。
下面以电子设备为平板电脑为例,结合图1,介绍本申请实施例涉及的电子设备。
图1为本申请适用的电子设备的一种结构示意图,如图1所示,该电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。可以理解的是,本实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件,或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,显示处理单元(display process unit,DPU),和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。在一些实施例中,电子设备100也可以包括一个或多个处理器110。其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。这就避免了重复存取,减少了处理器110的等待时间,因而提高了电子设备100系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接 口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。其中,USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以 是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN),蓝牙,全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),NFC,红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括GSM,GPRS,CDMA,WCDMA,TD-SCDMA,LTE,GNSS,WLAN,NFC,FM,和/或IR技术等。上述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等可以实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,一个或多个摄像头193,视频编解码器,GPU,一个或多个显示屏194以及应用处理器等实现拍摄功能。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
DPU也称为显示子系统(Display Sub-System,DSS),DPU用于对显示屏194的色彩进行调整,DPU可以通过三维查找表(3D look up table,3D LUT)对显示屏的色彩进行调整。DPU还可以对画面进行缩放、降噪、对比度增强、背光亮度管理、hdr处理、显示器参数Gamma调整等处理。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐、照片、视频等数据文件保存在外部存储卡中。
内部存储器121可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括 指令。处理器110可以通过运行存储在内部存储器121的上述指令,从而使得电子设备100执行各种功能应用以及数据处理等。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统;该存储程序区还可以存储一个或多个应用程序(比如图库、联系人等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如照片,联系人等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。在一些实施例中,处理器110可以通过运行存储在内部存储器121的指令,和/或存储在设置于处理器110中的存储器的指令,来使得电子设备100执行各种功能应用及数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。其中,音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,还可以是美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
传感器180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
其中,压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景等。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H(也称为指纹识别器),用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。另外,关于指纹传感器的其他记载可以参见名称为“处理通知的方法及电子设备”的国际专利申请PCT/CN2017/082773,其全部内容通过引用结合在本申请中。
触摸传感器180K,也可称触控面板或触敏表面。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称触控屏。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键,也可以是触摸式按键。 电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。其中,本申请实施例对电子设备的操作系统的类型不做限定。例如,Android系统、Linux系统、Windows系统、iOS系统、鸿蒙操作系统(harmony operating system,鸿蒙OS)等。
本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2为本申请一实施例提供的一种电子设备的软件结构框图。如图2所示,分层架构将软件系统分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层(APP framework),安卓运行时(Android runtime)和系统库(libraries),以及内核层(kernel)。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括电子邮件,相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,游戏,聊天,购物,出行,即时通信(如短信息),智能家居,设备控制等应用程序(application,APP)。
其中,智能家居应用可用于对具有联网功能的家居设备进行控制或管理。例如,家居设备可以包括电灯、电视和空调。又如,家居设备还可以包括防盗门锁、音箱、扫地机器人、插座、体脂秤、台灯、空气净化器、电冰箱、洗衣机、热水器、微波炉、电饭锅、窗帘、风扇、电视、机顶盒、门窗等。
通常,应用程序可划分为系统应用和三方应用。其中,系统应用可以理解为非独立且依赖于软件系统的应用程序,如Dock和桌面。三方应用为除了系统应用之外的应用程序,可以包括但不限于设备厂商的自研应用和非设备厂商的应用等,如电子设备应用和计算机应用。为了便于说明,应用程序层以包括分布式APP为例进行示意。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括:分布式软总线,分布式安装管理模块,分布式调度模块和应用管理模块等。为了便于说明,应用程序框架层以包括分布式安装管理模块,分布式调度模块,应用管理模块为例进行示意。其中,分布式软总线,分布式安装管理模块,分布式调度模块和应用管理模块均为软件模块。
分布式软总线,用于将硬件资源融合为硬件池,不仅实现硬件互联,而且让硬件资源 可以相互利用,为其他分布式服务提供基础通信功能。
分布式安装管理模块,用于实现分布式app在多个设备上的安装、管理、卸载以及数据查询等。
分布式调度模块,用于提供跨设备的调度能力,负责安装有该分布式app的多个设备上的应用组件之间可以进行通信,以及该多个设备上的应用组件与OS的通信。
应用管理模块,用于对分布式app在多个设备上安装的功能进行管理,例如,在分布式app安装完成之后,可以查看、删除或者增加某个设备上安装的功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGLES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合利用智能音箱播放声音的场景,示例性说明电子设备100的软件和硬件的工作流程。
当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为智能音箱图标的控件为例,智能音箱应用调用应用框架层的接口,启动智能音箱应用,进而通过调用内核层启动音频驱动,通过扬声器170A将音频电信号转换成声音信号。
可以理解的是,本申请示意的结构并不构成对电子设备100的具体限定。在另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
基于前述描述,分布式app的处理按照时间顺序包括以下四个阶段:app开发、app安装、app运行和app管理。
App开发也称为app打包,设备厂商发布一套分布式OS,支持手机,平板,电视,路由器等多设备互联。同时发布了一套开发者文档,app开发者可以根据开发者文档,开发出可以在该分布式OS上安装的,具有分布式功能的app。
app开发阶段,开发者根据分布式app提供的功能和需求,将该分布式app的安装文件进行模块化,以便在多个设备上安装,多个设备上的模块互相协同完成该app的功能。
分布式app通常情况下包括以下模块:基础模块、任务管理模块、任务监听模块、任务处理模块、资源文件、模块配置文件和其他模块等。
基础模块用于为其他模块提供运行时环境,该模块本身不提供功能。任务管理模块用于向用户提供管理界面,管理界面用于对安装了任务处理模块的设备上的任务进行管理和 监控,例如,通过管理界面向用户显示设备上任务的状态,任务的状态包括:正在处理、处理失败和处理完成等。用户可以对处理失败的任务进行删除,对正在处理的任务进行暂停等操作。
任务监听模块用于监听用户的上下文,提供增加任务处理的用户体验(User Experience,UX)交互。
任务处理模块用于在设备上执行任务的处理功能,完成分布式app的具体任务。以分布式app为分布式下载app为例,则任务处理模块为下载模块,下载模块用于完成分布式app的下载功能。
资源文件用于描述app是否支持分布式功能,后续在安装阶段,下载了该app的设备可以根据该配置文件确定该app是否支持分布式功能,并进行分布式安装,分布式安装是指将该app的功能安装到多个设备上。
模块配置文件用于存储各模块的信息,模块的信息包括模块的功能等。
分布式app开发完成后,用户可以在电子设备上下载分布式app并安装,该电子设备可以为用户设备(user equipment,UE),例如手机、电脑,还可以为蜂窝电话、无绳电话、会话发起协议(session initiation protocol,简称SIP)电话、智能电话、个人数字助理(personal digital assistant,简称PDA)、电脑、膝上型计算机、手持式通信设备、手持式计算设备、卫星无线设备、无线调制解调器卡、电视机顶盒(set top box,简称STB)、车载设备、可穿戴设备(例如智能手表、智能手环、智能眼镜)、智能家居设备、用于在无线系统上进行通信的其它设备等。
以手机为例,向用户提供应用商店或者应用市场,应用商店或者应用市场中提供了多种多样供用户下载的app,例如,各类社交app、新闻app、购物app、游戏app等,用户可以通过应用商店或者应用市场提供的搜索功能,查找要安装的分布式app,点击下载控件进行下载,下载完成之后进一步点击安装控件进行安装。目前为了方便用户操作,通常将下载和安装两个功能合并,应用市场显示给用户的可安装的app图标的下方通常显示有安装控件,用户点击安装控件之后即可完成下载和安装操作。当然,用户也可以通过浏览器搜索到该app的安装文件进行安装。
在app的安装文件下载完成后,电子设备上的分布式安装服务模块解析该app的安装文件,app的安装文件中携带有第一指示信息,该第一指示信息用于指示该app是否支持分布式功能。示例性的,可以在上述的资源文件中携带该第一指示信息,分布式安装服务模块从该资源文件中读取第一指示信息,如果第一指示信息指示app不支持分布式功能,则按照单设备app进行解析安装。如果第一指示信息指示app支持分布式功能,则分布式安装管理模块确定对该分布式app进行分布式安装。
以下将下载分布式app并进行分布式安装的设备称为主设备,将安装了该分布式app的部分模块的其他设备称为从设备。主设备上的分布式安装管理模块用于对主设备上的所有分布式app进行安装,并对已经安装的分布式app进行管理、卸载和数据查询等。在确定app支持分布式功能的情况下,分布式安装管理模块确定哪些设备(从设备)能够安装该分布式app。
分布式安装管理模块可以根据当前网络内连接的设备的信息,确定能够安装该分布式app的从设备,从而组成分布式app的安装网络,安装网络内的设备需要连接到同一个无 线网络内,所以,分布式管理服务先检测与主设备位于同一个无线网络内的设备。
图3为智能家居场景下分布式app对应的安装网络的示意图,如图3所示:分布式安装管理模块检测到当前共有8个设备连接到同一个无线网络内,包括:手机210(主设备)、手机220、平板电脑230、电视240、音箱250、音箱260、路由器270、笔记本电脑280。可以理解,图3只是示例性描述,该无线网络内还可以连接有更多的智能设备,例如,还可以连接有无线充电器、智能台灯、空调等。
图3所示场景中,手机210作为主设备,从除主设备外的剩余7个设备中确定哪些设备能够作为从设备。手机210中的分布式安装管理模块可以根据OS类型和设备的内存大小确定设备是否能够作为从设备。
针对任一设备,分布式管理服务判断该设备的OS类型与主设备的OS类型是否相同,如果该设备的OS类型与主设备的OS类型不同,则确定该设备不能作为从设备,如果该设备的OS类型与主设备的OS类型相同,则判断该设备的内存是否大于预设的内存阈值,如果该设备的内存大于该内存阈值,则确定该设备为从设备,如果该设备的内存小于该内存阈值,则确定该设备不能作为从设备。其中,主设备和从设备的设备类型可以相同,也可以不同,本实施例不对此进行限制,例如,当主设备为手机时,从设备也可以为手机,还可以为平板、电视、音箱或者路由器等。
通过上述方式确定的从设备满足以下条件:与主设备位于同一网络内、与主设备的OS类型相同以及内存大于预设的内存阈值。OS类型可以为
类型、
安卓(Android)系统、
鸿蒙系统等。示例性的,分布式安装管理模块从手机220、平板电脑230、电视240、音箱250、音箱260、路由器270、笔记本电脑280中确定出平板电脑230、电视240、音箱250和路由器270可以作为从设备,手机210、平板电脑230、电视240、音箱250和路由器270共同组成了分布式app的安装网络,安装网络内的所有设备的OS类型相同,例如,手机210、平板电脑230、电视240、音箱250和路由器270都采用安卓系统或者鸿蒙系统。
可选的,分布式安装管理模块还可以根据OS类型和处理器参数确定设备是否能够作为从设备,或者,根据OS类型、内存大小和处理器参数确定设备是否能够作为从设备,本实施例并不对此进行限定。
一种实现方式中,主设备在根据第一指示信息确定对分布式app进行分布式安装后,可以根据上述过程确定安装该分布式app的从设备,在确定安装该分布app的从设备以及各从设备上安装的功能模块后,可以直接进行分布式安装,即分布式安装管理模块将各从设备上需要安装的功能模块的安装文件发送给从设备,各从设备根据接收到的安装文件完成安装。
另一种实现方式中,主设备在根据第一指示信息确定对分布式app进行分布式安装后,显示图4(c)或者图5(d)所示的第二界面,该第二界面中包括分布式安装选项。
参考图4,用户通过“应用商城”安装分布式下载app,用户通过“应用商城”打开图4(b)所示界面,分布式下载app的图标显示在精品应用中,用户点击图4(b)中的安装控件后,页面可以跳转到图4(c)所示的第二界面。可以理解,分布式下载app的图标也可以不显示在图4(b)所示界面中,用户通过图4(b)所示界面中的搜索功能,搜索到分布式下载app,然后进行安装。
参考图5,用户通过“文件管理”安装分布式下载app,用户通过“文件管理”打开图5(b)所示界面,可以理解,从图5(a)到图5(b)界面中还经过了一个或者多个界面,不同终端设备中,从图5(a)到图5(b)界面的具体操作可能不同。在图5(b)所示界面中,安装包选项下包括多个已下载但是未安装的应用程序的安装包,应用程序的安装包可以为
安卓应用程序包(android application package,APK)或者
鸿门系统的应用程序包等。
未安装的应用程序包可以按照下载的先后时间排列在界面中,图中还显示了应用程序的图标、安装包的名称,例如,AAAAAAAA.apk,还显示有应用程序的名称(例如分布式下载)、版本号和安装包大小。用户可以通过点击安装包的名称或者图标触发安装操作,用户触发安装操作后,跳转到图5(c)所示的界面,如果允许“文件管理”安装该应用,则跳转到图5(d)所示的界面。
可选的,在一种可能的实现方式中,用户点击图5(b)所示的安装包的名称或者图标后,也可以直接跳转到图5(d)所示的界面。
参考图4(c)或者图5(d)所示的界面,该第二界面上显示有分布式安装选项,用于供用户选择是否进行分布式安装,分布式安装选项例如为“检测到当前应用具备分布式多设备交互能力,是否在其他设备上配置该应用”,并显示两个选择控件“是”和“否”,如果用户选择“是”则弹出如图6所示的界面。如果用户选择“否”,则按照单设备app进行解析安装,其中,单设备app是指app的所有功能模块安装在一个设备上,单设备app安装过程可以参考已有app的安装过程。
各个设备上安装的功能模块是该分布式安装管理模块根据分布式app划分的功能模块以及安装网络内的各个设备的类型确定的。例如,主设备上必须安装任务管理模块,其他设备上是否安装任务管理模块可以由用户选择。又如,通常情况下手机、平板和电视具有屏幕,通过该屏幕显示管理界面,便于用户对分布式app进行管理,所以任务管理可以安装在具有屏幕的设备上。例如,可以将任务管理模块部署在手机、平板和电视上。电视通常安装在固定位置,不便于和用户进行交互,所以,任务管理模块可以部署在手机和平板上。
对于任务监听模块,主要用于监听用户的操作,通常和任务管理模块的功能绑定在一起,例如,将任务监听模块也部署在手机和平板上。而分布式app提供的任务处理模块可以部署在一些用户不常用的设备或者负载较低的一些设备上,以避免任务处理模块处理任务时占用过多的计算资源和存储资源,对主设备的性能影响过大。例如,当任务处理模块为下载模块时,将下载模块部署在音箱和路由器上,可以避免下载功能占用手机较大的带宽,影响用户对手机的使用。
如图6所示,手机提供了任务管理和任务监听功能,平板和电视都提供了任务管理、任务监听和下载模块功能,音箱提供了下载模块。可以理解,当安装网络内有多个设备时,显示屏幕的一个页面可能无法显示所有设备提供的功能模块,需要通过多屏显示,此时,用户可以通过滑动等操作进行翻页操作,以浏览全部设备提供的功能模块。
一种可选方式中,各设备上安装的功能模块由主设备决定,用户无法调整,图6所示安装配置界面仅供用户了解各设备上安装的功能模块。
另一种可选方式中,各设备上安装的功能模块可以由用户进行调整,用户可以选择每 个设备上需要安装的功能模块,该场景下,一种实现方式中用户在图6所示界面的空白处进行长按操作,则会显示图7(a)所示的第三界面,该第三界面中包括能够安装分布式app的候选设备以及各候选设备上能够安装的功能模块的选项。即用户在图6所示界面的空白处长按之后,在图6所示界面的基础上为每个功能模块增加了选择控件。另一种实现方式中,用户在图4(c)或者图5(d)所示的第二界面中选择“是”控件之后,直接跳转到图7(a)所示的第三界面。
响应于用户对候选设备上能够安装的功能模块的第二选择操作,确定安装分布式app的从设备,以及从设备上安装的功能模块。
选择控件可以采用图7所示的圆形控件,该选择控件在第三界面显示后默认未被选中,如果用户需要在某个设备上安装某个功能,则选中对应的控件,控件被选中后会变亮或者改变颜色,以区别于未选中的控件,例如,该选择控件未被选中时呈白色,在被用户选中之后变为蓝色或者灰色,如图7(b)所示。本实施例不对选择控件的形式进行限定,选择控件还可以采用其他形式的控件。
图7所示界面中,手机提供了任务管理模块和任务监听模块,用户可以选择在手机上将这两个功能模块都安装,平板和电视上都提供了任务管理模块、任务监听模块和下载模块,用户可以选择在平板上安装任务管理模块和任务监听模块,在电视上安装任务监听模块。音箱和路由器(未示出)都提供了下载模块,用户可以选择只在音箱上安装下载模块,或者,只在路由器上安装下载模块。表一为用户最终选择的分布式网络内各个设备上安装的功能模块的示意图。
表一
设备 | 安装的功能模块 |
手机(主设备) | 任务管理模块,任务监听模块 |
平板 | 任务管理模块,任务监听模块 |
电视 | 任务监听模块 |
音箱 | 下载模块 |
路由器 | 下载模块 |
用户选中需要安装的功能模块之后,点击界面底部的“确认”控件,从而完成本次配置。如果用户点击“取消”控件,则取消上述的配置,用户需要重新选择各设备的功能模块。
图7所示界面中用户可以同时选择安装分布式app的从设备和各从设备上安装的功能模块,例如,用户未选择电视上的任何功能模块,则相当于用户未选择电视作为从设备,如果用户选择某个设备上的功能模块,则相当于选择了该设备作为从设备。
可选的,在一种可能的实现方式中,用户确认进行分布式安装之后,显示第四界面,该第四界面中包括能够安装分布式app的候选设备的选项,响应于用户对候选设备的第三选择操作,确定安装分布式应用的从设备,并显示第五界面,该第五界面上显示有从设备上能够安装的功能模块的选项,响应于用户对从设备上能够安装的功能模块的第四选择操作,确定从设备上安装的功能模块。该方式中用户先选择从设备,再选择从设备上安装的功能模块。
示例性的,用户在图4(c)或者图5(d)所示的界面中选择“是”控件之后,直接跳 转到图8(a)所示的第四界面,该第四界面中包括8个候选设备,用户从8个设备中选择图8(b)所示的5个设备:手机1、电视、平板、路由器和音箱2,其中,手机1为主设备(即显示该第四界面的设备)。可选的,也可以不显示主设备,只显示能够作为从设备的候选设备供用户选择。用户点击图8(b)所示的“确认”控件之后,可以跳转到图8(c)所示的第五界面或者图7(a)所示的界面,用户可以进一步选择各设备上安装的功能。
可选的,在一种实现方式中,主设备上安装的功能模块用户无法选择,用户只能选择从设备上安装的功能模块。
在用户确认各从设备上安装的功能之后,主设备根据各从设备需要安装的功能模块,将各从设备上安装的功能模块对应的安装文件(或者称为安装包)发送到对应的从设备,例如,手机将任务管理模块对应的安装文件发送给平板,将任务监听模块对应的安装文件发送给平板和电视,将下载模块对应的安装文件发送给音箱和路由器。各从设备接收到安装文件后,对安装文件进行解析,并安装对应的功能模块。
可以理解,主设备发送给安装同一功能模块的两个从设备的安装文件是相同的,但是由于两个从设备自身的硬件(例如屏幕尺寸)和搭载的操作系统等的差异,导致该相同功能模块在两个从设备上展示给用户的界面可能会存在差异,但是功能不会发生变化。例如,手机发送给平板和电视的任务监听模块对应的安装文件是相同的,但是由于平板和电视自身的硬件和搭载的操作系统的不同,导致任务监听模块最终在电视和平板上展示给用户的界面存在差异,但是任务监听模块在平板和电视上的监听功能相同。
可选的,在各从设备在完成各自安装之后,向主设备返回安装完成响应消息,主设备在接收到所有从设备返回的安装完成响应消息之后,确认分布式app安装完成,则可以弹出图9所示的界面,提示用户分布式app安装完成。分布式app安装完成之后,安装网络内的各个设备开始运行,共同完成分布式app的功能。
图10为分布式app执行任务的流程图,如图10所示,第一设备(即主设备)包括任务监听模块、分布式安装管理模块以及分布式调度模块,其中,任务监听模块属于分布式app的功能模块,分布式安装管理模块和分布式调度模块属于主设备的系统服务。如图10所示,该流程包括以下步骤:
S101、任务监听模块监听第一任务处理请求。
任务监听模块用于向用户提供交互界面,完成设备与用户的交互,用户通过该交互界面输入第一任务处理请求,该第一任务处理请求用于请求对第一任务进行处理。仍以上述分布式下载app为例进行说明,第一任务是下载任务,用户可以通过如下几种方式触发任务下载。
(1)用户使用平板通过浏览器浏览某个网页时,需要下载一个视频,此时用户复制该视频的链接,平板上的监听模块监听到用户的复制操作,则可以弹出如图11所示的下载选择页面。该页面上显示有提示信息和选择控件,该提示信息用于提示用户是否对链接进行下载,该提示信息例如为“检测到当前剪贴板有符合下载规格的链接,是否启动下载?”,该选择控件可以为“是”和“否”。用户可以选择“是”进行下载,选择“否”取消下载。
(2)任务监听模块监听用户对网页内的视频的操作,网页内包括一个或者多个视频, 有些视频可以下载,有些视频不能下载。当监听到用户对某个视频的点击操作时,如果该视频能下载,则弹出如图12所示的下载选择页面,该选择页面用于提示用户该视频能够下载,该提示信息例如为“检测到当前视频可下载,是否启动下载?”。
(3)当用户打开某个网页后,任务监听模块会判断网页内是否有能下载的视频,如果有能下载的视频,则弹出图13所示的提示信息,该提示信息用于提示用户该页面内能够下载的视频的数量以及视频的信息,以便供用户参考。该提示信息例如为:检测到当前页面内有如下X个视频可下载,该页面上还可以显示有每个视频的名称、类型等信息,本实施例不对此进行限制。用户可以根据该提示信息了解到哪些视频能够下载,进一步在网页内打开该视频的链接,并复制该视频的链接到下载app进行下载。
可选的,任务监听模块监听到网页内有能下载的视频后,还可以弹出图14所示的下载选择页面,该下载选择页面除了图13所示提示信息外,在每个视频信息后还显示有选择控件,用户可以通过选择控件选中一个或者多个视频,在选中视频之后用户点击页面中的“是”确认下载,用户选择“否”取消下载。
上述方式(1)和(2)是在用户触发下弹出下载选择页面,方式(3)不需要用户触发,由任务监听模块所在的设备自动弹出下载选择页面。
当用户在网页中选择对某个视频下载之后,一种示例性方式中,需要用户手动将视频的链接(还可以称为地址或者网址)复制并粘贴到下载app的下载页面内,用户先在显示有下载资源的页面内找到待下载视频的地址,对待下载视频的地址进行复制,然后,打开下载app,将待下载视频的地址粘贴到下载页面内。
示例性的,下载页面如图15所示,下载页面中包括下载地址输入框,视频的链接被粘贴到下载地址输入框中,在下载输入框的右侧还设置有“下载”控件,用户点击该“下载”控件之后下载app开始下载视频。当然,“下载”控件的位置和形式不限于图15所示,“下载”控件还可以设置在下载地址输入框的下方。可选的,在下载输入框中还显示有提示信息,提示用户输入下载地址。
又一种示例性方式中,当用户在网页中选择对某个视频下载之后,监听模块自动将视频的链接复制并粘贴到下载app的下载页面内,下载页面参照图15所示,该方式不需要用户手动从网页复制链接到下载app。
用户在分布式app的下载页面上点击“下载”控件后触发任务下载,任务监听模块接收到任务下载请求。
S102、响应于第一任务处理请求任务监听模块向分布式安装管理模块发送第一查询请求,该第一查询请求用于请求安装有任务处理模块的至少一个第二设备。
S103、分布式安装管理模块向任务监听模块发送第一查询请求响应,该第一查询请求响应中包括安装有任务处理模块的至少一个第二设备的信息。
任务监听模块响应于第一任务处理请求,向分布式安装管理模块查询安装有任务处理模块的至少一个第二设备,本实施例中任务监听模块通过S102和S103的步骤获取到安装有任务处理模块的至少一个第二设备的信息。可以理解,在可能的实现方式中,任务监听模块还可以通过更多的步骤才能请求到安装有任务处理模块的至少一个第二设备的信息,本实施例不对此进行限制。
S104、任务监听模块显示第一界面,该第一界面中包括至少两个第二设备的选项。
其中,步骤S104为可选步骤,即任务监听模块接收到安装有任务处理模块的至少一个第二设备后,可以按照预设规则或者随机选择一个第二设备对第一任务进行处理,而不需要显示给用户,由用户选择。
例如,当任务监听模块确定多个设备都安装有任务处理服务时,自动从多个设备中选择一个设备对第一任务进行处理,任务监听模块可以随机从多个设备中选择一个设备对第一任务进行处理,也可以根据多个设备的负载情况,选择一个负载较轻的设备对第一任务进行处理,或者,根据第一任务所需的处理资源大小以及多个设备的性能,选择一个性能匹配的设备对第一任务进行处理,本实施例不对此进行限制。
本实施例中,当任务监听模块查询到至少两个第二设备安装有任务处理模块时,任务监听模块显示第一界面,该第一界面中包括至少两个第二设备的选项,用户从该至少两个第二设备中选择一个设备对第一任务进行处理,响应于用户对至少两个第二设备的选项的第一选择操作,确定对第一任务进行处理的目标设备,第一选择操作用于选择目标设备。
任务监听模块可以通过列表的方式将具有任务处理功能的第二电子设备显示给用户,处理设备列表中包括多个设备,用户可以从多个设备中选择一个目标设备对第一任务进行处理。
示例性的,任务监听模块获取到有两个第二设备上安装有任务处理模块,弹出如图16所示的交互界面,该交互界面上显示有两个第二设备:路由器和音箱,用户可以选择路由器对第一任务进行处理,用户选择路由器之后,可点击“确认”按钮,路由器开始对第一任务进行处理。当任务监听模块查询到只有一个第二设备安装了任务处理模块后,可以不弹出图16所示的交互界面,默认使用该设备进行处理。
通过步骤S102-S104所述方法步骤,第一设备根据第一任务处理请求,从至少一个从设备中确定出对第一任务进行处理的目标设备,可以理解,上述只是举例说明。
S105、任务监听模块向分布式调度模块发送第二任务处理请求,该第二任务处理请求中包括对第一任务处理的目标设备的信息。
第一设备确定出对第一任务进行处理的目标设备后,向目标设备发送任务处理命令,具体可以通过任务监听模块和分布式调度模块向目标设备发送任务处理命令。该目标设备为至少一个第二设备中任一设备,该目标设备可以是用户从多个第二设备中选择的,也可以是任务监听模块自主从多个第二设备中选择的。
S106、分布式调度模块向目标设备发送任务处理命令。
分布式调度模块响应于该第二任务处理请求,向该目标设备发送任务处理命令,该处理命令用于指示目标设备执行第一任务。分布式调度模块接收到第二任务处理请求后,从第二任务处理请求中获取到由目标设备执行第一任务,则向目标设备发送任务处理命令。
S107、目标设备根据任务处理命令执行第一任务。
目标设备中的任务处理模块接收到任务处理命令之后,根据任务处理命令对第一任务进行处理。
S108、目标设备向任务监听模块返回第一任务的处理结果。
目标设备对第一任务进行处理得到处理结果,并向任务监听模块返回处理结果。可选的,任务监听模块将第一任务的处理结果显示给用户。
以第一任务为下载任务为例,第二处理请求中包括下载任务的地址,分布式调度模块 将下载任务的地址携带在下载命令中发送给目标设备,目标设备根据下载命令中的下载任务的地址进行下载,并将下载得到的视频或者其他文件发送给任务监听模块,任务监听模块向用户显示下载到的视频或者其他文件。
本申请提供的分布式应用的处理方法,分布式app安装在多个电子设备上,由该多个电子设备共同完成分布式app的功能。其中,下载并安装了该分布式app的第一设备能够监听任务处理请求,并根据任务处理请求查找到安装有该分布式app的任务处理模块的第二设备,然后请求第二设备对任务进行处理,第二设备对任务进行处理后,向第一设备返回任务处理结果,从而能够实现分布式任务处理。所述方法,通过分布式app实现分布式功能,提高了分布式功能的可移植性,任何安装了分布式OS的电子设备都能够安装分布式app,以获得分布式app提供的分布式功能,也降低了分布式服务的开发难度和成本。
本实施例以主设备(即第一设备)上的任务监听模块监听任务并触发任务执行为例进行说明,可以理解,本实施例的上述流程同样适用于从设备上的任务监听模块,主设备上的任务监听模块和从设备上的任务监听模块的功能相同,二者在任务监听和触发流程上的没有区别,主设备和从设备上的任务监听模块都是需要通过分布式软总线与主设备上的分布式安装管理模块或者分布式调度模块进行通信,对于分布式安装管理模块和分布式调度模块而言,不需要区分任务监听模块属于主设备还是从设备。
图17为分布式app中任务状态的查询流程示意图,本实施例以主设备(即第一设备)上的任务管理模块进行任务状态查询为例进行说明,如图17所示,该查询流程包括以下步骤:
S201、任务管理模块接收用户输入的任务状态查询请求。
该任务状态查询请求用于请求查询分布式app中当前处理的任务的状态,即查询各个安装了任务处理模块的第二电子上的任务的状态。
本实施例中,可以由用户触发任务管理模块发起任务状态查询,例如,手机为主设备,用户通过手机上的分布式app进入查询功能页面,通过查询功能页面发起任务状态查询。第一设备根据任务状态查询请求,从至少一个从设备中确定具有任务处理功能的第二设备,示例性的,通过如下步骤S202所示方法确定具有任务处理功能的第二设备。
S202、响应于任务状态查询请求,任务管理模块向分布式安装管理模块查询安装有任务处理模块的至少一个第二设备的信息。
任务管理模块可以采用图10所示实施例中步骤S102和S103的步骤查询安装有任务处理模块的至少一个第二设备的信息,当然,也可以采用与图10所示实施例中任务监听模块不同的方式查询该第二设备的信息,本实施例不对此进行限制。
S203、任务管理模块向分布式调度模块发送第一连接建立请求,该第一连接建立请求用于请求与第二设备建立连接。
当有多个第二设备都安装有该任务处理模块时,一种实现方式中,任务管理模块向用户显示交互界面,该交互界面中显示有该多个第二设备,用户可以选择对一个或者多个第二设备上的任务的状态进行查询。任务管理模块根据用户的选择,向分布式调度模块发送第一连接建立请求,该第一连接建立请求中包括需要建立连接的第二设备的信息,分布式 调度模块根据该第一连接建立请求,只与第一连接建立请求中包括的第二设备建立连接。
另一种实现方式中,任务管理模块不显示该用户交互界面,默认查询安装有任务处理模块的所有第二设备的任务状态,该第一连接建立请求中可以包括第二设备的信息,也可以不包括第二设备的信息,分布式调度模块接收到该第一连接建立请求后,发现该第一连接建立请求中不包括第二设备的信息,则默认向所有第二设备发送连接建立请求。
S204、分布式调度模块向第二设备发送第二连接建立请求。
第二连接建立请求用于请求与第二设备建立请求。
S205、第二设备向任务管理模块返回连接建立响应。
步骤S205为可选步骤,任务管理模块向分布式调度模块发送第一连接建立请求之后,默认在预设时间之后,与第二设备之间的连接建立。S205中第二设备直接向任务管理模块返回连接建立响应,可以理解,实际情况中,第二设备可以先向分布式调度模块返回第二连接建立响应,分布式调度模块再向任务管理模块返回第一连接建立响应。
S206、任务管理模块通过连接获取第二设备处理的任务的状态。
任务管理模块通过与第二设备之间建立的连接获取第二设备上处理的任务的状态,任务管理模块具体可以通过一条或者多条信息与第二设备交互,获取第二设备上处理的任务的状态。
第一设备从至少一个从设备中确定具有任务处理功能的第二设备后,可以采用步骤S203-S206的方法向第二设备请求第二设备处理的任务的状态,可以理解,这里只是举例说明,并不构成限定。
S207、任务管理模块显示第二设备处理的任务的状态。
任务状态信息例如为处理完成、正在处理、处理失败等,对于正在处理的任务,还可以显示任务的处理进度,例如,任务的处理进度为完成60%,还需要X分钟才能完成。
S208、任务管理模块接收用户根据第二设备处理的任务的状态输入的任务删除/暂停请求。
其中,步骤S208和S209为可选步骤,用户看到第二设备上处理的任务的状态后,也可能不进行任何操作,相应的不会执行步骤S208和S209。
对于处理失败的任务,用户可以选择删除该任务,对于正在处理的任务,用户可以选择暂停或者删除该任务。
S209、任务管理模块通过连接向第二设备发送任务删除/暂停请求。
第二设备根据任务删除请求删除相应的任务,根据任务暂停请求停止执行相应的任务。可选的,第二设备还可以向任务管理模块返回任务删除/暂停响应,任务删除响应用于通知任务删除成功或者删除失败,同样,任务暂停请求用于通知任务暂停成功或者暂停失败,任务管理模块可以根据第二设备返回的任务删除/暂停响应,将处理结果展示给用户。
本实施例以主设备(即第一设备)上的任务管理模块进行任务状态查询为例进行说明,可以理解,还可以通过从设备上的任务管理模块进行任务状态的查询,主设备上的任务管理模块和从设备上的任务管理模块的功能相同,二者在查询流程上没有区别,主设备和从设备上的任务管理模块都是需要通过分布式软总线与主设备上的分布式安装管理模块以及分布式调度模块进行通信,对于分布式安装管理模块以及分布式调度模块而言,不需要区分任务管理模块属于主设备还是从设备。
在分布式app安装完成之后,可以通过主设备上的应用管理模块对各从设备上安装的功能模块进行管理,本申请实施例中,只有主设备具有应用管理功能,主设备上的应用管理模块可以为系统应用。图18为分布式app的应用管理流程图,如图18所示,该应用管理流程包括以下步骤:
S301、应用管理模块接收用户输入的管理请求。
主设备上的应用管理模块可以向用户提供管理入口,用户通过待管理入口输入管理请求,以主设备为手机为例,示例性的,用户通过图19所示的操作流程打开管理入口,如图19所示,用户在手机上点击“设置”APP的图标之后,打开图19(a)所示的设置页面,该设置页面中显示有手机上的一些设置选项,该设置选项包括“WLAN”、“蓝牙”、“移动网络”、“桌面和壁纸”、“显示和亮度”、“声音和振动”、“应用”和“电池”等,用户点击“应用”选项之后,进入图19(b)所示的应用设置页面,该应用设置页面上包括“应用管理”、“应用启动管理”、“权限管理”等设置选项。用户点击“应用管理”选项后进入图19(c)所示的应用管理页面,该应用管理页面中包括设备上已安装的所有应用的入口,用户点击应用之后,对应用进行具体的管理,例如,权限管理、流量使用情况管理、存储管理等。针对分布式app,增加了分布式管理功能,用户通过该分布式管理功能触发管理请求。
S302、响应于该管理请求,应用管理模块向分布式安装管理模块查询安装分布式app的从设备、从设备上安装的功能模块以及第一设备上安装的功能模块。
示例性的,应用管理模块根据该管理请求向分布式安装管理模块发送第四查询请求,该第四查询请求用于请求查询安装有分布式app的各设备,以及各设备上安装的功能模块。分布式安装管理模块向应用管理模块发送第四查询响应,该第四查询响应中包括按照了该分布式app的从设备以及各从设备上安装的功能模块的信息。
其中,第四查询请求中可以包括待查询的分布式app的ID,分布式安装管理模块接收到第四查询请求后,可以根据第四查询请求中包括的分布式app的ID,查询安装有该分布式app的从设备,以及查询主设备以及各从设备上安装的功能。
S303、应用管理模块显示安装了分布式应用的从设备以及第一设备上安装的功能模块。
图20为各设备上已安装的分布式app的功能模块的管理页面的示意图,该管理页面上显示了主设备和从设备上安装的分布式app的功能模块,示例性的,在手机上安装了分布式app的任务管理模块和任务监听模块,平板上安装了分布式app的任务管理模块和任务监听模块,路由器和音箱上安装了分布式app的下载模块。
S304、应用管理模块接收用户输入的功能模块增加/删除请求。
其中,步骤S304为可选步骤,用户在查询到各设备上安装的分布式app的功能模块后,可能不需要调整各设备上安装的功能模块,则结束查询流程,不执行步骤S304。
用户可以对图20(a)所示的各设备上已安装的功能模块进行删除,或者,对各设备上的功能模块进行增加,例如,用户可以选择删除路由器上的下载模块,并选择在平板电脑上增加下载模块。
示例性的,用户可以对图20(a)所示的各设备上已安装的功能模块所在的区域进行长按操作,响应于该长按操作进入图20(b)所示的页面,即在图20(a)所示页面上弹 出对话框,该对话框中显示有提示信息,以提示用户是否卸载设备A上的A1功能,如果用户可以选择“是”,则卸载设备A上的A1功能,如果用户选择“否”则不卸载设备A上的A1功能。
可选的,图20(a)所示的页面上还显示有功能增加控件,可以在每个设备已安装的功能的下方显示有功能增加控件,用户点击功能增加控件之后,弹出对话框或者跳转到另一个页面,该对话框或者跳转后的页面中显示有可供用户增加的所有功能,用户可以选择增加一个或者多个功能。可选的,也可以在整个页面的下方或者其他空白区域显示功能增加控件。
该功能模块增加请求用于增加第一设备或者从设备上的功能模块,该功能模块删除请求用于删除第一设备或者从设备上的功能模块。
S305、应用管理模块向分布式安装管理模块发送功能模块增加/删除请求。
分布式安装管理模块接收到功能模块增加/删除请求之后,如果功能模块增加/删除请求用于在第一设备上增加/删除功能模块,则分布式安装管理模块根据功能模块增加请求在第一设备上安装增加的功能模块,或者,根据功能模块删除请求在第一设备上删除对应的功能模块。模块增加/删除成功之后,分布式安装管理模块更新第一设备上安装的功能模块的信息。可选的,分布式安装管理模块向应用管理模块发送功能模块增加/删除响应,该功能模块增加/删除响应用于通知功能模块增加/删除成功。本实施例中,分布式安装管理模块上记录有各设备上安装的功能模块的信息。
如果第一设备上的模块增加/删除失败,则分布式安装管理模块不更新第一设备上安装的功能模块的信息。可选的,分布式安装管理模块向应用管理模块发送功能模块增加/删除响应,该功能模块增加/删除响应用于通知功能模块增加/删除失败。
如果功能模块增加/删除请求用于在从设备上增加/删除功能模块,则执行步骤S306。
S306、分布式安装管理模块向需要增加/删除功能的从设备发送功能模块增加/删除请求。
该功能模块增加请求中包括需要增加的功能模块的安装文件,该功能删除请求中包括需要删除的功能模块的标识或者需要删除的功能模块的安装地址。
S307、从设备根据功能模块增加/删除请求执行功能模块增加/删除操作。
从设备对功能模块增加请求中包括的需要增加的功能模块的安装文件进行解析,完成功能模块的安装,根据功能模块删除请求中包括的需要删除的功能模块的标识或者需要删除的功能模块的安装地址,删除或者卸载对应的功能模块。
S308、从设备向分布式安装管理模块发送功能模块增加/删除响应。
可选的,从设备增加或者删除对应的功能模块之后,向分布式安装管理模块返回功能模块增加/删除响应,功能模块增加响应用于通知模块增加成功或者失败,功能模块删除响应用于通知模块删除成功或者失败。如果功能模块增加/删除响应指示从设备上的功能模块增加/删除成功,则执行步骤S309,如果功能模块增加/删除响应指示从设备上的功能模块增加/删除失败,则执行步骤S310。
S309、分布式安装管理模块更新从设备上安装的功能模块的信息。
如果功能模块增加/删除响应指示从设备上的功能模块增加/删除成功,则分布式安装管理模块更新从设备上安装的功能模块的信息,并在更新之后,执行步骤S310。
S310、分布式安装管理模块向应用管理模块发送功能模块增加/删除响应。
本实施例的方法,能够根据用户需求对安装了分布式app的各设备上的功能模块进行增加或者删除,实现对分布式app的灵活管理,使得各设备能够更好的完成分布式app的功能。
图21为本申请实施例提供的一种分布式应用的处理装置的结构示意图,本实施例提供的装置300包括:分布式应用31、分布式安装管理模块32和分布式调度模块33,分布式应用31包括多个功能模块,该多个功能模块安装在第一设备以及至少一个从设备中,第一设备和至少一个从设备通过分布式OS通信,第一设备为下载分布式应用31的安装文件的设备,该多个功能模块包括任务监听模块311和任务处理模块312,任务监听模块311安装在所述第一设备中,任务处理模块312安装在至少一个第二设备中,第二设备为从设备。
任务监听模块311用于:监听用户输入的第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;响应于所述第一任务处理请求,向所述分布式安装管理模块32查询安装有所述任务处理模块312的所述至少一个第二设备;向所述分布式调度模块33发送第二任务处理请求,所述第二任务处理请求中包括对所述第一任务处理的目标设备的信息,所述目标设备为所述至少一个第二设备中任一设备;
所述分布式调度模块33,用于响应于所述第二任务处理请求,向所述目标设备发送任务处理命令;
所述任务监听模块311,还用于接收所述目标设备对所述第一任务的处理结果。
在一种可能的设计中,所述任务监听模块311还用于:向所述分布式调度模块33发送第二任务处理请求之前,当查询到至少两个第二设备安装有所述任务处理模块时,显示第一界面,所述第一界面中包括所述至少两个第二设备的选项;响应于用户对所述至少两个第二设备的选项的第一选择操作,向所述分布式调度模块发送所述第二任务处理请求,所述第一选择操作用于选择所述目标设备。
在一种可能的设计中,所述任务监听模块311还用于:接收到所述第一任务的处理结果后,显示所述第一任务的处理结果。
在一种可能的设计中,所述分布式安装管理模块32还用于:确定对所述分布式应用进行分布式安装;确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块;将所述分布式应用的功能模块发送给对应的从设备。
在一种可能的设计中,所述分布式安装管理模块32确定对所述分布式应用进行分布式安装,具体为:检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;根据所述第一指示信息,确定对所述分布式应用进行分布式安装。
在一种可能的设计中,所述分布式安装管理模块32确定对所述分布式应用进行分布式安装,具体为:检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;根据所述第一指示信息显示第二界面,所述第二界面中包括分布式安装选项;响应于用户对所述分布式安装选项的确认操作,确定对所述分布式应用进行分布式安装。
在一种可能的设计中,所述分布式安装管理模块32确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,具体为:显示第三界面,所述第三界面中包括能够安装所述分布式应用的候选设备以及各候选设备上能够安装的功能模块的选项;响应于用户对所述候选设备上能够安装的功能模块的第二选择操作,确定安装所述分布式应用的从设备,以及所述从设备上安装的功能模块。
在另一种可能的设计中,所述分布式安装管理模块32确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,具体为:显示第四界面,所述第四界面中包括能够安装所述分布式应用的候选设备的选项;响应于用户对所述候选设备的第三选择操作,确定安装所述分布式应用的从设备;显示第五界面,所述第五界面上显示有所述从设备上能够安装的功能模块的选项;响应于用户对所述从设备上能够安装的功能模块的第四选择操作,确定所述从设备上安装的功能模块。
在一种可能的设计中,所述分布式安装管理模块32还用于:将所述分布式应用的功能模块发送给对应的从设备之后,接收到所有从设备返回的安装完成响应消息时,确认所述分布式应用安装成功;显示第五界面,所述第五界面用于通知所述分布式应用安装完成。
在一种可能的设计中,所述分布式应用31还包括任务管理模块313,所述任务管理模块安装313在所述第一设备上,所述任务管理模块313用于:接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;响应于所述任务状态查询请求,向所述分布式安装管理模块32查询安装有所述任务处理模块312的所述至少一个第二设备的信息;根据所述第二设备的信息,向所述分布式调度模块33发送第一连接建立请求,所述第一连接建立请求用于请求与第二设备建立连接。所述分布式调度模块33,用于向所述第二设备发送第二连接建立请求;所述任务管理模块313,还用于通过所述连接获取所述第二设备处理的任务的状态,显示所述第二设备处理的任务的状态。
在一种可能的设计中,所述任务管理模块313,还用于接收用户根据所述第二设备处理的任务的状态输入的任务删除请求;通过所述连接向所述第二设备发送所述任务删除请求。
在一种可能的设计中,所述任务管理模块313,还用于接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求;通过所述连接向所述第二设备发送所述任务暂停请求。
在一种可能的设计中,还包括应用管理模块34,用于接收用户输入的管理请求;响应于所述管理请求,向所述分布式安装管理模块32查询安装所述分布式应用的从设备,从设备上安装的功能模块以及所述第一设备上安装的功能模块;显示安装了所述分布式应用的从设备以及所述第一设备上安装的功能模块。
在一种可能的设计中,所述应用管理模块,还用于接收用户输入的功能模块增加请求;向所述分布式安装管理模块32发送所述功能模块增加请求;所述分布式安装管理模块32还用于,当所述功能模块增加请求用于增加所述第一设备上的功能模块时,根据所述功能模块增加请求在所述第一设备上安装增加的功能模块;当所述功能模块增加请求用于增加从设备上的功能模块时,向需要增加功能模块的从设备发送所述功能模块增加请求。
在一种可能的设计中,所述分布式安装管理模块32,还用于根据所述功能模块增加请 求在所述第一设备上安装增加的功能模块之后,更新所述第一设备上安装的功能模块的信息;向所述应用管理模块发送功能模块增加响应。
在一种可能的设计中,所述分布式安装管理模块32,还用于向需要增加功能模块的从设备发送所述功能模块增加请求之后,接收从设备发送的功能模块增加响应;根据所述功能模块增加响应更新所述第一设备上安装的功能模块的信息;向所述应用管理模块34发送所述功能模块增加响应。
在一种可能的设计中,所述应用管理模块34还用于,接收用户输入的功能模块删除请求,向所述分布式安装管理模块发送所述功能模块删除请求;所述分布式安装管理模块32还用于,当所述功能模块删除请求用于删除所述第一设备上的功能模块时,根据所述功能模块删除请求在所述第一设备上删除对应的功能模块;当所述功能模块增加请求用于删除从设备上的功能模块时,向需要删除功能模块的从设备发送所述功能模块删除请求。
在一种可能的设计中,所述分布式安装管理模块32还用于,根据所述功能模块删除请求在所述第一设备上删除对应的功能模块之后,更新所述第一设备上安装的功能模块的信息,向所述应用管理模块34发送功能模块删除响应。
在一种可能的设计中,所述分布式安装管理模块32还用于,向需要删除功能模块的从设备发送所述功能模块删除请求之后,接收从设备发送的功能模块删除响应,根据所述功能模块删除响应更新从设备上安装的功能模块的信息,向所述应用管理模块发送所述功能模块删除响应。
在一种可能的设计中,所述任务监听模块311还安装在至少一个从设备中。
在一种可能的设计中,所述任务管理模块313还安装在至少一个从设备中。
本实施例提供的装置300,可用于执行前文提及的第一设备(或者主设备)执行的方法步骤,其实现原理和技术效果类似,这里不再赘述。
图22为本申请实施例提供的一种分布式应用的处理装置的结构示意图,本实施例提供的装置400包括:
接收模块41,用于接收第一设备发送的分布式应用的至少一个功能模块的安装文件;
安装模块42,用于根据所述至少一个功能模块的安装文件安装对应的功能模块。
在一种可能的设计中,所述分布式应用包括任务监听模块、分布式安装管理模块、任务处理模块和分布式调度模块,所述装置400上安装有所述任务监听模块43,所述分布式安装管理模块和所述分布式调度模块安装在所述第一设备上,所述任务处理模块安装在至少一个第二设备上,所述第二设备为从设备。
所述任务监听模块43用于,监听用户输入的第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;响应于所述第一任务处理请求,向所述分布式安装管理模块查询安装有所述任务处理模块的所述至少一个第二设备;向所述分布式调度模块发送第二任务处理请求,所述第二任务处理请求中包括对所述第一任务处理的目标设备的信息,所述目标设备为所述至少一个第二设备中任一设备;接收所述目标设备对所述第一任务的处理结果。
在一种可能的设计中,所述任务监听模块43还用于,向所述分布式调度模块发送第二任务处理请求之前,当查询到至少两个第二设备安装有所述任务处理模块时,显示第一 界面,所述第一界面中包括所述至少两个第二设备的选项;响应于用户对所述至少两个第二设备的选项的第一选择操作,向所述分布式调度模块发送所述第二任务处理请求,所述第一选择操作用于选择所述目标设备。
在一种可能的设计中,所述任务监听模块43还用于,接收到所述第一任务的处理结果后,显示所述第一任务的处理结果。
在一种可能的设计中,所述分布式应用包括任务管理模块44,所述装置400上安装有所述任务管理模块,所述任务管理模块44用于,接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;响应于所述任务状态查询请求,向所述分布式安装管理模块查询安装有所述任务处理模块的所至少一个第二设备的信息;根据所述第二设备的信息,向所述分布式调度模块发送第一连接建立请求,所述第一连接建立请求用于请求与第二设备建立连接;通过所述连接获取所述第二设备处理的任务的状态,显示所述第二设备处理的任务的状态。
在一种可能的设计中,所述任务管理模块44还用于,接收用户根据所述第二设备处理的任务的状态输入的任务删除请求,通过所述连接向所述第二设备发送所述任务删除请求。
在一种可能的设计中,所述任务管理模块44还用于,接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求,通过所述连接向所述第二设备发送所述任务暂停请求。
在一种可能的设计中,所述装置400上安装有所述任务处理模块45,所述任务处理模块用于,接收所述分布式调度模块发送的任务处理命令,所述任务处理命令用于指示对第一任务进行处理;根据所述任务处理命令对所述第一任务进行处理,向所述分布式调度模块发送所述第一任务的处理结果。
在一种可能的设计中,接收模块41还用于,接收所述分布式安装管理模块发送的功能模块增加请求;所述安装模块42还用于,根据所述功能模块增加请求在所述从设备上安装增加的功能模块,向所述分布式安装管理模块发送功能模块增加响应。
在一种可能的设计中,接收模块41还用于,接收所述分布式安装管理模块发送的功能模块删除请求;所述安装模块42还用于,根据所述功能模块增加请求在所述从设备上删除对应的功能模块,向所述分布式安装管理模块发送功能模块删除响应。
在一种可能的设计中,所述任务监听模块还安装在所述第一设备上。
在一种可能的设计中,所述任务管理模块还安装在所述第一设备上。
本实施例提供的装置400,可用于执行前文提及的第二设备(或者从设备)执行的方法步骤,其实现原理和技术效果类似,这里不再赘述。
示例性地,本申请提供一种电子设备500,包括:处理器51、存储器52和通信接口53;存储器52用于存储程序指令,通信接口53用于和其他设备通信,处理器51用于调用存储器52中的程序指令使得电子设备500执行前文实施例中的分布式应用的处理方法。
示例性地,本申请提供一种芯片系统,芯片系统应用于包括存储器、显示屏和传感器的电子设备;芯片系统包括:处理器;当处理器执行存储器中存储的计算机指令时,电子设备执行前文实施例中的分布式应用的处理方法。
示例性地,本申请提供一种计算机可读存储介质,其上存储有计算机程序,计算机程 序被处理器使得电子设备执行时实现前文实施例中的分布式应用的处理方法。
示例性地,本申请提供一种计算机程序产品,包括:执行指令,执行指令存储在可读存储介质中,电子设备的至少一个处理器可以从可读存储介质读取执行指令,至少一个处理器执行执行指令使得电子设备实现前文实施例中的分布式应用的处理方法。
在上述实施例中,全部或部分功能可以通过软件、硬件、或者软件加硬件的组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
Claims (32)
- 一种分布式应用的处理方法,其特征在于,所述方法应用于第一设备,所述第一设备包括分布式应用,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在所述第一设备上,所述多个功能模块中的第二类功能模块安装在从设备中,所述第一设备和至少一个从设备通过分布式操作系统OS通信,所述第一设备为下载所述分布式应用的安装文件的设备;所述方法包括:监听第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;根据所述第一任务处理请求,从所述至少一个从设备中确定对所述第一任务进行处理的目标设备;向所述目标设备发送任务处理命令;接收所述目标设备对所述第一任务的处理结果。
- 根据权利要求1所述的方法,其特征在于,所述从所述至少一个从设备中确定对所述第一任务进行处理的目标设备,包括:当所述至少一个从设备中有至少两个从设备能够对所述第一任务处理时,显示第一界面,所述第一界面中包括所述至少两个从设备的选项;接收用户对所述至少两个从设备的选项的第一选择操作,确定所述第一选择操作对应的从设备为所述目标设备。
- 根据权利要求1或2所述的方法,其特征在于,还包括:确定对所述分布式应用进行分布式安装;确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块;将所述分布式应用的功能模块对应的安装文件发送给对应的从设备。
- 根据权利要求3所述的方法,其特征在于,所述确定对所述分布式应用进行分布式安装,包括:检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;根据所述第一指示信息,确定对所述分布式应用进行分布式安装。
- 根据权利要求3所述的方法,其特征在于,所述确定对所述分布式应用进行分布式安装,包括:检测到所述分布式应用的安装文件中包括第一指示信息,所述第一指示信息用于指示所述分布式应用支持分布式功能;根据所述第一指示信息显示第二界面,所述第二界面中包括分布式安装选项;接收用户对所述分布式安装选项的确认操作,根据所述确认操作确定对所述分布式应用进行分布式安装。
- 根据权利要求3-5任一项所述的方法,其特征在于,所述确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,包括:显示第三界面,所述第三界面中包括能够安装所述分布式应用的候选设备以及各候选设备上能够安装的功能模块的选项;接收用户对所述候选设备上能够安装的功能模块的第二选择操作,根据所述第二选择 操作确定安装所述分布式应用的从设备,以及所述从设备上安装的功能模块。
- 根据权利要求3-5任一项所述的方法,其特征在于,所述确定安装所述分布式应用的从设备以及从设备上安装的所述分布式应用的功能模块,包括:显示第四界面,所述第四界面中包括能够安装所述分布式应用的候选设备的选项;接收用户对所述候选设备的第三选择操作,根据所述第三选择操作确定安装所述分布式应用的从设备;显示第五界面,所述第五界面上显示有所述从设备上能够安装的功能模块的选项;接收用户对所述从设备上能够安装的功能模块的第四选择操作,根据所述第四操作确定所述从设备上安装的功能模块。
- 根据权利要求3-5任一项所述的方法,其特征在于,所述将所述分布式应用的功能模块对应的安装文件发送给对应的从设备之后,还包括:在接收到所有从设备返回的安装完成响应消息时,确认所述分布式应用安装成功;显示第五界面,所述第五界面用于通知所述分布式应用安装完成。
- 根据权利要求1-8任一项所述的方法,其特征在于,所述方法还包括:接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;根据所述任务状态查询请求,从所述至少一个从设备中确定具有任务处理功能的第二设备;向所述第二设备请求所述第二设备处理的任务的状态;显示所述第二设备处理的任务的状态。
- 根据权利要求9所述的方法,其特征在于,还包括:接收用户根据所述第二设备处理的任务的状态输入的任务删除请求;向所述第二设备发送所述任务删除请求。
- 根据权利要求9所述的方法,其特征在于,还包括:接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求;向所述第二设备发送所述任务暂停请求。
- 根据权利要求1-11任一项所述的方法,其特征在于,所述方法还包括:接收用户输入的管理请求;根据所述管理请求,显示安装了所述分布式应用的从设备以及所述第一设备上安装的功能模块。
- 根据权利要求12所述的方法,其特征在于,还包括:接收用户输入的功能模块增加请求;当所述功能模块增加请求用于增加所述第一设备上的功能模块时,根据所述功能模块增加请求在所述第一设备上安装增加的功能模块;当所述功能模块增加请求用于增加从设备上的功能模块时,向需要增加功能模块的从设备发送所述功能模块增加请求。
- 根据权利要求13所述的方法,其特征在于,所述向需要增加功能模块的从设备发送所述功能模块增加请求之后,还包括:接收从设备发送的功能模块增加响应;根据所述功能模块增加响应更新所述第一设备上存储的所述从设备上安装的功能模块的信息。
- 根据权利要求12所述的方法,其特征在于,还包括:接收用户输入的功能模块删除请求;当所述功能模块删除请求用于删除所述第一设备上的功能模块时,根据所述功能模块删除请求在所述第一设备上删除对应的功能模块;当所述功能模块增加请求用于删除从设备上的功能模块时,向需要删除功能模块的从设备发送所述功能模块删除请求。
- 根据权利要求15所述的方法,其特征在于,所述向需要删除功能模块的从设备发送所述功能模块删除请求之后,还包括:接收从设备发送的功能模块删除响应;根据所述功能模块删除响应更新所述第一设备上存储的所述从设备上安装的功能模块的信息。
- 一种分布式应用的处理方法,其特征在于,所述方法应用于分布式应用的从设备,所述分布式应用包括多个功能模块,所述多个功能模块中的第一类功能模块安装在第一设备中,所述多个功能模块中的第二类功能模块安装在从设备中,所述第一设备为下载所述分布式应用的安装文件的设备,所述第一设备和至少一个从设备通过分布式操作系统OS通信,所述方法包括:接收所述第一设备发送的所述分布式应用的至少一个功能模块的安装文件;根据所述至少一个功能模块的安装文件安装对应的功能模块。
- 根据权利要求17所述的方法,其特征在于,所述方法还包括:监听第一任务处理请求,所述第一任务处理请求用于请求对第一任务进行处理;根据所述第一任务处理请求,确定对所述第一任务进行处理的目标设备;向所述目标设备发送任务处理命令;接收所述目标设备对所述第一任务的处理结果。
- 根据权利要求18所述的方法,其特征在于,所述根据所述第一任务处理请求,确定对所述第一任务进行处理的目标设备,包括:向所述第一设备请求能够对所述第一任务处理的从设备;当有至少两个从设备能够对所述第一任务处理时,显示第一界面,所述第一界面中包括所述至少两个从设备的选项;接收用户对所述至少两个从设备的选项的第一选择操作,确定所述第一选择操作对应的从设备为所述目标设备。
- 根据权利要求17所述的方法,其特征在于,所述方法还包括:接收用户输入的任务状态查询请求,所述任务状态查询请求用于请求查询所述分布式应用中当前处理的任务的状态;根据所述任务状态查询请求,确定具有任务处理功能的第二设备;向所述第二设备请求所述第二设备处理的任务的状态;显示所述第二设备处理的任务的状态。
- 根据权利要求20所述的方法,其特征在于,还包括:接收用户根据所述第二设备处理的任务的状态输入的任务删除请求;向所述第二设备发送所述任务删除请求。
- 根据权利要求20所述的方法,其特征在于,还包括:接收用户根据所述第二设备处理的任务的状态输入的任务暂停请求;向所述第二设备发送所述任务暂停请求。
- 根据权利要求17所述的方法,其特征在于,所述方法还包括:接收所述第一设备发送的任务处理命令,所述任务处理命令用于指示对第一任务进行处理;根据所述任务处理命令对所述第一任务进行处理;向所述第一设备发送所述第一任务的处理结果。
- 根据权利要求17所述的方法,其特征在于,所述方法还包括:接收所述第一设备发送的功能模块增加请求;根据所述功能模块增加请求在所述从设备上安装增加的功能模块;向所述第一设备发送功能模块增加响应。
- 根据权利要求17所述的方法,其特征在于,所述方法还包括:接收所述第一设备发送的功能模块删除请求;根据所述功能模块增加请求在所述从设备上删除对应的功能模块;向所述第一设备发送功能模块删除响应。
- 一种电子设备,其特征在于,包括:存储器和处理器;所述存储器用于存储程序指令;所述处理器用于调用所述存储器中的程序指令使得所述电子设备执行权利要求1-16任一项所述的分布式应用的处理方法。
- 一种电子设备,其特征在于,包括:存储器和处理器;所述存储器用于存储程序指令;所述处理器用于调用所述存储器中的程序指令使得所述电子设备执行权利要求17-25任一项所述的分布式应用的处理方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器使得所述电子设备执行时实现权利要求1-16任一项所述的分布式应用的处理方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器使得所述电子设备执行时实现权利要求17-25任一项所述的分布式应用的处理方法。
- 一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时,实现权利要求1-16任一项所述的分布式应用的处理方法。
- 一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时,实现权利要求17-25任一项所述的分布式应用的处理方法。
- 一种程序产品,其特征在于,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,通信装置的至少一个处理器可以从所述可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序使得通信装置实施如权利要求1-16任意 一项所述的方法或者如权利要求17-25任意一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP22742014.8A EP4261676A4 (en) | 2021-01-22 | 2022-01-05 | METHOD AND DEVICE FOR PROCESSING DISTRIBUTED APPLICATIONS |
US18/224,741 US20230367571A1 (en) | 2021-01-22 | 2023-07-21 | Distributed application processing method and apparatus |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110090270.6 | 2021-01-22 | ||
CN202110090270.6A CN114816442A (zh) | 2021-01-22 | 2021-01-22 | 分布式应用的处理方法和装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/224,741 Continuation US20230367571A1 (en) | 2021-01-22 | 2023-07-21 | Distributed application processing method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022156535A1 true WO2022156535A1 (zh) | 2022-07-28 |
Family
ID=82523880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/070318 WO2022156535A1 (zh) | 2021-01-22 | 2022-01-05 | 分布式应用的处理方法和装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20230367571A1 (zh) |
EP (1) | EP4261676A4 (zh) |
CN (1) | CN114816442A (zh) |
WO (1) | WO2022156535A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116113071A (zh) * | 2023-04-13 | 2023-05-12 | 深圳开鸿数字产业发展有限公司 | 数据传输方法、主终端设备及存储介质 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11975263B2 (en) * | 2021-11-19 | 2024-05-07 | Dell Products, L.P. | Image stabilization system and method |
CN115798126A (zh) * | 2022-10-17 | 2023-03-14 | 深圳开鸿数字产业发展有限公司 | 分布式安全防盗系统、通信方法及存储介质 |
CN116743761B (zh) * | 2022-10-26 | 2024-04-16 | 荣耀终端有限公司 | 一种协同工作的方法及电子设备 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090222504A1 (en) * | 2008-02-28 | 2009-09-03 | Oracle International Corporation | Distributed cross-application server deployment |
CN105446760A (zh) * | 2014-08-29 | 2016-03-30 | 国际商业机器公司 | 用于应用安装的方法和装置 |
US20160274999A1 (en) * | 2014-05-20 | 2016-09-22 | Samsung Electronics Co., Ltd. | Distributed test and profiler framework |
CN106886434A (zh) * | 2016-12-28 | 2017-06-23 | 山西柯睿森信息技术有限公司 | 一种分布式应用安装方法与装置 |
CN110825532A (zh) * | 2018-08-08 | 2020-02-21 | 深圳市优必选科技有限公司 | 分布式任务处理方法、装置、系统、机器人和存储介质 |
CN112241316A (zh) * | 2020-09-18 | 2021-01-19 | 武汉迎风聚智科技有限公司 | 一种分布式调度应用的方法以及装置 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9386075B2 (en) * | 2009-12-08 | 2016-07-05 | At&T Intellectual Property I, L.P. | Flexible download destination |
EP2720146A1 (en) * | 2012-10-11 | 2014-04-16 | Thomson Licensing | Distributed application life-cycle management |
CN105991737A (zh) * | 2015-02-26 | 2016-10-05 | 阿里巴巴集团控股有限公司 | 分布式任务调度方法及系统 |
CN112181616B (zh) * | 2020-07-24 | 2021-11-19 | 华为技术有限公司 | 任务处理方法及相关装置 |
-
2021
- 2021-01-22 CN CN202110090270.6A patent/CN114816442A/zh active Pending
-
2022
- 2022-01-05 WO PCT/CN2022/070318 patent/WO2022156535A1/zh unknown
- 2022-01-05 EP EP22742014.8A patent/EP4261676A4/en active Pending
-
2023
- 2023-07-21 US US18/224,741 patent/US20230367571A1/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090222504A1 (en) * | 2008-02-28 | 2009-09-03 | Oracle International Corporation | Distributed cross-application server deployment |
US20160274999A1 (en) * | 2014-05-20 | 2016-09-22 | Samsung Electronics Co., Ltd. | Distributed test and profiler framework |
CN105446760A (zh) * | 2014-08-29 | 2016-03-30 | 国际商业机器公司 | 用于应用安装的方法和装置 |
CN106886434A (zh) * | 2016-12-28 | 2017-06-23 | 山西柯睿森信息技术有限公司 | 一种分布式应用安装方法与装置 |
CN110825532A (zh) * | 2018-08-08 | 2020-02-21 | 深圳市优必选科技有限公司 | 分布式任务处理方法、装置、系统、机器人和存储介质 |
CN112241316A (zh) * | 2020-09-18 | 2021-01-19 | 武汉迎风聚智科技有限公司 | 一种分布式调度应用的方法以及装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP4261676A4 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116113071A (zh) * | 2023-04-13 | 2023-05-12 | 深圳开鸿数字产业发展有限公司 | 数据传输方法、主终端设备及存储介质 |
CN116113071B (zh) * | 2023-04-13 | 2023-06-27 | 深圳开鸿数字产业发展有限公司 | 数据传输方法、主终端设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
US20230367571A1 (en) | 2023-11-16 |
EP4261676A4 (en) | 2024-01-17 |
EP4261676A1 (en) | 2023-10-18 |
CN114816442A (zh) | 2022-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110471639B (zh) | 显示方法及相关装置 | |
WO2020177622A1 (zh) | Ui组件显示的方法及电子设备 | |
WO2020155014A1 (zh) | 智能家居设备分享系统、方法及电子设备 | |
WO2022156535A1 (zh) | 分布式应用的处理方法和装置 | |
WO2022068483A1 (zh) | 应用启动方法、装置和电子设备 | |
WO2022017393A1 (zh) | 显示交互系统、显示方法及设备 | |
CN114461239B (zh) | 软件升级系统和软件升级方法 | |
WO2021036770A1 (zh) | 一种分屏处理方法及终端设备 | |
WO2021253975A1 (zh) | 应用程序的权限管理方法、装置和电子设备 | |
WO2021052204A1 (zh) | 基于通讯录的设备发现方法、音视频通信方法及电子设备 | |
WO2021078032A1 (zh) | 用户界面的显示方法及电子设备 | |
WO2022127661A1 (zh) | 应用共享方法、电子设备和存储介质 | |
US12032938B2 (en) | Plug-in installation method, apparatus, and storage medium | |
WO2020224447A1 (zh) | 一种在联系人中添加智能家居设备的方法及系统 | |
CN114124980A (zh) | 一种启动应用的方法、装置及系统 | |
WO2022052962A1 (zh) | 应用模块启动方法和电子设备 | |
WO2022161024A1 (zh) | 升级提示方法、终端设备及计算机可读存储介质 | |
WO2022111529A1 (zh) | 一种应用程序的调试方法及电子设备 | |
WO2022228180A1 (zh) | 一种应用的管理方法和电子设备 | |
WO2022062902A1 (zh) | 一种文件传输方法和电子设备 | |
CN113950045A (zh) | 签约数据的下载方法和电子设备 | |
CN114168115B (zh) | 通信系统、应用下载方法及设备 | |
WO2022222733A1 (zh) | 数据传输方法及相关设备 | |
WO2023071590A1 (zh) | 输入控制方法及电子设备 | |
WO2023045876A1 (zh) | 应用程序安装方法及相关设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22742014 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2022742014 Country of ref document: EP Effective date: 20230714 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |