Data processing method, electronic equipment and data processing system

By analyzing the matching of service connection information and local cache, the problem of the synchronization success rate of device management service information cannot be determined, and the normal display of device management services and the effectiveness of the compensation mechanism is realized.

CN120455519AActive Publication Date: 2025-08-08HONOR DEVICE CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411496274.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-08-08
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

In the prior art, electronic devices cannot determine the information synchronization success rate of equipment management services during the equipment interconnection process, resulting in the inability to judge whether the ball compensation mechanism takes effect, and the control center interface displays abnormally.

Method used

Retrieve callback messages by receiving service trigger operations, parse service connection information, use device ID and service ID to obtain matching results from the local cache, determine the information synchronization success rate of the device management service, and count the number of times the ball compensation mechanism takes effect.

Benefits of technology

It is realized that the information synchronization success rate of the equipment management service and the number of times the compensation mechanism take effect is determined under the ball compensation mechanism, to avoid abnormal display of the control center interface, and to ensure the normal operation of the equipment management service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455519A_ABST
    Figure CN120455519A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data processing method, electronic equipment and a data processing system, and relates to the technical field of data processing. The method comprises the steps that after the electronic device receives a service triggering operation, a first callback message corresponding to a first target device is obtained from a device management service, and the service triggering operation is used for triggering the electronic device to conduct connection or disconnection of a target service with other electronic devices; analyzing the first callback message to obtain first service connection information corresponding to the first target device and the target service, obtaining device connection information of a second target device from the first service connection information, and using a device ID of the second target device and a service ID of the target service to obtain a first callback message; obtaining second service connection information corresponding to the second target device and the target service from the local cache; and obtaining a matching result corresponding to the current service according to the first service connection information and the second service connection information. According to the scheme, the information synchronization success rate of the equipment management service can be determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, electronic equipment, and a data processing system. Background Art

[0002] Currently, electronic devices provide device interconnection functions that can be used to establish connections with other electronic devices that also have device interconnection functions, exchange information, and work together. After two electronic devices connect a service (or disconnect a service), whether each of the two electronic devices hangs a service ball for the recipient (or removes the service ball) in the control center interface displayed on its own depends mainly on the connection status of the recipient's device. Among them, one of the two electronic devices is the recipient and the other is the initiator.

[0003] However, before each of the two electronic devices receives the device connection status of the other device from its own device management service, its own device management service needs to synchronize information with the device management service of the other device to obtain the device connection status of the other device. If the device management service of the initiator of the two electronic devices fails to synchronize information, the initiator cannot obtain the device connection status of the recipient and cannot hang up the service ball (or remove the service ball) for the recipient. In response to this, the prior art proposes a hanging ball compensation mechanism. After the prior art adopts the hanging ball compensation mechanism, regardless of whether the information synchronization of the initiator's device management service is successful, the electronic device as the initiator can hang up the service ball for the recipient on the control center interface when establishing a connection with the recipient, and remove the service ball for the recipient on the control center interface when disconnecting from the recipient. It can be seen that even if the information synchronization of the initiator's device management service fails, the electronic device as the initiator can still hang up or remove the service ball normally in the control center interface, and the display of the control center interface will not be abnormal. In this way, based on the control center interface displayed by the electronic device itself during the device interconnection process, it is impossible to determine the success rate of the information synchronization of the device management service, nor can it determine whether the hanging ball compensation mechanism is effective. Summary of the Invention

[0004] The embodiments of the present application provide a data processing method, an electronic device, and a data processing system, which can determine the information synchronization success rate of the device management service and the number of times the hanging ball compensation mechanism is effective.

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

[0006] In a first aspect, a data processing method is provided, which is applied to an electronic device, wherein the electronic device includes a device management service, and the method includes: after receiving a service trigger operation, obtaining a first callback message corresponding to a first target device from the device management service, wherein the service trigger 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 device; 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 opposite device of the first target device, and the at least one opposite device of the first target device includes: an opposite 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 service is used to indicate that the information synchronization of the device management service is successful, or is used 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.

[0008] It is understandable that after receiving the business connection operation, the electronic device can receive a first callback message from its own device management service, and then parse the first callback message to obtain the first business connection information corresponding to the first target device. Then, the electronic device can obtain the second business connection information corresponding to the opposite device of the first target device (i.e., the second target device) based on the first business connection information corresponding to the first target device. The electronic device can obtain the matching result corresponding to the current business based on these two business connection information (including the first business connection information and the second business connection information). The matching result corresponding to the current business 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 matching result corresponding to the current business 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 business.

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

[0010] In combination with the first aspect, in another possible implementation method, the above-mentioned determination of the success rate of information synchronization of the device management service based on the matching results corresponding to at least one business 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 business, the first total number of successes being equal to the total number of matching success information in the matching results corresponding to at least one business, and the first total number of failures being equal to the total number of matching failure information in the matching results corresponding to at least one business; 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 combination with the first aspect, in another possible implementation method, the method also includes: counting the number of times the electronic device displays the hanging of the business ball and the number of times the electronic device displays the removal of the business ball within a preset sampling period; adding the number of times the electronic device displays the hanging of the business ball and the number of times the electronic device removes the business ball to obtain the total number of first changes; subtracting the first total number of successes from the total number of first changes to obtain the number of times the hanging ball compensation mechanism is effective.

[0012] In conjunction with the first aspect, in another possible implementation, 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 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. The above-mentioned use of 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 includes: when the combined information reaches the front end of the preset queue, using 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.

[0013] In combination with the first aspect, in another possible implementation method, the above-mentioned obtaining of the matching result corresponding to the current business based on the first business connection information and the second business connection information includes: obtaining the device connection information of the first target device based on the second business connection information; when the first target device is an electronic device, judging whether the first business connection information and the second business connection information match based on the device connection information of the first target device and the device connection information of the second target device; when the device connection information of the first target device includes the device ID of the first target device and the device connection status of the first target device, the device connection information of the second target device includes the device ID of the second target device and the device connection status of the second target device, and when 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 business connection information and the second business connection information match, and recording the first matching success information corresponding to the target business, and the matching result corresponding to the current business includes the first matching success information.

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

[0015] In combination with the first aspect, in another possible implementation manner, the method further includes: the electronic device deleting the target element from the polling comparison list.

[0016] In combination with the first aspect, in another possible implementation, the method also includes: when the first service connection information and the second service connection information do not match, and the timer is started, a new element is formed 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, wherein the first timestamp is the moment when the new element is added to the polling comparison list; according to the timer strategy, the matching result corresponding to each element in the polling comparison list is determined.

[0017] In combination with the first aspect, in another possible implementation method, the above-mentioned determination of the matching result corresponding to each element in the polling comparison list according to the timer strategy includes: traversing the polling comparison list according to a preset traversal period, and for an element in the traversed polling comparison list, determining the second delay using the current time and the first timestamp in the element; when the second delay is greater than or equal to the 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, in another possible implementation, the method further includes: receiving a service trigger operation on a first interface, the first interface including a first device ball corresponding to the electronic device and a second device ball corresponding to another electronic device; and in response to the service trigger operation, attaching or removing the service ball on the first interface;

[0019] In combination with the first aspect, in another possible implementation method, hanging or removing a business ball in the first interface includes: when the business trigger operation is used to trigger the electronic device to connect to other electronic devices for the target business, the electronic device hangs the business ball on the first device ball or the second device ball; when the business trigger operation is used to trigger the electronic device to disconnect from other electronic devices for the target business, the electronic device removes the business ball on the first device ball or the second device ball.

[0020] In a second aspect, a data processing method is provided, which is applied to a data processing system, wherein the data processing system includes a first electronic device and a cloud server, and the method includes: after receiving a service triggering 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 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 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, wherein the first service connection information includes device connection information of at least one opposite device of the first target device, and the at least one opposite device of the first target device includes: The target device connects or disconnects to the opposite device for the target business; the first electronic device obtains the device connection information of the second target device from the first business connection information, and uses the device ID of the second target device and the business ID of the target business to obtain the second business connection information corresponding to the second target device and the target business from the local cache; the first electronic device obtains the matching result corresponding to the current business based on the first business connection information and the second business connection information, wherein the matching result corresponding to the current business is used to indicate that the information synchronization of the device management service is successful, or is used 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 business 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 business.

