CN105653267B - Electronic equipment and data processing method - Google Patents

Electronic equipment and data processing method Download PDF

Info

Publication number
CN105653267B
CN105653267B CN201510999401.7A CN201510999401A CN105653267B CN 105653267 B CN105653267 B CN 105653267B CN 201510999401 A CN201510999401 A CN 201510999401A CN 105653267 B CN105653267 B CN 105653267B
Authority
CN
China
Prior art keywords
data
thread
processed
initial
processing method
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
Application number
CN201510999401.7A
Other languages
Chinese (zh)
Other versions
CN105653267A (en
Inventor
李侠懿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xindong Network Co Ltd
Original Assignee
Xindong Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xindong Network Co Ltd filed Critical Xindong Network Co Ltd
Priority to CN201510999401.7A priority Critical patent/CN105653267B/en
Publication of CN105653267A publication Critical patent/CN105653267A/en
Application granted granted Critical
Publication of CN105653267B publication Critical patent/CN105653267B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of electronic equipment and data processing method, and the data processing method is used for the program with user interface, comprising: UI thread reads UI data to be processed;The UI thread sends instruction information to the data thread;After the data thread receives the instruction information, reads and handle initial data corresponding with the UI data to be processed;And will treated that initial data is converted to UI data, replace the UI data to be processed in the UI thread, and by the initial data initial data that is updated to that treated.Electronic equipment provided by the invention and data processing method can improve the response speed of program user interface.

Description

Electronic equipment and data processing method
Technical field
The present invention relates to data processing field more particularly to a kind of electronic equipment and data processing method.
Background technique
With the development of science and technology, it is more and more using the user of electronic equipment (such as mobile phone, tablet computer), it is each realizing After class basic function, user starts more to focus on user interface for electronic devices interactive experience and data processing speed.Therefore, how Device data processing is improved under existing hardware equipment and response speed is asking for the wanted emphasis consideration of application development now Topic.
In the prior art, when operation has the program of user interface in the electronic equipment of mobile phone, tablet computer etc, lead to The operation such as user interface interaction, mathematical logic processing, user interface updating is often only completed with a thread.It is equivalent to so logical Thread is crossed to receive data that user input by user interface, then handle the data of user's input, finally again Data that treated are updated to user interface.The data processing method of single thread in this way makes user complete a data processing After could carry out next data processing again, entire data handling procedure makes user interface response speed cause to use slowly excessively more slowly Family interface Caton, and then influence the experience that user uses electronic equipment.
Summary of the invention
The present invention provides a kind of electronic equipment and data processing method to overcome the problems of the above-mentioned prior art, Its response speed that can improve program user interface.
The present invention provides a kind of data processing method, for the program with user interface, comprising: UI thread is read wait locate Manage UI data;The UI thread sends instruction information to the data thread;After the data thread receives the instruction information, It reads and handles initial data corresponding with the UI data to be processed;And initial data is converted to UI number by treated According to replacing the UI data to be processed in the UI thread, and by the initial data initial data that is updated to that treated.
Preferably, the UI data and the initial data mirror image each other.
Preferably, the UI data are stored in the different sections in same database from the initial data.
Preferably, each UI data and initial data corresponding with the UI data are adjacently stored in same database In.
Preferably, the data thread according to the storage address of the UI data to be processed and with UI to be processed number described in this The initial data is read according to the address offset amount of corresponding initial data.
Preferably, the UI data have UI data structure, will treated initial data is converted to UI data include: by The data structure for initial data that treated is converted to the UI data structure.
Preferably, the UI data to be processed in UI thread are replaced by atomic operation.
Preferably, before UI thread reads UI data to be processed further include: the UI thread judges the UI data currently read It whether is UI data to be processed.
According to another aspect of the invention, a kind of electronic equipment is also provided, the electronic equipment installation has user interface Program, the electronic equipment includes: processor, is configured to execute above-mentioned data processing method.
Compared with prior art, the present invention is by way of dual-thread, by the logical process of user interface response and data It separates, and by treated, initial data can update in user interface by corresponding UI data and initial data, and In the case where being not take up UI thread, initial data is updated, and then improve the response speed of program user interface, program is avoided to make Caton phenomenon caused by used time.
Detailed description of the invention
Its example embodiment is described in detail by referring to accompanying drawing, above and other feature of the invention and advantage will become It is more obvious.
Fig. 1 shows the flow chart of data processing method according to an embodiment of the present invention.
Fig. 2 shows the schematic diagrames of data handling procedure according to an embodiment of the present invention.
Fig. 3 shows the schematic diagram of database according to a first embodiment of the present invention.
Fig. 4 shows the schematic diagram of database according to a second embodiment of the present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes Formula is implemented, and is not understood as limited to embodiment set forth herein;On the contrary, thesing embodiments are provided so that the present invention will Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.It is identical attached in figure Icon note indicates same or similar structure, thus will omit repetition thereof.
In order to improve user interface response speed, the present invention is provided at a kind of data for the program with user interface Reason method.Data processing method includes 4 steps, and flow chart is referring to Fig. 1.
Step S110, UI thread reads UI data to be processed.
Step S120, UI thread sends an instruction information to data thread.
Step S130 reads after data thread receives instruction information and handles original number corresponding with UI data to be processed According to, wherein UI data and initial data mirror image each other.
Step S140, by treated, initial data is converted to UI data, replaces the UI number to be processed in the UI thread According to, and by the initial data initial data that is updated to that treated.Specifically, UI data have UI data structure, pass through The data structure of treated initial data is converted into UI data structure to convert raw data into UI data.In order to guarantee The update of UI data will not be interrupted by the processing of UI thread, and the present invention is replaced to be processed in UI thread by atomic operation UI data.
Data processing method provided by the present invention can be applicable on such as electronic equipment of mobile phone, tablet computer.Specifically For, electronic equipment is equipped with program with user interface, such as QQ, wechat, photograph program, social networks program etc..Electricity There is sub- equipment processor to execute data processing method provided by the invention.It is provided by the invention in a specific embodiment Data processing method is referring to fig. 2.
User passes through the user interface input data of program.The data that user is inputted by user interface are as to be processed UI data can be the text of keyboard input of the user by electronic equipment (for example, the comment of social networks program, communication The short message etc. of program), it is also possible to selection that user carried out according to the option that program user interface provides (such as on returning One, return to homepage etc.), can also be that user passes through operation (such as point that touch screen or key are carried out on a user interface Hit, pull, long-pressing etc.) or the targeted object (such as picture, video, audio etc.) of above-mentioned operations.
After user inputs UI data by user interface, UI thread reads UI data to be processed.UI thread reads to be processed After UI data, judge whether UI data to be processed need to handle.If UI data to be processed need not move through data thread and are patrolled Collect operation, then the UI data that UI thread is inputted directly in response to user.For example, when the UI data of user's input are to return to homepage, then The UI data to be processed do not need to carry out logical operation, and UI thread returns to homepage directly to respond the UI data of user's input.This Invention, can be direct by UI thread when UI data to be processed need not move through logical operation by way of dual-thread User's input is responded, without just being responded after the completion of waiting the logical operation of each user input data before the input This user's input.
If UI data to be processed are needed by further logical operation, UI thread designation date thread pair with it is to be processed The corresponding initial data of UI data is handled.UI data and initial data store in the database to mirror image each other.It is specific and Speech usually in the interaction of user and user interface, while needing to handle many data, and therefore, the present embodiment passes through logic Queue and task queue to carry out sequence management to UI data to be processed.For example, by logic query to UI data to be processed into Row major power sequence, is handled in a manner of first in first out task queue.Specifically, logic query can lead to The operand of UI data to be processed, the priority that user drafts, priority of default etc. is crossed to carry out UI data to be processed Order of priority.In some change case, whether UI data, which need to handle, to be judged in logic query.In other change Change in example, the sequence management of UI data to be processed can be only realized by a queue structure.
UI data to be processed are output to data thread by task queue, and data thread reads corresponding with UI data to be processed Initial data.
In some embodiments, UI data are stored in the different sections in same database from initial data.Such as Fig. 3 institute Show, in one section of database, all initial data are stored in another section of database all UI data storages.It is preferred that Ground, UI data and initial data all store the address offset amount of corresponding another data.In some embodiments, own The corresponding initial data of UI data address offset amount having the same, for example, the initial data 1 that UI data 1 are corresponding Address offset amount 1 be the address offset amount 2 of the corresponding initial data 2 of 8, UI data 2 be also 8.When all UI data with When its corresponding initial data address offset amount having the same, in database each UI data and initial data can not include with The address offset amount of its corresponding another data.In some change case, the corresponding initial data of each UI data has not Same address offset amount.For example, the address offset amount 1 of the corresponding initial data 1 of UI data 1 is that 8, UI data 2 are right with it The address offset amount 2 for the initial data 2 answered is 9.In other change case, the ground of the corresponding initial data of each UI data Location offset can be updated according to processing condition data.For example, increase or delete UI data when, other UI data with it is right The address offset amount for the initial data answered can generate variation, and the present invention can be according to the variation of address offset come more new database The address offset amount of middle storage.
In some change case, each UI data and initial data corresponding with the UI data are adjacently stored in same number According in library.As shown in figure 4, the address offset amount of the corresponding initial data of each UI data is identical, for example, each UI data and its The address offset amount of corresponding initial data is all 1.
Data thread can be according to the storage address of UI data to be processed and original number corresponding with the UI data to be processed According to address offset amount read the initial data.When the mode of UI data and initial data as shown in Figure 3 stores, that is, institute Some UI data storages are in one section of database, when all initial data are stored in another section of database, data line Journey is according to UI data to be processed, such as the storage address and corresponding with the UI data 1 to be processed initial data 1 of UI data 1 Address offset amount 1 reads initial data 1.When the mode of UI data and initial data as shown in Figure 4 stores, that is, each UI number When accordingly and initial data corresponding with the UI data is adjacently stored in same database, data thread is according to UI to be processed Data, for example, UI data 1 storage address and initial data 1 corresponding with the UI data 1 to be processed value be 1 address offset Amount is to read initial data 1.
After data thread reads initial data corresponding with UI data to be processed, which is handled.Specifically For, when UI data to be processed are the image processing operations in photograph program, data thread reads image data and to root (such as amplification, diminution, shearing, contrast processing etc.) is handled to image data what user interface inputted according to user.When UI data to be processed be in games to game object operate when, data thread read game object data and to according to Family is handled (such as movement, attack of game object etc.) to the operation of game object data in user interface input.
After data thread handles initial data, by treated, initial data is converted to UI data, replaces in UI thread UI data to be processed.Specifically, UI data have UI data structure, by the way that by treated, initial data is converted to UI The UI data of data structure convert raw data into UI data.Wherein, UI data structure preferably allows UI control with most straight The mode connect is read, and initial data structure preferably balances storage overhead and computing cost.For UI data structure, in some realities It applies in example, if UI control is list UI control, UI data structure is one-dimensional data;If UI control is grid UI control, UI number It is 2-D data according to structure;If UI control is level UI control, UI data structure is stack architecture.For initial data structure, In some embodiments, red black tree or hash table can be used to balance storage overhead and computing cost.It is embodied at one In example, for example, initial data structure mileage evidence, which is that 1, UI of number is upper, to be shown: the quantity of this commodity is 1.So in initial data It will be stored with number 1, and in UI data structure can be character string.Those skilled in the art can according to be described herein as realize more The change case of more UI data structures and initial data structure, it will not be described here.
In order to guarantee that the update of UI data will not be interrupted by the processing of UI thread, the present invention is replaced by atomic operation UI data to be processed in UI thread.Further, data thread is also by the initial data initial data that is updated to that treated.
Compared with prior art, the present invention is by way of dual-thread, by the logical process of user interface response and data It separates, and by treated, initial data can update in user interface by corresponding UI data and initial data, and In the case where being not take up UI thread, initial data is updated, and then improve the response speed of program user interface, program is avoided to make Caton phenomenon caused by used time.
It is particularly shown and described exemplary embodiments of the present invention above.It should be understood that the present invention is not limited to institute Disclosed embodiment, on the contrary, it is intended to cover comprising various modifications within the scope of the appended claims and equivalent set It changes.

Claims (4)

1. a kind of data processing method, for the program with user interface characterized by comprising
UI thread reads UI data, and judges whether the UI data currently read are UI data to be processed;
If so, the UI thread sends instruction information to data thread;
After the data thread receives the instruction information, reads and handle original number corresponding with the UI data to be processed According to;And
The data structure of treated initial data is converted into UI data structure to be converted to UI data, replaces the UI thread In UI data to be processed, and by the initial data initial data that is updated to that treated, the UI data with it is described original Data mirror image each other, wherein the UI data have UI data structure,
The UI data are stored in the different sections in same database from the initial data;Or each UI data and Initial data corresponding with the UI data is adjacently stored in same database.
2. data processing method as described in claim 1, which is characterized in that the data thread is according to the UI number to be processed According to storage address and the address offset amount of initial data corresponding with UI to be processed data described in this read the initial data.
3. data processing method as described in claim 1, which is characterized in that by atomic operation replace UI thread in wait locate Manage UI data.
4. a kind of electronic equipment, the electronic equipment installation has the program of user interface, which is characterized in that the electronic equipment Include:
Processor is configured to execute data processing method as described in any one of claims 1 to 3.
CN201510999401.7A 2015-12-28 2015-12-28 Electronic equipment and data processing method Expired - Fee Related CN105653267B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510999401.7A CN105653267B (en) 2015-12-28 2015-12-28 Electronic equipment and data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510999401.7A CN105653267B (en) 2015-12-28 2015-12-28 Electronic equipment and data processing method

Publications (2)

Publication Number Publication Date
CN105653267A CN105653267A (en) 2016-06-08
CN105653267B true CN105653267B (en) 2019-05-07

Family

ID=56478010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510999401.7A Expired - Fee Related CN105653267B (en) 2015-12-28 2015-12-28 Electronic equipment and data processing method

Country Status (1)

Country Link
CN (1) CN105653267B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567338A (en) * 2010-12-16 2012-07-11 凌群电脑股份有限公司 Data synchronization system capable of simulating system logs
CN103593231A (en) * 2012-08-14 2014-02-19 腾讯科技(深圳)有限公司 Data processing method and device and mobile terminal
CN104252379A (en) * 2013-06-25 2014-12-31 腾讯科技(深圳)有限公司 Picture thumbnail display method and device
CN104598322A (en) * 2014-12-31 2015-05-06 北京奇虎科技有限公司 Method and device for communicating among multiple window components
CN104866291A (en) * 2014-02-24 2015-08-26 上海连梦文化传播有限公司 Android-based 2D mobile game engine
CN104899039A (en) * 2015-06-12 2015-09-09 百度在线网络技术(北京)有限公司 Method and device for providing screen shooting service in terminal device
CN105183547A (en) * 2015-08-13 2015-12-23 青岛海信移动通信技术股份有限公司 Task scheduling method and device of user interface

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547161B (en) * 2008-03-28 2012-09-26 阿里巴巴集团控股有限公司 Folder transmission system, folder transmission device and folder transmission method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567338A (en) * 2010-12-16 2012-07-11 凌群电脑股份有限公司 Data synchronization system capable of simulating system logs
CN103593231A (en) * 2012-08-14 2014-02-19 腾讯科技(深圳)有限公司 Data processing method and device and mobile terminal
CN104252379A (en) * 2013-06-25 2014-12-31 腾讯科技(深圳)有限公司 Picture thumbnail display method and device
CN104866291A (en) * 2014-02-24 2015-08-26 上海连梦文化传播有限公司 Android-based 2D mobile game engine
CN104598322A (en) * 2014-12-31 2015-05-06 北京奇虎科技有限公司 Method and device for communicating among multiple window components
CN104899039A (en) * 2015-06-12 2015-09-09 百度在线网络技术(北京)有限公司 Method and device for providing screen shooting service in terminal device
CN105183547A (en) * 2015-08-13 2015-12-23 青岛海信移动通信技术股份有限公司 Task scheduling method and device of user interface

Also Published As

Publication number Publication date
CN105653267A (en) 2016-06-08

Similar Documents

Publication Publication Date Title
JP7013466B2 (en) Application data processing methods, equipment, and computer programs
CN111190718A (en) Method, device and system for realizing task scheduling
US10387161B2 (en) Techniques for capturing state information and performing actions for threads in a multi-threaded computing environment
CN103294335A (en) Apparatus and method for creating a shortcut menu
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
US11115362B2 (en) Method and system for presenting conversation thread
US10921974B2 (en) Using drag and drop to apply metadata
CN103678704A (en) Picture recognition method, system, equipment and device based on picture information
US9070120B2 (en) Identifying and displaying a set of high priority contacts on a display device
CN103678706A (en) Picture recognition method, system, equipment and device based on screenshot information
US11243679B2 (en) Remote data input framework
US9043464B1 (en) Automatically grouping resources accessed by a user
KR20210095126A (en) Context-Based Recommendation Techniques for Designing Robotic Process Automation
CN105653267B (en) Electronic equipment and data processing method
US20160313910A1 (en) Method and device for organizing a plurality of items on an electronic device
CN115617441A (en) Method and device for binding model and primitive, storage medium and computer equipment
CN113010059B (en) Application icon management method and device and electronic equipment
US11491404B2 (en) Method and system for replacing player in sports game
EP2763001A1 (en) Information input method and touch screen terminal
US20130055138A1 (en) Dynamically changing key selection based on context
KR102158544B1 (en) Method and system for supporting spell checking within input interface of mobile device
CN113407078A (en) Method and device for editing character icon, storage medium and terminal
CN112578961A (en) Application identifier display method and device
US20180239640A1 (en) Distributed data processing system, and distributed data processing method
US10191621B2 (en) Exposing populated lists of personalized strings

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20190507

Termination date: 20211228

CF01 Termination of patent right due to non-payment of annual fee