CN106021591A - Data processing method and system for terminal - Google Patents
Data processing method and system for terminal Download PDFInfo
- Publication number
- CN106021591A CN106021591A CN201610395581.2A CN201610395581A CN106021591A CN 106021591 A CN106021591 A CN 106021591A CN 201610395581 A CN201610395581 A CN 201610395581A CN 106021591 A CN106021591 A CN 106021591A
- Authority
- CN
- China
- Prior art keywords
- data
- shared database
- terminal
- data processing
- operation data
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 57
- 238000012545 processing Methods 0.000 claims abstract description 79
- 238000000034 method Methods 0.000 claims abstract description 40
- 239000011230 binding agent Substances 0.000 claims description 19
- 238000005516 engineering process Methods 0.000 claims description 17
- 238000013500 data storage Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 abstract description 9
- 230000006854 communication Effects 0.000 description 12
- 230000007246 mechanism Effects 0.000 description 11
- 238000011112 process operation Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 235000010627 Phaseolus vulgaris Nutrition 0.000 description 6
- 244000046052 Phaseolus vulgaris Species 0.000 description 6
- 238000006243 chemical reaction Methods 0.000 description 6
- 238000004806 packaging method and process Methods 0.000 description 6
- 238000011161 development Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 238000013404 process transfer Methods 0.000 description 3
- OLDXRTOEUPVZKB-UHFFFAOYSA-N B1CCCC1 Chemical compound B1CCCC1 OLDXRTOEUPVZKB-UHFFFAOYSA-N 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005538 encapsulation Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
- G06F16/2443—Stored procedures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a data processing method and system for a terminal. Two or more applications are arranged in the terminal. The data processing method for the terminal comprises the steps that a shared database is set; operating data of the applications is stored in a data table, corresponding to the operating data, in the shared database. Due to the fact that the multiple applications in the terminal share the same shared database, and the operating data of the different applications are stored in the data table, corresponding to the operating data, in the shared database, when the operating data of the multiple applications are stored or inquired about, dynamic space demands are effectively reduced, conflicts between processes of the different applications can be avoided, and data processing smoothness is improved. Moreover, through the data processing method and system, stringing operation required during establishment of the data table and inquiry about the data table can be effectively reduced, data processing efficiency is improved, and the probability of making mistakes is lowered.
Description
Technical Field
The invention relates to the internet technology, in particular to a data processing method and a data processing system for a terminal.
Background
With the continuous development of science and technology, electronic technology has also gained rapid development, and the variety of electronic products is also more and more, and people also enjoy various conveniences brought by the development of science and technology. People can enjoy comfortable life brought along with the development of science and technology through various types of mobile terminals. For example, mobile terminals such as smart phones and tablet computers have become an important part of people's lives, and users can listen to music, play games and the like by using the mobile terminals such as smart phones and tablet computers, so as to relieve pressure brought by modern fast-paced lives.
Three major operating systems, namely Android, iOS (apple operating system) and Windows, exist in the existing mobile terminal market. For each operating system, a software developer develops a large amount of application software to meet the use requirements of different users. Taking user groups as children as an example, software developers develop a large amount of high-quality children application software to assist children in learning, entertainment, health use reminding and the like. Such as literacy applications, arithmetic applications, english learning, educational games, idiom stories, timing online, and the like. Therefore, the purpose of edutainment and safe use of the mobile terminal is achieved.
In order to obtain the use condition of each application in the mobile terminal and to know the use behavior of the user of the mobile terminal, an independent database file is respectively established in each application for storing the running data (use time, use duration, use result, etc.) of the application. And then, the use behaviors of the mobile terminal user are analyzed by reading and processing the information stored in the database file of each application. When information stored in database files of various applications is read and processed, a large number of string splicing operations such as table establishment and query need to be performed, meanwhile, a Provider component needs to be adopted to perform cross-process operation, and the operation is heavy and cumbersome. Moreover, when the Cursor-List structure is realized, more objects are defined, the realization is complicated, the efficiency is low, and errors are easy to occur.
Therefore, how to simply and quickly store and query the operation data of each application in the terminal becomes one of the problems to be solved urgently at present.
Disclosure of Invention
The embodiment of the invention aims to solve the technical problem that: a data processing method and system for a terminal are provided to conveniently and quickly store and query the running data of each application in the terminal.
According to an aspect of an embodiment of the present invention, there is provided a data processing method for a terminal, where the terminal is provided with two or more applications; the data processing method of the terminal comprises the following steps:
setting a shared database;
and storing the operation data of the application in a data table corresponding to the operation data in the shared database.
In another embodiment based on the above method, before storing the operation data of the application in a data table corresponding to the operation data in the shared database, the method further includes:
judging whether a data table corresponding to the operation data is included in the shared database;
and if so, storing the operation data of the application in a data table corresponding to the operation data in the shared database.
In another embodiment based on the above method, if the shared database does not include the data table corresponding to the operation data, the data table corresponding to the operation data is created and stored in the shared database, and then the operation data is stored in the data table corresponding to the operation data in the shared database.
In another embodiment based on the above method, the operation data of the application is stored in a data table corresponding to the operation data in the shared database through a DataBaseHelper, or a data table corresponding to the operation data is established in the shared database.
In another embodiment based on the above method, before storing the operation data of the application in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes:
converting the operation data into a ContentValues class;
and sending the operation data converted into the ContentValues class to the shared database.
In another embodiment based on the above method, when the operation data is sent to the shared database, the Provider component determines the application where the operation data is located, and then the Binder component sends the operation data of the application to the shared database.
In another embodiment based on the above method, the operation data converted into the ContentValues class is sent to the shared database by aid of aid l technology.
In another embodiment based on the above method, the data table includes a table name and a field corresponding to the table name; the table name corresponds to a class name, and the field corresponds to a class member variable.
In another embodiment based on the above method, the class member variables include a generic variable and an additional variable, the generic variable including a class ID.
According to another aspect of the embodiments of the present invention, there is provided a data processing system of a terminal, in which two or more application units are disposed; the data processing system of the terminal comprises:
the data storage unit is used for storing a shared database, and the shared database is used for storing the running data of each application unit;
and the data processing unit is used for acquiring the operation data of the application unit and storing the operation data of the application unit in a data table corresponding to the operation data in the shared database.
Based on the data processing method of the terminal provided by the above embodiment of the present invention, for a terminal provided with more than two applications, the data processing method of the terminal includes: setting a shared database, and storing the operation data of the application in a data table corresponding to the operation data in the shared database. Because a plurality of applications in the terminal share one shared database, and different applications store the operation data in the shared database and the data table corresponding to the operation data, when the operation data of a plurality of subsequent applications are simultaneously used, the dynamic space requirement is low, the conflict among the processes of different applications can be avoided, and the data processing fluency is improved.
In addition, compared with the prior art that each application respectively establishes the corresponding database when storing the running data, the data processing method of the terminal can effectively reduce the string splicing operation required during the establishment and query of the data table, improve the data processing efficiency and reduce the error probability.
Further, before storing the operation data of the application in a data table corresponding to the operation data in the shared database, the method may further include: judging whether a data table corresponding to the operation data is included in the shared database; if yes, storing the operation data of the application in a data table corresponding to the operation data in the shared database; otherwise, a data table corresponding to the operation data is established and stored in the shared database, and then the operation data is stored in the data table corresponding to the operation data in the shared database. Therefore, the data table can be automatically created according to the data processing requirement, the data processing efficiency is improved, and the error probability is reduced.
Further, the operating data of the application is stored in a data table corresponding to the operating data in the shared database through the DataBaseHelper, or a data table corresponding to the operating data is established in the shared database. Before storing the operation data of the application in a data table corresponding to the operation data in the shared database, converting the operation data into a ContentValues class; and then the operation data converted into the ContentValues class is sent to the shared database. Because the ContentValues are Parcellable objects, cross-process transfer can be realized through the AIDL technology, so that data can be packaged by using the DataBasehelper, the establishment, query, packaging and the like of a data table are universal, redundant database statement writing and removing are not needed to be repeated, multi-process operation is not needed to be concerned, the data processing efficiency is improved, and the error probability is reduced.
Further, when the running data is sent to the shared database, the application where the running data is located is judged through the Provider component, and then the running data of the application is sent to the shared database through the Binder component. Compared with the cross-process operation completely through the progress of the Provider component, the cross-process operation performed by combining the Provider component and the Binder component has a simple structure, and is convenient for multi-process reading and single-process writing.
Further, the data table comprises a table name and a field corresponding to the table name; the table name corresponds to the class name and the field corresponds to the class member variable. The class member variables include generic variables and additional variables, and the generic variables include the class ID. The defined class and the data table form a mapping relation by using an ORM technology, so that the operations of establishing, inquiring, encapsulating and the like of the data table are general and simplified.
Further, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes: and each data table in the shared database is converted into a Bean class, so that the types of data stored in the shared database are uniform and clear, and subsequent query, packaging and the like are facilitated.
Further, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes: querying a class member variable corresponding to the class name in a shared database through the class name; alternatively, a class name corresponding to a table name of a data table is queried through fields of the data table in the shared database. By using the reflection mechanism and the reflection annotation characteristic of Java, the query of individual data in the shared database is realized, and the operation is simple.
Further, the running data in the data table is displayed in a view form through the Adapter. The user can conveniently check the stored data.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of an embodiment of a data processing method of a terminal according to the present invention.
Fig. 2 is a flowchart of another embodiment of a data processing method of a terminal according to the present invention.
Fig. 3 is a flowchart of a data processing method of the terminal according to another embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a data processing system of the terminal according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of another embodiment of the data processing system of the terminal according to the present invention.
Fig. 6 is a schematic structural diagram of a data processing system of a terminal according to another embodiment of the present invention.
Fig. 7 is a schematic structural diagram of an information display system of a terminal according to still another embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
In order to obtain the use condition of each application in the existing terminal, an independent database file needs to be established in each application respectively to store the operation data of the application. And then, the use behaviors of the end users are analyzed by reading and processing the information stored in the database files of the applications. However, when the running data in the database file of each application is read and processed, a large number of string splicing operations such as table establishment and query need to be performed; in addition, the existing terminal adopts a Provider component to carry out cross-process operation, so that the operation is heavy and tedious, the efficiency is low, and errors are easy to occur.
Fig. 1 is a flowchart of an embodiment of a data processing method of a terminal according to the present invention. In this embodiment, the terminal is provided with more than two applications. As shown in fig. 1, the data processing method of the terminal of the embodiment includes:
s102, setting a shared database;
and S104, storing the operation data of the application in a data table corresponding to the operation data in the shared database.
In this embodiment, the operating system of the terminal may be an android operating system. The applications in the terminal can be WeChat, qq, reading software, literacy applications, arithmetic applications, English learning, educational games, idiom stories, and the like, and the embodiment is not limited to the types of the applications. The running data of the application can be the use time, the use duration, the use result and the like.
In this embodiment, for a terminal provided with two or more applications, the data processing method includes: setting a shared database, and storing the operation data of the application in a data table corresponding to the operation data in the shared database. Because a plurality of applications in the terminal share one shared database, and different applications store the operation data in the shared database and the data table corresponding to the operation data, when the operation data of the plurality of applications are stored or inquired, the dynamic space requirement is effectively reduced, the conflict among the processes of the different applications can be avoided, and the data processing fluency is improved.
Compared with the prior art that a database is respectively arranged in each application to store the running data of the application, the data processing method of the terminal can effectively reduce the string splicing operation required during the establishment and query of the data table, improve the data processing efficiency and reduce the error probability.
Fig. 2 is a flowchart of another embodiment of a data processing method of a terminal according to the present invention. In this embodiment, the terminal is provided with more than two applications. As shown in fig. 2, the data processing method of the terminal of the embodiment includes:
s202, setting a shared database.
And S204, judging whether the shared database comprises a data table corresponding to the operation data.
In S204, if the shared database includes a data table corresponding to the operation data, S208 is executed.
And S208, storing the operation data of the application in a data table corresponding to the operation data in the shared database.
In S204, if the shared database does not include the data table corresponding to the operation data, S206 is executed.
S206, a data table corresponding to the operation data is established and stored in the shared database, and then S208 is performed.
In this embodiment, before storing the operation data of the application in the data table corresponding to the operation data in the shared database, it is first determined whether the data table corresponding to the operation data is included in the shared database, if so, the operation data of the application is stored in the data table corresponding to the operation data in the shared database, otherwise, the data table corresponding to the operation data is established and the established data table is stored in the shared database, and then the operation data is stored in the data table corresponding to the operation data in the shared database. Therefore, the data table can be automatically created according to the data processing requirement, the data processing efficiency is improved, and the error probability is reduced.
Fig. 3 is a flowchart of a data processing method of the terminal according to another embodiment of the present invention. In this embodiment, the terminal is provided with more than two applications. As shown in fig. 3, the data processing method of the terminal of the embodiment includes:
s302, setting a shared database.
S304, judging whether the shared database comprises a data table corresponding to the operation data.
In S304, if the shared database includes a data table corresponding to the operation data, S308 is executed.
S308, converting the operation data into a ContentValues class.
The ContentValues class is a storage mechanism, and can only store basic types of data, such as string, int, and the like, and cannot store objects. The ContentValues class is a Parcellable object, and cross-process transfer can be realized through AIDL technology.
In the Android operating system, in order to enable applications to communicate with each other, a unique implementation of an IPC (inter process Communication), namely, an Android Interface Definition Language (AIDL), is provided. The AIDL is a lightweight implementation of the IPC, the types supported by the AIDL by default comprise Java basic types (int, long, borolan, etc.) and (String, List, Map, CharSequence), and the AIDL is an interface definition language for restricting communication rules between two processes, so that a compiler generates codes to realize communication (IPC) between the two processes on the android operating system terminal.
And S310, transmitting the operation data converted into the ContentValues class to the shared database.
And S312, storing the operation data of the application in a data table corresponding to the operation data in the shared database.
In S304, if the shared database does not include the data table corresponding to the operation data, S306 is executed.
S306, establishing a data table corresponding to the operation data and storing the established data table in a shared database; then, S308, S310, and S312 are sequentially performed.
In this embodiment, the data base helper is used to store the running data of the application in a data table corresponding to the running data in the shared database, or to establish a data table corresponding to the running data in the shared database.
In particular, the DataBaseHelper is a database access help class that can be used to manage the creation and updating of a database.
In this embodiment, the operation data converted into the ContentValues class is sent to the shared database by aid of the aid l technique.
In this embodiment, the data base helper is used to store the running data of the application in a data table corresponding to the running data in the shared database, or to establish a data table corresponding to the running data in the shared database. Before storing the operation data of the application in a data table corresponding to the operation data in the shared database, converting the operation data into a ContentValues class; and then the operation data converted into the ContentValues class is sent to the shared database. Because the ContentValues are Parcellable objects, cross-process transmission can be realized through the AIDL technology, so that data can be packaged by using the DataBasehelper, the establishment, query, packaging and the like of a data table are universal, redundant database statement writing and removing are not needed repeatedly, multi-process operation is not needed to be concerned, the data processing efficiency is improved, and the error probability is reduced.
In another embodiment, when the running data is sent to the shared database, the Provider component determines the application where the running data is located, and then the Binder component sends the running data of the application to the shared database.
The Provider component is one of four major components in an android operating system, and is mainly used for sharing data externally, that is, data in the application is shared to other applications for access through the Provider component, and the other applications can operate the data in the specified application through the Provider component. The Binder component is not a new set of interprocess communication mechanism proposed by an android operating system, and is realized based on the OpenBinder. The Binder component is an interprocess communication mechanism that provides Remote Procedure Call (RPC) functionality. The Binder component can be used for IPC communication processes. The inter-process communication Binder mechanism of the android operating system is realized on a Java interface of an application program framework layer.
In this embodiment, when the running data is sent to the shared database, the Provider component determines the application where the running data is located, and then the Binder component sends the running data of the application to the shared database. Compared with the cross-process operation completely through the progress of the Provider component, the cross-process operation performed by combining the Provider component and the Binder component has a simple structure, and is convenient for multi-process reading and single-process writing.
In yet another embodiment, a data table includes a table name and a field corresponding to the table name; the table name corresponds to the class name and the field corresponds to the class member variable. The class member variables comprise general variables and additional variables, and the general variables comprise class IDs and other running data of users who need monitoring and use the application frequently. The class ID is unique to the terminal.
In this embodiment, the data table includes a table name and a field corresponding to the table name; the table name corresponds to the class name and the field corresponds to the class member variable. The class member variables include generic variables and additional variables, and the generic variables include the class ID. And (3) utilizing an Object Relational Mapping (ORM) technology to form a Mapping relation between the defined class and the data table, so that the operations of establishing, inquiring, packaging and the like of the data table are general and simplified.
In another embodiment, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes: and each data table in the shared database is converted into a Bean class, so that the types of data stored in the shared database are uniform and clear, and subsequent query, packaging and the like are facilitated.
In another embodiment, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes: querying a class member variable corresponding to the class name in a shared database through the class name; alternatively, a class name corresponding to a table name of a data table is queried through fields of the data table in the shared database. Therefore, by using the reflection mechanism and the reflection annotation characteristic of Java, the query of the running data in the shared database is realized, and the operation is simple.
In yet another embodiment, the running data in the data table is displayed in a view form through an Adapter, so that a user can conveniently view the data stored in the shared database.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Fig. 4 is a schematic structural diagram of a data processing system of the terminal according to an embodiment of the present invention. In this embodiment, the terminal is provided with more than two application units. As shown in fig. 4, the data processing system of the terminal in this embodiment includes:
a data storage unit 10, configured to store a shared database, where the shared database is used to store operation data of each application unit;
and the data processing unit 20 is configured to obtain the operation data of the application unit, and store the operation data of the application unit in a data table corresponding to the operation data in the shared database.
In this embodiment, the operating system of the terminal may be an android operating system. The application unit in the terminal may be an implementation unit of application software such as WeChat, qq, reading software, literacy application, arithmetic application, English learning, educational game, idiom story, and the like, and the embodiment does not limit the type of the application unit. The operation data of the application unit can be the use time, the use duration, the use result and the like.
It should be noted that, in this embodiment, the data processing system of the terminal may be integrated inside the terminal, or may be disposed separately from the terminal, which is not limited herein.
Preferably, the data processing system of the terminal is integrated inside the terminal.
In this embodiment, for a terminal provided with two or more application units, the data processing system thereof includes a data storage unit 10 and a data processing unit 20; a shared database for storing the operation data of each application unit through the data storage unit 10; the operation data of the application unit is acquired by the data processing unit 20 and stored in the shared database in the data table corresponding to the operation data. Therefore, when the running data of a plurality of application units are stored or inquired, the dynamic space requirement is effectively reduced, the conflict among the processes of different application units can be avoided, and the data processing fluency is improved.
Compared with the prior art that a database is respectively arranged in each application unit to store the running data of the application unit, the data processing system of the terminal can effectively reduce the required string splicing operation when the data table is established and inquired, thereby improving the data processing efficiency and reducing the error probability.
Fig. 5 is a schematic structural diagram of another embodiment of the data processing system of the terminal according to the present invention. Compared to fig. 4, the data processing unit 20 of the data processing system in fig. 5 further comprises:
a data obtaining unit 202, configured to obtain operation data of the application unit;
a data table query unit 204, configured to determine whether a data table corresponding to the operating data is included in the shared database;
a data table establishing unit 206, configured to establish a data table corresponding to the operating data when the shared database does not include the data table corresponding to the operating data, and store the established data table in the shared database;
and a data table updating unit 208, configured to, when the shared database includes a data table corresponding to the operation data, store the operation data of the application unit in the data table corresponding to the operation data in the shared database.
In this embodiment, after the data obtaining unit 202 in the data processing unit 20 obtains the operating data of the application unit, the data table querying unit 204 determines whether the shared database includes a data table corresponding to the operating data; if yes, the data table updating unit 208 stores the operation data of the application unit in a data table corresponding to the operation data in the shared database; otherwise, a data table corresponding to the operation data is first established by the data table establishing unit 206 and stored in the shared database, and then the operation data is stored in a data table corresponding to the operation data in the shared database by the data table updating unit 208. Therefore, the data table can be automatically created according to the data processing requirement, the data processing efficiency is improved, and the error probability is reduced.
In another embodiment, the application unit (not shown) further comprises:
a first data conversion unit (not shown) for converting the operation data into a ContentValues class;
and a data sending unit (not shown) for sending the operation data converted into the ContentValues class to the data processing unit.
Specifically, the ContentValues class is a storage mechanism, and the ContentValues class can only store basic types of data, such as string and int, and cannot store objects. The ContentValues class is a Parcellable object, and cross-process transfer can be realized through AIDL technology.
In the android operating system, in order to enable applications to communicate with each other, a unique implementation of IPC, namely AIDL, is provided. The AIDL is a lightweight implementation of IPC, the default supported types of AIDL include Java basic types (int, long, borolan, etc.) and (String, List, Map, CharSequence), and the AIDL is an interface definition language used for restricting the communication rule between two processes, so that a compiler generates codes to realize the communication between the two processes on the android operating system device.
In this embodiment, the operation data converted into the ContentValues class is sent to the shared database by aid of the aid l technique.
In this embodiment, the data table updating unit 208 stores the operation data of the application unit in a data table corresponding to the operation data in the shared database through the DataBaseHelper, or establishes a data table corresponding to the operation data in the shared database.
In particular, the DataBaseHelper is a database access help class that can be used to manage the creation and updating of a database.
In this embodiment, before the data table updating unit 208 stores the operation data of the application unit in the data table corresponding to the operation data in the shared database, the first data conversion unit in the application unit converts the operation data into a ContentValues class; and the data sending unit sends the operation data converted into the ContentValues class to the shared database. Because the ContentValues are Parcellable objects, cross-process transmission can be realized through the AIDL technology, so that data can be packaged by using the DataBasehelper, the establishment, query, packaging and the like of a data table are universal, redundant database statement writing and removing are not needed to be repeated, multi-process operation is not needed to be concerned, the data processing efficiency is improved, and the error probability is reduced.
In another embodiment, when the data sending unit sends the running data to the shared database, the Provider component judges the application unit where the running data is located, and then the Binder component sends the running data of the application unit to the shared database.
The Provider is one of four major components in an android operating system, and is mainly used for sharing data externally, that is, data in the application is shared to other applications for access through the Provider, and the other applications can operate the data in the specified application through the Provider. Binder is an inter-process communication mechanism that provides remote procedure call functionality. The Binder component can be used for IPC communication processes. The inter-process communication Binder mechanism of the android operating system is realized on a Java interface of an application program framework layer.
In this embodiment, when the running data is sent to the shared database through the data sending unit, the Provider component determines the application unit where the running data is located, and then the Binder component sends the running data of the application unit to the shared database. Compared with the cross-process operation completely through the progress of the Provider component, the cross-process operation performed by combining the Provider component and the Binder component has a simple structure, and is convenient for multi-process reading and single-process writing.
In another embodiment, a data table includes a table name and a field corresponding to the table name; the table name corresponds to the class name and the field corresponds to the class member variable. The class member variables comprise general variables and additional variables, and the general variables comprise class IDs and other running data of users who need monitoring and use the application frequently. The class ID is unique to the terminal.
In this embodiment, the data processing system of the terminal can form a mapping relationship between the defined class and the data table by using the ORM technology, so that operations such as establishment, query, encapsulation and the like of the data table are general and simplified.
In another embodiment, the data processing unit 20 further comprises: and the second data conversion unit (not shown) is used for converting each data table in the shared database into a Bean class.
In the data processing system of the terminal in this embodiment, each data table in the shared database is converted into a Bean class by the second data conversion unit, so that the types of data stored in the shared database are uniform and clear, and subsequent query and encapsulation are facilitated.
Fig. 6 is a schematic structural diagram of a data processing system of a terminal according to another embodiment of the present invention. Referring to fig. 6, the data processing system of the terminal in this embodiment includes: a data storage unit 10, a data processing unit 20, a first data querying unit 30 and a data display unit 40.
The internal structure division and functions of the data processing unit 20 can refer to the data processing unit 20 in fig. 5, which will not be described in detail herein.
The first data query unit 30 is configured to query, by a class name, a class member variable corresponding to the class name in the shared database; the data display unit 40 is used for displaying the operation data in the data table in a view form through the Adapter.
In this embodiment, the data processing system of the terminal can query the class member variable corresponding to the class name in the shared database by using the reflection mechanism and the reflection annotation characteristic of Java through the first data query unit 30 when the class name is obtained, so as to query each running data in the shared database, and the operation is simple; and the acquired operation data is visually displayed to the user through the data display unit 40, so that the user can conveniently check the data stored in the shared database.
Fig. 7 is a schematic structural diagram of an information display system of a terminal according to still another embodiment of the present invention. Referring to fig. 7, the data processing system of the terminal in this embodiment includes: a data storage unit 10, a data processing unit 20, a second data query unit 50, and a data display unit 40. Wherein,
the internal structure division and functions of the data processing unit 20 can refer to the data processing unit 20 in fig. 5, and will not be described in detail here.
The second data query unit 50 is configured to query a class name corresponding to a table name of a data table through a field of the data table in the shared database;
the data display unit 40 is used for displaying the operation data in the data table in a view form through the Adapter.
In this embodiment, the data processing system of the terminal can use the reflection mechanism and the reflection annotation characteristic of Java, and when the second data query unit 50 obtains the field of the data table in the shared database, query the class name corresponding to the table name of the data table in the shared database, so as to query each running data in the shared database, and the operation is simple; and the acquired operation data is visually displayed to the user through the data display unit 40, so that the user can conveniently check the data stored in the shared database.
The embodiment of the invention provides the following technical scheme:
1. a data processing method of a terminal is provided, wherein more than two applications are arranged in the terminal; the data processing method of the terminal comprises the following steps:
setting a shared database;
and storing the operation data of the application in a data table corresponding to the operation data in the shared database.
2. The data processing method of the terminal according to 1, before storing the operation data of the application in the data table corresponding to the operation data in the shared database, further comprising:
judging whether a data table corresponding to the operation data is included in the shared database;
and if so, storing the operation data of the application in a data table corresponding to the operation data in the shared database.
3. According to the data processing method of the terminal in claim 2, if the shared database does not include the data table corresponding to the operation data, the data table corresponding to the operation data is established and stored in the shared database, and then the operation data is stored in the data table corresponding to the operation data in the shared database.
4. According to the data processing method of the terminal in claim 3, the operation data of the application is stored in a data table corresponding to the operation data in the shared database through a DataBaseHelper, or a data table corresponding to the operation data is established in the shared database.
5. According to the data processing method of the terminal in claim 4, before the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes:
converting the operation data into a ContentValues class;
and sending the operation data converted into the ContentValues class to the shared database.
6. According to the data processing method of the terminal in the 5, when the operation data is sent to the shared database, the Provider component judges the application of the operation data, and then the Binder component sends the operation data of the application to the shared database.
7. According to the data processing method of the terminal in 6, the operation data converted into the ContentValues class is sent to the shared database through an AIDL technology.
8. The data processing method of the terminal according to 7, wherein the data table comprises a table name and a field corresponding to the table name; the table name corresponds to a class name, and the field corresponds to a class member variable.
9. According to the data processing method of the terminal in claim 8, the class member variables include a generic variable and an additional variable, and the generic variable includes a class ID.
10. According to the data processing method of the terminal of claim 9, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes:
and converting each data table in the shared database into a Bean class.
11. According to the data processing method of the terminal 10, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes: and querying a class member variable corresponding to the class name in the shared database through the class name.
12. According to the data processing method of the terminal 10, after the operation data of the application is stored in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further includes: and inquiring a class name corresponding to the table name of the data table through the field of the data table in the shared database.
13. According to the data processing method of the terminal 11 or 12, the running data in the data table is displayed in a view form through an Adapter.
14. According to the data processing method of the terminal in claim 1, the operating system of the terminal is an android operating system.
15. A data processing system of a terminal is provided, wherein more than two application units are arranged in the terminal; the data processing system of the terminal comprises:
the data storage unit is used for storing a shared database, and the shared database is used for storing the running data of each application unit;
and the data processing unit is used for acquiring the operation data of the application unit and storing the operation data of the application unit in a data table corresponding to the operation data in the shared database.
16. The data processing system of the terminal according to 15, the data processing unit comprising:
the data acquisition unit is used for acquiring the operating data of the application unit;
the data table query unit is used for judging whether the shared database comprises a data table corresponding to the operating data or not;
and the data table updating unit is used for storing the operation data of the application unit in a data table corresponding to the operation data in the shared database when the shared database comprises the data table corresponding to the operation data.
17. The data processing system of the terminal according to 16, the data processing unit further comprising:
and the data table establishing unit is used for establishing a data table corresponding to the operating data and storing the established data table in the shared database when the shared database does not comprise the data table corresponding to the operating data.
18. According to the data processing system of the terminal of claim 17, the data table updating unit stores the operation data of the application unit in a data table corresponding to the operation data in the shared database through a DataBaseHelper; the data table establishing unit establishes a data table corresponding to the operation data through a DataBaseHelper.
19. The data processing system of the terminal according to 18, wherein the application unit includes:
the first data conversion unit is used for converting the operation data into a ContentValues class;
and the data sending unit is used for sending the operation data converted into the ContentValues class to the data processing unit.
20. According to the data processing system of the terminal of 19, when the data sending unit sends the operation data converted into the ContentValues class to the data processing unit, the application unit where the operation data is located is judged through the Provider component, and then the operation data of the application unit is sent to the data processing unit through the Binder component.
21. According to the data processing system of the terminal 20, the data sending unit sends the operation data converted into the ContentValues class to the data processing unit by aid of aid l technology.
22. The data processing system of the terminal of claim 21, wherein the data table comprises a table name and a field corresponding to the table name; the table name corresponds to a class name, and the field corresponds to a class member variable.
23. The data processing system of a terminal of 22, wherein the class member variables comprise generic variables and additional variables, and the generic variables comprise a class ID.
24. The data processing method of the terminal according to 23, wherein the data processing unit further includes:
and the second data conversion unit is used for converting each data table in the shared database into a Bean class.
25. The data processing system of a terminal according to 24, further comprising: and the first data query unit is used for querying class member variables corresponding to the class names in the shared database through the class names.
26. The data processing system of a terminal according to 24, further comprising: and the second data query unit is used for querying the class name corresponding to the table name of the data table through the field of the data table in the shared database.
27. The data processing system of a terminal according to claim 25 or 26, further comprising: and the data display unit is used for displaying the operation data in the data table in a view form through the Adapter.
28. The data processing system of the terminal according to 15, wherein the operating system of the terminal is an android operating system.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to practitioners skilled in this art. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
Claims (10)
1. The data processing method of the terminal is characterized in that more than two applications are arranged in the terminal; the data processing method of the terminal comprises the following steps:
setting a shared database;
and storing the operation data of the application in a data table corresponding to the operation data in the shared database.
2. The data processing method of the terminal according to claim 1, further comprising, before storing the operation data of the application in a data table corresponding to the operation data in the shared database, the following steps:
judging whether a data table corresponding to the operation data is included in the shared database;
and if so, storing the operation data of the application in a data table corresponding to the operation data in the shared database.
3. The method according to claim 2, wherein if the shared database does not include the data table corresponding to the operation data, the data table corresponding to the operation data is created and stored in the shared database, and then the operation data is stored in the data table corresponding to the operation data in the shared database.
4. The method according to claim 3, wherein the operating data of the application is stored in a data table corresponding to the operating data in the shared database by a DataBaseHelper, or a data table corresponding to the operating data is established in the shared database.
5. The data processing method of the terminal according to claim 4, wherein before the storing the operation data of the application in the data table corresponding to the operation data in the shared database, the data processing method of the terminal further comprises:
converting the operation data into a ContentValues class;
and sending the operation data converted into the ContentValues class to the shared database.
6. The data processing method of the terminal according to claim 5, wherein when the running data is sent to the shared database, an application where the running data is located is determined by a Provider component, and then the running data of the application is sent to the shared database by a Binder component.
7. The data processing method of the terminal according to claim 6, wherein the operation data converted into the ContentValues class is transmitted to the shared database by aid of aid l technology.
8. The data processing method of the terminal according to claim 7, wherein the data table includes a table name and a field corresponding to the table name; the table name corresponds to a class name, and the field corresponds to a class member variable.
9. The data processing method of the terminal according to claim 8, wherein the class member variables include a generic variable and an additional variable, and the generic variable includes a class ID.
10. The data processing system of the terminal is characterized in that more than two application units are arranged in the terminal; the data processing system of the terminal comprises:
the data storage unit is used for storing a shared database, and the shared database is used for storing the running data of each application unit;
and the data processing unit is used for acquiring the operation data of the application unit and storing the operation data of the application unit in a data table corresponding to the operation data in the shared database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610395581.2A CN106021591A (en) | 2016-06-06 | 2016-06-06 | Data processing method and system for terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610395581.2A CN106021591A (en) | 2016-06-06 | 2016-06-06 | Data processing method and system for terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106021591A true CN106021591A (en) | 2016-10-12 |
Family
ID=57089647
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610395581.2A Pending CN106021591A (en) | 2016-06-06 | 2016-06-06 | Data processing method and system for terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106021591A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108920606A (en) * | 2018-06-28 | 2018-11-30 | 腾讯大地通途(北京)科技有限公司 | map data processing method, device, terminal device and storage medium |
CN113448995A (en) * | 2020-03-25 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Database operation method, device and system, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104424299A (en) * | 2013-09-02 | 2015-03-18 | 腾讯科技(深圳)有限公司 | Data statistical method and device |
CN104618503A (en) * | 2015-02-15 | 2015-05-13 | 西安酷派软件科技有限公司 | Inter-system data synchronization and sharing method and device as well as terminal |
CN104866366A (en) * | 2015-06-15 | 2015-08-26 | 广东欧珀移动通信有限公司 | Application clearing method and application clearing device |
CN104902089A (en) * | 2015-05-26 | 2015-09-09 | 北京金和网络股份有限公司 | Method for sequencing mobile terminal applications |
CN105045623A (en) * | 2015-07-13 | 2015-11-11 | 四川长虹电器股份有限公司 | Intelligent operating system based application configuration method |
-
2016
- 2016-06-06 CN CN201610395581.2A patent/CN106021591A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104424299A (en) * | 2013-09-02 | 2015-03-18 | 腾讯科技(深圳)有限公司 | Data statistical method and device |
CN104618503A (en) * | 2015-02-15 | 2015-05-13 | 西安酷派软件科技有限公司 | Inter-system data synchronization and sharing method and device as well as terminal |
CN104902089A (en) * | 2015-05-26 | 2015-09-09 | 北京金和网络股份有限公司 | Method for sequencing mobile terminal applications |
CN104866366A (en) * | 2015-06-15 | 2015-08-26 | 广东欧珀移动通信有限公司 | Application clearing method and application clearing device |
CN105045623A (en) * | 2015-07-13 | 2015-11-11 | 四川长虹电器股份有限公司 | Intelligent operating system based application configuration method |
Non-Patent Citations (3)
Title |
---|
余永佳,等: "《Android应用开发基础 基于Android4.2、任务驱动式》", 30 September 2014 * |
吴倩,等: "《Android 安全机制解析与应用实践》", 31 May 2013 * |
陈文,等: "《深入理解Android网络编程技术详解与最佳实践》", 31 August 2013 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108920606A (en) * | 2018-06-28 | 2018-11-30 | 腾讯大地通途(北京)科技有限公司 | map data processing method, device, terminal device and storage medium |
CN108920606B (en) * | 2018-06-28 | 2020-10-23 | 腾讯大地通途(北京)科技有限公司 | Map data processing method, map data processing device, terminal equipment and storage medium |
CN113448995A (en) * | 2020-03-25 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Database operation method, device and system, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10565293B2 (en) | Synchronizing DOM element references | |
WO2018112896A1 (en) | Chat interaction method and apparatus, and electronic device thereof | |
US9015657B2 (en) | Systems and methods for developing and delivering platform adaptive web and native application content | |
JP2019530921A (en) | Method and system for server-side rendering of native content for presentation | |
CN114416877A (en) | Data processing method, device and equipment and readable storage medium | |
CN110347319A (en) | It is a kind of to apply interior screenshot method and device | |
CN106021591A (en) | Data processing method and system for terminal | |
CN116263659A (en) | Data processing method, apparatus, computer program product, device and storage medium | |
CN114896161A (en) | File construction method and device based on artificial intelligence, computer equipment and medium | |
CN112527278A (en) | Smart form generating and issuing method, device, terminal and storage medium | |
CN117435106A (en) | Page generation method and device, electronic equipment and storage medium | |
US20140297736A1 (en) | Data interchange system | |
CN105528350B (en) | Complex scene and background data mapping synchronization method and device based on unity3D platform | |
CN116303888A (en) | Rarely used word processing method and device, storage medium and electronic equipment | |
JP2018509714A (en) | Search term list providing apparatus and method using the same | |
CN116069850A (en) | Classroom activity courseware manufacturing method and device, storage medium and electronic equipment | |
CN105608097A (en) | Method and device for adaptively adjusting database structure | |
CN113992989A (en) | Content display method, device, system, equipment and storage medium | |
US20170075880A1 (en) | Translation for web services | |
CN112086152B (en) | Electronic medical record viewing method, device, equipment and medium | |
CN113961571B (en) | Multi-mode data sensing method and device based on data probe | |
CN117235236B (en) | Dialogue method, dialogue device, computer equipment and storage medium | |
CN114996345B (en) | Online service combination method based on OGC network processing service | |
EP3166017A1 (en) | Method for projecting workspace and system using same | |
CN115062598A (en) | Training information processing method, device, equipment and medium based on member adding system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161012 |
|
RJ01 | Rejection of invention patent application after publication |