Data processing method and electronic device

By reading and transmitting the point-by-point data in electronic devices in a hierarchical manner, and prioritizing the processing of data with high priority, the problem of high point-by-point data loss rate in the prior art is solved, and a higher data transmission success rate and effectiveness are achieved.

CN117724860BActive Publication Date: 2025-04-29HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310783103.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-04-29
Estimated Expiration
2043-06-28

Smart Images

  • Figure CN117724860B_ABST
    Figure CN117724860B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method and an electronic device, which relates to the field of data processing technology, including: an electronic device obtains dotting data corresponding to a preset dotting event, wherein a priority is marked in the dotting data, and the priority is related to the dotting event. The electronic device stores the dotting data in a preset storage space according to the priority of the dotting data; when the electronic device meets the conditions for starting to report the dotting data, the electronic device reads the dotting data into a reporting cache according to the priority of the dotting data. The electronic device sends the dotting data in the reporting cache to other devices. In the present application, the electronic device transmits the dotting data according to the priority of the dotting data, so as to achieve the effect of preferentially reading the dotting data with high priority into the reporting cache and preferentially reporting it, thereby improving the storage and reporting success rate of the dotting data with high priority, and avoiding the loss of point data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of big data processing technology, and in particular to a data processing method and an electronic device. Background Art

[0002] In order to better count the performance stability and user behavior data of terminal products, improve the fault detection and positioning capabilities and maintainability of terminal products, and facilitate product R&D and testing personnel to track problems and evaluate version quality, terminal products need to have the ability to report big data.

[0003] There are many ways to report big data points for terminal products. For example, terminal products can save points through a software development kit (SDK), and report the saved points data to the upper-level device to implement big data point reporting operations.

[0004] However, the existing big data point reporting method has a high point loss rate. The loss of key points will make the point data incomplete, reducing the effectiveness of the point data provided to the terminal products of the upper-level equipment. Summary of the invention

[0005] The embodiments of the present application provide a data processing method and an electronic device. By performing hierarchical reading and hierarchical transmission on the dot data, the dot data with higher priority corresponding to key points can be sent to other devices in priority, thereby improving the transmission success rate of the dot data at the key points, avoiding the loss of the dot data at the key points, and improving the effectiveness of the transmitted dot data.

[0006] In order to achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions.

[0007] In a first aspect, a data processing method is provided, the method comprising:

[0008] The electronic device obtains dot data corresponding to a preset dot event, wherein the dot data is marked with a priority, and the priority is related to the dot event.

[0009] The electronic device stores the dot data in a preset storage space according to the priority of the dot data; when the electronic device meets the conditions for starting to send the dot data, the electronic device reads the dot data in the preset storage space into the reporting cache according to the priority of the dot data; the electronic device sends the dot data in the reporting cache to other devices.

[0010] In the present application, an electronic device may be a device that has the ability to communicate directly with an upper layer device, for example, an electronic device may be a mobile phone, a tablet computer, a computer device, etc.; an electronic device may also be a device that needs to communicate with an upper layer device through an intermediate device, for example, an electronic device may be a Bluetooth device, a wearable device, etc., and an intermediate device may be a mobile phone, a tablet computer, a computer device, etc. Other devices may include intermediate devices, and may also include upper layer devices such as servers and web terminals.

[0011] In the present application, the priority of device behavior can be divided into a first priority corresponding to a high priority and a second priority corresponding to a low priority; when generating dot data, the electronic device can add a field for representing the priority to represent the priority of the device behavior corresponding to the dot data, so as to process the dot data based on the priority.

[0012] In the present application, the electronic device reads and sends the dotting data according to the priority of the dotting data, so that the dotting data with high priority is read first into the reporting cache and data transmission is processed first, so as to improve the storage and transmission success rate of the dotting data with high priority and avoid the loss of the point data with high priority. In addition, reading the dotting data into the reporting cache for transmission can reduce the number of times the device file is read during the transmission of the dotting data, reduce the power consumption of the device file input / output (I / O), and optimize the performance of the processor when the electronic device processes the dotting data.

[0013] In a possible implementation manner of the first aspect, the method further includes:

[0014] When the electronic device detects a preset dotting event, it generates dotting data corresponding to the preset dotting event according to a preset data format; the electronic device stores the dotting data in a preset message queue; the preset message queue is a data structure of a linked list. The electronic device obtains the dotting data corresponding to the preset dotting event from the message queue.

[0015] In another possible implementation manner of the first aspect, the preset message queue adopts a CAS lock-free mechanism.

[0016] In this application, the electronic device stores the dotting data in the message queue, and writes the dotting data into the message queue first. When the system task scheduling comes, the saved dotting data can be uniformly managed from the message queue, which solves the data storage conflict problem that may be caused by the simultaneous dotting of multiple threads of the device application and reduces the point loss rate. In addition, the message queue adopts the CAS mechanism, which can realize the processing of high-performance message queues and solve the problem of performance loss caused by the use of locks under multi-threaded conditions. Moreover, the message queue uses a linked list data structure and can dynamically allocate memory according to the dotting needs of the device application. Compared with directly writing the dotting data into the file, it can avoid the problem of thread suspension / thread locking caused by the concurrency of multiple threads when reading and writing files, and it can also reduce the number of times the file is read and written, reduce the pressure of reading and writing files, and reduce the reading and writing power consumption of Bluetooth devices.

[0017] In another possible implementation manner of the first aspect, the method further includes:

[0018] The electronic device temporarily stores the dot data in the annular memory cache; when the amount of dot data in the annular memory cache is greater than or equal to a first threshold, the electronic device stores the dot data in the annular memory cache to a preset storage space according to the priority of the dot data in the annular memory cache.

[0019] The first threshold is determined according to the size of the ring memory cache.

[0020] In the present application, the electronic device temporarily stores the dot data in the message queue in the ring memory cache RingBuffer. The read priority of the ring memory cache RingBuffer is higher than the read priority of the storage space (device file). When there is dot data in the RingBuffer, the data in the RingBuffer can be read first, further reducing the read operation of the device file and optimizing the read operation performance of the device file.

[0021] In another possible implementation of the first aspect, the condition for starting to send the dot data includes the arrival of a trigger period of a first timer; or, the amount of dot data in a preset storage space and a ring memory cache is greater than or equal to a second threshold.

[0022] The second threshold is greater than the first threshold.

[0023] In the present application, when the trigger cycle of the first timer arrives, the electronic device starts to send the dotting data; or, when the number of dotting data in the preset storage space and the ring memory cache is greater than or equal to the second threshold, the electronic device starts to send the dotting data. In this way, when the dotting data is frequently generated, the electronic device can send the dotting data in time; when the dotting data is not frequently generated, the dotting data is sent according to the trigger cycle of the first timer, which can effectively optimize the performance of the electronic device in transmitting the dotting data.

[0024] In another possible implementation manner of the first aspect, the preset storage space includes a first storage space and a second storage space, the priority includes a first priority and a second priority, the first priority corresponds to the first storage space, and the second priority corresponds to the second storage space, and the electronic device stores the dotting data in the ring memory cache to the preset storage space according to the priority of the dotting data in the ring memory cache, including:

[0025] The electronic device stores the dot data corresponding to the first priority level in the first storage space and stores the dot data corresponding to the second priority level in the second storage space according to the priority level of the dot data in the ring memory buffer.

[0026] In this embodiment, hierarchical storage of high-priority dot data and low-priority dot data can be achieved according to the priority of the dot data and the priority of the storage space, which can improve the efficiency of subsequent hierarchical reading and hierarchical transmission.

[0027] In another possible implementation manner of the first aspect, the first priority is higher than the second priority, and the priority of the ring memory cache is higher than the priority of the first storage space; the electronic device reads the dot data in the preset storage space into the reporting cache according to the priority of the dot data, including:

[0028] The electronic device reads the dot data from the annular memory cache, the first storage space and the second storage space into the reporting cache in the order of priority from high to low.

[0029] The first storage space and the second storage space may both be files. The first storage space is a key point file; the second storage space is a common point file.

[0030] In the present application, the reading priority of RingBuffer is higher than the reading priority of the first storage space. That is, when the electronic device reads the dotting data to be sent from RingBuffer and the storage space (first storage space, second storage space), the dotting data to be sent in RingBuffer is read first, followed by the dotting data to be sent in the first storage space, and finally the dotting data to be sent in the second storage space. In this way, the priority reading of important dotting data and the priority data transmission processing are achieved, the success rate of sending high-priority dotting data is guaranteed, and the loss of dotting data is reduced.

[0031] In another possible implementation manner of the first aspect, the electronic device reads the dot data from the ring memory cache, the first storage space, and the second storage space to the reporting cache in order of priority from high to low, including:

[0032] When the amount of dot data in the storage space and the annular memory cache is greater than a third threshold, the electronic device reads the dot data from the annular memory cache, the first storage space, and the second storage space to the reporting cache in descending order of priority.

[0033] The third threshold is used to represent the lower limit of the amount of sent dotting data.

[0034] In the present application, when the electronic device reads the dot data to be sent that is greater than or equal to the third threshold from the RingBuffer and the storage space (the first storage space and the second storage space), the dot data is read in batches, which can reduce the number of accesses to the storage space, reduce the power consumption of the device file input / output (Input / Output, I / O), and reduce the processor occupancy of the Bluetooth device.

[0035] In another possible implementation manner of the first aspect, when the electronic device meets the condition for starting to send the dot data, the method further includes:

[0036] The electronic device obtains the link status; the link status is used to indicate whether the link is available or unavailable; when the electronic device determines that the link is available according to the link status, the dot data in the storage space is read into the reporting cache according to the priority of the dot data.

[0037] In this application, when the electronic device is sending the dot data, it needs to determine whether there is an available link at present. If it is determined that there is an available link, the dot data reading and sending process is executed; if there is no available link, the dot data cannot be sent. In this case, the electronic device can wait for the next time when the conditions for starting to send the dot data are met, and then read and send the dot data. In this way, the resources of the electronic device for processing the dot data can be released in time, and the processing performance of the electronic device can be optimized.

[0038] In another possible implementation manner of the first aspect, the method further includes:

[0039] The electronic device obtains a link status; the link status is used to indicate that the link is available or unavailable;

[0040] If the link status indicates that the link is available, the electronic device obtains the service status of the available link; the service status includes a busy state or an idle state; the electronic device determines the reporting period of the dot data in the reporting cache according to the service status of the available link; when the reporting period arrives, the electronic device sends the dot data in the reporting cache to other devices.

[0041] In another possible implementation of the first aspect, if the service state of the available link is an idle state, the reporting period is a first period; if the service state of the available link is a busy state, the reporting period is a second period; and the first period is smaller than the second period.

[0042] In this application, the electronic device can dynamically adjust the reporting period according to whether its service status is busy or idle. For example, when the service is busy, the reporting period is longer; when the service is idle, the reporting period is shorter. Exemplarily, when the service status is idle, the reporting period can be 50ms; when the service status is busy, in order not to affect the service execution of the Bluetooth device, the reporting period can be 2000ms.

[0043] In the present application, the electronic device identifies the business status of the available link and adjusts the reporting cycle according to whether the available link is in a busy state or an idle state. In particular, when the electronic device is in the process of business, that is, when the available link is in a busy state, it can ensure that when the electronic device is in the process of business, the point data can still be uploaded normally without affecting the normal operation of the Bluetooth device's business, and at the same time, the point loss rate is also reduced.

[0044] In another possible implementation manner of the first aspect, the electronic device sends the dot data in the reporting buffer to another device, including:

[0045] When the first cycle or the second cycle of the electronic device arrives, the electronic device sends the dot data in the reporting buffer to other devices through an available link.

[0046] In the present application, the electronic device identifies the business status of the available link and adjusts the reporting cycle according to whether the available link is in a busy state or an idle state. In particular, when the electronic device is in the process of business, that is, when the available link is in a busy state, it can ensure that when the electronic device is in the process of business, the point data can still be uploaded normally without affecting the normal operation of the Bluetooth device's business, and at the same time, the point loss rate is also reduced.

[0047] In another possible implementation manner of the first aspect, the method further includes:

[0048] The electronic device obtains the number of dotting data that have been sent to other devices; if the number of dotting data that have been sent is greater than a fourth threshold, the operation of sending the dotting data is stopped, and when the electronic device meets the conditions for starting to send the dotting data again, the electronic device reads the dotting data in the storage space into the reporting cache according to the priority of the dotting data.

[0049] The fourth threshold is used to represent the upper limit of the amount of dot data sent.

[0050] In the present application, if the number of dot data sent by the electronic device is greater than or equal to the fourth threshold, it means that the electronic device has sent a large amount of dot data in the current dot data sending process. In order not to affect other services of the electronic device, the electronic device can temporarily stop sending the dot data and wait for the next time when the conditions for starting to send the dot data are met to send new dot data.

[0051] In another possible implementation manner of the first aspect, the data transmission channel is marked in the dot data; and the electronic device sends the dot data in the reporting buffer to other devices, including:

[0052] The electronic device transmits the dot data in the reporting cache to the target application based on the data transmission channel corresponding to the dot data, so that the target application sends the dot data in the reporting cache to the other device; the target application includes an application in the electronic device for transmitting dot data.

[0053] The data transmission channel includes a first channel adapted to the electronic device system and a second channel provided by a third-party application in the electronic device.

[0054] In this application, taking into account the diversity of electronic equipment products, the dot data is transmitted through the target application based on the data transmission channel corresponding to the dot data, which can make the processing of the dot data more effective and efficient.

[0055] In another possible implementation manner of the first aspect, the method further includes:

[0056] The electronic device receives parameter configuration information and updates the parameter configuration based on the parameter configuration information; the parameter configuration information includes at least one of the storage space of the ring memory cache, the trigger period of the first timer, the first threshold, the second threshold, the third threshold, the fourth threshold, the first period and the second period.

[0057] In the present application, the electronic device can perform parameter configuration on the setting values ​​of each parameter based on the received parameter configuration information. Exemplarily, the parameter configuration information includes the storage space size of RingBuffer, for example, the setting value of RingBuffer can be 2K; the trigger period of the first timer, for example, the setting value of the trigger period of the first timer can be 60s; the value of the third threshold, for example, the setting value of the third threshold can be 4; the value of the fourth threshold, for example, the setting value of the fourth threshold can be 512; the reporting period of the idle state and the reporting period of the busy state, for example, the reporting period in the idle state can be set to 50ms, and the reporting period in the busy state can be set to 2000ms.

[0058] In the present application, the configuration values ​​of various parameters can be personalized based on different electronic devices, so that the collection, storage and sending processes of dot data are more suitable for the performance of the electronic device itself, further reducing the dot loss rate, improving the effectiveness of the dot data, improving the sending speed and efficiency of the dot data, reducing the power consumption of electronic devices for dot data transmission, and optimizing the performance of electronic devices for dot data transmission.

[0059] In another possible implementation manner of the first aspect, the electronic device sends the dot data in the reporting buffer to another device, including:

[0060] The electronic device performs data post-processing on the dot data and sends the post-processed dot data to other devices; the data post-processing includes data encoding conversion, data serialization processing, and data encapsulation processing.

[0061] In the present application, the electronic device can perform data post-processing on the dot data to be sent according to the communication protocol with the upper-layer device such as the server, so as to achieve successful transmission of the post-processed dot data.

[0062] In a second aspect, an electronic device is provided, which includes a memory, a communication module and one or more processors; the memory and the communication module are coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a method as described in any one of the above-mentioned first aspects.

[0063] According to a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on an electronic device, the electronic device can execute any one of the methods according to the first aspect.

[0064] According to a fourth aspect, a computer program product comprising instructions is provided, which, when executed on an electronic device, enables the electronic device to execute any one of the methods according to the first aspect.

[0065] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the method of the first aspect.

[0066] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second aspect, the computer-readable storage medium described in the third aspect, the computer program product described in the fourth aspect, and the chip described in the fifth aspect provided above can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of a scenario of Bluetooth device-mobile phone-server-web terminal interaction provided in an embodiment of the present application;

[0068] Figure 2 A schematic diagram of an interface for displaying data analysis results of a web-based big data dashboard provided in an embodiment of the present application;

[0069] Figure 3 A schematic diagram of a mobile phone-server-web-side interaction scenario provided in an embodiment of the present application;

[0070] Figure 4 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application;

[0071] Figure 5 A schematic diagram of the structure of an electronic device 300 provided in an embodiment of the present application;

[0072] Figure 6 A schematic diagram of a system architecture of an electronic device provided in an embodiment of the present application;

[0073] Figure 7 A schematic diagram of the module interaction of a Bluetooth device, a mobile phone, a server, and a web terminal in a data processing method provided in an embodiment of the present application;

[0074] Figure 8 A flowchart of a data processing method provided in an embodiment of the present application;

[0075] Fig. 9A flowchart of another data processing method provided in an embodiment of the present application;

[0076] Fig.10 A flowchart of another data processing method provided in an embodiment of the present application;

[0077] Fig.11 A schematic diagram of the interaction between the modules of a mobile phone, a server and a web terminal in a data processing method provided in an embodiment of the present application;

[0078] Fig.12 A schematic diagram of the structure of an electronic device 1000 provided in an embodiment of the present application;

[0079] Fig.13 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.

[0081] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0082] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0083] In order to better count the performance stability and user behavior data of terminal products, improve the fault detection and positioning capabilities and maintainability of terminal products, and facilitate product development and testing personnel to track problems and evaluate version quality, terminal products need to have the ability to transmit (report) big data. Among them, data point (also known as data embedding) refers to the collection of user behavior data for devices or applications. The collected data can be called point data (also known as embedding data). The server can obtain the point data of a certain device or application for analysis.

[0084] There are many ways for terminal products to report dotting data. For example, terminal products can collect, save and report dotting data through the built-in software development kit (SDK). For example, when a terminal product generates behavioral data, the SDK can perform data dotting and report the dotting data to the upper-layer device to implement the dotting data reporting operation. The SDK builds the feature of big data dotting reporting and provides an external interface for products to integrate and use as needed.

[0085] Some terminal products do not have the ability to communicate directly with upper-layer devices and need to report data through intermediate devices. For example, based on the interaction scenario of terminal-intermediate device-server-website (web) end, the process of data reporting between devices is explained. Figure 1 A schematic diagram of an interaction is given in which the terminal is a Bluetooth device and the intermediate device is a mobile phone. Figure 1As shown, the SDK is integrated in the Bluetooth device (exemplarily, the SDK is wearSDK), and the application side of the Bluetooth device can call the SDK interface to perform data dotting, and write the dotting data into a file for storage. When the operating system of the Bluetooth device schedules the execution of the dotting reporting thread, the SDK reads the stored dotting data from the file and reports the dotting data to the mobile phone (intermediate device) through the Bluetooth module. The mobile phone receives the dotting data through the Bluetooth module, processes the dotting data through the corresponding dotting application, and reports the dotting data to the server through the network. The server stores the dotting data in the database. The web end can read the dotting data about the Bluetooth device from the server database, and perform data statistics on the dotting data to obtain the dotting data analysis results about the Bluetooth device; optionally, the web end can also visualize the dotting data analysis results for product development and testing personnel to consult and use. For example, the dotting data analysis results of Bluetooth devices can be displayed in the big data dashboard.

[0086] For example, Figure 2 A schematic diagram of displaying the analysis results of the dot data on the display interface of the web terminal is given. Figure 2 The display interface can display the total test time, average test time standard, average test time, total test time standard and other test parameters of the device under test (Bluetooth device); the display interface can also display the test conclusions of the device under test (Bluetooth device), such as the probability of freezing / restarting problems, the probability of Bluetooth connection problems, the probability of user experience (UX) performance failure problems, the probability of machine box communication problems, the probability of silent / dual ear asynchrony problems, the probability of other error reports, etc. Among them, UX performance includes data security, data processing, strategy games, image processing and I / O performance.

[0087] In the existing method of reporting dotting data, when the terminal is collecting and reporting dotting data, the Bluetooth device reports the dotting data in real time. When the Bluetooth device is busy, the dotting data may be lost, resulting in a high data dotting loss rate. The loss of key points (such as equipment usage time statistics, communication failures, connection failures, etc.) will extend the iteration time, cover up the actual quality problems of the version, affect the product's over-delivery target, etc., and may also affect the product performance optimization in serious cases. Moreover, in the prior art, in the process of processing each dotting data, it is necessary to frequently read and write files (or flash), and wake up Bluetooth to report the dotting data, which makes the terminal power consumption higher when reporting the dotting data. In addition, the dotting data reporting process of the prior art cannot handle the problem of multi-threaded concurrent dotting when facing the simultaneous processing of multiple dotting data, and it is easy to cause thread suspension / thread lock problems, affecting the performance of the terminal processor.

[0088] The embodiment of the present application provides a data processing method, in which an electronic device obtains dotting data based on a preset dotting event, wherein the dotting data is marked with a priority. The electronic device classifies and stores the dotting data according to the priority of the dotting data, and stores the dotting data in a device file. When the electronic device meets the conditions for starting to report the dotting data, for example, when the first timer reaches the trigger cycle or the number of dotting data in the device file exceeds the first threshold, the electronic device reads multiple dotting data into the reporting cache based on the priority of the dotting data from high to low; when the reporting cycle of the electronic device arrives, for example, when the second timer reaches the trigger cycle, the electronic device reports the dotting data from the reporting cache to the upper-level device in sequence based on the priority of the dotting data from high to low. In this embodiment, the electronic device stores and reports the dotting data according to the priority of the dotting data, realizes the priority reading of the dotting data with high priority into the reporting cache and the priority data reporting processing, improves the storage and reporting success rate of the dotting data with high priority, and avoids the loss of the point data with high priority. In addition, reading the dot data to be reported into the reporting cache for sequential reporting can reduce the number of times the device file is read during the reporting of the dot data, reduce the power consumption of the device file input / output (I / O), and optimize the performance of the processor when the electronic device processes the dot data.

[0089] The applicable scenarios of the data processing method provided in this embodiment include the interaction scenarios between electronic devices (terminal products) and upper-layer devices. Exemplarily, the electronic device may be a device including a communication module, for example, the electronic device may be a Bluetooth device, a wearable device, a mobile phone, a tablet computer, a computer device, an augmented reality (AR) device, a virtual reality (VR) device, a car computer, etc. In this embodiment, the electronic device includes a first type of device that can directly communicate with the upper-layer device to report the dotting data, for example, the first type of device may include a mobile phone, a tablet computer, a computer device, etc.; the electronic device also includes a second type of device that needs to report the dotting data to the upper-layer device through an intermediate device, for example, the second type of device may include a Bluetooth device, a wearable device, a smart home appliance, and other devices. Among them, the upper-layer device includes a server, a web terminal, etc., and the server may be an independent server or a server cluster, etc. Optionally, the intermediate device may be a first type of device.

[0090] In some embodiments, the second type of device does not have remote communication capabilities and needs to transmit dot data to upper-layer devices such as servers through intermediate devices (near field devices). Exemplarily, the second type of device and the intermediate device usually use P2P (peer to peer) mode for point-to-point data transmission, and its communication methods include wireless fidelity (wireless fidelity, Wi-Fi) network, Bluetooth (blue tooth, BT), etc. The intermediate device and the first type of device have remote communication capabilities, and the intermediate device, the first type of device and upper-layer devices such as servers usually transmit data based on the server-client (Client-Server, C / S) architecture, and its communication methods include message queuing telemetry transport (message queuing telemetry transport, MQTT), global system for mobile communications (global system for mobile communications, GSM), etc.

[0091] like Figure 3 As shown, Figure 3 A schematic diagram of the interaction between the first-class device and the upper-layer device is given. The first-class device is a mobile phone; the upper-layer devices include a server and a web terminal.

[0092] Figure 3 In the example, the SDK is integrated into the mobile phone (exemplarily, the SDK is wearSDK), and the application side of the mobile phone can call the SDK interface to perform data dotting and write the dotting data into a file for storage. When the operating system of the mobile phone schedules the execution of the dotting reporting thread, the SDK reads the stored dotting data from the file, processes the dotting data through the dotting application, and reports the dotting data to the server through the network. The server stores the dotting data in the database. The web side can read the dotting data about the mobile phone from the server database, perform data statistics on the dotting data, obtain the analysis results of the dotting data about the mobile phone, and visualize the analysis results of the dotting data for reference and use by product development and testing personnel, etc.

[0093] Optionally, the data processing method provided in this embodiment may also be applicable to Figure 1 In the interactive scenario shown, the electronic device is a Bluetooth device (second-class device), the intermediate device is a mobile phone, and the upper-layer devices are a server and a web terminal.

[0094] refer to Figure 4 , Figure 4A schematic diagram of the structure of an electronic device that is a second type of device is given. The electronic device 100 includes a processor 110, an application module 120, an operating system module 130, a storage module 140, a communication module 150, an antenna 1, a universal serial bus (USB) interface 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a charging management module 180, a power management module 181, a battery 182, etc.

[0095] The structure shown in the embodiment of the present invention does not limit the electronic device 100. It may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0096] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0097] In this embodiment, the processor 110 may further include an SDK, and the SDK is used to collect and report the dot data of the electronic device.

[0098] The application module 120 is user-oriented and generates dot data about the behavior of the electronic device when the user uses the electronic device.

[0099] The operating system module 130 is used to schedule tasks in the electronic device. After the SDK obtains the scheduling of the operating system module 130, it executes the processing operation of the dot data.

[0100] The storage module 140 is used to store the dot data. Exemplarily, the storage module may include file storage, cache storage, queue storage and other methods.

[0101] The communication module 150 can provide one or more of a variety of communication methods such as Bluetooth, local area network (WLAN; for example, wireless fidelity (wireless fidelity, Wi-Fi) network), ZigBee technology, etc. Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands.

[0102] The charging management module 180 is used to receive charging input from a charger. The charging management module 180 can receive charging input from a wired charger through the USB interface 160. In some wireless charging embodiments, the charging management module 180 can receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 180 is charging the battery 182, it can also power the electronic device 100 through the power management module 181.

[0103] The power management module 181 is used to connect the battery 182, the charging management module 180 and the processor 110. The power management module 181 receives input from the battery 182 and / or the charging management module 180, and supplies power to the processor 110, the storage module 140 and the communication module 150. The power management module 181 can also be set in the processor 110. In some embodiments, the power management module 181 and the charging management module 180 can also be set in the same device.

[0104] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C and the application processor.

[0105] Optionally, refer to Figure 5 , which shows a structural block diagram of an electronic device provided by an embodiment of the present application as a first-category device. Among them, the electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a radio frequency module 350, a communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a display screen 394, etc.

[0106] The structure shown in the embodiment of the present invention does not constitute a limitation on the electronic device 300. It may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0107] The processor 310 may include one or more processing units. For example, the processor 310 may include A), a demodulation processor, a GPU, an ISP, a controller, a memory, a video codec, a DSP, a baseband processor, and / or an NPU, etc. Among them, different processing units may be independent devices or integrated into one or more processors.

[0108] In this embodiment, the processor 310 may further include an SDK, and the SDK is used to collect and report the dot data of the electronic device.

[0109] The controller can be a decision maker that directs the various components of the electronic device 300 to work in coordination according to the instructions. It is the nerve center and command center of the electronic device 300. The controller generates an operation control signal according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0110] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a high-speed cache memory, which can store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0111] In this embodiment, the processor 110 may further include an SDK, and the SDK is used to collect and report the dot data of the electronic device.

[0112] In some embodiments, the processor 310 may include an interface. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.

[0113] The interface connection relationship between the modules shown in the embodiment of the present invention is only for illustrative purposes and does not constitute a structural limitation on the electronic device 300. The electronic device 300 may adopt different interface connection methods in the embodiment of the present invention, or a combination of multiple interface connection methods.

[0114] The charging management module 340 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 340 may receive charging input from a wired charger through the USB interface 330. In some wireless charging embodiments, the charging management module 340 may receive wireless charging input through a wireless charging coil of the electronic device 300. While the charging management module 340 is charging the battery 342, it may also power the electronic device 300 through the power management module 341.

[0115] The power management module 341 is used to connect the battery 342, the charging management module 340 and the processor 310. The power management module 341 receives input from the battery 342 and / or the charging management module 340, and supplies power to the processor 310, the internal memory 321, the external memory interface 320, the display screen 394, the camera 393, and the communication module 360. The power management module 341 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some embodiments, the power management module 341 can also be set in the processor 310. In some embodiments, the power management module 341 and the charging management module 340 can also be set in the same device.

[0116] The wireless communication function of the electronic device 300 can be implemented through antenna 1, antenna 2, radio frequency module 350, communication module 360, modem and baseband processor.

[0117] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, a cellular network antenna can be reused as a wireless local area network diversity antenna. In some embodiments, the antenna can be used in combination with a tuning switch.

[0118] The RF module 350 can provide a communication processing module for wireless communication solutions including 2G / 3G / 4G / 5G, etc., applied to the electronic device 300. The RF module 350 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The RF module 350 receives electromagnetic waves from the antenna 1, and performs filtering, amplification, and other processing on the received electromagnetic waves, and transmits them to the modem for demodulation. The RF module 350 can also amplify the signal modulated by the modem, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the RF module 350 can be set in the processor 310. In some embodiments, at least some of the functional modules of the RF module 350 can be set in the same device as at least some of the modules of the processor 310.

[0119] The modem may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 370A, a receiver 370B, etc.), or displays an image or video through a display screen 394. In some embodiments, the modem may be an independent device. In some embodiments, the modem may be independent of the processor 310 and be arranged in the same device as the RF module 350 or other functional modules.

[0120] The communication module 360 ​​can provide a communication processing module for wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), ZigBee Technology, etc., which are applied to the electronic device 300. The communication module 360 ​​can be one or more devices integrating at least one communication processing module. The communication module 360 ​​receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and filters it, and sends the processed signal to the processor 310. The communication module 360 ​​can also receive the signal to be sent from the processor 310, modulate its frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0121] In some embodiments, the antenna 1 of the electronic device 300 is coupled to the radio frequency module 350, and the antenna 2 is coupled to the communication module 360, so that the electronic device 300 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include GSM, general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include satellite based augmentation systems (SBAS), global navigation satellite system (GLONASS), BeiDou navigation satellite system (BDS), Quasi-Zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0122] The electronic device 300 implements the display function through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.

[0123] The display screen 394 is used to display images, videos, etc. For example, the display screen 394 can display an incoming call reminder interface and a voice call interface. In the embodiment of the present application, if the electronic device 300 receives an in-application call request initiated by the opposite end in the first application, the display screen 394 of the electronic device 300 can display a voice call interface including the business information of the first application. The display screen 394 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 300 may include 1 or N display screens 394, where N is a positive integer greater than 1.

[0124] The electronic device 300 can realize the shooting function through ISP, camera 393, video codec, GPU, display screen and application processor.

[0125] The ISP is used to process the data fed back by the camera 393. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 393.

[0126] The camera 393 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 300 may include 1 or N cameras 393, where N is a positive integer greater than 1.

[0127] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 300 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0128] Video codecs are used to compress or decompress digital videos. The electronic device 300 may support one or more video codecs. Thus, the electronic device 300 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0129] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 300 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0130] The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 300. The external memory card communicates with the processor 310 through the external memory interface 320 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0131] The internal memory 321 can be used to store computer executable program codes, which include instructions. The processor 310 executes various functional applications and data processing of the electronic device 300 by running the instructions stored in the internal memory 321. The memory 321 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 300 (such as audio data, a phone book, etc.), etc. In addition, the memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.

[0132] The electronic device 300 can implement audio functions such as music playing and recording through the audio module 370, the speaker 370A, the receiver 370B, the microphone 370C, the headphone jack 370D, and the application processor.

[0133] The audio module 370 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 370 can also be used to encode and decode audio signals. In some embodiments, the audio module 370 can be arranged in the processor 310, or some functional modules of the audio module 370 can be arranged in the processor 310.

[0134] The speaker 370A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 300 can listen to music or listen to a hands-free call through the speaker 370A.

[0135] The receiver 370B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 300 receives a call or voice message, the voice can be received by placing the receiver 370B close to the human ear.

[0136] Microphone 370C, also called "microphone" or "microphone", is used to convert sound signals into audio electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to microphone 370C to input the sound signal into microphone 370C. The electronic device 300 can be provided with at least one microphone 370C. In some embodiments, the electronic device 300 can be provided with two microphones 370C, which can not only collect sound signals but also realize noise reduction function. In some embodiments, the electronic device 300 can also be provided with three, four or more microphones 370C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.

[0137] The earphone interface 370D is used to connect a wired earphone and can be a USB interface 330, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0138] The software system of the electronic device 300 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 300 is exemplified.

[0139] Figure 6 3 is a software structure diagram of the electronic device 300 of an embodiment of the present invention. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, The system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system library, and kernel layer.

[0140] The application layer can include a series of application packages.

[0141] like Figure 6 As shown, the application package may include target application, camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0142] The target application is a user-oriented application for generating dotting data. Optionally, the target application may also have the ability to process dotting data and report the dotting data to a server. The target application may be a system application of the electronic device or a third-party application in the electronic device. In this embodiment, the target application may be a dotting reporting application.

[0143] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0144] like Figure 6 As shown, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, and a notification manager.

[0145] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0146] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0147] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0148] In an embodiment of the present application, a data file describing the interface layout may be stored in a database. When constructing an interface, the view system may obtain the stored data file through a content provider and display the interface according to the obtained data file. In some embodiments, when constructing an interface, the data file stored in the content provider may also be modified.

[0149] The phone manager is used to provide communication functions of the electronic device 300. For example, the management of call status (including connecting, hanging up, etc.).

[0150] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0151] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0152] Android runtime includes core library and virtual machine. Android runtime is responsible for scheduling and management of Android system. Core library consists of two parts: one is the function that Java language needs to call, and the other is Android core library.

[0153] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0154] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as openGL ES), 2D graphics engine (such as SGL), etc.

[0155] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.

[0156] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0157] In some embodiments, the application Figure 1 In the interactive scenario of electronic device-intermediate device-server-web end shown in FIG. This embodiment takes the electronic device as the second type of device, such as a Bluetooth device, and the intermediate device as a mobile phone as an example. For example, reference can be made to Figure 7 The system architecture diagram of the data processing method shown.

[0158] like Figure 7 As shown, Figure 7 It includes Bluetooth devices, mobile phones, servers and web terminals. Among them, Bluetooth devices include device applications, SDKs, device operating systems, device files and device Bluetooth modules. SDKs include task scheduling modules, parameter configuration modules, link management modules, file management modules and data transmission modules. Mobile phones include mobile Bluetooth modules, target applications (system applications and third-party applications), point reporting applications and network modules. Servers include cloud (database). Web terminals include big data websites (big data dashboards).

[0159] Combination Figure 7The architecture shown in this embodiment describes the data processing method provided by the embodiment of the present application from the aspects of collection of Bluetooth device dot data, storage and processing of Bluetooth device dot data, reporting and processing of Bluetooth device dot data, and processing of dot data on mobile phones, servers, and web terminals.

