A data processing method, electronic device and data processing system

By parsing callback messages to obtain business connection information and statistically analyzing matching results to determine the success rate of information synchronization in the device management service and the number of times the ball-hanging compensation mechanism takes effect, the problem of unreliable information synchronization during device interconnection is solved, ensuring that the control center interface is displayed normally.

CN120455519BActive Publication Date: 2026-03-24HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, electronic devices cannot determine the success rate of information synchronization in device management services and whether the ball-hanging compensation mechanism is effective during device interconnection, leading to abnormal display of the control center interface.

Method used

By parsing callback messages in electronic devices to obtain business connection information, statistical matching results are used to determine the information synchronization success rate, and the number of times the ball-hanging compensation mechanism takes effect is recorded.

Benefits of technology

This enables accurate determination of the information synchronization success rate of equipment management services and the number of times the ball-hanging compensation mechanism takes effect during the equipment interconnection process, avoiding abnormal display of the control center interface and ensuring the normal operation of equipment management services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455519B_ABST
    Figure CN120455519B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a data processing method, an electronic device and a data processing system, and relates to the technical field of data processing. The method comprises the following steps: after receiving a service triggering operation, an electronic device acquires a first callback message corresponding to a first target device from a device management service, the service triggering operation is used for triggering the electronic device to connect or disconnect with other electronic devices for a target service; the first callback message is analyzed to obtain first service connection information corresponding to the first target device and the target service, the device connection information of a second target device is acquired from the first service connection information, and the second service connection information corresponding to the second target device and the target service is acquired from a local cache by using the device ID of the second target device and the service ID of the target service; and a matching result corresponding to a current service is obtained according to the first service connection information and the second service connection information. The scheme can determine the information synchronization success rate of the device management service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, electronic device and data processing system. Background Technology

[0002] Currently, electronic devices offer device interconnection capabilities, enabling them to connect with other electronic devices that also possess this capability, facilitating information exchange and collaborative work. After two electronic devices connect (or disconnect) for a service, whether each device adds (or removes) a service icon for the recipient in its own control center interface depends primarily on the recipient's device connection status. In this context, one of the two electronic devices is the recipient, and the other is the initiator.

[0003] However, before each of these two electronic devices receives the device connection status of the peer device from its own device management service, its own device management service needs to synchronize information with the peer device's device management service to obtain the peer device's connection status. If the initiator's device management service fails to synchronize information, the initiator cannot attach (or remove) a service ball for the recipient because it cannot obtain the recipient's device connection status. To address this, existing technology proposes a service ball compensation mechanism. With this compensation mechanism, regardless of whether the initiator's device management service synchronization is successful, the initiator's electronic device can attach a service ball for the recipient on the control center interface when establishing a connection and remove it from the control center interface when disconnecting. Therefore, even if the initiator's device management service synchronization fails, the initiator's electronic device can still attach or remove service balls normally on the control center interface, and the display of the control center interface will not be abnormal. Thus, based on the control center interface displayed by the electronic device itself during device interconnection, it is impossible to determine the success rate of the device management service's synchronization or whether the service ball compensation mechanism is effective. Summary of the Invention

[0004] This application provides a data processing method, electronic device, and data processing system that can determine the information synchronization success rate of device management services and the number of times the ball-hanging compensation mechanism takes effect.

[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0006] Firstly, a data processing method is provided, applied in an electronic device, the electronic device including a device management service. The method includes: after receiving a service triggering operation, obtaining a first callback message corresponding to a first target device from the device management service, wherein the service triggering operation is used to trigger the electronic device to connect or disconnect with other electronic devices for a target service; the first target device is an electronic device or other electronic devices; parsing the first callback message to obtain first service connection information corresponding to the first target device and the target service, wherein the first service connection information includes device connection information of at least one peer device of the first target device, the at least one peer device of the first target device including: a peer device that connects or disconnects with the first target device for the target service; obtaining device connection information of a second target device from the first service connection information, and using the device ID of the second target device and the service ID of the target service, obtaining second service connection information corresponding to the second target device and the target service from a local cache; and obtaining a matching result corresponding to the current service based on the first service connection information and the second service connection information.

[0007] The matching result corresponding to the current business is used to indicate whether the information synchronization of the device management service is successful or unsuccessful. The matching result corresponding to the current business is used to determine the success rate of information synchronization of the device management service.

[0008] Understandably, after receiving a service connection operation, the electronic device can receive a first callback message from its own device management service, and then parse the first service connection information corresponding to the first target device from the first callback message. Then, based on the first service connection information corresponding to the first target device, the electronic device can obtain the second service connection information corresponding to the peer device (i.e., the second target device). Based on these two service connection information (including the first and second service connection information), the electronic device can obtain the matching result corresponding to the current service. The matching result corresponding to the current service is used to indicate whether the information synchronization of the device management service is successful or unsuccessful. The matching result corresponding to the current service is used to determine the success rate of the information synchronization of the device management service; that is, the electronic device can determine the success rate of the information synchronization of the device management service based on the matching result corresponding to the current service.

[0009] In conjunction with the first aspect, in one possible implementation, the method further includes: statistically analyzing the matching results corresponding to at least one service executed within a preset sampling period; and determining the success rate of information synchronization of the device management service based on the matching results corresponding to at least one service, wherein the matching results corresponding to at least one service include the matching results corresponding to the current service.

[0010] In conjunction with the first aspect, in another possible implementation, determining the success rate of information synchronization of the device management service based on the matching results corresponding to at least one service includes: determining a first total number of successes and a first total number of failures based on the matching results corresponding to at least one service, wherein the first total number of successes is equal to the total number of successfully matched information in the matching results corresponding to at least one service, and the first total number of failures is equal to the total number of unsuccessfully matched information in the matching results corresponding to at least one service; and obtaining the success rate of information synchronization of the device management service based on the first total number of successes and the first total number of failures.

[0011] In conjunction with the first aspect, another possible implementation method further includes: counting the number of times the electronic device displays the attachment of a service ball and the number of times the electronic device displays the removal of a service ball within a preset sampling period; adding the number of times the electronic device displays the attachment of a service ball and the number of times the electronic device removes a service ball to obtain the first total number of changes; and subtracting the first total number of successes from the first total number of changes to obtain the number of times the ball-attaching compensation mechanism takes effect.

[0012] In conjunction with the first aspect, another possible implementation, after obtaining the device connection information of the second target device from the first service connection information, further includes: if the device connection status of the second target device is established or disconnected, mapping the first service connection information and the device connection information of the second target device to obtain combined information, and adding the combined information to a preset queue. Specifically, the above-mentioned method of obtaining the second service connection information corresponding to the second target device and the target service from the local cache using the device ID of the second target device and the service ID of the target service includes: if the combined information reaches the beginning of the preset queue, obtaining the second service connection information corresponding to the second target device and the target service from the local cache using the device ID of the second target device and the service ID of the target service.

[0013] In conjunction with the first aspect, in another possible implementation, obtaining the matching result corresponding to the current service based on the first service connection information and the second service connection information includes: obtaining the device connection information of the first target device based on the second service connection information; if the first target device is an electronic device, determining whether the first service connection information and the second service connection information match based on the device connection information of the first target device and the device connection information of the second target device; if the device connection information of the first target device includes the device ID and the device connection status of the first target device, and the device connection information of the second target device includes the device ID and the device connection status of the second target device, and if the device connection status of the first target device and the device connection status of the second target device are the same, determining that the first service connection information and the second service connection information match, and recording the first matching success information corresponding to the target service, wherein the matching result corresponding to the current service includes the first matching success information.

[0014] In conjunction with the first aspect, another possible implementation involves obtaining the matching result corresponding to the current service based on the first service connection information and the second service connection information, including: obtaining the device connection information of the first target device based on the second service connection information; if the first target device is another electronic device, searching from a polling comparison list for a target element that matches the service ID of the target service and the device connection information of the first target device, wherein the service ID in the target element is the same as the service ID of the target service, and the target element also includes content that is the same as the device connection information of the first target device; determining a first delay using the current time and a first timestamp in the target element; if the first delay is less than a preset duration, recording the second matching success information corresponding to the target service, and the matching result corresponding to the current service includes the second matching success information; if the first delay is greater than or equal to the preset duration, recording the first matching failure information corresponding to the target service, and the matching result corresponding to the current service includes the first matching failure information.

[0015] In conjunction with the first aspect, another possible implementation of the method also includes: the electronic device deleting the target element from the polled comparison list.

[0016] In conjunction with the first aspect, another possible implementation method further includes: when the first service connection information and the second service connection information do not match and the timer is started, using the device connection information of the second target device, the service ID of the target service, and the first timestamp to form a new element, which is added to the polling comparison list in the timer, wherein the first timestamp is the moment when the new element is added to the polling comparison list; and determining the matching result corresponding to each element in the polling comparison list according to the timer strategy.

[0017] In conjunction with the first aspect, another possible implementation involves determining the matching result corresponding to each element in the polling comparison list based on the timer strategy, including: traversing the polling comparison list according to a preset traversal period, and for an element in the traversed polling comparison list, determining a second delay using the current time and the first timestamp in the element; if the second delay is greater than or equal to a preset duration, recording the second matching failure information corresponding to the business in the element, and deleting the element from the polling comparison list.

[0018] In conjunction with the first aspect, another possible implementation of the method further includes: receiving a service trigger operation on a first interface, the first interface including a first device ball corresponding to an electronic device and second device balls corresponding to other electronic devices; and attaching or removing a service ball in response to the service trigger operation on the first interface.

[0019] In conjunction with the first aspect, another possible implementation involves attaching or removing a service ball in the first interface, including: when a service triggering operation is used to trigger the connection of the electronic device with other electronic devices for the target service, the electronic device attaches a service ball to the first or second device ball; when a service triggering operation is used to trigger the disconnection of the electronic device with other electronic devices for the target service, the electronic device removes the service ball from the first or second device ball.

[0020] Secondly, a data processing method is provided, applied in a data processing system, the data processing system including a first electronic device and a cloud server. The method includes: after receiving a service trigger operation, the first electronic device obtains a first callback message corresponding to a first target device from a device management service included in the first electronic device, wherein the service trigger operation is used to trigger the electronic device to connect or disconnect from other electronic devices for a target service; the first target device is an electronic device or other electronic devices; the first electronic device parses the first callback message to obtain first service connection information corresponding to the first target device and the target service, wherein the first service connection information includes device connection information of at least one peer device of the first target device, and the at least one peer device of the first target device includes: devices connected to the first target device... The target device connects to or disconnects from the peer device for the target service; the first electronic device obtains the device connection information of the second target device from the first service connection information, and uses the device ID of the second target device and the service ID of the target service to obtain the second service connection information corresponding to the second target device and the target service from the local cache; the first electronic device obtains the matching result corresponding to the current service based on the first service connection information and the second service connection information, wherein the matching result corresponding to the current service is used to indicate that the information synchronization of the device management service is successful, or to indicate that the information synchronization of the device management service has failed; the first electronic device sends the matching result corresponding to the current service to the cloud server; the cloud server determines the success rate of the information synchronization of the device management service based on the matching result corresponding to the current service.

