CN111327711A - A data service method, data service device, terminal and machine-readable storage medium - Google Patents

A data service method, data service device, terminal and machine-readable storage medium Download PDF

Info

Publication number
CN111327711A
CN111327711A CN202010192955.7A CN202010192955A CN111327711A CN 111327711 A CN111327711 A CN 111327711A CN 202010192955 A CN202010192955 A CN 202010192955A CN 111327711 A CN111327711 A CN 111327711A
Authority
CN
China
Prior art keywords
data
terminal
data service
service
uploading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010192955.7A
Other languages
Chinese (zh)
Inventor
蔡立恒
莫晓恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Sunmi Technology Group Co Ltd
Shanghai Sunmi Technology Co Ltd
Original Assignee
Shanghai Sunmi Technology Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Sunmi Technology Group Co Ltd filed Critical Shanghai Sunmi Technology Group Co Ltd
Priority to CN202010192955.7A priority Critical patent/CN111327711A/en
Publication of CN111327711A publication Critical patent/CN111327711A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

本申请实施例提供了一种数据服务方法、数据服务装置、终端和机器可读存储介质。所述数据服务方法包括:终端上运行唯一数据服务,该数据服务采集第一数据,第一数据包括终端自带的第一类应用程序运行时产生的数据;数据服务接收数据服务SDK发送的、终端上安装的第二类应用程序运行时产生的第二数据;存储第一数据和第二数据。本发明实施例中,因终端仅运行一个数据服务,终端上运行的第一类应用程序通过该数据服务进行数据采集,终端上运行的第二类应用程序采集的数据,通过统一的数据服务SDK进行存储。

Figure 202010192955

Embodiments of the present application provide a data service method, a data service apparatus, a terminal, and a machine-readable storage medium. The data service method includes: running a unique data service on a terminal, the data service collects first data, and the first data includes data generated when a first type of application program that comes with the terminal is running; the data service receives the data sent by the data service SDK. Second data generated when the second type of application program installed on the terminal is running; the first data and the second data are stored. In the embodiment of the present invention, since the terminal only runs one data service, the first type of application running on the terminal collects data through the data service, and the data collected by the second type of application running on the terminal passes through the unified data service SDK. to store.

Figure 202010192955

Description

一种数据服务方法、数据服务装置、终端和机器可读存储介质A data service method, data service device, terminal and machine-readable storage medium

技术领域technical field

本申请实施例涉及信息技术领域,并且更具体地,涉及数据服务方法、数据服务装置、终端和机器可读存储介质。The embodiments of the present application relate to the field of information technology, and more particularly, to a data service method, a data service apparatus, a terminal, and a machine-readable storage medium.

背景技术Background technique

当前市面上的智能移动终端或终端运行的应用程序都会采集终端的唯一标识码、应用操作、使用时长、终端使用情况等数据。第三方数据获取平台、软件开发者获得这些数据后,用于分析用户使用行为、硬件基本情况,给未来的迭代提供参考依据和优化建议。At present, the smart mobile terminals on the market or the applications running on the terminals will collect data such as the unique identification code of the terminal, the application operation, the usage time, and the usage of the terminal. After third-party data acquisition platforms and software developers obtain these data, they are used to analyze user behavior and basic hardware conditions, and provide reference and optimization suggestions for future iterations.

一般当前应用程序主要使用第三方平台提供的SDK,来记录终端或软件的使用行为等数据。在终端正常运行时,SDK会在后台运行一个服务,并按预置好的埋点进行数据采集并进行上传。由于一个终端会运行多个商户的应用程序,而若每个应用程序都集成一个第三方数据采集SDK,那么终端的后台服务将运行多个数据采集服务,这些服务均需要占用CPU、内存资源,同时会加快终端的电量、流量消耗,且上传机制基本固定不允许自定义。因此目前的方式容易产生占用系统资源、安全性未知、商用场景环境较差的情况。Generally, current applications mainly use SDKs provided by third-party platforms to record data such as terminal or software usage behavior. When the terminal is running normally, the SDK will run a service in the background, and collect and upload data according to the preset buried points. Since a terminal will run multiple merchant applications, and if each application integrates a third-party data collection SDK, then the terminal's background service will run multiple data collection services, all of which require CPU and memory resources. At the same time, it will speed up the power consumption and traffic consumption of the terminal, and the upload mechanism is basically fixed and does not allow customization. Therefore, the current method is prone to occupy system resources, the security is unknown, and the commercial scene environment is poor.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种数据服务方法、数据服务装置、终端和机器可读存储介质,每台移动终端仅运行一个数据服务模块,通过该数据服务对终端上安装的应用程序进行数据采集存储上传服务,能够以最小的资源占用、消耗来提供数据服务。The embodiments of the present application provide a data service method, a data service device, a terminal, and a machine-readable storage medium. Each mobile terminal only runs one data service module, and uses the data service to collect, store, and upload data for applications installed on the terminal. It can provide data services with minimal resource occupation and consumption.

一方面,本申请实施例提供了一种数据服务方法,唯一的数据服务运行在终端,所述方法包括:On the one hand, an embodiment of the present application provides a data service method, in which a unique data service runs on a terminal, and the method includes:

所述数据服务采集第一数据,所述第一数据包括所述终端自带的第一类应用程序运行时产生的数据;The data service collects first data, and the first data includes data generated when the first type of application program that comes with the terminal is running;

所述数据服务接收数据服务SDK发送的、终端上安装的第二类应用程序运行时产生的第二数据;The data service receives the second data sent by the data service SDK and generated when the second type of application program installed on the terminal is running;

存储所述第一数据和所述第二数据。The first data and the second data are stored.

作为一种优选方式,所述第一数据还包括终端的基础信息,所述第二数据包括业务数据。As a preferred manner, the first data further includes basic information of the terminal, and the second data includes service data.

作为一种优选方式,所述存储所述第一数据和所述第二数据,具体包括:As a preferred manner, the storing of the first data and the second data specifically includes:

分别将所述第一数据和第二数据封装成DataBean格式;respectively encapsulating the first data and the second data into a DataBean format;

将封装后的数据存储到内容提供者。Store the encapsulated data to the content provider.

进一步的,所述方法还包括:Further, the method also includes:

根据预定上传策略和上传时间,将所述内容提供者存储的数据上传到云端服务器。The data stored by the content provider is uploaded to the cloud server according to a predetermined upload policy and upload time.

进一步的,所述方法还包括:Further, the method also includes:

判断上传数据是否上传成功;Determine whether the uploaded data is uploaded successfully;

