CN108874344B - Data refreshing method, terminal equipment and computer readable medium - Google Patents

Data refreshing method, terminal equipment and computer readable medium Download PDF

Info

Publication number
CN108874344B
CN108874344B CN201810627595.1A CN201810627595A CN108874344B CN 108874344 B CN108874344 B CN 108874344B CN 201810627595 A CN201810627595 A CN 201810627595A CN 108874344 B CN108874344 B CN 108874344B
Authority
CN
China
Prior art keywords
interface
data
key
computer
same
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.)
Active
Application number
CN201810627595.1A
Other languages
Chinese (zh)
Other versions
CN108874344A (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.)
Golo Iov Data Technology Co ltd
Original Assignee
Golo Iov Data Technology 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 Golo Iov Data Technology Co ltd filed Critical Golo Iov Data Technology Co ltd
Priority to CN201810627595.1A priority Critical patent/CN108874344B/en
Publication of CN108874344A publication Critical patent/CN108874344A/en
Application granted granted Critical
Publication of CN108874344B publication Critical patent/CN108874344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1454Digital output to display device ; Cooperation and interconnection of the display device with other functional units involving copying of the display data of a local workstation or window to a remote workstation or window so that an actual copy of the data is displayed simultaneously on two or more displays, e.g. teledisplay
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention discloses a data refreshing method, terminal equipment and a computer readable medium, wherein the method comprises the following steps: when first data sent by a lower computer are received, the first data are stored in a first interface. And then comparing the first data in the first interface with the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface. And finally, processing the data in the first interface, which is the same as the data in the second interface, and refreshing the display interface by adopting the processed data in the first interface. The method has the advantages that repeated data in the data stream uploaded by the lower computer and the current display interface are filtered, and then only changed data are refreshed and stored, so that the expenditure of storage space can be reduced, and the overflow of the memory of the upper computer possibly generated in the frequent transmission of the data stream can be avoided when the lower computer communicates with the upper computer, so that the smoothness of the display interface is ensured.

Description