[0021] In conjunction with the second aspect, in one possible implementation, the data processing system includes multiple electronic devices, including a first electronic device. The cloud server determines the success rate of information synchronization for the device management service based on the matching results corresponding to the current business. This includes: the cloud server determining the success rate of information synchronization for the device management service based on the matching results received from the multiple electronic devices within a preset sampling period, wherein the matching results received from the multiple electronic devices include the matching results corresponding to the current business.

[0022] In conjunction with the second aspect, in one possible implementation, the cloud server determines the success rate of information synchronization for the device management service based on the matching results received from multiple electronic devices within a preset sampling period. This includes: the cloud server determining a second total number of successes and a second total number of failures based on the matching results received from multiple electronic devices within the preset sampling period. The second total number of successes is equal to the total number of successful matching messages in the matching results received from multiple electronic devices, and the second total number of failures is equal to the total number of failed matching messages in the matching results received from multiple electronic devices. The cloud server then obtains the success rate of information synchronization for the device management service based on the second total number of successes and the second total number of failures.

[0023] In conjunction with the second aspect, in one possible implementation, the method further includes: the cloud server counting the number of times multiple electronic devices displayed the attachment of a service ball and the number of times multiple electronic devices displayed the removal of a service ball within a preset sampling period; the cloud server adding the number of times multiple electronic devices displayed the attachment of a service ball and the number of times multiple electronic devices removed a service ball to obtain a second total number of changes; and the cloud server subtracting the second total number of successes from the second total number of changes to obtain the number of times the ball-attaching compensation mechanism took effect.

[0024] Thirdly, an electronic device is provided, comprising: a processor, a memory, and a communication interface. The memory and the communication interface are coupled to the processor, and the memory stores computer program code, including computer instructions. When the processor executes the computer instructions, it causes the electronic device to perform the method as described in any one of the first aspects above.

[0025] Fourthly, a data processing system is provided, comprising: a first electronic device and a cloud server for performing the method as described in any one of the second aspects above.

[0026] Fifthly, a computer-readable storage medium is provided that stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the method as described in any one of the first aspects above; or, when the computer instructions are executed on a data processing system, the data processing system performs the method as described in any one of the second aspects above.

[0027] In a sixth aspect, a computer program product comprising computer instructions is provided, which, when executed on an electronic device, causes the electronic device to perform the method as described in any one of the first aspects above; or, when executed on a data processing system, causes the data processing system to perform the method as described in any one of the second aspects above.

[0028] In a seventh aspect, an apparatus (e.g., a system-on-a-chip) is provided, comprising a processor for supporting an electronic device in implementing the methods described in the first aspect above, or for a data processing system in executing the methods described in any one of the second aspects above. In one possible design, the apparatus further comprises a memory for storing program instructions and data necessary for the electronic device or data processing system. When the apparatus is a system-on-a-chip, it may be composed of chips or may include chips and other discrete devices.

[0029] The technical effects of any of the design methods in aspects two through seven can be found in the technical effects of different design methods in aspect one, and will not be repeated here. Attached Figure Description

[0030] Figure 1 A schematic diagram of a control center interface provided in an embodiment of this application;

[0031] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0032] Figure 3 A schematic diagram of the system architecture of an electronic device provided in this application embodiment;

[0033] Figure 4 A schematic diagram illustrating a service connection between two devices provided in an embodiment of this application;

[0034] Figure 5 A flowchart illustrating a data processing method provided in this application embodiment. Figure 1 ;

[0035] Figure 6 A flowchart illustrating a data processing method provided in this application embodiment. Figure 2 ;

[0036] Figure 7 A flowchart illustrating a data processing method provided in this application embodiment. Figure 3 ;

[0037] Figure 8 A flowchart illustrating a data processing method provided in this application embodiment. Figure 4 ;

[0038] Figure 9 A flowchart illustrating a data processing method provided in this application embodiment. Figure 5 ;

[0039] Figure 10 A flowchart illustrating a data processing method provided in this application embodiment. Figure 6 ;

[0040] Figure 11 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0043] Currently, electronic devices offer device interconnection capabilities, enabling them to connect with other interconnected electronic devices for information exchange and collaborative work. The process of different devices exchanging information and collaborating via a network can be termed device interconnection. In some embodiments, an electronic device may include an application for implementing device interconnection functionality. Optionally, this application may be called a hyperterminal application. Users can control multiple interconnectable devices through a hyperterminal application.

[0044] Reference Figure 1 The diagram shown is a schematic representation of a control center interface provided in an embodiment of this application. Figure 1 As shown, the super terminal application may include a control center interface 100, which may include: a user avatar 101, a trust ring 102, and multiple device spheres.

[0045] The central position of the control center interface 100 is used to display the user avatar 101. The user avatar 101 is the avatar associated with the user account logged in on this device. This device refers to the electronic device used to display the control center interface 100.

[0046] A dashed ring is displayed outside the user avatar 101; this dashed ring can be called a trust ring 102. Trust ring 102 can be a circle or network composed of mutually trusting devices. Only electronic devices within trust ring 102 can securely exchange information and collaborate.

[0047] Multiple device spheres are evenly arranged on the trust ring 102. These multiple device spheres can represent multiple interconnectable electronic devices. These interconnectable electronic devices include the local device. These interconnectable electronic devices are logged into the same user account, and all of them are devices trusted by the user. For example, Figure 1 Three device balls are shown: device ball 103 for representing the local machine, device ball 104 for representing electronic device 1, and device ball 105 for representing electronic device 2.

[0048] Users can interact with each device ball by clicking or dragging to control the electronic device represented by that device ball. For example, a user can click on device ball 103 corresponding to their device to view at least one service offered by the device; then, the user can drag the icon corresponding to any service onto device ball 104 to trigger a connection between the device and the electronic device 1 represented by device ball 104, and implement the service after a successful connection. Here, a service can refer to an activity in information exchange and collaborative work, such as screen sharing or network sharing.

[0049] For example, Figure 1 The control center interface 100 is shown when the local device and electronic device 1 are sharing the screen. At this time, the control center interface 100 may also include service prompt information 106, which is used to prompt that screen sharing is in progress.

[0050] In this embodiment, two interconnected electronic devices, during the implementation of any service, can be categorized as the service initiator and the service recipient. If one electronic device is the service recipient, and the two electronic devices successfully establish a connection, each of these devices can attach a service ball to the device ball corresponding to the recipient on its own displayed control center interface. Optionally, attaching a service ball to the device ball corresponding to the recipient can be simply described as the recipient attaching a service ball. The receipt of a service ball on the control center interface can be used to indicate that the two electronic devices have successfully established a connection. For example, as... Figure 1 As shown, during the screen sharing process between the local machine and electronic device 1, electronic device 1 acts as the receiver in the screen sharing. The local machine can attach a service ball 107 to the device ball 104 corresponding to electronic device 1 on its own control center interface 100.

[0051] Furthermore, if the two electronic devices disconnect, the service ball on the device ball corresponding to the receiver is removed. For example, if the local device disconnects from electronic device 1, the service ball 107 on the device ball 104 corresponding to electronic device 1 is removed. Optionally, the removal of a service ball by an electronic device for the device ball corresponding to the receiver can be simply described as the receiver removing the service ball.

[0052] It should be noted that the presentation of the business ball (including its appearance and color) can be customized based on the business it represents. For example, Figure 1 The pattern in the service sphere 107 shown can be used to represent screen sharing. The color of the service sphere 107 can also be blue or green, etc. Figure 1 Not shown in the image.

[0053] In this embodiment, after two interconnected electronic devices successfully establish a connection, whether each of these two electronic devices adds a service ball to the receiver in its own control center interface depends primarily on the receiver's device connection status. Therefore, after the two electronic devices successfully establish a connection, each of them can receive not only its own device connection status but also the device connection status of the peer device, which refers to another electronic device interconnected with the circuit device. If an electronic device is the service initiator, it means that its peer device is the receiver. Therefore, it can determine whether to add a service ball to the corresponding device ball of the peer device in its own control center interface based on the peer device's device connection status. The device connection status of an electronic device can be in the process of connecting, already connected, or disconnected.

[0054] Optionally, each electronic device may receive its own device connection status and corresponding service connection information. Each electronic device may also receive the service connection information of the peer device while receiving the device connection status of the peer device. The service connection information of an electronic device may be used to record the device connection information of at least one peer device of that electronic device. The at least one peer device of that electronic device may include all peer devices that are connected or disconnected from that electronic device for a particular service.

[0055] For example, taking two interconnected electronic devices, including the local machine and electronic device 1, and the local machine as the initiator and electronic device 1 as the service recipient, this describes the process of an electronic device attaching a service ball to the recipient on the control center interface. Both the local machine and electronic device 1 can include a device management service (or profile). The local machine initiates a connection for any service to electronic device 1, and after successfully establishing the connection, each electronic device can receive its own device connection status and the device connection status of the peer device from its own device management service. As the initiator, after receiving the device connection status of electronic device 1 (i.e., the recipient's device connection status) from its own device management service, the local machine can attach a service ball to electronic device 1 on the control center interface displayed on its own machine (i.e., attach a service ball to the recipient) based on the device connection status of electronic device 1. As the recipient, after receiving its own device connection status from its own device management service, electronic device 1 can attach a service ball to itself on the control center interface displayed on its own device.

[0056] In this scenario, after two electronic devices successfully establish a connection, each device needs to synchronize its own device management service to obtain the connection status of the peer device before receiving it from its own device management service. However, the device management service of each electronic device may fail to synchronize, resulting in the electronic device only receiving its own connection status and not the connection status of the peer device. Since whether an electronic device attaches a service ball to the receiver depends primarily on the receiver's connection status, even if the two electronic devices successfully establish a connection, if the initiator's device management service fails to synchronize, the initiator cannot obtain the receiver's connection status and therefore cannot attach a service ball to the receiver. To address this, existing technologies employ a ball-attaching compensation mechanism for each interconnected electronic device. This mechanism allows an electronic device, acting as the initiator, to determine the peer device it has connected to based on its own connection status and attach a service ball to the peer device on its own control center interface. Introducing this compensation mechanism avoids the problem of successfully establishing a connection but not attaching a service ball to the control center interface due to synchronization failures in the device management service.

[0057] It should be noted that after the two interconnected electronic devices are disconnected, whether each of these devices removes the service ball for the receiver in its own control center interface depends primarily on the receiver's device connection status. For details on how each electronic device removes the service ball for the receiver in its own control center interface, please refer to the above description of how electronic devices attach service balls for the receiver in their own control center interfaces; it will not be repeated here.

[0058] In summary, with the existing technology employing the "ball-hanging compensation mechanism," regardless of whether the information synchronization of the initiating party's device management service is successful, the initiating electronic device can "hang" a service ball for the receiver on the control center interface when establishing a connection with the receiver, and remove the service ball from the control center interface when disconnecting from the receiver. Therefore, even if the initiating party's device management service information synchronization fails, the initiating electronic device can still normally "hang" or "remove" service balls in the control center interface, and the display of the control center interface will not show any abnormalities. Thus, based on the control center interface displayed by an electronic device itself during device interconnection, it is impossible to determine the success rate of the device management service information synchronization, nor can it determine whether the "ball-hanging compensation mechanism" is effective.

[0059] To address the aforementioned issues, this application proposes a data processing method. After receiving a service connection operation, an electronic device can receive its own corresponding service connection information from its own device management service. This service connection operation is used to trigger the connection or disconnection of a target service to a peer device. Then, the electronic device can obtain the service connection information corresponding to the peer device based on its own service connection information. If these two service connection information sets (including the service connection information corresponding to the electronic device and the service connection information corresponding to the peer device) include each other's device identifiers (IDs), and the device connection states included in these two service connection information sets are the same (e.g., both are established or disconnected), then the device management service is considered to have successfully synchronized information during the connection or disconnection process of the target service, and a matching success message is recorded. If the device IDs in these two service connection information sets do not include each other's device IDs, and / or the device connection states included in these two service connection information sets are different, then the electronic device is considered not to have received the service connection information corresponding to the peer device, the information synchronization of the device management service fails, and a matching failure message is recorded. Finally, the electronic device determines the first total number of successes and the first total number of failures based on the matching success information or matching failure information corresponding to all services executed within the preset sampling period. Then, the information synchronization success rate of the device management service can be determined based on the first total number of successes and the first total number of failures. Alternatively, the first total number of successes can be obtained by subtracting the first total number of changes of the service ball in the control center interface of the electronic device from the first total number of changes.

[0060] In summary, this solution allows for the determination of the device management service's information synchronization success rate and the number of times the compensation mechanism takes effect, assuming no abnormalities occur in the control center interface after the electronic device adopts the ball-hanging compensation mechanism. Furthermore, when the device management service's information synchronization success rate is low, developers can be alerted to promptly modify the device management service to ensure its normal operation.

[0061] This application provides a data processing method that can be applied to electronic devices with device interconnection capabilities, such as tablet computers, personal computers (PCs), laptops, mobile phones, in-vehicle devices, or wearable devices. This application does not impose any restrictions on the specific type of electronic device.

[0062] Take mobile phones as an example of electronic devices. Figure 2 A schematic diagram of the structure of the electronic device provided in this application is shown.

[0063] like Figure 2As shown, the mobile phone may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, antenna 1, antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera [1-N] 293, a display screen [1-N] 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer, a proximity sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0064] The processor 210 can be used to execute various functions or steps performed by the mobile phone in the above method embodiments.

