CN117170563A - Method for dotting service data when refreshing page and electronic equipment - Google Patents

Method for dotting service data when refreshing page and electronic equipment Download PDF

Info

Publication number
CN117170563A
CN117170563A CN202311404355.2A CN202311404355A CN117170563A CN 117170563 A CN117170563 A CN 117170563A CN 202311404355 A CN202311404355 A CN 202311404355A CN 117170563 A CN117170563 A CN 117170563A
Authority
CN
China
Prior art keywords
data
page
target service
dotting
refreshing
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.)
Granted
Application number
CN202311404355.2A
Other languages
Chinese (zh)
Other versions
CN117170563B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311404355.2A priority Critical patent/CN117170563B/en
Publication of CN117170563A publication Critical patent/CN117170563A/en
Application granted granted Critical
Publication of CN117170563B publication Critical patent/CN117170563B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a method and electronic equipment for dotting service data when refreshing a page, which lead in data types as data identifiers so that the refreshing data of the last time can be distinguished from the refreshing data of the previous time, and therefore, even if the received new data is consistent with the old data, the refreshing can still be triggered due to different identifiers, and the dotting is exposed after the partial refreshing is finished. According to the scheme, missing dotting caused by the extreme condition that the traditional partial refreshing scheme can exist and dotting data caused by mismatching of fixed time delay and refreshing time length are inaccurate, setting and control of parameters such as various time lengths of time delay in the traditional scheme are omitted, and the scheme is simpler and easier to realize.

Description