判断出上传失败时,在所述上传时间内触发所述上传数据重新上传;When judging that the uploading fails, trigger the uploading of the uploading data to be re-uploaded within the uploading time;

判断出上传成功时,触发所述内容提供者删除所述上传成功的数据。When it is determined that the upload is successful, the content provider is triggered to delete the successfully uploaded data.

作为一种优选方式,所述上传策略具体根据所述终端的网络状态和流量模式,和/或存储数据的数据等级提供,所述上传时间为凌晨1点到凌晨4间之间。As a preferred manner, the uploading policy is specifically provided according to the network status and traffic pattern of the terminal, and/or the data level of the stored data, and the uploading time is between 1:00 am and 4:00 am.

另一方面,本申请实施例提供了一种数据服务装置,包括唯一的数据服务、数据服务SDK模块和内容提供者:On the other hand, an embodiment of the present application provides a data service device, including a unique data service, a data service SDK module, and a content provider:

所述数据服务,用于采集终端自带的第一类应用程序运行时产生的第一数据;The data service is used to collect the first data generated when the first type of application program that comes with the terminal is running;

所述数据服务SDK模块连接数据服务模块,用于将终端上安装的第二类应用程序运行时产生的第二数据发送给所述数据服务;The data service SDK module is connected to the data service module, and is used for sending the second data generated when the second type of application program installed on the terminal is running to the data service;

所述内容提供者连接所述数据服务,用于将所述数据服务采集的第一数据和第二数据进行存储。The content provider is connected to the data service for storing the first data and the second data collected by the data service.

作为一种优选方式,所述数据服务装置还包括封装模块,所述封装模块连接所述内容提供者,用于分别将所述第一数据和第二数据封装成DataBean格式,并将封装后的数据存储到所述内容提供者。As a preferred manner, the data service device further includes an encapsulation module, which is connected to the content provider and is used to encapsulate the first data and the second data into a DataBean format, respectively, and encapsulate the encapsulated data. Data is stored to the content provider.

进一步的,所述数据服务装置还包括上传模块,用于根据预定上传策略和上传时间,将所述内容提供者的数据上传到云端服务器。Further, the data service device further includes an uploading module configured to upload the data of the content provider to the cloud server according to a predetermined uploading strategy and uploading time.

其中,所述数据服务装置还包括判断模块,所述判断模块连接所述内容提供者,用于判断上传数据是否上传成功,当上传失败时,在所述上传时间内触发数据重新上传,当上传成功时,触发所述内容提供者删除所述上传成功的数据。Wherein, the data service device further includes a judging module, the judging module is connected to the content provider and used to judge whether the uploaded data is uploaded successfully, when the upload fails, trigger the data to be re-uploaded within the uploading time, and when the uploading fails, the data is re-uploaded. When successful, the content provider is triggered to delete the successfully uploaded data.

又一方面,本申请实施例提供了一种终端,所述终端包括上述任一数据服务装置。In another aspect, an embodiment of the present application provides a terminal, where the terminal includes any of the foregoing data service apparatuses.

作为一种优选方式,所述终端还包括数据回收模块,用于在所述数据服务装置的内容提供者存储的数据达到一定阈值时,进行数据回收。As a preferred manner, the terminal further includes a data recovery module for performing data recovery when the data stored by the content provider of the data service device reaches a certain threshold.

其中,所述数据回收模块在所述数据服务装置的内容提供者存储的数据达到一定阈值时,根据数据的存储时间和数据等级进行回收。Wherein, when the data stored by the content provider of the data service device reaches a certain threshold, the data recovery module performs recovery according to the storage time and data level of the data.

再一方面,本申请实施例提供了一种机器可读存储介质,其上存储有可执行指令,所述可执行指令在被机器执行时使得实现上述方法。In yet another aspect, an embodiment of the present application provides a machine-readable storage medium on which executable instructions are stored, and when executed by a machine, the executable instructions enable the implementation of the above method.

可见,在上述技术方案中,终端仅运行一个数据服务(DataService),终端上运行的第一类应用程序通过该数据服务进行数据采集,终端上运行的第二类应用程序采集的数据,通过统一的数据服务SDK(DataServiceSDK)存储到内容提供者(ContentProvider)。通过利用唯一的数据服务进行数据采集和存储,终端的后台服务只运行一个采集服务,从而占用CPU和内存资源较小,且减少终端的电量、流量的消耗。It can be seen that in the above technical solution, the terminal only runs one data service (DataService), the first type of application running on the terminal collects data through the data service, and the data collected by the second type of application running on the terminal is unified The data service SDK (DataServiceSDK) is stored to the content provider (ContentProvider). By using the only data service for data collection and storage, the background service of the terminal only runs one collection service, which occupies less CPU and memory resources, and reduces the consumption of power and traffic of the terminal.

附图说明Description of drawings

为了更清楚地说明本申请的实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图进行简单介绍。然而,本领域技术人员应当理解的是,下面描述中的附图仅仅是本申请的一些示例,并不限制其范围。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that are required to be used in the description of the embodiments or the prior art. However, it should be understood by those skilled in the art that the accompanying drawings in the following description are merely some examples of the present application and do not limit its scope.

图1是根据一个实施例的数据服务方法流程示意图。FIG. 1 is a schematic flowchart of a data service method according to an embodiment.

图2是根据一个实施例的另一种数据服务方法流程示意图。FIG. 2 is a schematic flowchart of another data service method according to an embodiment.

图3是根据一个实施例的又一数据服务的工作流程示意图。FIG. 3 is a schematic diagram of the workflow of yet another data service according to an embodiment.

图4是根据一个实施例的数据服务装置的结构示意图。FIG. 4 is a schematic structural diagram of a data service apparatus according to an embodiment.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。本领域技术人员应当理解的是,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员可以进行任何适当的修改或变型,从而获得的所有其它实施例。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood by those skilled in the art that the described embodiments are some, but not all, embodiments of the present invention. Based on the embodiments in this application, those skilled in the art can make any suitable modifications or variations to obtain all other embodiments.