[0065] The display screen 294 is used for displaying interfaces, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), etc.

[0066] In this embodiment, if the display screen 294 integrates a touch sensor, then the display screen 294 can be referred to as a touch screen. The touch sensor can also be referred to as a "touch panel." That is, the display screen 294 can include a display panel and a touch panel. The touch sensor 231 is used to detect touch operations applied to or near it. After the touch sensor detects a touch operation (e.g., the user operation described above), it can trigger the driver of the phone's kernel layer to periodically scan the touch parameters generated by the touch operation. Then, the driver of the kernel layer passes the touch parameters to the relevant modules in the upper layer so that the relevant modules can determine the touch event corresponding to the touch parameters. This embodiment uses a display screen 294 that integrates a touch sensor (i.e., a touch screen) as an example to illustrate the method provided in this embodiment.

[0067] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone. In other embodiments, the mobile phone may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0068] The software system of the aforementioned mobile phone can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture of the Android® system as an example to exemplify the structure of the mobile phone's software system. A layered architecture divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through interfaces. In some embodiments, such as... Figure 3 As shown, the Android® system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0069] The application layer can include a series of application packages. These application packages can be divided into system applications (APPs) that come pre-installed on the phone, and third-party apps that users download to their phones. For example, ... Figure 3 As shown, the system apps may include camera, gallery, calendar, phone, hyperterminal application, trust ring control center, business services, device management services, and timer apps. Optionally, the hyperterminal application can be called a smart interconnection application. The trust ring control center can be simply referred to as the control center.

[0070] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0071] The application framework layer may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, etc., and this disclosure does not impose any limitations on this.

[0072] Activity Manager: Used to manage the lifecycle of each application. Applications typically run in the operating system as Activities. For each Activity, the Activity Manager maintains a corresponding application record (ActivityRecord), which records the state of the application's Activities. The Activity Manager can use this ActivityRecord as an identifier to schedule the application's Activity processes.

[0073] WindowManagerService: Used to manage graphical user interface (GUI) resources used on the screen. Specifically, it can be used for: getting screen size, creating and destroying windows, showing and hiding windows, window layout, focus management, and input method and wallpaper management, etc.

[0074] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc. Resource managers provide applications with various resources, such as localized strings, icons, images, layout files, video files, etc.

[0075] The Android Runtime comprises the core libraries and the virtual machine. The Android Runtime is responsible for scheduling and managing the Android system. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part contains the core Android libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0076] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0077] The Surface Manager manages the display subsystem and provides 2D and 3D layer blending for multiple applications. The Media Library supports playback and recording of various common audio and video formats, as well as still image files. The Media Library supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. OpenGL ES is used for 3D graphics drawing, image rendering, compositing, and layer processing. SGL is a 2D graphics engine.

[0078] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, sensor drivers, etc., but this disclosure does not impose any limitations on these components.

[0079] The methods described in the following embodiments can all be implemented in electronic devices having the above-described hardware or software structures.

[0080] In this embodiment of the application, during the interconnection process between the first electronic device and the second electronic device, the first electronic device or the second electronic device may execute a data processing method to determine whether the information synchronization of its own device management service in this device interconnection is successful or unsuccessful. Specifically, the first electronic device may be the initiator of this device interconnection, and the second electronic device may be the receiver; or, the first electronic device may be the receiver in this device interconnection, and the second electronic device may be the initiator.

[0081] Reference Figure 4 Taking the example of a first electronic device initiating a service and a second electronic device receiving the service, this paper describes the process of interconnecting the two electronic devices. Both the first and second electronic devices can include a super terminal application, a control center, service services, device management services, and timers. Optionally, such as... Figure 4 As shown, the super terminal application, control center, business service, device management service, and timer in the first electronic device can be referred to as the first super terminal application, first control center, first business service, first device management service, and first timer, respectively. The super terminal application, control center, business service, device management service, and timer in the second electronic device can be referred to as the second super terminal application, second control center, second business service, second device management service, and second timer, respectively. For example... Figure 4 As shown, the process of interconnecting two electronic devices may include S401-S414.

[0082] S401. When the first electronic device displays the first control center interface, the first super terminal application receives a service trigger operation. The service trigger operation is used to trigger the connection or disconnection of the target service to the second electronic device.

[0083] When the first electronic device displays the first control center interface, it can receive service-triggered operations. The first control center interface can include a trust ring and multiple device spheres included in the trust ring. Each device sphere corresponds one-to-one with a set of interconnectable electronic devices. These interconnectable electronic devices log in to the same user account.

[0084] For example, a service triggering operation could be to drag the icon corresponding to the target service displayed in the first control center interface to the device sphere corresponding to the second electronic device. In this case, the service triggering operation is used to initiate a connection to the second electronic device for the target service.

[0085] S402. The first super terminal application responds to the business trigger operation and sends the first connection command to the first control center.

[0086] S403. In response to the first connection command, the first control center sends a second connection command to the first service.

[0087] S404. The first service and the second service in the second electronic device connect or disconnect the target service.

[0088] S405, The first service writes the device connection information of the first electronic device and the service connection information corresponding to the first electronic device and the target service to the first device management service.

[0089] The device continuity information of the first electronic device can be in the process of connecting, having established a connection, or having disconnected. The service connection information corresponding to the first electronic device and the target service can be used to record the device connection information of at least one peer device of the first electronic device. The at least one peer device of the first electronic device can include all peer devices that are connected or disconnected from the first electronic device in connection with the target service.

[0090] S406. The second service writes the device connection information of the second electronic device and the service connection information corresponding to the second electronic device and the target service to the second device management service.

[0091] The device continuity information of the second electronic device can be in the process of connecting, having established a connection, or having disconnected. The service connection information corresponding to the second electronic device and the target service can be used to record the device connection information of at least one peer device of the second electronic device. The at least one peer device of the second electronic device can include all peer devices that are connected or disconnected from the second electronic device in connection with the target service.

[0092] S407, First Equipment Management Service and Second Equipment Management Service synchronize information.

[0093] S408. If the information synchronization is successful, the first control center obtains the device connection information of the second electronic device and the service connection information corresponding to the second electronic device and the target service from the first device management service.

[0094] S409. The first control center updates its interface based on the device connection information of the second electronic device, and obtains and displays the second control center interface.

[0095] S410, The first control center obtains the device connection information of the first electronic device and the service connection information corresponding to the first electronic device and the target service from the first device management service.

[0096] S411. In the event of information synchronization failure, the first control center adopts a ball-hanging compensation mechanism to update the interface of the first control center based on the device connection information of the first electronic device and the service connection information corresponding to the first electronic device and the target service, thereby obtaining and displaying the interface of the second control center.

[0097] S412, The second control center in the second electronic device obtains the device connection information of the second electronic device and the service connection information corresponding to the second electronic device and the target service from the second device management service in the second electronic device.

[0098] S413. The second control center updates the third control center interface currently displayed on the second electronic device based on the device connection information of the second electronic device, and obtains and displays the fourth control center interface.

[0099] S414. If the information synchronization is successful, the second control center obtains the device connection information of the first electronic device and the service connection information corresponding to the first electronic device and the target service from the second device management service.

[0100] It is understandable that each time an electronic device interconnects with a peer device, whether acting as the initiator or the receiver, it can receive callback messages from its own device management service. The electronic device can parse these callback messages to obtain the service connection information corresponding to either itself or the peer device. Then, based on this parsed service connection information, the electronic device can determine whether the information synchronization of its own device management service was successful during the execution of the target service. Furthermore, the electronic device can count the first total number of successes and the first total number of failures in the execution of multiple services; based on these, the information synchronization success rate of the device management service can be determined; and the number of times the "hanging ball" compensation mechanism took effect can be obtained by subtracting the first total number of successes from the first total number of changes to the service ball in the electronic device's control center interface. Optionally, the callback message can be called a connection information callback message or a profile callback message.

[0101] refer to Figure 5 This describes the process by which an electronic device determines whether the information synchronization of its device management service has been successful during device interconnection. This electronic device can be the initiator (e.g., the first electronic device mentioned above) or the receiver (e.g., the second electronic device mentioned above). Figure 5 As shown, the data processing method provided in this application embodiment may include S501-S519.

[0102] S501, The electronic device obtains the first callback message from its own device management service.

[0103] After receiving a service trigger operation, the control center within the electronic device can sequentially retrieve at least one callback message from the device management service. The service trigger operation is used to trigger a connection between the electronic device and a peer device for the target service, or to trigger a disconnection between the electronic device and a peer device for the target service. This at least one callback message may include a first callback message corresponding to the third electronic device and the current service. The first callback message records the device connection information of the third electronic device and the device connection information of at least one peer device of the third electronic device. At least one peer device of the third electronic device may include all peer devices that have connected to or disconnected from the third electronic device for the target service. The first callback message may include: the device ID of the third electronic device, the service ID of the target service, and the device connection information of at least one peer device of the third electronic device. The device connection information of each peer device may include: the device ID of the peer device, the device connection status of the peer device, and the role of the peer device, etc. The role of the peer device can be either an initiator or a receiver.