[0021] In combination with the second aspect, in a possible implementation, the data processing system includes multiple electronic devices, the multiple electronic devices include a first electronic device, and the cloud server determines the success rate of information synchronization of the device management service based on the matching results corresponding to the current business, 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 business.

[0022] In combination with the second aspect, in a possible implementation method, the above-mentioned cloud server determines the success rate of information synchronization of the device management service based on the matching results received from multiple electronic devices within a preset sampling period, including: the cloud server determines the second total number of successes and the 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 matching success information in the matching results received from multiple electronic devices, and the second total number of failures is equal to the total number of matching failure information in the matching results received from multiple electronic devices; the cloud server obtains the success rate of information synchronization of the device management service based on the second total number of successes and the second total number of failures.

[0023] In combination with the second aspect, in a possible implementation, the method also includes: the cloud server counts the number of times multiple electronic devices display the hanging of the business ball and the number of times multiple electronic devices display the removal of the business ball within a preset sampling period; the cloud server adds the number of times multiple electronic devices display the hanging of the business ball and the number of times multiple electronic devices remove the business 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 hanging ball compensation mechanism is effective.

[0024] In a third aspect, 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 is configured to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device performs the method described in any one of the first aspects.

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

[0026] In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in any one of the first aspects; or, when the computer instructions are executed on a data processing system, the data processing system executes the method described in any one of the second aspects.

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

[0028] In a seventh aspect, a device is provided (for example, the device may be a chip system), which includes a processor for supporting an electronic device to implement the method described in the first aspect above, or for a data processing system to execute a method as described in any one of the second aspects above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device or data processing system. When the device is a chip system, it may be composed of a chip, or it may include a chip and other discrete devices.

[0029] Among them, the technical effects brought about by any design method in the second to seventh aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0031] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

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

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

[0034] Figure 5 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 1 ;

[0035] Figure 6 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 2 ;

[0036] Figure 7 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 3 ;

[0037] Figure 8 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 4 ;

[0038] Figure 9 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 5 ;

[0039] Figure 10 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 6 ;

[0040] Figure 11 A schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts 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 the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout this application, unless otherwise specified, "plurality" means two or more.

[0043] Currently, electronic devices offer device interconnection functionality, which can be used to establish connections with other electronic devices equipped with device interconnection functionality, exchange information, and collaborate. The process of connecting different devices via a network to exchange information and collaborate can be referred to as device interconnection. In some embodiments, the electronic device may include an application for implementing the device interconnection functionality. Optionally, the application for implementing the device interconnection functionality can be referred to as a hyperterminal application. Users can use the hyperterminal application to control multiple interconnected devices.

[0044] Reference Figure 1 As shown in FIG, a schematic diagram of a control center interface provided by an embodiment of the present application. Figure 1 As shown, the hyperterminal application may include a control center interface 100 , which may include: a user avatar 101 , a trust ring 102 , and a plurality of device balls.

[0045] The center of the control center interface 100 is used to display a user avatar 101. The user avatar 101 is a user avatar associated with a user account logged in on the local device. The local device refers to an electronic device used to display the control center interface 100.

[0046] A dotted circle is displayed outside the user avatar 101. This dotted circle can be called a trust circle 102. Trust circle 102 can be a circle or network composed of mutually trusted devices. Only electronic devices within trust circle 102 can exchange information securely and work together.

[0047] Multiple device balls are evenly arranged on the trust ring 102. Multiple device balls can represent multiple electronic devices that can be interconnected. Multiple electronic devices that can be interconnected include this device. Multiple electronic devices that can be interconnected log in to the same user account, and the multiple electronic devices that can be interconnected are all devices that the user trusts. For example, Figure 1 Three device balls are shown, namely, a device ball 103 for representing the local device, a device ball 104 for representing electronic device 1, and a 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 device ball 103 corresponding to a local device to view at least one service provided by that device. The user can then drag the icon corresponding to any service onto device ball 104 to trigger a connection between the local device and the electronic device 1 represented by device ball 104. Once the connection is established, the service is implemented. A service can refer to any of the information exchange and collaborative work options, such as screen sharing or network sharing.

[0049] For example, Figure 1 The control center interface 100 is shown when the local device and the electronic device 1 are performing screen sharing. 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 the embodiment of the present application, the two interconnected electronic devices can be divided into the initiator and the receiver of the service in the process of implementing any service. If an electronic device is the receiver of this service, and the two electronic devices successfully establish a connection, then each of the two electronic devices can hang a service ball for the device ball corresponding to the receiver on the control center interface displayed on itself. Optionally, an electronic device hanging a service ball for the device ball corresponding to the receiver can be simply described as the receiver hanging a service ball. The receiver in the control center interface hanging a service ball can be used to indicate that the two electronic devices have successfully established a connection. For example, Figure 1 As shown, during the screen sharing between this machine and electronic device 1, electronic device 1 serves as the receiver in the screen sharing, and this machine can hang a business ball 107 for the device ball 104 corresponding to electronic device 1 on the control center interface 100 displayed by itself.

[0051] Furthermore, if the two electronic devices are disconnected, the service ball on the device ball corresponding to the recipient is removed. For example, if the device 1 is disconnected from the host, service ball 107 on device ball 104 corresponding to electronic device 1 is removed. Alternatively, an electronic device removing the service ball from the device ball corresponding to the recipient can be simply described as the recipient removing the service ball.

[0052] It should be noted that the presentation form of the business ball (including appearance and color, etc.) can be set according to the business represented by the business ball. For example, Figure 1 The pattern in the business ball 107 shown can be used to represent screen sharing. The color of the business ball 107 can also be blue or green, etc. Figure 1 Not shown.

[0053] In an embodiment of the present application, after two interconnected electronic devices successfully establish a connection, whether each of the two electronic devices hangs a service ball for the recipient in the control center interface displayed by itself mainly depends on the device connection status of the recipient. Therefore, after the two electronic devices successfully establish a connection, each of the two electronic devices can receive not only its own device connection status, but also the device connection status of the opposite device, which refers to another electronic device interconnected with the circuit device. If an electronic device is the initiator of the service, indicating that the opposite device of the electronic device is the recipient, it can be determined whether to hang a service ball for the device ball corresponding to the opposite device on the control center interface displayed by itself based on the device connection status of the opposite device. Among them, the device connection status of an electronic device can be connecting, connected or disconnected.

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

[0055] For example, taking the case where two electronic devices are interconnected, including this machine and electronic device 1, and this machine is the initiator and electronic device 1 is the receiver of the service, the process of the electronic device hanging a service ball for the receiver on the control center interface is introduced. Both this machine and electronic device 1 can include a device management service (or profile). This 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 opposite device from its own device management service. As the initiator, after receiving the device connection status of electronic device 1 (that is, the device connection status of the receiver) from the device management service of this machine, this machine can hang a service ball for electronic device 1 on the control center interface displayed by this machine (that is, hang a service ball for the receiver) based on the device connection status of electronic device 1. As the receiver, after receiving its own device connection status from the device management service of electronic device 1, electronic device 1 can hang a service ball for itself on the control center interface displayed by electronic device 1.

[0056] After two electronic devices successfully establish a connection, each device needs to synchronize its own device management service to obtain the device connection status of the other device before receiving it from its own device management service. However, synchronization may fail for each electronic device's device management service, resulting in the electronic device receiving only its own device connection status from its own device management service, but not the device connection status of the other device. Whether each electronic device displays a service ball for the recipient depends primarily on the recipient's device connection status. Therefore, even if the two electronic devices successfully establish a connection, if synchronization fails for the initiator's device management service, the initiator cannot display the service ball for the recipient because it cannot obtain the recipient's device connection status. To address this situation, conventional interconnected electronic devices employ a service ball compensation mechanism. This mechanism allows an electronic device, acting as an initiator, to determine the other device to establish a connection with based on its own device connection status and display a service ball for the other device on its control center interface. By introducing a service ball compensation mechanism, the problem of an electronic device successfully establishing a connection but not displaying a service ball on the control center interface due to a device management service synchronization failure can be avoided.

