Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of methods that are consistent with some aspects of the present application as detailed in the accompanying claims.
The embodiment of the application provides a terminal which is an electronic device with data calculation, processing and storage capabilities, and a target application program is installed and operated in the terminal. The terminal may be a smart phone, tablet, PC (Personal Computer ), wearable device, smart robot, etc. The target application may be any application having data display requirements, such as a music application, a game application, a social application, a payment application, a video application, a shopping application, a news application, and the like. The data in this embodiment of the present application may be displayed through a display panel, may also be displayed through projection, and may also be displayed through techniques such as AR (Augmented Reality ), VR (virtual reality), and the like. In the method of the embodiment of the present application, the execution subject of each step may be the terminal, for example, the target application program running in the terminal is installed.
The following describes the technical scheme of the application through several embodiments.
Referring to fig. 1, a flowchart of a data display method according to an embodiment of the present application is shown. In the present embodiment, the method is mainly applied to the above-described client terminal for installing and running the target application program in the terminal for illustration. The method may comprise the following steps (101-103):
step 101, requesting to obtain n items of data from a data source, wherein n is a positive integer.
The data source may store the n items of data, or may have a function of generating the n items of data; the data source may be a server or a database provided in the server. The server may be one server or may be a server cluster formed by a plurality of servers. The client may request to obtain n items of data from the data source by sending a data acquisition request. The data acquisition request may be one or more, that is, one data acquisition request may be used to acquire one item of data, and may also be used to acquire multiple items of data.
Step 102, receiving data fed back by a data source.
The data source can receive a data acquisition request sent by the client, determine corresponding data from the server or a database of the server according to the data acquisition request, and then send the corresponding data to the client; accordingly, the client may receive the data fed back by the data source. Wherein, the data fed back by the data source can be all or part of the n items of data.
In addition, for different items of data in the n items of data, the data source can feed back asynchronously, that is, feed back the item of data to the client every time the item of data is acquired.
And 103, when the set first time arrives, if m items of data in the n items of data are received, displaying the m items of data in a user interface, wherein m is a positive integer less than or equal to n.
Wherein, when the data acquisition request is a data acquisition request, the first time may be a time after the client transmits the data acquisition request; when the data acquisition request includes a plurality of data acquisition requests, the first time may be a time after the client issues a certain data acquisition request of the plurality of data acquisition requests, for example, the first time may be a time after the client issues a first data acquisition request of the plurality of data acquisition requests; for another example, the first time may be a time after the client issues the last data acquisition request of the plurality of data acquisition requests, which is not limited in the embodiment of the present application.
The first time may be preset, which is not limited in the embodiment of the present application. In an exemplary embodiment, the first time is 300 milliseconds after the client issues the data acquisition request. For example, after the client issues the data acquisition request, a timer may be started, where the duration of the timer is 300 ms, and when the time count of the timer is changed from 300 ms to 0, that is, the first time arrives, the client displays the data received in the 300 ms.
Note that the m pieces of data are actually received by the client when the first time set arrives, and the m pieces of data may be all of the n pieces of data or some of the n pieces of data.
In summary, in the technical solution provided in the embodiments of the present application, by requesting to obtain n items of data from a data source and receiving the data fed back by the data source, when the set first time arrives, if m items of data in the n items of data have been received, the m items of data are displayed in the user interface, that is, by setting a time, when the set time arrives, whether all the data to be obtained are received, the received data are displayed first, and compared with waiting for all the data to be received and then displayed, the technical solution provided in the embodiments of the present application can improve the timeliness of data display.
Referring to fig. 2, a flowchart of a data display method according to another embodiment of the present application is shown. In the present embodiment, the method is mainly applied to the above-described client terminal for installing and running the target application program in the terminal for illustration. The method may comprise the following steps (201-205):
step 201, requesting to obtain n items of data from a data source, where n is a positive integer.
In some possible embodiments, step 201 may comprise the steps of:
and respectively sending data acquisition requests to the n data acquisition interfaces. The data acquisition request is sent to an ith data acquisition interface in the n data acquisition interfaces and is used for requesting to acquire the ith data in the n data, wherein i is a positive integer less than or equal to n.
The data acquisition interface may be a server-provided interface. For example, the server may provide the client with n data acquisition interfaces, each for providing a piece of data. Optionally, when the address of the ith data acquisition interface is included in the data acquisition request sent by the client, the data acquisition request is received and processed by the ith data acquisition interface, and the ith data is fed back to the client when the ith data is acquired. Of course, if the ith item of data cannot be acquired, the ith item of data is not fed back to the client.
Step 202, receiving data fed back by a data source.
This step 202 may refer to the content of step 102 in the embodiment of fig. 1, which is not described herein.
And 203, when the set first time arrives, if m items of data in the n items of data are received, displaying the m items of data in a user interface, wherein m is a positive integer less than or equal to n.
In some possible embodiments, m cards are displayed in the user interface, each card for displaying one item of data. Referring to fig. 3, a schematic diagram of a user interface provided in one embodiment of the present application is shown. As shown in fig. 3, the user interface 30 is one of the music applications, and in the user interface 30, each item of data is displayed in its corresponding card. For example, the card 31 is used to display song information, and thus data 32 representing song information among m items of data is displayed in the card 31. For another example, the card 33 is used to display the relevant music short video, and thus the data 34 representing the relevant music short video among the m pieces of data is displayed in the card 33.
In some possible embodiments, if the data amount included in one item of data in the m items of data is larger, part of the data in the item of data may be displayed first, and when a remaining data display instruction is received, the remaining data in the item of data is displayed, so that the display area of the user interface is saved.
In some possible embodiments, for data not acquired in the n items of data, the corresponding card is not displayed, thereby helping to save the display area of the user interface. For example, a client requests 7 items of data (i.e., n equals 7) from the data source in total, including: data 1, 2, 3, 4, 5, 6, 7. If only the 1 st, 2 nd, 4 th and 6 th data are obtained, displaying the 1 st, 2 nd, 4 th and 6 th data in the corresponding cards in the user interface; for the 3 rd, 5 th and 7 th data which are not acquired in the 7 th data, the corresponding card is not displayed in the user interface.
In some possible embodiments, when the first time arrives, detecting whether m is equal to n, that is, detecting whether all n items of data are received, if yes, ending the step; if not, the following step 204 is performed.
And 204, when the set second moment arrives, if at least one piece of other data except the m pieces of data in the n pieces of data is received, adding and displaying the at least one piece of other data in the user interface.
When the set first time arrives, if m is smaller than n, that is, n items of data are not all received, and when the set second time arrives, the at least one item of data except m items of data in the n items of data is detected to be received between the first time and the second time, the at least one item of data is additionally displayed in the user interface.
Wherein the second time is a time after the first time. The interval duration between the first time and the second time may be 100 ms, 150 ms, 300 ms, 500 ms, 800 ms, 1 second, 2 seconds, etc., which is specifically set by the relevant technician according to the actual situation, which is not limited in the embodiment of the present application.
In some possible embodiments, according to the m items of data and the display position of each item of data in the at least one item of other data, the at least one item of other data is additionally displayed according to the corresponding display position in the user interface. In an exemplary embodiment, a display order is set for n items of data, and for example, please refer to fig. 4, which shows a schematic diagram of a data display method provided in one embodiment of the present application. As shown in fig. 4, the left diagram is a user interface having m items of data displayed between a first time and a second time, and the right diagram is a user interface having m items of data and the at least one other item of data displayed after the second time. The data 43 in the right drawing is data added on the basis of the user interface in the left drawing, and in the set display order, the data 43 is located between the data 44 and the data 45, and therefore, the data 43 is additionally displayed between the data 44 and the data 45. The data is ensured to be displayed according to the set display sequence, so that the data display order is improved.
In some possible embodiments, when the second time arrives, detecting whether all n items of data are received, if yes, ending the step; if not, the following step 205 is performed.
Step 205, after the second moment, each time one item of n items of data is received, the received item of data is added and displayed in the user interface.
For the data in the n items of data received after the second moment, each time one item of data is received, the data is additionally displayed in the user interface. And adding the received data according to the corresponding display positions in the user interface according to the displayed data in the user interface and the received data after the second moment.
It should be noted that, the data received after the first time may also be displayed in the form of a card in the user interface, which is not limited in the embodiment of the present application.
In summary, in the technical solution provided in the embodiments of the present application, when the second set time arrives, if at least one piece of other data except for the m pieces of data in the n pieces of data has been received, the at least one piece of other data is additionally displayed in the user interface, and after the second time, each time one piece of data in the n pieces of data is received, the received piece of data is additionally displayed in the user interface, so that the received data is ensured to be displayed, and the integrity of data display is ensured.
In the embodiment of the application, the data is displayed in the form of the card, so that the data displayed on the user interface is more organized and standardized, and the display effect is improved.
In an exemplary embodiment, after the above step 201, the following steps may be further included:
and when the set third moment is reached, if none of the n items of data is received, displaying prompt information in the user interface, wherein the prompt information is used for prompting that the data is not acquired. Wherein the third time is a time after the first time.
The third time may be a time between the first time and the second time or a time after the second time. The prompt information may also include network connection conditions (including whether the network is connected, network type, network speed, etc.).
In the implementation mode, the prompt information is displayed to prompt that the data is not acquired, so that the waiting time of a user is saved, and the display efficiency is improved.
The technical solution provided in the embodiments of the present application will be described below by taking a client terminal with a music application installed in a terminal as an example. The method may be applied to a client of the music application, as shown in fig. 5, and the method may include the following steps (501 to 507):
step 501, a music playing interface of a target song is displayed.
The music playing interface is a user interface for displaying relevant information of the played target song, and controls for controlling the playing state of the target song, switching the playing song, relevant information of the target song (such as song name and lyric content) and the like can be included in the music playing interface.
Step 502, a display instruction of an associated data interface corresponding to a target song is received.
A display instruction of the associated data interface corresponding to the target song may be received on the basis of the music playing interface of the target song, the display instruction being for displaying data related to the target song in the music playing interface. The display instruction may be obtained through gesture operations (such as left sliding, right sliding, clicking, long pressing, etc.), or may be obtained through voice input, which is not limited in the embodiment of the present application.
Step 503, displaying the associated data interface of the target song according to the display instruction, and requesting to obtain n items of data related to the target song from the data source, where n is a positive integer.
The client may request acquisition of n items of data related to the target song from the data source by sending a data acquisition request. The data source may be a server or a database in a server. The data source may provide n data acquisition interfaces, each for feeding back a piece of data related to the target song.
Step 504, data fed back by a data source is received.
This step 504 may refer to the content of step 102 in the embodiment of fig. 1, which is not described herein.
In step 505, when 300 ms arrives after the request is issued, if 3 items of data are received, the 3 items of data are displayed according to the data acquisition instruction.
Wherein, the 3 items of data are data in the n items of data, and the 3 items of data can be respectively displayed in corresponding cards related to the target songs.
Step 506 displays one of the n items of data received in a time interval between 300 ms and 600 ms after the request is made.
In step 507, after 600 milliseconds after the request is made, each time an item of data is received, the item of data is displayed in the user interface.
By the mode, timeliness of data display in the playing interface of the music application program is improved.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Referring to fig. 6, a block diagram of a data display device according to an embodiment of the present application is shown. The apparatus 600 has a function of implementing the above method example of data display, where the function may be implemented by hardware, or may be implemented by executing corresponding software by hardware. The apparatus 600 may be the terminal described above, or may be provided on the terminal. The apparatus 600 may include: a data request module 610, a data receiving module 620, and a data display module 630.
The data request module 610 is configured to request to obtain n items of data from a data source, where n is a positive integer.
The data receiving module 620 is configured to receive the data fed back by the data source.
The data display module 630 is configured to display, when the set first time arrives, m pieces of data in the n pieces of data if m pieces of data have been received, where m is a positive integer less than or equal to n.
In summary, in the technical solution provided in the embodiments of the present application, by requesting to obtain n items of data from a data source and receiving the data fed back by the data source, when the set first time arrives, if m items of data in the n items of data have been received, the m items of data are displayed in the user interface, that is, by setting a time, when the set time arrives, whether all the data to be obtained are received, the received data are displayed first, and compared with waiting for all the data to be received and then displayed, the technical solution provided in the embodiments of the present application can improve the timeliness of data display.
In an exemplary embodiment, as shown in fig. 7, the apparatus 600 further includes: a display module 640 is added.
The adding display module 640 is configured to, when a set second time arrives, add and display at least one item of other data in the user interface, if the at least one item of other data in the n items of data except the m items of data has been received; wherein the second time is a time after the first time.
In an exemplary embodiment, as shown in fig. 7, the adding display module 640 is configured to add and display, in the user interface, the at least one item of other data according to a corresponding display position according to a display position of each item of data in the m items of data and the at least one item of other data.
In an exemplary embodiment, as shown in fig. 7, the adding display module 640 is further configured to, after the second time, add and display one item of the n items of data in the user interface after receiving the one item of data.
In an exemplary embodiment, the data request module 610 is configured to send data acquisition requests to n data acquisition interfaces respectively; and the data acquisition request is sent to an ith data acquisition interface in the n data acquisition interfaces and is used for requesting to acquire the ith data in the n data, wherein i is a positive integer less than or equal to n.
In an exemplary embodiment, as shown in fig. 7, the apparatus 600 further includes: and an information display module 650.
The information display module 650 is configured to display, when the set third time arrives, a prompt message in the user interface if none of the n items of data is received, where the prompt message is used to prompt that no data is obtained; wherein the third time is a time after the first time.
In an exemplary embodiment, the data display module 630 is configured to display m cards in the user interface, each card being configured to display one item of data.
It should be noted that, in the apparatus provided in the foregoing embodiment, when implementing the functions thereof, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be implemented by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
Referring to fig. 8, a block diagram of a terminal according to an embodiment of the present application is shown. The terminal 800 may be an electronic device such as a cell phone, tablet computer, game console, electronic book reader, multimedia playing device, wearable device, PC, etc. The terminal is used for implementing the data display method provided in the above embodiment. The terminal may be the terminal 800 in the implementation environment shown in fig. 1. Specifically, the present invention relates to a method for manufacturing a semiconductor device.
In general, the terminal 800 includes: a processor 801 and a memory 802.
Processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 801 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and rendering of content required to be displayed by the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 802 is used to store at least one instruction, at least one program, set of codes, or set of instructions configured to be executed by one or more processors to implement the data display methods described above.
In some embodiments, the terminal 800 may further optionally include: a peripheral interface 803, and at least one peripheral. The processor 801, the memory 802, and the peripheral interface 803 may be connected by a bus or signal line. Individual peripheral devices may be connected to the peripheral device interface 803 by buses, signal lines, or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 804, a touch display 805, a camera 806, audio circuitry 807, a positioning component 808, and a power supply 809.
Those skilled in the art will appreciate that the structure shown in fig. 8 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
In an exemplary embodiment, there is also provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the above-described data display method.
In an exemplary embodiment, a computer program product is also provided, which, when being executed by a processor, is adapted to carry out the above-mentioned data display method.
It should be understood that references herein to "a plurality" are to two or more. Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.