Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1-3 are schematic diagrams of an application scenario of a page presentation method according to some embodiments of the present disclosure.
The page display method provided by some embodiments of the present disclosure is generally executed by a terminal device. The terminal device may be hardware or software. When the terminal device is hardware, it may be various electronic devices, including but not limited to a smart phone, a tablet computer, an e-book reader, a vehicle-mounted terminal, and the like. When the terminal device is software, the terminal device can be installed in the electronic devices listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
In the application scenario, as shown in fig. 1, a user can watch various videos uploaded by multiple authors through a smartphone 101. In practice, multiple videos uploaded by each author may be viewed on the author's personal work page. Thus, a user may select a video of interest for viewing from the personalized work page 102 of an author. In this scenario, the windmill video 103 is taken as an example. Thus, as shown in fig. 2, the windmill video 103 can be viewed in the video playback page 201.
In the application scenario, the first page is exemplified by the video playing page 201 in fig. 2, and the second page is exemplified by the personal work page 102 in fig. 1. On this basis, an executing subject (e.g., the smartphone 101) of the page display method may read at least one type of data corresponding to the video playback page 201 based on the identifier of the video playback page 201. In the context of the present application, at least one type of data is illustrated as like 202 in fig. 2. Specifically, since the personal work page 102 that has been previously presented also includes the praise number, as shown at 104 in fig. 1. That is, the praise number has been acquired in the process of presenting the personal work page 102. At this time, the praise number can be directly acquired from the local, so that the consistency of the target data displayed by the two pages can be ensured while the data acquisition speed is improved. On the basis, the user can perform interactive operations such as praise on the windmill video 103. The execution subject thus generates update data in response to an update (e.g., like data) for at least one type of data of the video playback page 201. It is thus possible to generate target data from the update data and at least one type of data and to present the target data in the video playback page 201, as shown at 301 in fig. 3.
With continued reference to fig. 4, a flow 400 of some embodiments of a page presentation method according to the present disclosure is shown. The page display method comprises the following steps:
step 401, reading at least one type of data corresponding to a first page based on an identifier of the first page, where the at least one type of data is obtained in a process of displaying a second page, the second page is displayed before the first page, and the at least one type of data is displayed in the second page.
In some embodiments, the execution subject of the page presentation method may read at least one type of data corresponding to the first page based on the identification of the first page. Wherein, according to actual needs, at least one type of data can be various data, including but not limited to: number of praise, amount of reading, amount of forwarding, etc. In practice, the different pages may represent different scenes, and by way of example, the first page may be a video playback page in a video playback scene, and the second page may be a work of personals page in a view personals home scene. In both of these two scenarios, data such as the playing amount or the like of the video needs to be displayed. In practice, the second page may be a page that has been presented before the presentation of the first page. At least one type of data may be acquired during the presentation of the second page. As an example, the data may be obtained by receiving data sent by the server. In practice, the first page and the second page may be different pages in the same application, and both the first page and the second page display at least one type of data.
In some optional implementations of some embodiments, reading target data corresponding to the first page based on the identifier of the first page includes: reading at least one type of data corresponding to the first page from the local target storage unit based on the identifier of the first page, wherein the first page and the second page share the target storage unit.
In these implementations, the first page and the second page may share a target memory location. That is, some of the same data required in the first page and the second page may be stored in the target storage unit. Thus, for each scene, complete data can be acquired.
In some optional implementations of some embodiments, at least one type of data is obtained by: and in the process of displaying the second page, receiving data issued by the server in response to the data acquisition request aiming at the target object.
Step 402, in response to the update of at least one type of data corresponding to the first page, generating update data.
In some embodiments, as an example, a user may perform various interactive operations with respect to a first page, including: like, forward, play, comment, etc. These interactions trigger the updating of at least one type of data. Thus, the execution subject may generate the update data in response to an update of at least one type of data corresponding to the first page. As an example, a user likes a piece of video, and the update data may be like data plus one.
In some embodiments, as an example, in response to an update of at least one type of data corresponding to the first page, the execution subject may also obtain the update data by sending a network request to the server.
Step 403, generating target data based on the update data and the at least one type of data, and displaying the target data in the first page.
In some embodiments, the target data may be generated according to at least one type of data obtained in step 401 and the update data obtained in step 402. As an example, if the user performs forwarding once, one may be added on the basis of the forwarding data in at least one type of data to obtain the target data. As yet another example, if the user cancels the like, the target data may be obtained by subtracting one from the like data in the at least one type of data. On the basis, the generated target data can be displayed on the first page.
In some optional implementations of some embodiments, generating the target data based on the update data and the at least one type of data includes: determining the update time of at least one type of data; in response to a time interval between the update time and the current time being less than or equal to a preset interval threshold, target data is generated based on the update data and at least one type of data.
In these implementations, by setting the time interval threshold, the use of data too long before the current time may be avoided. Because data is constantly changing over time, the data too long from the current time is constantly decreasing in its referential and accuracy. Thereby, the accuracy of the target data can be improved.
In some optional implementations of some embodiments, the method may further include: storing the target data; and deleting the target data in response to the time interval between the storage time of the target data and the current time being greater than or equal to a preset storage duration threshold.
According to the method provided by some embodiments of the present disclosure, the corresponding data is read through the identifier of the first page, so that each page can acquire accurate service data. In addition, since at least one type of data is acquired in the process of displaying the second page, the consistency of the at least one type of data displayed in the first page and the second page can be ensured. In practice, different pages may represent different scenarios. For example, the first page may be a video playback page in a video playback scenario, and the second page may be a work of personals page in a view personals home scenario. Therefore, the problem of data consistency in different scenes can be solved. On the basis, the target data can be ensured to be updated quickly and timely by using the updating data.
With continued reference to FIG. 5, a flow 500 of further embodiments of a page presentation method according to the present disclosure is shown. The page display method comprises the following steps:
step 501, reading at least one type of data corresponding to a first page from a local target storage unit based on an identifier of the first page, wherein the first page and a second page share the target storage unit.
In some embodiments, the first category of data may include at least one category of data. In practice, the first category of data may include multiple categories of data. For example, the target data may include two types of data, which are a forwarding amount and an like number, respectively. In practice, different data can be divided as required to obtain data of at least one category. The first page and the second page may share a target memory location. That is, some of the same data required in the first page and the second page may be stored in the target storage unit. Thus, for each scene, complete data can be acquired.
Step 502, in response to an update of at least one type of data corresponding to the first page, generating update data.
In some embodiments, the specific implementation of step 502 and the technical effect thereof may refer to step 402 in those embodiments corresponding to fig. 4, and are not described herein again.
Step 503, determining the data to be updated which is matched with the attribute corresponding to the updated data from at least one type of data.
In some embodiments, the execution subject may determine data to be updated that matches the attribute corresponding to the update data from at least one type of data. The attribute corresponding to the update data may be its category, identification, and the like.
In practice, the updated data may be all or part of at least one type of data. For example, at least one type of data includes both praise and forward quantities. In practice, the user may only like once, and the update data only contains like data once. Therefore, only the amount of praise changes, and the amount of forwarding does not change. In practice, as an example, a preset rule may be employed to identify the category of the changed data based on the update data. On the basis, the data to be updated with matched categories is determined from at least one category of data.
Step 504, determine the type of the update data and the data processing mode corresponding to the type.
And 505, processing the update data and the data to be updated based on the type of the update data and the data processing mode corresponding to the type to generate target data.
Optionally, if the update data is generated based on interaction of the user with respect to the first page, the update data is used to cover the data to be updated, and the target data is generated.
Optionally, if the update data is obtained from the server through the network request, target update data corresponding to the network request is determined from the update data, and the target update data is used to cover the data to be updated corresponding to the target update data, so as to generate the target data.
In some embodiments, compared with those embodiments corresponding to fig. 4, a step of determining a category of the update data and a data processing manner corresponding to the category is added, and then generating the target data. The data consistency problem under different scenes is further solved by applying the same data synchronization rule (including the category of the new data and the data processing mode corresponding to the category) under different scenes.
In addition, the page display method of some embodiments of the disclosure ensures feasibility, efficiency and accuracy of the data warehouse model based on the distributed accounting principle. In particular, since it has the following characteristics:
1. the account book is complete: and each application scene acquires complete and accurate data.
2. The rules are unified: the rules for synchronization of each application scenario data remain uniform.
3. Accounting is independent: the synchronization operations between different application scenarios are independent of each other.
Therefore, firstly, the problem that the account book is complete can be solved by using the global shared memory, and the global shared memory can ensure that each application scene in the client can acquire complete data. And then, the data in the shared memory is arranged into a key value pair form according to the unique identifier, so that accurate service data can be acquired through the unique identifier for each application scene in the client.
With further reference to fig. 6, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a page display apparatus, which correspond to those shown in fig. 4, and which may be applied in various electronic devices.
As shown in fig. 6, the page display apparatus 600 of some embodiments includes: a reading unit 601, a generating unit 602 and a presentation unit 603. The reading unit 601 is configured to read at least one type of data corresponding to a first page based on an identifier of the first page, where the at least one type of data is obtained during a process of displaying a second page, and the second page is displayed before the first page, and the at least one type of data is displayed in the second page. The generating unit 602 is configured to generate update data in response to an update for at least one type of data corresponding to the first page. The presentation unit 603 is configured to generate target data based on the update data and the at least one type of data, and present the target data in the first page.
In some embodiments, specific implementations of the reading unit 601, the generating unit 602, and the displaying unit 603 in the page displaying apparatus 600 and technical effects thereof may refer to steps 401 and 403 in the embodiment corresponding to fig. 4, which are not described herein again.
In an optional implementation of some embodiments, presentation unit 603 is further configured to: determining data to be updated matched with the attributes corresponding to the updated data from at least one type of data; target data is generated based on the update data and the data to be updated.
In an optional implementation of some embodiments, presentation unit 603 is further configured to: determining the type of the updating data and a data processing mode corresponding to the type; and processing the updated data and the data to be updated based on the type of the updated data and the data processing mode corresponding to the type to generate display target data.
In an optional implementation of some embodiments, presentation unit 603 is further configured to: if the updating data are generated based on the interaction of the user aiming at the first page, covering the data to be updated by using the updating data to generate target data; and if the update data is acquired from the server through the network request, determining target update data corresponding to the network request from the update data, covering the data to be updated corresponding to the target update data by using the target update data, and generating the target data.
In an alternative implementation of some embodiments, at least one type of data is obtained by: and in the process of displaying the second page, receiving data issued by the server in response to the data acquisition request aiming at the target object.
In an optional implementation of some embodiments, presentation unit 603 is further configured to: determining the update time of at least one type of data; in response to a time interval between the update time and the current time being less than or equal to a preset interval threshold, target data is generated based on the update data and at least one type of data.
In an optional implementation of some embodiments, the reading unit 601 is further configured to: reading at least one type of data corresponding to the first page based on the identifier of the first page, including: and reading at least one type of data corresponding to the first page from the local target storage unit based on the identifier of the first page, wherein the first page and the second page share the target storage unit.
In an optional implementation of some embodiments, the apparatus 600 may further include: a storage unit (not shown in the figure) and a deletion unit (not shown in the figure). Wherein the storage unit is configured to store the target data. A deleting unit configured to delete the target data in response to a time interval between a storage time of the target data and a current time being greater than or equal to a preset storage duration threshold.
In some embodiments, the corresponding data is read through the identifier of the first page, so that each page can acquire accurate service data. In addition, since at least one type of data is acquired in the process of displaying the second page, the consistency of the at least one type of data displayed in the first page and the second page can be ensured. In practice, different pages may represent different scenarios. For example, the first page may be a video playback page in a video playback scenario, and the second page may be a work of personals page in a view personals home scenario. Therefore, the problem of data consistency in different scenes can be solved. On the basis, the target data can be ensured to be updated quickly and timely by using the updating data.
Referring now to fig. 7, a block diagram of an electronic device (e.g., the terminal device of fig. 1) 700 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device in some embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; a storage device 708 including, for example, a memory card; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed from storage 708, or may be installed from ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: reading at least one type of data corresponding to a first page based on an identifier of the first page, wherein the at least one type of data is acquired in the process of displaying a second page, the second page is displayed before the first page, and the at least one type of data is displayed in the second page; generating update data in response to an update of at least one type of data corresponding to the first page; target data is generated based on the update data and the at least one type of data, and the target data is presented in a first page.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a reading unit, a receiving unit, and a generating unit. Here, the names of the cells do not constitute a limitation to the cells themselves in some cases, and for example, the reading cell may also be described as a "cell that reads target data corresponding to a target object based on an identification of the target object displayed in the first page".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
According to one or more embodiments of the present disclosure, there is provided a page display method including: reading at least one type of data corresponding to a first page based on an identifier of the first page, wherein the at least one type of data is acquired in the process of displaying a second page, the second page is displayed before the first page, and the at least one type of data is displayed in the second page; generating update data in response to an update of at least one type of data corresponding to the first page; target data is generated based on the update data and the at least one type of data, and the target data is presented in a first page.
According to one or more embodiments of the present disclosure, generating target data based on update data and at least one type of data includes: determining data to be updated matched with the attributes corresponding to the updated data from at least one type of data; target data is generated based on the update data and the data to be updated.
According to one or more embodiments of the present disclosure, generating target data based on update data and data to be updated includes: determining the type of the updating data and a data processing mode corresponding to the type; and processing the update data and the data to be updated based on the type of the update data and the data processing mode corresponding to the type to generate target data.
According to one or more embodiments of the present disclosure, processing update data and data to be updated based on a category of the update data and a data processing manner corresponding to the category to generate target data includes: if the updating data are generated based on the interaction of the user aiming at the first page, covering the data to be updated by using the updating data to generate target data; and if the update data is acquired from the server through the network request, determining target update data corresponding to the network request from the update data, covering the data to be updated corresponding to the target update data by using the target update data, and generating the target data.
According to one or more embodiments of the present disclosure, at least one type of data is obtained by: and in the process of displaying the second page, receiving data issued by the server in response to the data acquisition request aiming at the target object.
According to one or more embodiments of the present disclosure, generating target data based on update data and at least one type of data includes: determining the update time of at least one type of data; in response to a time interval between the update time and the current time being less than or equal to a preset interval threshold, target data is generated based on the update data and at least one type of data.
According to one or more embodiments of the present disclosure, reading at least one type of data corresponding to a first page based on an identifier of the first page includes: and reading at least one type of data corresponding to the first page from the local target storage unit based on the identifier of the first page, wherein the first page and the second page share the target storage unit.
In accordance with one or more embodiments of the present disclosure, a method further comprises: storing the target data; and deleting the target data in response to the time interval between the storage time of the target data and the current time being greater than or equal to a preset storage duration threshold.
According to one or more embodiments of the present disclosure, there is provided a page displaying apparatus including: the device comprises a reading unit, a generating unit and a display unit. The reading unit is configured to read at least one type of data corresponding to a first page based on an identifier of the first page, wherein the at least one type of data is acquired in a process of displaying a second page, the second page is displayed before the first page, and the at least one type of data is displayed in the second page. The generation unit is configured to generate update data in response to an update for at least one type of data corresponding to the first page. The presentation unit is configured to generate target data based on the update data and the at least one type of data, and present the target data in a first page.
In accordance with one or more embodiments of the present disclosure, the presentation unit is further configured to: generating target data based on the update data and at least one type of data, comprising: determining data to be updated matched with the attributes corresponding to the updated data from at least one type of data; target data is generated based on the update data and the data to be updated.
In accordance with one or more embodiments of the present disclosure, the presentation unit is further configured to: determining the type of the updating data and a data processing mode corresponding to the type; and processing the update data and the data to be updated based on the type of the update data and the data processing mode corresponding to the type to generate target data.
In accordance with one or more embodiments of the present disclosure, the presentation unit is further configured to: if the updating data are generated based on the interaction of the user aiming at the first page, covering the data to be updated by using the updating data to generate target data; and if the update data is acquired from the server through the network request, determining target update data corresponding to the network request from the update data, covering the data to be updated corresponding to the target update data by using the target update data, and generating the target data.
According to one or more embodiments of the present disclosure, at least one type of data is obtained by: and in the process of displaying the second page, receiving data issued by the server in response to the data acquisition request aiming at the target object.
In accordance with one or more embodiments of the present disclosure, the presentation unit is further configured to: determining the update time of at least one type of data; in response to a time interval between the update time and the current time being less than or equal to a preset interval threshold, target data is generated based on the update data and at least one type of data.
According to one or more embodiments of the present disclosure, the reading unit is further configured to: and reading at least one type of data corresponding to the first page from the local target storage unit based on the identifier of the first page, wherein the first page and the second page share the target storage unit.
According to one or more embodiments of the present disclosure, an apparatus may further include: a storage unit and a deletion unit. Wherein the storage unit is configured to store the target data. A deleting unit configured to delete the target data in response to a time interval between a storage time of the target data and a current time being greater than or equal to a preset storage duration threshold.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.