[0057] It should be noted that after two interconnected electronic devices are disconnected, whether each electronic device removes the service ball for the recipient in its own control center interface also depends primarily on the recipient's device connection status. For details on how each electronic device removes the service ball for the recipient in its own control center interface, please refer to the above description of how an electronic device attaches the service ball for the recipient in its own control center interface, and will not be repeated here.

[0058] From the above, it can be seen that after the existing technology adopts the hanging ball compensation mechanism, regardless of whether the information synchronization of the initiator's device management service is successful, the electronic device as the initiator can hang the business ball for the receiver on the control center interface when establishing a connection with the receiver, and remove the business ball for the receiver on the control center interface when disconnecting from the receiver. It can be seen that even if the information synchronization of the initiator's device management service fails, the electronic device as the initiator can normally hang or remove the business ball in the control center interface, and the display of the control center interface will not be abnormal. In this way, an electronic device cannot determine the success rate of the information synchronization of the device management service based on the control center interface displayed by itself during the device interconnection process, nor can it determine whether the hanging ball compensation mechanism is effective.

[0059] In response to the above problems, an embodiment of the present application proposes a data processing method, in which an electronic device can receive its own corresponding business connection information from its own device management service after receiving a business connection operation. The business connection operation is used to trigger the connection or disconnection of a target business to a peer device. Then, the electronic device can obtain the business connection information corresponding to the peer device based on its own business connection information. If the two business connection information (including the business connection information corresponding to the electronic device and the business connection information corresponding to the peer device) include each other's device identification (Identity document, ID), and the two business connection information include the same device connection status (for example, both have been established or disconnected), it is considered that the device management service has successfully synchronized the information during the connection or disconnection of the target business, and a matching success message is recorded. If the device IDs in the two business connection information do not include each other's device IDs, and / or the two business connection information include different device connection statuses, it is considered that the electronic device has not received the business connection information corresponding to the peer device, the information synchronization of the device management service has failed, 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, and then determines the information synchronization success rate of the device management service based on the first total number of successes and the first total number of failures; the total number of first changes of the business ball in the control center interface of the electronic device can also be subtracted from the first total number of successes to obtain the number of times the hanging ball compensation mechanism is effective.

[0060] In summary, this solution allows the device management service's information synchronization success rate and the number of times the compensation mechanism has been effective to be determined, without causing any display anomalies in the control center interface after the electronic device utilizes the compensation mechanism. Furthermore, if the device management service's information synchronization success rate is low, R&D personnel can be alerted to promptly modify the device management service to ensure its proper operation.

[0061] The embodiments of the present application provide a data processing method that can be applied to electronic devices with device interconnection functions, such as tablet computers, personal computers (PCs), laptop computers, mobile phones, vehicle-mounted devices, or wearable devices. The embodiments of the present application do not impose any restrictions on the specific type of electronic devices.

[0062] Take the example of a mobile phone as an electronic device. Figure 2 A schematic structural diagram of an 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, an antenna 1, an 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, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, cameras [1-N] 293, a display [1-N] 294, and a subscriber identification module (SIM) card interface 295. The sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

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

[0065] The display screen 240 is used to display an interface, etc. The display screen 240 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] Among them, if the display screen 240 in the embodiment of the present application is integrated with a touch sensor, the display screen 240 can be called a touch screen. The touch sensor can also be called a "touch panel". That is to say, the display screen 240 may include a display panel and a touch panel. The touch sensor 231 is used to detect touch operations acting on or near it. After the touch sensor detects a touch operation (such as the above-mentioned user operation), it can trigger the driver of the core layer of the mobile phone to periodically scan the touch parameters generated by the touch operation. Then, the driver of the core layer passes the touch parameters to the relevant modules of the upper layer, so that the relevant modules can determine the touch events corresponding to the touch parameters. In the embodiment of the present application, the method provided in the embodiment of the present application is described by taking the display screen 240 as a display screen integrated with a touch sensor (i.e., a touch screen) as an example.

[0067] It should be 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 shown, or some components may be combined or separated, or arranged differently. The components shown in the illustrations may be implemented in hardware, software, or a combination of software and hardware.

[0068] The software system of the mobile phone can adopt a layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture. Taking the system as an example, the structure of the software system of a mobile phone is illustrated. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through interfaces. In some embodiments, Figure 3 As shown, The system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system library, and kernel layer.

[0069] The application layer can include a series of application packages. This series of application packages can be divided into system applications (application, APP) that come with the mobile phone, and third-party APPs that users download to the mobile phone. For example, Figure 3 As shown, system apps can include apps such as camera, gallery, calendar, phone, HyperTerminal, Trust Ring Control Center, business services, device management services, and timer. Alternatively, HyperTerminal apps can be referred to as smart interconnected apps. The Trust Ring Control Center can be simply referred to as the control center.

[0070] The application framework layer provides an application programming interface (API) and programming framework for the 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 the embodiments of the present disclosure do not impose any restrictions on this.

[0072] The Activity Manager manages the lifecycle of each application. Applications typically run as activities in the operating system. Each activity has a corresponding application record (ActivityRecord) in the Activity Manager. This ActivityRecord records the state of the application's activity. The Activity Manager uses this ActivityRecord as an identifier to schedule the application's activity process.

[0073] Window Manager Service: It is used to manage the graphical user interface (GUI) resources used on the screen. Specifically, it can be used to obtain the screen size, create and destroy windows, show and hide windows, layout windows, manage focus, and manage input methods and wallpapers.

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

[0075] The Android runtime consists of core libraries and a virtual machine (VM). The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for Java-based functions and the other for the Android core library. The application layer and application framework layer run in the VM. The VM executes Java files from the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0076] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0077] The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of common audio and video formats, as well as still image files. It supports a variety of audio and video codecs, 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 the drawing engine for 2D drawing.