[0104] Alternatively, an electronic device may be referred to as the local device. The local device is the device that the user is operating.

[0105] In this embodiment, the at least one callback message obtained by the electronic device from the device management service may include a callback message corresponding to the local device and the target service, and may also include a callback message corresponding to the peer device and the target service. Since the third electronic device may be the local device or a peer device interconnected with the local device, the first callback message corresponding to the third electronic device and the target service may be either a callback message corresponding to the local device and the target service, or a callback message corresponding to the peer device and the target service.

[0106] Optionally, the electronic device may first obtain the callback message corresponding to its own device and the target service from the device management service, and then obtain the callback message corresponding to the peer device and the target service; or it may first obtain the callback message corresponding to the peer device and the target service, and then obtain the callback message corresponding to its own device and the target service. This application embodiment does not restrict the order in which the electronic device obtains at least one callback message from the device management service.

[0107] For example, the first callback message can be raw information stored in the local device management service. For instance, the first callback message might include the following: device1; device2; device3; status: 2, 1, 1; role: sink, sink, source. Here, device1, device2, and device3 represent the device IDs of the three peer devices connected to the third electronic device. "status: 2, 1, 1" indicates the device connection status of the three peer devices connected to the third electronic device; 2 indicates a connection is in progress, and 1 indicates a connection has been established. "role: sink, sink, source" indicates the role of the three peer devices connected to the third electronic device; sink indicates that the peer device is the receiver when connecting to the third electronic device, and source indicates that the peer device is the initiator when connecting to the third electronic device. The device connection status, device IDs, and roles of the three peer devices are all one-to-one.

[0108] S502. The electronic device parses the first callback message to obtain the first service connection information corresponding to the third electronic device and the target service.

[0109] The electronic device can parse the raw information (i.e., the first callback message) obtained from the device management service before using it. The electronic device parses the first callback message to obtain the first service connection information. The first service connection information may include device connection information of at least one peer device of the third electronic device. At least one peer device of the third electronic device may include all peer devices that are connected to or disconnected from the third electronic device for the target service.

[0110] In some embodiments, the first service connection information may be an information list. Optionally, this information list may be called a List. <deviceconnectioninfo>.

[0111] For example, taking the first callback message as including device1; device2; device3; status: 2, 1, 1; role: sink, sink, source, the first service connection information obtained by the electronic device from parsing the first callback message is shown in Table 1 below:

[0112] Table 1 First Service Connection Information

[0113]

[0114] S503. The electronic device determines whether the device state of the third electronic device is in the initialization state or the update state.

[0115] The first callback message corresponding to the third electronic device and the target service may also include the device status of the third electronic device. If the device status of the third electronic device is in the initialization state, the electronic device can end the process and reprocess the next callback message, which is obtained from the device management service after the first callback message. If the device status of the third electronic device is in the update state, the electronic device can execute S504.

[0116] When an electronic device is first brought online, its device state is in the initialization state. "Just brought online" means the electronic device appears in the control center interface (or has been added to the trust ring), but no business operations (including establishing or disconnecting connections) have been performed on it. After business operations are performed on the electronic device, its device state changes to the update state. Therefore, a third electronic device in the initialization state indicates that no business operations have been performed on it. A third electronic device in the update state indicates that some business operations (e.g., establishing or disconnecting connections) have been performed on it.

[0117] It should be noted that during the actual execution of the electronic device, S503 may not be executed. Instead, S504 may be executed directly when the device state of the third electronic device is in the update state.

[0118] S504. The electronic device obtains the device connection information of the fourth electronic device from the first service connection information. The device connection information of the fourth electronic device includes the device ID of the fourth electronic device and the device connection status of the fourth electronic device.

[0119] The electronic device can obtain the device connection information of the fourth electronic device from the first service connection information corresponding to the third electronic device and the target service. The fourth electronic device is an electronic device connected to the third electronic device, or a peer device of the third electronic device. For example, the fourth electronic device can be a peer device represented by device1, device2, or device3 mentioned above.

[0120] Optionally, the device connection information of the fourth electronic device may also be referred to as DeviceConnectionInfo.

[0121] For example, the device connection status of the fourth electronic device can be either "connecting" or "connection already established".

[0122] S505. The electronic device determines whether the device connection status of the fourth electronic device is currently in progress.

[0123] If the fourth electronic device's connection status is "connecting," the device can end the process and process the next callback message, which is retrieved from the device management service after the first callback message. If the fourth electronic device's connection status is not "connecting," it means the fourth electronic device's connection status is either established or disconnected, and S506 is executed.

[0124] For example, the device connection status can be 0, which indicates a disconnection.

[0125] S506. The electronic device maps the first service connection information and the device connection information of the fourth electronic device to obtain combined information, and adds the combined information to a preset queue.

[0126] If the device connection status of the fourth electronic device is not currently in the process of connecting, the electronic device can map the first service connection information corresponding to the third electronic device and the target service, as well as the device connection information of the fourth electronic device, and add them to a preset queue (e.g., a single-threaded pool) for processing.

[0127] Understandably, since the callback message receiving interface provided by the electronic device (i.e. the interface for receiving callback messages from the device management service) is multi-threaded and concurrent, in order to avoid problems caused by multi-threading, the electronic device sets up a preset queue. The business connection information obtained by parsing each callback message (e.g., the first business connection information obtained by parsing the first callback message) and the device connection information of the peer device obtained based on the business connection information (e.g., the device connection information of the fourth electronic device) are sent to the preset queue for processing, thereby avoiding problems caused by multi-threading.

[0128] S507. When the combined information arrives at the front end of the preset queue, the electronic device uses the device ID of the fourth electronic device and the service ID of the target service to obtain the second service connection information corresponding to the fourth electronic device and the target service from the local cache, and then obtains the device connection information of the third electronic device based on the second service connection information.

[0129] The second service connection information may include the device connection information of at least one peer device of the fourth electronic device. The at least one peer device of the fourth electronic device may include all peer devices that are connected to or disconnected from the fourth electronic device in connection with the target service. The device connection information of the third electronic device includes the device ID of the third electronic device and the device connection status of the third electronic device. For example, the device connection status of the third electronic device may be "connecting" or "connection established".

[0130] In some embodiments, the electronic device can obtain a second callback message corresponding to the peer device and the target service from its own device management service, then parse the second callback message to obtain the second service connection information and cache it locally. In this case, the second service connection information may include device connection information of at least one peer device of the fourth electronic device, and may also include the device status of the fourth electronic device, wherein the device status of the fourth electronic device in the second service connection information may be an updated status.

[0131] It should be noted that for details regarding how the electronic device parses the second callback message to obtain the second service connection information, please refer to the description of how the first callback message is parsed to obtain the first service connection information in the above-mentioned S502; and for details regarding the second service connection information, please refer to the description of the first service connection information in the above-mentioned S502.

[0132] In other embodiments, the electronic device may read the second service connection information from the cloud server and cache it locally when the fourth electronic device first comes online. In this case, the locally cached second service connection information may not include the device connection information of at least one peer device of the fourth electronic device, and the device state of the fourth electronic device in the second service connection information may be an initialization state.

[0133] Furthermore, if the second service connection information does not include the device connection information of at least one peer device of the fourth electronic device, then the electronic device cannot obtain the device connection information of the third electronic device from the second service connection information.

[0134] It should be noted that when an electronic device is first launched, the cloud server can synchronize the device connection information of the newly launched electronic device to the device management service of existing electronic devices (which may include the newly launched electronic device). The device management service of the existing electronic devices notifies the control center of the same electronic device. After receiving the notification, the control center can read the service connection information corresponding to the newly launched electronic device from the cloud server. The service connection information corresponding to the newly launched electronic device may not include the device connection information of at least one peer device of the newly launched electronic device. At least one peer device of the newly launched electronic device can include all peer devices that have connected to or disconnected from the newly launched electronic device for a service.

[0135] S508, Electronic Device Get Timer Singleton.

[0136] Electronic devices use a singleton timer pattern, creating only one timer instance (or timer singleton) during data processing. This facilitates management and avoids the problem of consuming computing resources due to a missed timer when there are many counters.

[0137] Understandably, after an electronic device interconnects with a peer device, there is a sequential order in which it retrieves the callback message corresponding to its own device from the device interconnection service and the callback message corresponding to the peer device. Therefore, a certain delay occurs between the electronic device retrieving the service connection information corresponding to its own device and the electronic device retrieving the service connection information corresponding to the peer device. The electronic device can use a timer singleton to calculate this delay to determine whether it is within a reasonable range.

[0138] S509. The electronic device determines whether the third electronic device corresponding to the first callback message is the local device.

[0139] After receiving the first callback message corresponding to the third electronic device, the electronic device determines whether the third electronic device is the local device, which means determining whether the received first callback message corresponds to the local device. If the third electronic device is the local device, then steps S510-S515 are executed. If the third electronic device is not the local device, then steps S515-S517 are executed.

[0140] It is understandable that since electronic devices can obtain callback messages corresponding to both themselves and peer devices from the same interface provided by their own device management service, they can determine whether a callback message corresponds to their own device after receiving it.

[0141] S510. The electronic device determines whether the first service connection information matches the second service connection information based on the device connection information of the fourth electronic device and the device connection information of the third electronic device.

[0142] The first service connection information is parsed from the first callback message corresponding to the third electronic device; the second service connection information is obtained using the device ID of the fourth electronic device from the first service connection information. If the third electronic device is the local device, the device can determine whether the first service connection information corresponding to the local device matches the second service connection information obtained using the device ID of the fourth electronic device. If the first and second service connection information match, then step S511 is executed; if the first and second service connection information do not match, then step S512 is executed.

[0143] In some embodiments, an electronic device may determine that the first service connection information and the second service connection information match when the first service connection information and the second service connection information satisfy the following two conditions: the first condition is that the first service connection information includes the device ID of the fourth electronic device and the second service connection information includes the device ID of the third electronic device; the second condition is that the device connection status of the fourth electronic device in the first service connection information is the same as the device connection status of the third electronic device in the second service connection information (for example, both have established a connection, or both have disconnected).

[0144] In some embodiments, an electronic device obtains device connection information (including the device ID of the fourth electronic device) from the first service connection information and device connection information (including the device ID of the third electronic device) from the second service connection information, indicating that the first service connection information and the second service connection information satisfy the first condition. The electronic device can determine whether the device connection status in the device connection information of the fourth electronic device is the same as the device connection status in the device connection information of the third electronic device to determine whether the first service connection information and the second service connection information satisfy the second condition.

[0145] S511. The electronic device records the first successful match information corresponding to the target service.

[0146] After an electronic device receives the first callback message corresponding to the third electronic device, if the first service connection information and the second service connection information match successfully, then the first matching success information is recorded. The first matching success information may include: the service ID of the target service, the matching result, the latency, and explanatory information. Specifically, the matching result in the first matching success information is true, indicating success. The latency in the first matching success information is 0. The explanatory information in the first matching success information indicates that the callback message corresponding to the peer device was received first.