目前终端上运行有各种应用程序,每个应用程序集成第三方平台提供的数据采集SDK(Software Development Kit,软件开发工具包),在终端正常运行时,SDK会在后台运行一个服务,并按预置好的埋点进行数据采集并进行上传,这种运行多个SDK进行数据服务的方式,不仅占用CPU、内存等资源,加快终端的电亮、流量消耗,而且对于终端在WIFI、基站信号差、SIM卡套餐流量较低的情况下,会影响数据采集服务和上传。At present, there are various applications running on the terminal, and each application integrates the data acquisition SDK (Software Development Kit, software development kit) provided by the third-party platform. When the terminal is running normally, the SDK will run a service in the background, and press Pre-set buried points are used for data collection and uploading. This method of running multiple SDKs for data services not only occupies CPU, memory and other resources to speed up the terminal's power consumption and traffic consumption, but also has a great impact on the terminal's WIFI and base station signals. In the case of poor SIM card package traffic, data collection services and uploading will be affected.

鉴于此,本申请实施例提供了一种数据服务方案。在该技术方案中,终端仅运行一个数据服务,即DataService,该DataService包括两部分:数据处理模块和数据采集模块,该数据采集模块用于采集第一类应用程序运行时产生的数据,并存储在,ContentProvider(内容提供者),而第二类应用程序运行时独立采集的数据通过DataServiceSDK,存储到ContentProvider,该数据处理模块用于将ContentProvider存储的数据上传到云端服务器。In view of this, the embodiments of the present application provide a data service solution. In this technical solution, the terminal only runs one data service, that is, DataService. The DataService includes two parts: a data processing module and a data acquisition module. The data acquisition module is used to collect the data generated when the first type of application is running, and store the data. Now, ContentProvider (content provider), and the data independently collected by the second type of application program is stored in the ContentProvider through the DataServiceSDK, and the data processing module is used to upload the data stored in the ContentProvider to the cloud server.

下面将结合具体实施例来详细描述上述技术方案。The above technical solutions will be described in detail below with reference to specific embodiments.

图1提供了根据一个实施例的数据服务方法流程示意图,主要包括三个步骤。FIG. 1 provides a schematic flowchart of a data service method according to an embodiment, which mainly includes three steps.

步骤101,终端运行唯一的数据服务,该数据服务采集第一数据,该第一数据包括终端自带的第一类应用程序运行时产生的数据;Step 101, the terminal runs a unique data service, the data service collects first data, and the first data includes data generated when the first type of application program that comes with the terminal is running;

该步骤中,终端仅运行一个数据服务,即DataService,该DataService对终端安装的各个应用程序运行产生的数据进行存储和上传。具体的,本实施例中,将终端上运行的应用程序分为第一类应用程序和第二类应用程序,第一类应用程序是指终端出厂自带的应用程序,与终端的操作系统相关联,而第二类应用程序是指一般的商用应用程序,或第三方应用程序,与终端的操作系统无关。实际应用中,本实施例的终端可以运行在特定操作系统下,如SUNMI OS,即商米操作系统,此时DataServicec可以采集终端的任何数据,若终端运行在非商米的安卓ROM,此时DataService无法获取某些需要特定接口访问的数据,如监控CPU峰值、电池电量等,但一般的数据采集、上传等可以正常运行。In this step, the terminal runs only one data service, that is, the DataService, and the DataService stores and uploads data generated by the running of each application program installed on the terminal. Specifically, in this embodiment, the application programs running on the terminal are divided into the first type of application program and the second type of application program. The first type of application program refers to the application program that comes with the terminal from the factory and is related to the operating system of the terminal. The second type of applications refers to general commercial applications or third-party applications, which have nothing to do with the operating system of the terminal. In practical applications, the terminal in this embodiment can run under a specific operating system, such as SUNMI OS, that is, Sunmi operating system. At this time, DataServicec can collect any data of the terminal. If the terminal runs on a non-SUNMI Android ROM, then DataService cannot obtain some data that requires specific interface access, such as monitoring CPU peak value, battery power, etc., but general data collection and uploading can work normally.

步骤102:数据服务接收数据服务SDK发送的、终端上安装的第二类应用程序运行时产生的第二数据;Step 102: the data service receives the second data sent by the data service SDK and generated when the second type of application program installed on the terminal is running;

本实施例中,对于终端上安装的第二类应用程序,其运行时产生的第二数据,通过数据服务SDK发送给数据服务。此处的第二数据一般为业务数据,可以为空中下载升级时产生的ROM包的下载速度信息、作为应用市场需要采集应用的下载速度、模块的点击量或操作量等。In this embodiment, for the second type of application installed on the terminal, the second data generated when the application is running is sent to the data service through the data service SDK. The second data here is generally service data, which may be the download speed information of the ROM package generated during the over-the-air download upgrade, the download speed of the application that needs to be collected as the application market, the number of clicks or operations of the module, and the like.

目前DataService所有的能力是用于商米自带应用程序(APP),未向一般商用APP开放,本实施例提供的DataService SDK将一般商用APP采集的数据存储到ContentProvider。Currently, all the capabilities of DataService are used in Sunmi's own application (APP), which is not open to general commercial APPs. The DataService SDK provided in this embodiment stores the data collected by general commercial APPs in the ContentProvider.

步骤103:存储第一数据和第二数据。Step 103: Store the first data and the second data.

其中,本发明实施例中,将数据服务存储的第一数据和第二数据,统称为存储数据,数据服务会根据当前终端所处的网络状态和流量模式来综合选择上传策略,结合选择上传时间,以最小的资源占用、消耗来保证数据可以完整传到云端服务器。Among them, in the embodiment of the present invention, the first data and the second data stored by the data service are collectively referred to as stored data. , to ensure that the data can be completely transmitted to the cloud server with the minimum resource occupation and consumption.

在本申请中,上述技术方案可以应用于智能终端、移动终端等。In this application, the above technical solutions can be applied to smart terminals, mobile terminals, and the like.

在一个实施例中,终端仅运行一个数据服务,即DataService,该数据服务会在终端开机后运行,对终端自带应用程序运行时产生的数据进行记录,并对终端安装的一般应用程序采集的数据,通过DataService的SDK存储到ContentProvider。In one embodiment, the terminal runs only one data service, namely DataService, which runs after the terminal is powered on, records data generated when the terminal's own application runs, and collects data from general applications installed on the terminal. Data is stored to ContentProvider through DataService SDK.

为了帮助本领域技术人员更好地理解本申请的技术方案,下面将结合具体例子进行说明。然而,应当理解的是,这些例子并不对本申请的保护范围造成任何限制。In order to help those skilled in the art better understand the technical solutions of the present application, the following description will be given with reference to specific examples. However, it should be understood that these examples do not impose any limitation on the scope of protection of the present application.

图2是根据一个实施例的数据服务方法的一个示例。Figure 2 is an example of a data service method according to one embodiment.