Data refreshing method, terminal equipment and computer readable medium
Technical Field
The invention relates to the technical field of automobile data flow, in particular to a data refreshing method, terminal equipment and a computer readable medium.
Background
The automobile data flow refers to data parameters communicated with the sensors and the actuators by an Electronic Control Unit (ECU), and the data flow memorized in the ECU truly reflects the working voltage and the state of each sensor and each actuator, so that a basis is provided for automobile fault diagnosis. The lower computer reads the automobile data stream and then is connected with the upper computer through the Bluetooth to upload the automobile data stream to the upper computer. The upper computer establishes connection with the Bluetooth device through the Bluetooth device to receive data streams, and analyzes data according to a communication protocol and converts the data into readable real-time data of the automobile condition.
After the upper computer is connected with the lower computer, in the communication process, as data streams (including data such as vehicle speed, rotating speed, coolant temperature and the like) need to be updated in real time, the lower computer often needs to send a plurality of data frames to the upper computer within 1 second. If the data stream continuously receives data storage, the memory of the upper computer is easy to overflow.
Disclosure of Invention
The embodiment of the invention provides a data refreshing method, which can avoid the possible overflow of the memory of an upper computer in the frequent transmission of data streams when a lower computer and the upper computer communicate, thereby ensuring the smoothness of a display interface.
In a first aspect, an embodiment of the present invention provides a data refresh method, where the method includes:
when first data sent by a lower computer is received, the first data are stored in a first interface;
comparing first data in the first interface with data in a second interface, wherein the data in the second interface is data currently displayed by a display interface;
processing the same data in the first interface and the second interface;
and refreshing the display interface by adopting the processed data in the first interface.
Optionally, before the storing the first data in the first interface, the method further includes:
judging whether the first data is received first frame data or not;
and if so, storing the first data into the second interface, and displaying the first data on the display interface.
Optionally, after the storing the first data in the first interface, before the comparing the first data in the first interface with the data in the second interface, the method further includes:
determining whether the first interface is equal to the second interface;
and if not, performing the comparison on the first data in the first interface and the data in the second interface.
Further, the first data stored in the first interface includes a key and a value, and the comparing the first data in the first interface with the data in the second interface includes:
traversing keys in the second interface with keys in the first interface in sequence to compare values corresponding to each key in the first interface and the second interface;
if the values corresponding to the same key exist in the first interface and the second interface are equal, determining that the key value pair is the data in the first interface which is the same as the data in the second interface;
the processing of the same data in the first interface as the data in the second interface comprises:
and deleting the key value pair which is the same as the key value pair of the second interface in the first interface.
Optionally, after traversing the keys in the second interface sequentially with the keys in the first interface to compare the key values corresponding to each key in the first interface and the second interface, the method further includes
If the key exists in the first interface and the second interface and the value corresponding to the key is the same but not equal, replacing the value corresponding to the key in the second interface with the value corresponding to the key in the first interface;
or if a key which does not exist in the second interface exists in the first interface, adding the key value pair in the first interface into the second interface.
In a second aspect, an embodiment of the present invention provides a terminal device, where the terminal device includes:
the storage unit is used for storing first data into a first interface when the first data sent by the lower computer are received;
the comparison unit is used for comparing first data in the first interface with data in a second interface, wherein the data in the second interface is data currently displayed by a display interface;
the processing unit is used for processing the data in the first interface, which is the same as the data in the second interface;
and the refreshing unit is used for refreshing the display interface by adopting the processed data in the first interface.
Optionally, the terminal device further includes:
a first judging unit, configured to judge whether the first data is received first frame data;
the storage unit is further configured to store the first data in the second interface if the first determination unit determines that the first data is stored in the second interface;
and the display unit is used for displaying the first data on the display interface.
Optionally, the terminal device further includes:
a second determining unit, configured to determine whether the first interface is equal to the second interface;
the comparing unit is configured to compare the first data in the first interface with the data in the second interface when the second determining unit determines that the first interface is not the first interface.
Further, the comparison unit includes:
the traversal unit is used for sequentially traversing the keys in the second interface by using the keys in the first interface so as to compare the corresponding values of each key in the first interface and the second interface;
a determining unit, configured to determine that the key value pair is data in the first interface that is the same as data in the second interface if values corresponding to the same key exist in the first interface and the second interface are equal;
the processing unit is configured to delete a key value pair in the first interface that is the same as a key value pair in the second interface.
Optionally, the terminal device further includes:
a replacing unit, configured to replace a value corresponding to a key in the second interface with a value corresponding to the key in the first interface if the key exists in the first interface and the second interface and the values corresponding to the key are not equal to each other;
and the adding unit is used for adding the key value pair in the first interface into the second interface if a key which does not exist in the second interface exists in the first interface.
In a third aspect, an embodiment of the present invention provides another terminal device, which includes a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store a computer program that supports the terminal device to execute the foregoing method, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the foregoing method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions, which, when executed by a processor, cause the processor to perform the method of the first aspect.
In the embodiment of the invention, when first data sent by a lower computer is received, the first data is stored in a first interface. And then comparing the first data in the first interface with the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface. And finally, processing the data in the first interface, which is the same as the data in the second interface, and refreshing the display interface by adopting the processed data in the first interface. By the embodiment of the invention, the overflow of the memory of the upper computer possibly generated in the frequent transmission of the data stream can be avoided when the lower computer communicates with the upper computer, so that the smoothness of a display interface is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a data refresh method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of another data refresh method provided by an embodiment of the invention;
FIG. 3 is a schematic flow chart of another data refresh method provided in the embodiment of the present invention
Fig. 4 is a schematic block diagram of a terminal device according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a terminal according to another embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, the terminal devices described in embodiments of the invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a terminal device that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal device may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal device supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal device may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal device may be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal device may support various applications with user interfaces that are intuitive and transparent to the user.
Referring to fig. 1, fig. 1 is a schematic flow chart of a data refresh method provided in an embodiment of the present invention, and as shown in the figure, the method may include:
101: and when first data sent by a lower computer is received, the first data is stored in a first interface.
The automobile data flow refers to data parameters communicated with a sensor and an actuator by an Electronic Control Unit (ECU), and comprises information such as coolant temperature, engine speed, engine load, duration of fuel injection of each cycle of the engine and the like, and the data parameters can be read by a diagnostic instrument to provide basis for automobile fault diagnosis. When the automobile breaks down, the fault point of the automobile can be detected by reading the automobile data stream; when the fault does not occur, the fault can be prevented by reading the automobile data stream to detect the working state of the automobile. The lower computer reads the automobile data stream and then is connected with the upper computer through the Bluetooth to upload the automobile data stream to the upper computer. The upper computer establishes connection with the Bluetooth device through the Bluetooth device to receive data streams, and analyzes data according to a communication protocol and converts the data into readable real-time data of the automobile condition. After the upper computer is connected with the lower computer, in the communication process, as the data stream needs to be updated in real time, the lower computer often needs to send a plurality of data frames to the upper computer within 1 second.
In the embodiment of the invention, when the upper computer receives the first data sent by the lower computer, the first data is stored in the first interface.
The first data is a frame of data uploaded to the upper computer by the lower computer, and the first data can comprise information such as coolant temperature, engine speed, engine load, duration of injection of each cycle of the engine and the like.
When the data is stored in the first interface, the interface includes a plurality of keys and corresponding values, for example, the map interface may include key1, value1, key2, value2, key/3, and value3 …
Specifically, after the upper computer receives the first data, the first data is stored in the first interface. It is understood that, when the first data is stored, the key (key) corresponding to a single data in the first data is fixed, for example, the first data includes the coolant temperature, the engine speed, and the engine load, then the coolant temperature is fixed corresponding to key1, the engine speed is fixed corresponding to key2, and the engine load is fixed corresponding to key 3.
102: and comparing the first data in the first interface with the data in the second interface.
Wherein, the data in the second interface is the data currently displayed on the display interface
In the embodiment of the present invention, after the upper computer receives first data and stores the first data in the first interface, the upper computer compares the data in the first interface with the data in the second interface, so as to extract a portion of the first data that is different from the data displayed on the current display interface, or extract the same portion of the first data and the data in the second interface; the method comprises the steps of finding out part of subsequently uploaded data which are changed from data displayed on a current display interface, so that the changed data are used for refreshing the display interface, and the data of the display interface are not required to be refreshed completely.
103: and processing the same data in the first interface and the second interface.
In an embodiment of the present invention, after the first data in the first interface and the data in the second interface are compared to obtain the same data in the first data as the data in the second interface, the same data in the first interface is deleted, that is, only the data changed from the display interface is left in the data in the first interface.
104: and refreshing the display interface by adopting the processed data in the first interface.
In an embodiment of the present invention, after the same data as the data in the second interface is processed in the first interface, the display interface is refreshed by using the processed data in the first interface.
Specifically, when the data in the same portion as the data in the second interface in the first interface is deleted and only the data changed from the display interface is left in the data in the first interface, the data in the first interface is used to refresh the data in the display interface. When the display interface is refreshed, replacing the data corresponding to the data in the display interface and the first interface with the data in the first interface, and keeping other data in the display interface unchanged.
It can be seen that, in the embodiment of the present invention, after receiving the first data sent by the lower computer, the first data is stored in the first interface. And then comparing the first data in the first interface with the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface. And finally, processing the data in the first interface, which is the same as the data in the second interface, and refreshing the display interface by adopting the processed data in the first interface. By the embodiment of the invention, the repeated data in the data stream uploaded by the lower computer and the current display interface are filtered, and then only the changed data is refreshed and stored, so that the expenditure of storage space can be reduced, and the overflow of the memory of the upper computer possibly generated in the frequent transmission of the data stream can be avoided when the lower computer communicates with the upper computer, thereby ensuring the smoothness of the display interface.
Referring to fig. 2, fig. 2 is a schematic flow chart of a data refresh method provided in an embodiment of the present invention, and as shown in the figure, the method may include:
201: and receiving first data sent by the lower computer.
The first data is a frame of data uploaded to the upper computer by the lower computer, and the first data can comprise information such as coolant temperature, engine speed, engine load, duration of injection of each cycle of the engine and the like.
202: and judging whether the first data is the first frame data uploaded by the lower computer.
Specifically, after receiving first data sent by the lower computer, the upper computer judges whether the first data is first frame data uploaded by the lower computer, and if the first data is the first frame data, the first data is stored in the second interface and is displayed on the display interface; if the first data is not the first frame data, step 203 is executed.
It is to be understood that, the execution order of the two steps of "storing the first data in the second interface and displaying the first data on the display interface" is not limited in the embodiment of the present invention. First, storing the first data into the second interface, and then displaying the first data on a display interface; or the first data may be displayed on the display interface first, and then the first data may be stored in the second interface; it may also be performed in parallel.
203: and storing the first data into the first interface.
204: and judging whether the first interface is equal to the second interface or not.
Specifically, after the upper computer stores the first data into the first interface, whether the first interface is equal to the second interface or not is judged, if the first interface is equal to the second interface, the data in the first interface is cleared, and then the next frame of data is waited and stored; if the first interface and the second interface are not equal, step 205 is executed continuously.
The condition for judging the first interface and the second interface to be equal is that all keys in the first interface and the second interface are equal, and the values corresponding to all the keys are also equal.
205: and traversing the keys in the second interface by using the keys in the first interface in sequence to compare the corresponding values of each key in the first interface and the second interface.
Specifically, the total keys of the first interface are sequentially used to traverse the keys of the second interface to compare the corresponding values of each key of the first interface and the second interface. For example, the first interface includes a build-up value pair of two data of the engine speed and the coolant temperature, the key corresponding to the engine speed is used to traverse the key in the second interface to check whether the key corresponding to the engine speed and the coolant temperature exists in the second interface, and if so, the two values of the engine speed and the coolant temperature are compared to determine whether the two values of the engine speed and the coolant temperature change.
206: and if the values corresponding to the same key exist in the first interface and the second interface are equal, determining that the key value pair is the same data in the first interface and the second interface.
207: and deleting the key value pair which is the same as the key value pair of the second interface in the first interface.
For example, the first interface and the second interface both have data of the engine speed, and the values of the engine speed are equal to each other, the key value pair corresponding to the engine speed is the same data as the data in the second interface in the first interface, and the key value pair corresponding to the engine speed in the first interface is deleted so that the data of the engine speed is not refreshed when the display interface is refreshed thereafter.
In practical applications, there may be a case where the previous frame data and the next frame data have more data than the next frame data, where the data is not present in the previous frame data, for example, the data currently displayed on the interface only includes the data of the engine speed and the coolant temperature, and the data currently received from the lower computer has more data of the fuel injection duration per engine cycle, and the data of the fuel injection duration per engine cycle is also added to the display interface after the display interface is refreshed. Therefore, in order to make the data in the second interface consistent with the data in the display interface, the duration of injection per cycle of the engine needs to be added to the second interface.
As an optional implementation manner, after traversing the keys in the second interface by using the keys in the first interface in sequence to compare the key values corresponding to each key in the first interface and the second interface, if the keys exist in the first interface and the second interface and the values corresponding to the keys are the same but not equal, replacing the value corresponding to the key in the second interface with the value corresponding to the key in the first interface; and if the key which does not exist in the second interface exists in the first interface, adding the key value pair in the first interface to the second interface.
For example, the first interface is map1, and the second interface is map 2. Among them, data in map1 is ((key1, value5), (key2, value6), (key3, value3), (key5, value7)), and data in map2 is ((key1, value1), (key2, value2), (key3, value3), (key4, value 4)). For example, key1 corresponds to the number of engine revolutions, and value1 is a specific corresponding value. The keys 1, 2, 3 and 5 in the map1 are used to traverse the keys 1, 2, 3 and 5 in the map2 to determine whether equal construction exists in the maps 1 and 2. If there is no key in map2 equal to the key being traversed in map1 during traversal, the value in map1 corresponding to that key is added to map 2. If the keys are equal, continuously judging whether the corresponding values are equal; if yes, deleting the key in map1 and the corresponding value; if not, the value corresponding to the key in map2 is replaced with the value corresponding to the key in map 1. After traversal, it is found that there are three keys equal to key1, key2, key3 in map1 and map2, and there is no key equal to key5 in map 2. Therefore, after traversal and corresponding processing, the data in map1 is ((key1, value5), (key2, value6), (key5, value7)), and the data in map2 is ((key1, value5), (key2, value6), (key3, value3), (key4, value4), (key5, value 7)).
208: and refreshing the display interface by adopting the processed data in the first interface.
In order to keep the data in the second interface consistent with the data in the display interface, as another alternative embodiment, after the display interface is refreshed by using the processed data in the first interface, the data in the second interface may be updated by using the processed data in the first interface.
It can be seen that, in the embodiment of the present invention, after receiving the first data sent by the lower computer, the first data is stored in the first interface. And then comparing the first data in the first interface with the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface. And finally, processing the data in the first interface, which is the same as the data in the second interface, and refreshing the display interface by adopting the processed data in the first interface. By the embodiment of the invention, the repeated data in the data stream uploaded by the lower computer and the current display interface are filtered, and then only the changed data is refreshed and stored, so that the expenditure of storage space can be reduced, and the overflow of the memory of the upper computer possibly generated in the frequent transmission of the data stream can be avoided when the lower computer communicates with the upper computer, thereby ensuring the smoothness of the display interface.
Referring to fig. 3, fig. 3 is a schematic flow chart of another data refreshing method provided by an embodiment of the present invention, and as shown in the figure, the method may include:
in an embodiment of the present invention, the first interface is map1, and the second interface is map 2.
301: and receiving first data sent by the lower computer.
The first data is a frame of data uploaded to the upper computer by the lower computer, and the first data can comprise information such as coolant temperature, engine speed, engine load, duration of injection of each cycle of the engine and the like.
302: and judging whether the first data is first frame data or not.
Specifically, after receiving the first data, determining a value X of a determiner, and when the value X of the determiner is 0, determining that the first data is first frame data; and when the value X of the judger is 1, determining that the first data is not the first frame data.
If the first data is the first frame data, go to step 304; if the first data is not the first frame data, step 303 is executed.
303: the first data is stored in the map 1.
304: the first data is stored in the map2, and the first data is displayed on the display interface.
305: whether the map1 and the map2 are equal or not is judged.
Specifically, after the upper computer stores the first data in the map1, it is determined whether the map1 and the map2 are equal, and if the map1 and the map2 are equal, step 306 is executed, and then the next frame of data is waited and stored; if the first interface and the second interface are not equal, continue to execute step 307.
306: the data in map1 is cleared.
307: sequentially using the keys in the map1 to traverse the keys in the map2 to judge whether the keys exist1nAnd key2mAre equal.
Wherein, key1nIs the key in map1, n is the number of keys in map1, key1mIs the key in map2, and m is the number of keys in map 2.
If key exists1nAnd key2mIf yes, go to step 308, if no key exists1nAnd key2mStep 309 is performed if equal.
308: judging value1nAnd value2mWhether or not equal.
Wherein value1nIs key1nCorresponding value, value2mIs key2mThe corresponding value.
If value1nAnd value2mIf not, go to step 310, if value1nAnd value2mIf equal, go to step 311.
309: key in map11nAnd value1nAdded to map 2.
310: value in map22mReplace with value in map11n
311: key in map11nAnd value1nAnd (5) deleting.
312: the display interface is refreshed with the data in map 1.
After the display interface is refreshed, the data in map1 is cleared.
It can be seen that, in the embodiment of the present invention, after receiving the first data sent by the lower computer, the first data is stored in the first interface. And then comparing the first data in the first interface with the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface. And finally, processing the data in the first interface, which is the same as the data in the second interface, and refreshing the display interface by adopting the processed data in the first interface. By the embodiment of the invention, the repeated data in the data stream uploaded by the lower computer and the current display interface are filtered, and then only the changed data is refreshed and stored, so that the expenditure of storage space can be reduced, and the overflow of the memory of the upper computer possibly generated in the frequent transmission of the data stream can be avoided when the lower computer communicates with the upper computer, thereby ensuring the smoothness of the display interface.
The embodiment of the present invention further provides a terminal device, where the terminal device is configured to execute the unit of any one of the foregoing methods. Specifically, referring to fig. 4, fig. 4 is a schematic block diagram of a terminal device according to an embodiment of the present invention. The terminal device of the embodiment includes: memory unit 410, comparison unit 420, processing unit 430, and refresh unit 440.
A storage unit 410, configured to store first data sent by a lower computer into a first interface when the first data is received;
a comparing unit 420, configured to compare first data in the first interface with data in a second interface, where the data in the second interface is data currently displayed on a display interface;
a processing unit 430, configured to process data in the first interface that is the same as data in the second interface;
the refreshing unit 440 is configured to refresh the display interface with the processed data in the first interface.
Optionally, the terminal device further includes:
a first determining unit 450, configured to determine whether the first data is received first frame data;
the storage unit 410 is further configured to store the first data in the second interface if the first determination unit determines that the first data is valid;
the display unit 460 is configured to display the first data on the display interface.
Optionally, the terminal device further includes:
a second determining unit 470, configured to determine whether the first interface is equal to the second interface;
the comparing unit is configured to compare the first data in the first interface with the data in the second interface when the second determining unit determines that the first interface is not the first interface.
Further, the comparing unit includes:
a traversing unit 421, configured to sequentially traverse the keys in the second interface with the keys in the first interface, so as to compare values corresponding to each key in the first interface and each key in the second interface;
a determining unit 422, configured to determine that the key value pair is the same data in the first interface as the data in the second interface if the values corresponding to the same key exist in the first interface and the second interface are equal;
the processing unit 430 is configured to delete the key value pair in the first interface that is the same as the key value pair in the second interface.
Optionally, the processing unit further includes:
a replacing unit 431, configured to replace a value corresponding to a key in the second interface with a value corresponding to the key in the first interface if the key exists in the first interface and the key exists in the second interface, but the values corresponding to the key are not equal to each other;
an adding unit 432, configured to add the key value pair in the first interface to the second interface if a key that is not present in the second interface is present in the first interface.
It can be seen that, in the embodiment of the present invention, after receiving the first data sent by the lower computer, the first data is stored in the first interface. And then comparing the first data in the first interface with the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface. And finally, processing the data in the first interface, which is the same as the data in the second interface, and refreshing the display interface by adopting the processed data in the first interface. By the embodiment of the invention, the repeated data in the data stream uploaded by the lower computer and the current display interface are filtered, and then only the changed data is refreshed and stored, so that the expenditure of storage space can be reduced, and the overflow of the memory of the upper computer possibly generated in the frequent transmission of the data stream can be avoided when the lower computer communicates with the upper computer, thereby ensuring the smoothness of the display interface.
Referring to fig. 5, a schematic block diagram of a terminal according to another embodiment of the present invention is shown. The terminal in this embodiment as shown in the figure may include: one or more processors 501; one or more input devices 502, one or more output devices 503, and memory 504. The processor 501, the input device 502, the output device 503, and the memory 504 are connected by a bus 505. The memory 502 is used to store computer programs comprising program instructions, and the processor 501 is used to execute the program instructions stored by the memory 502. Wherein, the processor 501 is configured to call the above program instructions to execute: when first data sent by a lower computer is received, the first data are stored in a first interface; comparing the first data in the first interface with the data in a second interface, wherein the data in the second interface is the data currently displayed by a display interface; processing the same data in the first interface as the data in the second interface; and refreshing the display interface by adopting the processed data in the first interface.
It should be understood that, in the embodiment of the present invention, the Processor 501 may be a Central Processing Unit (CPU), and the Processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 502 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 503 may include a display (LCD, etc.), a speaker, etc.
The memory 504 may include both read-only memory and random access memory, and provides instructions and data to the processor 401. A portion of the storage 504 may also include non-volatile random access memory. For example, the memory 504 may also store device type information.
In a specific implementation, the processor 501, the input device 502, and the output device 503 described in this embodiment of the present invention may execute the implementation manners described in the first embodiment and the second embodiment of the data refreshing method provided in this embodiment of the present invention, and may also execute the implementation manners of the terminal described in this embodiment of the present invention, which is not described herein again.
In another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, the computer program comprising program instructions that when executed by a processor implement: when first data sent by a lower computer is received, the first data are stored in a first interface; comparing the first data in the first interface with the data in a second interface, wherein the data in the second interface is the data currently displayed by a display interface; processing the same data in the first interface as the data in the second interface; and refreshing the display interface by adopting the processed data in the first interface.
The computer readable storage medium may be an internal storage unit of the terminal according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal. The computer readable storage medium may be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the computer-readable storage medium may include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium stores the computer program and other programs and data required by the terminal. The above-described computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the end device and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed terminal device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A data refresh method, comprising:
when first data sent by a lower computer is received, the first data are stored in a first interface, and the first data stored in the first interface comprise keys and values;
traversing keys in a second interface sequentially by using the keys in the first interface to compare values corresponding to each key in the first interface and the second interface;
if the values corresponding to the same key exist in the first interface and the second interface are equal, determining that the key value pair is the data in the first interface which is the same as the data in the second interface, wherein the data in the second interface is the data currently displayed by the display interface;
if the key exists in the first interface and the second interface and the value corresponding to the key is the same but not equal, replacing the value corresponding to the key in the second interface with the value corresponding to the key in the first interface;
or if a key which does not exist in the second interface exists in the first interface, adding the key value pair in the first interface into the second interface;
deleting the key value pair which is the same as the key value pair of the second interface in the first interface;
and refreshing the display interface by adopting the processed data in the first interface.
2. The method of claim 1, wherein prior to said storing said first data into said first interface, said method further comprises:
judging whether the first data is received first frame data or not;
and if so, storing the first data into the second interface, and displaying the first data on the display interface.
3. The method of claim 1, wherein after said storing said first data into said first interface, prior to said comparing said first data in said first interface with data in said second interface, comprising:
determining whether the first interface is equal to the second interface;
and if not, performing the comparison on the first data in the first interface and the data in the second interface.
4. A terminal device, comprising:
the storage unit is used for storing first data into a first interface when the first data sent by a lower computer are received, wherein the first data stored in the first interface comprise keys and values;
the traversal unit is used for sequentially traversing the keys in the second interface by using the keys in the first interface so as to compare the corresponding values of each key in the first interface and the second interface;
the determining unit is configured to determine that the key value pair is data in the first interface that is the same as data in the second interface if values corresponding to the same key exist in the first interface and the second interface are the same, where the data in the second interface is data currently displayed on a display interface;
a replacing unit, configured to replace a value corresponding to a key in the second interface with a value corresponding to the key in the first interface if the key exists in the first interface and the second interface and the values corresponding to the key are not equal to each other;
an adding unit, configured to add, if a key that does not exist in a second interface exists in the first interface, the key-value pair in the first interface to the second interface;
the processing unit is used for deleting the key value pair which is the same as the key value pair of the second interface in the first interface;
and the refreshing unit is used for refreshing the display interface by adopting the processed data in the first interface.
5. A terminal device comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-3.
CN201810627595.1A 2018-06-15 2018-06-15 Data refreshing method, terminal equipment and computer readable medium Active CN108874344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810627595.1A CN108874344B (en) 2018-06-15 2018-06-15 Data refreshing method, terminal equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810627595.1A CN108874344B (en) 2018-06-15 2018-06-15 Data refreshing method, terminal equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN108874344A CN108874344A (en) 2018-11-23
CN108874344B true CN108874344B (en) 2021-10-08