[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., which are not limited in this embodiment.

[0079] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure or software structure.

[0080] In an embodiment of the present application, during the process of interconnecting a first electronic device and a second electronic device, the first electronic device or the second electronic device may execute a data processing method to determine whether information synchronization of its own device management service in this device interconnection succeeds or fails. The first electronic device may be the initiator of this device interconnection, and the second electronic device may be the receiver of this device interconnection; or the first electronic device may be the receiver of this device interconnection, and the second electronic device may be the initiator of this device interconnection.

[0081] Reference Figure 4 , taking the first electronic device as the initiator of the service and the second electronic device as the receiver of the service as an example, the process of interconnecting the two electronic devices is introduced. The first electronic device and the second electronic device can both include a super terminal application, a control center, a service service, a device management service and a timer. Optionally, 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 respectively referred to as the first super terminal application, the first control center, the first business service, the first device management service and the first timer. The super terminal application, control center, business service, device management service and timer in the second electronic device can be respectively referred to as the second super terminal application, the second control center, the second business service, the second device management service and the second timer. Figure 4 As shown, the process of interconnecting two electronic devices may include S401-S414.

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

[0083] When the first electronic device displays the first control center interface, it can receive a service trigger operation. The first control center interface can include a trust ring and multiple device balls included in the trust ring. The multiple device balls correspond one-to-one to multiple interconnected electronic devices. The multiple interconnected electronic devices are logged into the same user account.

[0084] For example, the service triggering operation may be dragging the icon corresponding to the target service displayed in the first control center interface to the device ball corresponding to the second electronic device. In this case, the service triggering operation is used to trigger the initiation of a connection to the target service to the second electronic device.

[0085] S402: The first super terminal application sends a first connection instruction to the first control center in response to a service triggering operation.

[0086] S403: The first control center sends a second connection instruction to the first business service in response to the first connection instruction.

[0087] S404: The first business service connects or disconnects the target business with the second business service in the second electronic device.

[0088] S405: The first business 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 into the first device management service.

[0089] The device continuity information of the first electronic device may include information indicating that the device is connecting, has been connected, or has been disconnected. The service connection information corresponding to the first electronic device and the target service may be used to record 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 may include all peer devices that have been connected or disconnected from the first electronic device for the target service.

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

[0091] The device continuity information of the second electronic device may include information indicating that the device is connecting, that a connection has been established, or that the device is disconnected. The service connection information corresponding to the second electronic device and the target service may be used to record 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 may include all peer devices that have connected or disconnected with the second electronic device for the target service.

[0092] S407: The first device management service and the second device 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 the first control center interface according to the device connection information of the second electronic device, obtains the second control center interface, and displays it.

[0095] S410: The first control center obtains device connection information of the first electronic device and 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 hanging ball compensation mechanism to update the first control center interface according to the device connection information of the first electronic device and the service connection information corresponding to the first electronic device and the target service, obtain the second control center interface and display it.

[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 according to the device connection information of the second electronic device, 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 is interconnected with a peer device, whether as an initiator or a receiver, it can receive a callback message from its own device management service. The electronic device can parse the callback message to obtain the business connection information corresponding to the electronic device, or the business connection information corresponding to the peer device. Then, based on the parsed business connection information corresponding to the electronic device or the business connection information corresponding to the peer device, the electronic device can determine whether the information synchronization of its own device management service is successful in the process of executing the target business. Furthermore, the electronic device can count the first total number of successes and the first total number of failures of the device management service in the process of executing multiple businesses; then, based on the first total number of successes and the first total number of failures, the information synchronization success rate of the device management service can be determined; and the total number of first changes of the business ball in the control center interface of the electronic device minus the first total number of successes can be used to obtain the number of times the hanging ball compensation mechanism is effective. Optionally, the callback message can be called a connection information callback message or a profile callback message.

[0101] refer to Figure 5 , introduces the process of an electronic device determining whether the information synchronization of its own device management service is successful in device interconnection. The electronic device can be the initiator (for example, the first electronic device mentioned above) or the recipient (for example, the second electronic device mentioned above). Figure 5 As shown, the data processing method provided in the embodiment of the present application may include S501-S519.

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

[0103] After the electronic device receives a service triggering operation, the control center in the electronic device can sequentially obtain at least one callback message from the device management service. The service triggering operation is used to trigger the electronic device to connect to a peer device for a target service, or to trigger the electronic device to disconnect from a peer device for a target service. The at least one callback message may include a first callback message corresponding to a third electronic device and the current service. The first callback message is used to record 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. The at least one peer device of the third electronic device may include all peer devices that connect or disconnect with 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, the role of the peer device, etc. The role of the peer device may be an initiator or a receiver.

[0104] Alternatively, the electronic device may be referred to as the local device. The local device is the device being operated by the user.

[0105] In an embodiment of the present application, 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 a 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 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 a callback message corresponding to the device and the target service from the device management service, and then obtain a callback message corresponding to the peer device and the target service; or first obtain a callback message corresponding to the peer device and the target service, and then obtain a callback message corresponding to the device and the target service. This embodiment of the application does not limit the order in which the electronic device obtains at least one callback message from the device management service.

[0107] Exemplarily, the first callback message may be the original information stored in the local device management service. For example, the first callback message may include the following content: device1; device2; device3; status: 2, 1, 1; role: sink, sink, source. Among them, device1, device2, and device3 represent the device IDs of the three peer devices connected to the third electronic device. "status: 2, 1, 1" is used to indicate the device connection status of the three peer devices connected to the third electronic device, 2 indicates connecting, and 1 indicates a connection has been established. "role: sink, sink, source" is used to indicate the roles of the three peer devices connected to the third electronic device, sink indicates that the peer device is a receiver when connected to the third electronic device, and source indicates that the peer device is an initiator when connected to the third electronic device. The device connection status of the three peer devices, the device IDs of the three peer devices, and the roles of the three peer devices are all one-to-one corresponding.

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

[0109] The electronic device may parse the original 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 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. The at least one peer device of the third electronic device may include all peer devices that are connected or disconnected with the third electronic device for the target service.

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

[0111] For example, taking the first callback message including device1; device2; device3; status: 2, 1, 1; role: sink, sink, source as an example, the electronic device parses the first callback message to obtain first service connection information as shown in Table 1 below:

[0112] Table 1 First service connection information

[0113]

[0114]

[0115] S503: The electronic device determines whether the device state of the third electronic device is an initialization state or an update state.

[0116] 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 may terminate 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 may execute S504.

[0117] Among them, when an electronic device just comes online, the device status of the electronic device is the initialization state. The electronic device just comes online means that: the electronic device appears in the control center interface (or joins the trust ring), but no business operations are performed on the electronic device (including operations to establish a connection and operations to disconnect). After a business operation is performed on the electronic device, the device status of the electronic device is changed to an update state. It can be seen that the device status of the third electronic device is the initialization state, indicating that no business operations have been performed on the third electronic device. The device status of the third electronic device is the update state, indicating that some business operations (for example, operations to establish a connection or operations to disconnect) are performed on the third electronic device.

[0118] It should be noted that, during the actual execution process of the electronic device, S503 may not be executed, but S504 may be directly executed when the device status of the third electronic device is the update status.

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

[0120] The electronic device can obtain 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 the peer device represented by device1, device2, or device3 above.

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

[0122] Exemplarily, the device connection status of the fourth electronic device may be connecting or having established a connection.

[0123] S505: The electronic device determines whether the device connection status of the fourth electronic device is being connected.

[0124] If the device connection status of the fourth electronic device is "Connecting", the electronic device may terminate the process and process the next callback message, which is obtained from the device management service after the first callback message. If the device connection status of the fourth electronic device is not "Connecting", indicating that the device connection status of the fourth electronic device is either established or disconnected, the process proceeds to S506.

[0125] For example, the device connection status can be 0, which means disconnected.

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

[0127] If the device connection status of the fourth electronic device is not connecting, the electronic device can map the first service connection information corresponding to the third electronic device and the target service, and the device connection information of the fourth electronic device, and add them to a preset queue (for example, a single-thread pool) to wait for processing.

[0128] It can be understood that 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, and sends the business connection information obtained by parsing each callback message (for example, the first business connection information obtained by parsing the first callback message) and the device connection information of the opposite device obtained based on the business connection information (for example, the device connection information of the fourth electronic device) into the preset queue for processing, thereby avoiding problems caused by multi-threading.

[0129] S507. When the combined information reaches 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.

[0130] The second service connection information may include 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 connected or disconnected with the fourth electronic device for 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 already connected.

[0131] In some embodiments, the electronic device may obtain a second callback message corresponding to the peer device and the target service from its own device management service, parse the second callback message to obtain 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. The device status of the fourth electronic device in the second service connection information may be an updated status.

[0132] It should be noted that, for details of how the electronic device parses the second callback message to obtain the second service connection information, reference may be made to the introduction to how the electronic device parses the first callback message to obtain the first service connection information in S502 above; and for details of the second service connection information, reference may be made to the introduction to the first service connection information in S502 above.

[0133] 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 just 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 status of the fourth electronic device in the second service connection information may be in an initialized state.

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

[0135] It should be noted that when an electronic device just comes online, the cloud server can synchronize the device connection information of the newly online electronic device to the device management service in the existing electronic device (which may include the newly online electronic device). The device management service in the existing electronic device notifies the control center in the same electronic device. After receiving the notification, the control center can read the business connection information corresponding to the newly online electronic device from the cloud server. The business connection information corresponding to the newly online electronic device may not include the device connection information of at least one opposite device of the newly online electronic device. The at least one opposite device of the newly online electronic device may include all opposite devices that are connected or disconnected for a business with the newly online electronic device.

[0136] S508: The electronic device obtains a timer instance.

[0137] Electronic devices use singleton timers, creating only one instance of a timer (also known as a timer singleton) during data processing. This makes management easier and avoids the problem of missing a timer when there are many counters, which can lead to computing resource hogs.

[0138] It is understandable that after an electronic device connects to a peer device, there is a certain order in which the callback message corresponding to the device is obtained from the device interconnection service on the device itself and the callback message corresponding to the peer device is obtained. Therefore, there is a certain delay between the electronic device obtaining the service connection information corresponding to the device itself and obtaining 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.

[0139] S509: The electronic device determines whether the third electronic device corresponding to the first callback message is the electronic device itself.

[0140] 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. Specifically, it determines whether the received first callback message is a callback message corresponding to the local device. If the third electronic device is the local device, steps S510-S515 are executed. If the third electronic device is not the local device, steps S515-S517 are executed.

[0141] It is understandable that since the electronic device can obtain both the callback message corresponding to the local device and the callback message corresponding to the peer device from the same interface provided by its own device management service, the electronic device can determine whether the callback message corresponds to the local device after receiving it.

[0142] 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.

[0143] 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 in the first service connection information. If the third electronic device is the local device, the electronic 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 service connection information and the second service connection information match, execute S511; if the first service connection information and the second service connection information do not match, execute S512.

[0144] In some embodiments, the electronic device can determine that the first business connection information and the second business connection information match when the first business connection information and the second business connection information meet the following two conditions: the first condition is that the first business connection information includes the device ID of the fourth electronic device, and the second business 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 business connection information is the same as the device connection status of the third electronic device in the second business connection information (for example, both are connected, or both are disconnected).

[0145] In some embodiments, the electronic device obtains the device connection information of the fourth electronic device (including the device ID of the fourth electronic device) from the first service connection information, and obtains the device connection information of the third electronic device (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 meet 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 meet the second condition.

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

[0147] After the 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 successfully match, the electronic device records the first successful match information. The first successful match information may include: the service ID of the target service, the matching result, the delay, and the description information. The matching result in the first successful match information is true, which indicates success. The delay in the first successful match information is 0. The description information in the first successful match information indicates that the callback message corresponding to the peer device was first received.

[0148] Illustratively, the format of the first successful matching information may be: business:{business ID}, result:{matching result}, delay:{delay}, detail:{description information}.

[0149] It is understandable that if the first service connection information and the second service connection information successfully match, and no delay is calculated, then the delay is 0. Secondly, the electronic device receives the first callback message corresponding to the third electronic device, which is the local device, and parses the first service connection information from the first callback message. The first service connection information successfully matches 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 (i.e., the callback message corresponding to the peer device) first.

[0150] S512: The electronic device determines whether the timer is started.

[0151] If the third electronic device is the local device, and the first service connection information parsed by the electronic device 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, indicating that the electronic device has not received the callback message corresponding to the peer device, the electronic device can calculate the delay to determine whether the reception of the callback message corresponding to the peer device has timed out. When calculating the delay, the electronic device can first determine whether a timer has started. If the timer has not started, execute S513. If the timer has started, execute S514.

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

[0153] S513. The electronic device starts a timer.

[0154] 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 the new element to the polling comparison list in the timer.

[0155] When the timer has started, the electronic device can use the current moment to generate a first timestamp, and use the device connection information of the fourth electronic device obtained from the first business connection information corresponding to the local device, the business ID of the target business, and the first timestamp to form a new element, and add it to the polling comparison list. The first timestamp is the moment when 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 opposite device obtained from all the business connection information corresponding to the local device that failed the initial match (for example, the first business connection information corresponding to the local device), or the device connection information of the opposite device that is waiting for all the business connection information corresponding to the local device that failed the initial match.

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

[0157] Table 2 Polling comparison list

[0158]

[0159] Each element in the polling comparison list may 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 may represent a first timestamp, which is used to record the time when the element was added to the polling comparison list.

[0160] It is understandable that while an electronic device only creates one timer instance, or uses one timer, during data processing, it may participate in multiple services and therefore need to determine matching results for multiple services. Therefore, the electronic device can include a polling comparison list in the timer, sequentially determining timeouts for elements corresponding to multiple services in the polling comparison list.

[0161] 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.

[0162] S515: The electronic device traverses the polling comparison list to search for a target element that matches the service ID of the target service and the device connection information of the third electronic device.

[0163] If the first callback message received by the electronic device corresponding to the third electronic device is not the callback message corresponding to the electronic device, it indicates that the first service connection information parsed from the first callback message is the service connection information corresponding to the peer device. The electronic device can then search 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 the device ID and device connection status) of the third electronic device.

[0164] The traversing of the polling comparison list may include: the electronic device sequentially accessing all elements in the polling comparison list.

[0165] Exemplarily, the electronic device may call equals(status:int, remoteDeviceId:String, businessld:String):boolean in the polling comparison list to traverse the polling comparison list to search for a target element that matches the business ID of the target business and the device connection information of the third electronic device.

[0166] Optionally, if the electronic device does not find a target element that matches the service ID of the target service and the device connection information of the third electronic device by traversing the polling comparison list, the process may be ended and the next callback message may be processed again.

[0167] S516: The electronic device determines a first delay using the current time and the first timestamp in the target element, and determines whether the first delay is less than a preset duration.

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

[0169] S517: The electronic device records second successful matching information corresponding to the target service.

[0170] The second successful match message may include: the service ID of the target service, the matching result, the delay, and a description. The matching result in the second successful match message is true. The delay in the second successful match message is the first delay. The description in the second successful match message is a callback message corresponding to the peer device received later.

[0171] It is understood that if the electronic device first receives the corresponding callback message from the local device, it may add the device connection information of the other device to the polling comparison list before the electronic device can find the target element in the polling comparison list. Therefore, after the electronic device finds the target element in the polling comparison list, it generates the second successful match message, indicating that the electronic device first received the corresponding callback message from the local device. Therefore, the information in the second successful match message indicates that the callback message corresponding to the other device was received later.

[0172] S518. The electronic device records first matching failure information corresponding to the target service.

[0173] The first match failure information may include: the service ID of the target service, the match result, the delay, and an explanation. The match result in the first match failure information is false, indicating a match failure. The delay in the first match failure information is equal to the first delay. The explanation in the first match failure information is timeout.

[0174] S519: The electronic device deletes the target element from the polling comparison list.

[0175] After S517 or S518 , the electronic device removes the target element from the polling comparison list to prevent another timeout determination on the target element.

[0176] In an embodiment of the present application, the electronic device can determine a first total number of successes and a 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 a total number; and divide the first total number of successes by the total number to obtain a success rate of information synchronization of the device management service.

[0177] Secondly, the electronic device may also count the number of times the electronic device attaches a service ball and removes the service ball on the control center interface during the preset sampling period; then, the number of service ball attachments and the number of service ball removals are added together to obtain a first total number of changes. The first total number of successes is then subtracted from the first total number of changes to obtain the number of times the detachment compensation mechanism has been effective.

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

[0179] It is understandable that in the embodiment of the present application, after receiving the service connection operation, the electronic device can receive a first callback message from its own device management service, and then parse the first callback message to obtain the first service connection information corresponding to the third electronic device. Then, the electronic device can obtain the second service connection information corresponding to the peer device of the third electronic device (i.e., the fourth electronic device) based on the first service connection information corresponding to the third electronic device. If the two service connection information (including the first service connection information and the second service connection information) include each other's device IDs, and the two service connection information include the same device connection status (for example, both have been established or disconnected), it is considered that the device management service has successfully synchronized the information during the connection or disconnection of the target service, and a matching success message (for example, the above-mentioned first matching success message or the second matching success message) is recorded. If the device IDs in the two service connection information do not include each other's device IDs, and / or the two service connection information include different device connection states, 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 fails, and a matching failure message (for example, the above-mentioned first 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 results corresponding to all services executed within the preset sampling period (for example, matching success information or matching failure information), and then determines the information synchronization success rate of the device management service based on the first total number of successes and the first total number of failures; the total number of first changes of the business ball in the control center interface of the electronic device can also be subtracted from the first total number of successes to obtain the number of times the hanging ball compensation mechanism is effective.

[0180] In some embodiments, the first service connection information may include device connection information of multiple peer devices interconnected with the third electronic device, or may be empty. In different situations, the process of the electronic device obtaining the device connection information of the fourth electronic device from the first service connection information is also different.

[0181] refer to Figure 6 , introduces the process of an electronic device acquiring device connection information of a fourth electronic device from the first service connection information. Figure 6 As shown, the data processing method provided in the embodiment of the present application may further include S601-S602 before S504, and S504 may include S603-S610.

[0182] S601: The electronic device obtains a second timestamp, where the second timestamp is the moment when a second callback message corresponding to the fourth electronic device is obtained during the process of connecting or disconnecting the target service.

[0183] The electronic device may use the current moment as the second timestamp. If a delay needs to be calculated later, the second timestamp may be used to indicate 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. The electronic device may use the second timestamp as the starting time for calculating the delay.

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

[0185] The electronic device obtains the first historical callback information after receiving the service triggering operation last time, and the first historical service connection information is obtained by parsing the first historical callback information.

[0186] It should be noted that, for details of the first historical callback information, reference may be made to the introduction of the first callback information in S501 above; for details of the first historical service connection information, reference may be made to the introduction of the first service connection information in S502 above, which will not be repeated here.

[0187] It should also be noted that, in the case where the first service connection information includes multiple opposite-end 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 by relying solely on the first service triggering operation parsed after receiving the service triggering operation. In the case where the service triggering operation is used to trigger the electronic device to disconnect from a opposite-end device for the target service, since the first service connection information does not include the device connection information of the opposite-end device disconnected from the third electronic device, the electronic device cannot accurately obtain the device connection information of the fourth electronic device by relying solely on the first service triggering operation parsed after the service triggering operation. In summary, it can be seen that in the above two cases, the electronic device cannot accurately obtain the device connection information of the fourth electronic device by relying solely on the first service triggering operation parsed after the service triggering operation. Therefore, the electronic device can obtain the device connection information of the fourth electronic device with the help of the first historical service connection information.

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

[0189] 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 S604 is executed. If the first service connection information is empty, then S609 may be executed.

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

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

[0192] S605: When the electronic device finds 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, the electronic device determines the device connection information of the first peer device as the device connection information of the fourth electronic device.

[0193] If the first historical service connection information is empty, and the first service connection information is not empty, it indicates that the service triggering operation is to trigger the electronic device to connect to a peer device for the target service. In this case, the electronic device traverses the first service connection information. If the device connection information of a peer device found in the first service connection information is valid, the device connection information of this peer device is used as the device connection information of the fourth electronic device. Optionally, the device connection information of the peer device in the first service connection information can be referred to as the device connection information of the first peer device.

[0194] Traversing to the device connection information of a peer device in the first service connection information may mean that the electronic device accesses the device connection information of a peer device in the first service connection information during the process of traversing the first service connection information. Traversing the first service connection information may include sequentially accessing the device connection information of all peer devices in the first service connection information.

[0195] Furthermore, after the electronic device completes processing the device connection information of the first peer device, it 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, the device connection information of the next first peer device is determined as the device connection information of the new fourth electronic device. When the electronic device completes traversing 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.

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

[0197] 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.

[0198] 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, S607 may 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, S608 may be executed. "Not greater than" may include less than and equal to.

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

[0200] If the number of device connection information items included in the first service connection information is greater than the number of device connection information items included in the first historical service connection information, indicating that the number of device connection information items in the first service connection information has increased since receiving the service trigger operation, it can be determined that the service trigger operation is used to trigger the electronic device to connect to a peer device for the target service. At this point, the electronic device traverses the first service connection information. If the device connection information of a first peer device found in the first service connection information is valid, the electronic device traverses the first historical service connection information based on the device connection information of the first peer device. If it is determined that the device connection information of this peer device exists in the first historical service connection information, the device connection information of the first peer device may not be processed.

[0201] Furthermore, after the electronic device completes processing the device connection information of the first peer device, it 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, the device connection information of the next first peer device is determined as the device connection information of the new fourth electronic device. When the electronic device completes 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.

[0202] The presence of the device connection information of the first peer device in the first historical service connection information may 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. The device connection information of the first peer device and the device connection information of the second peer device being completely identical may include that the device connection information of the first peer device and the device connection information of the second peer device include the same device ID, device connection status, and role. Optionally, the device connection information of the peer device in the first historical service connection information may be referred to as the device connection information of the second peer device.

[0203] 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 electronic device 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.

[0204] If the number of device connection information included in the first business connection information is greater than the number of device connection information included in the first historical business connection information, it means that the number of device connection information in the first business connection information has decreased after receiving the business trigger operation, then it can be known that the business trigger operation is used to trigger the electronic device to disconnect from a peer device for the target business. At this time, the electronic device can traverse the first historical business connection information, and if the device connection information of a second peer device traversed in the first historical business connection information is valid, traverse the first business connection information 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 business 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 business connection information, the device connection information of the second peer device can be not processed.

[0205] Furthermore, after the electronic device processes the device connection information of the second peer device, it 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, the electronic device updates the device connection status in the device connection information of the next second peer device to disconnected, and then determines the device connection information of the next second peer device as the new device connection information of the fourth electronic device. When the electronic device completes 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.

[0206] The presence of the device connection information of the second peer device in the first service connection information may mean that the device connection information of the second peer device is completely identical to the device connection information of a first peer device in the first service connection information. The device connection information of the second peer device being completely identical to the device connection information of the first peer device may include that the device connection information of the second peer device and the device connection information of the first peer device include the same device ID, device connection status, and role.

[0207] It can be understood that since the device status information in the device connection information of the second counterpart device in the first historical service connection information is connecting or has established a connection, and the service trigger operation is used to trigger the electronic device to disconnect from a counterpart device for the target service, the electronic device needs to update the device connection status in the device connection information of the second counterpart device to disconnected, so that the device connection status in the device connection information of the second counterpart device is adapted to the service trigger operation, and at the same time prevent deviations in the subsequent comparison of the device connection information of the two disconnected devices.

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

[0209] After the electronic device determines that the first business connection information corresponding to the third electronic device and the target business is empty, if the first historical business connection information is not empty, execute S610; if the first historical business connection information is empty, the electronic device cannot obtain the device connection information of the fourth electronic device, and directly ends the process of determining the device connection information of the fourth electronic device from the first business connection information.

[0210] 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, the electronic device 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.

[0211] If the first service connection information is empty, but the first historical service connection information is not empty, indicating that the number of device connection information in the first service connection information has decreased after receiving the service trigger operation, it can be determined that the service trigger 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 traverse 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 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, the device connection information of the second peer device can be not processed.

[0212] Furthermore, after the electronic device completes processing the device connection information of the second peer device, it 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 electronic device updates the device connection status in the device connection information of the next second peer device to disconnected, and then determines the device connection information of the next second peer device as the new device connection information of the fourth electronic device. When the electronic device completes traversing 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.

[0213] It is understandable that, by executing the above process, the electronic device can accurately filter out the device connection information of the fourth electronic device that has established a connection or disconnected with the third electronic device.

[0214] refer to Figure 7 , introduces the process of an electronic device obtaining the second service connection information corresponding to the fourth electronic device and the target service, and then obtaining the device connection information of the third electronic device based on the second service connection information. Figure 7 As shown, S507 in the data processing method provided in the embodiment of the present application may include S701-S711.

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

[0216] The third service connection information is used to record the device connection information of all peer devices connected to 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., no longer executing S508-S519).

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

[0218] The third service connection information may include device connection information of all peer devices 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 may report an error and terminate the process of determining the matching success information or matching failure information corresponding to the target service (i.e., no longer executing S508-S519).

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

[0220] 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, at this time, the third electronic device is the counterpart 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.

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

[0222] 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 is terminated and S508 is executed. If the device connection information of the third electronic device is empty, S705 is executed.

[0223] S705: The electronic device obtains second historical service connection information corresponding to the fourth electronic device and the target service.

[0224] The electronic device obtains the second historical callback information corresponding to the fourth electronic device and the target service after receiving the service triggering operation last time. The second historical service connection information may be obtained by parsing the second historical callback information.

[0225] It should be noted that, for details of the second historical callback information, reference may be made to the introduction of the second callback information in S507 above; for details of the second historical service connection information, reference may be made to the introduction of the second service connection information in S507 above, which will not be repeated here.

[0226] It can be understood that the device connection information of the third electronic device obtained by the electronic device from the second business connection information is empty, indicating that the business triggering operation is used to trigger the electronic device to disconnect from a peer device for the target business. The electronic device can then obtain the second historical business connection information to re-obtain the device connection information of the third electronic device based on the second historical business connection information.

[0227] S706: The electronic device determines whether the second historical service connection information is empty.

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

[0229] S707. When the electronic device traverses the 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.

[0230] The electronic device traverses the second historical service connection information, and if the device ID in the device connection information of a traversed 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.

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

[0232] It is understandable that, when a service triggering operation is used to trigger the electronic device to disconnect 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, the device status information in the device connection information of the third electronic device indicates that the connection is being connected or has been established. Therefore, the electronic device needs to update the device connection status in the device connection information of the third electronic device to disconnected, so that the device connection status in the device connection information of the third electronic device is compatible with the service triggering operation, and prevent deviations in the subsequent comparison of the device connection information of the two disconnected devices.

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

[0234] 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.

[0235] It is understandable that during the process of disconnecting the third and fourth electronic devices for the target service, the fourth electronic device may go offline and then go online. At this time, 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 the second historical service connection information corresponding to the fourth electronic device is empty, and the device connection information of the third electronic device cannot be obtained from the second historical service connection information. In the case that the fourth electronic device goes offline and then goes online during the process of disconnecting the target service, the device connection status of the third and fourth electronic devices are both disconnected, that is, the target service is disconnected, and the service balls of the recipients in the third and fourth electronic devices are successfully removed. This situation (that is, the fourth electronic device goes offline and then goes online during the process of disconnecting the target service) does not belong to the case of abnormal hanging or removal of the service ball, and the matching success information should be recorded. Therefore, for the scenario where the fourth electronic device goes offline and then goes online, the electronic device can again 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, it means that the device connection information of the third electronic device has been successfully re-acquired, and the process of obtaining the device connection information of the third electronic device is terminated 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 online again during the disconnection process of the target service, and the process of obtaining the device connection information of the third electronic device is continued.

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

[0237] 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 online again during the disconnection process of the target service, and S711 is continued 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 may be reported, and the process of determining the matching success information or matching failure information corresponding to the target service is terminated (i.e., S508-S519 are no longer executed).

[0238] S711: The electronic device determines that the newly created device connection information is the device connection information of a 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.

[0239] The electronic device executes S711, which indicates that the fourth electronic device goes offline and then online again during the process of disconnecting the target service. This situation (i.e., the fourth electronic device goes offline and then online again during the process of disconnecting the target service) does not belong to the abnormal hanging or removal of the service ball, and the matching success information should be recorded. Therefore, the electronic device can create a new device connection information and use the newly created device connection information as the device connection information of the third electronic device for subsequent processing. The electronic device uses the newly created device connection information as the device connection information of the third electronic device for subsequent processing, and can obtain the first matching success information corresponding to the target service.

[0240] It is understandable that the electronic device performs different operations to determine the matching result corresponding to the target service in response to the connection with the peer device for the target service, the disconnection from the peer device for the target service, and the situation where the fourth electronic device goes offline and then goes online during the process of disconnecting the target service. Therefore, this solution can accurately obtain the matching results corresponding to the target service in various situations, thereby accurately counting 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 is effective.

[0241] refer to Figure 8 , introduces the process of how the electronic device processes each element in the polling comparison list according to the timer strategy. Figure 8 As shown, the data processing method provided in the embodiment of the present application may also include S801-S806.

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

[0243] The electronic device traversing the polling comparison list according to the preset traversal period may mean that the electronic device sequentially accesses all elements in the polling comparison list according to the preset traversal period, and only accesses one element in the polling comparison list at the beginning of each preset traversal period. For example, the preset traversal period may be 0.5 seconds.

[0244] The first timestamp in the element may point to the moment when the element is added to the polling comparison list.

[0245] Exemplarily, the electronic device may subtract the first timestamp in the element from the current time to obtain the second delay.

[0246] S802: The electronic device determines whether the second delay is less than a preset duration.

[0247] If the second delay is not less than (i.e., greater than or equal to) the preset duration, it indicates that the waiting time for an element in the traversed polling comparison list has timed out, and S803 is executed. If the second delay is less than the preset duration, it indicates that the waiting time for an element in the traversed polling comparison list has not timed out, and no processing is performed on the element, and the next element in the polling comparison list is accessed at the start of the next preset traversal cycle.

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

[0249] The second match failure information may include: the service ID of the service in the element, the match result, the delay, and an explanation. The match result in the first match failure information is false, indicating a match failure. The delay in the first match failure information is equal to the second delay. The explanation in the first match failure information is timeout.

[0250] S804: The electronic device deletes the element from the polling comparison list.

[0251] 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 determination of whether the element has timed out.

[0252] S805: The electronic device determines whether the polling comparison list is empty.

[0253] If the polling comparison list is empty, then S806 is executed. If the polling comparison list is not empty, then the next element in the polling comparison list is accessed when the next preset traversal cycle starts.

[0254] S806. The electronic device turns off the timer.

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

[0256] The embodiment of the present application also provides a data processing method, which is 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 may execute the steps (including S501-S519, S601-S610, S701-S711, and S801-S806) performed by the above-mentioned electronic device to determine the matching result corresponding to the target business, and send the matching result to the cloud server. Then, the cloud server may determine the second total number of successes and the second total number of failures based on all matching results received from the multiple electronic devices within a preset sampling period, and then determine the information synchronization success rate of the device management service based on the second total number of successes and the second total number of failures; the second total number of changes in the business ball in the control center interface of the multiple electronic devices may be subtracted from the second total number of successes to obtain the number of times the hanging ball compensation mechanism is effective.

[0257] The second total number of successes may 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 may 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 may 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 may be equal to the sum of the first total number of changes for the multiple electronic devices.

[0258] For example, in combination Figure 4 , taking the data processing system including the first electronic device and the second electronic device, the first electronic device being the initiator of the target service, the second electronic device being the receiver of the target service, and the first device management service and the second device management service successfully synchronizing information as an example, the process of the data processing system executing the data processing method is introduced. Figure 9 As shown, the data processing method applied in the data processing system may include S901-S911.

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

[0260] S902: The first control center uses the device ID of the local device to request the first device management service to obtain fourth service connection information corresponding to the first electronic device and the target service.

[0261] S903: The first control center obtains device connection information of a peer device according to fourth service connection information corresponding to the first electronic device and the target service, where the peer device is a second electronic device.

[0262] S904: The first control center searches the polling comparison list to see whether there is a target element that matches the service ID of the target service and the device connection information of the opposite device.

[0263] S905: When 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 opposite device, the timer sends a first message indicating that there is no matching result to the first control center.

[0264] S906 . After S408 , the first control center receives the local device connection information from the first device management service, and the fifth service connection information corresponding to the first electronic device and the target service.

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

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

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

[0268] S910. The first control center determines that the fifth service connection information and the sixth service connection information match successfully 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.

[0269] It should be noted that, for details of S910, reference can be made to the introduction of S510 above, which will not be repeated here.

[0270] S911. The first control center sends first matching success information to the cloud server.

[0271] It should be noted that the second electronic device may also determine the matching result corresponding to the current service after S412. The process of the second electronic device determining the matching result corresponding to the current service can refer to the introduction of the first electronic device determining the matching result corresponding to the current service described in S901-S911 above, and will not be repeated here.

[0272] For example, in combination Figure 4 , taking the data processing system including a first electronic device and a second electronic device, the first electronic device being the initiator of the target service, the second electronic device being the receiver of the target service, and the failure of information synchronization between the first device management service and the second device management service as an example, the process of the data processing system executing the data processing method is introduced. Figure 10 As shown, the data processing method applied in the data processing system may include S1001-S1008.

[0273] S1001: After S410, a first control center in a first electronic device obtains a device ID of a peer device from service connection information corresponding to the first electronic device and a target service, where the peer device is a second electronic device.

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

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

[0276] S1004: The first control center starts a timer, and combines the device connection information of the opposite device, the service ID of the target service, and the first timestamp into a new element, and adds the new element to a polling comparison list in the timer.

[0277] S1005: The first control center traverses the polling comparison list according to a preset traversal period, and determines a second delay for an element in the traversed polling comparison list using the current time and a first timestamp in the element.

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

[0279] S1007: The first control center deletes the element from the polling comparison list.

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

[0281] It should be noted that the second electronic device may also determine the matching result corresponding to the current service after S412. The process of the second electronic device determining the matching result corresponding to the current service can refer to the introduction of the first electronic device determining the matching result corresponding to the current service described in S1001-S1008 above, and will not be repeated here.

[0282] It should also be noted that the third electronic device in the embodiment of the present application is equivalent to the first target device in the invention content, and the fourth electronic device is equivalent to the second target device in the invention content.

[0283] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0284] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0285] An embodiment of the present application also provides an electronic device, which includes: a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method executed by the above-mentioned electronic device.

