Data processing system, method, electronic device and medium
By comparing and updating version identification and attribute values in multi-device collaborative communication, the cross-device data processing timing problem is solved to ensure the accuracy and consistency of data processing.
Patent Information
- Application Number
- CN202310125219.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-19
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-01-19
AI Technical Summary
In multi-device collaborative communication, when electronic devices deal with cross-device data timing problems, new messages may be overwritten by old messages or first messages arrive later, resulting in confusion in data processing.
After the properties of the first electronic device change, the attribute instruction is assembled and sent to the second electronic device, the second electronic device compares the version identifier in the attribute instruction with the version identifier in the local cache attribute and updates it to the latest version identifier and attribute value to ensure subsequent processing based on the latest version identifier.
Solve the cross-device data processing timing problem to ensure the accuracy and consistency of data processing.
Smart Images

Figure CN117118840B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a data processing system, method, electronic device and medium. Background Art
[0002] As the mobility and connectivity of electronic devices become increasingly powerful, users can transfer and synchronize data between multiple electronic devices, which is called multi-device collaboration.
[0003] Near-field communication (NFC) refers to communication between multiple electronic devices via short-range methods like Wi-Fi or Bluetooth. Far-field communication (FFC) refers to communication between multiple electronic devices via a device cloud. When two electronic devices simultaneously perform both NFC and FF communication, it's called multi-channel communication. When a multi-channel communication message reaches the receiving electronic device, the receiving device may process it incorrectly, causing new messages to be overwritten by older ones. This creates a timing issue with cross-device data processing.
[0004] On the other hand, if either the electronic device receiving the message or the electronic device sending the message is in a scenario of network delay or processing network delay, confusion may occur during the message transmission process, resulting in the earlier sent message arriving later and the later sent message arriving first, that is, a cross-device data processing timing problem occurs. Summary of the Invention
[0005] The purpose of this application is to provide a data processing system, method, electronic device and medium that can solve the timing problem of cross-device data processing.
[0006] In the first aspect, the present application discloses a data processing system, which includes: a first electronic device and a second electronic device. The first electronic device and the second electronic device can be electronic devices such as mobile phones, PADs, and large screens. Among them, the first electronic device is used to send an attribute instruction to the second electronic device, and the attribute instruction includes a version identifier and an attribute value. The second electronic device is used to compare the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result. If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, the version identifier and attribute value in the local cache attribute are updated to the version identifier and attribute value in the attribute instruction. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, which solves the timing problem of cross-device data processing.
[0007] In some possible implementations, the above-mentioned data processing system also includes: a device cloud. A first electronic device is used to send attribute instructions to the device cloud; the device cloud is used to send attribute instructions to a second electronic device. Therefore, after the attribute of the first electronic device changes, the first electronic device assembles an attribute instruction, which includes a version identifier and an attribute value, and the first electronic device sends the attribute instruction to the device cloud, and the device cloud then sends the attribute instruction to the second electronic device. The second electronic device compares the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result. If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, the version identifier and attribute value in the local cache attribute are updated to the version identifier and attribute value in the attribute instruction. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, which solves the timing problem of cross-device data processing.
[0008] In the second aspect, the present application discloses a data processing system, which includes: a first electronic device, a device cloud, and a second electronic device. The first electronic device and the second electronic device can be electronic devices such as mobile phones, PADs, and large screens. The first electronic device is used to send an attribute instruction to the device cloud, and the attribute instruction includes a version identifier and an attribute value; the device cloud is used to compare the version identifier in the attribute instruction with the version identifier in the cloud cache attribute of the device cloud to obtain a comparison result. If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the cloud cache attribute of the device cloud, the version identifier and attribute value in the cloud cache attribute of the device cloud are updated to the version identifier and attribute value in the attribute instruction; the version identifier and attribute value in the updated cloud cache attribute of the device cloud are sent to the second electronic device; the second electronic device is used to update the version identifier and attribute value in the local cache attribute of the second electronic device to the version identifier and attribute value in the updated cloud cache attribute of the device cloud. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, which solves the timing problem of cross-device data processing.
[0009] In a third aspect, the present application discloses a data processing method, which is applied to a second electronic device. The method includes: receiving an attribute instruction sent by a first electronic device, the attribute instruction including a version identifier and an attribute value; comparing the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result; if the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, then updating the version identifier and attribute value in the local cache attribute to the version identifier and attribute value in the attribute instruction. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, solving the problem of cross-device data processing timing.
[0010] In some possible implementations, comparing the version identifier in the attribute instruction with the version identifier in the local cache attribute includes: determining whether the version identifier in the attribute instruction is 0; if the version identifier in the attribute instruction is not 0, comparing the version identifier in the attribute instruction with the version identifier in the local cache attribute.
[0011] In some possible implementations, the method further includes: if the version identifier in the attribute instruction is 0, setting the version identifier and attribute value in the attribute instruction to the version identifier and attribute value in the local cache attribute.
[0012] In some possible implementations, comparing the version identifier in the attribute instruction with the version identifier in the local cache attribute includes: determining whether the version identifier and attribute value in the local cache attribute exist; if the version identifier and attribute value in the local cache attribute exist, comparing the version identifier in the attribute instruction with the version identifier in the local cache attribute.
[0013] In some possible implementations, the method further includes: if the version identifier and attribute value in the local cache attribute do not exist, setting the version identifier and attribute value in the attribute instruction to the version identifier and attribute value in the local cache attribute.
[0014] In some possible implementations, the attribute instruction includes a device deregistration instruction; and updating the version identifier and attribute value in the locally cached attribute to the version identifier and attribute value in the attribute instruction includes: deleting the version identifier in the locally cached attribute and updating the attribute value to a default attribute value. Thus, even in a scenario where the first electronic device is deregistered, cross-device data processing can be completed.
[0015] In some possible implementations, the attribute instruction includes a device re-registration instruction; and updating the version identifier and attribute value in the locally cached attribute to the version identifier and attribute value in the attribute instruction includes: updating the version identifier in the locally cached attribute to 0 and updating the attribute value to a default attribute value. Thus, even in a scenario where the first electronic device re-registers with the device cloud, cross-device data processing can be completed.
[0016] Fourthly, the present application discloses a data processing method, which is applied to a device cloud. The method includes: receiving an attribute instruction sent by a first electronic device, the attribute instruction including a version identifier and an attribute value; comparing the version identifier in the attribute instruction with the version identifier in the cloud cache attribute to obtain a comparison result; if the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the cloud cache attribute, then updating the version identifier and attribute value in the cloud cache attribute to the version identifier and attribute value in the attribute instruction; and sending the updated version identifier and attribute value in the cloud cache attribute to a second electronic device. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, solving the problem of cross-device data processing timing.
[0017] In a fifth aspect, the present application discloses an electronic device comprising a processor and a memory; the memory is used to store computer execution commands; the processor is used to execute the computer execution commands stored in the memory, so that the processor executes the methods in the third and fourth aspects.
[0018] In a sixth aspect, the present application discloses a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the third aspect and the fourth aspect is implemented.
[0019] In a seventh aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the methods in the third and fourth aspects.
[0020] Compared with the existing technology, this application has the following beneficial effects:
[0021] The embodiments of the present application provide a data processing system, method, electronic device, and medium. After the attribute of a first electronic device changes, the first electronic device assembles an attribute instruction, which includes a version identifier and an attribute value, and the first electronic device sends the attribute instruction to a second electronic device. The second electronic device compares the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result. If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, the version identifier and attribute value in the local cache attribute are updated to the version identifier and attribute value in the attribute instruction. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, solving the problem of cross-device data processing timing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1A A schematic diagram of data transmission provided in an embodiment of the present application;
[0023] Figure 1B A schematic diagram of another data transmission provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0025] Figure 3 A flow chart of a data processing method provided in an embodiment of the present application;
[0026] Figure 4 An overall logic diagram of data processing provided by an embodiment of the present application;
[0027] Figure 5A schematic diagram of a property change of a first electronic device provided in an embodiment of the present application;
[0028] Figure 6 A schematic diagram of another first electronic device property change provided in an embodiment of the present application;
[0029] Figure 7 Another overall logic diagram of data processing provided by an embodiment of the present application;
[0030] Figure 8 A flowchart of a method for obtaining the latest reportID provided in an embodiment of the present application;
[0031] Figure 9 The overall logic diagram of the third data processing provided in the embodiment of the present application;
[0032] Figure 10 This is an overall logic diagram of the fourth type of data processing provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The terms "first", "second" and "third" in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0034] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0035] As the mobility and connectivity of electronic devices become increasingly powerful, users can transfer and synchronize data between multiple electronic devices, which is called multi-device collaboration. Multi-device collaboration is a technology applied between multiple electronic devices. Using multi-device collaboration technology, two or more electronic devices can collaborate across systems and devices to achieve resource sharing and collaborative operation. For example, electronic devices can use multi-device collaboration technology based on the HyperTerminal service to achieve the following functions:
[0036] Screen casting: Projecting the content (e.g., videos, photos, etc.) on the screen of a first electronic device to the screen of a second electronic device for display. When casting, users can select part or all of the content on the screen of the first electronic device to be projected to the screen of the second electronic device for display. Some screen casting methods also allow users to switch the screen to other pages during casting without affecting the second electronic device from continuing to play the casted content, such as DLNA casting.
[0037] Screen mirroring: Mirrors all the content on the screen of a first electronic device to the screen of a second electronic device. The content displayed on the second electronic device is the same as the content displayed on the first electronic device, and changes as the content displayed on the first electronic device changes.
[0038] Screen extension: Use the screen of the second electronic device as the secondary screen of the first electronic device. The first electronic device can transfer part of the content it needs to display to the secondary screen for display. The screen of the first electronic device and the screen of the second electronic device can display content together, expanding the display capability of the first electronic device.
[0039] Screen sharing: Projecting the user interface of a first electronic device onto the screen of a second electronic device for display, allowing the user to operate the user interface of the first electronic device on the second electronic device, and transferring files from the second electronic device to the first electronic device by performing specific operations on the second electronic device (for example, dragging and dropping files from the user interface of the second electronic device to the user interface of the first electronic device), thereby enabling cross-device operations and cross-device file transfers between the first and second electronic devices. The user interface of the first electronic device can be displayed in any area of the screen of the second electronic device, or it can be displayed in full screen.
[0040] Keyboard and mouse collaboration: A first electronic device can share the input devices of a second electronic device. For example, if the first electronic device is an Android device and the second electronic device is a Windows device, the Android device can share the Windows device's input devices, such as a mouse and keyboard. In addition, with keyboard and mouse sharing, the first and second electronic devices can also transfer files.
[0041] Continuation collaboration: When a user runs an application on a first electronic device, the interface of a second electronic device may prompt the user to open the application currently running on the first electronic device on the second electronic device, thereby transferring the user to the second electronic device for continued operation, such as watching a video, editing a document, etc. For example: a document application, such as a memo or word, is running on the first electronic device, and the user is editing a document on the first electronic device. When the second electronic device is close to the first electronic device, a prompt message is displayed on the second electronic device, and the user clicks the prompt message on the second electronic device. In response to the user's click, the second electronic device opens the document application and displays the location where the user is editing, thereby transferring the user to the second electronic device to continue editing, etc.
[0042] Call collaboration: When the first electronic device receives an incoming voice call or video call, the second electronic device can simultaneously display the incoming call interface, so that the user can choose to answer or hang up the call on the second electronic device.
[0043] Notification collaboration: When a first electronic device receives a notification message, the notification message can be synchronously displayed on a second electronic device, and the user can also perform operations such as reply, delete, and read the notification message on the second electronic device.
[0044] It is understood that the first electronic device in the above description can also be referred to as the master device, which refers to the side that initiates status message synchronization. The second electronic device can also be referred to as the slave device, which refers to the side that receives status message synchronization. For ease of understanding, the electronic device that initiates status message synchronization is referred to as the first electronic device, and the electronic device that receives status message synchronization is referred to as the second electronic device.
[0045] The above functions can be achieved through near-field communication, far-field communication or multi-channel communication. Near-field communication refers to communication between multiple electronic devices through short-range methods such as WIFI or Bluetooth, and far-field communication refers to communication between multiple electronic devices through forwarding through the device cloud. When two electronic devices perform near-field communication and far-field communication at the same time, it is called multi-channel communication. When the multi-channel communication message reaches the electronic device that receives the message, the electronic device that receives the message may make an error when processing the multi-channel communication message, causing the new message to be overwritten by the old message, that is, a cross-device data processing timing problem occurs.
[0046] See also Figure 1A , which is a schematic diagram of a data transmission provided by an embodiment of the present application. The data transmission process is applied to the service scenario of a super terminal or the service scenario of a southbound device. Taking the super terminal service scenario as an example, Figure 1AAs shown, the first electronic device first communicates via a short-range method such as Bluetooth or WIFI based on near-field communication, and transmits a message of state 1 to the second electronic device. Wherein, the state refers to the service state of the electronic device (i.e., service support capability, such as whether it supports connection, incoming calls, notifications, keyboard and mouse, collaboration, sharing, screen projection and other services). In a very short period of time, the first electronic device changes state 1 to state 2, and communicates via the device cloud method based on far-field communication, and transmits a message of state 2 to the second electronic device. Wherein, state 1 and state 2 are two different states. For example, state 1 may support connection and state 2 may not support connection. At this time, the final state of the first electronic device is state 2, and the second electronic device receives the messages of state 1 and state 2 in a very short time through both near-field and far-field methods. Therefore, the second electronic device needs to merge or invalidate the messages of the near-field and far-field methods. If an error occurs when the second electronic device merges or invalidates the message, the new data will be overwritten by the old data, that is, the final state of the second electronic device is state 1, resulting in the emergence of cross-device data processing timing problems.
[0047] On the other hand, if either the electronic device receiving the message or the electronic device sending the message is in a scenario of network delay or processing network delay, confusion may occur during the message transmission process, resulting in the earlier sent message arriving later and the later sent message arriving first, that is, a cross-device data processing timing problem occurs.
[0048] See also Figure 1B , which is a schematic diagram of another data transmission provided by an embodiment of the present application. The data transmission process is also applicable to the service scenario of the super terminal or the service scenario of the southbound device. Taking the super terminal service scenario as an example, Figure 1B As shown, the first electronic device first sends a message in state 1 to the second electronic device via the device cloud, then the first electronic device changes state 1 to state 2, and again sends a message in state 2 to the second electronic device via the device cloud. At this point, the final state of the first electronic device is state 2. However, because the second electronic device is in a scenario of network delay or processing network delay, the second electronic device first receives a message in state 2, and then receives a message in state 1, resulting in the final state of the second electronic device being state 1, which is inconsistent with the final state of the first electronic device being state 2, thereby also leading to the emergence of cross-device data processing timing issues.
[0049] In view of this, the embodiments of the present application provide a data processing system, method, electronic device and medium. After the attributes of the first electronic device (such as whether it supports the capability attributes of services such as connection, incoming calls, notifications, keyboard and mouse, collaboration, sharing, and screen projection) change, the first electronic device assembles an attribute instruction, which includes a version identifier and an attribute value, and the first electronic device sends the attribute instruction to the second electronic device. The second electronic device compares the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result. If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, the version identifier and attribute value in the local cache attribute are updated to the version identifier and attribute value in the attribute instruction. Thus, subsequent processing is performed based on the attribute value corresponding to the latest version identifier, which solves the timing problem of cross-device data processing.
[0050] First, an exemplary electronic device 100 provided in an embodiment of the present application is introduced. The electronic device 100 can be used as both a master device and a slave device in multi-device collaboration. In some embodiments, the electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100. See Figure 2 , which is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0051] like Figure 2 As shown, the electronic device 100 may include a processor 210, an internal memory 220, an antenna 1, an antenna 2, a mobile communication module 230, a wireless communication module 240, a display screen 250, and the like.
[0052] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0053] The processor 210 may include one or more processing units, for example: the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, 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 can be independent devices or integrated into one or more processors. For example, in the present application, the processor 210 of the second electronic device can receive an attribute instruction sent by the first electronic device, and the attribute instruction includes a version identifier and an attribute value; compare the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result; if the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, the version identifier and attribute value in the local cache attribute are updated to the version identifier and attribute value in the attribute instruction.
[0054] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction operation codes and timing signals to complete the control of instruction fetching and execution.
[0055] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.
[0056] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may 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.
[0057] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C busses. The processor 210 may be coupled to touch sensors, etc., through different I2C bus interfaces.
[0058] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 210 and the wireless communication module 240.
[0059] The MIPI interface can be used to connect the processor 210 to peripheral devices such as the display screen 250. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 210 and the camera communicate via the CSI interface to implement the shooting function of the electronic device. The processor 210 and the display screen 250 communicate via the DSI interface to implement the display function of the electronic device. For example, based on the display function, the electronic device can display a related interface.
[0060] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 to a camera, display 250, wireless communication module 240, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0061] It is understood that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0062] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 230, wireless communication module 240, modem processor and baseband processor.
[0063] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0064] The mobile communication module 230 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to electronic devices. The mobile communication module 230 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 230 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 230 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 230 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 230 can be set in the same device as at least some of the modules of the processor 210.
[0065] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor displays images or videos via the display screen 250. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be provided in the same device as the mobile communication module 230 or other functional modules.
[0066] The wireless communication module 240 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 240 can be one or more devices that integrate at least one communication processing module. The wireless communication module 240 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 240 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0067] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 230, and antenna 2 is coupled to wireless communication module 240, so that the electronic device can communicate with a network and other devices via 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. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a BeiDou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite-based augmentation system (SBAS).
[0068] In some examples, based on the wireless communication technology of the electronic device, the electronic device can download the corresponding file from the cloud.
[0069] The electronic device implements its display functionality through a GPU, display screen 250, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 250 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0070] Display screen 250 is used to display images, videos, and the like. Display screen 250 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, or a quantum dot light-emitting diode (QLED). In some embodiments, the electronic device can include one or N display screens 250, where N is a positive integer greater than one.
[0071] A series of graphical user interfaces (GUIs) can be displayed on the display screen 250 of the electronic device, and these GUIs are the main screens of the electronic device. Generally speaking, the size of the display screen 250 of the electronic device is fixed, and only limited controls can be displayed on the display screen 250 of the electronic device. A control is a GUI element, which is a software component included in an application that controls all data processed by the application and interactive operations on this data. Users can interact with the controls through direct manipulation to read or edit relevant information of the application. Generally speaking, controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. In some examples, when the functions supported by the electronic device are different, the functional controls displayed by the electronic device will be different.
[0072] The internal memory 220 can be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 220. The internal memory 220 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 220 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 220, and / or the instructions stored in the memory provided in the processor.
[0073] See also Figure 3 , which is a flow chart of a data processing method provided by an embodiment of the present application, and is applied to the side receiving the status message synchronization, that is, to the second electronic device. The method includes:
[0074] S301: The second electronic device determines whether the reportID in the attribute instruction is 0, and if so, executes S302; otherwise, executes S303.
[0075] An attribute instruction refers to an instruction sent by a first electronic device to a second electronic device that can characterize the existing attributes of the first electronic device. The attribute instruction includes one or more version identifiers and attribute values, where the version identifier can be a version number or a version ID. This application names the version identifier reportID. The reportID can be a string of numbers. As the attributes of the first electronic device change, the number of the reportID will continue to increase, that is, the larger the number of the reportID, the newer the attribute. The attribute value may include whether the capability attributes of services such as connection, incoming calls, notifications, keyboard and mouse, collaboration, sharing, and screen projection are supported.
[0076] After the second electronic device receives the attribute instruction sent by the first electronic device, it first needs to determine whether the reportID in the attribute instruction is 0. If so, it executes step S302; otherwise, it executes step S303. In some specific implementations, the reason why the reportID is 0 may be: the second electronic device has not previously received the reportID, or the reportID of the first electronic device has been lost, causing the reportID to be counted again from 0.
[0077] It should be noted that the version identifier in the attribute instruction may also be an empty identifier, that is, the reportID does not contain any numbers. In some specific implementations, the reason why the version identifier is an empty identifier may be that the first electronic device is a lower-end or older device that does not support version identifiers. Therefore, although the first electronic device sends an attribute instruction to the second electronic device, the first electronic device is an older device and does not support version identifiers in the attribute instruction it sends. In this case, the version identifier in the attribute instruction is an empty identifier, and step S302 is also executed.
[0078] S302: The second electronic device sets the reportID and attribute value in the attribute instruction to the reportID and attribute value in the local cache attribute.
[0079] If the version identifier reportID in the attribute instruction is 0, then the second electronic device will directly update all the attributes in the attribute instruction received from the electronic device that initiated the status message synchronization (that is, the first electronic device) to the local cache attributes of the second electronic device, that is, the version identifier and attribute value in the attribute instruction are set to the version identifier and attribute value in the local cache attribute. At this time, the reportID in the local cache attribute of the second electronic device is the reportID in the attribute instruction sent by the first electronic device, that is, 0.
[0080] It should be noted that if the version identifier in the attribute instruction is an empty identifier, the second electronic device will also update all attributes in the attribute instruction received from the first electronic device to the local cache attributes of the second electronic device, that is, set the version identifier and attribute value in the attribute instruction to the version identifier and attribute value in the local cache attributes.
[0081] S303: The second electronic device determines whether there is an attribute in the attribute instruction that requires subsequent data processing, and if so, executes S304.
[0082] The second electronic device searches the received attribute instruction to determine whether any attribute has changed and thus requires subsequent data processing. If the attribute instruction contains an attribute that requires subsequent data processing, step S304 is executed. If the attribute instruction does not contain an attribute that requires subsequent data processing, the second electronic device may determine that the received attribute instruction is an empty instruction and directly terminate the subsequent steps, i.e., discard the attribute instruction.
[0083] S304: The second electronic device obtains the attribute D1 in the attribute instruction and the reportID corresponding to D1.
[0084] Attribute D1 represents an attribute value in the attribute instruction, and attribute D1 has a corresponding reportID. The second electronic device can sequentially compare attribute D1 in the attribute instruction and its corresponding reportID with attribute TD in the local cache attributes of the second electronic device and its corresponding reportID to determine whether the attribute value in the local cache attributes of the second electronic device needs to be updated.
[0085] S305: The second electronic device obtains the local cache attribute TD and the reportID corresponding to the TD.
[0086] The second electronic device can obtain an attribute TD corresponding to attribute D1 from the local cache attributes. This attribute TD and attribute D1 in the attribute instruction can represent the same type of attribute. For example, attribute TD indicates that the screen sharing function is not supported, while attribute D1 indicates that the screen sharing function is supported. Furthermore, the second electronic device can obtain a reportID for this attribute TD based on this attribute TD.
[0087] In some specific implementations, although attribute TD may exist in the local cache attributes of the second electronic device, the attribute TD is an empty attribute. In one possible implementation, the reason why attribute TD is an empty attribute may be that the second electronic device supports the version identification method, but has not completed the setting of attribute TD, that is, attribute TD is still the factory setting, so the attribute TD is an empty attribute, and the reportID corresponding to the attribute TD cannot be obtained, and further, the reportID corresponding to attribute D1 in the attribute instruction and the reportID corresponding to attribute TD in the local cache attributes of the second electronic device cannot be compared. Therefore, the operation of S306 is performed, that is, it is determined whether attribute TD exists.
[0088] S306: The second electronic device determines whether the attribute TD exists, and if not, executes S307; if so, executes S308.
[0089] The second electronic device can determine whether attribute TD in the local cache of the second electronic device is an empty attribute by determining whether attribute TD exists. If attribute TD does not exist, it indicates that attribute TD in the local cache of the second electronic device is an empty attribute, and step S307 can be executed. If attribute TD exists, it indicates that attribute TD in the local cache of the second electronic device is not an empty attribute, and step S308 can be executed.
[0090] S307: The second electronic device saves the attribute D1 and the corresponding reportID to a cache.
[0091] If attribute TD does not exist, it means that attribute TD in the local cache attribute of the second electronic device is an empty attribute. The second electronic device can directly save attribute D1 and the corresponding reportID to the cache, that is, set attribute D1 and the corresponding reportID in the attribute instruction to the attribute value and reportID in the local cache attribute, thereby completing the data processing logic after receiving the data.
[0092] It should be noted that, since the attribute instruction may include one or more sets of version identifiers reportID and attribute values, if there are multiple sets of version identifiers reportID and attribute values in the attribute instruction, after completing step S307, that is, saving the attribute D1 and the corresponding reportID to the cache, the operation of step S303 can be executed again, that is, continue to determine whether there are any attribute changes in the attribute instruction that require subsequent data processing.
[0093] S308: The second electronic device determines whether the reportID corresponding to D1 is newer than the reportID corresponding to TD. If so, execute S309; otherwise, execute S303.
[0094] The second electronic device can obtain a comparison result by comparing the reportID corresponding to attribute D1 in the attribute instruction with the reportID corresponding to attribute TD. If the comparison result indicates that the reportID corresponding to attribute D1 is later than the reportID corresponding to attribute TD, the second electronic device updates attribute TD and the reportID corresponding to attribute TD to attribute D1 and the reportID corresponding to attribute D1, i.e., executes step S309. Otherwise, it means that the attributes in the attribute instruction have not been updated. In this case, after discarding attribute D1 and its corresponding reportID in the attribute instruction, step S303 can be executed again, i.e., continuing to determine whether there are any attribute changes in the attribute instruction that require subsequent data processing.
[0095] In some specific implementations, reportID can be a string of numbers, where a larger reportID indicates a newer attribute D1. If the reportID corresponding to attribute TD is smaller than the reportID corresponding to attribute D1 in the attribute instruction, this indicates that the attribute in the attribute instruction has been updated, and the attribute and its corresponding reportID in the attribute instruction need to be saved. If the reportID corresponding to attribute TD is larger than the reportID corresponding to attribute D1 in the attribute instruction, this indicates that the attribute in the attribute instruction has not been updated, and the attribute and its corresponding reportID in the attribute instruction need to be discarded.
[0096] In other specific implementations, if the reportID corresponding to attribute TD is less than the reportID corresponding to attribute D1 in the attribute instruction, and if the reportID corresponding to attribute D1 in the attribute instruction minus the reportID corresponding to attribute TD is greater than 2147483647, then the attribute in the attribute instruction has been updated and the attribute in the attribute instruction and its corresponding reportID need to be saved. Otherwise, it can be said that the attribute in the attribute instruction has not been updated and the attribute in the attribute instruction and its corresponding reportID need to be discarded. It should be noted that 2147483647 is set by those skilled in the art and can be other values, which is not limited by this application.
[0097] It is understandable that there are other methods for comparing the reportID corresponding to the attribute D1 in the attribute instruction with the reportID corresponding to the attribute TD, which is not limited in this application.
[0098] S309: The second electronic device updates the value of TD to D1, and updates the reportID corresponding to TD to the reportID corresponding to D1.
[0099] If the reportID corresponding to attribute D1 is later than the reportID corresponding to attribute TD, attribute TD needs to be updated to attribute D1 in the attribute instruction, and accordingly, the version identifier reportID corresponding to attribute TD needs to be updated to the version identifier reportID corresponding to attribute D1. At this point, the attribute stored in the second electronic device is attribute D1 in the attribute instruction sent by the first electronic device.
[0100] It should be noted that the above steps can not only be applied to the second electronic device side, but also when the first electronic device and the second electronic device are based on a multi-channel communication method, transmitting data both through near-field transmission and far-field transmission through the device cloud, the method can also be applied to the device cloud side, that is, through this method, the attribute saved in the cloud cache attribute of the device cloud is the attribute D1 in the new attribute instruction sent by the first electronic device.
[0101] This application discloses a data processing method in which a second electronic device compares a version identifier in an attribute instruction with a version identifier in a locally cached attribute to obtain a comparison result. If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the locally cached attribute, the version identifier and attribute value in the locally cached attribute are updated to the version identifier and attribute value in the attribute instruction. This allows subsequent processing to be performed based on the attribute value corresponding to the latest version identifier, resolving the timing issue of cross-device data processing.
[0102] See also Figure 4, this figure is an overall logic diagram of data processing provided by an embodiment of the present application, which is applied to data change scenarios during multi-channel communication.
[0103] S401: The first electronic device loads a report ID.
[0104] Regardless of whether the electronic device communicates via near field communication, far field communication or multi-channel communication, the status message that needs to be synchronized sent down carries the version identifier reportID.
[0105] First, the first electronic device needs to load the version identifier reportID so that after the attributes of the first electronic device change, the attribute instruction sent by the first electronic device will carry the version identifier reportID. It can be understood that the attribute refers to whether the first electronic device supports the attributes of services such as connection, incoming calls, notifications, keyboard and mouse, collaboration, sharing, and screen projection. For example, the attribute change can be that the first electronic device changes from the attribute of not supporting connection to the attribute of supporting connection services.
[0106] S402: The first electronic device registers with the device cloud.
[0107] Device Cloud, as a cloud platform for service apps, provides infrastructure for transmission, storage, and presentation. Service apps are apps on electronic devices that provide specific capabilities, such as Android installation packages (APKs) for applications like Super Terminal, Super Call, and Sharing.
[0108] The first electronic device and the second electronic device can both register with the device cloud to propagate messages based on near field communication, far field communication, or multi-channel communication methods.
[0109] S403: The second electronic device registers with the device cloud.
[0110] S404: The second electronic device service APP is started.
[0111] S405: The second electronic device subscribes to device attribute changes.
[0112] The second electronic device sends an instruction to subscribe to device attribute changes to the device cloud, so that when the device cloud receives the attribute instruction sent by the first electronic device, the device cloud can send the above attribute instruction to the second electronic device, so that the second electronic device can obtain the attribute changes of the first electronic device, thereby realizing multi-device collaboration.
[0113] S406: The attributes of the first electronic device change.
[0114] In response to a user's operating instruction or a system upgrade of the first electronic device, the properties of the first electronic device may change.
[0115] For some specific implementations, see Figure 5 , which is a schematic diagram of a property change of a first electronic device provided by an embodiment of the present application. Figure 5 It can be seen from the existing collaborative attribute window 502 that the existing collaborative attribute of the first electronic device is not supported. When the user modifies the existing collaborative attribute in the change collaborative attribute window 500, that is, after the user clicks the support plug-in 501, the display content in the existing collaborative attribute window 502 of the first electronic device will also change accordingly from the existing collaborative attribute is not supported to the existing collaborative attribute is supported.
[0116] For other specific implementations, see Figure 6 , which is a schematic diagram of another first electronic device property change provided by an embodiment of the present application. Figure 6 The existing connection attribute window 602 in the system shows that the existing connection attribute of the first electronic device is not supported. When the user upgrades the existing system in the system upgrade window 600, that is, after the user clicks the plug-in 601, the display content in the existing connection attribute window 602 of the first electronic device will also change from the existing connection attribute not supported to the existing connection attribute supported. It is understandable that the system upgrade can also be an automatic upgrade of the first electronic device.
[0117] It should be noted that there are other operations that can change the properties of the first electronic device, and this application does not limit the specific operation methods.
[0118] S407: First electronic device assembly attribute instruction.
[0119] After the properties of the first electronic device change, the first electronic device assembles a property instruction. This property instruction carries a version identifier, reportID, and properties, which are represented by attribute values. The reportID can be a string of numbers. As the properties of the first electronic device change, the reportID number increases, meaning that a larger reportID number indicates newer properties.
[0120] S408: The first electronic device sends an attribute instruction.
[0121] The first electronic device sends the attribute instruction assembled in step S407 to the device cloud. The attribute instruction carries the version identifier reportID and the attribute value.
[0122] S409: The device cloud sends the attribute instruction to the second electronic device.
[0123] Since the second electronic device sent an instruction to subscribe to device attribute changes to the device cloud, thereby subscribing to the device attribute change service, after the first electronic device sent the attribute instruction to the device cloud, the device cloud will send the attribute instruction sent by the first electronic device to the second electronic device. The attribute instruction also carries the version identifier reportID and attribute value.
[0124] S410: The second electronic device receives the attribute instruction and executes the merging logic.
[0125] After the second electronic device obtains the attribute value and version identifier reportID of the first electronic device forwarded by the device cloud, the second electronic device will Figure 3 The process shown in completes the data processing logic and will not be repeated here.
[0126] S411: The device cloud receives the attribute instruction and executes the merging logic.
[0127] After the device cloud obtains the attribute value of the first electronic device and its version identifier reportID, the device cloud will also Figure 3 The process shown in completes the data processing logic.
[0128] It should be noted that, in actual execution, there is no particular order in which the second electronic device receives the attribute instruction and executes the data processing logic in step S410 and the device cloud receives the attribute instruction and executes the data processing logic in step S411.
[0129] It can be understood that in addition to the above-mentioned method in which the device cloud and the second electronic device simultaneously receive attribute instructions and execute the merging logic, the device cloud can also first receive the attribute instruction and then execute the merging logic, and then send the merged result to the second electronic device, that is, after the device cloud receives the attribute instruction sent by the first electronic device, it compares the version identifier in the attribute instruction with the version identifier in the cloud cache attribute of the device cloud to obtain a comparison result; if the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the cloud cache attribute, the device cloud updates the version identifier and attribute value in the cloud cache attribute to the version identifier and attribute value in the attribute instruction, and sends the updated version identifier and attribute value in the cloud cache attribute to the second electronic device.
[0130] The present application provides a data processing method, in which after the attributes of a first electronic device change, the first electronic device assembles an attribute instruction, the attribute instruction including a version identifier and an attribute value, and the first electronic device sends the attribute instruction to a device cloud. The device cloud responds to an instruction from a second electronic device to subscribe to the device attribute change, and after sending the attribute instruction to the second electronic device, both the device cloud and the second electronic device perform data processing, that is, save the latest version identifier and attribute value to the local cache attributes of the device cloud and the second electronic device. Thus, the device cloud and the second electronic device solve the cross-device data processing timing problem by comparing the version identifier in the attribute instruction sent by the first electronic device with the version identifier corresponding to the local cache attributes of the device cloud and the second electronic device.
[0131] See also Figure 7 , this figure is an overall logic diagram of another data processing provided by an embodiment of the present application, which is applied to the attribute acquisition scenario of near field communication.
[0132] S701: The second electronic device sends an acquisition instruction.
[0133] If the first electronic device and the second electronic device perform near field communication via Bluetooth or other means, the second electronic device can directly send an instruction to obtain the device attributes of the first electronic device, ie, an acquisition instruction, to the first electronic device, thereby directly obtaining the attributes of the first electronic device.
[0134] S702: First electronic device assembly attribute instruction.
[0135] After the first electronic device receives the acquisition instruction sent by the second electronic device, it assembles an attribute instruction. This attribute instruction carries a version identifier, reportID, and an attribute, which is represented by an attribute value. The reportID can be a string of numbers. As the attributes of the first electronic device change, the reportID number will also increase. That is, a larger reportID number indicates a newer attribute.
[0136] S703: The second electronic device obtains the attribute instruction and executes the merging logic.
[0137] Since the second electronic device sends the acquisition instruction to the first electronic device, the second electronic device can acquire the attribute instruction after the first electronic device assembles the attribute instruction, and the attribute instruction carries the reportID and the attribute value.
[0138] After the second electronic device obtains the reportID and attribute value of the first electronic device, the second electronic device will Figure 3 The process shown in completes the data processing logic and will not be repeated here.
[0139] This application provides a data processing method in which a first electronic device assembles an attribute instruction in response to an acquisition instruction issued by a second electronic device to the first electronic device. After the second electronic device acquires the attribute instruction of the first electronic device, the second electronic device saves the latest version identifier and attribute value to the local cache attribute of the second electronic device based on data processing logic. Thus, the second electronic device solves the cross-device data processing timing problem by comparing the version identifier in the attribute instruction with the version identifier corresponding to the local cache attribute of the second electronic device.
[0140] In some possible implementations, the reportID is a string of numbers, and the version number will continue to increase as the properties of the first electronic device change. It should be noted that the reportID update can be based on user operation instructions or based on automatic system upgrades of the first electronic device. This application does not limit the specific update method.
[0141] See also Figure 8 This figure is a flow chart of a method for obtaining the latest reportID provided by an embodiment of the present application, which is applied to the side that initiates status message synchronization, that is, to the first electronic device. The method includes:
[0142] S801: The first electronic device determines whether reportID(A) exists in the memory, and if not, executes S802; if so, executes S803.
[0143] In this application, the version identifier is named reportID, and reportID(A) is the reportID in the memory. ReportID(A) increases as the properties of the first electronic device change. For example, if the version number reportID is updated to 20, then reportID(A) is 20. As the properties of the first electronic device change, the version number reportID is updated to 50, then reportID(A) is 50.
[0144] Regardless of whether the first electronic device communicates through near-field communication, far-field communication, or multi-channel communication, the attribute instructions that need to be synchronized carry reportID in the instructions, so as to achieve the effect of attribute reporting, event reporting, or method response. When the first electronic device is started, the first electronic device determines whether reportID(A) exists in the memory by reading the version identification reportID(A) in the memory. In one possible implementation, the reason why reportID(A) does not exist may be that although the first electronic device supports the version identification method, it has not completed the setting of the attribute, so reportID(A) does not exist. Therefore, if the electronic device cannot read the reportID(A) in the memory, it means that the reportID(A) in the memory does not exist, and it is necessary to make reportID(A) exist, that is, execute step S802; if the electronic device can read the reportID(A) in the memory, it means that the reportID(A) in the memory exists, and execute step S803.
[0145] S802: The first electronic device writes reportID(B)=1000 into the cache.
[0146] reportID(B) refers to the upper limit of the reportID count available in the current cache. For example, as the properties of the first electronic device change, the reportID number will continue to increase. If reportID(B) = 100 and reportID(A) = 20, then the subsequent reportID number can only increase from 20 to 100. If reportID(B) = 1000 and reportID(A) = 20, then the subsequent reportID number can only increase from 20 to 1000.
[0147] If the first electronic device cannot read reportID(A) from memory, it indicates that reportID(A) does not exist in memory, meaning that the memory has never stored reportID. Therefore, reportID(A) must be present so that the attribute instruction issued by the first electronic device can carry the reportID. Therefore, it is necessary to set an upper limit on the version number available in memory, namely, reportID(B), so that reportID(A) can be counted starting from 1, thus assigning the first electronic device a version identifier, reportID.
[0148] In some specific implementations, reportID(B)=1000 can be written to the cache, i.e., the upper limit of the current cache available is set to 1000. After reportID(B)=1000 is written to the cache, since there is no reportID(A) in the memory at this time, reportID(A) can be counted starting from 1, i.e., reportID(A)=1 in the memory.
[0149] It should be noted that this application only takes reportID(B)=1000 as an example. In actual use, reportID(B) can also be set to 2000, 5000, etc. This application does not limit the specific reportID(B).
[0150] S803: The first electronic device writes reportID(B)+=1000 into the cache.
[0151] reportID(B)+=1000 means reportID(B)=reportID(B)+1000, which is an operation of adding 1000 to the original reportID(B), that is, adding 1000 to the upper limit of the current cache. For example, if reportID(B)=100 before executing step S803, then reportID(B)=1100 after executing step S803. The purpose of doing this is: since the first electronic device determines that reportID(A) exists in the memory, that is, the version identifier has been saved in the memory, then since the version identifier can be updated based on the user's operating instructions and the automatic upgrade of the system of the first electronic device, the side that initiates the status message synchronization, that is, the first electronic device, needs to increase the upper limit of the cache available on the basis of the original reportID(B) itself to avoid frequent refresh storage, so that reportID(A) can save more values, that is, the first electronic device can update the attributes more times.
[0152] It is understood that 1000 represents the incremental value written to the persistent storage each time an update is made, and the specific incremental value is not limited in this application. For ease of understanding, the following description will be based on an incremental value of 1000.
[0153] After reportID(B)+=1000 is written into the cache, reportID(A) in the memory becomes reportID(B)-1000, that is, reportID(A) is equal to the original reportID(B) before being increased by 1000.
[0154] S804: The first electronic device maintains reportID (A) in the memory.
[0155] In response to the second electronic device or the device cloud's request to obtain reportID, the first electronic device maintains reportID(A) in memory. Maintaining the reportID in memory avoids the time-consuming and life-shortening issue of adaptively writing to storage every time the value changes. It is understood that if the issue of shortened storage lifespan and time consumption is not a concern, step S804 can be omitted.
[0156] In some specific implementations, the first electronic device maintains in memory the triggered action reportID(A) = reportID(A) + 1, i.e., incrementing the original reportID(A) by 1. This allows adaptive storage only once every two value changes, thereby extending the storage lifespan.
[0157] It is understandable that the value may also be other values, such as 4, etc., that is, it is adaptively written and stored once every five value changes. This application does not limit the specific value.
[0158] S805: The first electronic device sets reportID(C)=reportID(A).
[0159] reportID(C) refers to the reportID used by the second electronic device or device cloud to interact with the first electronic device. The first electronic device assigns the value of reportID(A) after maintenance to reportID(C) and returns reportID(C) to the second electronic device or device cloud. After that, the second electronic device or device cloud can complete the following steps: Figure 3 The operations shown are to execute data processing logic.
[0160] After steps S801-S805, the first electronic device has sent the updated reportID to the second electronic device or the device cloud. However, in preparation for the next reportID to be sent to the second electronic device or the device cloud, the first electronic device still needs to perform S806 and subsequent steps.
[0161] S806: The first electronic device determines whether the reportID (A) after maintenance is greater than 4294967000. If so, the process proceeds to S807; otherwise, the process proceeds to S808.
[0162] 4294967000 represents the upper limit for storing reportIDs, i.e., the first threshold. When reportID(A) reaches the first threshold, the upper limit for storing reportIDs is reached and the reportID count cannot be incremented any further. At this point, the version number must restart from the minimum value of 1, resulting in a rollover. It should be noted that the rollover threshold of 4294967000 is set by those skilled in the art and may be other values. This application does not limit the specific maximum value.
[0163] The first electronic device determines whether the reportID (A) maintained in the memory has reached the rollover critical value 4294967000. If so, the process proceeds to S807; otherwise, the process proceeds to S808.
[0164] It is understandable that in order to avoid the problem of shortened lifespan and time-consuming due to adaptively writing to storage every time the value changes, it is also possible to determine whether the reportID (A) + 1 after maintenance is greater than 4294967000.
[0165] S807: After the first electronic device sets reportID(A)=1 and reportID(B)=0, it executes the operation of S813.
[0166] The reportID(A) in step S807 refers to a new round of reportID(A) that is counted again after the reportID(A) reaches the critical value for inversion and is reversed.
[0167] If the reportID (A) after maintenance is greater than 4294967000, that is, it reaches the rollover threshold, then reportID (A) needs to be rolled over, reportID (A) = 1 again, that is, count starts again, and reportID (B) is updated to 0. Then, the operation of S813 is executed.
[0168] S808: The first electronic device sets reportID(A)=reportID(A)+1, and reportID(B) remains unchanged.
[0169] If reportID(A)+1 is not greater than 4294967000, that is, it has not reached the rollover critical value, then reportID(A)=reportID(A)+1, reportID(B) remains unchanged, that is, reportID(A) continues to count, and the operation of S809 is executed.
[0170] S809: The first electronic device determines whether reportID(B)-reportID(A) is less than 100, and if so, executes S810, and if not, executes S811.
[0171] Since reportID(B) refers to the upper limit of the count available in the current cache, when reportID(B)-reportID(A)<100, i.e., less than the second threshold, it indicates that the count space available in the current cache is very small and the upper limit of the current cache needs to be increased. For example, if reportID(B)=1000 and reportID(A)=901, then the count space available in the current cache is only reportID(B)-reportID(A)=1000-901=99, meaning that reportID(A) is only allowed to change 99 more times. The count space available in the current cache is very small and the upper limit of the current cache needs to be increased.
[0172] It is understandable that the reason for selecting the second threshold of 100 is that 100 is 10% of the 1000 increments written to persistent storage for each update. When reportID(B) - reportID(A) < 100, it is necessary to increase the available space. It should be noted that the second threshold can also be other values, such as 50, 150, etc., and this application does not limit the specific second threshold.
[0173] S810: The first electronic device determines whether reportID(B) is greater than 4294967000. If so, execute S812; otherwise, execute S813.
[0174] After reportID(B) reaches the flipping critical value 4294967000, that is, after reportID(B) reaches the first threshold, the upper limit of the stored reportID is reached, and reportID cannot be increased any further. At this time, reportID(A) also needs to start increasing again from the minimum value 1, so a jump is also involved.
[0175] The first electronic device determines whether the reportID (B) maintained in the memory has reached the rollover critical value 4294967000. If so, S812 is executed; otherwise, S813 is executed.
[0176] It is understandable that, similar to reportID(A), in order to avoid the problem of shortened lifespan and time-consuming due to adaptively writing to storage every time the value changes, it is also possible to determine whether the reportID(B)+1 after maintenance is greater than 4294967000.
[0177] S811: The first electronic device maintains reportID (A) in the memory.
[0178] If the first electronic device determines that reportID(B)-reportID(A) is not less than 100, it means that the first electronic device has a relatively large available counting space in its current cache, so it can continue counting and needs to maintain reportID(A) in the memory.
[0179] In some specific implementations, the first electronic device maintains in memory the triggered action reportID(A) = reportID(A) + 1, i.e., incrementing the original reportID(A) by 1. This allows adaptive storage only once every two value changes, thereby extending the storage lifespan.
[0180] S812: The first electronic device maintains reportID(A)=1, reportID(B)=0 in the memory.
[0181] The first electronic device maintains the triggered action in the memory by setting reportID(A)=1 and reportID(B)=0. That is, reportID(B) is flipped and reportID(A)=1 again, that is, the counting is restarted, and reportID(B) is updated to 0.
[0182] S813: The first electronic device writes reportID(B)+=1000 into the cache.
[0183] reportID(B)+=1000 means reportID(B)=reportID(B)+1000, which is an operation of adding 1000 to reportID(B), that is, adding 1000 to the upper limit of the current cache.
[0184] See also Figure 9 , This figure is an overall logic diagram of the third data processing provided by the embodiment of the present application, which is applied to the re-registration scenario of multi-channel communication. It should be noted that steps S901-S905 are the same as steps S401-S405 and will not be repeated here.
[0185] S901: The first electronic device loads reportID.
[0186] S902: The first electronic device registers with the device cloud.
[0187] S903: The second electronic device registers with the device cloud.
[0188] S904: The second electronic device APP is started.
[0189] S905: The second electronic device subscribes to device attribute changes.
[0190] S906: The first electronic device is restored to factory or the reportID is lost.
[0191] Restoring to factory default means restoring the system of the first electronic device to the factory default state, deleting all user software, and restoring the system data to the default state. At this time, the version identifier reportID is an empty identifier.
[0192] In some specific implementations, if an error occurs in the storage result of the version identifier reportID of the first electronic device, the version identifier reportID may be lost. In other specific implementations, if the first electronic device sets a password when storing the version identifier reportID, but the key is lost or damaged, the reportID may be lost. It should be noted that there are many ways that may cause the version identifier reportID to be lost, and this application does not limit the specific cause of loss.
[0193] S907: The first electronic device re-registers with the device cloud.
[0194] The reportID needs to be persistently stored on the electronic device. When the first electronic device is restored to factory settings or the reportID is lost, the first electronic device needs to re-register with the device cloud. The purpose of persistent storage is to solve the problem that the version identifier reportID returns to 1 after each power outage and restart.
[0195] S908: The device cloud resets the locally stored reportID to 0.
[0196] After the device cloud receives the instruction for the first electronic device to re-register with the device cloud, it triggers the reset of the version identifier reportID stored locally in the device cloud and updates the corresponding attribute value to the default attribute value. The purpose of clearing the version identifier reportID is to avoid the situation where the reportID in the cloud is larger than the reportID of the first electronic device when the first electronic device re-counts, causing the device cloud to consider the reportID sent by the first electronic device to be old data and discard it.
[0197] S909: The device cloud sends a device registration message to the second electronic device.
[0198] Since the second electronic device has subscribed to the device attribute change service from the device cloud, when the first electronic device re-registers with the device cloud, the device cloud will send a device registration message to the second electronic device.
[0199] S910: The second electronic device resets the locally stored reportID to 0.
[0200] After the second electronic device receives the device registration message from the first electronic device, the second electronic device resets the locally stored reportID to 0 and updates the corresponding attribute value to the default attribute value.
[0201] This application provides a data processing method. When a first electronic device is factory-restored or its reportID is lost, the first electronic device sends a device re-registration instruction to the device cloud. In response to the device re-registration instruction, the device cloud resets the locally stored reportID to 0 and sends the device re-registration instruction to a second electronic device, causing the second electronic device to reset the locally stored version identifier reportID to 0. Thus, cross-device data processing can also be completed in the scenario where the first electronic device re-registers with the device cloud.
[0202] See also Figure 10 This figure is an overall logic diagram of the fourth data processing provided by the embodiment of the present application, which is applied to the device cancellation scenario of multi-channel communication. It should be noted that steps S1001-S1005 are the same as steps S401-S405 and will not be repeated here.
[0203] S1001: The first electronic device loads reportID.
[0204] S1002: The first electronic device registers with the device cloud.
[0205] S1003: The second electronic device registers with the device cloud.
[0206] S1004: The second electronic device APP is started.
[0207] S1005: The second electronic device subscribes to changes in device attributes.
[0208] S1006: The first electronic device sends a device deregistration instruction.
[0209] In response to the logout operation of the first electronic device, the first electronic device sends a device logout instruction to the device cloud.
[0210] S1007: The device cloud deletes the device information and reportID.
[0211] After the device cloud receives the device deregistration instruction sent by the first electronic device to the device cloud, the device cloud deletes the device information and version identifier reportID of the first electronic device stored in the device cloud, and updates the corresponding attribute value to the default attribute value.
[0212] S1008: The device cloud sends a device deregistration message.
[0213] Since the second electronic device has subscribed to the device attribute change service from the device cloud, after the first electronic device sends a device deregistration instruction to the device cloud, the device cloud will send a device deregistration message to the second electronic device.
[0214] S1009: The second electronic device deletes the device information and reportID.
[0215] After the second electronic device receives the device deregistration message from the first electronic device, the second electronic device deletes the device information and version identifier reportID of the first electronic device stored in the second electronic device, and updates the corresponding attribute value to the default attribute value.
[0216] This application provides a data processing method. When a first electronic device is deregistered, the first electronic device sends a device deregistration instruction to a device cloud. The device cloud deletes the device information and reportID of the first electronic device in response to the device deregistration instruction, and sends a device deregistration instruction to a second electronic device. The second electronic device then deletes the device information and reportID of the first electronic device in response to the device deregistration instruction. Thus, even in the scenario where the first electronic device is deregistered, cross-device data processing can be completed.
[0217] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the various functions or steps performed by the electronic device 100 in the above method embodiment are implemented.
[0218] Another embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer or processor, causes the computer or processor to execute one or more steps in any of the above methods.
Claims
1. A data processing method, characterized in that: Applied to a second electronic device, the method includes: The second electronic device registers with the device cloud to perform message propagation based on a multi-channel communication method; The multi-channel communication is the simultaneous near-field communication and far-field communication between the second electronic device and the first electronic device, the near-field communication is the communication between the second electronic device and the first electronic device via WIFI or Bluetooth, and the far-field communication is the communication between the second electronic device and the first electronic device by forwarding through the device cloud, the first device is the device that initiates status message synchronization, the second electronic device is the device that receives the status message synchronization, and the status message is a message carrying a version identifier; a change in the subscription device attribute of the second electronic device; The second electronic device sends the instruction for subscribing to the device attribute change to the device cloud, the instruction for subscribing to the device attribute change being used to cause the device cloud to send the attribute instruction to the second electronic device when the device cloud receives the attribute instruction sent by the first electronic device; receiving the attribute instruction sent by the first electronic device, the attribute instruction including the version identifier and the attribute value, the version identifier indicating the order in which the attribute values are sent by the first electronic device to the second electronic device, the attribute value being a capability attribute of whether to support various services, the various services including the following services: connection, incoming call, notification, keyboard and mouse, collaboration, sharing, or screen projection; Determine whether the version identifier and attribute value in the local cache attribute exist; If the version identifier and the attribute value in the local cache attribute exist, then the version identifier in the attribute instruction is compared with the version identifier in the local cache attribute to obtain a comparison result; If the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, the version identifier and attribute value in the local cache attribute are updated to the version identifier and attribute value in the attribute instruction.
2. The method according to claim 1, characterized in that Before determining whether the version identifier and the attribute value in the local cache attribute exist, the method further includes: Determine whether the version identifier in the attribute instruction is 0; If the version identifier in the attribute instruction is not 0, it is determined whether the version identifier and attribute value in the local cache attribute exist.
3. The method according to claim 2, characterized in that The method further comprises: If the version identifier in the attribute instruction is 0, the version identifier and attribute value in the attribute instruction are set to the version identifier and attribute value in the local cache attribute.
4. The method according to claim 1, wherein The method further comprises: If the version identifier and attribute value in the local cache attribute do not exist, the version identifier and attribute value in the attribute instruction are set to the version identifier and attribute value in the local cache attribute.
5. The method according to claim 1, wherein The attribute instruction includes a device deregistration instruction; The updating of the version identifier and the attribute value in the local cache attribute to the version identifier and the attribute value in the attribute instruction includes: The version identifier in the local cache attribute is deleted, and the attribute value is updated to the default attribute value.
6. The method according to claim 1, characterized in that The attribute instruction includes a device re-registration instruction; The updating of the version identifier and the attribute value in the local cache attribute to the version identifier and the attribute value in the attribute instruction includes: The version identifier in the local cache attribute is updated to 0, and the attribute value is updated to the default attribute value.
7. A data processing system, characterized in that: The data processing system includes: a first electronic device, a second electronic device and a device cloud; The first electronic device is configured to send an attribute instruction to the second electronic device and the device cloud, the attribute instruction including a version identifier and an attribute value, the version identifier indicating a sequence in which the attribute values are sent by the first electronic device to the second electronic device, the attribute value being a capability attribute of whether to support various services, the various services including the following: call connection, incoming call, notification, keyboard and mouse, collaboration, sharing, or screen casting; The second electronic device is configured to determine whether a version identifier and an attribute value in the local cache attribute exist; if the version identifier and the attribute value in the local cache attribute exist, compare the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result; if the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the local cache attribute, update the version identifier and the attribute value in the local cache attribute to the version identifier and the attribute value in the attribute instruction; The first electronic device and the second electronic device are in multi-channel communication; wherein the multi-channel communication is the second electronic device and the first electronic device simultaneously performing near-field communication and far-field communication, the near-field communication is the communication between the second electronic device and the first electronic device via WIFI or Bluetooth, and the far-field communication is the communication between the second electronic device and the first electronic device by forwarding through the device cloud, the first device is a device that initiates status message synchronization, the second electronic device is a device that receives the status message synchronization, and the status message is a message carrying a version identifier; The device cloud is used to send the attribute instruction to the second electronic device.
8. A data processing system, characterized in that: The data processing system includes: a first electronic device, a device cloud, and a second electronic device; The first electronic device is configured to send an attribute instruction to the device cloud, the attribute instruction including a version identifier and an attribute value, the version identifier indicating a sequence in which the attribute values are sent by the first electronic device to the second electronic device, the attribute value being a capability attribute indicating whether various services are supported, the various services including the following: call connection, incoming call, notification, keyboard and mouse, collaboration, sharing, or screen casting; The device cloud is configured to determine whether a version identifier and an attribute value in a local cache attribute exist; if the version identifier and the attribute value in the local cache attribute exist, then compare the version identifier in the attribute instruction with the version identifier in the local cache attribute to obtain a comparison result; if the comparison result indicates that the version identifier in the attribute instruction is later than the version identifier in the cloud cache attribute of the device cloud, then update the version identifier and the attribute value in the cloud cache attribute of the device cloud to the version identifier and the attribute value in the attribute instruction; and send the updated version identifier and the attribute value in the cloud cache attribute of the device cloud to the second electronic device; The second electronic device is configured to update the version identifier and attribute value in the local cache attributes of the second electronic device to the version identifier and attribute value in the cloud cache attributes updated by the device cloud; The first electronic device and the second electronic device are in multi-channel communication; wherein, the multi-channel communication is that the second electronic device and the first electronic device perform near-field communication and far-field communication simultaneously, the near-field communication is the communication between the second electronic device and the first electronic device via WIFI or Bluetooth, and the far-field communication is the communication between the second electronic device and the first electronic device by forwarding through the device cloud, the first device is a device that initiates status message synchronization, the second electronic device is a device that receives the status message synchronization, and the status message is a message carrying a version identifier.
9. An electronic device, characterized in that: including processor and memory; The memory is used to store computer-executable instructions; The processor is configured to execute the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program or instructions, and when the computer program or instructions are executed, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Upgrade prompting method, terminal equipment and computer readable storage medium
CN114816463A