Method for dotting service data when refreshing page and electronic equipment
Technical Field
The present application relates to the field of electronic devices, and in particular, to a method for dotting service data when refreshing a page, and an electronic device.
Background
For a service, the cached data can be uploaded to the cloud for various purposes such as model construction or data analysis, and the process of obtaining the cached data and uploading the cached data can be called dotting. For example, for an application recommendation module (application recommendation service), icons of applications most used by a user are displayed in a concentrated manner, so that the icons are convenient for the user to use. For example, a user may enter a search page on the desktop of the electronic device via a swipe gesture operation, including an application recommendation module.
The data of the search page is the icon which is updated and changed after the data returned by the recommendation platform is received and then compared with the data of the current page and then is subjected to local refreshing. The dotting of the cached data for the application recommendation service occurs when the page is locally refreshed. For such services that require local refreshing of pages, the pages may or may not be refreshed. If the page does not need to execute local refreshing, namely the current cache data is directly exposed and dotted without change, and if the local refreshing is needed, the cache data at the time of exposure is dotted after the preset delay time is reached. However, since many other services and processes exist in the electronic device, the refresh duration may also dynamically change, which may not be well matched with the preset delay duration. The foregoing dotting process may result in inaccurate dotting data, which may be a wrong correspondence between the cache data and the corresponding time point, or may be missed dotting, or may be incomplete dotting data.
Therefore, how to more accurately dot service data for the service with local refreshing is a technical problem to be solved.
Disclosure of Invention
The application provides a method and electronic equipment for dotting service data when refreshing a page, which can more accurately dott the service data aiming at the service with local refreshing.
In a first aspect, there is provided a method of dotting service data when refreshing a page, the method comprising: responding to a first operation of starting a target service by a user, acquiring first cache data, wherein the first cache data is cache data of a first page, the first page is a first display page of an application of the target service after the first operation is executed, and the first operation is gesture operation of starting the target service for the first time or not; marking the data type of the first cache data as old data; receiving second data, wherein the second data is the data of a second page to be updated; marking the data type of the second data as new data; during the period of carrying out local refreshing on the first page according to the second data to obtain the second page, when the data type of the second data is not consistent with the data type of the first cache data, carrying out local refreshing on the first page; and after the partial refreshing is finished, performing exposure dotting by taking the second data as dotting data of the target service.
In the technical scheme of the application, the mark of the new and old data is added for refreshing the data, so that even if the received content of the new data is consistent with that of the old data, the refreshing operation can still be triggered because of the difference of the mark, and the dotting is exposed only after the refreshing is finished, thereby avoiding the missed dotting caused by the fact that the refreshing cannot be triggered when the content of the new and old data is the same; the situation that the data is spotted when the data is not refreshed is avoided due to the fixed setting of the delay time length, and the spotting data is inaccurate due to the midway spotting; and avoids that the dotting time caused by delay does not correspond to the actual acquisition time of the data. Thus, the obtained dotting data is more accurate. In addition, a series of judgment and control on when the delay starts, when the delay ends, how long and the like are omitted, so that the response rate is also improved. In short, the scheme can avoid missing dotting caused by the extreme condition of non-refreshing and inaccurate dotting data caused by mismatching of fixed delay and refreshing time length, and the scheme omits setting and control of parameters such as various time lengths of delay in the traditional scheme, so that the scheme is simpler and easier to realize.
It should be noted that, exposure may be understood as displaying, exposing, and presenting, and in the embodiment of the present application, exposure dotting may be understood as transmitting data to a dotting software module, and after uploading the data to be exposed to a cloud server or a corresponding platform through the dotting software module, dotting is completed once. It should also be appreciated that drawing a picture of data on a screen is presented to a user, referred to as a presentation in embodiments of the present application. Presentation and dotting are two things that are parallel and influence each other. In the embodiment of the application, exposure dotting is used for collecting the condition data of the user using the target service, namely what picture is refreshed at what time to the user, how many times the refreshing is performed in one day, what the content after each refreshing is, so that the data can be used as various possible purposes such as a sample for establishing a model for analyzing the user demand. Therefore, if the dotting is inaccurate, for example, the dotting time does not correspond to the actual picture display time, and for example, the dotting record is missed, the sample is inaccurate, and the implementation effect of the related application is affected.
With reference to the first aspect, in some implementations of the first aspect, during the local refresh of the first page according to the second data to obtain the second page, when determining that the data type of the second data is inconsistent with the data type of the first cache data, performing the local refresh on the first page may include: sending the second data to an adapter; when a partial refresh is performed on a first page with data in an adapter, the following operations are performed:
comparing the difference value of the second data and the first cache data to determine a page area needing refreshing;
judging whether the data source of the second data is the same as the data source of the first cache data or not, wherein the data source is used for indicating the platform source of the data;
when the page area to be refreshed is empty and the data source of the second data is the same as the data source of the first cache data according to the difference value of the second data and the first cache data, judging whether the data type of the second data is consistent with the data type of the first cache data;
and when the data type of the second data is inconsistent with the data type of the first cache data, executing the step of local refreshing on the first page.
In this implementation, the judgment of the consistency of the data types is added in the judgment logic of the local refresh, and because the judgment result is not consistent, even if the judgment results of the original two judgment logics indicate that the local refresh is not needed, the local refresh is triggered and still needs to be executed according to the judgment result of the consistency of the data types. It should be understood that in this implementation, the original determination logic of the local refresh (that is, the determination of the page area that needs to be refreshed and the determination of the data source) is not directly removed, but new determination logic is added on the basis of the two determination logics, so that the accuracy of dotting can be ensured while the technical effect of improving the refresh efficiency of the local refresh is hardly affected.
With reference to the first aspect, in some implementations of the first aspect, before the local refresh of the first page, the method may further include: sending the first cache data to an adapter; a first page is generated using data in the adapter. This implementation is directed to the case where there is no first page at the beginning, i.e. at cold start, and when there is no data for the target service in the last page, the first page's picture also requires a rendering process to be presented to the user on the screen, and the rendering of the first page is still using the adapter. Because the data has new and old identifications, the drawing of the first page does not influence the generation of the second page through partial refreshing after the drawing of the first page is completed. Therefore, the second data can be directly received after the drawing of the first page is started without waiting for the drawing completion, differential refreshing is realized, and waiting time is saved. The traditional scheme cannot distinguish the refresh data with the same content, so that differential refresh cannot be realized, and the next step can be executed only after one refresh is finished, so that the condition that the first page is not refreshed yet is prevented, and the second data reaches the data confusion caused by the adapter, and the refresh action cannot be executed even after the messy code is refreshed.
With reference to the first aspect, in certain implementation manners of the first aspect, during the partial refresh of the first page, the method may further include: and executing the step of local refreshing when the page area to be refreshed is determined to be non-empty according to the difference value between the second data and the first cache data or the data source of the second data is different from the data source of the first cache data. That is, for the case where local refresh is originally required or according to execution logic similar to the conventional scheme, the step of performing local refresh may be continued.
From the two implementations described above, it is primarily desirable to avoid false dotting by adding decision logic. However, the new judgment logic and the original two judgment logics can be combined, so that the effect of minimizing the influence on the local refreshing scheme as much as possible can be achieved.
With reference to the first aspect, in some implementations of the first aspect, after the partial refresh is completed, exposing and dotting the second data as dotting data of the target service may include: after the partial refreshing is finished, reading data to be exposed from the adapter, wherein the data to be exposed is the first cache data or the second data; and when the data type of the data to be exposed is new data, the data to be exposed is considered to be the second data, and the second data is used as dotting data of target service for exposure dotting.
The page data needs to be taken from some specific nodes, so in the embodiment of the application, the second data can be taken by taking the data from the adapter after the partial refresh is finished. However, since both the first cache data and the second data are sent to the adapter, it is also necessary to determine whether the read data is new data or not after the data is read from the adapter, and if the read data is new data, the second data is indicated, and then the dotting is exposed.
With reference to the first aspect, in certain implementation manners of the first aspect, the method further includes: determining a preset number threshold of display icons of the target service according to the screen size of the electronic equipment and/or the state of the target service; the states of the target service include a collapsed state and an expanded state.
The preset number threshold may be used to classify the first cache data and/or the second data to achieve finer refreshing, that is, to set an execution threshold for the subsequent step, so that different refresh policies may be adopted in different situations.
It should be understood that in the above implementation manner, fine setting of the preset number threshold is mainly achieved, and setting is performed by integrating the screen size of the electronic device and the state of the display area of the target service, but there is no limitation on the specific numerical value of the preset number threshold.
With reference to the first aspect, in some implementations of the first aspect, when marking the data type of the first cache data as old data may include: when the number of icons to be displayed indicated by the first cache data is greater than or equal to the preset number threshold, marking the data type of the first cache data as old data, and converting to execute the step of receiving the second data, and transmitting the first cache data to an adapter for generating the first page while executing the step of receiving the second data; or when the number of icons to be displayed indicated by the first cache data is smaller than the preset number threshold, switching to the step of directly executing the step of receiving the second data.
That is, when the display area of the target service is displayed in its entirety with a small number of icons, no refreshing is necessary, so that it is unnecessary to mark the type of data, and it is sufficient to directly receive and overwrite the initial data with newly received second data. This is often the case when the electronic device is just used, taking the target service as an application suggestion service, that is, because the user just starts to use the electronic device, the number of applications that need to be recommended is insufficient to fill the display area of the application suggestion service, and such data may be directly received as the second data, that is, the new data, without regard to the old data.
With reference to the first aspect, in certain implementation manners of the first aspect, during the local refresh of the first page, the method further includes: when the number of icons to be displayed indicated by the second data is larger than or equal to a preset number threshold, after the starting effect of the target service is finished, executing a step of locally refreshing the first page according to the second data; or when the number of icons to be displayed indicated by the second data is smaller than a preset number threshold, the step of carrying out local refreshing on the first page is not carried out, and the step of carrying out exposure dotting by directly taking the second data as dotting data of the target service is carried out.
In this implementation, if the number of icons is sufficient, then the target service starts playing the active effect, then a partial refresh is performed, if the number of icons is insufficient, then no refresh is performed, which corresponds to the need for the second data to be displayed, and the second data is directly exposed to the light for dotting. The former is to refresh first, refresh and then dotting, and the latter is to directly dott without refreshing.
It will also be appreciated that the steps of the inventive arrangements may be performed after the first operation is obtained, with the initiating action being played during this period also being accompanied by the triggering of the first operation. Therefore, in order not to affect the display effect of starting the dynamic effect, the step related to the partial refresh can be executed after the dynamic effect is ended. And when the number of icons is too small and the display is not necessary, the equivalent effect is not needed to be ended.
With reference to the first aspect, in some implementations of the first aspect, before acquiring the first cached data, the method may further include: judging whether the starting of the target service is cold starting or not; when the starting of the target service is cold starting, executing the step of acquiring first cache data, wherein the first cache data is data corresponding to the target service in application initial page data of the target service; or,
when the starting of the target service is not cold starting, firstly acquiring the data of the last display page stored in the electronic equipment before the first operation, and judging whether the last display page contains the data of the target service or not;
when the last display page contains the data of the target service, the step of receiving second data is executed; or when the last display page does not contain the data of the target service, the step of acquiring the first cache data is performed.
That is, when the target service is started for the first time, there is no background cache data, and when an initial page is displayed after the starting, the data of the initial page can be used to determine the first cache data, and if the target service is not started for the first time, that is, the target service is started for multiple times in a state that the application of the target service has been started, at this time, the first cache data corresponds to the last display page before the first operation, specifically, the last display page refers to the last display page before the first operation of the application where the target service is located. When cold start is performed, acquiring first cache data; when the first operation is not performed on the running page of the application where the target service is located, that is, when the first operation is performed, the page displayed when the first operation occurs is the last displayed page, if the data of the target service is contained in the page, the more desirable dotting data is certainly the refreshed data, so that the situation is directly converted into receiving the second data. When there is a last page but there is no data of the target service, it indicates that there is no target service in the last page during the first operation, which can be understood as other pages where the target service is applied, and there is still need to provide an initial data for the target service, so that the step of acquiring the first cache data is performed, and then the subsequent steps can be continuously performed in a manner equivalent to the cold start. The implementation mode is that when the first operation occurs at different occasions, different corresponding processing modes exist, so that the whole scheme is finer and more rigorous in process execution, and the accuracy of dotting data can be further improved. It may be that the application where the target service is located is still in the background in a suspended state, which may be the case in a hot start, where a snapshot (surface) of the application where the target service is located is a page that is presented first after the target service is started, and data corresponding to the target service in the snapshot may be used as the first cached data. It should be understood that cold start refers to no suspension in the background, no complete start, and hot start that occurs after a temporary exit, the application is put in the background and suspended, at which point a snapshot is stored for hot start. This situation may be equivalent to a situation where the target service is not cold-started, where the snapshot of the application may not necessarily have the target service's data in it, is uncertain, if any, indicating that the page does not need to be redrawn (as it was already shown before it was deposited) or to be clicked (as it was already clicked before it was deposited). The time that the snapshot was generated is before the first operation, but many times before it was not. Only knowing that the data of the target service in the snapshot is not required to be redrawn or dotted after the application of the target service is started up, if the data of the target service is not in the snapshot, the first page is required to be redrawn and the dotting is performed after the second page is refreshed.
The steps are performed after the first operation occurs and before the first cached data is obtained.
With reference to the first aspect, in some implementations of the first aspect, the application of the target service is a search page, the target service is an application suggestion service provided on the search page, and the first operation is a user's slide-down gesture operation in a desktop or the search page. Application suggestion services are typically services that update pages through partial refresh, and in desktop swipe gesture operations are also the most widely operated way to open a search page by an application, while swipe gesture operations on a search page are operations that a user would perform when thinking about continuously updating a recommended application. It should be understood that the solution of the embodiment of the present application may also be used in other services that update pages through partial refresh.
With reference to the first aspect, in certain implementation manners of the first aspect, after performing exposure dotting with the second data as dotting data of the target service, the method further includes: the data type of the second data is marked as old data. The implementation enables dynamic updating, and when the target service is started next time, and not cold starting, the receiving of new data compared with the second data and the local refreshing and dotting of the new data with the new data can be directly performed.
In a second aspect, there is provided an apparatus for performing dotting on service data when refreshing a page, the apparatus comprising means for performing any one of the methods of the first aspect, comprised of software and/or hardware.
In a third aspect, there is provided an electronic device comprising a memory, one or more processors and a computer program stored in the memory and executable on the processor, the one or more processors when executing the computer program enabling the electronic device to carry out any one of the methods of the first aspect.
In a fourth aspect, there is provided a chip comprising a processor for reading and executing a computer program stored in a memory, which when executed by the processor enables an electronic device in which the chip is located to carry out any one of the methods of the first aspect.
Optionally, the chip further comprises a memory, the memory being electrically connected to the processor.
Optionally, the chip may further comprise a communication interface.
In a fifth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, the computer program being capable of implementing any one of the methods of the first aspect when executed by an electronic device.
In a sixth aspect, a computer program product is provided, the computer program product comprising a computer program capable of implementing any one of the methods of the first aspect when the computer program is executed by an electronic device.
Drawings
FIG. 1 is a schematic diagram of an interaction process of a target service to which an embodiment of the present application is applied.
FIG. 2 is a schematic flow chart of a method of dotting service data when refreshing pages in accordance with an embodiment of the application.
FIG. 3 is a schematic flow chart of another method of dotting service data when refreshing pages in accordance with an embodiment of the application.
Fig. 4 is a schematic structural diagram of an apparatus for dotting service data when refreshing a page according to an embodiment of the present application.
Fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described below with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of an interaction process of a target service to which an embodiment of the present application is applied. Fig. 1 exemplifies an application suggestion service in a search page (search application) as a target service. As shown in fig. 1, a screen of a desktop is displayed in an interface 101 of an electronic device a, and icons of some applications are included on the desktop. Assuming that the user performs a swipe gesture operation, i.e., a press and swipe operation, at any one of the desktop images in the electronic device a, the start of the search page may be triggered to see the search page as shown in the interface 102. The search page may also be regarded as an application. The application suggestion module (application suggestion service) is one service in the search page. The application suggestion service is used for intensively displaying icons of common applications to users, so that the users can conveniently and quickly find applications which the users want to open. The page that is loaded and displayed immediately after the interface 102 appears may be referred to as a first page. If this is the first cold start search page, then there is no other cached data and the first page is the initial page of this search page. If the search page is not the first cold start but is suspended in the background, and can be started at a hot state, the first page is the page data of the snapshot (surface) stored in the background when the first page is suspended, and the first page can be the page corresponding to the snapshot.
The application proposal includes two states: the application suggestions in the interface 102 are collapsed states, which are the application suggestions in the expanded state shown in the interface 104 can be seen when the user clicks the expansion control in the upper right corner of the application suggestion in the interface 102, and the application suggestions in the collapsed state shown in the interface 102 can be seen when the user clicks the collapse control in the upper right corner of the application suggestion in the interface 104. It can be seen that the application suggestions in the unfolded state can show more icons, and the application suggestions in the folded state can show relatively fewer icons.
It should be further understood that, for the application suggestion, several icons may be shown in the folded state and the unfolded state, depending on the design logic of the electronic device, which does not affect the solution of the embodiment of the present application, fig. 1 is taken as an example in which the folded state is 4 icons and the unfolded state is 8 icons, and in fact, other numbers such as 5, 6, etc. may also be used without limitation.
After the interface 102 is presented to the user, i.e. the current page is loaded, the search page is refreshed according to the user's history of using the application or receiving recommendation information from the application recommendation platform. In the conventional scheme, for faster refresh, a comparison of data contents, that is, a comparison of the contents of a picture to be displayed and the contents of a current page, is performed, and only a portion where a change occurs is refreshed, so that the refreshed page is presented to a user more quickly, which is called partial refresh.
The auto-refresh from interface 102 to interface 103 in fig. 1 is a partial refresh, and only the application icons that are no longer recommended need to be removed and the newly added recommended icons need to be added during the partial refresh. Here, two interfaces take the example that both the contact and camera applications are no longer recommended and both weather and sports applications are newly added. The use of partial refresh only requires two newly added substitutions to be removed from recommendation. If the more traditional total refreshing is to redraw the whole search page according to the new recommended data, all icons in the application proposal need to be redrawn, including the music without change and shopping, which obviously reduces the refreshing efficiency and increases the waiting time of the user.
In the traditional local refreshing scheme of application recommendation service display recommendation application icons, if cache data are displayed, the data returned by a system recommendation platform are abnormal or are not returned after overtime and are not refreshed; if the data returned by the system recommendation platform can be displayed normally, the newly received data is compared with the existing data, and the application recommendation page is refreshed locally by using the difference data. After the partial refresh, the page may have no or little variation.
In the traditional scheme, the post-exposure dotting is only shown for the data returned by the system recommendation platform, and the exposure dotting is not needed for the cache data to be updated. This results in a second time that the new data back may be consistent with the buffered data, but the data cannot be recalled after the partial refresh is employed, as the page may not have been modified. If all refreshing is adopted, that is, all data are drawn and displayed to the user after assignment, the page is uploaded to the dotting data before drawing, and the exposure dotting time and the actual data should not correspond to the dotting time.
Considering that the cache data after the service is started may be the page finally presented to the user after the display, or may be just one transition page, and the new data is received first, but the page corresponding to the new data is not refreshed yet, and the data is not obtained yet after the refresh, so that a two-time delay exposure scheme is adopted, two delay tasks of 800 milliseconds (ms) and 300ms are set, the former is used for waiting for the completion of the refresh process of exposure, and the latter is used for increasing the delay time length when the refresh is detected to be not completed yet. Although two delay durations are set, the delay durations are still fixed values, and even if the combination of execution and non-execution of the two delay durations is enumerated all over, uncertainty of each duration of the local refresh cannot be accommodated. And if both delays are performed, the whole delay time is too long, the waiting time of a user is increased, and inaccuracy is caused by too long dotting data delay. And if not refreshed, there is still a miss-strike. In short, even the above-described secondary delay exposure scheme still fails to solve the problem of inaccurate dotting because the fixed delay cannot adapt to the unfixed refresh duration of the partial refresh.
That is, although the partial refresh serves the purpose of improving the refresh efficiency, a new problem arises in that the number of icons or the area of the screen is different for each partial refresh, so that the required refresh period is not fixed. For example, only one icon may need to be changed at a time, two icons and one profile at a time, and sometimes no local refresh at all because the screen is unchanged. In the local refreshing scheme, time delay tasks are set for local refreshing to give time for foot refreshing, but the time delay time is fixed, and only two choices are executed or not executed, so that the uncertainty causes the problem that the timing of dotting is not good in the traditional scheme, and thus causes the problems of inaccurate dotting data such as missing dotting, missing dotting data or large corresponding relation deviation of dotting time and dotting data. For example, when local refreshing is not performed, missing dotting may be caused, and when a local refreshing task cannot be completed within a fixed delay, the dotting data may be lost, or when the previous dotting data is directly used as the current dotting data, various problems that the dotting data is inaccurate, such as incorrect correspondence between the dotting time and the dotting data, are caused.
In view of the above problems, the present application proposes a new dotting scheme, in which, for the case that the local refresh may not be refreshed and the refresh duration is not fixed, the data before and after the refresh is marked with old and new data, so that the operation of the local refresh is definitely triggered and the dotting data is exposed again after the refresh is completed. In the case where the two contents are identical but partial refreshing is still performed according to the scheme of the present application, because the re-drawn picture area is empty, the execution process does not need to take time to draw the picture and thus is very short. Therefore, on the premise of ensuring that the performance of local refreshing is not affected (the refreshing efficiency is improved), the accuracy of dotting data is also ensured, complicated setting and control of various parameters of time delay are omitted, and the scheme is simpler and easier to realize.
It should be noted that, exposure may be understood as displaying, exposing, and presenting, and in the embodiment of the present application, exposure dotting may be understood as transmitting data to a dotting software module, and after uploading the data to be exposed to a cloud server or a corresponding platform through the dotting software module, dotting is completed once. It should also be appreciated that drawing a picture of data on a screen is presented to a user, referred to as a presentation in embodiments of the present application. Presentation and dotting are two things that are parallel and influence each other. In the embodiment of the application, exposure dotting is used for collecting the condition data of the user using the target service, namely what picture is refreshed at what time to the user, how many times the refreshing is performed in one day, what the content after each refreshing is, so that the data can be used as various possible purposes such as a sample for establishing a model for analyzing the user demand. Therefore, if the dotting is inaccurate, for example, the dotting time does not correspond to the actual picture display time, and for example, the dotting record is missed, the sample is inaccurate, and the implementation effect of the related application is affected.
FIG. 2 is a schematic flow chart of a method of dotting service data when refreshing pages in accordance with an embodiment of the application. The steps shown in fig. 2 are described below.
S201, responding to a first operation of starting a target service by a user, and acquiring first cache data.
The first cache data are cache data of a first page, the first page is a first display page of an application of the target service after the first operation is executed, and the first operation is gesture operation for starting the target service for the first time or not. The target service is also exemplified by the application suggestion service, that is, step S201 may be to first slide down to open the search page and then start the target service. It may also be that the user continues to perform the slide down in the search page already in the search page, which may be regarded as triggering the start of the target service again.
The target service may be the application recommendation service (also referred to as the application recommendation service) described above, but it should be understood that any service capable of performing local refresh may be used as the target service herein, and the scheme of the present application is implemented to achieve accurate dotting.
The first page presented on the screen of the electronic device after the target service is started is the first page. If fig. 1 is taken as an example, interface 102 may be considered an example of a current page.
The first operation of the user to initiate the target service may be clicking an icon or a swipe gesture, without limitation. The specific form of the first operation may be various, and may be a slide gesture operation such as up, down, left, right, or a click operation. When the target service is an application suggestion service set on the search page, the operation of starting the target service may be a slide-down gesture operation on the desktop or a slide-down gesture operation in a running interface of the search page.
In one implementation, the application of the target service is a search page, the target service is an application suggestion service arranged on the search page, and the first operation is a user sliding gesture operation in a desktop or the search page. Application suggestion services are typically services that update pages through partial refresh, and are also the most widely operated way to open a search page in a desktop or swipe gesture operation, which is an operation that a user would perform when thinking of continuously updating a recommended application. It should be understood that the solution of the embodiment of the present application may also be used in other services that update pages through partial refresh.
In another implementation, before step S201, the method may further include: judging whether the starting of the target service is cold starting or not; when the starting of the target service is cold starting, executing the step of acquiring first cache data, wherein the first cache data is data corresponding to the target service in application initial page data of the target service; or,
when the starting of the target service is not cold starting, firstly acquiring the data of the last display page stored in the electronic equipment before the first operation, and judging whether the last display page contains the data of the target service or not;
when the last display page contains the data of the target service, the step of receiving second data is executed; or when the last display page does not contain the data of the target service, the step of acquiring the first cache data is performed.
That is, when the target service is started for the first time, there is no background cache data, and when an initial page is displayed after the starting, the data of the initial page can be used to determine the first cache data, and if the target service is not started for the first time, that is, the target service is started for multiple times in a state that the application of the target service has been started, at this time, the first cache data corresponds to the last display page before the first operation, specifically, the last display page refers to the last display page before the first operation of the application where the target service is located. When cold start is performed, acquiring first cache data; when the first operation is not performed on the running page of the application where the target service is located, that is, when the first operation is performed, the page displayed when the first operation occurs is the last displayed page, if the data of the target service is contained in the page, the more desirable dotting data is certainly the refreshed data, so that the situation is directly converted into receiving the second data. When there is a last page but there is no data of the target service, it indicates that there is no target service in the last page during the first operation, which can be understood as other pages where the target service is applied, and there is still need to provide an initial data for the target service, so that the step of acquiring the first cache data is performed, and then the subsequent steps can be continuously performed in a manner equivalent to the cold start. The implementation mode is that when the first operation occurs at different occasions, different corresponding processing modes exist, so that the whole scheme is finer and more rigorous in process execution, and the accuracy of dotting data can be further improved.
The steps are performed after the first operation occurs and before the first cached data is obtained.
It may be that the application where the target service is located is still in the background in a suspended state, which may be the case in a hot start, where a snapshot (surface) of the application where the target service is located is a page that is presented first after the target service is started, and data corresponding to the target service in the snapshot may be used as the first cached data. It should be understood that cold start refers to no suspension in the background, no complete start, and hot start that occurs after a temporary exit, the application is put in the background and suspended, at which point a snapshot is stored for hot start. This situation may be equivalent to a situation where the target service is not cold-started, where the snapshot of the application may not necessarily have the target service's data in it, is uncertain, if any, indicating that the page does not need to be redrawn (as it was already shown before it was deposited) or to be clicked (as it was already clicked before it was deposited). The time that the snapshot was generated is before the first operation, but many times before it was not. Only knowing that the data of the target service in the snapshot is not required to be redrawn or dotted after the application of the target service is started up, if the data of the target service is not in the snapshot, the first page is required to be redrawn and the dotting is performed after the second page is refreshed.
S202, marking the data type of the first cache data as old data.
In the embodiment of the application, the data type is to distinguish between new and old data, so the data type may include old data and new data. The buffered data taken before the refresh is called old data and the data taken after the refresh is called new data. However, it should be understood that the cache data and the new data may be used as data types, and correspond to old data and new data, respectively, or may be referred to as history data and latest data, respectively, or may be referred to as old data and new data, respectively, and the like, and there is no limitation. In the conventional scheme, the distinction between new data and old data is not performed, because the partial refresh only needs to compare the content difference of two adjacent cache data, and does not need to distinguish which is the preceding data and which is the following data. The embodiment of the application aims at the situation that the local refreshing is possibly not refreshed, and the data before and after refreshing are distinguished by the new data and the old data, so that the dotting data is accurate.
In one implementation, step S202 may include: when the number of icons to be displayed indicated by the first cache data is greater than or equal to the preset number threshold, marking the data type of the first cache data as old data, and converting to execute the step of receiving the second data, and transmitting the first cache data to an adapter for generating the first page while executing the step of receiving the second data; or when the number of icons to be displayed indicated by the first cache data is smaller than the preset number threshold, switching to the step of directly executing the step of receiving the second data.
That is, when the display area of the target service is displayed in its entirety with a small number of icons, no refreshing is necessary, so that it is unnecessary to mark the type of data, and it is sufficient to directly receive and overwrite the initial data with newly received second data. This is often the case when the electronic device is just used, taking the target service as an application suggestion service, that is, because the user just starts to use the electronic device, the number of applications that need to be recommended is insufficient to fill the display area of the application suggestion service, and such data may be directly received as the second data, that is, the new data, without regard to the old data.
The preset number threshold here may be obtained by a method of setting the preset number threshold hereinafter.
S203, receiving second data, wherein the second data is the data of a second page to be updated.
The second data may be received from the application recommendation platform through the communication interface, or may be received from a server corresponding to the target service through the communication interface.
For the application suggestion service, the second data may be generated by using the history record of the application on the electronic device for the user, where the second data includes the updated application icons with the highest use frequency and the preset number.
The second page to be updated may be understood as a page presented after the first previous page is refreshed. Taking fig. 1 as an example, the second page to be updated of the first page shown in the interface 102 is shown as an interface 103.
S204, marking the data type of the second cache data as new data.
Since the data types of the first cache data and the second cache data are marked as old data and new data, respectively, the data types of the two may always be different (inconsistent).
S205, during the period of carrying out local refreshing on the first page according to the second data to obtain the second page, when the data type of the second data is not consistent with the data type of the first cache data, carrying out local refreshing on the first page.
After the second data is taken, the local refresh can be performed, and in the scheme of the embodiment of the application, since the data type of the first cache data is marked as old data and the data type of the second data is marked as new data, the local refresh step becomes a step which is necessarily performed, and even if the local refresh area determined when the area needing the local refresh is determined to be empty, the local refresh action is performed, and only because the picture does not need to be redrawn when the local refresh area is empty, the redrawing time is saved.
In one implementation, step S205 may include: sending the second data to an adapter; when a partial refresh is performed on a first page with data in an adapter, the following operations are performed:
comparing the difference value of the second data and the first cache data to determine a page area needing refreshing;
judging whether the data source of the second data is the same as the data source of the first cache data or not, wherein the data source is used for indicating the platform source of the data;
when the page area to be refreshed is empty and the data source of the second data is the same as the data source of the first cache data according to the difference value of the second data and the first cache data, judging whether the data type of the second data is consistent with the data type of the first cache data;
and when the data type of the second data is inconsistent with the data type of the first cache data, executing the step of local refreshing on the first page.
In this implementation, the judgment of the consistency of the data types is added in the judgment logic of the local refresh, and because the judgment result is not consistent, even if the judgment results of the original two judgment logics indicate that the local refresh is not needed, the local refresh is triggered and still needs to be executed according to the judgment result of the consistency of the data types. It should be understood that in this implementation, the original determination logic of the local refresh (that is, the determination of the page area that needs to be refreshed and the determination of the data source) is not directly removed, but new determination logic is added on the basis of the two determination logics, so that the accuracy of dotting can be ensured while the technical effect of improving the refresh efficiency of the local refresh is hardly affected.
In another implementation, before the local refresh of the first page, the method may further include: sending the first cache data to an adapter; a first page is generated using data in the adapter. This implementation is directed to the case where there is no first page at the beginning, i.e. at cold start, and when there is no data for the target service in the last page, the first page's picture also requires a rendering process to be presented to the user on the screen, and the rendering of the first page is still using the adapter. Because the data has new and old identifications, the drawing of the first page does not influence the generation of the second page through partial refreshing after the drawing of the first page is completed. Therefore, the second data can be directly received after the drawing of the first page is started without waiting for the drawing completion, differential refreshing is realized, and waiting time is saved. The traditional scheme cannot distinguish the refresh data with the same content, so that differential refresh cannot be realized, and the next step can be executed only after one refresh is finished, so that the condition that the first page is not refreshed yet is prevented, and the second data reaches the data confusion caused by the adapter, and the refresh action cannot be executed even after the messy code is refreshed.
In another implementation, during the partial refresh of the first page, the method may further include: and executing the step of local refreshing when the page area to be refreshed is determined to be non-empty according to the difference value between the second data and the first cache data or the data source of the second data is different from the data source of the first cache data. That is, for the case where local refresh is originally required or according to execution logic similar to the conventional scheme, the step of performing local refresh may be continued.
From the two implementations described above, it is primarily desirable to avoid false dotting by adding decision logic. However, the new judgment logic and the original two judgment logics can be combined, so that the effect of minimizing the influence on the local refreshing scheme as much as possible can be achieved.
In one implementation, the method further includes: determining a preset number threshold of display icons of the target service according to the screen size of the electronic equipment and/or the state of the target service; the states of the target service include a collapsed state and an expanded state.
The preset number threshold may be used to classify the first cache data and/or the second data to achieve finer refreshing, that is, to set an execution threshold for the subsequent step, so that different refresh policies may be adopted in different situations.
The larger the screen of the electronic device, the larger the display area that can be allocated to the target service, and the more data that can be presented. Taking fig. 1 as an example, there are only 4 icons in the target service bar (application suggestion service bar) in the folded state, and in practice, there may be 5, 6, or other values. For example, a folding screen phone may be large to expand a full screen, where the preset number of thresholds that may be set is larger. But for the same electronic device, the folded state and the unfolded state of the target service are also distinguished, as in the example of fig. 1, where the folded state is a one-line display and the unfolded state is a two-line display. In practice, however, there is no limitation to the division of the two states into rows, respectively.
It should be understood that in the above implementation, fine setting of the threshold value of the preset number is mainly achieved, and setting is performed by integrating the screen size of the electronic device and the state of the display area of the target service, but there is no limitation on the specific numerical value.
In one implementation, during the partial refresh of the first page, the method further includes: when the number of icons to be displayed indicated by the second data is larger than or equal to a preset number threshold, after the starting effect of the target service is finished, executing a step of locally refreshing the first page according to the second data; or when the number of icons to be displayed indicated by the second data is smaller than a preset number threshold, the step of carrying out local refreshing on the first page is not carried out, and the step of directly exposing the second data serving as dotting data of the target service is carried out.
In this implementation, if the number of icons is sufficient, then the target service starts playing the active effect, then a partial refresh is performed, if the number of icons is insufficient, then no refresh is performed, which corresponds to the need for the second data to be displayed, and the second data is directly exposed to the light for dotting. The former is to refresh first, refresh and then dotting, and the latter is to directly dott without refreshing.
It will also be appreciated that the steps of the inventive arrangements may be performed after the first operation is obtained, with the initiating action being played during this period also being accompanied by the triggering of the first operation. Therefore, in order not to affect the display effect of starting the dynamic effect, the step related to the partial refresh can be executed after the dynamic effect is ended. And when the number of icons is too small and the display is not necessary, the equivalent effect is not needed to be ended.
206. And exposing the second data serving as dotting data of the target service after the partial refreshing is finished.
The local refreshing is finished, then the exposure dotting is performed, the dotting time at the moment is most reasonable, missing dotting and misplacing can be effectively avoided, the whole dotting process does not influence the local refreshing process, and the local refreshing can be performed in a differential refreshing mode due to the identification of new and old data.
It should be further noted that, since page data is required to be obtained from some specific nodes, in the embodiment of the present application, the second data may be obtained by taking the data from the adapter after the partial refresh is completed. However, since both the first cache data and the second data are sent to the adapter, it is also necessary to determine whether the read data is new data or not after the data is read from the adapter, and if the read data is new data, the second data is indicated, and then the dotting is exposed.
In one implementation, step S206 may include:
after the partial refreshing is finished, reading data to be exposed from the adapter, wherein the data to be exposed is the first cache data or the second data;
and when the data type of the data to be exposed is new data, the data to be exposed is considered to be the second data, and the second data is used as dotting data of target service for exposure.
In one example, the implementation further includes:
after the partial refreshing is finished, reading data to be exposed from the adapter, wherein the data to be exposed is the first cache data or the second data;
and when the data type of the data to be exposed is new data, the data to be exposed is considered as the first cache data, and the first cache data is deleted.
In one implementation, the method shown in fig. 2 may further include:
s207, after exposing the second data as dotting data of the target service, the method further includes: the data type of the second data is marked as old data.
The implementation enables dynamic updating, and when the target service is started next time, and not cold, the receiving of new data compared to the second data update and the local refreshing and dotting of the new data compared to the second data update can be performed directly.
The scheme shown in fig. 2 mainly adds the identifier of the new data and the old data to the refresh data, so that the refresh operation can be triggered even if the received content of the new data and the content of the old data are consistent because of different identifiers, and the dotting is exposed after the refresh is finished, thereby avoiding the missed dotting caused by the fact that the refresh cannot be triggered when the content of the new data and the old data are identical; the situation that the data is spotted when the data is not refreshed is avoided due to the fixed setting of the delay time length, and the spotting data is inaccurate due to the midway spotting; and avoids that the dotting time caused by delay does not correspond to the actual acquisition time of the data. Thus, the obtained dotting data is more accurate. In addition, a series of judgment and control on when the delay starts, when the delay ends, how long and the like are omitted, so that the response rate is also improved. In short, the scheme can avoid missing dotting caused by the extreme condition of non-refreshing and inaccurate dotting data caused by mismatching of fixed delay and refreshing time length, and the scheme omits setting and control of parameters such as various time lengths of delay in the traditional scheme, so that the scheme is simpler and easier to realize.
FIG. 3 is a schematic flow chart of another method of dotting service data when refreshing pages in accordance with an embodiment of the application. Fig. 3 can be seen as an example of the method shown in fig. 2. Fig. 3 exemplifies an application suggestion service in which a target service is a search page.
S301, pulling down to open the search page.
Step S301 can be regarded as an example of step S201. Pull-down is one example of a first operation. Either pulling down on the desktop or pulling down in the search page to refresh manually.
S302, judging whether the cold start is performed, when the judging result is yes, turning to the step S303, and when the judging result is no, turning to the step S311.
S303, obtaining cache data.
The cache data is herein an example of the first cache data.
S304, judging whether the data quantity is larger than or equal to a preset quantity threshold, when the judging result is yes, turning to execute step S305, and when the judging result is no, turning to execute step S307.
The number of data here, in the case where the target service is an application recommendation service, can be understood as the number of icons, that is, the number of icons in the cache data.
It should be noted that, the preset value in fig. 3 is the preset number threshold, which is omitted for simplicity of the drawing.
In one example, the preset number threshold is: a straight mobile phone (one example of electronic equipment with a smaller screen) +services are in a folding state of 5; the number of the straight mobile phones and the number of the services are 6; folding screen full screen mobile phone (one example of electronic equipment with larger screen) +service is 6 folding status; the folding screen full screen mobile phone + service is 7 in unfolding state. However, it is to be understood that in practice, there is no limitation to the specific values, and may be set as desired. However, only two factors of the comprehensive screen size and the display state of the service can be determined in the setting process. Therefore, when the preset quantity threshold value is used, better refreshing and displaying effects are achieved.
S305, setting the data type of the cache data acquired in the step S303 to be old data.
The step further includes sending the cached data to an adapter. Since this corresponds to the time when the page has not been presented to the user, in connection with fig. 1, the interface 102 is also drawn and presented to the user after the interface 101, but during the period of time before the interface 102 has not yet been presented. The execution of step S306 and step S316 may be triggered synchronously after the execution of step S305.
S306, acquiring business pushing data.
The business pushing data is the recommendation data of the business recommendation platform. Or may be understood as recommended data for the recommended platform to which the target service corresponds, but not data provided by the manufacturer of the electronic device. May be considered as one example of one of the sources of the second data.
In connection with this scenario, it may be one or more application icons that the business pushing platform issues to the electronic device.
S307, brain and quotient pushing data are acquired.
The brain data may be understood as data of a system recommendation platform, or data determined after various data analysis of the electronic device itself, or as data provided by a manufacturer of the electronic device. May be considered as another example of a source of the second data.
In combination with the scenario herein, the application icons sent to the electronic device by the business pushing platform may be a set of application icons obtained by combining one or more application icons sent by the system recommendation platform of the electronic device.
The second data may also be recommendation data generated from a local historical usage record of the electronic device. In connection with this scenario, it may be that the electronic device determines a preset number of icons that are most frequently used as recommendation data according to a historical usage record of applications on the electronic device by a user.
S308, setting the data types of the data acquired in step S306 and step S307 and step S315 as new data.
Step S306 is performed on the premise that the number of icons in the cached data is also sufficient, step S307 is performed on the premise that the number of icons in the cached data is insufficient, and step S315 is performed on the premise that the data of the application suggestion is not in the last page (current page) and the number of icons in the obtained cached data is sufficient.
S309, judging whether the data quantity is larger than or equal to a preset quantity threshold, when the judging result is yes, turning to execute step S310, and when the judging result is no, turning to execute step S318.
The number of data here, i.e. the number of icons in the new data. When the determination result is yes, it is indicated that the data amount of the new data is enough to be displayed, so that both display and dotting are required, step S310 is performed until the data amount is used for the subsequent partial refresh and is used for exposing the dotting. When the determination result is no, it is indicated that the data amount of the new data is insufficient for display, but there is no need for display but there is a need for dotting, so that the exposure dotting of step S318 is not displayed but directly performed.
S310, waiting for the end of the pulling-down effect.
That is, the above steps may be performed after the pull-down operation is acquired, and during this period, the pull-down effect played under the trigger of the pull-down operation is accompanied. Therefore, in order not to affect the display effect of the dynamic effect, step S316 may be executed after the dynamic effect is ended.
S311, judging whether the current page has data of application suggestion service, and when the judging result is yes, turning to execute step S315, and when the judging result is no, turning to execute step S312.
The current page is understood herein to be the page at the time the pull-down operation is performed, i.e., the last page before the pull-down operation. If the data of the application proposal service is already in the page, the part of the data is subjected to dotting exposure when the page is refreshed, and the page is also presented to the user, so that the step of directly skipping to the step of receiving new data is finished, and the part of the data does not need to be walked into an adpter for refreshing and can be directly discarded.
It should be noted that, in step S311 in fig. 3, for brevity, the data for determining whether the current page has the application suggestion service is represented as "page has application suggestion? ".
S312, obtaining cache data.
That is, although not cold-started, since the current page is not already presented, it is also required to be presented to the user, so that the steps of acquiring cache data, judging the data amount, and marking the data type need to be performed continuously with reference to the cold start to generate the first page to be presented to the user.
S313, judging whether the data quantity is larger than or equal to a preset quantity threshold, when the judging result is yes, turning to the step S314, and when the judging result is no, turning to the step S315.
The number of data herein may be understood as the number of icons in the cached data. The preset number threshold may be described above, and will not be described in detail.
When the number of icons in the cache data is enough to be displayed, the icons are marked as old data and sent to the adpter, otherwise, the icons are not displayed, and new data are directly acquired.
S314, setting the data type of the cache data acquired in the step S313 as old data.
The step further includes sending the cached data to an adapter. Since this corresponds to when the page has not yet been presented to the user. After the execution of step S324, the execution of step S325 and step S311 may be triggered synchronously.
S315, acquiring brain and quotient pushing data.
The content refers to the above, that is, the step of acquiring the second data is performed, step S315 is performed under the trigger of step S313 or step S311, that is, when the number of data is insufficient for presentation or has been presented/clicked, new data (second data) is directly acquired.
S316, setting the adpter data and refreshing the page.
Step S316 may be performed under the trigger of step S305 or step S314 to generate a first page presented to the user, i.e. the first page above. Taking fig. 1 as an example, step S316 is triggered by step S305 or step S314 to complete execution, and then the interface 102 is displayed. The refresh data used during this period is the cache data, i.e. the old data, or the first cache data described above.
Step S316 may also be performed under the trigger of step S310 to obtain the next page presented to the user by partial refresh of the first page presented to the user, i.e. the second page is obtained by partial refresh of the first page hereinabove. Taking fig. 1 as an example, step S316 is performed under the triggering of step S310 to display the interface 103, that is, step S316 occurs between the time when the interface 102 occurs and the time when the interface 103 occurs.
The locally refreshed and judged logic includes: judging whether the package names are consistent (areltemsname), and refreshing when the package names are inconsistent, namely whether the icon names are consistent, and refreshing when the package names are inconsistent; determining whether the source types are consistent (arementtsname), i.e. whether the data is from the same recommendation platform (here, brain/business push is taken as an example), and refreshing when the source types are inconsistent; when the two judging results are consistent, judging whether the data types are consistent (getChangePayload), and refreshing when the data types are inconsistent.
The onPayLoads refresh can be called back when refreshing.
When judging the data sources, the data sources can be different recommendation platforms, can be generated by local histories of the electronic equipment, and can be the results obtained by integrating a plurality of data sources, so that the data sources are the same, namely that only one source of the refreshing data (old data) of the previous time and the refreshing data (new data) of the next time is the same; alternatively, both the previous refresh data (old data) and the next refresh data (new data) have multiple sources of the same number, and the multiple sources are all the same.
S317, the data is fetched from the adpter and whether the data is new data is judged, and when the judgment result is yes, the step S318 is executed.
Since the callback data is required to be refreshed, and the traditional scheme does not have a data type to distinguish whether the fetched data is the last refreshed data or the last refreshed data, in the scheme of the application, the exposure dotting can be triggered by judging whether the fetched data is new data or not after the data is fetched due to the addition of the identification of the data type.
S318, immediately executing exposure dotting.
It will be appreciated that it is certainly desirable that the exposure dotting be new data, so the old data (old data) is used only to generate an initial page or a transition page, or is used to present to the user's view, but is not used to expose dotting. The new data and the screen are used for displaying the user and are also used for exposing and dotting.
And S319, setting the data type of the new data as old data after the exposure is finished.
In some implementations, the scheme shown in fig. 3 may further include a step of discarding old data, which may be performed after step S316 and before step S317, so that the determination of S317 need not be performed because only new data remains. It may also be executed at any time after the determination of no in step S304 and/or step S313, because the number is insufficient for presentation and the old data has no dotting requirement, neither presentation nor dotting is required, and it is discarded.
In addition, the page data may be discarded when the determination result in step S311 is yes, and since the target service is all the inside of the page, which has been already shown and clicked, is not needed, it is only necessary to discard the page directly and then re-receive new data.
In the scheme shown in fig. 3, the process of refreshing and dotting the whole page is described mainly taking the application suggestion service that the target service is the search page as an example. Because the two data are marked, the data in the adapter can distinguish which refreshing time, thereby ensuring that the refreshing process is not affected. And three judgment logics are adopted in the partial refresh, and the judgment results of the data types are inconsistent, so that the refresh is necessarily performed. However, since the partial refresh is only a part of which the refresh is changed, the redrawing is not needed without the change, which is equivalent to a blank execution, and the whole partial refresh scheme is not adversely affected. But the dotting time is more accurate, and the dotting data is also accurate.
It should be noted that, steps S306, S307, S324 in fig. 3 are all examples of receiving the second data, and the trigger conditions are different, that is, the opportunity of receiving is different, but the time delay is not used to wait for the end of the previous refresh to be received as in the conventional scheme. That is, the conventional scheme needs to wait for the first page to refresh and display before receiving the second data, but the scheme of the application only marks the first cache data (the refresh data of the first page) or determines that the first page does not display necessarily, and then receives the second data. Or it is understood that the traditional scheme must wait for the end of the previous refresh to receive the data needed by the next refresh, but because of the existence of the data type identifier, after the previous refresh data is marked, the data is not sent to the adapter at this time, and the next refresh data can be received when the refresh is not started yet; or when it is determined that the previous refresh data is not necessary (the amount of data is too small to be displayed or the history page indicates that the first page is already displayed and is not necessary for display when the data is not cold-started, and the first page does not need to be refreshed), the next refresh data can be received. The reason is that the traditional scheme does not have data type identification, if two groups of data arrive at the adapter at the same time, the adapter cannot distinguish the data to cause refresh errors when executing refresh, so that a delay task is set, and the next time can be performed after the previous time of refreshing, so that new data received during refresh is prevented from interfering with the original refresh task. Because the time from receiving new data to sending to the adapter is very short, but the time that the adapter refreshes pages with old data is relatively long, sending new data to the adapter if a page of old data has not been refreshed, tends to cause the adapter to refresh an erroneous page because of the inability to distinguish between miscellaneous data, and even stop refreshing. However, in the scheme of the application, the data type identifier is introduced, and even if two groups of data exist in the adapter at the same time, the two groups of data can still be distinguished as the data to be used for the previous refresh and the next refresh respectively, so that the next refresh can be continued by the data of the next time immediately after the previous refresh is finished, and the differential refresh is realized. It should be further understood that, although the above data type setting can be extended to marking three or more groups of data at a time, for example, marking can be performed by using the receiving time, this brings more complicated judgment logic operation and obtaining time and larger storage control, and for the page refresh of the target service, the local refresh book is suitable for updating less, relatively infrequent scenes, and for the scenes with frequent picture changes, local refresh is not adopted, so in the local refresh scene of the present application, it is enough to only mark the data with two times, and the scheme of the present application is the most simple and most suitable for the local refresh scene on the premise of distinguishing the data.
The method of the embodiment of the present application is mainly described above with reference to the drawings. It should be understood that, although the steps in the flowcharts related to the embodiments described above are shown in order, these steps are not necessarily performed in the order shown in the figures. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages. The following describes an apparatus according to an embodiment of the present application with reference to the accompanying drawings.
Fig. 4 is a schematic structural diagram of an apparatus for dotting service data when refreshing a page according to an embodiment of the present application. As shown in fig. 4, the apparatus 2000 includes a processing unit 2001, a refresh unit 2002, and a dotting unit 2003. The device 2000 may be integrated into an electronic device such as a mobile phone, a tablet computer, a notebook computer, etc.
The apparatus 2000 can be used to perform any of the methods described above for dotting service data when refreshing pages. For example, the processing unit 2001 may be used to perform steps S201-S204, the refresh unit 2002 may be used to perform step S205, and the dotting unit 2003 may be used to perform step S206. The processing unit 2001 may be used for performing steps S301-S310, S321-S325, the refresh unit 2002 may be used for performing step S311, and the dotting unit 2003 may be used for performing steps S312-S314.
In one implementation, the apparatus 2000 may further include a storage unit to store related data. The memory unit may be integrated in any one of the above units, or may be a unit independent of all the above units.
Fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device 900 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (universal serial bus, USB) interface 930, a charge management module 940, a power management module 941, a battery 942, an antenna 1, an antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, an earphone interface 970D, a sensor module 980, keys 990, a motor 991, an indicator 992, a camera 993, a display screen 994, and a subscriber identity module (subscriber identification module, SIM) card interface 995, etc. The sensor module 980 may include, among other things, a pressure sensor 980A, a gyroscope sensor 980B, a barometric sensor 980C, a magnetic sensor 980D, an acceleration sensor 980E, a distance sensor 980F, a proximity sensor 980G, a fingerprint sensor 980H, a temperature sensor 980J, a touch sensor 980K, an ambient sensor 980L, a bone conduction sensor 980M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 900. In other embodiments of the application, electronic device 900 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Illustratively, the processor 910 shown in fig. 5 may include one or more processing units, such as: the processor 910 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 900, among other things. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 910 for storing instructions and data. In some embodiments, the memory in the processor 910 is a cache memory. The memory may hold instructions or data that the processor 910 has just used or recycled. If the processor 910 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided and the latency of the processor 910 is reduced, thereby improving the efficiency of the system.
In some embodiments, a MIPI interface may be used to connect processor 910 with peripheral devices such as display 994, camera 993, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. Processor 910 and display 994 communicate via a DSI interface to implement the display functions of electronic device 900.
In some embodiments, the GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. GPIO interfaces may be used to connect processor 910 with camera 993, display 994, wireless communication module 960, audio module 970, sensor module 980, and so forth. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
It should be understood that the connection between the modules illustrated in the embodiments of the present application is only illustrative, and does not limit the structure of the electronic device 900. In other embodiments of the present application, the electronic device 900 may also employ different interfacing manners, or a combination of interfacing manners, in the above embodiments.
The electronic device 900 implements display functionality via a GPU, a display 994, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display 994 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 910 may include one or more GPUs that execute program instructions to generate or change display information.
The display 994 is used to display images, videos, and the like. The display 994 includes a display panel. In some embodiments, the electronic device 900 may include 1 or N displays 994, N being a positive integer greater than 1.
The internal memory 921 may be used to store computer-executable program code including instructions. The processor 910 executes various functional applications of the electronic device 900 and data processing by executing instructions stored in the internal memory 921. The internal memory 921 may include a stored program area and a stored data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 900 (e.g., audio data, phonebook, etc.), and so forth. In addition, the internal memory 921 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The pressure sensor 980A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 980A may be disposed on the display 994. The pressure sensor 980A is of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. When a force is applied to the pressure sensor 980A, the capacitance between the electrodes changes. The electronic device 900 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display 994, the electronic device 900 detects the intensity of the touch operation from the pressure sensor 980A. The electronic device 900 may also calculate the location of the touch based on the detection signal of the pressure sensor 980A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example, when a touch operation with a touch operation intensity smaller than a first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
Touch sensor 980K, also referred to as a "touch panel". The touch sensor 980K may be disposed on the display 994, and the touch sensor 980K and the display 994 form a touch screen, which is also referred to as a "touch screen". The touch sensor 980K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 994. In other embodiments, the touch sensor 980K may be disposed on a surface of the electronic device 900 other than where the display 994 is located.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
The embodiment of the application also provides electronic equipment, which comprises: one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors, which when executed, cause the electronic device to implement the steps of any of the methods described above. Embodiments of the present application also provide a computer-readable storage medium storing a computer program that, when executed by an electronic device, performs the steps of the method embodiments described above.
The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/electronic apparatus, recording medium, computer memory, read-only memory (ROM), random access memory (random access memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
Embodiments of the present application provide a computer program product comprising a computer program for performing the steps of the method embodiments described above when the computer program is executed by an electronic device. The computer program comprises computer program code which may be in source code form, object code form, executable file or in some intermediate form, etc.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. 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 application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other manners. For example, the apparatus/device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
It should 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 should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (13)

1. A method for dotting service data when refreshing a page, comprising:
responding to a first operation of starting a target service by a user, acquiring first cache data, wherein the first cache data is cache data of a first page, the first page is a first display page of an application of the target service after the first operation is executed, and the first operation is gesture operation of starting the target service for the first time or not;
marking the data type of the first cache data as old data;
receiving second data, wherein the second data is the data of a second page to be updated;
marking the data type of the second data as new data;
during the period of carrying out local refreshing on the first page according to the second data to obtain the second page, when the data type of the second data is not consistent with the data type of the first cache data, executing local refreshing on the first page;
and after the partial refreshing is finished, exposing the second data serving as dotting data of the target service.
2. The method of claim 1, wherein the performing the partial refresh on the first page when the data type of the second data is determined to be inconsistent with the data type of the first cache data during the partial refresh of the first page based on the second data to obtain the second page comprises:
Sending the second data to an adapter;
when the local refresh is performed on the first page by using the data in the adapter, the following operations are performed:
comparing the difference value of the second data and the first cache data to determine a page area needing refreshing;
judging whether the data source of the second data is the same as the data source of the first cache data or not, wherein the data source is used for indicating the platform source of the data;
when the page area to be refreshed is empty and the data source of the second data is the same as the data source of the first cache data according to the difference value of the second data and the first cache data, judging whether the data type of the second data is consistent with the data type of the first cache data;
and executing the local refreshing on the first page when the data type of the second data is inconsistent with the data type of the first cache data.
3. The method of claim 2, wherein prior to the local refreshing of the first page, the method further comprises:
sending the first cache data to the adapter;
The first page is generated using data in the adapter.
4. The method of claim 2, wherein during the partial refresh of the first page, the method further comprises:
and executing the step of local refreshing when the page area to be refreshed is determined to be non-empty according to the difference value between the second data and the first cache data or the data source of the second data is different from the data source of the first cache data.
5. The method according to claim 2, wherein exposing the second data as the dotting data of the target service after the partial refresh is completed, comprises:
after the partial refreshing is finished, reading data to be exposed from the adapter, wherein the data to be exposed is the first cache data or the second data;
and when the data type of the data to be exposed is new data, the data to be exposed is considered to be the second data, and the second data is used as dotting data of target service for exposure dotting.
6. The method according to claim 1, wherein the method further comprises:
Determining a preset number threshold of display icons of the target service according to the screen size of the electronic equipment and/or the state of the target service; the states of the target service include a collapsed state and an expanded state.
7. The method of claim 6, wherein the marking the data type of the first cache data as old data comprises:
when the number of icons to be displayed indicated by the first cache data is greater than or equal to the preset number threshold, marking the data type of the first cache data as old data, and converting to execute the step of receiving the second data, and transmitting the first cache data to an adapter for generating the first page while executing the step of receiving the second data; or,
and when the number of icons to be displayed indicated by the first cache data is smaller than the preset number threshold, switching to the step of directly executing the step of receiving the second data.
8. The method of claim 6, wherein during the partial refresh of the first page, the method further comprises:
when the number of icons to be displayed indicated by the second data is greater than or equal to the preset number threshold, executing the step of locally refreshing the first page according to the second data after the starting effect of the target service is finished; or,
And when the number of icons to be displayed indicated by the second data is smaller than the preset number threshold, not executing the step of locally refreshing the first page, and switching to executing the step of directly exposing and dotting the second data as dotting data of the target service.
9. The method of claim 1, wherein after the first operation occurs and before the first cached data is obtained, the method further comprises:
judging whether the starting of the target service is cold starting or not;
when the starting of the target service is cold starting, executing the step of acquiring the first cache data, wherein the first cache data is data corresponding to the target service in the application initial page data of the target service; or,
when the starting of the target service is not cold starting, firstly acquiring the data of the last display page stored in the electronic equipment before the first operation, and judging whether the last display page contains the data of the target service or not;
when the last display page contains the data of the target service, the step of receiving second data is executed; or when the last display page does not contain the data of the target service, the step of acquiring the first cache data is performed.
10. The method according to any one of claims 1 to 9, wherein the application of the target service is a search page, the target service is an application suggestion service provided on the search page, and the first operation is a user's slide-down gesture operation on a desktop or in the search page.
11. The method according to any one of claims 1 to 9, characterized in that after exposing dotting the second data as dotting data of the target service, the method further comprises: and marking the data type of the second data as old data.
12. An electronic device comprising a memory, one or more processors, and a computer program stored in the memory and executable on the processor, wherein execution of the computer program by the one or more processors causes the electronic device to implement the method of any one of claims 1 to 11.
13. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by an electronic device, implements the method of any one of claims 1 to 11.
CN202311404355.2A 2023-10-27 2023-10-27 Method for dotting service data when refreshing page and electronic equipment Active CN117170563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311404355.2A CN117170563B (en) 2023-10-27 2023-10-27 Method for dotting service data when refreshing page and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311404355.2A CN117170563B (en) 2023-10-27 2023-10-27 Method for dotting service data when refreshing page and electronic equipment

Publications (2)

Publication Number Publication Date
CN117170563A true CN117170563A (en) 2023-12-05
CN117170563B CN117170563B (en) 2024-03-15

Family

ID=88941615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311404355.2A Active CN117170563B (en) 2023-10-27 2023-10-27 Method for dotting service data when refreshing page and electronic equipment

Country Status (1)

Country Link
CN (1) CN117170563B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105303412A (en) * 2015-11-20 2016-02-03 小米科技有限责任公司 Method, device and system for layout of content items
US9984125B1 (en) * 2012-05-31 2018-05-29 Leading Market Technologies, Inc. Apparatus and method for acquiring, managing, sharing, monitoring, analyzing and publishing web-based time series data
WO2021254269A1 (en) * 2020-06-17 2021-12-23 华为技术有限公司 Method and device for determining features of user, and computer readable medium
CN115292627A (en) * 2022-07-27 2022-11-04 天翼云科技有限公司 Method and device for displaying page, electronic equipment and storage medium
CN116186400A (en) * 2023-02-17 2023-05-30 中信百信银行股份有限公司 Front-end page refined region dotting method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9984125B1 (en) * 2012-05-31 2018-05-29 Leading Market Technologies, Inc. Apparatus and method for acquiring, managing, sharing, monitoring, analyzing and publishing web-based time series data
CN105303412A (en) * 2015-11-20 2016-02-03 小米科技有限责任公司 Method, device and system for layout of content items
WO2021254269A1 (en) * 2020-06-17 2021-12-23 华为技术有限公司 Method and device for determining features of user, and computer readable medium
CN115292627A (en) * 2022-07-27 2022-11-04 天翼云科技有限公司 Method and device for displaying page, electronic equipment and storage medium
CN116186400A (en) * 2023-02-17 2023-05-30 中信百信银行股份有限公司 Front-end page refined region dotting method and system

Also Published As

Publication number Publication date
CN117170563B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
EP2990930B1 (en) Scraped information providing method and apparatus
US10366519B2 (en) Operating method for image and electronic device supporting the same
CN108763582B (en) File searching method, device, terminal and storage medium
US11169627B2 (en) Apparatus and method for providing memo function
US20180032259A1 (en) Method of displaying content and electronic device adapted to the same
KR101050866B1 (en) Character recognition devices, character recognition programs, and character recognition methods
WO2019105457A1 (en) Image processing method, computer device and computer readable storage medium
RU2648616C2 (en) Font addition method and apparatus
CN108595573B (en) Page display method and device, storage medium and electronic equipment
CN110222288B (en) Page display method, device and storage medium
US10504560B2 (en) Electronic device and operation method thereof
EP3480790B1 (en) Method and apparatus for continuously displaying images on basis of similarity of images
EP4191513A1 (en) Image processing method and apparatus, device and storage medium
KR20180121273A (en) Method for outputting content corresponding to object and electronic device thereof
KR102316846B1 (en) Method for sorting a media content and electronic device implementing the same
CN108234758B (en) Application display method and device, storage medium and electronic equipment
CN108803972B (en) Information display method, device, mobile terminal and storage medium
CN117170563B (en) Method for dotting service data when refreshing page and electronic equipment
US10645211B2 (en) Text input method and electronic device supporting the same
CN109388249B (en) Input information processing method and device, terminal and readable storage medium
EP3446240B1 (en) Electronic device and method for outputting thumbnail corresponding to user input
US20140040187A1 (en) Information processing apparatus and information processing method
CN116826892A (en) Charging method, charging device, electronic apparatus, and readable storage medium
CN111813307B (en) Application program display method and device and electronic equipment
CN113141433B (en) Method and device for testing screen sensitivity and processor

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
GR01 Patent grant
GR01 Patent grant