Cross-device data processing method and electronic device
By identifying P2P conflicts during cross-device call and re-organizing the network, the problem of data transmission failure between electronic devices is solved, and the successful transmission of data is achieved.
Patent Information
- Application Number
- CN202311868664.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
During cross-device call, data transmission between electronic devices is prone to failure due to P2P conflicts, resulting in data being unable to be successfully returned.
When P2P conflict is identified, the electronic device preempts the network and re-organizes the network to establish a P2P connection to achieve communication with the target device.
It effectively resolves the problem of data transmission failure caused by P2P conflicts, ensuring that data can be successfully transmitted to the target device.
Smart Images

Figure CN120281820A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electronic devices, and in particular, to a cross-device data processing method and an electronic device. Background Art
[0002] Currently, since different types of electronic devices have different functions, users will use more convenient electronic devices according to different scenarios, and the scenario of cross-device calling is becoming more and more common. For example, a tablet (PAD) calls the camera function of a mobile phone, and mobile phone 1 calls the camera function of mobile phone 2, etc.
[0003] During the process of cross-device calling, there is usually data transmission between various electronic devices. There will be a failure in cross-device calling during the process of cross-device calling. Summary of the Invention
[0004] The embodiments of this application provide a cross-device data processing method and an electronic device, which can realize data transmission for cross-device calling.
[0005] To achieve the above object, the embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, a cross-device data processing method is provided. This method can be applied to an electronic device. The method includes: The first electronic device executes a target service in response to receiving a call request from the second electronic device. When the first electronic device executes the target service to obtain corresponding target data, it sends a connection request to the second electronic device; the connection request is used to request to establish a first communication connection between the first electronic device and the second electronic device. During the process of establishing the first communication connection between the first electronic device and the second electronic device, the first electronic device executes re-networking in response to a connection failure signal to complete the first communication connection between the first electronic device and the second electronic device; the connection failure signal is used to indicate that there is a preset conflict in the first communication connection. After the first communication connection is established between the first electronic device and the second electronic device, the first electronic device returns the target data to the second electronic device based on the first communication connection.
[0007] By adopting the above technical solution, if there is a P2P conflict during the process of establishing a P2P connection between the first electronic device and the second electronic device, the first electronic device can preempt the network, re-network, and establish a P2P connection with the second electronic device to realize communication with the second electronic device.
[0008] In a possible implementation, after the first electronic device executes a target service to obtain corresponding target data, it further includes: The first electronic device sends a first acquisition request to the second electronic device, for requesting to obtain a first file handle object of a preset file of the second electronic device. The first file handle object is used by the second electronic device to create a first distributed file, and the preset file is used to store the target data. The first distributed file and a second distributed file in the first electronic device are used to support data access between the first electronic device and the second electronic device, and the first file handle object is used by the second electronic device to return the target data in the first distributed file to the preset file. The first electronic device receives the file name of the first distributed file sent by the second electronic device.
[0009] In a possible implementation, sending a connection request to the second electronic device includes: The first electronic device sends a connection request to the second electronic device based on the file name.
[0010] In a possible implementation, performing re-networking includes: The first electronic device sends a second acquisition request to the second electronic device, for requesting to re-obtain the first file handle object of the preset file of the second electronic device. The first electronic device receives the file name of the first distributed file sent by the second electronic device. The first electronic device performs re-networking based on the file name.
[0011] In a possible implementation, before the first electronic device receives the file name of the first distributed file sent by the second electronic device, it further includes: The first electronic device deletes the file name of the first distributed file.
[0012] In a possible implementation, the first electronic device returns the target data to the second electronic device based on a first communication connection, including: The first electronic device opens the corresponding second distributed file based on the file name of the first distributed file, and the second distributed file is used to obtain the target data. The second distributed file of the first electronic device transfers the target data to the first distributed file of the second electronic device, so that the second electronic device returns the target data in the first distributed file to the preset file through the first file handle object.
[0013] In a possible implementation, performing re-networking includes: When the first electronic device establishes a second communication connection with a third electronic device, the first electronic device disconnects the second communication connection and establishes a first communication connection with the second electronic device.
[0014] In a possible implementation, in response to a connection failure signal, the first electronic device performs re-networking, including: in response to the connection failure signal, the first electronic device displays a prompt message for prompting the user that there is a transmission problem with the target data. In response to the user's operation on the confirmation control in the prompt message, the first electronic device performs re-networking. Thus, the electronic device can determine whether to preempt the network in response to the user's selection. In this way, if the user is not willing to interrupt the previously existing service, the first electronic device stops transmitting data to the second electronic device.
[0015] In a possible implementation, before sending a connection request to the second electronic device, it further includes: the service collaboration module of the first electronic device receives the file name of the distributed file sent by the second electronic device.
[0016] In a possible implementation, sending a connection request to the second electronic device includes: the service collaboration module sends an opening instruction to the distributed file module of the first electronic device based on the file name, and the opening instruction is used to open the second distributed file corresponding to the file name. In response to the opening instruction, the distributed file module sends a connection request to the second electronic device.
[0017] In a possible implementation, in response to a connection failure signal, the first electronic device performs re-networking, including: the distributed file module receives the connection failure signal sent by the second electronic device, and based on the connection failure signal, sends an opening failure message to the service collaboration module. The opening failure message is used to indicate that the distributed file module fails to open the second distributed file. Based on the received opening failure message, the distributed file module sends an exception message to the distributed application framework of the first electronic device. The exception message is used to indicate that the first electronic device has an exception in obtaining the first file handle object. The distributed application framework performs re-networking based on the exception message. Among them, the service collaboration module of the first electronic device can save the name of the previously received distributed file. When receiving a preemption instruction, it can directly perform re-networking based on the saved name of the distributed file without obtaining the name of the distributed file of the second electronic device again.
[0018] In a possible implementation, displaying the prompt message includes: the distributed application framework of the first electronic device sends a display request to the display interface of the first electronic device based on the exception message, for requesting the display interface to display the prompt message. The display interface displays the prompt message in response to the display request.
[0019] In a possible implementation, when the first electronic device responds to the user's operation on the confirmation control in the prompt message, the first electronic device performs re-networking, including: the display interface responds to the user's operation on the confirmation control in the display request, and sends a networking request to the distributed application framework, where the networking request is used to perform re-networking. The distributed application framework receives the networking request and sends the networking request to the service collaboration module. The service collaboration module receives the networking request and sends the networking request to the distributed file module. The distributed file module performs re-networking with the second electronic device based on the networking request.
[0020] In a second aspect, the present application provides an electronic device, which includes: a communication module, a display screen, a memory, and one or more processors; the communication module, the display screen, the memory, and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device executes the method described in any one of the above first aspects.
[0021] In a third aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When it runs on a computer, the computer can execute the method described in any one of the above first aspects.
[0022] In a fourth aspect, the present application provides a computer program product containing instructions. When it runs on a computer, the computer can execute the method described in any one of the above first aspects.
[0023] It can be understood that the electronic device described in the second aspect above, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 FIG. is a schematic diagram of a cross-device call scenario provided by an embodiment of the present application;
[0025] Figure 2 FIG. is a schematic diagram of a P2P conflict scenario provided by an embodiment of the present application;
[0026] Figure 3 FIG. is another schematic diagram of a P2P conflict scenario provided by an embodiment of the present application;
[0027] Figure 4 FIG. is a schematic diagram of the system architecture of an electronic device provided by an embodiment of the present application;
[0028] Figure 5A timing diagram of a mobile phone registration service and a tablet acquisition service provided by an embodiment of the present application;
[0029] Figure 6 A display schematic diagram of a call entry provided by an embodiment of the present application;
[0030] Figure 7 A schematic diagram of photo confirmation provided by an embodiment of the present application;
[0031] Figure 8 A timing diagram of a camera application obtaining a File Provider object and obtaining a file handle provided by an embodiment of the present application;
[0032] Figure 9 A timing diagram of a camera application obtaining a file handle provided by an embodiment of the present application;
[0033] Figure 10 A schematic diagram of a pop-up box provided by an embodiment of the present application;
[0034] Figure 11 A timing diagram of re-networking provided by an embodiment of the present application;
[0035] Figure 12 Another timing diagram of re-networking provided by an embodiment of the present application;
[0036] Figure 13 Another schematic diagram of re-networking provided by an embodiment of the present application;
[0037] Figure 14 A schematic diagram of a cross-device data processing method provided by an embodiment of the present application;
[0038] Figure 15 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
[0039] Figure 16 A schematic diagram of the structure of a chip system provided by an embodiment of the present application. Detailed implementation manners
[0040] Next, the technical solutions in the embodiments of the present application will be described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0041] The following terms, such as "first", "second", etc., are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of this embodiment, unless otherwise specified, the meaning of "a plurality" is two or more. In this application, the character " / " generally indicates an "or" relationship between the associated objects before and after. For example, A / B can be understood as A or B.
[0042] In addition, the terms "comprising" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally further include other unlisted steps or modules, or may optionally further include other steps or modules inherent to these processes, methods, products, or devices.
[0043] In addition, in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present concepts in a specific manner.
[0044] During the process of cross-device invocation, there is usually data transmission between various electronic devices. There may be a situation where cross-device invocation fails during the process of cross-terminal device invocation.
[0045] Among them, the scenario of cross-device invocation can be the scenario where a second electronic device invokes a first electronic device. Taking the first electronic device as a mobile phone and the second electronic device as a tablet or a personal computer (PC) as an example. Please refer to Figure 1 , such as Figure 1 In the schematic diagram of the cross-device invocation scenario shown, the tablet or PC can send an invocation instruction to the mobile phone in response to a user's operation. Among them, the invocation instruction can include a shooting instruction or a scanning instruction. After receiving the shooting instruction, the mobile phone invokes the camera in the mobile phone to execute the shooting task. After the shooting by the camera is completed, the mobile phone directly transmits the shooting result (photo) to the tablet or PC. Or, after receiving the scanning instruction, the mobile phone invokes the camera in the mobile phone to execute the scanning task. After the scanning by the camera is completed, the mobile phone directly transmits the scanning result (extracted text) to the tablet or PC.
[0046] During the process of the above-mentioned mobile phone transmitting the shooting result to the tablet or PC, or during the process of the mobile phone transmitting the scanning result to the tablet or PC, it is possible that the tablet or PC fails to call the camera function in the mobile phone. In this case, the shooting result or scanning result in the mobile phone cannot be transmitted to the tablet or PC.
[0047] The above transmission error may be caused by a peer-to-peer (P2P) conflict.
[0048] Among them, P2P is a technology that allows direct connection between devices. Devices can communicate one-to-one or one-to-many without relying on a local area network or an access point (AP). The P2P architecture includes a group owner (GO) and group clients (GC). Devices that support the P2P function can be called GO or GC. In a P2P group, there is only one GO. The GO has the same function as an AP, and other GCs can connect to the GO and then communicate. During the group formation process, it is used to negotiate which of the two P2P devices will be called GO and which will be called GC, and form a new group.
[0049] Among them, a P2P conflict means that if the first P2P device is negotiated as GO in the first P2P group, when the second P2P group is being formed, the first P2P device is to be called GC; or, if the first P2P device is negotiated as GC in the first P2P group, when the second P2P group is being formed, the first P2P device is to be called GO. At this time, the formation of the second P2P group fails, which will also cause the first P2P device to be unable to communicate with other P2P devices in the second P2P group.
[0050] In the above cross-device call scenario, take the first P2P device as the PC, the second P2P device as mobile phone 1, and the third P2P device as mobile phone 2 as an example. Please refer to Figure 2 , such as Figure 2In the schematic diagram of the P2P conflict scenario shown, it is assumed that a P2P connection 1 has been established between mobile phone 1 and mobile phone 2, and in the P2P group 1 formed after this P2P connection, after negotiation between mobile phone 1 and mobile phone 2, it is determined that mobile phone 1 is G0 and mobile phone 2 is GC. Subsequently, the PC calls the camera shooting function of mobile phone 1. During the process of mobile phone 1 transmitting photos back to the PC, the PC and mobile phone 1 need to establish a P2P connection 2 to form a P2P group 2. Since the PC can only act as GO in the P2P group, then, in the P2P group 2, mobile phone 1 can only be GC. At this time, however, mobile phone 1 has already been G0 in the P2P group 1. Then, there will be a conflict between the role of mobile phone 1 in the P2P group 1 (G0) and the role of mobile phone 1 in the P2P group 2 (GC). Thus, mobile phone 1 cannot establish a P2P connection with the PC, so mobile phone 1 cannot transmit the photos back to the PC, which leads to the failure of the PC to call mobile phone 1 across devices.
[0051] Alternatively, in the above scenario of cross-device calling, taking the first P2P device as a tablet, the second P2P device as mobile phone 1, and the third P2P device as the PC as an example. Please refer to Figure 3 , as Figure 3 In the schematic diagram of the P2P conflict scenario shown, it is assumed that a P2P connection 3 has been established between mobile phone 1 and the PC. In the P2P group 3 formed after this P2P connection, since the PC can only act as GO, then mobile phone 1 can only be GC. Subsequently, the tablet calls the camera shooting function of mobile phone 1. During the process of mobile phone 1 transmitting photos back to the tablet, mobile phone 1 and the tablet need to establish a P2P connection 4 to form a P2P group 4. During the formation of the P2P group 4, if mobile phone 1 negotiates to be GO and the tablet negotiates to be GC. At this time, however, mobile phone 1 has already been GC in the P2P group 3. Then, there will be a conflict between the role of mobile phone 1 in the P2P group 3 (GC) and the role of mobile phone 1 in the P2P group 4 (GO). Thus, mobile phone 1 cannot establish a P2P connection with the tablet, so mobile phone 1 cannot transmit the photos back to the tablet, which leads to the failure of the tablet to call mobile phone 1 across devices.
[0052] In summary, the embodiment of the present application provides a cross-device data processing method, which can be applied to electronic devices. The electronic devices in the embodiment of the present application can be devices such as mobile phones, tablet computers, personal computers, and laptop computers. In this cross-device data processing method, if a P2P conflict occurs during the process of establishing a P2P connection between the first electronic device and the second electronic device, the first electronic device can preempt the network, reorganize the network, establish a P2P connection with the second electronic device, and achieve communication with the second electronic device.
[0053] The present application mainly takes the calling between Android devices as an example for illustration, but is not limited to the calling between Android devices.
[0054] See also Figure 4 , Figure 4 A schematic diagram of a system architecture of an electronic device is shown. The system architecture of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes a system with a layered architecture as an example to exemplify the software structure of the electronic device.
[0055] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into five layers, from top to bottom: application layer, system application framework layer, collaborative service and scheduling layer, communication module and device profile layer, and kernel layer.
[0056] The application layer may include a series of application packages. Figure 4 As shown, the application package may include: notes, camera, mail, schedule. The application package may also include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0057] like Figure 4 As shown, the system application framework layer may include an activity management service (ActivityManagerService, AMS), a distributed activity management service (DistributedActivityManagerService, DAMS), a package management service (PackageManagerService, PMS), a distributed package management service (DistributedPackageManagerService, DPMS), a service management module (Service Manager, SM), a distributed service management module (Service Manager, DSM), and a system Binder framework. Among them, AMS, PMS and SM are existing system services in the Android system, and the related functions are not specifically introduced here. Among them, DAMS, DPMS and DSM are system functions newly added in the distributed system of the embodiment of the present application, and together they are a distributed application framework for processing service calls between distributed applications in the present application.
[0058] The distributed application framework may provide a distributed application management service for registering in the distributed service management module to implement service calls and management between distributed applications.
[0059] like Figure 4As shown in the figure, the collaborative service and scheduling layer is used to provide the management capabilities of remote services, including remote service registration and remote service acquisition. It is responsible for forwarding service calls between devices, converting local resource references (such as anonymous Binder objects, file descriptors, etc.) into resource references between devices. Among them, the collaborative service and scheduling layer may include a distributed service management module, a distributed Binder management module, a distributed file management module, a transmission management module, and a device management module.
[0060] Among them, the distributed service management module includes a service registration module, a service management module, a service acquisition module, and a service lifecycle module. The service management module is used to manage multiple remote devices in the presence of multiple remote devices.
[0061] The service registration module is used to register the target service by the service registration module of device 2 before device 1 calls the target service of device 2.
[0062] The service acquisition module is used to acquire the target service of device 2 by the service acquisition module of device 1 when the target service of device 2 is completely registered in the scenario where device 1 calls the target service of device 2.
[0063] The service lifecycle module is used to, if device 1 can call the services provided in device A and device B, where there may be two services on device A and two services on device B, when a certain service on device A or device B is abnormal or disappears, that is, after the service exits, some processing needs to be done on the exited service in the service lifecycle module of device 1. Among them, the lifecycle can be understood as a process of creation and closing.
[0064] Among them, the services listed in the distributed service management module are all services with known names, all of which are system services, that is, all are real-name services, and the corresponding Binder objects are all real-name Binders. When the server registers the provided service, it will register the service in the distributed service management module.
[0065] Among them, the distributed Binder management module includes a Binder management mapping module, a Binder access authentication module, and a Binder lifecycle module.
[0066] The Binders in the distributed Binder management module are all anonymous Binders except for the real-name Binders. Therefore, the scope is wider than that of the Binders in the distributed service management module. Among them, an anonymous Binder refers to a Binder that is not registered in the distributed service management module and is created by the application itself.
[0067] The Binder management mapping module is used to manage Binder objects and is involved in the mapping between local Binders and remote Binders.
[0068] The Binder access authentication module is used to manage the ability of distributed Binder access authentication in cross-device or distributed scenarios.
[0069] The distributed file management module is responsible for reading and writing files across devices. The distributed file management module manages distributed files, mainly creating files, opening files, etc. These operations involve the transmission of messages between devices and will perform serialization and deserialization.
[0070] The distributed file management module mainly refers to scenarios such as taking pictures. For example, when a PC wants to call the camera function of a mobile phone, the actual photo cache file is created by the PC. After the mobile phone takes a photo, it needs to obtain the file handle of the photo cache file on the PC side. After obtaining the file handle, it needs to perform a write operation to this photo cache file. That is, cross-device reading and writing are involved here. The distributed file management module can provide cross-device file access.
[0071] Among them, the file handle is a relatively complex object, similar to a Binder object.
[0072] The transmission management module refers to the channels (sessions) created between devices, and messages are transmitted through the channels.
[0073] The device management module refers to the connected devices. Devices may have operations such as going online or offline. Going offline means that the device has been connected and then goes offline, that is, it is no longer connected. Then, all resources related to this device need to be cleaned up or other operations need to be performed. Among them, one or more devices may be connected.
[0074] As Figure 4 shown, the communication module and the device Profile (Device Profile) layer include the communication module, the device Profile module, and the distributed file module.
[0075] Among them, the communication module is the module responsible for transmission, including device discovery connection services and data transmission services, etc. It provides cross-device transmission interfaces and supports automatic networking within the trust ring, one-to-many connections, and waking up sleeping devices. In the scenario of cross-device calls, information is transmitted between devices through the communication module.
[0076] The device Profile module is used to provide device information, provide service registration interfaces supported by the device, and other interfaces for device query services.
[0077] The distributed file module, namely the distributed file management mentioned above, is responsible for reading and writing files across devices.
[0078] The kernel layer includes the Binder driver module, which is mainly used for communication across devices.
[0079] First, taking the first electronic device as the server and the second electronic device as the client as an example, the following details the specific steps for the second electronic device to call the first electronic device. Here, the server is the end that provides the service, and the client is the end that wants to use the service provided by the server. The second electronic device can call the service of the first electronic device. Among them, the second electronic device can be a PC, a tablet, a mobile phone, etc., and the first electronic device can be a tablet, a mobile phone, etc.
[0080] In the scenario where the second electronic device calls the target service of the first electronic device, first the first electronic device needs to register the target service in its own device, and then the second electronic device goes to obtain the target service registered by the first electronic device. After the second electronic device successfully obtains the target service of the second electronic device, the second electronic device can call the service interface of the first electronic device.
[0081] Taking the second electronic device as a tablet, the first electronic device as a mobile phone, and the note application on the tablet calling the camera application on the mobile phone as an example for illustration. In the scenario where the note application on the tablet calls the camera application on the mobile phone for the taking photo service, first the mobile phone needs to register the distributed application management service in itself, and then the tablet goes to obtain the distributed application management service registered by the mobile phone. After the tablet successfully obtains the distributed application management service of the mobile phone, the note application on the tablet launches the camera application on the mobile phone. After the camera application takes a photo of the specified content, the mobile phone will transmit the obtained photo data back to the note application on the tablet.
[0082] Thus, the overall process of the above cross-device call can include two parts: the mobile phone registering the service and the tablet obtaining the service registered by the mobile phone, and the service data (photo data) of the mobile phone being transmitted back to the tablet. The P2P conflict in the embodiment of this application occurs during the process of the service data of the mobile phone being transmitted back to the tablet.
[0083] Please refer to Figure 5 , Figure 5 for the timing diagram of the mobile phone registering the service and the tablet obtaining the service. First, the process of the mobile phone registering the service is introduced. Among them, what the mobile phone registers is the distributed application management service.
[0084] Among them, the distributed application management service is within the system application framework. When the mobile phone is powered on, the system application framework will be started, that is, the distributed application management service will be started. After the mobile phone is powered on, the communication module is started. After the communication module is started, the service collaboration module is started. Therefore, after the service collaboration module is started, the mobile phone can register the distributed application management service into the service collaboration module.
[0085] Among them, the process of the mobile phone registering the service is also the process of the mobile phone registering the distributed application management service, which specifically includes: registering the distributed application management service of the mobile phone into the distributed service manager (DSM) (refer to Figure 5 Step 1). Among them, the distributed application management service is in the system application framework. After the mobile phone is powered on, the distributed application management service is started.
[0086] The service name (such as "DisApp") and the IBinder object (such as "IBinder S1") of the distributed application management service are stored in the distributed service management module. Then, the service name and the IBinder object are sent to the distributed Binder management module. The distributed Binder management module caches the IBinder object (the above IBinder S1) and assigns a BinderId (such as "Binder S1") to the IBinder object. That is, a mapping relationship is established between IBinder S1 and Binder S1 (refer to Figure 5 Step 1.1.1). Then, the distributed Binder management module returns the registration result to the system application framework (refer to Figure 5 Step 1.2).
[0087] In the embodiment of this application, after the distributed Binder management module of the mobile phone assigns a BinderId to the IBinder object and establishes a mapping relationship, it means that the registration of the distributed application management service of the mobile phone is successful. The distributed Binder management module of the mobile phone can send a notification message of successful registration to the system application framework of the mobile phone. At this time, the tablet can obtain the distributed application management service registered by the mobile phone.
[0088] Among them, the application (such as the camera application) is an interface provided by the distributed application framework. The distributed application framework is in the system application framework. After the tablet obtains the distributed application management service registered by the mobile phone, it can call the camera application of the mobile phone through the distributed application framework and obtain the service provided by the camera application.
[0089] Secondly, the process of obtaining services for a tablet is introduced. After the distributed application management service of a mobile phone is successfully registered, the tablet can obtain the distributed application management service registered by the mobile phone.
[0090] It is understandable that before obtaining the photo service, the tablet has already opened the note application, and in response to the user's touch operation on the call entry in the note application interface, the tablet calls up the device list and capability list. In other words, when the tablet receives the user's operation, it can be considered that the user has the intention of cross-device call, so it needs to obtain the distributed application management service provided by the mobile phone.
[0091] Among them, there is a call entry in the note application of the tablet. Figure 6 As shown, an insert button 602 is provided on the display interface 601 of the note application of the PC. After the PC responds to the user's touch operation on the insert button 602, the PC displays the devices that can provide services and the capability list corresponding to the devices on the display interface. The displayed devices may be a mobile phone 1 and a tablet 1. The capability list includes the services that each device can provide, such as Figure 6 Among them, mobile phone 1 corresponds to taking pictures, scanning, etc., and tablet 1 corresponds to taking pictures, scanning, etc.
[0092] In some examples, the tablet may call the camera service of the mobile phone for the first time, or it may call it multiple times. Then, after the tablet obtains the camera service of the camera for the first time, the obtained call information of the camera service can be cached locally. Therefore, the tablet can first search for the mobile phone and distributed application management service from the local cache. If it is found, it will be directly returned to the note application. If it is not found, it can be searched from the mobile phone.
[0093] The embodiment of the present application specifically introduces the process of obtaining the distributed application management service when the tablet calls the camera service of the mobile phone's camera for the first time.
[0094] In the embodiment of the present application, after the distributed application management service of the mobile phone is successfully registered, and in response to the user's touch operation on the call entry of the note application interface, the note application of the tablet can obtain the distributed context of the mobile phone, that is, obtain the "DisApp" service of the mobile phone (refer to Figure 5 Specifically, the system application framework of the tablet sends a request to obtain the "DisApp" service to the distributed service management module of the tablet. Then, the distributed service management module of the tablet sends a request to obtain the "DisApp" service to the message center (Message Center)-communication module of the second tablet (refer to Figure 5 Step 2.2).
[0095] After the communication module of the tablet receives a request to obtain the "DisApp" service, it creates a channel (session) with the mobile phone (refer to Figure 5 Step 2.2.1). After the channel is successfully created, the distributed service management module of the tablet sends an instruction to obtain the "DisApp" service to the communication module of the tablet (refer to Figure 5 Step 2.2.2). The communication module of the tablet receives the instruction to obtain the "DisApp" service, constructs a message, and sends the message to the communication module of the mobile phone.
[0096] After the communication module of the mobile phone receives the message, it parses the message to obtain the instruction to obtain the "DisApp" service (refer to Figure 5 Step 2.2.3). The communication module of the mobile phone sends the instruction to the distributed Binder management module of the mobile phone (refer to Figure 5 Step 2.1.4).
[0097] After the distributed Binder management module of the mobile phone receives the instruction, it searches for the "DisApp" service in the distributed service management module. Among them, as can be seen from Step 1.1, the distributed service management module stores the service name and the corresponding IBinder object. Therefore, the distributed Binder management module can search in the distributed service management module according to the service name ("DisApp") in the above instruction to check whether the service is stored. If the service ("DisApp" service) is found, the corresponding IBinder object (IBinder S1) is determined.
[0098] Then, the distributed service management module of the mobile phone returns the IBinder object (IBinder S1) to the distributed Binder management module of the mobile phone. The distributed Binder management module of the mobile phone determines the BinderId (BinderId S1) corresponding to the IBinder object (IBinder S1) according to the established mapping relationship between the IBinder object and the BinderId (refer to Figure 5 Step 2.2.4). Then, the BinderId (BinderId S1) is sent to the communication module of the mobile phone (refer to Figure 5 Step 2.2.5).
[0099] After the communication module of the mobile phone receives the BinderId (BinderId S1) of the "DisApp" service, it assembles it into a message (the message carries BinderId S1), and sends the message to the communication module of the tablet.
[0100] The communication module of the tablet receives the message, parses the information content, and obtains the BinderId (BinderId S1) of the "DisApp" service (refer to Figure 5 Step 2.2.6). The communication module of the tablet sends the BinderId (BinderId S1) of the "DisApp" service to the distributed service management module of the tablet. The distributed service management module of the tablet sends the BinderId (BinderId S1) of the "DisApp" service to the distributed Binder management module of the tablet. Then, the distributed Binder management module newly creates a corresponding local IBinder object (IBinder C1) according to BinderId S1, that is, the distributed Binder management module creates a mapping relationship between BinderId S1 and IBinder C1, and stores the mapping relationship (refer to Figure 5 Step 2.2.7).
[0101] Then, the distributed Binder management module of the tablet returns the service name ("DisApp") and the corresponding IBinder object (IBinder C1) to the communication module of the tablet, the system application framework (refer to Figure 2 Step 5.2.8), and finally returns to the note application of the tablet (refer to Figure 5 Step 2.3).
[0102] In the embodiment of the present application, after the tablet obtains the "DisApp" service registered by the mobile phone, the tablet can open the camera application of the mobile phone.
[0103] Among them, the specific process of the note application of the tablet opening the camera application of the mobile phone is as follows: The note application sends a start activity for result (intent) message to the system application framework of the tablet, and the Intent contains the uri and device information (set as information 1). The note application makes a call through the locally created IBinder C1, and the system application framework sends information 1 to the distributed Binder management module in the service collaboration module of the tablet.
[0104] The service collaboration module of the tablet then sends the above-mentioned information 1 to the service collaboration module of the mobile phone. The service collaboration module of the mobile phone sends information 1 to the system application framework of the mobile phone. The system application framework of the mobile phone sends a startActivity message to the camera application and starts the camera by calling the start activity method through the locally created IBinder S1. Then, the system application framework sends the result data returned by the camera application (the camera has been turned on) to the distributed Binder management module in the service collaboration module of the mobile phone. The service collaboration module of the mobile phone sends the result data to the service collaboration module of the tablet. Specifically, the communication module of the mobile phone sends the result data to the communication module of the tablet. The communication module of the tablet then forwards the result data to the distributed Binder management module in the service collaboration module of the tablet. The distributed Binder management module of the tablet sends the result data to the system application framework of the tablet. At this time, the camera is successfully turned on.
[0105] After the tablet obtains the "DisApp" service registered by the mobile phone and the camera application of the mobile phone is opened, the camera application can take a photo of the information that needs to be uploaded to the note in response to the user's shooting operation. And, the camera application sends the obtained photo data back to the note application in response to the user's confirmation operation on the photo data. For example, when inserting the blackboard writing content of an offline class in the note application, then, after the camera application is opened, the camera application takes a photo of the blackboard writing content in response to the user's touch operation on the shooting button, obtaining a blackboard photo (the photo data of the blackboard writing content). Then, the camera application sends the blackboard photo back to the note application.
[0106] Among them, the camera application obtains a photo in response to the user's click operation on the photo-taking button, and then can confirm whether the photo meets the user's requirements. The camera obtains the confirmed photo in response to the user's click operation on the confirmation button, that is, after confirming that the photo meets the user's requirements. The camera sends the confirmed photo back to the note. That is to say, after the camera responds to the user's click operation on the confirmation button, the camera sends the photo data back to the note on the tablet. Please refer to Figure 7 , Figure 7 shows a schematic diagram of photo confirmation. As Figure 7 shown, during the process of the tablet calling the mobile phone to take a photo, the mobile phone obtains the confirmed photo in response to the user's touch operation on the confirmation control 701. The camera sends the confirmed photo back to the note on the tablet.
[0107] Among them, for the camera application, when the captured data needs to be transmitted back to the note application after taking a photo, it is necessary to first obtain the file handle of the photo cache file of the note application, and then write the captured data back to the photo cache file of the note application. Since the handle is a resource on the tablet local device, the mobile phone cannot directly obtain it. Therefore, the file handle can be hosted in a certain service (such as the Provider service). The camera application obtains the File Provider object (file providing object) of the note application, and then obtains the file handle through this object.
[0108] Therefore, the specific steps for the captured data of the mobile phone to be transmitted back to the tablet include: the camera application obtains the IContent Provider object (i.e., the File Provider object) of the note application, the camera application obtains the file handle of the photo cache file of the note application, and the camera application writes the captured data back to the note application. Among them, the captured data refers to the result of the mobile phone executing the distributed application management service. The P2P conflict in the embodiment of the present application occurs during the process of the camera application obtaining the file handle of the photo cache file of the note application.
[0109] Please refer to Figure 8 , Figure 8 which shows a timing diagram of a camera application obtaining a File Provider object and obtaining a file handle in an embodiment of the present application. As Figure 8 shown, after the camera application responds to the user's click operation on the confirmation button, it sends a request to obtain the File Provider object of the note application to the tablet (refer to Figure 8 step 1). Since the File Provider object of the note application is registered in the distributed application framework of the tablet, the camera application sends a request to obtain the File Provider object of the note application to the distributed application framework of the mobile phone, and the distributed application framework of the mobile phone obtains the File Provider object of the note application from the distributed application framework of the tablet.
[0110] After the camera application obtains the File Provider object of the note application, it can obtain the file handle of the photo cache file of the note based on this FileProvider object. The camera application sends a request to obtain the file handle of the note application to the distributed application framework of the mobile phone (refer to Figure 8 step 2). The distributed application framework then sends this acquisition request to the service coordination module of the mobile phone. Then, the service coordination module forwards this acquisition request to the communication module of the mobile phone. The communication module of the mobile phone assembles a message and sends this acquisition request to the communication module of the tablet.
[0111] After the communication module of the tablet receives the acquisition request, it sends the acquisition request to the service cooperation module of the tablet. The service cooperation module then forwards the acquisition request to the distributed application framework of the tablet. Among them, the file handle of the photo cache file of the note application is pre-registered in the distributed application framework. Thus, based on the acquisition request, the distributed application framework returns the file handle to the service cooperation module (refer to Figure 8 Step 2.1). The service cooperation module sends an instruction to create a distributed file to the distributed file module of the tablet based on the file handle (refer to Figure 8 Step 2.2).
[0112] It can be understood that a file handle can be used to access a file, such as opening a file, closing a file, reading and writing a file, etc. Therefore, after the camera obtains the file handle, the captured data can be written into the actual file. Since the actual file is on the device side where the note application is located, and the camera application performs cross-device reading and writing, a distributed file can be created (the distributed file module can provide access to cross-device files) to ensure that the data is written from the camera side across devices into the file on the device side where the note is located.
[0113] After the distributed file module successfully creates a distributed file, it sends an instruction indicating success to the service cooperation module of the tablet (refer to Figure 8 Step 2.2.1). Among them, the created distributed file will have a corresponding name. The service cooperation module of the tablet sends the name of the distributed file to the communication module of the mobile phone through the communication module of the tablet (refer to Figure 8 Step 2.3). The communication module of the mobile phone then sends the name of the distributed file to the service cooperation module of the mobile phone for processing. The service cooperation module can send an open instruction to the distributed file module of the mobile phone based on the obtained name of the distributed file to open the corresponding distributed file (refer to Figure 8 Step 2.4).
[0114] Then, the distributed file module of the mobile phone returns the file handle of the distributed file to the service cooperation module of the mobile phone (refer to Figure 8 Step 2.5). The service cooperation module returns the file handle to the distributed application framework of the mobile phone, and then the distributed application framework returns it to the camera application.
[0115] The above steps are the process for the camera application to successfully open a distributed file based on the obtained name of the distributed file.
[0116] In an embodiment of the present application, during the process of the service collaboration module of the mobile phone opening a distributed file, the service collaboration module sends an opening instruction to the distributed file module of the mobile phone. After receiving the opening instruction, the distributed file module of the mobile phone initiates a request to create a connection (session) to the distributed file module of the tablet based on the opening instruction. Among them, creating a session between the distributed file module of the mobile phone and the distributed file module of the tablet refers to establishing a P2P connection. During the process of establishing a P2P connection between the distributed file module of the mobile phone and the distributed file module of the tablet, a P2P conflict may occur.
[0117] In order to solve the above problems, the cross-device data processing method provided in the embodiment of the present application can trigger re-networking if a P2P conflict is detected during the process of establishing a P2P connection between two devices, and realize communication between the two devices after the re-networking is successful.
[0118] See also Figure 9 , Figure 9 A timing diagram of a camera application obtaining a file handle provided in an embodiment of the present application. Figure 9 As shown, at this time, it is assumed that the camera application has obtained the File Provider object of the note application, and obtains the file handle of the photo cache file of the note based on the FileProvider object. The camera application sends a request to obtain the file handle of the note application to the distributed application framework of the mobile phone (refer to Figure 9 Step 1). The distributed application framework sends the acquisition request to the service collaboration module of the mobile phone, and then the service collaboration module forwards the acquisition request to the communication module of the mobile phone. The communication module of the mobile phone assembles the message and sends the acquisition request to the communication module of the tablet.
[0119] After receiving the acquisition request, the communication module of the tablet sends the acquisition request to the service collaboration module of the tablet. The service collaboration module then forwards the acquisition request to the distributed application framework of the tablet. Based on the acquisition request, the distributed application framework returns the file handle to the service collaboration module (refer to Figure 9 The service collaboration module sends a command to create a distributed file to the distributed file module of the tablet based on the file handle (refer to Figure 9 Step 1.2).
[0120] After successfully creating a distributed file, the distributed file module sends a successful creation instruction to the tablet service collaboration module (refer to Figure 9Step 1.3). The created distributed file will have a corresponding name. The tablet service collaboration module sends the name of the distributed file to the mobile phone's communication module through the tablet's communication module. The mobile phone's communication module then sends the name of the distributed file to the mobile phone's service collaboration module for processing. The service collaboration module can send an open instruction to the mobile phone's distributed file module based on the name of the distributed file obtained (refer to Figure 9 Step 1.4). The distributed file module of the mobile phone initiates a request to create a session to the distributed file module of the tablet based on the open instruction (refer to Figure 9 In fact, the distributed file module of the mobile phone sends a request to create a connection to the communication module of the mobile phone. After the communication module of the mobile phone and the communication module of the tablet establish a connection, the distributed file module of the mobile phone and the distributed file module of the tablet complete the establishment of the connection.
[0121] At this time, if there is a P2P conflict, the distributed file module of the tablet sends a P2P conflict prompt message (such as an error code) to the distributed file module of the mobile phone (refer to Figure 9 Step 1.4.2). After receiving the prompt message, the distributed file module of the mobile phone fails to open the distributed file. Then, the distributed file module of the mobile phone sends a failure prompt message of failure to open the distributed file to the service collaboration module of the mobile phone (refer to Figure 9 Based on the failure prompt message, the service collaboration module sends an exception prompt message to the distributed application framework of the mobile phone, indicating that the file handle of the note application is abnormal (refer to Figure 9 Step 1.5). At this time, the distributed application framework can send a preemption instruction to the service collaboration module of the mobile phone (refer to Figure 9 In step 1.6), the preemption instruction is used to instruct to preempt the currently existing P2P connection. Preempting the currently existing P2P connection is also the mobile phone executing re-networking.
[0122] After receiving the preemption instruction, the service collaboration module sends the preemption instruction to the distributed file module of the mobile phone. The service collaboration module sends the open instruction for the distributed file to the distributed file module of the mobile phone again, and the open instruction contains the preemption instruction (refer to Figure 9 as in step 1.7).
[0123] The distributed file module preempts the currently existing P2P connection based on this preemption instruction. Assume that the currently existing P2P connection is that the mobile phone has established a P2P connection 1 with the PC before receiving the shooting instruction sent by the tablet. In P2P connection 1, the PC is the GO role and the mobile phone is the GC role; while in the P2P connection 2 that the mobile phone is to establish with the tablet, after negotiation with the tablet, the mobile phone is the GO role and the tablet is the GC role. Thus, the P2P conflict at this time is that the role of the mobile phone in P2P connection 1 (GC) conflicts with the role in P2P connection 2 (GO).
[0124] Among them, the specific steps for the above-mentioned distributed file module to preempt the currently existing P2P connection are as follows: The mobile phone first disconnects the P2P connection with the PC, and then the distributed file module of the mobile phone sends a request to establish a P2P connection (establish a session) to the distributed file module of the tablet, and the distributed file module of the mobile phone and the distributed file module of the tablet complete the establishment of the P2P connection.
[0125] After the distributed file module of the mobile phone and the distributed file module of the tablet complete the establishment of the P2P connection, the distributed file module of the mobile phone successfully opens the corresponding distributed file. The distributed file module of the mobile phone returns the handle of the distributed file to the service collaboration module of the mobile phone (refer to Figure 9 Step 1.8). Then, the service collaboration module returns the handle of the distributed file to the distributed application framework of the mobile phone (refer to Figure 9 Step 1.9), and the distributed application framework returns the handle of the distributed file to the camera application. Thus, the camera application obtains the file handle of the distributed file.
[0126] Then, the camera application can write the captured photo data back to the tablet, that is, the camera application writes the captured photo data into the distributed file of the mobile phone through the file handle of the distributed file, then transfers it to the distributed file of the tablet, and finally returns it to the note application of the tablet.
[0127] That is to say, after the camera application calls the write data interface of the distributed file of the mobile phone through the file handle, writes the captured photo data, and transfers it to the distributed file of the tablet through the channel created by the distributed file module of the mobile phone and the distributed file module of the tablet, and then returns it to the note application. Thus, the captured photo data obtained by the camera application of the mobile phone is successfully transferred to the note application of the tablet.
[0128] In some other examples, after receiving the exception prompt message of the file handle exception of the note application, the distributed application framework may include the cause of the exception (P2P conflict) in the exception prompt message. Among them, the distributed application framework may pop up a window on the mobile phone interface, and the window may display a prompt message for prompting the user whether to preempt the network. Thus, the electronic device may choose whether to continue the current cross-device call service or stop the current cross-device call service and continue the original service of the electronic device according to the user's will.
[0129] For example, as Figure 10 shown, a schematic diagram of a pop-up window is shown. Figure 10 In it, the mobile phone interface 801 displays a pop-up window 802, and the prompt message in the pop-up window includes: "Continuing to transfer the file will interrupt and reload the services in use of intelligent interconnection. Do you want to continue?" The mobile phone may receive the touch operation of the user on the confirmation control ("Continue") 803 and generate a preemption instruction. Or, the mobile phone may receive the touch operation 804 of the user on the cancel control to cancel the preemption. The service in use of intelligent interconnection here may refer to the cross-device call camera service.
[0130] Please refer to Figure 11 , Figure 11 , which is a timing diagram of re-networking provided by an embodiment of the present application. As Figure 11 shown, at this time, it is assumed that the camera application has obtained the File Provider object of the note application, and based on this File Provider object, it obtains the file handle of the photo cache file of the note. The camera application sends a request for obtaining the file handle of the note application to the distributed application framework of the mobile phone (refer to Figure 11 step 1). The distributed application framework then sends the obtain request to the service collaboration module of the mobile phone, and then, the service collaboration module forwards the obtain request to the communication module of the mobile phone. The communication module of the mobile phone assembles the message and sends the obtain request to the communication module of the tablet.
[0131] After receiving the obtain request, the communication module of the tablet sends the obtain request to the service collaboration module of the tablet. The service collaboration module then forwards the obtain request to the distributed application framework of the tablet. The distributed application framework returns the file handle to the service collaboration module based on the obtain request (refer to Figure 11 step 1.1). The service collaboration module sends an instruction to create a distributed file to the distributed file module of the tablet based on the file handle (refer to Figure 11 step 1.2).
[0132] After successfully creating the distributed file, the distributed file module sends an instruction of successful creation to the service collaboration module of the tablet (refer to Figure 11Step 1.2.1). Among them, the created distributed file will have a corresponding name. The service collaboration module of the tablet sends the name of the distributed file to the communication module of the mobile phone through the communication module of the tablet (refer to Figure 11 Step 1.3). The communication module of the mobile phone then sends the name of the distributed file to the service collaboration module of the mobile phone for processing. The service collaboration module can send an open instruction to the distributed file module of the mobile phone by obtaining the name of the distributed file (refer to Figure 11 Step 1.4). The distributed file module of the mobile phone initiates a request to create a session to the distributed file module of the tablet based on this open instruction (refer to Figure 11 Step 1.4.1).
[0133] At this time, if there is a P2P conflict, the distributed file module of the tablet sends a P2P conflict prompt message (such as an error code) to the distributed file module of the mobile phone (refer to Figure 11 Step 1.4.2). After receiving this prompt message, the distributed file module of the mobile phone, that is, the distributed file module of the mobile phone fails to open the distributed file (refer to Figure 11 Step 1.4.3). Then, the distributed file module of the mobile phone sends a failure prompt message indicating that the distributed file cannot be opened to the service collaboration module of the mobile phone. Based on this failure prompt message, the service collaboration module sends an exception prompt message for the file handle of the requested note application to the distributed application framework of the mobile phone (refer to Figure 11 Step 1.5).
[0134] The distributed application framework of the mobile phone pops up a window on the mobile phone interface, and there is prompt information displayed in this window (refer to Figure 11 Step 2). The distributed application framework of the mobile phone generates a preemption instruction in response to receiving a touch operation by the user on the confirmation control in the pop-up window (refer to Figure 11 Step 2.1).
[0135] The distributed application framework of the mobile phone initiates a preemption instruction to the service collaboration module of the mobile phone based on this preemption instruction (refer to Figure 11 Step 2.2), which is used to indicate preemption of the currently existing P2P connection. After receiving the preemption instruction, the service collaboration module sends this preemption instruction to the distributed file module of the mobile phone again (refer to Figure 11 Step 2.3). Among them, the service collaboration module sends an open instruction for the distributed file to the distributed file module of the mobile phone again, and this open instruction contains a preemption instruction. For the specific steps of the distributed file module to preempt the currently existing P2P connection, please refer to the relevant steps in the foregoing embodiments.
[0136] After the distributed file module of the mobile phone and the distributed file module of the tablet complete the establishment of a P2P connection, the distributed file module of the mobile phone successfully opens the corresponding distributed file. The distributed file module of the mobile phone returns the handle of the distributed file to the service collaboration module of the mobile phone (refer to Figure 11 Then, the service collaboration module returns the handle of the distributed file to the distributed application framework of the mobile phone (refer to Figure 11 In step 2.5), the distributed application framework returns the handle of the distributed file to the camera application. Thus, the camera application obtains the file handle of the distributed file.
[0137] Then, the camera application can write the photo data back to the tablet, that is, the camera application writes the photo data to the distributed file of the mobile phone through the file handle of the distributed file, then transfers it to the distributed file of the tablet, and finally returns it to the note application of the tablet.
[0138] In the above example, if the service collaboration module of the mobile phone saves the name of the obtained distributed file, then after subsequently receiving the preemption instruction from the distributed application framework of the mobile phone, it can directly send an opening instruction for the distributed file to the distributed file module of the mobile phone based on the saved name of the distributed file, and preempt the currently existing P2P connection in the process of opening the distributed file.
[0139] In some embodiments, after the distributed file module of the mobile phone fails to open the distributed file, the distributed file module sends a failure prompt message to the service collaboration module of the mobile phone indicating that the distributed file has failed to be opened. At this time, the service collaboration module may consider that the name of the obtained distributed file is invalid and delete the name of the distributed file obtained in the service collaboration module. Then, after receiving the preemption instruction, the distributed application framework of the subsequent mobile phone can re-trigger the process of the mobile phone obtaining the file handle of the note application across devices.
[0140] See also Figure 12 , Figure 12 Another timing diagram of re-networking provided in the embodiment of the present application. Figure 12 As shown, the steps before the distributed file module of the mobile phone receives the opening instruction of opening the distributed file sent by the service collaboration module of the mobile phone (refer to Figure 12 Step 1, step 1.1, step 1.2, step 1.2.1, step 1.3 and step 1.4) are the same as those in the aforementioned embodiment and will not be described in detail here.
[0141] The distributed file module of the mobile phone initiates a request to create a session to the distributed file module of the tablet based on the open instruction (refer to Figure 12Step 1.4.1). At this time, if there is a P2P conflict, the distributed file module of the tablet sends a P2P conflict prompt message (such as an error code) to the distributed file module of the mobile phone (refer to Figure 12 Step 1.4.2). After the distributed file module of the mobile phone receives this prompt message, that is, the distributed file module of the mobile phone fails to open the distributed file. Then, the distributed file module of the mobile phone sends a failure prompt message indicating the failure to open the distributed file to the service collaboration module of the mobile phone (refer to Figure 12 Step 1.4.3). Based on this failure prompt message, the service collaboration module sends an exception prompt message requesting an abnormal file handle of the note application to the distributed application framework of the mobile phone (refer to Figure 12 Step 1.5).
[0142] The distributed application framework of the mobile phone pops up a dialog on the mobile phone interface, and a prompt message is displayed in this dialog (refer to Figure 12 Step 1.5). In response to receiving a touch operation of the user on the confirmation control in the dialog, the mobile phone generates a preemption instruction (refer to Figure 12 Step 2).
[0143] The distributed application framework of the mobile phone receives the preemption instruction and sends a process to re-trigger openOutputStream to the service collaboration module of the mobile phone, that is, re-trigger a process for the mobile phone to obtain the file handle of the note application on the tablet across devices (refer to Figure 12 Step 2.1). Among them, the specific steps for the mobile phone to obtain the file handle of the note application on the tablet across devices (refer to Figure 12 Steps 2.3, 2.4.1, and 2.5) are the same as the steps in the foregoing embodiments, and the present application will not elaborate here.
[0144] Among them, a preemption instruction is carried in the flag bit of the openOutputStream process. The preemption instruction can occupy a certain field in the flag bit. For example, it can be set to true or 1. If the preemption instruction is true or 1, it means to preempt the currently existing P2P connection.
[0145] Among them, after the service collaboration module of the mobile phone receives the process to re-trigger openOutputStream and obtains the preemption instruction in the flag bit, it clears this flag bit, that is, restores the flag bit to its original state.
[0146] After the service collaboration module of the mobile phone receives the file name of the re-created distributed file sent by the service collaboration module of the tablet, it sends an open instruction for the distributed file to the distributed file module of the mobile phone again (refer to Figure 12In step 2.6), the opening instruction includes a preemption instruction. The distributed file module preempts the current existing P2P connection based on the preemption instruction, wherein the specific steps of the distributed file module preempting the current existing P2P connection can refer to the steps in the above embodiment.
[0147] After the distributed file module of the mobile phone and the distributed file module of the tablet complete the establishment of a P2P connection, the distributed file module of the mobile phone successfully opens the corresponding distributed file. The distributed file module of the mobile phone returns the handle of the distributed file to the service collaboration module of the mobile phone (refer to Figure 12 Then, the service collaboration module returns the handle of the distributed file to the distributed application framework of the mobile phone (refer to Figure 12 In step 2.8), the distributed application framework returns the handle of the distributed file to the camera application. Thus, the camera application obtains the file handle of the distributed file.
[0148] Then, the camera application can write the photo data back to the tablet, that is, the camera application writes the photo data to the distributed file of the mobile phone through the file handle of the distributed file, then transfers it to the distributed file of the tablet, and finally returns it to the note application of the tablet.
[0149] Therefore, the above solution can respond to the user's operation to choose whether to preempt, providing the user with a better usage experience.
[0150] In some embodiments, see Figure 13 , Figure 13 A schematic diagram of another re-networking provided in an embodiment of the present application. Figure 13 As shown, the steps before the distributed file module of the mobile phone receives the opening instruction of opening the distributed file sent by the service collaboration module of the mobile phone (refer to Figure 13 Step 1, step 1.1, step 1.2, step 1.2.1, step 1.3 and step 1.4) are the same as those in the aforementioned embodiment and will not be described in detail here.
[0151] The distributed file module of the mobile phone initiates a request to create a session to the distributed file module of the tablet based on the open instruction (refer to Figure 13 At this time, if there is a P2P conflict, the distributed file module of the tablet sends a P2P conflict prompt message (such as an error code) to the distributed file module of the mobile phone (refer to Figure 13 Step 1.4.2). After receiving the prompt message, the distributed file module of the mobile phone fails to open the distributed file. Then, the distributed file module of the mobile phone sends a failure prompt message of failure to open the distributed file to the service collaboration module of the mobile phone (refer to Figure 13Step 1.4.3). Based on this failure prompt message, the service collaboration module sends an exception prompt message indicating an exception with the file handle of the note application to the distributed application framework of the mobile phone (refer to Figure 13 Step 1.5).
[0152] At this time, after recognizing the P2P conflict, the distributed application framework can send a process to re-trigger the opening of the output stream (openOutputStream) to the service collaboration module of the mobile phone (refer to Figure 13 Step 2), that is, re-trigger the process of the mobile phone obtaining the file handle of the note application on the tablet across devices. Among them, the specific steps of the mobile phone obtaining the file handle of the note application on the tablet across devices are the same as those in the foregoing embodiments (refer to Figure 13 Steps 2.1, 2.2, 2.2.1, and 2.3), and are not elaborated herein in this application.
[0153] Among them, a preemption instruction is carried in the flag of the openOutputStream process. This preemption instruction is used to indicate preemption of the currently existing P2P connection.
[0154] After the service collaboration module of the mobile phone receives the name of the re-created distributed file sent by the service collaboration module of the tablet, it sends an open instruction for the distributed file to the distributed file module of the mobile phone again (refer to Figure 13 Step 2.4). A preemption instruction is included in this open instruction. The distributed file module preempts the currently existing P2P connection based on this preemption instruction. Among them, the specific steps for the distributed file module to preempt the currently existing P2P connection can refer to the steps in the foregoing embodiments.
[0155] Thus, after the distributed file module of the mobile phone and the distributed file module of the tablet complete the establishment of the P2P connection, the distributed file module of the mobile phone successfully opens the corresponding distributed file. The distributed file module of the mobile phone returns the handle of the distributed file to the service collaboration module of the mobile phone (refer to Figure 13 Step 2.5). Then, the service collaboration module returns the handle of the distributed file to the distributed application framework of the mobile phone (refer to Figure 13 Step 2.6), and the distributed application framework returns the handle of the distributed file to the camera application. Thus, the camera application obtains the file handle of the distributed file.
[0156] Then, the camera application can write the captured photo data back to the tablet, that is, the camera application writes the captured photo data into the distributed file of the mobile phone through the file handle of the distributed file, then transfers it to the distributed file of the tablet, and finally returns it to the note application of the tablet.
[0157] In summary, in the cross-device data processing method provided by the embodiments of the present application, if a P2P conflict occurs during the establishment of a P2P connection between the first electronic device and the second electronic device, the second electronic device can preempt the network, reorganize the network, establish a P2P connection with the first electronic device, and realize communication with the first electronic device.
[0158] Please refer to Figure 14 , Figure 14 which is a schematic diagram of a cross-device data processing method provided by the embodiments of the present application. As Figure 14 shown, before the tablet calls the target service of the mobile phone, the mobile phone and the PC have established a P2P connection 1. The steps of this method may specifically include steps S1401 - S1404 as follows:
[0159] Step S1401: The mobile phone executes the target service in response to receiving a call request from the tablet.
[0160] Among them, the target service may be the camera service in the foregoing embodiments.
[0161] Step S1402: When the mobile phone executes the target service and obtains the corresponding target data, it sends a connection request to the tablet.
[0162] Among them, this connection request is used to request the establishment of a first communication connection between the mobile phone and the tablet. Here, the first communication connection may refer to a P2P connection. The target data may be photographed data, text obtained by scanning, etc.
[0163] Step S1403: During the establishment of the first communication connection between the mobile phone and the tablet, the mobile phone executes network reorganization in response to a connection failure signal.
[0164] Among them, the connection failure signal is used to indicate that there is a preset conflict in the first communication connection. The preset conflict may be, for example, a P2P conflict. For the explanation of the P2P conflict, please refer to the foregoing embodiments and will not be elaborated here.
[0165] Among them, when the mobile phone executes network reorganization, it includes disconnecting the P2P connection 1 with the PC and establishing a P2P connection, that is, the first communication connection, between the mobile phone and the tablet. Thus, after the mobile phone successfully executes network reorganization, it can complete the first communication connection between the mobile phone and the tablet.
[0166] Step S1404: After the mobile phone and the tablet establish the first communication connection, the mobile phone returns the target data to the tablet based on the first communication connection.
[0167] Therefore, for the above cross-device data processing method, if a P2P conflict occurs during the process of establishing a P2P connection between the first electronic device and the second electronic device, the first electronic device can preempt the network, reorganize the network, establish a P2P connection with the second electronic device, and realize communication with the second electronic device.
[0168] Exemplarily, the electronic device in the embodiments of the present application may be a tablet computer, a mobile phone, a desktop type, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, a vehicle-mounted device, etc. The embodiments of the present application do not impose special restrictions on the specific form of the electronic device.
[0169] In the embodiments of the present application, the electronic device may be divided into a private device and a public device. It can be understood that the private device is used to indicate a device that only the owner of the device (i.e., the owner of the device) can use. For example, the private device may be a mobile phone, a smart watch, smart glasses, headphones, etc. The public device is used to indicate a device that any user can use. That is to say, there may be multiple accounts logged in to the public device, and there is an association between multiple different accounts. For example, the public device may be a TV, a stereo, a tablet computer, etc.
[0170] The execution subject of the cross-device data processing method provided by the present application may be a cross-device data processing device, and the execution device may be Figure 15 the electronic device shown. At the same time, the execution device may also be the central processing unit (CPU) of the electronic device, or the control module for cross-device data processing in the electronic device. In the embodiments of the present application, the cross-device data processing method provided by the present application is described by taking the electronic device as an example to execute the cross-device data processing method.
[0171] Next, the implementation manners of the embodiments of the present application will be described in detail with reference to the accompanying drawings. Taking the above electronic device as a mobile phone as an example, the hardware structure of the electronic device (such as the electronic device 300) will be introduced. Among them, Figure 15 the electronic device 300 shown is only an example of the electronic device, and the electronic device 300 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. Figure 15The various components shown in [figure] can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0172] Please refer to Figure 15 , Figure 15 which shows a schematic structural diagram of an electronic device. As Figure 15 shown, the electronic device 300 may include: a processor 310, an external memory interface 320, an internal memory 321, a USB interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone, a headphone interface, a sensor module 380, a key 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc.
[0173] Among them, the above-mentioned sensor module 380 may include sensors such as a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor.
[0174] It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 300. In other embodiments, the electronic device 300 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0175] The processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0176] The controller can be the nerve center and command center of the electronic device 300. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0177] A memory can also be set in the processor 310 to store instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can save the instructions or data that the processor 310 has just used or recycled. If the processor 310 needs to use the instruction or data again, it can directly call it from the said memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0178] In some embodiments, the processor 310 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0179] It can be understood that the interface connection relationships between the modules illustrated in this embodiment are only illustrative descriptions and do not constitute a structural limitation on the electronic device 300. In other embodiments, the electronic device 300 can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0180] The charging management module 340 is used to receive a charging input from a charger. Among them, the charger is a wired charger in the embodiments of the present application, and the charging management module 340 can receive the charging input of the wired charger through the USB interface 330 (i.e., the above-mentioned charging interface). While charging the battery 342, the charging management module 340 can also supply power to the electronic device through the power management module 341.
[0181] The power management module 341 is used to connect to the battery 342, the charging management module 340, and the processor 310. The power management module 341 receives inputs from the battery 342 and / or the charging management module 340 and supplies power to the processor 310, the internal memory 321, the external memory, the display screen 394, the camera 393, the wireless communication module 360, etc. The power management module 341 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 341 can also be disposed in the processor 310. In some other embodiments, the power management module 341 and the charging management module 340 can also be disposed in the same device.
[0182] The wireless communication function of the electronic device 300 can be implemented by the antenna 1, the antenna 2, the mobile communication module 350, the wireless communication module 360, the modulation and demodulation processor, and the baseband processor, etc.
[0183] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0184] The mobile communication module 350 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 300. The mobile communication module 350 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves through the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0185] The mobile communication module 350 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 350 can be disposed in the processor 310. In some embodiments, at least some functional modules of the mobile communication module 350 and at least some modules of the processor 310 can be disposed in the same device.
[0186] The wireless communication module 360 can provide solutions for wireless communications applied to the electronic device 300, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. For example, in the embodiments of this application, the electronic device 300 can access a Wi-Fi network through the wireless communication module 360.
[0187] The wireless communication module 360 can be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication module 360 can also receive the signals to be sent from the processor 310, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0188] In some embodiments, antenna 1 of electronic device 300 is coupled to mobile communication module 350, and antenna 2 is coupled to wireless communication module 360, such that electronic device 300 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).
[0189] Electronic device 300 implements a display function through a GPU, display screen 394, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.
[0190] The display screen 394 is used to display images, videos, etc. The display screen 394 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 (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc.
[0191] The electronic device 300 can implement the shooting function through the ISP, the camera 393, the video codec, the GPU, the display screen 394, and the application processor, etc. The ISP is used to process the data fed back by the camera 393. The camera 393 is used to capture static images or videos. In some embodiments, the electronic device 300 may include one or N cameras 393, where N is a positive integer greater than 1. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 300 selects a frequency point, the digital signal processor is used to perform a Fourier transform on the frequency point energy, etc. The video codec is used to compress or decompress digital videos. The NPU is a neural-network (NN) computing processor. By learning from the biological neural network structure, for example, learning from the transmission mode between human brain neurons, it can quickly process the input information and can also continuously self-learn. Through the NPU, applications such as the intelligent cognition of the electronic device 300 can be realized, such as: image recognition, face recognition, voice recognition, text understanding, etc.
[0192] The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 300. The external memory card communicates with the processor 310 through the external memory interface 320 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0193] The internal memory 321 can be used to store computer-executable program code, and the executable program code includes instructions. The processor 310 executes various functional applications and data processing of the electronic device 300 by running the instructions stored in the internal memory 321. For example, in the embodiments of the present application, the processor 310 can execute the instructions stored in the internal memory 321, and the internal memory 321 can include a program storage area and a data storage area.
[0194] Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 300 (such as audio data, a phone book, etc.). In addition, the internal memory 321 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0195] The electronic device 300 can implement audio functions through an audio module 370, a speaker 370A, a receiver 370B, a microphone, a headphone jack, and an application processor, etc. Such as music playback, recording, etc.
[0196] The audio module 370 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 370 can also be used to encode and decode audio signals. In some embodiments, the audio module 370 can be disposed in the processor 310, or some functional modules of the audio module 370 can be disposed in the processor 310. The speaker 370A, also called a "loudspeaker", is used to convert an audio electrical signal into a sound signal. The receiver 370B, also called a "handset", is used to convert an audio electrical signal into a sound signal. The microphone, also called a "microphone" or "transmitter", is used to convert a sound signal into an electrical signal.
[0197] The headphone jack is used to connect a wired headphone. The headphone jack can be a USB interface 330, or a 3.5 mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0198] The button 390 includes a power-on button, volume buttons, etc. The button 390 can be a mechanical button or a touch button. The motor 391 can generate vibration prompts. The motor 391 can be used for incoming call vibration prompts and also for touch vibration feedback. The indicator 392 can be an indicator light and can be used to indicate the charging state, battery level changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 395 is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface 395 to achieve contact and separation from the electronic device 300. The electronic device 300 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 395 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0199] Although Figure 15 not shown, the electronic device 300 may also include a flash, a micro projection device, a Near Field Communication (NFC) device, etc., which will not be elaborated here.
[0200] This application embodiment also provides a chip system. As Figure 16 shown, the chip system 900 includes at least one processor 901 and at least one interface circuit 902. The processor 901 and the interface circuit 902 can be interconnected by a line. For example, the interface circuit 902 can be used to receive signals from other devices (such as the memory of the electronic device). For another example, the interface circuit 902 can be used to send signals to other devices (such as the processor 901). Exemplarily, the interface circuit 902 can read the instructions stored in the memory and send the instructions to the processor 901. When the instructions are executed by the processor 901, the electronic device can execute each step in the above embodiments. Of course, the chip system may also include other discrete devices, and this application embodiment does not make specific limitations thereon.
[0201] This application embodiment also provides a computer storage medium. The computer storage medium includes computer instructions. When the computer instructions run on the above electronic device, the electronic device is enabled to execute each function or step that the mobile phone executes in the above method embodiment.
[0202] This application embodiment also provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute each function or step that the mobile phone executes in the above method embodiment.
[0203] From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0204] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0205] The units described as separate components may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0206] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0207] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. And the foregoing storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks or optical disks and other various media that can store program codes.
[0208] The above content is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application shall be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.
Claims
1. A data processing method across devices, characterized in that, Applied to a first electronic device, the method includes: The first electronic device executes a target service in response to receiving a call request from a second electronic device; When the first electronic device executes the target service to obtain corresponding target data, the first electronic device sends a connection request to the second electronic device; the connection request is used to request to establish a first communication connection between the first electronic device and the second electronic device; During the process of establishing the first communication connection between the first electronic device and the second electronic device, the first electronic device executes re-networking in response to a connection failure signal to complete the first communication connection between the first electronic device and the second electronic device; the connection failure signal is used to indicate that there is a preset conflict in the first communication connection; After the first communication connection is established between the first electronic device and the second electronic device, the first electronic device returns the target data to the second electronic device based on the first communication connection.
2. The method according to claim 1, wherein After the first electronic device executes the target service to obtain corresponding target data, it further includes: The first electronic device sends a first acquisition request to the second electronic device, which is used to request to obtain a first file handle object of a preset file of the second electronic device. The first file handle object is used for the second electronic device to create a first distributed file; the preset file is used to save the target data; the first distributed file and a second distributed file in the first electronic device are used to support data access between the first electronic device and the second electronic device, and the first file handle object is used for the second electronic device to return the target data in the first distributed file to the preset file; The first electronic device receives the file name of the first distributed file sent by the second electronic device; Among them, the sending the connection request to the second electronic device includes: The first electronic device sends a connection request to the second electronic device based on the file name.
3. The method according to claim 1 or 2, characterized in that, The execution of re-networking includes: The first electronic device sends a second acquisition request to the second electronic device, which is used to request to re-obtain the first file handle object of the preset file of the second electronic device; The first electronic device receives the file name of the first distributed file sent by the second electronic device; The first electronic device executes the re-networking based on the file name.
4. The method according to claim 3, characterized in that Before the first electronic device receives the file name of the first distributed file sent by the second electronic device, it further includes: The first electronic device deletes the file name of the first distributed file.
5. The method according to any one of claims 1-4, characterized in that The first electronic device returns the target data to the second electronic device based on the first communication connection, including: The first electronic device opens a corresponding second distributed file based on the file name of the first distributed file, and the second distributed file is used to obtain the target data; The second distributed file of the first electronic device transfers the target data to the first distributed file of the second electronic device, so that the second electronic device returns the target data in the first distributed file to the preset file through the first file handle object.
6. The method according to any one of claims 1-5, characterized in that, The execution of re-networking includes: When a second communication connection is established between the first electronic device and a third electronic device, the first electronic device disconnects the second communication connection and establishes the first communication connection with the second electronic device.
7. The method according to any one of claims 1-6, characterized in that, The first electronic device responds to a connection failure signal and executes re-networking, including: The first electronic device responds to a connection failure signal and displays a prompt message for prompting the user that there is a transmission problem with the target data. If the first electronic device responds to the user's operation on the confirmation control in the prompt message, the first electronic device executes re-networking.
8. The method according to claim 7, wherein Before sending a connection request to the second electronic device, it further includes: The service cooperation module of the first electronic device receives the file name of the distributed file sent by the second electronic device. Among them, sending a connection request to the second electronic device includes: The service cooperation module sends an opening instruction to the distributed file module of the first electronic device based on the file name, and the opening instruction is used to open the second distributed file corresponding to the file name. The distributed file module responds to the opening instruction and sends a connection request to the second electronic device.
9. The method according to claim 8, wherein The first electronic device responds to a connection failure signal and executes re-networking, including: The distributed file module receives the connection failure signal sent by the second electronic device and sends an opening failure message to the service cooperation module based on the connection failure signal. The opening failure message is used to indicate that the distributed file module fails to open the second distributed file. The distributed file module sends an exception message to the distributed application framework of the first electronic device based on the received opening failure message. The exception message is used to indicate that the first electronic device has an exception in obtaining the first file handle object. The distributed application framework executes the re-networking based on the exception message.
10. The method according to claim 9, wherein The display of the prompt message includes: The distributed application framework of the first electronic device sends a display request to the display interface of the first electronic device based on the exception message, for requesting the display interface to display the prompt message. The display interface responds to the display request and displays the prompt message. Among them, if the first electronic device responds to the user's operation on the confirmation control in the prompt message, the first electronic device executes re-networking, including: The display interface responds to the user's operation on the confirmation control in the display request and sends a networking request to the distributed application framework. The networking request is used to execute the re-networking. The distributed application framework receives the networking request and sends the networking request to the service cooperation module. The service collaboration module receives the networking request and sends the networking request to the distributed file module; The distributed file module performs re-networking with the second electronic device based on the networking request.
11. An electronic device, characterized in that, The electronic device includes: a communication module, a display screen, a memory, and one or more processors; the communication module, the display screen, the memory, and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device executes the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium. When the instructions run on the electronic device, the electronic device executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Android device gas platform system based on Bluetooth handle and implementation method of Android device gas platform system
CN103316472A
Cross-terminal data processing method and device
CN105915611A
Terminal communication coordination service system and method
CN114124970A
Data transmission method and system, electronic equipment and storage medium
CN114301899A
Cross-device control method and device
CN114510186A