[0286] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions; wherein, when the computer instructions are executed on an electronic device, the electronic device executes the method executed by the above-mentioned electronic device; when the computer instructions are executed on a data processing system, the electronic device executes the method executed by the above-mentioned data processing system.

[0287] An embodiment of the present application also provides a computer program product, which includes executable instructions; wherein, when the computer program product is run on an electronic device, the electronic device executes the method executed by the above-mentioned electronic device; when the computer instructions are run on a data processing system, the electronic device executes the method executed by the above-mentioned data processing system.

[0288] The present application also provides a chip system. 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 can be interconnected via a line. For example, the interface circuit 1102 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1102 can be used to send signals to other devices (such as the processor 1101).

[0289] For example, the interface circuit 1102 can read instructions stored in the memory and send the instructions to the processor 1101. When the instructions are executed by the processor 1101, the chip system can perform the various steps in the above embodiment. Of course, the chip system can also include other discrete components, which are not specifically limited in this embodiment of the present application.

[0290] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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.

[0291] In the several embodiments provided in this application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0292] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0293] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0294] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0295] The above content is only a specific implementation method of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be included in the protection scope of the present application.< / deviceconnectioninfo>

Claims

1. A data processing method, characterized in that: Applied to an electronic device, the electronic device includes a device management service, and the method includes: After receiving a service trigger operation, obtaining a first callback message corresponding to a first target device from the device management service, wherein the service trigger operation is used to trigger the electronic device to connect or disconnect with another electronic device for a target service; the first target device is the electronic device or the other electronic device; 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, and the at least one peer device of the first target device includes: a peer device that connects to or disconnects from the first target device for the target service; Acquire device connection information of a second target device from the first service connection information, and acquire second service connection information corresponding to the second target device and the target service from a local cache using the device ID of the second target device and the service ID of the target service; Based on the first business connection information and the second business connection information, a matching result corresponding to the current business is obtained, wherein the matching result corresponding to the current business 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, and the matching result corresponding to the current business is used to determine the success rate of the information synchronization of the device management service.