[0147] For example, the format of the first successful match information can be: business:{business ID}, result:{match result}, delay:{delay}, detail:{description information}.

[0148] Understandably, if the first and second service connection information match successfully, and no latency is calculated, then the latency is 0. Next, the electronic device receives the first callback message corresponding to the third electronic device (the local device). It parses the first service connection information from the first callback message. The first service connection information matches successfully with the second service connection information corresponding to a fourth electronic device, indicating that the electronic device received the callback message corresponding to the fourth electronic device first (i.e., the callback message corresponding to the peer device).

[0149] S512, The electronic device determines whether the timer has started.

[0150] If the third electronic device is the local device, and the first service connection information parsed from the first callback message corresponding to the local device does not match the second service connection information obtained using the device ID of the fourth electronic device, it indicates that the electronic device has not received the callback message corresponding to the peer device. In this case, the electronic device can calculate the delay to determine if the reception of the callback message corresponding to the peer device has timed out. When calculating the delay, the electronic device can first determine if a timer has started. If the timer has not started, then execute S513. If the timer has started, then execute S514.

[0151] In some embodiments, the timer may include a polling comparison list. If the polling comparison list is not empty, it indicates that the timer has started.

[0152] S513, Electronic device start timer.

[0153] S514. The electronic device uses the device connection information of the fourth electronic device, the service ID of the target service, and the first timestamp to form a new element and adds it to the polling comparison list in the timer.

[0154] With the timer running, the electronic device can generate a first timestamp using the current moment. It then combines the device connection information of the fourth electronic device obtained from the first service connection information corresponding to its own device, the service ID of the target service, and the first timestamp to form a new element, which is added to the polling comparison list. The first timestamp is the moment the new element is added to the polling comparison list. The polling comparison list can be used to record the device connection information of the peer device obtained from the service connection information corresponding to all initially failed matches of the own device (e.g., the first service connection information corresponding to the own device). Alternatively, it can be described as the device connection information of the peer device that the service connection information corresponding to all initially failed matches of the own device is waiting for.

[0155] For example, the polling comparison list is shown in Table 2 below:

[0156] Table 2 Polling Comparison List

[0157]

[0158] Each element in the polling comparison list can include: remoteDeviceId, businessId, status, and startTimestamp. In this element, remoteDeviceId represents the device ID of the peer device, businessId represents the business ID, status represents the device connection status of the peer device, and startTimestamp can represent the first timestamp, which is used to record the moment this element was added to the polling comparison list.

[0159] Understandably, since electronic devices only create one timer instance during data processing, or use only one timer, but may participate in multiple services, requiring the determination of matching results for multiple services, electronic devices can introduce a polling comparison list into the timer to sequentially check the timeout for elements corresponding to multiple services in the polling comparison list.

[0160] In some embodiments, after the electronic device adds a new element to the polling comparison list in the timer, the new element waits for processing in the polling comparison list. The electronic device can process each element in the polling comparison list according to the timer strategy to determine the matching result corresponding to each element.

[0161] S515. The electronic device traverses and polls the comparison list to find the target element that matches the business ID of the target business and the device connection information of the third electronic device.

[0162] If the first callback message received by the electronic device corresponding to the third electronic device is not the callback message corresponding to the local device, it means that the first service connection information parsed from the first callback message is the service connection information corresponding to the peer device. In this case, the electronic device can search for the target element from the polling comparison list. The service ID in the target element is the same as the service ID of the target service, and the target element also includes the same content as the device connection information (including device ID and device connection status) of the third electronic device.

[0163] Traversing the polling comparison list can include: the electronic device accessing all elements in the polling comparison list sequentially.

[0164] For example, an electronic device can call equals(status:int,remoteDeviceId:String,businessld:String):boolean in the polling comparison list to traverse the polling comparison list and find the target element that matches the business ID of the target business and the device connection information of the third electronic device.

[0165] Optionally, if the electronic device fails to find a target element that matches the business ID of the target business and the device connection information of the third electronic device by iterating through the comparison list, the process can be terminated and the next callback message can be reprocessed.

[0166] S516. The electronic device uses the current time and the first timestamp in the target element to determine the first delay, and determines whether the first delay is less than the preset duration.

[0167] The electronic device can subtract the time recorded in the first timestamp from the current time to obtain the first delay. If the first delay is less than a preset duration (e.g., 5 seconds), it is considered that the first service connection information and the target element have successfully matched, and S517 can be executed. If the first delay is greater than or equal to the preset duration, S518 can be executed.

[0168] S517. Electronic devices record the second successful matching information corresponding to the target service.

[0169] The second successful match information may include: the target service's service ID, the matching result, the latency, and explanatory information. Specifically, the matching result in the second successful match information is true. The latency in the second successful match information is the first latency. The explanatory information in the second successful match information is the callback message received from the peer device.

[0170] Understandably, if the electronic device receives its own callback message first, it might add the peer device's connection information to the polling comparison list before it can find the target element. Therefore, after finding the target element in the polling comparison list, the electronic device generates a second matching success message, indicating that it received its own callback message first. Thus, the description in the second matching success message indicates that the peer device's callback message was received subsequently.

[0171] S518. Electronic devices record the first matching failure information corresponding to the target service.

[0172] The first match failure message may include: the target service's business ID, the match result, the latency, and a description. Specifically, the match result in the first match failure message is false, indicating a match failure. The latency in the first match failure message is equal to the first latency. The description in the first match failure message is a timeout.

[0173] S519. The electronic device removes the target element from the polled comparison list.

[0174] After S517 or S518, the electronic device removes the target element from the polling comparison list to prevent timeout checks from being performed on the target element again.

[0175] In this embodiment, the electronic device can determine the first total number of successes and the first total number of failures based on the matching success information or matching failure information corresponding to all services executed within a preset sampling period; then add the first total number of successes and the first total number of failures to obtain the total number; and use the first total number of successes divided by the total number to obtain the success rate of information synchronization of the device management service.

[0176] Secondly, the electronic device can also count the number of times it attaches and removes service balls on the control center interface within the preset sampling period; then, the number of times it attaches and removes service balls is added together to obtain the first total number of changes. Then, the first total number of successful changes is subtracted from the first total number of changes to obtain the number of times the ball-attaching compensation mechanism takes effect.

[0177] The first total number of successful matches can be equal to the total number of successful matches in all matching results corresponding to all services executed within the preset sampling period. The first total number of failed matches can be equal to the total number of failed matches in all matching results corresponding to all services executed within the preset sampling period. The information synchronization success rate of the device management service can be equal to the first total number of successful matches divided by the sum of the first total number of successful matches and the first total number of failed matches.

[0178] It is understood that, in this embodiment of the application, after receiving a service connection operation, the electronic device can receive a first callback message from its own device management service, and then parse the first service connection information corresponding to the third electronic device from the first callback message. Then, the electronic device can obtain the second service connection information corresponding to the peer device (i.e., the fourth electronic device) of the third electronic device based on the first service connection information corresponding to the third electronic device. If these two service connection information (including the first and second service connection information) include each other's device IDs, and the device connection states included in these two service connection information are the same (e.g., both are established or disconnected), then it is considered that the device management service has successfully synchronized information during the connection or disconnection process of the target service, and a matching success message is recorded (e.g., the aforementioned first matching success message or second matching success message). If the device IDs in these two service connection information do not include each other's device IDs, and / or the device connection states included in these two service connection information are different, then it is considered that the electronic device has not received the service connection information corresponding to the peer device, the information synchronization of the device management service has failed, and a matching failure message is recorded (e.g., the aforementioned first matching failure message). Finally, the electronic device determines the first total number of successes and the first total number of failures based on the matching results (e.g., matching success information or matching failure information) of all services executed within the preset sampling period. The information synchronization success rate of the device management service can then be determined based on the first total number of successes and the first total number of failures. Alternatively, the first total number of successes can be obtained by subtracting the first total number of changes of the service ball in the control center interface of the electronic device from the first total number of changes.

[0179] In some embodiments, the first service connection information may include device connection information of multiple peer devices interconnected with the third electronic device, or it may be empty. The process by which the electronic device obtains the device connection information of the fourth electronic device from the first service connection information also differs depending on the circumstances.

[0180] refer to Figure 6 This describes the process by which an electronic device obtains the device connection information of a fourth electronic device from the first service connection information. For example... Figure 6 As shown, the data processing method provided in this application embodiment may include S601-S602 before S504, and S504 may include S603-S610.

[0181] S601. The electronic device obtains the second timestamp, which is the moment when the second callback message corresponding to the fourth electronic device is obtained during the connection or disconnection process of the target service.

[0182] The electronic device can use the current time as a second timestamp. If latency needs to be calculated later, the second timestamp can be used to represent the moment when the electronic device receives the second callback message corresponding to the fourth electronic device during the connection or disconnection process of the target service. In this case, the electronic device can use the second timestamp as the start time for latency calculation.

[0183] S602, The electronic device obtains the first historical service connection information corresponding to the third electronic device and the target service.

[0184] After the electronic device receives a service trigger operation, it obtains the first historical callback information. The first historical service connection information is obtained by parsing the first historical callback information.

[0185] It should be noted that the details of the first historical callback information can be found in the introduction to the first callback information in S501 above; the details of the first historical business connection information can be found in the introduction to the first business connection information in S502 above, and will not be repeated here.

[0186] It should also be noted that when the first service connection information includes multiple peer devices connected to the electronic device for the target service, the electronic device cannot accurately obtain the device connection information of the fourth electronic device solely based on the first service trigger operation parsed after receiving the service trigger operation. When the service trigger operation is used to trigger the disconnection of the electronic device from a peer device for the target service, since the first service connection information does not include the device connection information of the peer device disconnected from the third electronic device, the electronic device cannot accurately obtain the device connection information of the fourth electronic device solely based on the first service trigger operation parsed after the service trigger operation. In summary, in both of the above situations, the electronic device cannot accurately obtain the device connection information of the fourth electronic device solely based on the first service trigger operation parsed after the service trigger operation. Therefore, the electronic device can obtain the device connection information of the fourth electronic device by utilizing the first historical service connection information.

[0187] S603. The electronic device determines whether the first service connection information is empty.

[0188] If the first service connection information corresponding to the third electronic device and the target service is not empty, or in other words, non-empty, then execute S604. If the first service connection information is empty, then execute S609.

[0189] S604. The electronic device determines whether the first historical service connection information is empty.

[0190] If the first historical service connection information corresponding to the third electronic device and the target service is empty, then execute S605. If the first historical service connection information is not empty, then execute S606.

[0191] S605. When the electronic device traverses the device connection information of a first peer device in the first service connection information and the device connection information of the first peer device is valid, it determines the device connection information of the first peer device as the device connection information of the fourth electronic device.

[0192] If the first historical service connection information is empty, or if the first service connection information is not empty, it indicates that the service triggering operation is to trigger an electronic device to establish a connection for the target service with a peer device. In this case, the electronic device iterates through the first service connection information. If the device connection information of a peer device found in the first service connection information is valid, then this peer device's device connection information is used as the device connection information of the fourth electronic device. Optionally, the peer device's device connection information in the first service connection information can be referred to as the device connection information of the first peer device.