步骤201:终端运行唯一数据服务,该数据服务在终端开机后运行;Step 201: the terminal runs a unique data service, and the data service runs after the terminal is powered on;

实际应用中,该数据服务在开机后第一时间获取服务时间戳,后续时间通过计算可以知道服务器具体时间,该数据本服务中数据都是以服务器时间来记录的。In practical applications, the data service obtains the service timestamp at the first time after it is powered on, and the specific time of the server can be known by calculating the subsequent time. The data in this service is all recorded by the server time.

本实施例的终端可以运行在特定操作系统下,如SUNMI OS,即商米操作系统,此时DataServicec可以采集终端的任何数据,若终端运行在非商米的安卓ROM,此时DataService无法获取某些需要特定接口访问的数据,如监控CPU峰值、电池电量等,但一般的数据采集、上传等可以正常运行。The terminal in this embodiment can run under a specific operating system, such as SUNMI OS, that is, Sunmi operating system. At this time, DataServicec can collect any data of the terminal. If the terminal runs on a non-SUNMI Android ROM, DataService cannot obtain certain data. Some data that require specific interface access, such as monitoring CPU peak, battery power, etc., but general data collection, upload, etc. can run normally.

具体的,本实施例通过Android系统的定时服务(AlarmManager)来提供定时任务,唤醒AlarmManager是系统唤醒,即使系统现在处于休眠状态也能被唤醒处理数据服务中的数据采集任务。这样可以保证数据采集任务在设定的时间后准时运行。Specifically, in this embodiment, a timing service (AlarmManager) of the Android system is used to provide timing tasks, and waking up the AlarmManager is a system wake-up. Even if the system is in a dormant state, it can be woken up to process data collection tasks in the data service. This ensures that the data collection task runs on time after the set time.

AlarmManager启动后,设置了不同的定时任务和定时时间,到达定时时间后,数据服务运行程序采集相关数据。After AlarmManager is started, different timing tasks and timings are set. After the timing is reached, the data service running program collects relevant data.

步骤202:数据服务采集终端自带的第一类应用程序运行时产生的第一数据;Step 202: the data service collects the first data generated when the first type of application program that comes with the terminal is running;

本实施例中,将终端上运行的应用程序分为第一类应用程序和第二类应用程序,第一类应用程序是指终端出厂自带的应用程序,与终端的操作系统相关联,而第二类应用程序是指一般的商用应用程序,与终端的操作系统无关。In this embodiment, the application programs running on the terminal are divided into the first type of application program and the second type of application program. The first type of application program refers to the application program that comes with the terminal from the factory and is associated with the operating system of the terminal. The second type of application program refers to a general commercial application program, which has nothing to do with the operating system of the terminal.

本发明数据服务的数据采集功能,是基于Android原生和定制rom 提供的API采集的,因而数据的准确性能得到很好的保证。The data collection function of the data service of the present invention is collected based on the API provided by the Android native and customized rom, so the accurate performance of the data is well guaranteed.

进一步的,第一数据还包括终端的基础信息,数据服务还采集终端的基础信息,该基础信息可以为终端内存、终端电量、位置信息、ROM信息和/或安装APP的运行时间等,基础信息是通过系统广播来收集的,广播采用静态注册,即使数据服务退出或者被回收了,也能在收到广播重新开启运行,进而可以节省系统内存和减少系统消耗。Further, the first data also includes the basic information of the terminal, and the data service also collects the basic information of the terminal, and the basic information can be the terminal memory, terminal power, location information, ROM information and/or the running time of the installed APP, etc., the basic information It is collected through system broadcast. The broadcast adopts static registration. Even if the data service exits or is recycled, it can be restarted after receiving the broadcast, which can save system memory and reduce system consumption.

步骤203:数据服务接收数据服务SDK发送的、终端上安装的第二类应用程序运行时产生的第二数据;Step 203: the data service receives the second data sent by the data service SDK and generated when the second type of application installed on the terminal is running;

具体的,终端上安装的第二类应用程序,其运行时产生的第二数据,一般为业务数据,如第二类应用程序升级产生系统包的下载速度信息、模块的点击量或操作量等,通过数据服务SDK发送给数据服务,从而通过该数据服务将采集的数据存储、上传给云端服务器。Specifically, for the second type of application installed on the terminal, the second data generated when it is running is generally business data, such as the download speed information of the system package generated by the upgrade of the second type of application, the number of clicks or operations of the module, etc. , and send it to the data service through the data service SDK, so that the collected data is stored and uploaded to the cloud server through the data service.

其中,该第二数据一般为业务数据,可以为空中下载升级时产生的ROM包的下载速度信息、作为应用市场需要采集应用的下载速度、模块的点击量或操作量等,第二类应用程序采集的第二数据,都需要通过DataServiceSDK传到ContentProvider的数据库。该ROM包是好比电脑装系统时所需的安装盘,在本实施例指终端的系统包。Among them, the second data is generally business data, which can be the download speed information of the ROM package generated during the over-the-air download upgrade, the download speed of the application that needs to be collected as the application market, the number of clicks or operations of the module, etc. The second type of application program The collected second data needs to be transmitted to the database of ContentProvider through DataServiceSDK. The ROM package is like an installation disk required when a computer is installed with a system, and in this embodiment refers to the system package of the terminal.

步骤204:将第一数据和第二数据进行存储。Step 204: Store the first data and the second data.

将数据存储在ContentProvider的数据库,其他组件可以通过URI将数据存储到设定好的数据库里,本实施例在此处增加权限控制,防止其他APP存储或者读取数据。其他组件不能通过URI读数据,该URI服务只能添加数据,不能读取数据。The data is stored in the database of the ContentProvider, and other components can store the data in the set database through the URI. In this embodiment, permission control is added here to prevent other APPs from storing or reading the data. Other components cannot read data through URI. The URI service can only add data, but cannot read data.

具体的,数据服务的数据接收部分是由很多广播接收器和定时任务控制,收到数据后将数据push到数据处理模块的队列中一个一个处理,然后存储到数据库中进行保存。Specifically, the data receiving part of the data service is controlled by many broadcast receivers and timing tasks. After receiving the data, the data is pushed to the queue of the data processing module for processing one by one, and then stored in the database for preservation.