Family

ID=64339746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810627595.1A Active CN108874344B (en) 2018-06-15 2018-06-15 Data refreshing method, terminal equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN108874344B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597813B (en) * 2018-11-28 2022-01-04 深圳市轱辘车联数据技术有限公司 Vehicle data processing method and device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1499750A (en) * 2002-11-04 2004-05-26 威达电股份有限公司 System and method for monitoring iamge transmission in realtime
CN103455292A (en) * 2012-05-28 2013-12-18 展讯通信(上海)有限公司 Business data display and processing method and device and user equipment
CN103970061A (en) * 2013-01-24 2014-08-06 阿自倍尔株式会社 Data creating device and method
CN104748757A (en) * 2013-12-31 2015-07-01 北京四维图新科技股份有限公司 Data updating method and device for navigation electronic map
CN105068843A (en) * 2015-08-24 2015-11-18 北京网田科技发展有限公司 Data updating method of automobile recommendation program and data updating system of automobile recommendation program
CN106027645A (en) * 2016-05-19 2016-10-12 Tcl移动通信科技(宁波)有限公司 Mutual control method and system for mobile terminals
CN106197441A (en) * 2016-06-29 2016-12-07 奇瑞汽车股份有限公司 A kind of vehicle-mounted navigation map difference update method
CN106595681A (en) * 2016-12-16 2017-04-26 上海博泰悦臻网络技术服务有限公司 Differential updating method for path data, system and server
CN107360229A (en) * 2017-07-12 2017-11-17 北京海克智动科技开发有限公司 A kind of system and method for environmental data push and response
CN107947366A (en) * 2017-12-07 2018-04-20 中科创能实业有限公司 Data processing method and data processing equipment
CN108153784A (en) * 2016-12-06 2018-06-12 北京京东尚科信息技术有限公司 Synchrodata treating method and apparatus

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1499750A (en) * 2002-11-04 2004-05-26 威达电股份有限公司 System and method for monitoring iamge transmission in realtime
CN103455292A (en) * 2012-05-28 2013-12-18 展讯通信(上海)有限公司 Business data display and processing method and device and user equipment
CN103970061A (en) * 2013-01-24 2014-08-06 阿自倍尔株式会社 Data creating device and method
CN104748757A (en) * 2013-12-31 2015-07-01 北京四维图新科技股份有限公司 Data updating method and device for navigation electronic map
CN105068843A (en) * 2015-08-24 2015-11-18 北京网田科技发展有限公司 Data updating method of automobile recommendation program and data updating system of automobile recommendation program
CN106027645A (en) * 2016-05-19 2016-10-12 Tcl移动通信科技(宁波)有限公司 Mutual control method and system for mobile terminals
CN106197441A (en) * 2016-06-29 2016-12-07 奇瑞汽车股份有限公司 A kind of vehicle-mounted navigation map difference update method
CN108153784A (en) * 2016-12-06 2018-06-12 北京京东尚科信息技术有限公司 Synchrodata treating method and apparatus
CN106595681A (en) * 2016-12-16 2017-04-26 上海博泰悦臻网络技术服务有限公司 Differential updating method for path data, system and server
CN107360229A (en) * 2017-07-12 2017-11-17 北京海克智动科技开发有限公司 A kind of system and method for environmental data push and response
CN107947366A (en) * 2017-12-07 2018-04-20 中科创能实业有限公司 Data processing method and data processing equipment