2. The method according to claim 1, wherein: The method further comprises: Collect statistics on 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 according to the matching result corresponding to the at least one service, wherein the matching result corresponding to the at least one service includes the matching result corresponding to the current service.

3. The method according to claim 2, characterized in that Determining the success rate of information synchronization of the device management service according to the matching result corresponding to the at least one service includes: Determining a first total number of successes and a first total number of failures based on the matching result corresponding to the at least one service, where the first total number of successes is equal to the total number of successful matches in the matching result corresponding to the at least one service, and the first total number of failures is equal to the total number of failed matches in the matching result corresponding to the at least one service; A success rate of information synchronization of the device management service is obtained according to the first total number of successes and the first total number of failures.

4. The method according to claim 3, wherein: The method further comprises: Counting the number of times the electronic device displays a service ball being attached and the number of times the electronic device displays a service ball being removed within the preset sampling period; Adding the number of times the electronic device displays a service ball and the number of times the electronic device removes the service ball to obtain a total number of first changes; The number of times the hanging ball compensation mechanism is effective is obtained by subtracting the first total number of successes from the total number of the first changes.

5. The method according to any one of claims 1 to 4, characterized in that After acquiring the device connection information of the second target device from the first service connection information, the method further includes: When the device connection state 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; The acquiring, from a local cache, second service connection information corresponding to the second target device and the target service by using the device ID of the second target device and the service ID of the target service includes: When the combination information reaches the front of the preset queue, the second service connection information corresponding to the second target device and the target service is acquired from the local cache using the device ID of the second target device and the service ID of the target service.