DataService存储数据时,可以对部分指定重要业务的数据进行汇总,例如汇总每个APP每天的流量消耗,或汇总出单台设备每天消耗的流量。除此之外,DataService会把数据分为明细、半汇总、汇总三个类型,这三个类型的重要等级分别为明细→低、半汇总→中、汇总→高,存储数据的数据等级会影响到数据存储及上传策略。When DataService stores data, it can summarize the data of some specified important services, such as summarizing the daily traffic consumption of each APP, or summarizing the daily traffic consumption of a single device. In addition, DataService divides data into three types: detailed, semi-aggregated, and aggregated. The importance levels of these three types are detailed→low, semi-aggregated→medium, aggregated→high. The data level of the stored data will affect the to data storage and upload policies.

为了方便本实施例封装了整个过程,其他App只需要调用相关的API 即可完成操作。For convenience, this embodiment encapsulates the entire process, and other apps only need to call related APIs to complete operations.

对于第一数据的存储方式,将采集的第一数据全部封装成DataBean的List集合,存储到ContentProvider中,可以批量存储,优选地,本实施例中,以服务端记录的时间为准,数据服务在开机后第一时间获取服务时间戳,服务器时间戳记录数据采集的时间,将当前时间到第二天凌晨0点之间采集的数据全部封装成DataBean的List集合,存储到ContentProvider中,可以批量存储。For the storage method of the first data, all the collected first data is encapsulated into the List collection of DataBean, and stored in the ContentProvider, which can be stored in batches. Preferably, in this embodiment, the time recorded by the server shall prevail, and the data service The service timestamp is obtained at the first time after booting, and the server timestamp records the time of data collection. All the data collected between the current time and 0:00 am the next day is encapsulated into the List collection of DataBean, which is stored in the ContentProvider, which can be batched. storage.

对于第二数据的存储方式,将其他第三方APP采集的数据,封装成固定的DataBean,通过DataServiceSDK存储到ContentProvider中。For the storage method of the second data, the data collected by other third-party APPs is encapsulated into a fixed DataBean and stored in the ContentProvider through the DataServiceSDK.

步骤205:数据服务将存储的数据上传到云端服务器。Step 205: The data service uploads the stored data to the cloud server.

本实施例中数据服务的工作流程如图3所示,本实施例分别对商米APP、第三方APP及其他APP运行时的数据进行采集,然后对采集数据标志等级,将采集的数据通过DataServiceSDK存储到内容提供者;DataService上传数据时,从内容提供者中获取数据,并通过上传策略和处理逻辑,将数据上传给云端服务器。图未示出对商米APP通过终端安装的唯一数据服务进行采集,而对第三方APP和其他APP则利用自身的采集功能,只是将采集后的数据通过DataServiceSDK存储到ContentProvider。The workflow of the data service in this embodiment is shown in Figure 3. In this embodiment, the data of Sunmi APP, third-party APP and other APPs are collected respectively, and then the collected data is marked with a grade, and the collected data is passed through the DataServiceSDK Store to the content provider; when DataService uploads data, it obtains the data from the content provider, and uploads the data to the cloud server through the upload strategy and processing logic. The figure does not show the collection of the only data service installed by the Sunmi APP through the terminal, while the third-party APP and other APPs use their own collection functions, and only store the collected data to the ContentProvider through the DataServiceSDK.

其中对数据的上传功能,由定时任务进行控制,本实施例通过Android的系统服务AlarmManager来提供定时任务,即使系统现在处于休眠状态也能被唤醒处理数据服务中的数据采集任务及数据上传服务,不仅保证了数据采集任务在设定的时间后准时运行,而且保证了数据上传时以服务器记录的时间为准,克服了目前数据产生的时间使用的是服务器时间,在获取app的当天的流量消耗时,却是以本地的时间区间去计算,因在本地时间和服务器时间不匹配时数据无法真实描述当天的流量消耗的情况。The data upload function is controlled by a timed task. In this embodiment, the Android system service AlarmManager provides a timed task. Even if the system is in a dormant state, it can be woken up to process the data collection task and data upload service in the data service. It not only ensures that the data collection task runs on time after the set time, but also ensures that the time recorded by the server shall prevail when the data is uploaded, which overcomes the current data generation time using the server time and the traffic consumption on the day when the app is obtained. However, it is calculated in the local time interval, because the data cannot truly describe the traffic consumption of the day when the local time and server time do not match.

AlarmManager服务启动后,会设置不同的定时任务和定时时间,到达定时时间后数据服务运行程序采集相关数据,唤醒AlarmManager是系统唤醒。After the AlarmManager service is started, different timing tasks and timings will be set. After the timing time is reached, the data service running program collects relevant data, and waking up the AlarmManager is the system wakeup.

实际应用中,每天凌晨1点后,选择一个随机时间开始从ContentProvider中根据一定的策略取出数据,如,每次取出1MB以内的数据通过Gzip压缩后发生Http请求上传,分多次进行直到所有都上传成功。In practical applications, after 1:00 am every day, select a random time to start extracting data from the ContentProvider according to a certain strategy, for example, every time the data within 1MB is extracted and compressed by Gzip, an Http request upload occurs, and it is performed in multiple times until all the Uploaded successfully.

如果上传失败,则再随机一段时间后重新上传,直至凌晨4点停止上传等明天凌晨。如果上传成功,将删除已经上传成功的数据。If the upload fails, it will be re-uploaded after a random period of time, and the upload will be stopped at 4:00 a.m. until the next morning. If the upload is successful, the data that has been uploaded successfully will be deleted.

本实施例中对于数据是否上传成功,提供了验证手段,上传结果会通过接口回调获取上传数据,实际中,如果在2分钟内无法获取就默认失败,此处的2分钟是作为举例说明,并不对实际中的时间值进行限制。In this embodiment, a verification method is provided for whether the data is uploaded successfully, and the upload result will be obtained through the interface callback. In practice, if the data cannot be obtained within 2 minutes, it will fail by default. The 2 minutes here is used as an example, and The actual time value is not limited.

本实施例提供的在凌晨1点到凌晨4点间上传数据的方式,根据机具空闲状态进行及时上传数据。与现有方案中在凌晨后设置固定时间,定时上传数据的方式相比,不会导致数据在后端显示的滞后性。该机具空闲状态是指终端闲置空闲未被使用的时候。In the method of uploading data between 1:00 am and 4:00 am provided in this embodiment, the data is uploaded in time according to the idle state of the implement. Compared with the method of setting a fixed time after the early morning and uploading data regularly in the existing solution, it will not cause the lag of data displayed in the backend. The idle state of the equipment refers to the time when the terminal is idle and not used.