[0193] Specifically, accessing the device connection information of a peer device within the first service connection information can mean that the electronic device accesses the device connection information of a peer device within the first service connection information during the process of traversing the first service connection information. Traversing the first service connection information can include accessing the device connection information of all peer devices within the first service connection information sequentially.

[0194] Furthermore, after processing the device connection information of the first peer device, the electronic device continues to traverse the first service connection information to determine the device connection information of the next first peer device. If the device connection information of the next first peer device is valid, then the device connection information of the next first peer device is determined as the new device connection information of the fourth electronic device. When the electronic device completes the traversal of the first service connection information, the process of determining the device connection information of the fourth electronic device from the first service connection information ends.

[0195] In some embodiments, valid device connection information for the first peer device may mean that the device connection information for the first peer device is not empty, and that the device connection information for the first peer device includes the device ID of the peer device.

[0196] S606. The electronic device determines whether the number of device connection information included in the first service connection information is greater than the number of device connection information included in the first historical service connection information.

[0197] If the first historical service connection information is not empty, the electronic device determines whether the number of device connection information included in the first service connection information is greater than the number of device connection information included in the first historical service connection information. If the number of device connection information included in the first service connection information is greater than the number of device connection information included in the first historical service connection information, step S607 can be executed. If the number of device connection information included in the first service connection information is not greater than the number of device connection information included in the first historical service connection information, step S608 can be executed. Here, "not greater than" can include less than and equal to.

[0198] S607. When the electronic device traverses the device connection information of a first peer device in the first service connection information, and the device connection information of the first peer device is valid and does not belong to the first historical service connection information, the device connection information of the first peer device is determined as the device connection information of the fourth electronic device.

[0199] If the number of device connection information entries in the first service connection information is greater than the number of device connection information entries in the first historical service connection information, it indicates that the number of device connection information entries in the first service connection information has increased after receiving the service trigger operation. Therefore, the service trigger operation is used to trigger the connection of the electronic device with a peer device for the target service. At this time, the electronic device iterates through the first service connection information. If a device connection entry for a first peer device in the first service connection information is valid, the first historical service connection information is iterated based on the first peer device's device connection information. If it is determined that the device connection information of this peer device exists in the first historical service connection information, then the device connection information of the first peer device does not need to be processed.

[0200] Furthermore, after processing the device connection information of the first peer device, the electronic device continues to traverse the first service connection information to determine the device connection information of the next first peer device. If the device connection information of the next first peer device is valid and does not belong to the first historical service connection information, then the device connection information of the next first peer device is determined as the new device connection information of the fourth electronic device. When the electronic device completes the traversal of the first service connection information, the process of determining the device connection information of the fourth electronic device from the first service connection information ends.

[0201] The statement that the device connection information of the first peer device exists in the first historical service connection information can mean that the device connection information of the first peer device is completely identical to the device connection information of a second peer device in the first historical service connection information. This complete identity can include the same device ID, device connection status, and role as the second peer device. Optionally, the device connection information of the peer device in the first historical service connection information can be referred to as the device connection information of the second peer device.

[0202] S608. When the electronic device traverses the device connection information of a second peer device in the first historical service connection information, and the device connection information of the second peer device is valid and does not belong to the first service connection information, the device connection status in the device connection information of the second peer device is updated to disconnected, and then the device connection information of the second peer device is determined as the device connection information of the fourth electronic device.

[0203] If the number of device connection information entries included in the first service connection information is greater than the number of device connection information entries included in the first historical service connection information, it indicates that the number of device connection information entries in the first service connection information has decreased after receiving the service trigger operation. Therefore, the service trigger operation is used to trigger the electronic device to disconnect from a peer device for the target service. At this time, the electronic device can iterate through the first historical service connection information. If the device connection information of a second peer device found in the first historical service connection information is valid, the first service connection information is iterated based on the device connection information of the second peer device. If it is determined that the device connection information of the second peer device does not exist in the first service connection information, the device connection status in the device connection information of the second peer device can be updated to disconnected. If it is determined that the device connection information of the second peer device is not valid, and / or the device connection information of the second peer device exists in the first service connection information, the device connection information of the second peer device can be left unprocessed.

[0204] Furthermore, after processing the device connection information of the second peer device, the electronic device continues to traverse the first historical service connection information to determine the device connection information of the next second peer device. If the device connection information of the next second peer device is valid and does not belong to the first service connection information, then the device connection status in the device connection information of the next second peer device is updated to disconnected, and then the device connection information of the next second peer device is determined as the new device connection information of the fourth electronic device. When the electronic device completes the traversal of the first historical service connection information, the process of determining the device connection information of the fourth electronic device from the first service connection information ends.

[0205] The statement that the device connection information of the second peer device exists in the first service connection information can mean that the device connection information of the second peer device is completely identical to the device connection information of one of the first peer devices in the first service connection information. This complete similarity can include the second peer device having the same device ID, device connection status, and role as the first peer device.

[0206] Understandably, since the device status information of the second peer device in the first historical service connection information is either in the process of connecting or has already been established, and the service triggering operation is used to trigger the electronic device to disconnect from a peer device for the target service, the electronic device needs to update the device connection status of the second peer device to disconnected. This ensures that the device connection status of the second peer device matches the service triggering operation and prevents discrepancies from occurring when comparing the device connection information of the two disconnected devices later.

[0207] S609. The electronic device determines whether the first historical service connection information is empty.

[0208] After the electronic device determines that the first service connection information corresponding to the third electronic device and the target service is empty, if the first historical service connection information is not empty, then S610 is executed; if the first historical service connection information is empty, the electronic device cannot obtain the device connection information of the fourth electronic device, and the process of determining the device connection information of the fourth electronic device from the first service connection information is directly terminated.

[0209] S610. When the electronic device traverses the device connection information of a second peer device in the first historical service connection information and the device connection information of the second peer device is valid, it updates the device connection status in the device connection information of the second peer device to disconnected, and then determines the device connection information of the second peer device as the device connection information of the fourth electronic device.

[0210] If the first service connection information is empty, but the first historical service connection information is not empty, it means that the number of device connection information entries in the first service connection information decreased after receiving the service trigger operation. This indicates that the service trigger operation was used to trigger the electronic device to disconnect from a peer device for the target service. At this time, the electronic device can iterate through the first historical service connection information. If the device connection information of a second peer device found in the first historical service connection information is valid, the device connection status in the second peer device's device connection information can be updated to disconnected. If it is determined that the device connection information of the second peer device is not valid, then the device connection information of the second peer device can be left unprocessed.

[0211] Furthermore, after processing the device connection information of the second peer device, the electronic device continues to traverse the first historical service connection information to determine the device connection information of the next second peer device. If the device connection information of the next second peer device is valid, the device connection status in the device connection information of the next second peer device is updated to disconnected, and then the device connection information of the next second peer device is determined as the new device connection information of the fourth electronic device. When the electronic device completes the traversal of the first historical service connection information, the process of determining the device connection information of the fourth electronic device from the first service connection information ends.

[0212] Understandably, by executing the above process, electronic devices can accurately filter out the device connection information of a fourth electronic device that has established or disconnected a connection with a third electronic device.

[0213] refer to Figure 7 This describes the process by which an electronic device acquires the second service connection information corresponding to a fourth electronic device and a target service, and then obtains the device connection information of a third electronic device based on the second service connection information. For example... Figure 7 As shown, S507 in the data processing method provided in this application embodiment may include S701-S711.

[0214] S701. The electronic device uses the device ID of the fourth electronic device to obtain the third service connection information corresponding to the fourth electronic device from the local cache.

[0215] The third service connection information is used to record the device connection information of all peer devices that connect with the fourth electronic device. If the electronic device cannot obtain the third service connection information from the local cache, it can report an error and end the process of determining the matching success information or matching failure information corresponding to the target service (i.e., S508-S519 will no longer be executed).

[0216] S702. The electronic device uses the service ID of the target service to obtain the second service connection information corresponding to the fourth electronic device and the target service from the third service connection information.

[0217] The third service connection information may include device connection information for all peer devices that are connected to the fourth electronic device for different services. Therefore, the electronic device can use the service ID of the target service to obtain the second service connection information corresponding to the fourth electronic device and the target service from the third service connection information. If the electronic device cannot obtain the second service connection information from the third service connection information, it can report an error and terminate the process of determining the matching success or failure information corresponding to the target service (i.e., S508-S519 will no longer be executed).

[0218] S703. The electronic device uses the device ID of the third electronic device to obtain the device connection information of the third electronic device from the second service connection information.

[0219] Since the electronic device obtains the device ID of the fourth electronic device from the first service connection information corresponding to the third electronic device, the third electronic device is the peer device of the fourth electronic device. Therefore, the electronic device can directly obtain the device connection information of the third electronic device from the second service connection information corresponding to the fourth electronic device.

[0220] S704. The electronic device determines whether the device connection information of the third electronic device is empty.

[0221] If the device connection information of the third electronic device is not empty, the process of obtaining the device connection information of the third electronic device ends, and S508 is executed. If the device connection information of the third electronic device is empty, S705 is executed.

[0222] S705. The electronic device acquires the second historical service connection information corresponding to the fourth electronic device and the target service.

[0223] After the electronic device receives a service trigger operation, it obtains the second historical callback information corresponding to the fourth electronic device and the target service. The second historical service connection information can be obtained by parsing the second historical callback information.

[0224] It should be noted that for details of the second historical callback information, please refer to the introduction of the second callback information in S507 above; for details of the second historical business connection information, please refer to the introduction of the second business connection information in S507 above, and will not be repeated here.

[0225] It is understandable that if the device connection information of the third electronic device obtained by the electronic device from the second service connection information is empty, it means that the service triggering operation is used to trigger the electronic device to disconnect from a peer device for the target service. In this case, the electronic device can obtain the second historical service connection information to re-obtain the device connection information of the third electronic device based on the second historical service connection information.

[0226] S706. Electronic devices determine whether the second historical service connection information is empty.

[0227] If the second historical service connection information is not empty, then execute S707. If the second historical service connection information is empty, then execute S709.

[0228] S707. When an electronic device encounters device connection information of a third peer device in the second historical service connection information, and the device ID in the device connection information of the third peer device is the device ID of the third electronic device, the electronic device determines the device connection information of the third peer device as the device connection information of the third electronic device.

[0229] The electronic device iterates through the second historical service connection information. If the device ID in the device connection information of a third peer device is the device ID of the third electronic device, the device connection information of the third peer device is determined as the device connection information of the third electronic device.

[0230] S708, The electronic device updates the device status information in the device connection information of the third electronic device to disconnected.

[0231] Understandably, when a service trigger operation is used to disconnect an electronic device from a peer device for a target service, the electronic device obtains the device connection information of the third electronic device from the second historical service connection information. Since the device connection information of the third electronic device is obtained from the second historical service connection information, and the device status information in the third electronic device's device connection information indicates either "connecting" or "connected," the electronic device needs to update the device connection status in the third electronic device's device connection information to "disconnected." This ensures that the device connection status in the third electronic device's device connection information matches the service trigger operation and prevents discrepancies in subsequent comparisons of the device connection information of the two disconnected devices.