Also Published As

Publication number Publication date
CN108874344A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN107463627B (en) Picture loading method and terminal
US9152529B2 (en) Systems and methods for dynamically altering a user interface based on user interface actions
CN107181858B (en) Method and terminal for displaying notification message
CN109286850B (en) Video annotation method and terminal based on bullet screen
CN106991179B (en) Data deleting method and device and mobile terminal
US20150082242A1 (en) Providing Context Menu Based on Predicted Commands
US20100153890A1 (en) Method, Apparatus and Computer Program Product for Providing a Predictive Model for Drawing Using Touch Screen Devices
KR20150121646A (en) Method and device for controlling page rollback
WO2018103402A1 (en) Wireless fidelity (wifi) scan method and related product
US20140280262A1 (en) Electronic device with a funiction of applying applications of different operating systems and method thereof
US9454674B2 (en) Data sharing control method and data sharing control terminal
CN108717516B (en) File labeling method, terminal and medium
US8762867B1 (en) Presentation of multi-category graphical reports
CN112395118A (en) Equipment data detection method and device
CN113238905A (en) Screen jumpiness detection method and device
CN108874344B (en) Data refreshing method, terminal equipment and computer readable medium
CN109783321B (en) Monitoring data management method and device and terminal equipment
CN104217153A (en) Information processing method and electronic equipment
CN108268507B (en) Browser-based processing method and device and electronic equipment
CN113192639A (en) Training method, device and equipment of information prediction model and storage medium
CN113379469A (en) Abnormal flow detection method, device, equipment and storage medium
JP2008129678A (en) System, method and program for automatically determining file compression
CN106708705B (en) Terminal background process monitoring method and system
CN107819944A (en) Delet method, device, equipment and the storage medium of short message
CN108469938B (en) Electronic book reading reminding method and device and terminal equipment

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Bantian street, Longgang District of Shenzhen City, Guangdong province 518000 yuan and five Avenue sign technology plant No. 1 building 4 floor

Applicant after: SHENZHEN GOLO CHELIAN DATA TECHNOLOGY Co.,Ltd.

Address before: Bantian street Shenzhen city Guangdong province 518000 yuan and five Avenue sign technology plant No. 1 building 4 floor

Applicant before: GOLO IOV DATA TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant