Information statistics method, electronic device, chip system and storage medium
Patent Information
- Application Number
- CN202510574565.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0094]第五方面,提供了一种计算机程序产品,当计算机程序产品在设备上运行时,使得电子设备执行本申请第一方面任一项的方法中的步骤。
Smart Images

Figure CN123011654A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and in particular to an information statistics method, electronic equipment, chip system and storage medium. Background Technology
[0002] Electronic devices can include various types, such as mobile phones, which are convenient for taking photos but not for studying or working, and laptops, which are convenient for studying or working but not for taking photos. In some scenarios, users can use their mobile phones to take photos and their laptops to study or work. However, when a user is using a laptop for studying or working, if they need to take photos with their mobile phone and transfer them to the laptop, they need to use the laptop to access the mobile phone's camera function across devices.
[0003] In practical applications, cross-device business calls are prone to failure. From the user's perspective, user interface changes can be used to inform the user whether the cross-device call was successful or failed. However, for developers, further optimization of cross-device business calls requires obtaining more statistical information to determine specific optimization strategies. Summary of the Invention
[0004] This application provides an information statistics method, electronic device, chip system, and storage medium that can collect some information during cross-device calls, providing developers with a basis for optimizing cross-device call solutions.
[0005] To achieve the above objectives, the first aspect of this application provides an information statistics method, employing the following technical solution:
[0006] The first device receives a first operation, which is used to trigger the calling device to call the first service on the called device.
[0007] In response to the first operation, the first device triggers the establishment of a first call connection between the first service on the calling device and the first service on the called device;
[0008] The first device records the first connection information during the process of establishing the first call connection;
[0009] The first device obtains first statistical information of the first call connection based on the first connection information. The first statistical information includes: the first call result and the time consumed at each stage in the process of establishing the first call connection.
[0010] In this application, cross-device call scenarios may involve a calling device, a called device, and an operating device. The operating device may be the same as or different from the calling device. When collecting information in cross-device call scenarios, collecting connection process information from multiple devices separately may result in data duplication, complexity, and redundancy.
[0011] This application embodiment sets up information collection on the operating device side and generates statistical information for developers to view based on the collected information. The statistical information can include success, failure, and the reason for failure, and may also include the time spent in each stage. By statistically analyzing the success rate, the current user experience can be determined and the success rate can be improved; by analyzing the time spent in each stage, stages that may be optimized can be identified (e.g., reducing the time spent in one or more stages).
[0012] As one implementation of the first aspect, the calling device is a first device, and the called device is a second device; the first device includes a first control center and a first application, the first application providing the first service; the second device includes a second control center and a second application, the second application providing the first service.
[0013] The first device records the first connection information during the process of establishing the first call connection, including:
[0014] The first control center generates a first invocation instruction, which includes an operating device, an invocation device, and a device being invoked;
[0015] The first control center sends the first invocation command to the first application;
[0016] If the first application has the ability to initiate a call connection, it initiates the first call connection to the second application based on the first call instruction. The first call connection is used to establish a call connection between the first application and the second application and obtain a first connection result, which includes connection success or connection failure.
[0017] The first application sends the first connection result to the first control center;
[0018] The first control center records the time when it receives the first connection result as the connection response time, and the first connection information includes the connection response time.
[0019] In this application, when the calling device and the operating device are the same, and the business application of the operating device has the ability to initiate a call connection, the business application of the operating device can directly initiate a call connection to the business application of the called device, and the business application of the operating device can also send the call result directly to the control center of the local machine, thereby determining whether the connection is successful or failed, and the connection response time.
[0020] As one implementation of the first aspect, after the first control center sends the first invocation instruction to the first application, it further includes:
[0021] If the first application does not have the ability to initiate a call connection, it sends a first message to the first control center, the first message indicating that the first application does not have the ability to initiate a call connection.
[0022] After receiving the first information, the first control center sends the first call instruction to the second control center. The first call instruction is used to trigger the second control center to control the second application to initiate the first call connection to the first application. The first call instruction is also used to transmit the first connection result from the second application to the first control center through the second control center.
[0023] The first control center shall record the time when it receives the first connection result as the connection response time.
[0024] In this application, when the calling device and the operating device are identical, and the business application on the operating device lacks the capability to initiate a connection, the business application on the operating device cannot directly initiate a connection to the business application on the called device. Instead, it needs to notify its own control center that it lacks the capability to initiate a connection. The operating device's control center then sends the call instruction to the control center of the called device, causing the called device's control center to send a call instruction to its own business application, which in turn initiates a connection with the calling device's business application. Correspondingly, the called device's business application also needs to return the call result to the operating device's control center, which can be transmitted via a communication connection between the control centers. This allows the operating device to collect information on connection success or failure, as well as the connection response time. Furthermore, transmitting the call completion and collection time information through the control center reduces the burden of data synchronization between the business applications of the two devices. Additionally, sending the collected information directly from the local business application to the local control center shortens the data transmission link and increases speed.
[0025] As one implementation of the first aspect, before the first control center sends the first invocation instruction to the first application, the method further includes:
[0026] The first control center generates a first call item, which is used to record the first connection information;
[0027] The first control center will record the time when it receives the user's operation as the initiation time in the first calling project;
[0028] After the first control center sends the first invocation instruction to the first application, the method further includes:
[0029] The time when the first control center sends the first call instruction to the first application is recorded as the call start time in the first call item;
[0030] The first control center receives the first response returned by the first application after receiving the first call instruction, and records the time of receiving the first response in the first call item as the call response time.
[0031] In this application, multiple time nodes are set on the operating device side, and the specific time of each time node is collected to calculate the time consumed in each subsequent stage.
[0032] As one implementation of the first aspect, the first device obtains first statistical information of the first call connection based on the first connection information, including:
[0033] The first control center calculates the time consumed in each stage based on the initiation time, the call start time, the call response time, and the connection response time.
[0034] As one implementation of the first aspect, the first device further includes: a first state synchronization module, and the second device further includes: a second state synchronization module;
[0035] If the first application has the capability to initiate a call connection, after the first application initiates the first call connection to the second application based on the first call instruction, the method further includes:
[0036] The first application sends the first connection result to the first state synchronization module, and the first connection result is used to trigger a change in the connection state within the first state synchronization module.
[0037] After the first control center detects a change in the connection status in the first status synchronization module, it updates the status indicator in the currently displayed interface of the first device and records the time when the connection status in the first status synchronization module changes as the interface change time in the first call project.
[0038] If the first application does not have the ability to initiate a connection call, the method further includes:
[0039] After the first control center detects a change in the connection status in the second status synchronization module, it updates the status indicator in the currently displayed interface of the first device and records the time when the connection status in the second status synchronization module changes as the interface change time in the first call item. The status in the second status synchronization module is determined by the first connection result sent by the second application. The first connection result is obtained after the second application initiates the first call connection to the first application.
[0040] In this application, a parameter for collecting interface change time is also set. Since in cross-device call scenarios, the control center synchronizes the information of successful or failed connection of business applications through the status synchronization module, the control center that operates the device can also monitor the status synchronization module of the calling device and the called device in the current call instruction to obtain the information of successful or failed connection again, and can remember the time of interface update.
[0041] In practical applications, the business application that initiates the call connection synchronizes the call result to the local status synchronization module. The control center on the operating device side can monitor the status changes in the status synchronization module of each device in the call command. Therefore, it can be applied in situations where the application has the ability to initiate a call connection or in situations where the application does not have the ability to initiate a call connection.
[0042] As one implementation of the first aspect, the first device obtains first statistical information of the first call connection based on the first connection information, including:
[0043] The first control center calculates the time consumption of each stage based on the initiation time, the call start time, the call response time, the connection response time, and the interface change time.
[0044] As one implementation of the first aspect, before the first control center sends the first invocation instruction to the first application, the method further includes:
[0045] The first control center determines whether the first device and the second device meet the connection conditions;
[0046] When the first device and the second device meet the connection conditions, the first control center creates the first scheduling instruction and records the time of creating the first scheduling instruction in the first call item as the instruction creation time.
[0047] The first control center uses the instruction creation time as an index for the first calling item, stores it in the first storage space of the first device, and starts a timer;
[0048] After starting the timer, the first control center traverses the call items in the first storage space at a preset time period to obtain the first statistical information of the call items.
[0049] In this application, whether the connection condition is met refers to the physical condition under which the two devices can establish a call connection. Although the control center on the operating device side can calculate statistics after receiving the call result (and remove the call item after calculating the statistics), in some scenarios where errors occur midway leading to failure, the control center on the operating device side may not receive the call result, resulting in the inability to calculate statistics. This application sets up a fallback mechanism, traversing the cached call items for which statistics have not yet been calculated, to avoid failing to exclude some failed call items from the statistics, thus preventing inaccurate statistical data.
[0050] As one implementation of the first aspect, the process by which the first control center traverses the call items in the first storage space includes:
[0051] If the difference between the current time and the initiation time in the called item is less than or equal to a first value, the first control center traverses the next called item in the first storage space at a preset time period.
[0052] If the difference between the current time and the initiation time in the called project is greater than the first value, the first control center sets a timeout period (the difference between the current time and the initiation time in the called project);
[0053] After setting the timeout period, the first control center obtains the first statistical information of the first call connection based on the first connection information within the call project;
[0054] After obtaining the first statistical information, remove the currently traversed call item.
[0055] In this application, a first value (time) can be set as a time boundary. If the cache still contains the calling item after the first value's duration (but it has not been removed from the statistical information within the first value's duration), it means that the calling item has not yet received the connection result from the business side. Therefore, it is necessary to collect information about the calling item and remove it after the statistics are collected. If the cache does not exceed the first value's duration, it means that the current calling item may still receive the connection result, so the next calling item is traversed.
[0056] As one implementation of the first aspect, obtaining the first statistical information of the first call connection based on the first connection information within the call item includes:
[0057] If there is no connection response time in the first connection information, the timeout time is obtained by subtracting the call response time from the timeout time.
[0058] In this application, the timeout is set to the difference between the traversal time and the initiation time in the called project, which is greater than the first value. If the call end time has been received, it means that the actual timeout is the time from the call response time to the traversal time. Therefore, the call response time needs to be subtracted.
[0059] As one implementation of the first aspect, the method further includes:
[0060] When the first control center receives first connection failure information transmitted from the first service, it generates a first type of error code based on the first connection failure information. The first type of error code is used to indicate that the connection failure is caused by the first service.
[0061] The first control center generates a second type of error code based on the second connection failure information received by the first control center. The second type of error code is used to indicate that the connection failure is caused by the control center. The second type of error code includes: a first sub-code and a second sub-code. The first sub-code indicates that the calling device and the called device do not meet the connection conditions. The second sub-code indicates that the information transmission path between the control center of the calling device and the control center of the called device has failed. In the case where the connection failure reason of the called item is determined to be the second type of error code, the connection failure reason of the called item is no longer determined to be the first type of error code.
[0062] Upon receiving a successful first connection result, the first control center generates a third type of error code, which is used to indicate a successful connection.
[0063] In this application, the failure scenario responded by the business application is the expression method on the business application side. To avoid conflicts with the failure scenario on the control center side, a first-type error code on the control center side can be generated based on the connection failure information sent by the business side. Of course, different business sub-codes can be set for different reasons causing connection failures on the business side. Similarly, different control center sub-codes can be set for different reasons causing connection failures on the control center side. By setting different error codes for the business side and the control center side, it is easier to view the specific reasons for the failure.
[0064] As one implementation of the first aspect, the method further includes:
[0065] The first control center calculates second statistical information based on the first statistical information of multiple call items. The second statistical information includes: call success rate, control center call success rate, and business execution success rate.
[0066] The call success rate is the percentage of the number of call items with the third type of error code out of the total number of call items;
[0067] The success rate of the control center call is the percentage of the sum of the number of call items for the third type of error code and the number of call items for the first type of error code to the total number of the first statistical information.
[0068] The success rate of the business execution is the percentage of the number of calls with the third type of error code relative to the difference between the total number of calls and the number of calls with the second type of error code.
[0069] As one implementation of the first aspect, the calling device is a second device, and the called device is a third device; the first device includes a first control center and a first application, the first application providing a first service; the second device includes a second control center and a second application, the second application providing the first service; the third device includes a third control center and a third application, the third application providing the first service.
[0070] The first device records the first connection information during the process of establishing the first call connection, including:
[0071] The first control center generates a first invocation instruction, which includes an operating device, an invocation device, and a device being invoked;
[0072] The first control center sends the first call instruction to the second control center. The first call instruction is used to establish a first call connection between the second application and the third application and obtain a first connection result. The first connection result includes connection success or connection failure.
[0073] After receiving the first connection result, the first control center records the connection response time, and the first connection information includes the connection response time.
[0074] In this application, the cross-device invocation scenario may also involve an operation on the first device triggering a call from the second device to the third device's service. This scenario is similar to the one where an operation on the first device triggers a call from the first device to the second device. The main difference lies in the transmission path of the invocation command: from the control center of the first device to the control center of the second device. After receiving the invocation command, the control center of the second device first sends it to the service application of the second device. If the service application of the second device has the ability to initiate an invocation connection, it initiates a connection to the service application of the third device. If the service application of the second device does not have the ability to initiate an invocation connection, it notifies its own control center, which then sends the invocation command to the control center of the called device. The control center of the called device then sends the invocation command to the service application of the called device, which in turn initiates an invocation connection to the service application of the calling device. The return path of the connection result also differs. If the service application of the second device has the ability to initiate an invocation connection, the result is transmitted from the service application of the second device to the control center of the second device and then to the control center of the first device. If the service application of the second device does not have the ability to initiate an invocation connection, the result is transmitted from the service application of the third device to the control center of the third device and then to the control center of the first device. Before the control center of the first device sends a call command to the control center of the second device, a communication session is established between the two, and the time of establishing the communication session is used as the call start time. Other related content can be found in the description above.
[0075] As one implementation of the first aspect, when the second application has the ability to initiate a call connection, the first call instruction is transmitted from the second control center to the second application, triggering the second application to initiate the first call connection to the third application, and the first connection result is transmitted from the second application to the first control center through the second control center.
[0076] If the second application lacks the ability to initiate a call connection, the first call instruction, after being transmitted from the second control center to the second application, triggers the second application to send second information to the second control center. The second information indicates that the second application lacks the ability to initiate a call connection and instructs the second control center to send a first scheduling instruction to the third control center. After the first scheduling instruction is transmitted from the third control center to the third application, it triggers the third application to initiate the first call connection to the second application. The result of the first connection is transmitted from the third application through the third control center to the first control center.
[0077] As one implementation of the first aspect, before the first control center sends the first invocation instruction to the second control center, the method further includes:
[0078] The first control center generates a first call item, which is used to record the first connection information;
[0079] The first control center will record the time when it receives the user's operation as the initiation time in the first calling project;
[0080] The first control center creates a communication session between the first control center and the second control center, and records the creation time of the communication session as the call start time in the first call project. The communication session is used to transmit information between the first control center and the second control center.
[0081] After the first control center sends the first invocation instruction to the second control center, the method further includes:
[0082] The first control center receives the first response returned by the second control center after receiving the first call instruction, and records the time of receiving the first response in the first call item as the call response time.
[0083] As one implementation of the first aspect, the first device further includes: a first state synchronization module; the second device further includes: a second state synchronization module; and the third device further includes: a third state synchronization module.
[0084] When the second application has the ability to initiate a connection call, the connection status in the second state synchronization module changes, and is determined by the second application based on the first connection result;
[0085] After the first control center detects a change in the connection status in the second status synchronization module, it updates the status indicator in the currently displayed interface of the first device and records the time when the connection status in the second status synchronization module changes as the interface change time in the first call project.
[0086] If the second application does not have the ability to initiate a connection call, the connection status in the third state synchronization module changes and is determined by the third application based on the first connection result.
[0087] As one implementation of the first aspect, before the first control center creates a communication session between the first control center and the second control center, the method further includes:
[0088] The first control center creates the first scheduling instruction and records the time of creation of the first scheduling instruction in the first calling project as the instruction creation time.
[0089] The first control center uses the instruction creation time as an index for the first calling item, stores it in the first storage space of the first device, and starts a timer;
[0090] After starting the timer, the first control center traverses the call items in the first storage space at a preset time period to obtain the first statistical information of the call items.
[0091] In a second aspect, an electronic device is provided, including a processor configured to invoke a computer program stored in a memory to implement the steps of the method of any one of the first aspects of this application.
[0092] Thirdly, a chip system is provided, including a processor coupled to a memory, the processor executing a computer program stored in the memory to cause an electronic device to implement the steps of the method of any one of the first aspects of this application.
[0093] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed on an electronic device, causes the electronic device to implement the steps of the method of any one of the first aspects of this application.
[0094] Fifthly, a computer program product is provided that, when run on a device, causes an electronic device to perform the steps of the method of any one of the first aspects of this application.
[0095] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0096] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0097] Figure 2 This is a schematic diagram of an operation interface for cross-device invocation provided in an embodiment of this application;
[0098] Figure 3 The embodiments provided in this application are related to Figure 2 A flowchart illustrating a cross-device call process;
[0099] Figure 4 The embodiments provided in this application are related to Figure 2 A corresponding flowchart illustrating another type of cross-device invocation;
[0100] Figure 5 This application provides a schematic diagram of a technical architecture for cross-device invocation.
[0101] Figure 6 This is a schematic diagram of another cross-device call operation interface provided in an embodiment of this application;
[0102] Figure 7 The embodiments provided in this application are related to Figure 6 A flowchart illustrating a cross-device call process;
[0103] Figure 8 The embodiments provided in this application are related to Figure 6 A corresponding flowchart illustrating another type of cross-device invocation;
[0104] Figure 9 A schematic diagram illustrating a time node for collecting time information, provided in an embodiment of this application;
[0105] Figure 10 The embodiments provided in this application are related to Figure 3 A corresponding sequence diagram for cross-device calls;
[0106] Figure 11 The embodiments provided in this application are related to Figure 4 A corresponding sequence diagram for cross-device calls;
[0107] Figure 12 The embodiments provided in this application are related to Figure 7 A corresponding sequence diagram for cross-device calls;
[0108] Figure 13 The embodiments provided in this application are related to Figure 7 A corresponding sequence diagram for cross-device calls;
[0109] Figure 14 The embodiments provided in this application are related to Figure 8 A corresponding sequence diagram for cross-device calls;
[0110] Figure 15 A flowchart illustrating a fallback mechanism provided in an embodiment of this application;
[0111] Figure 16 A flowchart illustrating the calculation of time consumption at each stage, provided for an embodiment of this application;
[0112] Figure 17 This is a schematic diagram of a statistical information display interface provided in an embodiment of this application. Detailed Implementation
[0113] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.
[0114] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0115] It should also be understood that in the embodiments of this application, "one or more" refers to one, two, or more; "and / or" describes the relationship between the associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0116] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," "fourth," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0117] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0118] This application provides an information statistics method that can be applied to electronic devices. These electronic devices can be tablets, mobile phones, wearable devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. This application does not limit the specific type of electronic device.
[0119] Figure 1A schematic diagram of an electronic device is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0120] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0121] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0122] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0123] Internal memory 121 can be used to store computer executable program code, including instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function (such as image playback). Touch sensor 180K, also called a "touch panel," can be disposed on display screen 194. Touch sensor 180K and display screen 194 together form a touch screen, also called a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it. Touch sensor can transmit the detected touch operation to application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be disposed on the surface of electronic device 100, in a different location than display screen 194.
[0124] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0125] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a minimized display, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0126] This application does not specifically limit the structure of the execution subject of an information statistics method. As long as the code recording the information statistics method of this application is executed, communication can be performed according to the information statistics method provided in this application. For example, the execution subject of the information statistics method provided in this application can be a functional module in an electronic device capable of calling and executing programs, or a communication device applied in an electronic device, such as a chip.
[0127] This application provides a method for cross-device service invocation, which allows a user operation to trigger an electronic device to invoke a service on another electronic device.
[0128] As an example, an electronic device (e.g., electronic device A) can trigger an operation to call a service (e.g., photo taking, audio recording, screenshotting, screen recording, scanning, handwriting recognition, etc.) in another electronic device (e.g., electronic device B). This allows electronic device A to obtain objects captured or generated in real time by the called service in electronic device B. These objects can include, but are not limited to, documents, videos, audio, images, handwritten notes, and text. This object can be inserted into any application on electronic device A that has an object insertion function, or it can be stored in the storage space (e.g., disk) of electronic device A instead of being inserted into any application on electronic device A.
[0129] Reference Figure 2As shown, in the trust ring interface displayed on Pad V8 (i.e., electronic device A), the area corresponding to the photo-taking service in Magic 5 (i.e., electronic device B) is used as the starting point of the drag operation, and the area where the Pad V8 (i.e., electronic device A) is located is used as the ending point of the drag operation. After the drag operation is released at the ending point, Pad V8 (i.e., electronic device A) is triggered to call the photo-taking service in Magic 5 (i.e., electronic device B).
[0130] To allow users to more intuitively determine whether electronic device A has successfully established a service scheduling connection with electronic device B, the connection status can be represented by certain elements in the trust ring interface. For example, upon releasing a drag operation, a small ball representing Magic 5 (electronic device B) is added around the area where Pad V8 (i.e., electronic device A) is located in the current trust ring interface. If the Magic 5 ball is attached to the area around Pad V8 (i.e., electronic device A), it indicates that a call connection exists between Pad V8 and Magic 5. If the Magic 5 ball bounces away from the area around Pad V8 (i.e., electronic device A), it indicates that the call connection between Pad V8 and Magic 5 has been broken.
[0131] Additionally, it should be noted that electronic device B and electronic device A have a communication channel to transmit information. For example, electronic device B and electronic device A are connected via Wi-Fi Direct, or they are on the same local area network, or they have established a connection via Bluetooth. Of course, in practical applications, electronic device A and electronic device B may have other forms of communication connections.
[0132] From a security perspective, it's also possible to configure electronic device A to only access other electronic devices under the same account. This prevents one device from being accessed by another user's device when multiple devices are on the same local area network. The "same account" can refer to multiple related electronic devices set up by the user; these devices can belong to the same user, and can access each other.
[0133] The process of electronic device A calling electronic device B can be achieved in two ways.
[0134] Reference Figure 3 This is a schematic diagram illustrating a framework for electronic device A to call electronic device B, provided in an embodiment of this application. This calling process corresponds to… Figure 2 The scene shown.
[0135] Electronic device A includes a control center application and at least one business application. The business application includes a control center SDK and a business logic module.
[0136] Electronic device B also includes a control center application and at least one business application, which includes a control center SDK and a business logic module.
[0137] Step (1): The trust ring interface displayed by electronic device A is the interface of the control center application of electronic device A. In response to the user's drag operation on the interface of the control center application of electronic device A, the control center application of electronic device A sends a CallInnerBusiness instruction to the control center-SDK in the business application of this electronic device, which is used to send a call instruction to the business application of this electronic device. The control center-SDK is a toolkit for the control center to call the business application.
[0138] Step (2): After receiving the scheduling instruction, the business application of electronic device A first determines whether it can execute the call instruction (i.e., has the ability to initiate a business connection). If the business application can execute the call instruction, it initiates a call connection to the business application of electronic device B.
[0139] Among them, the business application of device A that initiates the connection call transmits the connection result to the control center of device A.
[0140] Reference Figure 4 This is a schematic diagram illustrating a framework for another electronic device A to call electronic device B, provided in an embodiment of this application. This calling process also corresponds to… Figure 2 The scene shown.
[0141] Step (1): The trust ring interface displayed by electronic device A is the interface of the control center of electronic device A. In response to the user's drag operation on the interface of the control center of electronic device A, the control center of electronic device A sends a CallInnerBusiness instruction to the control center-SDK in the business application of electronic device A. The CallInnerBusiness instruction is used to send a call instruction to the business application of this electronic device. The control center-SDK is a toolkit for the control center to call the business application.
[0142] Step (2): After receiving the call instruction, the business application of electronic device A first determines whether it can execute the call instruction. If the business application of electronic device A cannot execute the scheduling instruction, it sends a CallDistributedBusiness instruction to the control center of electronic device A through the control center-SDK of electronic device A. The CallDistributedBusiness instruction is used to send the information that the call instruction cannot be executed to the control center of electronic device A, thereby enabling electronic device A to initiate a call connection to the business application of electronic device A through the business application of another electronic device B.
[0143] In step (3), the control center of electronic device A forwards the call instruction to the control center of electronic device B.
[0144] Step (4): After receiving the call instruction, the control center of electronic device B sends the call instruction to the control center-SDK in the business application of electronic device B.
[0145] Step (5): After receiving the call instruction, the business application of electronic device B initiates a call connection to the business application of electronic device A.
[0146] In this process, the business application of device B that initiates the connection call transmits the connection result to the control center of device B, and the control center of device B then transmits the connection result back to the control center of device A.
[0147] regardless Figure 3 The process of the caller initiating the connection, as shown in the call direction, is still... Figure 4 The process shown, where the called party initiates a connection with the caller, and where a business application on one electronic device initiates a connection with a business application on another electronic device, are both time-consuming operations. Figure 3 Step (2) and Figure 4 Step (5) in the process takes a relatively long time.
[0148] To avoid blocking the connection establishment process of business applications while still ensuring timely notification of successful connection establishment, the control center can configure a profile application within the electronic devices. This profile application synchronizes connection status. For example, when a business application begins establishing a connection, it updates the connection status in the profile application from "idle" to "connecting." Upon successful connection, it updates the status to "connected." If the connection fails, it updates the status back to "idle." The control center can monitor the connection status in the profile application. If the status changes from "connecting" to "connected," the control center maintains the small ball of Magic 5 (electronic device B) in the area marked Pad V8 (electronic device A) on the trust ring interface. If the status changes from "connecting" to "idle," the control center removes the small ball of Magic 5 (electronic device B) from the area marked Pad V8 (electronic device A) on the trust ring interface.
[0149] Reference Figure 5 The diagram shown is a schematic representation of the software structure of an electronic device with an added profile application provided in an embodiment of this application.
[0150] For electronic device A, electronic device A includes a control center application, at least one business application, a profile application, and a Magiclink application (which communicates with other devices).
[0151] The control center application includes: a business logic module, a profile-SDK, and a Magiclink-SDK. The profile-SDK is a toolkit for the DeviceProfile application, which allows the control center application to communicate with the profile application; the Magiclink-SDK is a toolkit for the Magiclink application, which allows the control center application to communicate with the Magiclink application.
[0152] The business applications include: Control Center SDK, Business Logic Module, and Profile SDK. The Control Center SDK is a toolkit for the control center application, allowing business applications to interact with the control center; the Profile SDK is a toolkit for the profile application, allowing business applications to communicate with the profile application.
[0153] For electronic device B, electronic device B includes a control center application, at least one business application, a profile application, and a Magiclink application (for communication with other devices).
[0154] The control center application includes: a business logic module, a profile-SDK, and a Magiclink-SDK. The profile-SDK is a toolkit for the DeviceProfile application, which allows the control center application to communicate with the profile application; the Magiclink-SDK is a toolkit for the Magiclink application, which allows the control center application to communicate with the Magiclink application.
[0155] The business applications include: Control Center SDK, Business Logic Module, and Profile SDK. The Control Center SDK is a toolkit for the control center application, allowing business applications to interact with the control center; the Profile SDK is a toolkit for the profile application, allowing business applications to communicate with the profile application.
[0156] Understandable. Figures 2 to 5 The embodiments shown all illustrate a process where the control center of electronic device A initiates a connection between the business applications of electronic device A and electronic device B. Therefore, electronic device A, receiving user operations, is the master device, and electronic device B is the slave device; this scenario represents a master-slave connection. In practical applications, another method exists for cross-device business invocation.
[0157] As another method for cross-device service invocation, an operation within one electronic device (e.g., electronic device A) can trigger another electronic device (e.g., electronic device B) to invoke services within another electronic device (e.g., electronic device C). This allows electronic device B to obtain objects collected or generated in real-time by the invoked service in electronic device C. Similarly, this object can be inserted into any application of electronic device B that has object insertion functionality, or it can be stored in the storage space (e.g., disk) of electronic device B without being inserted into any application of electronic device B.
[0158] Reference Figure 6 As shown, in the trust ring interface displayed on Pad V8 (i.e., electronic device A), drag the camera service in Magic 5 (i.e., electronic device C) to the area where the Magic book X14 (i.e., electronic device B) is located, thereby triggering Magic book X14 (i.e., electronic device B) to call the camera service in Magic 5 (i.e., electronic device C).
[0159] Similarly, electronic devices A, B, and C have a communication channel to transmit information. Electronic devices A, B, and C are all under the same account.
[0160] In this scenario, the connection between electronic devices B and C is initiated by the control center of electronic device A. Therefore, electronic device A, which receives user operations, is the master device, while electronic devices B and C are both slave devices. This scenario is a slave-slave connection.
[0161] Reference Figure 7 As shown, this is an embodiment provided in this application. Figure 6 In the scenario shown, if the business application of device B has the ability to establish a call connection, the process of device B and device C establishing a call connection is described.
[0162] Electronic device C also includes a control center application and at least one business application, which includes a control center SDK and a business logic module.
[0163] In step (1), the trust ring interface displayed by electronic device A is the interface of the control center application of electronic device A. In response to the user's drag operation on the interface of the control center application of electronic device A, the control center application of electronic device A sends a connection command to the control center application of electronic device B.
[0164] Step (2): The control center application of electronic device B sends a CallInnerBusiness instruction to the control center-SDK in the business application of this electronic device, which is used to send a call instruction to the business application of this electronic device.
[0165] Step (3): After receiving the call instruction, the business application of electronic device B first determines whether it can execute the scheduling instruction (has the ability to establish a call connection). If the business application can execute the scheduling instruction, it initiates a call connection to the business application of electronic device C.
[0166] In this process, the business application of device B that initiates the connection call sends the connection result to the control center of device B, and the control center of device B then sends the connection result to the control center of device A.
[0167] Reference Figure 8 As shown, this is an embodiment provided in this application. Figure 6 The scenario shown illustrates the process of establishing a call connection between device B and device C when device B's business application lacks the capability to establish a call connection.
[0168] Step (1) The trust ring interface displayed by electronic device A is the interface of the control center of electronic device A. In response to the user's drag operation on the interface of the control center of electronic device A, the control center of electronic device A sends a call command to the control center of electronic device B.
[0169] Step (2): The control center of electronic device B sends a CallInnerBusiness instruction to the control center-SDK in the business application of electronic device B. The CallInnerBusiness instruction is used to send a call instruction to the business application of this electronic device.
[0170] Step (3): After receiving the call instruction, the business application of electronic device B first determines whether it can execute the scheduling instruction. If the business application of electronic device B cannot execute the scheduling instruction, it sends a CallDistributedBusiness instruction to the control center of electronic device B through the control center-SDK of electronic device B. The CallDistributedBusiness instruction is used to send the information that the call instruction cannot be executed to the control center of electronic device B, thereby enabling electronic device B to initiate a call connection with the business application of another electronic device C.
[0171] Step (4): The control center of electronic device B forwards the call instruction to the control center of electronic device C.
[0172] Step (5): After receiving the call instruction, the control center of electronic device C sends the call instruction to the control center-SDK in the business application of electronic device C.
[0173] Step (6): After receiving the call instruction, the business application of electronic device C initiates a call connection to the business application of electronic device B.
[0174] In this process, the business application of device C that initiates the connection call sends the connection result to the control center of device C. The control center of device C then sends the connection result directly to the control center of device A, or forwards the connection result to the control center of device A through the control center of device B.
[0175] regardless Figure 7 The process of the caller initiating the connection, as shown in the call direction, is still... Figure 7 The process shown, where the called party initiates a connection with the caller, and where a business application on one electronic device initiates a connection with a business application on another electronic device, are both time-consuming operations. Figure 7 Step (3) and Figure 8 Step (6) in the process is time-consuming. Therefore, a profile application has also been added to electronic devices.
[0176] Figure 6 In the scenario shown, the internal software structure of each electronic device can be referenced. Figure 5 The software structure shown will not be illustrated further.
[0177] Regardless of whether it's a master-slave connection or a slave-slave connection in the above embodiments, connection failures or even successful connections with long connection times may occur. From the user's perspective, the mounting status of the small ball in the trust ring interface can determine whether the call connection has been successfully established. For developers, understanding certain statistical information is necessary to better improve the call connection establishment process, thereby increasing connection speed and success rate.
[0178] However, after the control center generates scheduling instructions, connection establishment may fail due to either the control center's own actions or the business application's actions. In scenarios with long connection durations, although the communication between the control center and the business application is cross-process asynchronous, the control center cannot detect whether the business application's connection was successful or failed, nor can it track the time consumed by the business application during the connection establishment process, making information statistics difficult. Even when collecting multiple time information from different electronic devices, data duplication, complexity, and redundancy may occur.
[0179] This application provides an information statistics scheme for cross-device call services. It can record the time of multiple nodes in the control center of device A responding to user operations, and count the time of each stage based on the time of each node. In addition, if the recording is done in the control center of device A responding to user operations, the final connection result (local service side or other device service side) also needs to be transmitted to the control center of device A.
[0180] As mentioned earlier, there may be at least two connection modes: master-slave mode and slave-slave mode. Within each connection mode, there may be situations where the calling party's business side has the capability to initiate a connection, or it does not. Therefore, in practical applications, there are mainly four scenarios.
[0181] Scenario 1: Master-slave connection. An operation on device A triggers device A to call the business application on device B. The business application on device A has the ability to establish a scheduling connection. Figure 3 The data transmission process is shown.
[0182] Scenario 2: Master-slave connection. An operation on device A triggers device A to call the business application on device B. The business application on device A does not have the ability to establish a scheduling connection. Figure 4 The data transmission process is shown.
[0183] Scenario 3: Slave connection. An operation on device A triggers device B to call the business application on device C. The business application on device B has the ability to establish a scheduling connection. Figure 7 The data transmission process is shown.
[0184] Scenario 4: A connection is established between devices. An operation on device A triggers a call from device B to a service application on device C. The service application on device B has the capability to operate without establishing a scheduled connection. Figure 8 The data transmission process is shown.
[0185] Reference Figure 9 The above refers to the time acquisition nodes set for the corresponding scenarios in the four cases.
[0186] Taking a master-slave connection as an example, after receiving a user operation, the control center of device A determines the current time as the initiation time StartConnect. After determining that device A and device B meet the conditions for establishing a connection, the control center of device A constructs a local execution instruction (call instruction), obtaining the instruction creation time msgGenerated. The time when the control center of device A sends the instruction to the business application of device A is recorded as the call start time dispatchBegin. The time when the control center of device A receives the response returned by the business application of device A is recorded as the call response time dispatchEnd. The time when the control center of device A receives the connection result is recorded as the connection response time; if the call connection was initiated by the business application of device A, it is recorded as localBsReplied; if the call connection was initiated by the business application of device B, it is recorded as remoteReplied.
[0187] Taking a slave-to-slave connection as an example, after receiving a user operation, the control center of device A determines the current time as the initiation time StartConnect. The control center of device A constructs a local execution instruction (call instruction), obtaining the instruction creation time msgGenerated. The time when the control center of device A establishes a session with the service side of device A is recorded as the session start time opensession. The control center of device A sends the slave-to-slave mode call instruction to the service side of device A through the established session. The time when the control center of device A receives the response to the sent call instruction through the session is recorded as the call response time sendmessagecallback. The time when the control center of device A receives the connection result is recorded as the connection response time remoteReplied.
[0188] For consistency, the session start time can also be recorded as the call start time.
[0189] The following describes in detail the calling process under each case, as well as the process of obtaining the above-mentioned time nodes and calculating the time consumption of each stage based on each time node.
[0190] Reference Figure 10 This is the invocation process corresponding to Case 1 provided in the embodiments of this application, and... Figure 2The scenario shown corresponds to the timing diagram of the business application of electronic device A having the ability to execute scheduling instructions.
[0191] A1, the user initiates a connection by dragging and dropping in the control center interface displayed on device A.
[0192] In this embodiment, the control center interface displayed by device A can show the identifier of device A and multiple service identifiers in device B. The user can drag the area corresponding to one of the service identifiers in device B as the starting point and the area where the identifier of device A is located as the ending point, thereby triggering device A to call the corresponding service in device B.
[0193] The dragging operation in this step can be corresponding to... Figure 2 The drag operation shown is that device A is a PAD V8 and device B is a Magic 5, and device A calls the photo-taking service in device B.
[0194] A2, the control center of device A responds to the user's operation by constructing an operation parameter object OperationParam (which can also be referred to as a call item, with a unique identifier). OperationParam includes: StartConnect, InitiationType, Operation device op, Initiating end src, Initiated end sink, business, etc.
[0195] The initiation time is the current time, the initiation method is determined by the user's operation as manual initiation, the determined operating device is device A, the initiating end is device A, the initiated end is device B, and the service is photo taking.
[0196] In practical applications, more information is also included, such as the entry point being the Trust Ring Control Center, the operation type being a connection operation, the model and system version information of the calling device, the model and system version information of the called device, the time items for each stage (the specific time value for the current step is empty), whether it is a master-slave mode or a slave-slave mode, whether it is initiated manually by the user or passively initiated due to a remote call, etc.
[0197] The specific time items for each stage include: instruction creation time (as the unique key of the instruction CallBusinessCmd), initiation time, call start time (session creation time), call response time, connection response time, interface change time (time when a state change within the profile is detected), timeout time, status, etc.
[0198] A3, the control center of device A determines that the current connection mode is master-slave.
[0199] In this embodiment, the control center can determine whether the current connection is master-slave based on whether the operating device and the initiating device are the same. If the operating device and the initiating device are the same, the current connection is master-slave; if the operating device and the initiating device are different, the current connection is slave-slave. In this scenario, the operating device is device A, and the initiating device is device A, so it is a master-slave connection.
[0200] A4, the control center of device A determines whether the connection conditions are currently met.
[0201] In this embodiment of the application, the control center can determine whether the connection conditions are met by the following criteria:
[0202] Determine whether there are any services in the connection between the initiating and receiving ends.
[0203] Determine whether the service switches of the initiating and receiving ends are enabled;
[0204] Determine whether the services of the initiating and receiving ends can be scheduled;
[0205] Determine whether the device being invoked supports the call.
[0206] As another example, the control center can determine whether the current connection conditions are met by considering the following:
[0207] Determine if there are any conflicting services already connected between the initiating and receiving ends.
[0208] Determine whether the service switches of the initiating and receiving ends are enabled;
[0209] Determine whether the services of the initiating and receiving ends can be scheduled;
[0210] Determine whether the device being invoked supports the call.
[0211] In practical implementation, each condition can be checked sequentially according to a specific order. If any condition is not met, the connection condition is determined to be unmet. If all conditions are met, the connection condition is determined to be met. The connection condition is determined to be met if: neither the initiating nor the receiving end has any services currently connecting (or no conflicting services already connected); both the initiating and receiving ends have their service switches enabled; both the initiating and receiving ends' services are schedulable; and the receiving end's device supports being invoked. Otherwise, the connection condition is not met.
[0212] In case of A5, if the connection conditions are not met, the control center of device A will perform data logging, and the error code will be the one corresponding to the failure caused by the control center, thus ending the process. For example, the second type of error code (the error code caused by the control center). In practical applications, different control center sub-error codes can also be set according to various scenarios of failure caused by the control center.
[0213] A6. Under the condition that the connection conditions are met, the control center of device A constructs a local execution instruction CallBusinessCmd (i.e., a call instruction), with op=A, src=A, and sink=B. The instruction creation time msgGenerated is written into OperationParam and CallBusinessCmd to uniquely identify the call instruction.
[0214] A7, the control center of device A uses the instruction creation time msgGenerated as the index of OperationParam, puts OperationParam into the cache, and starts the timer.
[0215] A8, the control center of device A records the call start time dispatchBegin in OperationParam.
[0216] A9, the control center of device A uses the bindService method to call the business application of electronic device A across processes to send call instructions.
[0217] In this embodiment, the call start time can be recorded first and then the call instruction can be sent, or the call instruction can be sent first and the time of sending the call instruction can be recorded. This embodiment does not limit this, and the same applies to subsequent embodiments.
[0218] A10. After receiving the call instruction from the control center of device A, the business application of device A replies to the control center of device A with the current time and carries the unique identifier of the call instruction.
[0219] A11, after receiving the call instruction and timestamp from the business application of device A, the control center of device A obtains msgGenerated according to the call instruction, uses msgGenerated as an index to look up the corresponding OperationParam from the cache, and writes the received time as dispatchEnd into OperationParam.
[0220] In this embodiment of the application, the current time of the business application's reply can be used as the received time, or the actual time of receiving the response can be used as dispatchEnd. This embodiment of the application does not limit this, and the same applies to subsequent embodiments.
[0221] A12, the ability of device A's business application to determine whether the local end has specifically initiated a connection call.
[0222] A13, when the business application of device A has the ability to initiate a connection call, initiate a connection to the business application of device B.
[0223] A15, the business application of device A writes the connection result to the profile.
[0224] This application example uses a successful connection as an example. In practical applications, other information may also be written, such as the callee, connection status (connection success flag or connection failure flag), connection role, etc.
[0225] A16, the control center of device A can listen to the profile changes of device A's business applications by listening to callbacks, and attach or remove the ball according to the connection status in the profile (status of 1 keeps the ball around the area where device A's identifier is located) or remove the ball (status of 0 bounces the ball away from the area where device A's identifier is located).
[0226] A17, the control center of device A searches for Operationparam based on the local execution command, and writes the time of profile change detected as modifyBsBall and connection status into Operationparam.
[0227] A18. After receiving the connection result (connection successful) information, the business application of device A returns the connection result to the control center of device A, carrying a unique identifier of the scheduling instruction.
[0228] In this embodiment of the application, a success interface is used when execution is determined to be successful:
[0229] The `replySuccessResult(long cmdTimestamp, String businessId, String description)` method returns a unique identifier for the `OperationParam` and a success description.
[0230] If execution fails, use the failure interface:
[0231] The `replyFailResult(long cmdTimestamp, String businessId, int businessReturnCode, String businessSubCode, String errorDescription, int returnType, String content)` method can return a unique identifier of the `OperationParam`, the error code, the error subcode, the error description, and other information.
[0232] A19, the control center of device A obtains msgGenerated based on the unique identifier of the scheduling instruction it carries, uses msgGenerated as an index to look up the corresponding OperationParam in the cache, and determines from the found OperationParam that the initiation method is user manual initiation. Then, it writes the time of receiving the connection result as localBsReplied into the OperationParam.
[0233] In practical applications, A15, A16, and A17 form one branch, and A18 and A19 form another branch. These two branches are executed in no particular order and both are executed after A14.
[0234] A20, the control center of device A calculates the segmented time consumption based on the various times in OperationParam, marks the time, and then removes the current OperationParam from the cache.
[0235] Understandable. Figure 10 In the process shown, the OperationParam cached in the control center of device A includes the following time information:
[0236] Initiation time (startConnect), initiation method (user manual initiation), call start time (dispatchBegin), call response time (dispatchEnd), connection response time (localBsReplied), interface change time (modifyBsBall), status, etc.
[0237] Reference Figure 11 This is the calling process corresponding to Case 2 provided in the embodiments of this application, and... Figure 2 The scenario shown corresponds to the timing diagram of electronic device A when its service application lacks the ability to execute scheduling instructions. Steps A1 to A12 can be referenced... Figure 10 Description of the illustrated embodiment.
[0238] If the result of step A12 is negative, proceed as follows:
[0239] B1, the business application of device A returns the first message to the control center of device A, indicating that it does not have the ability to initiate a connection call.
[0240] This step can be referred to. Figure 4 Step (2) in the process.
[0241] B2, the control center of device A sends a call command to the control center of device B.
[0242] After receiving the call command, the control center of device B constructs the local operation parameter object OperationParam. OperationParam includes: StartConnect, InitiationType, Operation device op, Initiating end src, Initiated end sink, and business, etc.
[0243] The initiation time is the current time, the initiation method is determined by the user operation as passive initiation due to remote call, the determined operating device is device A, the initiating end is device A, the initiated end is device B, and the service is photo taking.
[0244] Other related information can be found in step A2.
[0245] In addition, since it has already been determined in step A4 that the connection conditions are met, the control center on device B does not need to repeat the step of determining whether the connection conditions are met.
[0246] B4, the control center of device B writes the creation time of the call command into OperationParam.
[0247] B5, the control center of device B uses the instruction creation time msgGenerated as the index of OperationParam, puts OperationParam into the cache, and starts the timer.
[0248] B6, the control center of device B uses the bindService method to call the business application of electronic device B across processes to send call instructions.
[0249] B7. After receiving the call instruction from the control center of device B, the business application of device B initiates a connection to the business application of device A.
[0250] This application example uses a successful connection as an example.
[0251] B9, after receiving the connection result information, the service application of device B writes the connection result into the profile.
[0252] In practical applications, other information may also be written, such as the callee, connection status (connection success flag or connection failure flag), connection role, etc.
[0253] B10, the control center of device A can listen to the profile changes of the business application of device B through the listener callback. Based on the connection status in the profile, it can attach a ball (if the status is 1, the ball will be kept around the area where the identifier of device A is located) or remove the ball (if the status is 0, the ball will bounce away from the area where the identifier of device A is located).
[0254] B11, the control center of device A searches for Operationparam, and writes the time when the profile change was detected as modifyBsBall and the connection status into Operationparam.
[0255] B12: After receiving the connection result (e.g., success) information, the service application of device B returns the connection result to the control center of device B, carrying a unique identifier of the scheduling instruction.
[0256] B13, the control center of device B obtains msgGenerated based on the unique identifier of the call instruction it carries, uses msgGenerated as an index to look up the corresponding OperationParam in the cache, and determines from the found OperationParam that the initiation method is a remote call passively initiated. Then, it continues to look up the initiating device, which is device A.
[0257] B14, the control center of device B sends a connection result to the control center of device A: successful.
[0258] B15. After receiving the connection result, the control center of device A looks up the OperationParam and writes the time when the connection result was received as remoteReplied into the OperationParam.
[0259] In practical applications, B9, B10, and B11 form one branch, while B12, B13, B14, and B15 form another branch. These two branches are executed in no particular order and both are executed after B8.
[0260] B16, the control center of device A calculates the segmented time consumption based on the various times in the OperationParam, marks the time, and then removes the current OperationParam from the cache.
[0261] Understandable. Figure 11 In the process shown, the OperationParam cached in the control center of device A includes the following time information:
[0262] Initiation time (startConnect), initiation method (user manual initiation), call start time (dispatchBegin), call success time (dispatchEnd), connection response time (remoteReplied), interface change time (modifyBsBall), status, etc.
[0263] The OperationParam cached in the control center of device B includes the following time information:
[0264] Initiation time: startConnect; Initiation method: Passive initiation via remote call.
[0265] Reference Figure 12 and Figure 13 This is the calling process corresponding to scenario three provided in the embodiments of this application, and... Figure 6 The scenario shown corresponds to the process of device A initiating a call from device B to device C for a service, where the service application of electronic device B has the ability to initiate a scheduling connection.
[0266] C1, the user initiates a connection by dragging in the interface displayed on device A.
[0267] In this embodiment of the application, the interface displayed by device A can display the identifier of device B and multiple service identifiers in device C. The user takes the area corresponding to one of the service identifiers in device C as the starting point and the area where the identifier of device B is located as the ending point, and performs a drag operation, thereby triggering device B to call a service in device C on device A.
[0268] The dragging operation in this step can be corresponding to... Figure 6 The drag-and-drop operation shown illustrates that device A is a PAD V8, device B is a MagicBook X14, and device C is a Magic 5. Device B is calling the camera function on device C.
[0269] C2, the control center of device A responds to the user's operation by constructing an operation parameter object OperationParam. OperationParam includes: StartConnect, InitiationType, Operation device op, Initiating end src, Initiated end sink, Service, etc.
[0270] The initiation time is the current time, the initiation method is determined by the user's operation as manual initiation, the determined operating device is device A, the initiating end is device B, the initiated end is device C, and the service is photo taking.
[0271] In practical applications, more information is also included, such as the initiation entry point being the Trust Ring Control Center, the operation type being a connection operation, and the time of each stage (the current step is empty).
[0272] C3, the control center of device A determines that the current connection mode is slave-slave.
[0273] As mentioned earlier, if the operating device and the initiating device are different, the current connection is a slave-slave connection. The operating device is device A, and the initiating device is device B, so the current connection is a slave-slave connection.
[0274] C4, the control center of device A constructs a cross-end execution instruction CallBusinessCmd, op=A, src=B, sink=C. The instruction creation time msgGenerated is written into OperationParam and the CallBusinessCmd instruction.
[0275] C5, the control center of device A uses the instruction creation time msgGenerated as the index of OperationParam, puts OperationParam into the cache, and starts the timer.
[0276] C6, Device A's control center creates a session with Device B's control center via MagicLink. This session is used for communication between Device A and Device B.
[0277] C7, the control center of device A records the time of session creation: opensession.
[0278] C8, the control center of device A sends a call command to the control center of device B through the created session, carrying the slave-slave connection mode.
[0279] C9. After receiving the instruction to call device C, the control center of device B returns response information to the control center of device A.
[0280] C10, the control center of device A determines whether the returned response information is success or failure.
[0281] C11, if the control center of device A determines that the returned response information is a failure, the control center of device A will perform data logging, the error code will be the error code corresponding to the failure caused by the control center, the subcode will be -102, the error code of MagicLink callback, and the process will end.
[0282] C12, if the control center of device A determines that the returned response information is successful, it writes the time when the response information was received as sendmessagecallback into OperationParam.
[0283] C13, after the control center of device B sends a successful response message, it determines whether device B and device C currently meet the connection conditions.
[0284] C14, if the connection conditions are not met, the control center of device B sends the call result to the control center of device A: failure, error code, failure caused by the control center.
[0285] C15. After receiving the connection result sent by the control center of device B, the control center of device A writes the time of receiving the connection result as remoteReplied into OperationParam.
[0286] C16 calculates segmentation time, marks points, and removes Param from the cache.
[0287] C17, Under the condition that the connection conditions are met, the control center of device B constructs OperationParam: initiation time, initiation method, operating device, initiating end, initiated end, and service.
[0288] The initiation time is the current time, the initiation method is determined by the user operation as passive initiation from the device, the determined operating device is device A, the initiating end is device B, the initiated end is device C, and the service is photo taking.
[0289] In practical applications, more information is also included, such as the initiation entry point being the Trust Ring Control Center, the operation type being a connection operation, and the time of each stage (the current step is empty).
[0290] C18, the control center of device B writes the creation time of the call command into OperationParam.
[0291] C19, the control center of device B uses the instruction creation time msgGenerated as the index of OperationParam, puts OperationParam into the cache, and starts the timer.
[0292] C20, the control center of device B sends a call command to the business application of device B.
[0293] C21, Device B's business application determines whether it has the capability to initiate a connection call.
[0294] C22, if the business application of device B has the ability to initiate a connection, the business application of device B sends a connection request to the business application of device C.
[0295] C24, After receiving the connection success message, the service application of device B writes the connection result to the profile.
[0296] C25, the control center of device A can listen to the profile changes of device B's business application by listening to callbacks. Based on the connection status in the profile, it can attach a ball (if status is 1, keep the ball of device C around the area where the identifier of device B is located) or remove the ball (if status is 0, bounce the ball of device C away from the area where the identifier of device B is located).
[0297] C26, the control center of device A, based on the lookup in Operationparam, writes the time when the profile change was detected as modifyBsBall and the connection status into Operationparam.
[0298] C27. After receiving the connection result information, the business application of device B returns a successful connection result to the control center of device B, carrying the unique identifier of the call instruction (e.g., instruction creation time).
[0299] In practical applications, C24, C25, and C26 form one branch, while C27, C28, C29, and C30 form another branch. These two branches are executed in no particular order and both are executed after C23.
[0300] C28, the control center of device B obtains msgGenerated based on the unique identifier of the call instruction it carries, uses msgGenerated as an index to look up the corresponding OperationParam in the cache, and determines from the found OperationParam that the initiation method is passively initiated from the device, then continues to look up the operation device: device A.
[0301] C29, The control center of device B sends a connection result to the control center of device A: Success.
[0302] C30, after receiving the connection result, the control center of device A looks up the OperationParam and writes the time when the connection result was received as remoteReplied into the OperationParam.
[0303] C31, the control center of device A calculates the segmented time consumption based on each time in the OperationParam, marks the time, and then removes the current OperationParam from the cache.
[0304] Understandable. Figure 12 and Figure 13 In the process shown, the OperationParam cached in the control center of device A includes the following time information:
[0305] Initiation time (startConnect), initiation method (user manual initiation), session creation time (opensession), call response time (sendmessagecallback), connection response time (remoteReplied), interface change time (modifyBsBall), status, etc.
[0306] The OperationParam cached in the control center of device B includes the following time information:
[0307] Initiation time: startConnect; Initiation method: Passively initiated from the device.
[0308] Reference Figure 14 This is the calling process corresponding to scenario four provided in the embodiments of this application, and... Figure 6 The scenario shown corresponds to the process of device A initiating a call from device B to device C for a service, where the service application of electronic device B does not have the capability to initiate a connection call. Steps C1 to C21 can be referenced... Figure 12 and Figure 13 Description of the illustrated embodiment.
[0309] If the result of step C21 is negative, proceed as follows:
[0310] D1, Device B's business application returns a first information order to Device B's control center indicating that it does not have the ability to initiate a connection call.
[0311] D2, the control center of device B sends a call command to the control center of device C.
[0312] D3. After receiving the call command, the control center of device C constructs an operation parameter object OperationParam. OperationParam includes: StartConnect, InitiationType, Operation device op, Initiating end src, Initiated end sink, and business, etc.
[0313] The initiation time is the current time, the initiation method is determined by the user operation as passive initiation due to remote call, the determined operating device is device A, the initiating end is device B, the initiated end is device C, and the service is photo taking.
[0314] In practical applications, more information is also included, such as the initiation entry point being the Trust Ring Control Center, the operation type being a connection operation, and the time of each stage (the current step is empty).
[0315] In addition, since it has been determined in step C13 that the connection conditions are met, the control center on the device C side does not need to repeat the step of determining whether the connection conditions are met.
[0316] D4, the control center of device C writes the creation time of the call command into OperationParam.
[0317] D5, the control center of device C uses the instruction creation time msgGenerated as the index of OperationParam, puts OperationParam into the cache, and starts the timer.
[0318] D6, the control center of device C uses the bindService method to call the business application of electronic device C across processes to send the call command.
[0319] D7. After receiving the call instruction from the control center of device C, the business application of device C initiates a connection to the business application of device B.
[0320] D8, after the connection result is successful or failed, the business application of device B sends the connection result to the business application of device C.
[0321] This application example uses a successful connection as an example.
[0322] D9, After the business application of device C obtains the connection result, it writes the connection result into the profile.
[0323] In practical applications, other information may also be written, such as the callee, connection status (connection success flag or connection failure flag), connection role, etc.
[0324] D10, the control center of device A can listen to the profile changes of the business application of device C through the listener callback. Based on the connection status in the profile, it can attach a ball (keep the ball of device C around the area where the identifier of device B is located) or remove the ball (bounce the ball of device C away from the area where the identifier of device B is located).
[0325] D11, the control center of device A, based on the search Operationparam, writes the time of the detected profile change as modifyBsBall and the connection status into Operationparam.
[0326] D12: After obtaining the connection result, the business application of device C returns the connection result to the control center of device C, carrying the unique identifier of the call command.
[0327] In practical applications, D9, D10, and D11 form one branch, and D12, D13, D14, and D15 form another branch. These two branches are executed in no particular order and both are executed after D8.
[0328] D13, the control center of device C obtains msgGenerated based on the unique identifier of the call instruction it carries, uses msgGenerated as an index to look up the corresponding OperationParam in the cache, and determines from the found OperationParam that the initiation method is a remote call passively initiated. Then, it continues to look up the operation device: device A.
[0329] D14, the control center of device C sends the connection result to the control center of device A: success or failure.
[0330] D15. After receiving the connection result, the control center of device A looks up the OperationParam and writes the time when the connection result was received as remoteReplied into the OperationParam.
[0331] D16, the control center of device A calculates the segmented time consumption based on the various times in the OperationParam, marks the time, and then removes the current OperationParam from the cache.
[0332] Understandable. Figure 14 In the process shown, the OperationParam cached in the control center of device A includes the following time information:
[0333] Initiation time (startConnect), initiation method (user manual initiation), session creation time (opensession), successful call time (sendmessagecallback), connection response time (remoteReplied), UI change time (modifyBsBall), status, etc.
[0334] The OperationParam cached in the control center of device B includes the following time information:
[0335] Initiation time: startConnect; Initiation method: Passively initiated from the device.
[0336] The OperationParam cached in the control center of device C includes the following time information:
[0337] Initiation time: startConnect; Initiation method: Passive initiation via remote call.
[0338] In practical applications, when the control center of the initiating device receives the connection result (success or failure), it can obtain the connection information based on the time-related parameters in the corresponding OperationParam, calculate the time consumption for each time period based on the connection information, and finally remove the corresponding OperationParam from the cache.
[0339] However, in some scenarios, the control center of the operating device may not receive the connection result after an abnormal situation occurs. For example, the connection conditions may not be met in the intermediate stage, the control center of the operating device may fail to call the local business application, or the connection between the control center of the calling device and the control center of the called device may fail via MagicLink. To obtain statistical information in these abnormal situations, this application embodiment sets up a fallback mechanism. That is, in the above embodiments, after the OperationParam (which records the time information of each stage) is put into the cache, a timer needs to be started. For example, steps A7, B5, C5, C19, and D5. The purpose of starting the timer is to ensure that after a certain period of time (e.g., 30 seconds), if the OperationParam still exists in the cache (it has not been removed, indicating that the connection result has not been received and the time of each stage has not been calculated), the time of each time period is calculated based on the time-related parameters in the OperationParam (regardless of whether the final execution result has been obtained). Of course, OperationParam may still be in the cache for a certain period of time, which may mean that the step of receiving the connection result has not yet been reached. You can continue to wait until 30 seconds later to confirm whether the connection result has been received (it is removed after the time of each stage is calculated).
[0340] Reference Figure 15 This is a flowchart illustrating the process of starting the timer in an embodiment of this application.
[0341] E1 checks if the timer is started.
[0342] E2 starts the timer if it is not started.
[0343] E3, after the timer has been started, periodically executes step E4 and subsequent steps.
[0344] E4, traverses the OperationParam of the cache of this electronic device (which can be referred to as the first storage space).
[0345] E5 checks if the data in OperationParam is empty.
[0346] E6 terminates the timer if the data in OperationParam is empty.
[0347] E7. If the data in OperationParam is not empty, calculate the difference between the current time and startconnect, and determine whether the difference is greater than 30s.
[0348] The difference between the current time and startconnect indicates the elapsed time since the connection was initiated. 30 seconds is an example.
[0349] If the difference is less than or equal to 30s, iterate through the next OperationParam, i.e., execute E3.
[0350] E8: If the difference is greater than 30 seconds, determine whether the initiation method is manual initiation by the user.
[0351] Remove the current OperationParam if it is not manually initiated by the user. This application embodiment focuses on describing the information statistics process under the user-initiated method. In practical applications, if it is necessary to collect information from other methods, this step can be omitted.
[0352] E9 sets the timeout when the initiation method is manual, which is the difference between the current time and startconnect. This parameter is used to calculate the time consumed in each stage.
[0353] E10, check if status is 1 (whether the ball has been successfully hung).
[0354] E11, with status 1, indicates successful point marking and calculates the time consumption of each segment (i.e., some statistics) when the connection call is successful.
[0355] E12, when status is 0, indicates that the point marking failed, and calculates the time consumption of each segment (i.e., some statistics) when the call connection failed.
[0356] E13, removes the OperationParam currently being traversed.
[0357] After removing the currently traversed OperationParam, continue traversing the next OperationParam, i.e., execute E4.
[0358] It is understood that in this embodiment of the application, the control center of each electronic device may contain one or more OperationParams, and a connection time of 30 seconds is given. If no connection result is received within 30 seconds, the statistical information is calculated and the device is removed, and the time consumption for each time period is calculated based on the times recorded in the OperationParam. In the statistical data obtained using the fallback mechanism, the connection result is considered a connection failure.
[0359] The following is through Figure 16 This is a flowchart illustrating the process of calculating the time consumption for each time period.
[0360] F1 checks if dispatchBegin is greater than 0.
[0361] F2, when dispatchBegin is greater than 0, calculates PreToBusiness = dispatchBegin - startConnect in master-slave mode. That is, the time spent in the control center from the initiation time to the initiation call.
[0362] In this application, a dispatchBegin greater than 0 indicates that dispatchBegin has a corresponding value. Based on the example above, it can be understood that the dispatchBegin parameter has a value in master-slave mode. In slave-slave mode, openSession is used.
[0363] F3 calculates ToBusiness = dispatchEnd - dispatchBegin in master-slave mode. This represents the time elapsed between the control center and the business application, from the control center initiating a call to receiving the response.
[0364] F4 sets ToBusinessEnd to dispatchEnd in master-slave mode.
[0365] F5, with dispatchBegin not greater than 0, calculates PreToBusiness = openSession - startConnect in slave mode. That is, the time spent in the control center from the initiation time to the start of the session.
[0366] In this embodiment of the application, dispatchBegin not greater than 0 indicates that dispatchBegin has no value, that is, it is not in master-slave mode.
[0367] F6 calculates the time taken from the control center initiating a session to receiving the call response transmitted through the session between the control center on the operation device side and the business application on the operation device side in the ToOtherDeviceBusiness=sendMsgCallBack-opensession mode.
[0368] Press F7 to set ToBusinessEnd = sendMsgCallBack in slave mode.
[0369] Press F8 to check if localBusinessReplied is greater than 0.
[0370] F9, when localBusinessReplied is greater than 0, calculates the case where the initiator in master-slave mode has the ability to initiate a connection call (case 1): ReceiveReply = localBsReplied - toBsEnd.
[0371] In this application, a value greater than 0 in `localBsReplied` indicates that `localBusinessReplied` has a corresponding value. Based on the example above, it can be understood that the `localBsReplied` parameter has a value when in master-slave mode and the calling application has the capability to initiate a connection. That is, it represents the time elapsed from when the operator's control center receives the call response to when it receives the connection result.
[0372] F10 checks if remoteBusinessReplied is greater than 0 if localBusinessReplied is not greater than 0.
[0373] In this application, a value not greater than 0 in localBusinessReplied indicates that dispatchBegin has no value. remoteBusinessReplied is the parameter value obtained by the control center of device A after receiving the execution result in cases two through four.
[0374] A value greater than 0 in remoteBusinessReplied indicates that remoteBusinessReplied has a value; a value not greater than 0 indicates that remoteBusinessReplied has no value.
[0375] F11, when remoteBusinessReplied is greater than 0, calculate ReceiveReplyFromOtherDevice = remoteBusinessReplied - toBsEnd in any of cases two to four, that is, the time taken for the operator's control center from receiving the call response to receiving the connection result.
[0376] F12 checks if the timeout period is greater than 0 if remoteBusinessReplied is not greater than 0 (the control center of the operating device has not received a connection result).
[0377] F13, if the timeout is greater than 0, calculate ToMeout = timeout - ToBusinessEnd.
[0378] In this embodiment, the timeout period is the time set in the fallback mechanism. If the timeout period is greater than 0, it means that the current OperationParam goes through the fallback mechanism process, and after subtracting ToBusinessEnd from the timeout period, the actual time consumed by the step that caused the timeout is obtained.
[0379] If the timeout period is not greater than 0 (theoretically, the fallback mechanism process has not been executed), execute F14.
[0380] In practical applications, the timeout period may not be greater than 0. Since this embodiment is a fallback mechanism, this branch is set up to ensure that statistical information can be obtained in order to avoid some errors or other unexpected events during program execution.
[0381] F14 checks if modifyBsBall is greater than 0.
[0382] In this application, `modifyBsBall` is a parameter obtained after monitoring changes in the profile. If it is greater than 0, it indicates that the process has reached the point where the ball is suspended.
[0383] F15, if modifyBsBall is greater than 0, calculate modifyBs = modifyBsBallt - ToBusinessEnd.
[0384] The duration from receiving a call response from the control center of the operating equipment to the final stage of the ball being suspended.
[0385] If modifyBsBall is not greater than 0, it means that no ball is currently detected to be hanging, and this part of the time parameter is not involved.
[0386] Of course, in the above embodiments, more or fewer time reference nodes can be set to calculate the time consumption of other different stages.
[0387] After the above process, the following information can be obtained: business ID (OperationParam), error code, error subcode, business subcode, scheduling mode, total time, segmented time, connection mode, connection entry point, initiating software version information, and receiving software version information.
[0388] The service ID represents the process of cross-device service calls for each user in the manual connection mode.
[0389] Error codes are used to distinguish whether a cross-device service call succeeds or fails. For example, an error code of 1 indicates a successful cross-device service call, while an error code other than 1 indicates a failed cross-device service call. When the error code is not 1, different characters can be used to indicate failures caused by different stages. For example, error code -216 indicates a failure caused by the service side, error code -214 indicates a failure caused by the remote control center in slave mode, and error code -102 indicates a failure caused by MagicLink communication. Other characters (e.g., -301) indicate failures caused by the local control center.
[0390] In practical applications, -216 can be attributed to failures caused by business-side reasons, while -214, -102, and -301 can be attributed to failures caused by the control center side.
[0391] Error subcodes are used to represent more granular error scenarios corresponding to the control center and / or error scenarios corresponding to the business side.
[0392] Business subcodes represent more granular error scenarios on the business side.
[0393] In this application, since the error codes returned by the service side that can be recognized by the service side may conflict with the error codes generated by the control center, in practical applications, when the control center receives the error codes issued by the service side, it re-encodes the error codes issued by the service side into error codes of the control center side to avoid conflicts between the error codes of the control center side and the error codes of the service side.
[0394] As another implementation method, the above three-level error code approach is adopted: error code, error subcode, and business error subcode.
[0395] The system combines error codes and error subcodes to represent error codes and more granular error scenarios caused by the control center; and combines error subcodes and business error subcodes to represent error codes and more granular error scenarios caused by the business side. This not only provides a detailed representation of the type and scenario of each error but also avoids errors between the business side and the control center.
[0396] The scheduling mode uses 0 to represent master-slave mode and 1 to represent slave-slave mode.
[0397] After obtaining some statistical information corresponding to multiple OperationParams (referred to as the first statistical information, including connection results and stage consumption time), other information can be collected, referred to as the second statistical information.
[0398] Based on the number of dots (OperationParam count) and error code information, the following statistics can be obtained:
[0399] Success rate = Number of successful attempts with error code 1 / Total number of successful attempts. In other words, it's the percentage of successful attempts out of the total number of successful attempts.
[0400] Control center scheduling success rate = (number of points with error code 1 + number of service failures) / total number of points. That is, the percentage of successful points to service failures out of the total number of points.
[0401] Business execution success rate = Number of points with error code 1 / (Total number of points - Number of control center scheduling failures). That is, the percentage of successful points out of the difference between the total number of points and the number of points that failed in the control center.
[0402] To allow developers to view these statistics intuitively, they can use... Figure 17 The above statistical information is displayed in the form shown in the interface.
[0403] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0404] This application also provides a computer-readable storage medium storing a computer program that, when run on an electronic device, can implement the steps in the above-described method embodiments.
[0405] This application also provides a computer program product that, when run on an electronic device or a wireless router, enables the electronic device to perform the steps described in the various method embodiments above.
[0406] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0407] This application also provides a chip, which includes a processor coupled to a memory. The processor calls a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip can be a single chip or a chip module composed of multiple chips.
[0408] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0409] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0410] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An information statistics method, characterized in that, include: The first device receives a first operation, which is used to trigger the calling device to call the first service on the called device. In response to the first operation, the first device triggers the establishment of a first call connection between the first service on the calling device and the first service on the called device; The first device records the first connection information during the process of establishing the first call connection; The first device obtains first statistical information of the first call connection based on the first connection information. The first statistical information includes: the first call result and the time consumed at each stage in the process of establishing the first call connection.
2. The method as described in claim 1, characterized in that, The calling device is a first device, and the called device is a second device; the first device includes a first control center and a first application, the first application providing the first service; the second device includes a second control center and a second application, the second application providing the first service. The first device records the first connection information during the process of establishing the first call connection, including: The first control center generates a first invocation instruction, which includes an operating device, an invocation device, and a device being invoked; The first control center sends the first invocation command to the first application; If the first application has the ability to initiate a call connection, it initiates the first call connection to the second application based on the first call instruction. The first call connection is used to establish a call connection between the first application and the second application and obtain a first connection result, which includes connection success or connection failure. The first application sends the first connection result to the first control center; The first control center records the time when it receives the first connection result as the connection response time, and the first connection information includes the connection response time.
3. The method as described in claim 2, characterized in that, After the first control center sends the first invocation instruction to the first application, it also includes: If the first application does not have the ability to initiate a call connection, it sends a first message to the first control center, the first message indicating that the first application does not have the ability to initiate a call connection. After receiving the first information, the first control center sends the first call instruction to the second control center. The first call instruction is used to trigger the second control center to control the second application to initiate the first call connection to the first application. The first call instruction is also used to transmit the first connection result from the second application to the first control center through the second control center. The first control center shall record the time when it receives the first connection result as the connection response time.
4. The method as described in claim 2 or 3, characterized in that, Before the first control center sends the first invocation instruction to the first application, the method further includes: The first control center generates a first call item, which is used to record the first connection information; The first control center will record the time when it receives the user's operation as the initiation time in the first calling project; After the first control center sends the first invocation instruction to the first application, the method further includes: The time when the first control center sends the first call instruction to the first application is recorded as the call start time in the first call item; The first control center receives the first response returned by the first application after receiving the first call instruction, and records the time of receiving the first response in the first call item as the call response time.
5. The method as described in claim 4, characterized in that, The first device obtains first statistical information about the first call connection based on the first connection information, including: The first control center calculates the time consumed in each stage based on the initiation time, the call start time, the call response time, and the connection response time.
6. The method as described in claim 4 or 5, characterized in that, The first device further includes: a first state synchronization module; the second device further includes: a second state synchronization module. If the first application has the capability to initiate a call connection, after the first application initiates the first call connection to the second application based on the first call instruction, the method further includes: The first application sends the first connection result to the first state synchronization module, and the first connection result is used to trigger a change in the connection state within the first state synchronization module. After the first control center detects a change in the connection status in the first status synchronization module, it updates the status indicator in the currently displayed interface of the first device and records the time when the connection status in the first status synchronization module changes as the interface change time in the first call project. If the first application does not have the ability to initiate a connection call, the method further includes: After the first control center detects a change in the connection status in the second status synchronization module, it updates the status indicator in the currently displayed interface of the first device and records the time when the connection status in the second status synchronization module changes as the interface change time in the first call item. The status in the second status synchronization module is determined by the first connection result sent by the second application. The first connection result is obtained after the second application initiates the first call connection to the first application.
7. The method as described in claim 6, characterized in that, The first device obtains first statistical information about the first call connection based on the first connection information, including: The first control center calculates the time consumption of each stage based on the initiation time, the call start time, the call response time, the connection response time, and the interface change time.
8. The method according to any one of claims 4 to 7, characterized in that, Before the first control center sends the first invocation instruction to the first application, the method further includes: The first control center determines whether the first device and the second device meet the connection conditions; When the first device and the second device meet the connection conditions, the first control center creates the first scheduling instruction and records the time of creating the first scheduling instruction in the first call item as the instruction creation time. The first control center uses the instruction creation time as an index for the first calling item, stores it in the first storage space of the first device, and starts a timer; After starting the timer, the first control center traverses the call items in the first storage space at a preset time period to obtain the first statistical information of the call items.
9. The method as described in claim 8, characterized in that, The process by which the first control center traverses the call items in the first storage space includes: If the difference between the current time and the initiation time in the called item is less than or equal to a first value, the first control center traverses the next called item in the first storage space at a preset time period. If the difference between the current time and the initiation time in the called project is greater than the first value, the first control center sets a timeout period, which is the difference between the current time and the initiation time in the called project. After setting the timeout period, the first control center obtains the first statistical information of the first call connection based on the first connection information within the call project; After obtaining the first statistical information, remove the currently traversed call item.
10. The method as described in claim 9, characterized in that, The step of obtaining the first statistical information of the first call connection based on the first connection information within the call item includes: If there is no connection response time in the first connection information, the timeout time is obtained by subtracting the call response time from the timeout time.
11. The method according to any one of claims 8 to 10, characterized in that, The method further includes: When the first control center receives first connection failure information transmitted from the first service, it generates a first type of error code based on the first connection failure information. The first type of error code is used to indicate that the connection failure is caused by the first service. The first control center generates a second type of error code based on the second connection failure information received by the first control center. The second type of error code is used to indicate that the connection failure is caused by the control center. The second type of error code includes: a first sub-code and a second sub-code. The first sub-code indicates that the calling device and the called device do not meet the connection conditions. The second sub-code indicates that the information transmission path between the control center of the calling device and the control center of the called device has failed. In the case where the connection failure reason of the called item is determined to be the second type of error code, the connection failure reason of the called item is no longer determined to be the first type of error code. Upon receiving a successful first connection result, the first control center generates a third type of error code, which is used to indicate a successful connection.
12. The method as described in claim 11, characterized in that, The method further includes: The first control center calculates second statistical information based on the first statistical information of multiple call items. The second statistical information includes: call success rate, control center call success rate, and business execution success rate. The call success rate is the percentage of the number of call items with the third type of error code out of the total number of call items; The success rate of the control center call is the percentage of the sum of the number of call items for the third type of error code and the number of call items for the first type of error code to the total number of the first statistical information. The success rate of the business execution is the percentage of the number of calls with the third type of error code relative to the difference between the total number of calls and the number of calls with the second type of error code.
13. The method according to any one of claims 1 to 12, characterized in that, The calling device is a second device, and the called device is a third device; the first device includes a first control center and a first application, the first application providing a first service; the second device includes a second control center and a second application, the second application providing the first service; the third device includes a third control center and a third application, the third application providing the first service. The first device records the first connection information during the process of establishing the first call connection, including: The first control center generates a first invocation instruction, which includes an operating device, an invocation device, and a device being invoked; The first control center sends the first call instruction to the second control center. The first call instruction is used to establish a first call connection between the second application and the third application and obtain a first connection result. The first connection result includes connection success or connection failure. After receiving the first connection result, the first control center records the connection response time, and the first connection information includes the connection response time.
14. The method as described in claim 13, characterized in that, When the second application has the ability to initiate a call connection, the first call instruction is transmitted from the second control center to the second application, triggering the second application to initiate the first call connection to the third application. The first connection result is transmitted from the second application to the first control center via the second control center. If the second application does not have the ability to initiate a call connection, after the first call instruction is transmitted from the second control center to the second application, it triggers the second application to send second information to the second control center. The second information is used to indicate that the second application does not have the ability to initiate a call connection, and the second information is used to instruct the second control center to send a first scheduling instruction to the third control center. After the first scheduling instruction is transmitted from the third control center to the third application, it triggers the third application to initiate the first call connection to the second application, and the result of the first connection is transmitted from the third application through the third control center to the first control center.
15. The method as described in claim 13 or 14, characterized in that, Before the first control center sends the first invocation instruction to the second control center, the method further includes: The first control center generates a first call item, which is used to record the first connection information; The first control center will record the time when it receives the user's operation as the initiation time in the first calling project; The first control center creates a communication session between the first control center and the second control center, and records the creation time of the communication session as the call start time in the first call project. The communication session is used to transmit information between the first control center and the second control center. After the first control center sends the first invocation instruction to the second control center, the method further includes: The first control center receives the first response returned by the second control center after receiving the first call instruction, and records the time of receiving the first response in the first call item as the call response time.
16. The method as described in claim 15, characterized in that, The first device further includes: a first state synchronization module; the second device further includes: a second state synchronization module; and the third device further includes: a third state synchronization module. When the second application has the ability to initiate a connection call, the connection status in the second state synchronization module changes, and is determined by the second application based on the first connection result; After the first control center detects a change in the connection status in the second status synchronization module, it updates the status indicator in the currently displayed interface of the first device and records the time when the connection status in the second status synchronization module changes as the interface change time in the first call project. If the second application does not have the ability to initiate a connection call, the connection status in the third state synchronization module changes and is determined by the third application based on the first connection result.
17. The method as described in claim 15 or 16, characterized in that, Before the first control center creates a communication session between the first control center and the second control center, the method further includes: The first control center creates the first scheduling instruction and records the time of creation of the first scheduling instruction in the first calling project as the instruction creation time. The first control center uses the instruction creation time as an index for the first calling item, stores it in the first storage space of the first device, and starts a timer; After starting the timer, the first control center traverses the call items in the first storage space at a preset time period to obtain the first statistical information of the call items.
18. An electronic device, characterized in that, The device includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program that, when executed by the one or more processors, causes the electronic device to perform the method as described in any one of claims 1-17.
19. A chip system applied to an electronic device, the chip system comprising one or more processors, characterized in that, The processor is configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-17.
20. A computer-readable storage medium comprising a computer program, characterized in that, When the computer program is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-17.
21. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-17.
