CN110377235B - Data processing method and device, mobile terminal and computer readable storage medium - Google Patents
Data processing method and device, mobile terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN110377235B CN110377235B CN201910681397.8A CN201910681397A CN110377235B CN 110377235 B CN110377235 B CN 110377235B CN 201910681397 A CN201910681397 A CN 201910681397A CN 110377235 B CN110377235 B CN 110377235B
- Authority
- CN
- China
- Prior art keywords
- data
- stored
- rate
- cache region
- server
- 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.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0656—Data buffering arrangements
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请属于数据处理技术领域,尤其涉及一种数据处理方法、装置、移动终端及计算机可读存储介质。The present application belongs to the technical field of data processing, and in particular relates to a data processing method, device, mobile terminal and computer-readable storage medium.
背景技术Background technique
随着通信技术的发展,手机、平板电脑等移动终端的功能越来越多,例如拍摄教学、会议等大容量视频、较长时间录音、拍摄大容量照片等,对移动终端的存储要求较高,要求移动终端具有较大的存储空间,较低容量的存储空间无法满足大容量数据的存储。With the development of communication technology, mobile terminals such as mobile phones and tablet computers have more and more functions, such as shooting large-capacity videos such as teaching and conferences, recording for a long time, and taking large-capacity photos, etc., which have higher storage requirements for mobile terminals. , the mobile terminal is required to have a larger storage space, and a lower-capacity storage space cannot meet the storage of large-capacity data.
发明内容Contents of the invention
本申请实施例提供了一种数据处理方法、装置、移动终端及计算机可读存储介质,可以解决现有技术对移动终端的存储空间要求较高的问题。Embodiments of the present application provide a data processing method, device, mobile terminal, and computer-readable storage medium, which can solve the problem of relatively high storage space requirements for mobile terminals in the prior art.
第一方面,本申请实施例提供了一种数据处理方法,所述数据处理方法包括:In the first aspect, the embodiment of the present application provides a data processing method, the data processing method comprising:
获取待存储数据;Obtain the data to be stored;
将所述待存储数据写入缓存区;writing the data to be stored into a cache;
在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。When writing the data to be stored into the cache area, upload the data stored in the cache area to the server, and delete the data stored in the cache area that has been uploaded to the server.
第二方面,本申请实施例提供了一种数据处理装置,所述数据处理装置包括:In a second aspect, an embodiment of the present application provides a data processing device, and the data processing device includes:
数据获取模块,用于获取待存储数据;A data acquisition module, configured to acquire data to be stored;
数据写入模块,用于将所述待存储数据写入缓存区;A data writing module, configured to write the data to be stored into a cache area;
数据处理模块,用于在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。A data processing module, configured to upload the data stored in the cache to the server when writing the data to be stored into the cache, and delete the data stored in the cache that has been uploaded to the server data.
第三方面,本申请实施例提供了一种移动终端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的数据处理方法。In a third aspect, an embodiment of the present application provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, Realize the data processing method as described in the first aspect above.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的数据处理方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing as described in the first aspect above is implemented method.
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行上述第一方面中任一项所述的数据处理方法。In a fifth aspect, an embodiment of the present application provides a computer program product, which, when the computer program product is run on a mobile terminal, enables the mobile terminal to execute the data processing method described in any one of the above first aspects.
本申请方案先获取待存储数据,再将待存储数据写入缓存区,在将待存储数据写入缓存区的同时,将缓存区中存储的数据上传至服务器,并删除缓存区中存储的已上传至服务器的数据,通过同步写入、上传、删除来释放移动终端的存储空间,将大容量数据上传至服务器,而不占用移动终端的存储空间,无需考虑移动终端的存储空间的限制,降低了对移动终端的存储空间的要求。The application scheme first obtains the data to be stored, and then writes the data to be stored into the buffer area. When writing the data to be stored into the buffer area, uploads the data stored in the buffer area to the server and deletes the stored The data uploaded to the server releases the storage space of the mobile terminal through synchronous writing, uploading, and deletion, and uploads large-capacity data to the server without occupying the storage space of the mobile terminal, without considering the limitation of the storage space of the mobile terminal, reducing Requirements for the storage space of the mobile terminal.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only for the present application For some embodiments, those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative efforts.
图1是本申请一实施例提供的数据处理方法所适用于的手机的结构示意图;FIG. 1 is a schematic structural diagram of a mobile phone to which a data processing method provided by an embodiment of the present application is applicable;
图2是本申请一实施例提供的数据处理方法的所适用于的手机的软件架构示意图;Fig. 2 is a schematic diagram of the software architecture of the mobile phone to which the data processing method provided by an embodiment of the present application is applicable;
图3是本申请一实施例提供的数据处理系统的网络结构示意图;FIG. 3 is a schematic diagram of a network structure of a data processing system provided by an embodiment of the present application;
图4是本申请一实施例提供的数据处理方法的流程示意图;Fig. 4 is a schematic flow chart of a data processing method provided by an embodiment of the present application;
图5是本申请另一实施例提供的数据处理方法的流程示意图;FIG. 5 is a schematic flowchart of a data processing method provided by another embodiment of the present application;
图6是本申请又一实施例提供的数据处理方法的流程示意图;FIG. 6 is a schematic flowchart of a data processing method provided in another embodiment of the present application;
图7是本申请一实施例提供的数据处理装置的结构示意图;Fig. 7 is a schematic structural diagram of a data processing device provided by an embodiment of the present application;
图8是本申请一实施例提供的移动终端的结构示例图;FIG. 8 is a structural example diagram of a mobile terminal provided by an embodiment of the present application;
图9是本申请一实施例提供的移动终端的结构示意图。Fig. 9 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other Presence or addition of features, wholes, steps, operations, elements, components and/or collections thereof.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
本申请实施例提供的数据处理方法可以应用于手机、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对移动终端的具体类型不作任何限制。The data processing method provided by the embodiment of the present application can be applied to terminal devices such as mobile phones, tablet computers, notebook computers, ultra-mobile personal computers (ultra-mobile personal computer, UMPC), netbooks, and personal digital assistants (personal digital assistant, PDA). , the embodiment of the present application does not impose any limitation on the specific type of the mobile terminal.
以所述移动终端为手机为例。图1示出的是与本申请实施例提供的手机的部分结构的框图。参考图1,手机包括:射频(Radio Frequency,RF)电路110、存储器120、输入单元130、显示单元140、传感器150、音频电路160、无线保真(wireless fidelity,WiFi)模块170、处理器180、以及电源190等部件。本领域技术人员可以理解,图1中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Take the mobile terminal as an example. FIG. 1 shows a block diagram of a partial structure of a mobile phone provided by an embodiment of the present application. With reference to Fig. 1, mobile phone comprises: radio frequency (Radio Frequency, RF)
下面结合图1对手机的各个构成部件进行具体的介绍:The following is a specific introduction to each component of the mobile phone in combination with Figure 1:
RF电路110可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器180处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low NoiseAmplifier,LNA)、双工器等。此外,RF电路110还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GlobalSystem of Mobile communication,GSM)、通用分组无线服务(General Packet RadioService,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。The
存储器120可用于存储软件程序以及模块,处理器180通过运行存储在存储器120的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器120可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The
输入单元130可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元130可包括触控面板131以及其他输入设备132。触控面板131,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板131上或在触控面板131附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板131可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板131。除了触控面板131,输入单元130还可以包括其他输入设备132。具体地,其他输入设备132可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The
显示单元140可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元140可包括显示面板141,可选的,可以采用液晶显示器(Liquid CrystalDisplay,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板141。进一步的,触控面板131可覆盖显示面板141,当触控面板131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图1中,触控面板131与显示面板141是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板131与显示面板141集成而实现手机的输入和输出功能。The
手机还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在手机移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The handset may also include at least one
音频电路160、扬声器161,传声器162可提供用户与手机之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,传声器162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一手机,或者将音频数据输出至存储器120以便进一步处理。The
WiFi属于短距离无线传输技术,手机通过WiFi模块170可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图1示出了WiFi模块170,但是可以理解的是,其并不属于手机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-distance wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages, and access streaming media through the
处理器180是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理单元;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。The
手机还包括给各个部件供电的电源190(比如电池),优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the
尽管未示出,手机还可以包括摄像头。可选地,摄像头在手机的上的位置可以为前置的,也可以为后置的,本申请实施例对此不作限定。Although not shown, the phone may also include a camera. Optionally, the position of the camera on the mobile phone may be front or rear, which is not limited in this embodiment of the present application.
可选地,手机可以包括单摄像头、双摄像头或三摄像头等,本申请实施例对此不作限定。Optionally, the mobile phone may include a single camera, dual cameras, or triple cameras, etc., which is not limited in this embodiment of the present application.
例如,手机可以包括三摄像头,其中,一个为主摄像头、一个为广角摄像头、一个为长焦摄像头。For example, a mobile phone may include three cameras, wherein one is a main camera, one is a wide-angle camera, and one is a telephoto camera.
可选地,当手机包括多个摄像头时,这多个摄像头可以全部前置,或者全部后置,或者一部分前置、另一部分后置,本申请实施例对此不作限定。Optionally, when the mobile phone includes multiple cameras, all of the multiple cameras may be front-mounted, or all rear-mounted, or a part may be front-mounted and another part may be rear-mounted, which is not limited in this embodiment of the present application.
另外,尽管未示出,手机还可以包括蓝牙模块等,在此不再赘述。In addition, although not shown, the mobile phone may also include a bluetooth module, etc., which will not be repeated here.
图2是本申请实施例的手机的软件结构示意图。以手机操作系统为Android系统为例,在一些实施例中,将Android系统分为四层,分别为应用程序层、应用程序框架层(framework,FWK)、系统层以及硬件抽象层,层与层之间通过软件接口通信。Fig. 2 is a schematic diagram of the software structure of the mobile phone according to the embodiment of the present application. Taking the mobile phone operating system as the Android system as an example, in some embodiments, the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer (framework, FWK), the system layer and the hardware abstraction layer, and the layer and layer communicate with each other through a software interface.
如图2所示,所述应用程序层可以一系列应用程序包,应用程序包可以包括短信息,日历,相机,视频,导航,图库,通话等应用程序。As shown in FIG. 2, the application layer can be a series of application packages, and the application packages can include short message, calendar, camera, video, navigation, gallery, call and other applications.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层可以包括一些预先定义的函数,例如用于接收应用程序框架层所发送的事件的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer may include some predefined functions, such as functions for receiving events sent by the application framework layer.
如图2所示,应用程序框架层可以包括窗口管理器、资源管理器以及通知管理器等。As shown in FIG. 2, the application framework layer may include a window manager, a resource manager, a notification manager, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. Content providers are used to store and retrieve data and make it accessible to applications. Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
应用程序框架层还可以包括:The application framework layer can also include:
视图系统,所述视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。A view system, where the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and the like. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供手机的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication functions of the mobile phone. For example, the management of call status (including connected, hung up, etc.).
系统层可以包括多个功能模块。例如:传感器服务模块,物理状态识别模块,三维图形处理库(例如:OpenGL ES)等。The system layer can include multiple functional modules. For example: sensor service module, physical state recognition module, 3D graphics processing library (for example: OpenGL ES), etc.
传感器服务模块,用于对硬件层各类传感器上传的传感器数据进行监测,确定手机的物理状态;The sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer and determine the physical state of the mobile phone;
物理状态识别模块,用于对用户手势、人脸等进行分析和识别;The physical state recognition module is used to analyze and recognize user gestures, faces, etc.;
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
系统层还可以包括:The system layer can also include:
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
硬件抽象层是硬件和软件之间的层。硬件抽象层可以包括显示驱动,摄像头驱动,传感器驱动等,用于驱动硬件层的相关硬件,如显示屏、摄像头、传感器等。The Hardware Abstraction Layer is the layer between hardware and software. The hardware abstraction layer can include display drivers, camera drivers, sensor drivers, etc., used to drive related hardware at the hardware layer, such as display screens, cameras, sensors, etc.
以下实施例可以在具有上述硬件结构/软件结构的手机上实现。以下实施例将以手机为例,对本申请实施例提供的数据处理方法进行说明。The following embodiments can be implemented on a mobile phone with the above hardware structure/software structure. The following embodiments will use a mobile phone as an example to describe the data processing method provided in the embodiments of the present application.
参见图3,是本申请一实施例提供的数据处理系统的网络架构示意图,为了便于说明,仅示出了与本申请实施例相关的部分。Referring to FIG. 3 , it is a schematic diagram of a network architecture of a data processing system provided by an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
如图3所示,所述数据处理系统包括移动终端31以及服务器32。移动终端31与服务器32之间可以通过有线或者无线的方式连接通信。其中,服务器32可以是单一的服务器,也可以为由多个功能服务器共同组成的服务器。As shown in FIG. 3 , the data processing system includes a
为了解决现有技术对移动终端的存储空间要求较高的问题。本申请实施例移动终端31获取待存储数据;并将所述待存储数据写入缓存区;在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器32,并删除所述缓存区中存储的已上传至所述服务器32的数据。In order to solve the problem in the prior art that the storage space of the mobile terminal is relatively high. In the embodiment of the present application, the
可选的,本申请实施例还包括:Optionally, the embodiment of this application also includes:
移动终端31获取将所述待存储数据写入所述缓存区时的写入速率以及将所述缓存区中存储的数据上传至所述服务器时的上传速率;根据所述写入速率和所述上传速率,调整所述缓存区的容量。The
可选的,移动终端31比较所述写入速率和所述上传速率;若所述写入速率小于或等于所述上传速率,则计算所述缓存区的容量的初始值L=K*t1,并将所述缓存区的容量调整至所述初始值,其中,K为所述写入速率,t1为大于零的数;若所述写入速率K大于所述上传速率G,则计算所述缓存区的容量的目标值H=(K-G)*(T+t1),其中,G为所述上传速率,T为大于零的数;比较所述目标值和所述初始值;若所述目标值大于或等于所述初始值,则将所述缓存区的容量调整至所述目标值;若所述目标值小于所述初始值,则将所述缓存区的容量调整至所述初始值。Optionally, the
可选的,移动终端31根据预设时间间隔T,获取所述写入速率和所述上传速率。Optionally, the
可选的,本申请实施例还包括:Optionally, the embodiment of this application also includes:
移动终端31当检测到所述缓存区中存储的数据已全部上传至所述服务器且无数据写入所述缓存区时,停止获取所述写入速率和所述上传速率。When the
可选的,移动终端31根据先进先出原则,将所述缓存区中存储的数据上传至所述服务器。Optionally, the
可选的,若移动终端31处于预设场景,则在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。Optionally, if the
为了更好地理解本申请实施例,下面通过一个具体的应用场景来说明本申请实施例:In order to better understand the embodiment of the present application, the following describes the embodiment of the present application through a specific application scenario:
移动终端31在拍摄大容量视频时,获取待存储的视频数据,并将待存储的视频数据写入移动终端31的缓存区,在写入移动终端31的缓存区的同时,将移动终端31的缓存区中存储的视频数据上传至服务器32,并删除移动终端31的缓存区中已上传至服务器32的视频数据。The
从上述应用场景可以看出本申请实施例通过同步写入、上传、删除来释放移动终端31的存储空间,将大容量视频数据上传至服务器32,而不占用移动终端31的存储空间,无需考虑移动终端31的存储空间的限制,降低了对移动终端31的存储空间的要求。It can be seen from the above application scenarios that the embodiment of the present application releases the storage space of the
另外,本申请实施例提供的应用场景用于解释本申请,并不限定本申请的保护范围。In addition, the application scenarios provided in the embodiments of the present application are used to explain the present application, and do not limit the protection scope of the present application.
参见图4,是本申请一实施例提供的数据处理方法的流程示意图,如图所示该数据处理方法可以包括以下步骤:Referring to FIG. 4 , it is a schematic flow chart of a data processing method provided by an embodiment of the present application. As shown in the figure, the data processing method may include the following steps:
步骤S401,获取待存储数据。Step S401, acquiring data to be stored.
在本申请实施例中,待存储数据可以是指待存储的任意数据,例如移动终端接收到的其他设备所发送的数据、移动终端从网络下载的数据、移动终端所拍摄的视频、所拍摄的照片、所录声音等。In this embodiment of the application, the data to be stored may refer to any data to be stored, such as data sent by other devices received by the mobile terminal, data downloaded by the mobile terminal from the network, videos taken by the mobile terminal, photos, recorded sounds, etc.
步骤S402,将所述待存储数据写入缓存区。Step S402, writing the data to be stored into a cache area.
在本申请实施例中,缓存区是移动终端的存储空间的一部分,即将移动终端的存储器的一部分作为缓存区,例如移动终端的存储器的存储空间为16G,可以分配1G作为缓存区。In the embodiment of the present application, the cache area is a part of the storage space of the mobile terminal, that is, a part of the memory of the mobile terminal is used as the cache area. For example, the storage space of the memory of the mobile terminal is 16G, and 1G can be allocated as the cache area.
步骤S403,在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。Step S403, when writing the data to be stored into the cache, upload the data stored in the cache to the server, and delete the data stored in the cache that has been uploaded to the server.
在本申请实施例中,在将待存储数据写入缓存区的同时,对缓存区中存储的数据进行上传及删除操作,以实现随传随删,删除缓存区中已上传的数据,释放缓存区的存储空间。In the embodiment of the present application, while the data to be stored is written into the buffer area, the data stored in the buffer area is uploaded and deleted, so as to realize uploading and deleting at the same time, delete the uploaded data in the buffer area, and release the cache area storage space.
本申请实施例通过同步写入、上传、删除来释放移动终端的存储空间,将大容量数据上传至服务器,而不占用移动终端的存储空间,无需考虑移动终端的存储空间的限制,降低了对移动终端的存储空间的要求。The embodiment of the present application releases the storage space of the mobile terminal by synchronously writing, uploading, and deleting, and uploads large-capacity data to the server without occupying the storage space of the mobile terminal. The storage space requirement of the mobile terminal.
参见图5,是本申请一实施例提供的数据处理方法的实现流程示意图,如图所示该数据处理方法可以包括以下步骤:Referring to FIG. 5 , it is a schematic diagram of the implementation flow of a data processing method provided by an embodiment of the present application. As shown in the figure, the data processing method may include the following steps:
步骤S501,获取待存储数据。Step S501, acquiring data to be stored.
该步骤与步骤S401相同,具体可参见步骤S401的相关描述,在此不再赘述。This step is the same as step S401, for details, please refer to the relevant description of step S401, which will not be repeated here.
步骤S502,将所述待存储数据写入缓存区。Step S502, writing the data to be stored into a cache area.
该步骤与步骤S402相同,具体可参见步骤S403的相关描述,在此不再赘述。This step is the same as step S402, for details, please refer to the relevant description of step S403, which will not be repeated here.
步骤S503,在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。Step S503, when writing the data to be stored into the cache, upload the data stored in the cache to the server, and delete the data stored in the cache that has been uploaded to the server.
该步骤与步骤S403相同,具体可参见步骤S403的相关描述,在此不再赘述。This step is the same as step S403, for details, please refer to the relevant description of step S403, which will not be repeated here.
步骤S504,获取将所述待存储数据写入所述缓存区时的写入速率以及将所述缓存区中存储的数据上传至所述服务器时的上传速率。Step S504, obtaining the writing rate when the data to be stored is written into the cache area and the upload rate when uploading the data stored in the cache area to the server.
其中,写入速率可以是指将待存储数据写入缓存区时的速率,例如单位时间内将待存储数据写入缓存区的数据量(例如比特数)。上传速率可以是指将缓存区中存储的数据上传至服务器时的速率,例如单位时间内将缓存区中存储的数据上传至服务器的数据量。需要说明的是,其他计算写入速率和上传速率的方法也在本申请的保护范围内。Wherein, the writing rate may refer to the rate at which the data to be stored is written into the cache area, for example, the data volume (eg, the number of bits) of the data to be stored into the cache area per unit time. The upload rate may refer to the rate at which the data stored in the cache area is uploaded to the server, for example, the amount of data stored in the cache area uploaded to the server per unit time. It should be noted that other methods for calculating the writing rate and the uploading rate are also within the protection scope of the present application.
可选的,所述获取将所述待存储数据写入所述缓存区时的写入速率以及将所述缓存区中存储的数据上传至所述服务器时的上传速率包括:Optionally, the obtaining the write rate when the data to be stored is written into the cache area and the upload rate when the data stored in the cache area is uploaded to the server includes:
根据预设时间间隔T,获取所述写入速率和所述上传速率。According to a preset time interval T, the writing rate and the uploading rate are acquired.
在本申请实施例中,由于移动终端的网络环境不稳定,上传速率可能发生变化,写入速率也可能由于移动终端的数据处理性能发生变化而变化,通过周期性地获取写入速率和上传速率可以周期性地检测缓存区的容量分配是否合理。其中,预设时间间隔T可以是指获取写入速率和上传速率的周期,即,重新分配缓存区的周期,用户可以根据实际需要自行设定预设时间间隔T,也可以根据移动终端所连接网络的类型设定预设时间间隔T,例如在移动终端所连接网络的类型为WLAN时,移动终端的上传速率较为固定,可以适当延长预设时间间隔T(如设定为T1);在移动终端所连接网络的类型为数据网络时,移动终端的上传速率变化大,可以缩短预设时间间隔T(例如设定为T2,且T2小于T1)。In this embodiment of the application, due to the unstable network environment of the mobile terminal, the upload rate may change, and the write rate may also change due to changes in the data processing performance of the mobile terminal. By periodically obtaining the write rate and upload rate It is possible to periodically check whether the capacity allocation of the cache area is reasonable. Wherein, the preset time interval T may refer to the cycle of obtaining the write rate and the upload rate, that is, the cycle of reallocating the buffer area. The user can set the preset time interval T by himself according to actual needs, or according to The type of network sets the preset time interval T. For example, when the type of network connected to the mobile terminal is WLAN, the upload rate of the mobile terminal is relatively fixed, and the preset time interval T can be appropriately extended (such as set to T1); When the type of network connected to the terminal is a data network, the upload rate of the mobile terminal varies greatly, and the preset time interval T can be shortened (for example, set to T2, and T2 is smaller than T1).
可选的,本申请实施例还包括:Optionally, the embodiment of this application also includes:
当检测到所述缓存区中存储的数据已全部上传至所述服务器且无数据写入所述缓存区时,停止获取所述写入速率和所述上传速率。Stop acquiring the write rate and the upload rate when it is detected that all the data stored in the buffer has been uploaded to the server and no data is written into the buffer.
以移动终端进行大容量视频拍摄为例,当检测到缓存区中存储的视频数据均已上传至服务器且预设时间内无新的视频数据写入(即视频采集结束)时,停止获取写入速率和上传速率,否则根据预设时间间隔继续获取写入速率和上传速率。Taking large-capacity video shooting on a mobile terminal as an example, when it is detected that the video data stored in the cache area has been uploaded to the server and no new video data is written within the preset time (that is, the video capture ends), stop acquiring and writing rate and upload rate, otherwise continue to get the write rate and upload rate according to the preset time interval.
步骤S505,根据所述写入速率和所述上传速率,调整所述缓存区的容量。Step S505, adjusting the capacity of the cache area according to the writing rate and the uploading rate.
在本申请实施例中,根据写入速率和上传速率调整缓存区的容量,可以合理地分配缓存区的大小,避免分配过小导致写入空间受限而无法及时写入,也避免分配过大导致存储空间浪费,例如,在上传速率较大时可以缩小缓存区,避免缓存区的存储空间浪费,在上传速率较小时可以加大缓存区,避免写入空间受限。其中,缓存区的容量可以是缓存区的大小,例如移动终端的存储器的存储空间为16G,可以分配1G作为缓存区,那么缓存区的容量即为1G。In the embodiment of this application, the capacity of the buffer area is adjusted according to the writing rate and uploading rate, so that the size of the buffer area can be allocated reasonably, so as to avoid the limited writing space caused by too small allocation and unable to write in time, and also avoid too large allocation This leads to waste of storage space. For example, when the upload rate is high, the buffer area can be reduced to avoid wasting storage space in the buffer area. When the upload rate is low, the buffer area can be enlarged to avoid limited writing space. Wherein, the capacity of the buffer area may be the size of the buffer area. For example, the storage space of the memory of the mobile terminal is 16G, and 1G may be allocated as the buffer area, so the capacity of the buffer area is 1G.
可选的,所述根据所述写入速率和所述上传速率,调整所述缓存区的容量;Optionally, adjusting the capacity of the cache area according to the writing rate and the uploading rate;
比较所述写入速率和所述上传速率;comparing said write rate with said upload rate;
若所述写入速率小于或等于所述上传速率,则计算所述缓存区的容量的初始值L=K*t1,并将所述缓存区的容量调整至所述初始值,其中,K为所述写入速率,t1为大于零的数;If the write rate is less than or equal to the upload rate, then calculate the initial value L=K*t1 of the capacity of the buffer area, and adjust the capacity of the buffer area to the initial value, where K is The write rate, t1 is a number greater than zero;
若所述写入速率大于所述上传速率,则计算所述缓存区的容量的目标值H=(K-G)*(T+t1),其中,G为所述上传速率,T为大于零的数;If the write rate is greater than the upload rate, then calculate the target value H=(K-G)*(T+t1) of the capacity of the buffer area, where G is the upload rate, and T is a number greater than zero ;
比较所述目标值和所述初始值;comparing said target value with said initial value;
若所述目标值大于或等于所述初始值,则将所述缓存区的容量调整至所述目标值;If the target value is greater than or equal to the initial value, adjusting the capacity of the buffer area to the target value;
若所述目标值小于所述初始值,则将所述缓存区的容量调整至所述初始值。If the target value is smaller than the initial value, adjusting the capacity of the buffer area to the initial value.
其中,T为获取写入速率和上传速率的预设时间间隔。t1为大于零的常数,可以根据实际需要自行设定,例如30s。Wherein, T is a preset time interval for obtaining the writing rate and the uploading rate. t1 is a constant greater than zero, which can be set according to actual needs, for example, 30s.
在本申请实施例中,当移动终端的写入速率小于移动终端的上传速率时,说明移动终端的上传速率较快,将缓存区的容量设置为初始值,可以缩小缓存区的容量;当移动终端的写入速率大于移动终端的上传速率时,说明移动终端的上传速率较慢,需要加大缓存区的容量,比较目标值和初始值,将缓存区的容量设置为两者中的较大值。In the embodiment of the present application, when the writing rate of the mobile terminal is lower than the uploading rate of the mobile terminal, it means that the uploading rate of the mobile terminal is faster, and setting the capacity of the buffer area as the initial value can reduce the capacity of the buffer area; When the write rate of the terminal is greater than the upload rate of the mobile terminal, it means that the upload rate of the mobile terminal is relatively slow, and the capacity of the buffer area needs to be increased. Compare the target value and the initial value, and set the capacity of the buffer area to the larger of the two value.
本申请实施例通过对待处理数据进行写入、上传的过程中,周期性地读取移动终端的写入速率和上传速率,可以实时调整缓存区的容量,合理地分配缓存区的大小,避免分配过小导致写入空间受限而无法及时写入,也避免分配过大导致存储空间浪费。In the embodiment of the present application, during the process of writing and uploading the data to be processed, periodically reading the writing rate and uploading rate of the mobile terminal, the capacity of the buffer area can be adjusted in real time, and the size of the buffer area can be reasonably allocated to avoid allocation. If it is too small, the writing space is limited and cannot be written in time, and it also avoids the waste of storage space caused by too large allocation.
参见图6,是本申请一实施例提供的数据处理方法的实现流程示意图,如图所示该数据处理方法可以包括以下步骤:Referring to FIG. 6 , it is a schematic diagram of the implementation flow of a data processing method provided by an embodiment of the present application. As shown in the figure, the data processing method may include the following steps:
步骤S601,获取待存储数据。Step S601, acquiring data to be stored.
该步骤与步骤S401相同,具体可参见步骤S401的相关描述,在此不再赘述。This step is the same as step S401, for details, please refer to the relevant description of step S401, which will not be repeated here.
步骤S602,将所述待存储数据写入缓存区。Step S602, writing the data to be stored into a cache area.
该步骤与步骤S402相同,具体可参见步骤S402的相关描述,在此不再赘述。This step is the same as step S402, for details, please refer to the relevant description of step S402, which will not be repeated here.
步骤S603,若移动终端处于预设场景,则在将所述待存储数据写入所述缓存区时,根据先进先出原则将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。Step S603, if the mobile terminal is in a preset scene, when writing the data to be stored into the cache, upload the data stored in the cache to the server according to the first-in-first-out principle, and delete the cache data stored in the zone that has been uploaded to the server.
在本申请实施例中,移动终端在初次获取到待存储数据时,将待存储数据写入缓存区,当检测到缓存区满且再次获取到数据时,判定移动终端处于预设场景。其中,预设场景可以是指待存储的数据的大小超过缓存区的容量的初始值的场景,即大容量数据接收场景,例如拍摄大容量视频、大容量照片或者大容量录音等。例如,移动终端启动拍摄功能时,先将获取到的视频数据写入缓存区,当检测到缓存区满且再次获取到视频数据时,判定移动终端处于大容量视频接收场景,即移动终端处于预设场景。In the embodiment of the present application, when the mobile terminal acquires the data to be stored for the first time, it writes the data to be stored into the buffer area, and when it detects that the buffer area is full and acquires the data again, it determines that the mobile terminal is in a preset scene. Wherein, the preset scene may refer to a scene in which the size of the data to be stored exceeds the initial value of the buffer capacity, that is, a large-capacity data receiving scene, such as shooting a large-capacity video, a large-capacity photo, or a large-capacity recording. For example, when the mobile terminal starts the shooting function, it first writes the acquired video data into the buffer area, and when it detects that the buffer area is full and acquires the video data again, it is determined that the mobile terminal is in a large-capacity video receiving scene, that is, the mobile terminal is in the pre-set mode. set the scene.
在本申请实施例中,先进先出原则可以是指按照数据写入缓存区的顺序将数据上传至服务器,即先写入缓存区就先上传至服务器。In this embodiment of the present application, the first-in-first-out principle may refer to uploading data to the server in the order in which data is written into the buffer area, that is, uploading data to the server first after writing into the buffer area.
步骤S604,获取将所述待存储数据写入所述缓存区时的写入速率以及将所述缓存区中存储的数据上传至所述服务器时的上传速率。Step S604, obtaining the writing rate when the data to be stored is written into the cache area and the upload rate when uploading the data stored in the cache area to the server.
该步骤与步骤S504相同,具体可参见步骤S504的相关描述,在此不再赘述。This step is the same as step S504, for details, please refer to the relevant description of step S504, which will not be repeated here.
步骤S605,根据所述写入速率和所述上传速率,调整所述缓存区的容量。Step S605, adjusting the capacity of the cache area according to the writing rate and the uploading rate.
该步骤与步骤S505相同,具体可参见步骤S505的相关描述,在此不再赘述。This step is the same as step S505, for details, please refer to the related description of step S505, which will not be repeated here.
本申请实施例在移动终端处于大容量数据接收场景时,可以通过同步写入、上传、删除来释放移动终端的存储空间,将大容量数据上传至服务器,而不占用移动终端的存储空间,无需考虑移动终端的存储空间的限制,降低了对移动终端的存储空间的要求。In the embodiment of the present application, when the mobile terminal is in a large-capacity data receiving scene, the storage space of the mobile terminal can be released through synchronous writing, uploading, and deletion, and the large-capacity data can be uploaded to the server without occupying the storage space of the mobile terminal. Considering the limitation of the storage space of the mobile terminal, the requirement on the storage space of the mobile terminal is reduced.
参见图7,是本申请一实施例提供的数据处理装置的结构示意图,为了便于说明,仅示出了与本申请实施例相关的部分。Referring to FIG. 7 , it is a schematic structural diagram of a data processing device provided by an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
所述数据处理装置包括:The data processing device includes:
数据获取模块71,用于获取待存储数据;A
数据写入模块72,用于将所述待存储数据写入缓存区;A
数据处理模块73,用于在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。The
可选的,所述数据处理装置还包括:Optionally, the data processing device also includes:
速率获取模块74,用于获取将所述待存储数据写入所述缓存区时的写入速率以及将所述缓存区中存储的数据上传至所述服务器时的上传速率;A
容量调整模块75,用于根据所述写入速率和所述上传速率,调整所述缓存区的容量。A
可选的,所述容量调整模块75具体用于:Optionally, the
比较所述写入速率和所述上传速率;comparing said write rate with said upload rate;
若所述写入速率小于或等于所述上传速率,则计算所述缓存区的容量的初始值L=K*t1,并将所述缓存区的容量调整至所述初始值,其中,K为所述写入速率,t1为大于零的数;If the write rate is less than or equal to the upload rate, then calculate the initial value L=K*t1 of the capacity of the buffer area, and adjust the capacity of the buffer area to the initial value, where K is The writing rate, t1 is a number greater than zero;
若所述写入速率大于所述上传速率,则计算所述缓存区的容量的目标值H=(K-G)*(T+t1),其中,G为所述上传速率,T为大于零的数;If the write rate is greater than the upload rate, then calculate the target value H=(K-G)*(T+t1) of the capacity of the buffer area, where G is the upload rate, and T is a number greater than zero ;
比较所述目标值和所述初始值;comparing said target value with said initial value;
若所述目标值大于或等于所述初始值,则将所述缓存区的容量调整至所述目标值;If the target value is greater than or equal to the initial value, adjusting the capacity of the buffer area to the target value;
若所述目标值小于所述初始值,则将所述缓存区的容量调整至所述初始值。If the target value is smaller than the initial value, adjusting the capacity of the buffer area to the initial value.
可选的,所述速率获取模块74具体用于:Optionally, the
根据预设时间间隔T,获取所述写入速率和所述上传速率。According to a preset time interval T, the writing rate and the uploading rate are acquired.
可选的,所述数据处理装置还包括:Optionally, the data processing device also includes:
停止获取模块76,用于当检测到所述缓存区中存储的数据已全部上传至所述服务器且无数据写入所述缓存区时,停止获取所述写入速率和所述上传速率。The stop obtaining
可选的,所述数据处理模块73具体用于:Optionally, the
根据先进先出原则,将所述缓存区中存储的数据上传至所述服务器。Upload the data stored in the cache area to the server according to the first-in-first-out principle.
可选的,所述数据处理模块73具体用于:Optionally, the
若移动终端处于预设场景,则在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。If the mobile terminal is in a preset scene, when the data to be stored is written into the cache, upload the data stored in the cache to the server, and delete the data stored in the cache that has been uploaded to the cache. data from the server.
本申请实施例提供的数据处理装置可以应用在前述方法实施例中,详情参见上述方法实施例的描述,在此不再赘述。The data processing apparatus provided in the embodiment of the present application can be applied in the foregoing method embodiments. For details, refer to the description of the foregoing method embodiments, and details are not repeated here.
图8是本申请一实施例提供的移动终端的结构示意图。如图所示的该移动终端可以包括:一个或多个处理器801(图中仅示出一个);一个或多个输入设备802(图中仅示出一个),一个或多个输出设备803(图中仅示出一个)和存储器804。上述处理器801、输入设备802、输出设备803和存储器804通过总线805连接。存储器804用于存储指令,处理器801用于执行存储器804存储的指令。其中:Fig. 8 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application. The mobile terminal as shown in the figure may include: one or more processors 801 (only one is shown in the figure); one or more input devices 802 (only one is shown in the figure), and one or more output devices 803 (only one is shown in the figure) and
所述处理器801,用于获取待存储数据;将所述待存储数据写入缓存区;在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。The
可选的,所述处理器801还用于:Optionally, the
获取将所述待存储数据写入所述缓存区时的写入速率以及将所述缓存区中存储的数据上传至所述服务器时的上传速率;Obtaining the write rate when the data to be stored is written into the cache area and the upload rate when the data stored in the cache area is uploaded to the server;
根据所述写入速率和所述上传速率,调整所述缓存区的容量。Adjust the capacity of the buffer area according to the writing rate and the uploading rate.
可选的,所述处理器801具体用于:Optionally, the
比较所述写入速率和所述上传速率;comparing said write rate with said upload rate;
若所述写入速率小于或等于所述上传速率,则计算所述缓存区的容量的初始值L=K*t1,并将所述缓存区的容量调整至所述初始值,其中,K为所述写入速率,t1为大于零的数;If the write rate is less than or equal to the upload rate, then calculate the initial value L=K*t1 of the capacity of the buffer area, and adjust the capacity of the buffer area to the initial value, where K is The write rate, t1 is a number greater than zero;
若所述写入速率大于所述上传速率,则计算所述缓存区的容量的目标值H=(K-G)*(T+t1),其中,G为所述上传速率,T为大于零的数;If the write rate is greater than the upload rate, then calculate the target value H=(K-G)*(T+t1) of the capacity of the buffer area, where G is the upload rate, and T is a number greater than zero ;
比较所述目标值和所述初始值;comparing said target value with said initial value;
若所述目标值大于或等于所述初始值,则将所述缓存区的容量调整至所述目标值;If the target value is greater than or equal to the initial value, adjusting the capacity of the buffer area to the target value;
若所述目标值小于所述初始值,则将所述缓存区的容量调整至所述初始值。If the target value is smaller than the initial value, adjusting the capacity of the buffer area to the initial value.
可选的,所述处理器801具体用于:Optionally, the
根据预设时间间隔T,获取所述写入速率和所述上传速率。According to a preset time interval T, the writing rate and the uploading rate are acquired.
可选的,所述处理器801还用于:Optionally, the
当检测到所述缓存区中存储的数据已全部上传至所述服务器且无数据写入所述缓存区时,停止获取所述写入速率和所述上传速率。Stop acquiring the write rate and the upload rate when it is detected that all the data stored in the buffer has been uploaded to the server and no data is written into the buffer.
可选的,所述处理器801具体用于:Optionally, the
根据先进先出原则,将所述缓存区中存储的数据上传至所述服务器。Upload the data stored in the cache area to the server according to the first-in-first-out principle.
可选的,所述处理器801具体用于:Optionally, the
若移动终端处于预设场景,则在将所述待存储数据写入所述缓存区时,将所述缓存区中存储的数据上传至服务器,并删除所述缓存区中存储的已上传至所述服务器的数据。If the mobile terminal is in a preset scene, when the data to be stored is written into the cache, upload the data stored in the cache to the server, and delete the data stored in the cache that has been uploaded to the cache. data from the server.
应当理解,在本申请实施例中,所述处理器801可以是中央处理单元(CentralProcessing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(DigitalSignal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in the embodiment of the present application, the
输入设备802可以包括触控板、指纹采传感器(用于采集用户的指纹信息和指纹的方向信息)、麦克风、数据接收接口等。输出设备803可以包括显示器(LCD等)、扬声器、数据发送接口等。The
该存储器804可以包括只读存储器和随机存取存储器,并向处理器801提供指令和数据。存储器804的一部分还可以包括非易失性随机存取存储器。例如,存储器804还可以存储设备类型的信息。The
具体实现中,本申请实施例中所描述的处理器801、输入设备802、输出设备803和存储器804可执行本申请实施例提供的数据处理方法的实施例中所描述的实现方式,也可执行本申请实施例提供的数据处理装置中所描述的实现方式,在此不再赘述。In a specific implementation, the
图9是本申请一实施例提供的移动终端的结构示意图。如图9所示,该实施例的移动终端9包括:至少一个处理器90(图9中仅示出一个)、存储器91以及存储在所述存储器91中并可在所述至少一个处理器90上运行的计算机程序92。所述处理器90执行所述计算机程序92时实现上述各个数据处理方法实施例中的步骤。Fig. 9 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application. As shown in Figure 9, the mobile terminal 9 of this embodiment includes: at least one processor 90 (only one is shown in Figure 9), a
所述移动终端9可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该移动终端可包括,但不仅限于,处理器90、存储器91。本领域技术人员可以理解,图9仅仅是移动终端9的举例,并不构成对移动终端9的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The mobile terminal 9 may be a computing device such as a desktop computer, a notebook, a palmtop computer, or a cloud server. The mobile terminal may include, but not limited to, a
所称处理器90可以是中央处理单元(Central Processing Unit,CPU),该处理器90还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called
所述存储器91在一些实施例中可以是所述移动终端9的内部存储单元,例如移动终端9的硬盘或内存。所述存储器91在另一些实施例中也可以是所述移动终端9的外部存储设备,例如所述移动终端9上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器91还可以既包括所述移动终端9的内部存储单元也包括外部存储设备。所述存储器91用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器91还可以用于暂时地存储已经输出或者将要输出的数据。The
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used for illustration. In practical applications, the above-mentioned functions can be assigned to different functional units, Completion of modules means that the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit, and the above-mentioned integrated units may adopt hardware It can also be implemented in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the above system, reference may be made to the corresponding process in the foregoing method embodiments, and details will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the foregoing method embodiments when executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the procedures in the methods of the above embodiments in the present application can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a computer-readable storage medium. The computer program When executed by a processor, the steps in the above-mentioned various method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program codes to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium. Such as U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/移动终端和方法,可以通过其它的方式实现。例如,以上所描述的装置/移动终端实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/mobile terminal and method may be implemented in other ways. For example, the device/mobile terminal embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still implement the foregoing embodiments Modifications to the technical solutions described in the examples, or equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application, and should be included in the Within the protection scope of this application.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910681397.8A CN110377235B (en) | 2019-07-26 | 2019-07-26 | Data processing method and device, mobile terminal and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910681397.8A CN110377235B (en) | 2019-07-26 | 2019-07-26 | Data processing method and device, mobile terminal and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110377235A CN110377235A (en) | 2019-10-25 |
CN110377235B true CN110377235B (en) | 2023-04-07 |
Family
ID=68256175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910681397.8A Expired - Fee Related CN110377235B (en) | 2019-07-26 | 2019-07-26 | Data processing method and device, mobile terminal and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110377235B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111538678B (en) * | 2020-04-20 | 2025-05-06 | 深圳Tcl数字技术有限公司 | Data buffering method, device and computer readable storage medium |
CN111984609B (en) * | 2020-08-19 | 2024-07-16 | 北京龙鼎源科技股份有限公司 | Data storage method, device, storage medium and processor |
CN112711386B (en) * | 2021-01-18 | 2021-07-16 | 深圳市龙信信息技术有限公司 | Storage capacity detection method and device of storage device and readable storage medium |
CN114281724B (en) * | 2021-12-10 | 2024-01-02 | 深圳市欧瑞博科技股份有限公司 | Data transmission method and device and electronic equipment |
CN115840541B (en) * | 2023-02-23 | 2023-06-13 | 成都体育学院 | Motion data storage method, system and medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760467A (en) * | 2016-02-05 | 2016-07-13 | 浪潮(北京)电子信息产业有限公司 | Real-time data read-write method, device and system and NFS server |
CN105791353A (en) * | 2014-12-23 | 2016-07-20 | 深圳市腾讯计算机系统有限公司 | Distributed data storage method and system based on erasure code |
CN107229673A (en) * | 2017-04-20 | 2017-10-03 | 努比亚技术有限公司 | Method for writing data, Hbase terminals and the storage medium of Hbase databases |
CN107608627A (en) * | 2017-08-21 | 2018-01-19 | 云宏信息科技股份有限公司 | A kind of remote data classification storage method, electronic equipment and storage medium |
CN107633014A (en) * | 2017-08-17 | 2018-01-26 | 深圳市诚壹科技有限公司 | A kind of date storage method and server |
WO2019010686A1 (en) * | 2017-07-14 | 2019-01-17 | 深圳市元征科技股份有限公司 | Data processing method and data processing apparatus |
CN109284066A (en) * | 2017-07-19 | 2019-01-29 | 阿里巴巴集团控股有限公司 | A kind of data processing method, device, equipment and system |
CN109885403A (en) * | 2019-01-29 | 2019-06-14 | 努比亚技术有限公司 | A kind of data managing method, mobile terminal and computer readable storage medium |
-
2019
- 2019-07-26 CN CN201910681397.8A patent/CN110377235B/en not_active Expired - Fee Related
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105791353A (en) * | 2014-12-23 | 2016-07-20 | 深圳市腾讯计算机系统有限公司 | Distributed data storage method and system based on erasure code |
CN105760467A (en) * | 2016-02-05 | 2016-07-13 | 浪潮(北京)电子信息产业有限公司 | Real-time data read-write method, device and system and NFS server |
CN107229673A (en) * | 2017-04-20 | 2017-10-03 | 努比亚技术有限公司 | Method for writing data, Hbase terminals and the storage medium of Hbase databases |
WO2019010686A1 (en) * | 2017-07-14 | 2019-01-17 | 深圳市元征科技股份有限公司 | Data processing method and data processing apparatus |
CN109284066A (en) * | 2017-07-19 | 2019-01-29 | 阿里巴巴集团控股有限公司 | A kind of data processing method, device, equipment and system |
CN107633014A (en) * | 2017-08-17 | 2018-01-26 | 深圳市诚壹科技有限公司 | A kind of date storage method and server |
CN107608627A (en) * | 2017-08-21 | 2018-01-19 | 云宏信息科技股份有限公司 | A kind of remote data classification storage method, electronic equipment and storage medium |
CN109885403A (en) * | 2019-01-29 | 2019-06-14 | 努比亚技术有限公司 | A kind of data managing method, mobile terminal and computer readable storage medium |
Non-Patent Citations (1)
Title |
---|
面向移动环境的数据存储管理方法关键技术研究;曾文英;《中国博士学位论文全文数据库信息科技辑》;20120615(第6期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110377235A (en) | 2019-10-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110377235B (en) | Data processing method and device, mobile terminal and computer readable storage medium | |
WO2021098695A1 (en) | Information sharing method and electronic device | |
US10599336B2 (en) | Method of displaying content and electronic device adapted to the same | |
CN105409160B (en) | System for remote control of electronic equipment and operation method thereof | |
WO2020151460A1 (en) | Object processing method and terminal device | |
CN115454286B (en) | Application data processing method and device and terminal equipment | |
CN110069179A (en) | Icon control method and terminal device | |
US11481357B2 (en) | Album display method, electronic device, and storage medium | |
CN112347048B (en) | Electronic device and method for sharing data thereof | |
CN108595113A (en) | A kind of method and terminal of subregion adjustment | |
CN107589901A (en) | Page display method, device, terminal and computer-readable storage medium | |
CN109522278B (en) | A file storage method and terminal device | |
CN112835493B (en) | Screenshot display method, device and terminal device | |
CN110442297A (en) | Split screen display method, split screen display device and terminal equipment | |
CN109976611A (en) | The control method and terminal device of terminal device | |
CN115766851A (en) | Device registration method, device, mobile terminal and storage medium | |
CN111966491B (en) | Method for counting memory usage and terminal equipment | |
CN109981442A (en) | Method for sending information and terminal device | |
CN108833684A (en) | An information prompt method and terminal device | |
CN110221741A (en) | Icon management method and terminal device | |
CN111368188B (en) | Application processing method and electronic device | |
CN108549576A (en) | File monitoring method and device, electronic equipment and storage medium | |
CN108366106A (en) | Update method, management method, amending method and the relevant device of the communication information | |
CN107332996A (en) | Screen lock control method, device, computer storage medium and mobile terminal | |
EP3043252A1 (en) | Method and electronic device for displaying electronic document |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20230407 |
|
CF01 | Termination of patent right due to non-payment of annual fee |