6. The method according to any one of claims 1 to 5, characterized in that Obtaining a matching result corresponding to the current service according to the first service connection information and the second service connection information includes: Obtaining device connection information of the first target device according to the second service connection information; In a case where the first target device is the electronic device, determining whether the first service connection information and the second service connection information match according to the device connection information of the first target device and the device connection information of the second target device; When the device connection information of the first target device includes the device ID of the first target device and the device connection status of the first target device, the device connection information of the second target device includes the device ID of the second target device and the 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, it is determined that the first business connection information and the second business connection information match, and the first matching success information corresponding to the target business is recorded, and the matching result corresponding to the current business includes the first matching success information.

7. The method according to any one of claims 1 to 5, characterized in that Obtaining a matching result corresponding to the current service according to the first service connection information and the second service connection information includes: Obtaining device connection information of the first target device according to the second service connection information; In a case where the first target device is the other electronic device, searching a target element from the polling comparison list for a match between 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 further includes the same content as the device connection information of the first target device; Determining a first time delay using a current time and a first timestamp in the target element; When the first delay is less than a preset time length, recording second matching success information corresponding to the target service, and the matching result corresponding to the current service includes the second matching success information; When the first delay is greater than or equal to a preset duration, 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 comprises: The electronic device deletes the target element from the polling comparison list.