本实施例的终端还提供了回收数据模块,如果囤积超过20MB的数据没有删除,则自动启动回收数据功能,将按照时间和数据等级将低优先级和早期的数据删除,保持总体数据在20MB以内。The terminal in this embodiment also provides a data recovery module. If the accumulated data exceeding 20MB is not deleted, the data recovery function will be automatically activated, and the low-priority and early data will be deleted according to time and data level, keeping the overall data within 20MB. .

另外,本实施例还提供了数据服务根据当前终端所处的网络状态和流量模式来综合选择上传策略,结合上传时间,以最小的资源占用、消耗来保证数据可以完整传到云端服务器。In addition, this embodiment also provides the data service to comprehensively select the upload strategy according to the current network state and traffic mode of the terminal, and combine the upload time to ensure that the data can be completely transmitted to the cloud server with minimum resource occupation and consumption.

其中,网络状态可以是网络连接类型,如wifi,有线,sim卡等。设备的流量模式可以是极省流量模式或无限制模式,如终端使用SIM卡且处于极省流量模式,DataService仅会上传汇总类数据,而终端处于极省流量模式且使用WIFI,DataService会上传所有等级数据。上传策略是上传前会根据网络状态和流量模式判断上传哪些数据,和要不要上传。Among them, the network status can be a network connection type, such as wifi, wired, sim card, etc. The traffic mode of the device can be the ultra-saving traffic mode or the unlimited mode. If the terminal uses a SIM card and is in the ultra-saving traffic mode, the DataService will only upload the summary data, while the terminal is in the ultra-saving traffic mode and using WIFI, the DataService will upload all the data. grade data. The upload strategy is to determine which data to upload and whether to upload it or not based on the network status and traffic pattern before uploading.

在此基础上,本实施例提供的上传策略除考虑终端所处的网络状态、流量模式之外,还可以结合存储数据的数据等级,在终端的网络状态、流量模式相同的情况下,优先将高等级的数据上传给云端服务器。On this basis, the upload policy provided in this embodiment not only considers the network state and traffic mode of the terminal, but also can combine the data level of the stored data. High-level data is uploaded to the cloud server.

本发明实施例提供的方法,终端仅运行一个数据服务,即DataService,该数据服务会在终端开机后运行,对终端自带应用程序运行时产生的第一数据进行记录,并存储在DataService的数据库,将终端安装的一般应用程序采集的第二数据,通过DataService的SDK存储到ContentProvider。对于第一数据和第二数据均封装成DataBean的List集合,存储到ContentProvider中。In the method provided by the embodiment of the present invention, the terminal only runs one data service, namely DataService, the data service will run after the terminal is powered on, record the first data generated when the terminal's own application program runs, and store it in the database of DataService , and store the second data collected by the general application installed on the terminal to the ContentProvider through the SDK of DataService. Both the first data and the second data are encapsulated into a List collection of DataBean and stored in the ContentProvider.

本实施例以服务端记录的时间为准,能够避免以本地时间区间计算数据,而数据产生时间是使用服务器时间,两者不匹配时产生无法真实描述当天的流量消耗的情况。This embodiment takes the time recorded by the server as the criterion, which can avoid calculating data in the local time interval, and the data generation time is the server time.

本实施例上传数据时,根据终端的网络状态和流量模式提供了上传策略,因而服务商可以根据自己需求进行数据上传,不再受单一上传策略的限制,有助于上传的数据动态适应网络状态。When uploading data in this embodiment, an upload strategy is provided according to the network state and traffic pattern of the terminal, so the service provider can upload data according to its own needs, and is no longer limited by a single upload strategy, which helps the uploaded data to dynamically adapt to the network state .

在一个实施例中,图4提供了一种数据服务装置的结构示意图,该数据服务装置包括唯一的数据服务301、数据服务SDK模块302和内容提供者303:In one embodiment, FIG. 4 provides a schematic structural diagram of a data service device, the data service device includes a unique data service 301, a data service SDK module 302 and a content provider 303:

数据服务301,用于采集终端自带的第一类应用程序运行时产生的第一数据;The data service 301 is used to collect the first data generated when the first type of application program that comes with the terminal is running;

数据服务SDK模块302连接数据服务模块301,用于将终端上安装的第二类应用程序运行时产生的第二数据发送给数据服务301;The data service SDK module 302 is connected to the data service module 301, and is used for sending the second data generated when the second type of application installed on the terminal is running to the data service 301;

内容提供者303连接数据服务301,用于将数据服务301采集的第一数据和第二数据进行存储。The content provider 303 is connected to the data service 301 for storing the first data and the second data collected by the data service 301 .

其中,该数据服务装置位于移动终端或智能终端上。Wherein, the data service device is located on a mobile terminal or an intelligent terminal.

图3的数据服务装置的其它功能和操作可以参照上面图1至图2的方法实施例的过程,为了避免重复,此处不再赘述。For other functions and operations of the data service apparatus in FIG. 3 , reference may be made to the processes of the method embodiments in FIG. 1 to FIG. 2 above, which will not be repeated here in order to avoid repetition.

本发明实施例提供的数据服务装置,根据终端运行的数据服务对终端自带应用程序运行时产生的数据进行记录并存储在DataService的数据库,并对终端安装的一般应用程序采集的数据,通过DataService的SDK存储在ContentProvider。The data service device provided by the embodiment of the present invention records the data generated when the terminal's own application is running according to the data service running on the terminal and stores it in the database of DataService, and collects the data of the general application installed on the terminal through the DataService. The SDK is stored in ContentProvider.

在一个实施例中,提供了一种终端的结构示意图,该终端包括上述实施例所述的任一数据服务装置;In one embodiment, a schematic structural diagram of a terminal is provided, where the terminal includes any of the data service apparatuses described in the foregoing embodiments;

该数据服务装置至少包括唯一的数据服务、数据服务SDK模块和内容提供者,数据服务用于采集终端自带的第一类应用程序运行时产生的第一数据;数据服务SDK模块将终端上安装的第二类应用程序运行时产生的第二数据发送给数据服务;内容提供者存储数据服务采集的第一数据和第二数据。The data service device at least includes a unique data service, a data service SDK module and a content provider. The data service is used to collect the first data generated when the first type of application program that comes with the terminal is running; the data service SDK module is installed on the terminal. The second data generated when the second type of application program runs is sent to the data service; the content provider stores the first data and the second data collected by the data service.

进一步的,该终端还包括数据回收模块,用于在内容提供者存储的数据达到一定阈值时,进行数据回收。Further, the terminal further includes a data recovery module for performing data recovery when the data stored by the content provider reaches a certain threshold.