[0160] Among them, the process of Bluetooth device collecting dot data ( Figure 7 For steps 1 to 5 in the Figure 8 . Figure 8 A more specific interaction diagram is given, including:

[0161] 1. When a user uses a Bluetooth device, the device application of the Bluetooth device will generate event records about the Bluetooth device.

[0162] In some embodiments, when a user uses an electronic device, an event related to the electronic device may be generated. The preset dot event may be determined based on the actual usage scenario and the event records that may be generated in different usage scenarios. The event record is used to represent the data records generated by each module and each service / application during the use of the electronic device. The event record may include data records of the working status of each module of the electronic device, data records of the running status of each service / application, etc.

[0163] For example, when a user is using an electronic device, the event records may include data records generated when the power module of the electronic device is powered on / started up, data records generated when the power module of the electronic device is powered off / shutdown, data records generated when the electronic device runs applications / services, data records generated when the communication module of the electronic device establishes a communication connection, data records generated when a module of the electronic device is abnormal or fails, etc. Some or all of the events are selected from the event records generated by the electronic device as preset marking events, and the preset marking events correspond to data that can be used to perform performance analysis on the electronic device.

[0164] Exemplarily, the preset dotting events may be the power on or off of the electronic device, the running of the application / service by the electronic device, the running status of each module of the electronic device, etc. The dotting events such as the running of the application / service by the electronic device may include event records such as the start time of the electronic device starting application 1, the duration of using application 1, the end time of closing application 1, etc. The dotting events such as the running status of each module of the electronic device may include event records such as, for example, the battery module may include the battery usage time of the electronic device, the remaining battery power of the electronic device, etc., and the communication module may include the start time of data transmission, the data transmission rate, the end time of data transmission, etc.

[0165] Taking the electronic device as a Bluetooth device as an example, the preset management events of the Bluetooth device may include powering on the Bluetooth device, establishing a communication connection between the communication module of the Bluetooth device and other devices, and performing services of the Bluetooth device.

[0166] For example, when the Bluetooth device is a Bluetooth headset, the preset dot events may include the user taking out the Bluetooth headset from the headset box (the Bluetooth headset is turned on), the Bluetooth headset is connected to the mobile phone via Bluetooth (the communication module of the Bluetooth headset is connected to the mobile phone via Bluetooth); or, after the Bluetooth headset is connected to the mobile phone via Bluetooth, music is played or a call is made through the Bluetooth headset (the Bluetooth headset performs a music playing service or a call service); or, the user charges the Bluetooth headset (the battery module of the Bluetooth headset is charged), etc. The preset dot events may include the behavior records and abnormal fault records generated by the Bluetooth device during operation, and the dot data corresponding to the dot events may be used to analyze the working performance of the Bluetooth device.

[0167] For example, the Bluetooth device can also be a smart home appliance in a smart home, such as an air conditioner. The preset dot events can include the user turning on the air conditioner power (air conditioner power on), setting the operating mode and temperature of the air conditioner (working conditions of air conditioner related modules), etc. The event records corresponding to the preset dot events of the air conditioner include data such as the air conditioner start time, operating time, operating mode, maximum temperature, minimum temperature, and air conditioner shutdown event.

[0168] 2. The device application of the Bluetooth device generates the dot data based on the event record of the preset dot event.

[0169] Optionally, the device application of the Bluetooth device can generate corresponding dotting data based on the event record of the preset dotting event based on the preset data format. The dotting data all have a unique event identity identification number (identity document, ID), and the dotting data all correspond to the external interface provided by the Bluetooth device SDK. The preset data format may include event ID, classification code, primary code, secondary code, tertiary code, etc. Among them, the classification code refers to the top-level business module, such as the power module, Bluetooth module, microcontroller unit (MCU) management module, etc.; the primary and secondary codes are subdivision modules of each business module, and the tertiary code is an extension field of the secondary coding module and can be used as needed.

[0170] Optionally, in the process of reporting dotting data, in order to improve the efficiency and success rate of data reporting, in this embodiment, the reporting priority of dotting data is agreed upon in the preset data format. The priority can be set by the device application when the Bluetooth device generates a preset dotting event, based on the dotting event, to set the priority of the dotting data corresponding to the preset dotting event. Alternatively, the device application can also obtain a preset corresponding relationship, and determine the priority of the dotting data corresponding to the preset dotting event based on the preset corresponding relationship. Among them, the preset corresponding relationship is the corresponding relationship between the classification code and the priority. For example, the preset corresponding relationship can include that the priority of the dotting event corresponding to the power module is high, the priority of the dotting event corresponding to the Bluetooth module is medium, and so on. After generating the preset dotting event, the device application determines the priority of the dotting data corresponding to the current dotting event according to the classification code corresponding to the dotting event and the preset corresponding relationship. That is, the priority of the dotting data can be set in real time by the device application, or it can be set by the device application based on the preset corresponding relationship.

[0171] In the process of reporting the dot data, the SDK will report the dot data in descending order of priority. Exemplarily, the preset data format can be expressed as: WearSdkBiRecordCode(unsigned charcatalogId, unsigned char info1, unsigned char info2, unsigned int info3, unsigned char priority); wherein, catalogId is the classification code, info1 is the primary code, info2 is the secondary code, info3 is the tertiary code, and priority is the priority. When the dot data needs to have other available information, the preset data format may also include other fields, which is not limited in this embodiment.

[0172] Exemplarily, taking the out-of-box usage time of Bluetooth headsets as an example, the corresponding classification code in the dot data is the power module, the first-level code is the out-of-box power, the second-level code is the out-of-box usage time, and the third-level code is the specific value of the usage time, with a high priority. The device application can pass the values ​​corresponding to these parameters to the SDK through the function WearSdkBiRecordCode(). The SDK can record the dot data of the Bluetooth headset about the out-of-box usage time after receiving the data. Optionally, the SDK can also add corresponding time information to the dot data, and save the dot data after adding the time information to the specified storage space. For example, the dot data after adding the time information is stored in the specified stack; or, saved to a file; or, saved to a cache, and so on.

[0173] In this embodiment, a priority parameter definition is added to the preset data format of the dot data. The priority can distinguish between key points (event records of concern) and ordinary points (ordinary event records). For key points and ordinary points, the priorities in their data formats are differentiated and processed. In the subsequent priority-based dot data reporting process, the storage and upload success rate of key points can be improved to avoid the loss of key points.

[0174] 3. The SDK obtains the dot data from the storage space and saves the dot data to the SDK message queue.

[0175] Among them, the message queue is the message queue inside the SDK. The SDK moves the dot data out of the specified storage space and stores it in the message queue, which makes it easier for the SDK to uniformly manage the dot data of device applications.

[0176] Optionally, the SDK can also read the dot data from the specified storage space and write it directly into a file on the device.

[0177] In this embodiment, the SDK stores the dotting data of the specified storage space in the internal message queue, which can better process each dotting data in the message queue. The SDK adopts a compare and swap (CAS) lock-free mechanism, and the CAS mechanism can realize the processing of high-performance message queues. The SDK can solve the problem of performance loss caused by using locks under multi-threaded conditions through the message queue. The atomicity of the operation is guaranteed by the processor of the Bluetooth device, and the multi-threaded data interaction between the device application and the SDK is supported. The SDK's message queue uses a linked list data structure, which can dynamically allocate memory according to the dotting needs of the device application. Compared with directly writing the dotting data into the file, it can avoid the problem of thread suspension / thread locking caused by multiple threads concurrently when reading and writing files, and it can also reduce the number of times the file is read and written, reduce the pressure of reading and writing files, and reduce the reading and writing power consumption of Bluetooth devices.

[0178] 4. The device operating system switches device tasks and schedules threads.

[0179] In this embodiment, the SDK is integrated into the Bluetooth device, and the internal logic runs in the polling thread, which needs to rely on the device operating system for task switching and thread scheduling. The task scheduling module of the SDK is responsible for the scheduling of internal timers, data processing of message queues, and business processing.

[0180] 5. When the SDK obtains the task scheduling of the device operating system, it starts reporting and processing the dot data.

[0181] In this embodiment, after the SDK is scheduled by the device operating system, it processes the dot data in the message queue. The SDK moves the dot data in the message queue to the ring memory buffer (RingBuffer) to temporarily store the dot data. RingBuffer is used as a temporary storage space for dot data. It uses a fixed-length memory as a ring buffer. When the memory is exhausted, the remaining unstored data is stored from the starting position of this memory. It does not need to allocate memory frequently, which is suitable for caching data streams.

[0182] After the above steps 1-5, when the SDK generates dot data on the device, it can generate dot data through the dot interface and the preset dot data format, and write the dot data into the message queue; after obtaining the task scheduling of the device operating system, it processes the dot data in the message queue, temporarily stores the dot data in the ring memory cache, and waits for subsequent processing of the dot data.

[0183] In this embodiment, the SDK caches the dot data through the message queue, thereby achieving the purpose of unified management of the dot data on the application side, solving the data storage conflict problem that may be caused by simultaneous dot data of multiple threads of device applications, and reducing the dot loss rate.

[0184] In some embodiments, Fig. 9 A schematic diagram of the storage and reporting process of Bluetooth device dot data is given (corresponding to Figure 7 Steps 6 to 13 in the above), refer to Fig. 9 ,include:

[0185] 6. The SDK determines the amount of dot data temporarily stored in the RingBuffer. If the amount of dot data temporarily stored in the RingBuffer has not been reported and exceeds the first threshold, the SDK writes the dot data temporarily stored in the RingBuffer into a file.

[0186] In this embodiment, the SDK writes the temporarily stored dotting data in the RingBuffer into the file, which can avoid the loss of the temporarily stored dotting data. The SDK can call the file management module inside the SDK to write the dotting data into the file. The file management module is responsible for unified management of the read and write operations of SDK-related files, shielding other modules from directly perceiving the operations on the device files.

[0187] Here, the first threshold value can be determined according to the actual storage space of RingBuffer. For example, the storage space size of RingBuffer can be 2k, 4k, 6k, etc. The first threshold value can be the same as the storage space size of RingBuffer. For example, the first threshold value can be 2k. That is, after the dotting data in RingBuffer is full, SDK writes the dotting data in RingBuffer to the file; the first threshold value is also smaller than the storage space of RingBuffer. For example, the first threshold value can be 1k, 2k, 3k, etc. For example, when the number of dotting data in RingBuffer reaches 2k, SDK writes the dotting data in RingBuffer to the file. The storage space size of RingBuffer can also be set according to the generation frequency and generation amount of dotting data of the actual Bluetooth device.

[0188] When the SDK writes the dot data in the RingBuffer into a file, the SDK can store the large dot data of different priorities into the corresponding files according to the priority of the dot data. That is, the file management module includes different file modules corresponding to the priority, for example, including key point files corresponding to high priority and ordinary point files corresponding to low priority. When the SDK stores the dot data into a file, it can first obtain the parameter field of the priority of the dot data to determine the priority of the dot data; store the dot data with high priority into the key point file, and store the dot data with low priority into the ordinary point file.

[0189] Optionally, the file management module of the SDK can mark the dot data to be stored in the file, for example, mark the dot data with high priority to be stored in the key point file; and mark the dot data with low priority to be stored in the common point file.

[0190] 7. The file management module of SDK calls the file reading and writing interface of the device to save the dot data into the device file.

[0191] The file management module of the SDK can store the dot data into the corresponding device file according to the mark of the dot data. Alternatively, the file management module of the SDK can directly store the dot data into the corresponding device file according to the priority field of the dot data.

[0192] 8. The first timer is defined in the SDK, and the first timer is used to trigger the reporting operation of starting the dot data.

[0193] In this embodiment, the triggering of the first timer is controlled by the task scheduling module of the SDK. After the SDK obtains the task scheduling of the device operating system, the task scheduling module of the SDK triggers the first timer. The default period of the first timer can be 60 seconds. Optionally, the period of the first timer can also be determined according to the generation frequency of the dotting data of the Bluetooth device. For example, if the generation frequency of the dotting data is high, the period of the first timer can be shorter, such as 20s, 30s, 40s, 50s, etc.; if the generation frequency of the dotting data is low, the period of the first timer can be longer, such as 60s, 70s, 80s, 90s, etc.

[0194] 9. After the first timer is triggered, the SDK determines the current link status of the Bluetooth device.

[0195] The SDK needs to report the dot data through an idle link. After the first timer is triggered, the SDK can first determine whether there is an available link. If there is an available link, the reporting process of the dot data will continue; if there is no available link, it will wait for the next first timer to be triggered. Among them, the situation where there is no available link may include the temporary disconnection of the communication connection between the Bluetooth device and the mobile phone.

[0196] Optionally, in some embodiments:

[0197] 10. When the file management module of the SDK monitors that the amount of dot data saved in the device file exceeds a second threshold, the SDK may also trigger and start a reporting process for the dot data.

[0198] Similarly, referring to the method in 9, when the SDK determines that the amount of unreported dot data stored in the device file exceeds the second threshold, the SDK obtains the link status from the device application through the link management module to determine whether there is an available link. If there is an available link, the dot data reporting process continues; if there is no available link, wait for the next trigger of the file management module.

[0199] Optionally, the second threshold value can be determined according to the size of the storage space of the device file; or according to the generation frequency and the generation amount of the dot data of the Bluetooth device. The second threshold value is a configurable parameter.

[0200] 11. If the SDK determines that there is an available link, the SDK generates a report cache (ReportCache) for caching the dot data to be reported.

[0201] In this embodiment, if the SDK determines that there is an available link, the SDK generates a report cache (ReportCache) for caching the dot data to be reported, and reports the dot data from the report cache, which can reduce the read and write operations on the device file and optimize the operating performance of the device file.

[0202] 12. The SDK reads the dot data in the RingBuffer into the ReportCache.

[0203] In this embodiment, if the SDK determines that there is an available link, the SDK may also cache the dot data in the RingBuffer into the ReportCache.

[0204] 13. SDK reads the RBI data in the device file into ReportCache.

[0205] Optionally, in order to further optimize the read and write operations of the device file. When the SDK determines that there is an available link, the SDK can also judge the number of dotting data to be reported. Here, the dotting data to be reported includes the dotting data to be reported in the device file and the dotting data to be reported in the RingBuffer. If the number of dotting data to be reported is less than the third threshold, wait for the next time the first timer is triggered, and re-execute the operation of determining whether the number of dotting data to be reported is less than the third threshold. If the number of dotting data to be reported is equal to or greater than the third threshold, the SDK generates a report cache (ReportCache) and caches the dotting data to be reported in ReportCache. Here, the third threshold is used to characterize the minimum value (lower limit value) of the dotting data to be reported; for example, the third threshold can be 4, 5, 6, and the third threshold is a natural number greater than 0. For example, when the number of dotting data to be reported is at least 4, the SDK is triggered to cache the dotting data to be reported in ReportCache; if it is less than 4, wait for the next time the first timer is triggered. The value of the third threshold may be determined according to the generation frequency and the generation amount of the dot data of the Bluetooth device.

[0206] In this embodiment, the judgment of the third threshold is added to further realize batch processing of the dot data to be reported. When the number of dot data to be reported is less than the third threshold, it will not be reported, saving the processing resources of the Bluetooth device SDK. In addition, the dot data to be reported that is not less than the third threshold is cached in ReportCache, waiting for the subsequent reporting operation of the dot data. Each time, multiple dot data to be reported are read from the device file and cached in ReportCache, avoiding the problem of frequently waking up Bluetooth when the Bluetooth device is in an idle state and generating less dot data, which can reduce the read access to the device file and further optimize the reading power consumption of the device file; at the same time, the reporting speed of the dot data can be increased, and the overall power consumption of the Bluetooth device can be reduced.

[0207] Optionally, when reading the RBI data to be reported into ReportCache, the SDK can also read the RBI data in batches according to their priority. Combined with the description of 6, the RBI data with high priority will be written into the key point file, and the RBI data with low priority will be written into the ordinary point file. Then, the reading priority of the key point file is higher than that of the ordinary point file.

[0208] In addition, since the dotting data in the RingBuffer is more time-sensitive than the dotting data in the device file (key point file, common point file), in this embodiment, the reading priority of the RingBuffer is higher than the reading priority of the key point file. That is, when the SDK reads the dotting data to be reported that is greater than or equal to the third threshold from the RingBuffer and the device file (key point file, common point file), the dotting data to be reported in the RingBuffer is read first, followed by the dotting data to be reported in the key point file, and finally the dotting data to be reported in the common point file. In this way, the priority reading of the important dotting data to the ReportCache is achieved, and the data reporting process is performed first.

[0209] In this embodiment, the SDK reports the data in the RingBuffer first, then the data in the key dotted files, and finally the data in the common dotted files, thereby reducing the number of file writes, reducing the power consumption of device file input / output (I / O), and reducing the processor occupancy of the Bluetooth device.

[0210] In some embodiments, Fig.10 A process diagram of reporting and processing Bluetooth device dot data is given (corresponding to Figure 7 Steps 14-20 in the Fig.10 ,include:

[0211] 14. A second timer is defined in the SDK, and the second timer is used to trigger the sequential reporting operation of the dot data.

[0212] In this embodiment, the triggering of the second timer is controlled by the task scheduling module of the SDK. After the SDK obtains the task scheduling of the device operating system, the task scheduling module of the SDK triggers the second timer. The default period of the second timer can be 50ms. Optionally, the period of the second timer can also be determined according to the service status of the Bluetooth device. For example, when the service status of the Bluetooth device is in an idle state, the period of the second timer can be shorter, such as 50ms; when the service status of the Bluetooth device is in a busy state, in order not to affect the service execution of the Bluetooth device, the period of the second timer can be longer, for example, 2000ms. The period of the second timer is dynamically adjusted by the SDK based on the service status of the Bluetooth device during the acquisition and reporting of the dot data.

[0213] 15. After the second timer is triggered, the SDK determines the current link status of the Bluetooth device.

[0214] In this embodiment, after the second timer is triggered, the SDK performs the operation of reporting the dot data in sequence, and the SDK needs to query again whether there is an available link to report the dot data. Similar to 9, the SDK can obtain the link status from the device application through the link management module. If there is no available link, the subsequent process does not continue, and waits for the next second timer to be triggered. If there is an available link, the SDK continues to perform the operation of reporting the dot data in sequence.

[0215] 16. The SDK adjusts the period of the second timer based on the link status.

[0216] When the SDK determines that there is currently an available link, the second timing period is adjusted based on the link status of the available link. Exemplarily, the SDK can determine whether the current available link is in an idle or busy state based on the link status of the available link. For example, the device application will occupy the link when executing device services. For example, when the device application is executing services such as listening to music or making calls, the link status of the available link is in a busy state; when the device application does not execute any services, for example, it is just connected to the mobile phone after powering on. At this time, the link status of the available link is in an idle state.

[0217] The SDK dynamically adjusts the period of the second timer according to the link status, that is, adjusts the interval time for reporting the dot data in sequence. Exemplarily, when the available link is in an idle state, it means that the Bluetooth device currently has no business to conduct. At this time, the period of the second timer can be the first period, for example, the first period can be 50ms, 100ms; for example, the second timer is triggered every 50ms, and a dot data in ReportCache is reported every 50ms. When the available link is in a busy state, it means that the Bluetooth device currently has business to conduct. In order not to affect the business execution of the Bluetooth device, the period of the second timer can be set to the second period at this time, for example, the second period can be 1000ms, 2000ms, 3000ms; for example, the second timer is triggered every 2000ms, and a dot data in ReportCache is reported every 2000ms. The period of the second timer in the idle state or busy state of the available link can be determined according to the actual situation of the Bluetooth device. In this embodiment, the first period is less than the second period.

[0218] In this embodiment, the SDK identifies the business status of the available link and adjusts the period of the second timer according to whether the available link is in a busy state or an idle state. In particular, when the Bluetooth device is in the process of business and the available link is in a busy state, it can ensure that when the Bluetooth device is in the process of business, the dot data can still be uploaded normally without affecting the normal operation of the Bluetooth device's business, and at the same time, the point loss rate is also reduced.

[0219] Optionally, if the number of dotting data reported by the SDK exceeds the fourth threshold value in the operation of reporting the dotting data in sequence this time, that is, in this reporting process, the number of dotting data reported by the SDK has reached the fourth threshold value, in this case, the SDK can end the reporting process, wait for the next triggering of the first timer or wait for the number of dotting data saved in the device file to exceed the second threshold value (refer to the embodiments provided in 9 and 10 above). The fourth threshold value is the upper limit value of the number of reported dotting data, and illustratively, the fourth threshold value can be 256, 512, etc. The fourth threshold value is greater than the third threshold value, and the fourth threshold value is a natural number greater than 0.

[0220] Optionally, after determining the period of the second timer based on the available link status, the SDK may also determine a reporting channel for the dotted data.

[0221] The mobile phone may include a first channel and a second channel. When reporting the dot data to the mobile phone, the SDK may specify the reporting channel for the dot data. The first channel may be understood as the dot data reporting channel that is compatible with mobile phones, Bluetooth devices and other products; the second channel may be understood as a third-party reporting channel in the mobile phone. If the first channel exists, the first channel is used to report the dot data; if the first channel does not exist, the second channel is used to report the dot data.

[0222] Optionally, before the SDK reports the dot data to the mobile phone via the Bluetooth module, conventional data processing may be performed on the dot data.

[0223] 17. SDK encodes and converts the dot data.

[0224] Exemplarily, the SDK converts the dot coding data according to the dot coding format corresponding to the preset Bluetooth device.

[0225] 18. The SDK serializes the dot data after the encoding conversion to obtain the serialized dot data.

[0226] Among them, serialization processing refers to serializing the dot data based on the serialization framework inside the SDK, and converting the dot data into a form that can be transmitted.

[0227] 19. SDK encapsulates the serialized dot data according to the preset communication protocol to obtain the encapsulated dot data.

[0228] For example, when the Bluetooth device is a Bluetooth headset, the SDK can encapsulate the serialized dot data according to the business communication protocol for interaction between the Bluetooth headset and the mobile phone to obtain the data-encapsulated dot data. When the Bluetooth device is a smart watch, the SDK can encapsulate the serialized dot data according to the business communication protocol for interaction between the smart watch and the mobile phone to obtain the data-encapsulated dot data.

[0229] 20. SDK transmits the encapsulated dot data to the device Bluetooth module through the data transmission module.

[0230] In some embodiments, Figure 7 Steps 21 to 29 are the process of the Bluetooth device transmitting the dot data to the mobile phone and the mobile phone, server, and web end processing the dot data, including:

[0231] 22. SDK transmits Bluetooth data with the mobile phone through the Bluetooth module of the device, and reports the packaged RBI data to the mobile phone.

[0232] Furthermore, the Bluetooth module of the mobile phone transmits the data to the target application corresponding to the data transmission channel according to the data transmission channel specified in the received dot data. The data transmission channel includes a first channel and a second channel. Among them, the first channel corresponds to the first target application, which can be understood as a system application supporting products such as mobile phones and Bluetooth devices; the second channel corresponds to the second target application, which can be understood as a third-party application in the mobile phone. The target application is an application for managing Bluetooth devices connected to the mobile phone.

[0233] 23. The Bluetooth module of the mobile phone transmits the dot data to the first target application corresponding to the first channel according to the first channel specified in the received dot data.

[0234] 24. The first target application of the mobile phone transmits the received RBI data to the RBI upload application through the first channel.

[0235] In some embodiments, the first target application is responsible for receiving the dotting data received by the Bluetooth module of the mobile phone; the dotting upload application in the mobile phone is responsible for reporting the dotting data to the server through the network.

[0236] 25. The Bluetooth module of the mobile phone transmits the dot data to the second target application corresponding to the second channel according to the second channel specified in the received dot data.

[0237] 26. The second target application of the mobile phone transmits the received RBI data to the RBI upload application through the second channel.

[0238] In some embodiments, the second target application is responsible for receiving the dotting data received by the Bluetooth module of the mobile phone; the dotting upload application in the mobile phone is responsible for reporting the dotting data to the server through the network.

[0239] 27. The RBI upload application reports the RBI data to the server through the network.

[0240] 28. The mobile phone and the server interact through the network to transmit the data of the management data.

[0241] 29. The web end obtains the dot data of the Bluetooth device from the cloud (server) of the server. Optionally, the web end can perform statistical analysis on the dot data of the Bluetooth device and visualize the analysis results.

[0242] In some embodiments, during the process of collecting, storing and reporting the dot data for the SDK, the parameters involved may be initialized and configured.

[0243] 21. SDK receives parameter configuration information and updates the corresponding parameter configuration.

[0244] Among them, the parameter configuration information includes the storage space size of RingBuffer, for example, the setting value of RingBuffer can be 2K; the trigger period of the first timer, for example, the setting value of the trigger period of the first timer can be 60s; the value of the third threshold, for example, the setting value of the third threshold can be 4; the value of the fourth threshold, for example, the setting value of the fourth threshold can be 512; the reporting period of the second timer in the idle state and the reporting period of the second timer in the busy state, for example, the reporting period of the second timer in the idle state can be set to 50ms, and the reporting period of the second timer in the busy state can be set to 2000ms. This embodiment does not specifically limit the setting value of each parameter, and the setting value of each parameter can be personalized based on different Bluetooth devices (electronic devices), so that the collection, storage and reporting process of dotting data is more suitable for the performance of the electronic device itself, further reducing the point loss rate, improving the effectiveness of dotting data, improving the reporting speed and efficiency of dotting data, reducing the power consumption of electronic devices for reporting dotting data, and optimizing the performance of electronic devices for reporting dotting data.

[0245] In this embodiment, in the interactive scenario of electronic device-server-web end, the electronic device is a mobile phone, combined with the architecture of mobile phone-server-web end, the data processing method provided by this embodiment is explained. For example, reference can be made to Fig.11 The architecture diagram shown.

[0246] Fig.11 The scenario shown includes a mobile phone, a server, and a web terminal. The mobile phone includes an SDK, a device operating system, device files, device applications, target applications (system applications and third-party applications), a point reporting application, and a network module. Among them, the SDK includes a data transmission module, a link management module, a file management module, a task scheduling module, and a parameter configuration module. The server includes a cloud (database), and the web terminal includes a big data website (big data dashboard). Among them, the mobile phone can transmit data with the server through the network module.

[0247] Fig.11 In the illustrated mobile phone-server-web interaction scenario, the mobile phone SDK collects and stores the dot data, and the SDK performs data processing before serializing the dot data ( Fig.11 The data processing process represented by sequence number 1 to sequence number 17) and Figure 7 The data processing method before the SDK of the Bluetooth device collects and stores the dot data and serializes the dot data in the interactive scenario of the Bluetooth device-mobile phone-server-web end shown in the figure ( Figure 7 The data processing process represented by sequence number 1 to sequence number 17 is the same and can be reused Figure 7The data processing methods provided by No. 1 to No. 17 include:

[0248] 1. The device application generates event records of the Bluetooth device when the user uses the Bluetooth device.

[0249] For reference Figure 7 A description of the data processing process represented by sequence number 1 in the provided embodiment.

[0250] 2. The device application generates dot data based on the event records of the Bluetooth device.

[0251] For reference Figure 7 A description of the data processing process represented by sequence number 2 in the provided embodiment.

[0252] 3. The SDK saves the dot data to the SDK message queue.

[0253] For reference Figure 7 A description of the data processing process represented by sequence number 3 in the provided embodiment.

[0254] 4. The device operating system switches device tasks and schedules threads.

[0255] For reference Figure 7 A description of the data processing process represented by sequence number 4 in the provided embodiment.

[0256] 5. When the SDK obtains the task scheduling of the device operating system, it starts reporting and processing the dot data.

[0257] For reference Figure 7 A description of the data processing process represented by sequence number 5 in the provided embodiment.

[0258] 6. The SDK determines the amount of dot data temporarily stored in the RingBuffer. If the amount of dot data temporarily stored in the RingBuffer has not been reported and exceeds the first threshold, the SDK writes the dot data temporarily stored in the RingBuffer into a file.

[0259] For reference Figure 7 A description of the data processing process represented by sequence number 6 in the provided embodiment.

[0260] 7. The file management module of SDK calls the file reading and writing interface of the device to save the dot data into the device file.

[0261] For reference Figure 7 A description of the data processing process represented by sequence number 7 in the provided embodiment.

[0262] 8. SDK defines the first timer, which is used to trigger the reporting operation of starting the dot data.

[0263] For reference Figure 7 A description of the data processing process represented by sequence number 8 in the provided embodiment.

[0264] 9. After the first timer is triggered, the SDK determines the current link status of the Bluetooth device.

[0265] For reference Figure 7 A description of the data processing process represented by sequence number 9 in the provided embodiment.

[0266] 10. When the file management module of the SDK monitors that the amount of dot data saved in the device file exceeds a second threshold, the SDK may also trigger and start a reporting process for the dot data.

[0267] For reference Figure 7 A description of the data processing process represented by sequence number 10 in the provided embodiment.

[0268] 11. If the SDK determines that there is an available link, the SDK generates a report cache (ReportCache) for caching the dot data to be reported.

[0269] For reference Figure 7 A description of the data processing process represented by sequence number 11 in the provided embodiment.

[0270] 12. The SDK reads the dot data in the RingBuffer into the ReportCache.

[0271] For reference Figure 7 A description of the data processing process represented by sequence number 12 in the provided embodiment.

[0272] 13. SDK reads the RBI data in the device file into ReportCache.

[0273] For reference Figure 7 A description of the data processing process represented by sequence number 13 in the provided embodiment.

[0274] 14. A second timer is defined in the SDK, and the second timer is used to trigger the sequential reporting operation of the dot data.

[0275] For reference Figure 7 A description of the data processing process represented by sequence number 14 in the provided embodiment.

[0276] 15. After the second timer is triggered, the SDK determines the current link status of the Bluetooth device.

[0277] For reference Figure 7A description of the data processing process represented by sequence number 15 in the provided embodiment.

[0278] 16. The SDK adjusts the period of the second timer based on the link status.

[0279] For reference Figure 7 A description of the data processing process represented by sequence number 16 in the provided embodiment.

[0280] 17. SDK encodes and converts the dot data.

[0281] For reference Figure 7 A description of the data processing process represented by sequence number 17 in the provided embodiment.

[0282] 18. The SDK serializes the dot data after the encoding conversion to obtain the serialized dot data.

[0283] For reference Figure 7 A description of the data processing process represented by sequence number 18 in the provided embodiment.

[0284] 30. SDK encapsulates the serialized dot data according to the preset communication protocol to obtain the encapsulated dot data.

[0285] In this embodiment, Figure 7 The scenes shown are 19 different, Fig.11 After the SDK of the mobile phone serializes the dot data, it encapsulates the data according to the preset communication protocol to obtain the dot data after data encapsulation. The preset communication protocol here is the business communication protocol preset by the mobile phone, which is different from the 19 shown in 7, which encapsulates the dot data according to the business communication protocol between the mobile phone and the Bluetooth device.

[0286] 31. SDK transmits the packaged dotted data to the data transmission module.

[0287] 32. The data transmission module of the SDK transmits the data to the target application (system application or third-party application) corresponding to the reporting channel based on the reporting channel specified in the dot data.

[0288] The first channel corresponds to the first target application, which can be understood as a system application that is compatible with mobile phones, Bluetooth devices and other products; the second channel corresponds to the second target application, which can be understood as a third-party application in the mobile phone. The target application is an application that manages Bluetooth devices connected to the mobile phone.

[0289] 24. The first target application of the mobile phone transmits the received RBI data to the RBI upload application through the first channel.

[0290] For reference Figure 7 A description of the data processing process represented by sequence number 24 in the provided embodiment.

[0291] 26. The second target application of the mobile phone transmits the received RBI data to the RBI upload application through the second channel.

[0292] For reference Figure 7 A description of the data processing process represented by sequence number 26 in the provided embodiment.

[0293] 27. The RBI upload application reports the RBI data to the server through the network.

[0294] 28. The mobile phone and the server interact through the network to transmit the data of the management data.

[0295] 29. The web end obtains the dot data of the Bluetooth device from the cloud (server) of the server. Optionally, the web end can perform statistical analysis on the dot data of the Bluetooth device and visualize the analysis results.

[0296] In this embodiment, the data processing method can be applied to the interaction scenarios of dotting data between different electronic devices and servers, and can effectively solve the problem of high point loss rate in the existing dotting data reporting method. Based on the data processing solution provided by this embodiment, the dotting data can be cached through the SDK message queue, which can shield the impact of multi-threaded concurrent calls on the storage of dotting data and reduce the point loss rate; based on the report cache ReportCache provided by this embodiment, the SDK can read multiple dotting data from the device file to ReportCache each time, reduce the number of read and write times of the device file, improve the reporting speed of the dotting data, and reduce the reading power consumption of the device file. When generating dotting data, a field for characterizing the priority of the dotting data is added based on the preset data format, and the dotting data is classified and stored according to the priority. When reporting the dotting data, it is read based on the priority of the dotting data, so as to improve the storage and reporting success rate of the dotting data with high priority and avoid the loss of the point data with high priority. In addition, when reporting the dot data in sequence, the busy state and the idle state of the electronic device will be distinguished according to the link status of the current electronic device, and the cycle of reporting the dot data in sequence (the triggering cycle of the second timer) will be adjusted accordingly. This can ensure that the dot data can be uploaded normally when the device is always in busy business, without affecting the normal operation of the business, thereby reducing the point loss rate.

[0297] Fig.12 A possible structural diagram of the electronic device involved in the above embodiments is shown. Fig.12 The electronic device 1000 shown includes a processor 1001 , a communication module 1002 , and a storage module 1003 .

[0298] Among them, the processor 1001 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The processor may include an application processor and a baseband processor. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The storage module 1005 may be a memory.

[0299] For example, the processor 1001 may be Figure 5 The processor 310 shown; the communication module 1002 may be as follows Figure 5 The camera 393 shown, the storage module 1003 can be as follows Figure 5 The internal memory 321 shown. The electronic device provided in the embodiment of the present application can be Figure 5 An electronic device 300 is shown.

[0300] The present application also provides a chip system (eg, a system on a chip (SoC)), such as Fig.13 As shown, the chip system includes at least one processor 701 and at least one interface circuit 702. The processor 701 and the interface circuit 702 can be interconnected by lines. For example, the interface circuit 702 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 702 can be used to send signals to other devices (such as a processor 701 or a camera of an electronic device). Exemplarily, the interface circuit 702 can read instructions stored in the memory and send the instructions to the processor 701. When the instruction is executed by the processor 701, the electronic device can perform the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0301] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device 200 or the electronic device 300 in the above-mentioned method embodiment.

[0302] The embodiment of the present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the electronic device 200 or the electronic device 300 in the above method embodiment. For example, the computer may be the above electronic device 200 or the electronic device 300.

[0303] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

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

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

[0306] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

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

[0308] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A data processing method, characterized in that: Applicable to multi-threaded working environment, including: The electronic device obtains the dotting data corresponding to the preset dotting event from the message queue; the dotting data is marked with a priority, and the priority is related to the preset dotting event; the message queue is a linked list data structure, and adopts a compare and exchange CAS lock-free mechanism; The electronic device temporarily stores the dot data in a ring memory buffer; When the amount of dot data in the annular memory cache is greater than or equal to a first threshold, the electronic device stores the dot data in the annular memory cache into a preset storage space according to the priority of the dot data in the annular memory cache; the preset storage space includes a first storage space and a second storage space, the priority includes a first priority and a second priority, the first storage space corresponds to the first priority, the second storage space corresponds to the second priority, the first priority is higher than the second priority, and the priority of the annular memory cache is higher than the priority of the first storage space; When the electronic device meets the condition for starting to send the dot data, the electronic device reads the dot data from the annular memory cache, the first storage space and the second storage space into the reporting cache in order of priority from high to low; The electronic device sends the dot data in the reporting buffer to other devices.

2. The method according to claim 1, characterized in that: Before the electronic device obtains the dot data corresponding to the preset dot event from the message queue, the method further includes: When the electronic device detects the preset dotting event, it generates dotting data corresponding to the preset dotting event according to a preset data format; The electronic device stores the dotted data in a preset message queue.

3. The method according to claim 1, characterized in that The conditions for starting to send dot data include: the trigger period of the first timer arrives; or the amount of dot data in the preset storage space and the ring memory cache is greater than or equal to a second threshold; the second threshold is greater than the first threshold.

4. The method according to claim 1, characterized in that: The electronic device stores the dot data in the annular memory buffer into a preset storage space according to the priority of the dot data in the annular memory buffer, including: The electronic device stores the dot data corresponding to a first priority level in the first storage space and stores the dot data corresponding to a second priority level in the second storage space according to the priority level of the dot data in the ring memory buffer.

5. The method according to claim 1, characterized in that The electronic device reads the dot data from the annular memory cache, the first storage space, and the second storage space into the reporting cache in a descending order of priority, including: When the number of dot data in the storage space and the annular memory cache is greater than a third threshold, the electronic device reads the dot data from the annular memory cache, the first storage space and the second storage space to the reporting cache in order of priority from high to low; the third threshold is used to represent the lower limit value of the number of dot data to be sent.

6. The method according to claim 1, characterized in that When the electronic device meets the condition for starting to send dot data, the method further includes: The electronic device acquires a link status; the link status is used to indicate that the link is available or unavailable; The electronic device reads the dot data in the storage space into a reporting buffer according to the priority of the dot data, including: When the electronic device determines that the link is available according to the link status, the electronic device reads the dot data in the storage space into the reporting buffer according to the priority of the dot data.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The electronic device acquires a link status; the link status is used to indicate that the link is available or unavailable; If the link status indicates that the link is available, the electronic device acquires the service status of the available link; the service status includes a busy state or an idle state; The electronic device determines, according to the service status of the available link, a reporting period of the dot data in the reporting buffer; The electronic device sends the dot data in the reporting buffer to other devices, including: When the reporting period arrives, the electronic device sends the dot data in the reporting buffer to the other device.

8. The method according to claim 7, characterized in that If the service state of the available link is an idle state, the reporting period is a first period; if the service state of the available link is a busy state, the reporting period is a second period; and the first period is smaller than the second period.

9. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The electronic device acquires the amount of dot data sent to the other device; If the number of dot data sent is greater than or equal to a fourth threshold, the operation of sending dot data is stopped. When the electronic device meets the condition for starting to send dot data again, the electronic device reads the dot data in the storage space into the reporting cache according to the priority of the dot data. The fourth threshold is used to represent the upper limit of the number of dot data sent.

10. The method according to any one of claims 1 to 6, characterized in that: The data transmission channel is marked in the dotted data; The electronic device sends the dot data in the reporting buffer to other devices, including: The electronic device transmits the dot data in the reporting cache to the target application based on the data transmission channel corresponding to the dot data, so that the target application sends the dot data in the reporting cache to the other device; the target application includes an application in the electronic device for transmitting dot data.

11. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The electronic device receives parameter configuration information and updates the parameter configuration based on the parameter configuration information; the parameter configuration information includes at least one of the storage space of the ring memory cache, the trigger period of the first timer, the first threshold, the second threshold, the third threshold, the fourth threshold, the first period and the second period.

12. An electronic device, characterized in that: The electronic device includes a memory, a communication module and one or more processors; the memory and the communication module are coupled to the processor; the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-11.

13. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data statistics method and device based on multi-level cache, terminal and storage medium

    CN111723115A

  • Burial point reporting method and device, terminal and storage medium

    CN114816949A