9. The method according to any one of claims 6, characterized in that The method further comprises: When 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 a first timestamp, and added to the polling comparison list in the timer, wherein the first timestamp is the time when the new element is added to the polling comparison list; According to the timer strategy, a 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, according to a timer strategy, a matching result corresponding to each element in the polling comparison list, including: Traversing the polling comparison list according to a preset traversal period, and determining a second delay for an element in the traversed polling comparison list using a current time and a first timestamp in the element; When the second delay is greater than or equal to the preset duration, second matching failure information corresponding to the service in the element is recorded, and the element is deleted from the polling comparison list.

11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: Receiving the service triggering operation on a first interface, where the first interface includes a first device ball corresponding to the electronic device and a second device ball corresponding to the other electronic device; In response to the service triggering operation, attaching or removing a service ball in the first interface; 12. The method according to claim 11, characterized in that The step of attaching or removing a business ball in the first interface includes: In a case where the service triggering operation is used to trigger the connection between the electronic device and the other electronic device for the target service, the electronic device hangs the service ball on the first device ball or the second device ball; In a case where the service triggering operation is used to trigger the disconnection of the electronic device from the other electronic device for performing 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: Applied to a data processing system, the data processing system includes a first electronic device and a cloud server, the method includes: After receiving the service triggering 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 triggering operation is used to trigger the electronic device to connect or disconnect with another electronic device for a 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, 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: a peer device that connects to 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 a 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 information synchronization of the device management service is successful, or is used to indicate that information synchronization of the device management service is failed; The first electronic device sends the matching result corresponding to the current service to the cloud server; The cloud server determines a success rate of information synchronization of the device management service based on a matching result corresponding to the current service.

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

15. The method according to claim 14, characterized in that The cloud server determines, based on the matching results received from the plurality of electronic devices within a preset sampling period, a success rate of information synchronization of the device management service, including: The cloud server determines, based on the matching results received from the multiple electronic devices within a preset sampling period, a second total number of successes and a second total number of failures, where the second total number of successes is equal to the total number of matching success 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 matching failure messages in the matching results received from the multiple electronic devices; The cloud server obtains a success rate of information synchronization of the device management service according to the second total number of successes and the second total number of failures.

16. The method according to claim 14, characterized in that The method further comprises: The cloud server counts the number of times the multiple electronic devices display the hanging of the service balls and the number of times the multiple electronic devices display the removal of the service balls within the preset sampling period; The cloud server adds the number of times the multiple electronic devices display the service balls and the number of times the multiple electronic devices remove the service balls to obtain a 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 hanging ball compensation mechanism is effective.

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, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the electronic device executes the method according to any one of claims 1 to 12.

18. A data processing system, characterized in that: The data processing system includes: a first electronic device and a cloud server for executing the method according to any one of claims 13 to 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 is caused to execute the method according to any one of claims 1 to 12; Alternatively, when the computer instructions are executed on a data processing system, the data processing system is caused to perform the method according to any one of claims 13 to 16.

20. A chip system, characterized in that: The chip system includes a processor and an interface circuit, wherein the processor and the interface circuit are interconnected via a line; wherein the interface circuit is configured to receive a first signal from an electronic device and send the first signal to the processor, wherein the first signal includes a first computer instruction; when the processor executes the first computer instruction, the chip system executes the method according to any one of claims 1 to 12; Alternatively, the interface circuit is used to receive a second signal from a data processing system and send the second signal to the processor, wherein the second signal includes a second computer instruction; when the processor executes the second computer instruction, the chip system executes 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

  • Data reporting method and electronic equipment

    CN117714088A

  • Channel selection method and electronic equipment

    CN118368322A

  • Session Synchronization Across Multiple Devices in an Identity Cloud Service

    US20200007530A1