具体的根据数据存储时间和数据等级进行数据回收,实际中,一般将低优先级的数据和/和存储时间较早的数据进行回收。Specifically, data recovery is performed according to the data storage time and data level. In practice, data with low priority and/or data with an earlier storage time are generally recovered.

实际中,该阈值可以为20MB,如果内容提供者的数据囤积超过20MB的数据没有删除,则自动启动回收数据功能,将按照时间和数据等级将低优先级和早期的数据删除,保持总体数据在20MB以内。In practice, the threshold can be 20MB. If the data hoarding of the content provider exceeds 20MB and the data is not deleted, the data recovery function will be automatically activated, and the low-priority and early data will be deleted according to the time and data level, keeping the overall data in the Within 20MB.

其中,该终端可以为智能终端,或移动终端,该终端能够运行android系统。Wherein, the terminal may be an intelligent terminal or a mobile terminal, and the terminal can run the android system.

本发明实施例提供的终端,根据终端运行的唯一数据服务对终端自带应用程序运行和安装的第三方应用程序运行时产生的数据进行采集、存储,并上传到云端服务器,通过唯一的数据服务完成数据采集存储操作,有助于减少终端后台服务运行的采集服务的数量,相比于目前对每个应用程序均集成第三方数据采集SDK,在设备后台服务运行多个采集服务,而大量占用CPU、内存资源的情况,本实施例不必占用大量CPU及内存资源,且能够加快设备的电量、流量消耗。The terminal provided by the embodiment of the present invention collects and stores the data generated when the terminal's own application program runs and the third-party application program installed by the terminal according to the unique data service running on the terminal, and uploads it to the cloud server, through the unique data service Completing the data collection and storage operation helps to reduce the number of collection services running in the terminal background service. Compared with the current integration of third-party data collection SDKs for each application, multiple collection services are run in the device background service, which consumes a large amount of In the case of CPU and memory resources, this embodiment does not need to occupy a large amount of CPU and memory resources, and can speed up the power consumption and traffic consumption of the device.

此外,本申请实施例还提供一种机器可读存储介质。该机器可读存储介质可以存储有可执行指令,可执行指令在被机器执行时使得机器实现上面参照图1至图2描述的方法实施例的具体过程。In addition, the embodiments of the present application further provide a machine-readable storage medium. The machine-readable storage medium may store executable instructions, which, when executed by the machine, cause the machine to implement the specific processes of the method embodiments described above with reference to FIGS. 1 to 2 .

例如,机器可读存储介质可以包括但不限于随机存取存储器(Random AccessMemory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦除可编程只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、静态随机存取存储器(Static Random Access Memory,SRAM)、硬盘、闪存等等。For example, a machine-readable storage medium may include, but is not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read-Only Memory, ROM), electrically-erasable programmable read-only memory (Electrically-Erasable Programmable Read-only memory) -Only Memory, EEPROM), static random access memory (Static Random Access Memory, SRAM), hard disk, flash memory, etc.

本领域技术人员可以明白的是,结合本文中所公开的实施例描述的各示例的单元及算法步骤能够以电子硬件、或者软件和电子硬件的结合来实现。这些功能是以硬件还是软件方式来实现,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以针对每个特定的应用,使用不同的方式来实现所描述的功能,但是这种实现并不应认为超出本申请的范围。It can be understood by those skilled in the art that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may implement the described functions in different ways for each specific application, but such implementations should not be considered beyond the scope of this application.

在本申请实施例中,所公开的系统、装置和方法可以通过其它方式来实现。例如,所述单元的划分仅仅为一种逻辑功能划分,在实际实现时还可以有另外的划分方式。例如,多个单元或组件可以进行组合或者可以集成到另一个系统中。另外,各个单元之间的耦合可以是直接耦合或间接耦合。另外,在本申请实施例中的各功能单元可以集成在一个处理单元中,也可以是单独的物理存在等等。In the embodiments of the present application, the disclosed systems, devices, and methods may be implemented in other manners. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system. In addition, the coupling between the various units may be direct coupling or indirect coupling. In addition, each functional unit in the embodiments of the present application may be integrated into one processing unit, or may exist independently physically, or the like.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在机器可读存储介质中。因此,本申请的技术方案可以以软件产品的形式来体现,该软件产品可以存储在机器可读存储介质中,其可以包括若干指令用以使得电子设备执行本申请实施例所描述的技术方案的全部或部分过程。上述存储介质可以包括ROM、RAM、可移动盘、硬盘、磁盘或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a machine-readable storage medium. Therefore, the technical solution of the present application may be embodied in the form of a software product, and the software product may be stored in a machine-readable storage medium, which may include several instructions to enable the electronic device to execute the technical solutions described in the embodiments of the present application. all or part of the process. The above-mentioned storage medium may include ROM, RAM, removable disks, hard disks, magnetic disks or optical disks and other mediums that can store program codes.

以上内容仅为本申请的具体实施方式,本申请的保护范围并不局限于此。本领域技术人员在本申请所公开的技术范围内可以进行变化或替换,这些变化或替换都应当在本申请的保护范围之内。The above contents are only specific embodiments of the present application, and the protection scope of the present application is not limited thereto. Those skilled in the art can make changes or substitutions within the technical scope disclosed in this application, and these changes or substitutions should all fall within the protection scope of this application.

Claims (15)