[0232] S709. The electronic device determines whether the device connection information of the third electronic device is empty.

[0233] After the electronic device updates the device status information in the reacquired device connection information of the third electronic device to "disconnected," it can then determine whether the device connection information of the third electronic device is empty. If the device connection information of the third electronic device is not empty, the process of acquiring the device connection information of the third electronic device ends, and S508 is executed. If the device connection information of the third electronic device is empty, S710 is executed.

[0234] It is understandable that during the disconnection process of the third and fourth electronic devices for the target service, the fourth electronic device may go offline and then come back online. In this case, the device connection information of the third electronic device cannot be obtained from the second service connection information corresponding to the fourth electronic device, and if the second historical service connection information corresponding to the fourth electronic device is empty, the device connection information of the third electronic device also cannot be obtained from the second historical service connection information. If the fourth electronic device goes offline and then comes back online during the disconnection process for the target service, and the device connection status of both the third and fourth electronic devices is disconnected, meaning the target service is disconnected and the service ball of the receiver in both the third and fourth electronic devices is successfully removed, this situation (i.e., the fourth electronic device going offline and then coming back online during the disconnection process for the target service) does not constitute an abnormal situation of service ball attachment or removal, and a successful matching information should be recorded. Therefore, for the scenario where the fourth electronic device goes offline and then comes back online, the electronic device can again check whether the device connection information of the third electronic device is empty. If the device connection information of the third electronic device is not empty, it means that the device connection information of the third electronic device has been successfully retrieved again, and the process of retrieving the device connection information of the third electronic device ends, and S508 is executed. If the device connection information of the third electronic device is empty, it means that the fourth electronic device went offline and then came back online during the disconnection process of the target service, and the process of obtaining the device connection information of the third electronic device continues.

[0235] S710. The electronic device determines whether the device connection status of the fourth electronic device obtained from the first service connection information is disconnected.

[0236] If the device connection status of the fourth electronic device obtained from the first service connection information is disconnected, it means that the fourth electronic device went offline and then came back online during the disconnection process of the target service, and S711 continues to be executed. If the device connection status of the fourth electronic device obtained from the first service connection information is not disconnected, an error can be reported, and the process of determining the matching success information or matching failure information corresponding to the target service can be terminated (i.e., S508-S519 will no longer be executed).

[0237] S711. The electronic device determines that the newly created device connection information is the device connection information of the third electronic device. The newly created device connection information includes the device ID of the third electronic device, and the device connection status in the newly created device connection information is disconnected.

[0238] When the electronic device executes step S711, it indicates that the fourth electronic device went offline and then back online during the disconnection process of the target service. This situation (i.e., the fourth electronic device going offline and then back online during the disconnection process of the target service) does not fall under the category of abnormal service ball attachment or removal, and a successful match should be recorded. Therefore, the electronic device can create a new device connection information and use this new device connection information as the device connection information of the third electronic device for subsequent processing. By using the newly created device connection information as the device connection information of the third electronic device for subsequent processing, the electronic device can obtain the first successful match information corresponding to the target service.

[0239] It is understandable that electronic devices perform different operations to determine the matching result for the target service when connecting to the peer device for the target service, disconnecting from the peer device for the target service, or when a fourth electronic device goes offline and then comes back online during the disconnection process for the target service. Therefore, this solution can accurately obtain the matching result for the target service in multiple situations, thereby accurately calculating the first total number of successes and the first total number of failures of the device management service, and then accurately determining the information synchronization success rate of the device management service and the number of times the "hanging ball compensation mechanism" takes effect.

[0240] refer to Figure 8 This describes the process by which an electronic device processes each element in a polling comparison list according to a timer strategy. For example... Figure 8 As shown, the data processing method provided in this application embodiment may further include S801-S806.

[0241] S801. The electronic device traverses the polling comparison list according to a preset traversal period, and for an element in the traversed polling comparison list, determines the second delay using the current time and the first timestamp in that element.

[0242] The electronic device traversing the polling comparison list according to a preset traversal period can mean that the electronic device sequentially accesses all elements in the polling comparison list according to the preset traversal period, and at the beginning of each preset traversal period, only one element in the polling comparison list is accessed. For example, the duration of the preset traversal period can be 0.5 seconds (s).

[0243] The first timestamp in this element can be the time when the element was added to the polling comparison list.

[0244] For example, an electronic device can obtain a second delay by subtracting the first timestamp in the element from the current time.

[0245] S802, The electronic device determines whether the second delay is less than the preset duration.

[0246] If the second delay is not less than (i.e., greater than or equal to) the preset duration, it means that an element in the polling comparison list has timed out, and S803 is executed. If the second delay is less than the preset duration, it means that an element in the polling comparison list has not timed out, and no processing is done on that element. The next element in the polling comparison list is accessed when the next preset traversal cycle begins.

[0247] S803, The electronic device records the second matching failure information corresponding to the service in the element.

[0248] The second match failure information may include: the business ID of the service in the element, the match result, the latency, and a description. The match result in the first match failure information is false, indicating a match failure. The latency in the first match failure information is equal to the second latency. The description in the first match failure information is a timeout.

[0249] S804. The electronic device removes the element from the polled comparison list.

[0250] After the electronic device records the second matching failure information corresponding to the service in the element, it can delete the element from the polling comparison list to avoid repeated timeout checks on the element.

[0251] S805, Electronic devices determine whether the polling comparison list is empty.

[0252] If the polling comparison list is empty, execute S806. If the polling comparison list is not empty, wait for the start of the next preset traversal cycle to access the next element in the polling comparison list.

[0253] S806, Electronic device shutdown timer.

[0254] It should be noted that the steps performed by the above electronic device (including S501-S519, S601-S610, S701-S711, and S801-S806) can be performed by the control center in the electronic device.

[0255] This application also provides a data processing method applied to a data processing system. The data processing system may include multiple electronic devices and a cloud server. Each of the multiple electronic devices can execute the steps described above (including S501-S519, S601-S610, S701-S711, and S801-S806) to determine the matching result corresponding to the target service and send the matching result to the cloud server. Then, the cloud server can determine a second total success count and a second total failure count based on all matching results received from the multiple electronic devices within a preset sampling period. The information synchronization success rate of the device management service can then be determined based on the second total success count and the second total failure count. Furthermore, the number of times the "hanging ball compensation mechanism" takes effect can be obtained by subtracting the second total success count from the second total number of changes to the service ball in the control center interface of the multiple electronic devices.

[0256] The second total number of successes can be equal to the total number of successful matches among all matching results received from multiple electronic devices within a preset sampling period. The second total number of failures can be equal to the total number of failed matches among all matching results received from multiple electronic devices within a preset sampling period. The information synchronization success rate of the device management service can be equal to the second total number of successes divided by the sum of the second total number of successes and the second total number of failures. The second total number of changes can be equal to the sum of the first total number of changes from multiple electronic devices.

[0257] For example, combined Figure 4 Taking a data processing system comprising a first electronic device and a second electronic device, where the first electronic device is the initiator of the target service and the second electronic device is the recipient of the target service, and the successful synchronization of information between the first device management service and the second device management service as an example, this paper describes the process by which the data processing system executes data processing methods. Figure 9 As shown, the data processing methods applied to the data processing system may include S901-S911.

[0258] S901, after S408, the first control center in the first electronic device obtains the device ID of the local machine from the service connection information corresponding to the second electronic device and the target service.

[0259] S902. The first control center uses its own device ID to request the fourth service connection information corresponding to the first electronic device and the target service from the first device management service.

[0260] S903. The first control center obtains the device connection information of the peer device based on the fourth service connection information corresponding to the first electronic device and the target service. The peer device is the second electronic device.

[0261] S904. The first control center searches the polling comparison list to see if there is a target element that matches the target service's service ID and the device connection information of the peer device.

[0262] S905. If there is no target element in the polling comparison list that matches the service ID of the target service and the device connection information of the peer device, the timer sends a first message to the first control center indicating that there is no matching result.

[0263] S906, after S408, the first control center receives device connection information from the local machine of the first device management service, as well as fifth service connection information corresponding to the first electronic device and the target service.

[0264] S907. The first control center obtains the device connection information of the second electronic device from the fifth service connection information.

[0265] S908. The first control center requests the first equipment management service to obtain the sixth service connection information corresponding to the second electronic device and the target service.

[0266] S909, The first control center obtains the device connection information of the first electronic device from the sixth service connection information.

[0267] S910. The first control center determines that the fifth service connection information and the sixth service connection information are successfully matched based on the device connection information of the second electronic device obtained from the fifth service connection information and the device connection information of the first electronic device obtained from the sixth service connection information, and records the first matching success information.

[0268] It should be noted that for details about S910, please refer to the above introduction of S510, which will not be repeated here.

[0269] S911, The first control center sends the first matching success message to the cloud server.

[0270] It should be noted that the second electronic device can also determine the matching result corresponding to the current service after S412. The process by which the second electronic device determines the matching result corresponding to the current service can be referred to the description of the first electronic device determining the matching result corresponding to the current service in S901-S911 above, and will not be repeated here.

[0271] For example, combined Figure 4 Taking a data processing system comprising a first electronic device and a second electronic device, where the first electronic device is the initiator of the target service and the second electronic device is the recipient of the target service, and an example of a failure in information synchronization between the first device management service and the second device management service, this paper describes the process by which the data processing system executes data processing methods. Figure 10 As shown, the data processing methods applied to the data processing system may include S1001-S1008.

[0272] S1001, after S410, the first control center in the first electronic device obtains the device ID of the peer device from the service connection information corresponding to the first electronic device and the target service. The peer device is the second electronic device.

[0273] S1002. The first control center uses the device ID of the peer device to request the seventh service connection information corresponding to the second electronic device and the target service from the first device management service.

[0274] S1003. The first control center obtains the device connection information of the local machine based on the seventh service connection information corresponding to the first electronic device and the target service.

[0275] S1004. The first control center starts a timer and adds a new element, consisting of the device connection information of the peer device, the service ID of the target service, and the first timestamp, to the polling comparison list in the timer.

[0276] S1005. The first control center traverses the polling comparison list according to the preset traversal cycle, and for an element in the traversed polling comparison list, it determines the second delay using the current time and the first timestamp in that element.

[0277] S1006. The first control center records the second matching failure information corresponding to the service in the element when the second delay is not less than the preset duration.

[0278] S1007, The first control center removes the element from the polling comparison list.

[0279] S1008, The first control center sends a second matching failure message to the cloud server.

[0280] It should be noted that the second electronic device can also determine the matching result corresponding to the current service after S412. The process by which the second electronic device determines the matching result corresponding to the current service can be referred to the description of the first electronic device determining the matching result corresponding to the current service in S1001-S1008 above, and will not be repeated here.

[0281] It should also be noted that the third electronic device in the embodiments of this application is equivalent to the first target device in the invention, and the fourth electronic device is equivalent to the second target device in the invention.

[0282] It is understood that, in order to achieve the aforementioned functions, the electronic device includes corresponding hardware structures and / or software modules for performing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0283] This application embodiment can divide the above-described electronic device into functional modules based on the method example described above. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.

[0284] This application also provides an electronic device, which includes: a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the method as described above.

[0285] This application also provides a computer-readable storage medium including computer instructions; wherein, when the computer instructions are executed on an electronic device, the electronic device performs the method as described above; and when the computer instructions are executed on a data processing system, the electronic device performs the method as described above.

[0286] This application also provides a computer program product comprising executable instructions; wherein, when the computer program product is run on an electronic device, the electronic device performs the method as described above; and when the computer instructions are run on a data processing system, the electronic device performs the method as described above.

[0287] This application also provides a chip system, such as... Figure 11 As shown, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 are interconnected via lines. For example, the interface circuit 1102 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 1102 can be used to send signals to other devices (e.g., the processor 1101).

[0288] For example, interface circuit 1102 can read instructions stored in memory and send those instructions to processor 1101. When the instructions are executed by processor 1101, the chip system can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application embodiment does not specifically limit this.

[0289] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0290] In the several embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0291] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0292] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0293] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0294] The above content is only a specific implementation of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the protection scope of this application.< / deviceconnectioninfo>

Claims

1. A data processing method, characterized in that, Applied to electronic devices, the electronic devices including device management services, the method includes: After receiving a service trigger operation, a first callback message corresponding to the first target device is obtained from the device management service. The service trigger operation is used to trigger the electronic device to connect or disconnect from other electronic devices for the target service. The first target device is the electronic device or the other electronic device. The first callback message is parsed to obtain the first service connection information corresponding to the first target device and the target service. The first service connection information includes the device connection information of at least one peer device of the first target device. The at least one peer device of the first target device includes: a peer device that connects or disconnects from the first target device to perform the target service. Obtain the device connection information of the second target device from the first service connection information, and use the device ID of the second target device and the service ID of the target service to obtain the second service connection information corresponding to the second target device and the target service from the local cache; Based on the first service connection information and the second service connection information, a matching result corresponding to the current service is obtained. The matching result corresponding to the current service is used to indicate that the information synchronization of the device management service is successful or to indicate that the information synchronization of the device management service fails. The matching result corresponding to the current service is used to determine the success rate of the information synchronization of the device management service.

2. The method according to claim 1, characterized in that, The method further includes: Statistically analyze the matching results corresponding to at least one business executed within a preset sampling period; The success rate of information synchronization of the device management service is determined based on the matching results corresponding to the at least one service, wherein the matching results corresponding to the at least one service include the matching results corresponding to the current service.

3. The method according to claim 2, characterized in that, The step of determining the success rate of information synchronization of the device management service based on the matching results corresponding to the at least one service includes: Based on the matching results corresponding to the at least one service, a first total number of successes and a first total number of failures are determined. The first total number of successes is equal to the total number of successful matching messages in the matching results corresponding to the at least one service, and the first total number of failures is equal to the total number of failed matching messages in the matching results corresponding to the at least one service. The success rate of information synchronization for the device management service is obtained based on the first total number of successes and the first total number of failures.

4. The method according to claim 3, characterized in that, The method further includes: The number of times the electronic device displays the attachment of a service ball and the number of times the electronic device displays the removal of a service ball are counted within the preset sampling period. The total number of times the electronic device displays the number of times the service ball is attached and the total number of times the electronic device removes the service ball are added together to obtain the first total number of changes; Subtract the first total number of successes from the first total number of changes to obtain the number of times the ball-hanging compensation mechanism takes effect.

5. The method according to any one of claims 1-4, characterized in that, After obtaining the device connection information of the second target device from the first service connection information, the method further includes: When the device connection status of the second target device is either established or disconnected, the first service connection information and the device connection information of the second target device are mapped to obtain combined information, and the combined information is added to a preset queue. The step of retrieving the second service connection information corresponding to the second target device and the target service from the local cache using the device ID of the second target device and the service ID of the target service includes: When the combined information arrives at the front end of the preset queue, the device ID of the second target device and the service ID of the target service are used to retrieve the second service connection information corresponding to the second target device and the target service from the local cache.

6. The method according to any one of claims 1-4, characterized in that, The step of obtaining the matching result corresponding to the current service based on the first service connection information and the second service connection information includes: Based on the second service connection information, the device connection information of the first target device is obtained; If the first target device is the electronic device, it is determined whether the first service connection information and the second service connection information match based on the device connection information of the first target device and the device connection information of the second target device. If the device connection information of the first target device includes the device ID and device connection status of the first target device, and the device connection information of the second target device includes the device ID and device connection status of the second target device, and the device connection status of the first target device and the device connection status of the second target device are the same, then the first service connection information and the second service connection information are determined to match, and the first matching success information corresponding to the target service is recorded. The matching result corresponding to the current service includes the first matching success information.

7. The method according to any one of claims 1-4, characterized in that, The step of obtaining the matching result corresponding to the current service based on the first service connection information and the second service connection information includes: Based on the second service connection information, the device connection information of the first target device is obtained; If the first target device is the other electronic device, a target element matching the service ID of the target service and the device connection information of the first target device is searched from the polling comparison list. The service ID in the target element is the same as the service ID of the target service, and the target element also includes the same content as the device connection information of the first target device. The first time delay is determined using the current time and the first timestamp in the target element; If the first delay is less than a preset duration, record the second matching success information corresponding to the target service, and the matching result corresponding to the current service includes the second matching success information; If the first delay is greater than or equal to a preset duration, the first matching failure information corresponding to the target service is recorded, and the matching result corresponding to the current service includes the first matching failure information.

8. The method according to claim 7, characterized in that, The method further includes: The electronic device removes the target element from the polling comparison list.

9. The method according to claim 6, characterized in that, The method further includes: In the event that the first service connection information and the second service connection information do not match, and the timer is started, a new element is formed by using the device connection information of the second target device, the service ID of the target service, and the first timestamp, and added to the polling comparison list in the timer. The first timestamp is the time when the new element is added to the polling comparison list. Based on the timer strategy, the matching result corresponding to each element in the polling comparison list is determined.

10. The method according to claim 9, characterized in that, The electronic device determines the matching result corresponding to each element in the polling comparison list according to a timer strategy, including: The polling comparison list is traversed according to a preset traversal period, and for an element in the polling comparison list that is traversed, the second delay is determined using the current time and the first timestamp in the element. If the second delay is greater than or equal to a preset duration, record the second matching failure information corresponding to the service in the element, and delete the element from the polling comparison list.

11. The method according to any one of claims 1-4, characterized in that, The method further includes: The service trigger operation is received on a first interface, which includes a first device ball corresponding to the electronic device and a second device ball corresponding to the other electronic devices. In response to the business trigger operation, add or remove a business ball in the first interface.

12. The method according to claim 11, characterized in that, The process of attaching or removing a business ball in the first interface includes: When the service triggering operation is used to trigger the electronic device to connect with the other electronic device to perform a target service, the electronic device hangs the service ball on the first device ball or the second device ball; When the service triggering operation is used to trigger the disconnection of the electronic device from the other electronic device for the target service, the electronic device removes the service ball from the first device ball or the second device ball.

13. A data processing method, characterized in that, The method is applied to a data processing system, which includes a first electronic device and a cloud server, and includes: After receiving a service triggering operation, the first electronic device obtains a first callback message corresponding to the first target device from the device management service included in the first electronic device. The service triggering operation is used to trigger the electronic device to connect or disconnect from other electronic devices for the target service. The first target device is the electronic device or the other electronic device. The first electronic device parses the first callback message to obtain first service connection information corresponding to the first target device and the target service. The first service connection information includes device connection information of at least one peer device of the first target device. The at least one peer device of the first target device includes: a peer device that connects or disconnects from the first target device for the target service. The first electronic device obtains the device connection information of the second target device from the first service connection information, and uses the device ID of the second target device and the service ID of the target service to obtain the second service connection information corresponding to the second target device and the target service from the local cache; The first electronic device obtains the matching result corresponding to the current service based on the first service connection information and the second service connection information, wherein the matching result corresponding to the current service is used to indicate that the information synchronization of the device management service is successful, or to indicate that the information synchronization of the device management service fails. The first electronic device sends the matching result corresponding to the current service to the cloud server; The cloud server determines the success rate of information synchronization for the device management service based on the matching results corresponding to the current business.

14. The method according to claim 13, characterized in that, The data processing system includes multiple electronic devices, including the first electronic device. The cloud server determines the success rate of information synchronization for the device management service based on the matching result corresponding to the current service, including: The cloud server determines the success rate of information synchronization of the device management service based on the matching results received from the multiple electronic devices within a preset sampling period, wherein the matching results received from the multiple electronic devices include the matching results corresponding to the current service.

15. The method according to claim 14, characterized in that, The cloud server determines the success rate of information synchronization for the device management service based on the matching results received from the multiple electronic devices within a preset sampling period, including: The cloud server determines a second total number of successes and a second total number of failures based on the matching results received from the multiple electronic devices within a preset sampling period. The second total number of successes is equal to the total number of successful matching messages in the matching results received from the multiple electronic devices, and the second total number of failures is equal to the total number of failed matching messages in the matching results received from the multiple electronic devices. The cloud server obtains the success rate of information synchronization for the device management service based on the second total number of successes and the second total number of failures.

16. The method according to claim 15, characterized in that, The method further includes: The cloud server counts the number of times the multiple electronic devices display the attachment of a service ball and the number of times the multiple electronic devices display the removal of a service ball within the preset sampling period; The cloud server adds the number of times the multiple electronic devices displayed the attached service ball and the number of times the multiple electronic devices removed the service ball to obtain the second total number of changes; The cloud server subtracts the second total number of successes from the second total number of changes to obtain the number of times the ball-hanging compensation mechanism takes effect.

17. An electronic device, characterized in that, The electronic device includes: a processor, a memory, and a communication interface; the memory and the communication interface are coupled to the processor, the memory is used to store computer program code, the computer program code including computer instructions; wherein, when the processor executes the computer instructions, the electronic device performs the method as described in any one of claims 1-12.

18. A data processing system, characterized in that, The data processing system includes: a first electronic device and a cloud server for performing the method as described in any one of claims 13-16.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions; wherein, when the computer instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-12; Alternatively, when the computer instructions are executed on the data processing system, the data processing system is caused to perform the method as described in any one of claims 13-16.

20. A chip system, characterized in that, The chip system includes a processor and an interface circuit, which are interconnected via a line; wherein the interface circuit is used to receive a first signal from an electronic device and send the first signal to the processor, the first signal including a first computer instruction; when the processor executes the first computer instruction, the chip system performs the method as described in any one of claims 1-12; Alternatively, the interface circuit is configured to receive a second signal from the data processing system and send the second signal to the processor, the second signal including a second computer instruction; when the processor executes the second computer instruction, it causes the chip system to perform the method as described in any one of claims 13-16.

Citation Information

Patent Citations

  • Multi-device collaborative management method, electronic device and storage medium

    CN116680020A

  • Service callback method and device, electronic equipment and storage medium

    CN117579685A