1. A data service method, wherein a unique data service is run on a terminal, the method comprising:
the data service acquires first data, wherein the first data comprises data generated when a first type of application program carried by the terminal runs;
the data service receives second data which are sent by the data service SDK and generated when a second type of application program installed on the terminal runs;
storing the first data and the second data.
2. The method of claim 1, wherein the first data further comprises basic information of a terminal, and wherein the second data comprises service data.
3. The method according to claim 1 or 2, wherein the storing the first data and the second data specifically comprises:
respectively packaging the first data and the second data into a DataBean format;
the packaged data is stored to the content provider.
4. The method of claim 3, further comprising:
and uploading the data stored by the content provider to a cloud server according to a preset uploading strategy and uploading time.
5. The method of claim 4, wherein the upload time comprises a locate upload time, the method further comprising:
providing timing acquisition time and timing uploading time according to timing service of the android system;
when the timing acquisition time is reached, starting the data service to acquire first data;
and when the timed uploading time is reached, uploading the data stored by the content provider to a cloud server according to the uploading strategy.
6. The method of claim 4, further comprising:
judging whether the uploaded data is uploaded successfully or not;
when the uploading failure is judged, triggering the uploading data to be uploaded again within the uploading time;
and triggering the content provider to delete the successfully uploaded data when judging that the uploading is successful.
7. The method according to claim 4, wherein the uploading policy is provided according to a network status and a traffic pattern of the terminal and/or a data level of stored data, and the uploading time is from 1 am to 4 am.
8. A data service arrangement, characterized in that the data service arrangement comprises a unique data service, a data service SDK module and a content provider,
the data service is used for acquiring first data generated when a first type of application program carried by the terminal runs;
the data service SDK module is connected with the data service module and used for sending second data generated when a second type of application program installed on the terminal runs to the data service;
the content provider is connected with the data service and used for storing the first data and the second data collected by the data service.
9. The apparatus of claim 8, wherein the data service further comprises an encapsulation module, connected to the content provider, for encapsulating the first data and the second data into DataBean format, respectively, and storing the encapsulated data to the content provider.
10. The apparatus according to claim 8 or 9, wherein the data service apparatus further comprises an uploading module, configured to upload the data stored by the content provider to a cloud server according to a predetermined uploading policy and uploading time.
11. The device according to claim 10, wherein the data service device further comprises a judging module, connected to the content provider, for judging whether the upload of the upload data is successful, and when the upload is unsuccessful, the data is triggered to be uploaded again within the upload time, and when the upload is successful, the content provider is triggered to delete the successfully uploaded data.
12. A terminal, characterized in that it comprises a data service device according to any of claims 8-11.
13. The terminal of claim 12, further comprising a data recycling module for recycling data when the data stored by the content provider of the data service device reaches a certain threshold.
14. The terminal of claim 13, wherein the data recovery module recovers data stored by a content provider of the data service device according to a storage time and a data level of the data when the data reaches a certain threshold.
15. A machine-readable storage medium having stored thereon executable instructions that when executed by a machine result in the implementation of a method according to any one of claims 1-7.
CN202010192955.7A 2020-03-18 2020-03-18 A data service method, data service device, terminal and machine-readable storage medium Pending CN111327711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010192955.7A CN111327711A (en) 2020-03-18 2020-03-18 A data service method, data service device, terminal and machine-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010192955.7A CN111327711A (en) 2020-03-18 2020-03-18 A data service method, data service device, terminal and machine-readable storage medium

Publications (1)

Publication Number Publication Date
CN111327711A true CN111327711A (en) 2020-06-23

Family

ID=71170038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010192955.7A Pending CN111327711A (en) 2020-03-18 2020-03-18 A data service method, data service device, terminal and machine-readable storage medium

Country Status (1)

Country Link
CN (1) CN111327711A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9038043B1 (en) * 2012-06-21 2015-05-19 Row Sham Bow, Inc. Systems and methods of information processing involving activity processing and/or optimization features
CN104899325A (en) * 2015-06-19 2015-09-09 上海卓悠网络科技有限公司 APP (application) acquired data collection method, terminal, server and system
CN105656714A (en) * 2015-12-25 2016-06-08 北京京东尚科信息技术有限公司 Data collection and reporting method and device of mobile device
CN106156212A (en) * 2015-04-22 2016-11-23 阿里巴巴集团控股有限公司 A kind of collecting method and system and terminal thereof and server
CN107018046A (en) * 2017-06-06 2017-08-04 上海鋆创信息技术有限公司 A kind of collecting method, device, terminal and storage medium
CN108134838A (en) * 2017-12-27 2018-06-08 广东欧珀移动通信有限公司 Data reporting method, device, mobile terminal and computer readable medium
CN108235308A (en) * 2017-12-27 2018-06-29 广东欧珀移动通信有限公司 data reporting method, device, mobile terminal and computer-readable medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9038043B1 (en) * 2012-06-21 2015-05-19 Row Sham Bow, Inc. Systems and methods of information processing involving activity processing and/or optimization features
CN106156212A (en) * 2015-04-22 2016-11-23 阿里巴巴集团控股有限公司 A kind of collecting method and system and terminal thereof and server
CN104899325A (en) * 2015-06-19 2015-09-09 上海卓悠网络科技有限公司 APP (application) acquired data collection method, terminal, server and system
CN105656714A (en) * 2015-12-25 2016-06-08 北京京东尚科信息技术有限公司 Data collection and reporting method and device of mobile device
CN107018046A (en) * 2017-06-06 2017-08-04 上海鋆创信息技术有限公司 A kind of collecting method, device, terminal and storage medium
CN108134838A (en) * 2017-12-27 2018-06-08 广东欧珀移动通信有限公司 Data reporting method, device, mobile terminal and computer readable medium
CN108235308A (en) * 2017-12-27 2018-06-29 广东欧珀移动通信有限公司 data reporting method, device, mobile terminal and computer-readable medium

Similar Documents

Publication Publication Date Title
TWI622933B (en) Client update method and device
US6697972B1 (en) Method for monitoring fault of operating system and application program
CN110244991B (en) Micro-service dependency analysis method and device
CN112860466B (en) Method and system for restarting fault diagnosis of in-vehicle entertainment system
WO2019051948A1 (en) Method, apparatus, server, and storage medium for processing monitoring data
CN102831035A (en) Information backup method and device
CN105204979A (en) Recording method of Android logs and mobile terminal
CN110309029A (en) Abnormal data collection method, device, computer equipment and storage medium
CN115658113A (en) Server self-starting method, device, readable storage medium and electronic equipment
CN110347571A (en) A kind of crash log acquisition method, analysis method and relevant apparatus
CN105357584A (en) User behavior log classification uploading method and system based on intelligent television
CN114882607B (en) Automatic card punching method and device, processor and electronic equipment
CN112799925A (en) Data acquisition method, apparatus, electronic device and readable storage medium
TW202109336A (en) Method and apparatus for upgrading system in internet of things device, device, and storage medium
CN110543398A (en) method and system for recording fault information
CN114650310B (en) Equipment control method and device based on Internet of things, electronic equipment and storage medium
CN112256451A (en) Timing service message generation method and device, electronic equipment and storage medium
CN115114249A (en) File management method and file management device
WO2017140154A1 (en) Method and system for security information management based on intelligent platform
CN111327711A (en) A data service method, data service device, terminal and machine-readable storage medium
CN102739423B (en) Method, apparatus and network management system for performance data acquisition
CN117215840A (en) Log storage method and device for terminal and kernel exception thereof, and readable storage medium
CN114449628B (en) Log data processing method, electronic device and medium thereof
CN113992644B (en) Internet of things system based on no-service technology and data processing method thereof
CN111382380A (en) Statistical method and device for page access duration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination