CN114691269A - Page updating method, device, system and storage medium - Google Patents

Page updating method, device, system and storage medium Download PDF

Info

Publication number
CN114691269A
CN114691269A CN202210316974.5A CN202210316974A CN114691269A CN 114691269 A CN114691269 A CN 114691269A CN 202210316974 A CN202210316974 A CN 202210316974A CN 114691269 A CN114691269 A CN 114691269A
Authority
CN
China
Prior art keywords
state data
updating
page
time
current state
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
CN202210316974.5A
Other languages
Chinese (zh)
Other versions
CN114691269B (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.)
Guangdong Vanward New Electric Co Ltd
Original Assignee
Guangdong Vanward New Electric 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 Guangdong Vanward New Electric Co Ltd filed Critical Guangdong Vanward New Electric Co Ltd
Priority to CN202210316974.5A priority Critical patent/CN114691269B/en
Publication of CN114691269A publication Critical patent/CN114691269A/en
Application granted granted Critical
Publication of CN114691269B publication Critical patent/CN114691269B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

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

Abstract

The application relates to a page updating method, a device, a system and a storage medium. The page updating method comprises the following steps: receiving state data sent by the smart home; determining the time interval between the last time of receiving the state data and the current time of receiving the state data; and selecting synchronous update or asynchronous update of the control page of the smart home based on the current state data according to the time interval. According to the method and the device, a suitable mode for updating the intelligent home control page can be intelligently selected according to the reporting frequency of the intelligent home state data, the problem that the page backflow redrawing causes the blockage due to the excessive rendering times of the control page caused by the fact that the intelligent home is in a high concurrent data reporting state in a short time is avoided, the problem that the client end is flashed and retreated due to the increase of resource consumption is prevented, and the rendering efficiency of the intelligent home control page and the stability of page updating are effectively improved.

Description

Page updating method, device, system and storage medium
Technical Field
The present application relates to the field of data service technologies, and in particular, to a page update method, apparatus, system, and storage medium.
Background
When the existing smart home device is in a high-concurrency reporting state, the number of times of rendering a control page corresponding to the smart home device by a mobile terminal is too many, so that the problems of blocking, resource consumption increase and the like caused by page backflow redrawing are caused.
In the implementation process, the inventor finds that at least the following problems exist in the conventional technology: the existing updating method of the intelligent household equipment control page is not high in stability.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a page updating method, device, system and storage medium.
A page updating method comprises the following steps:
receiving state data sent by the smart home;
determining the time interval between the last time of receiving the state data and the current time of receiving the state data;
and selecting synchronous update or asynchronous update of the control page of the smart home based on the current state data according to the time interval.
In one embodiment, the step of selecting synchronous update or asynchronous update of the control page of the smart home based on the current state data according to the time interval includes:
comparing the first duration with the time interval to obtain a comparison result;
if the comparison result is that the time interval is greater than or equal to the first duration, synchronously updating the control page based on the current state data;
and if the comparison result is that the time interval is smaller than the first duration, asynchronously updating the control page based on the current state data.
In one embodiment, if the comparison result is that the time interval is less than the first duration, the step of asynchronously updating the control page based on the current state data includes:
judging whether the cache region is full or not under the condition that the time interval is smaller than the first duration as a comparison result to obtain a judgment result;
if the judgment result is that the cache region is not full, storing the current state data into the cache region;
and if the judgment result is that the cache region is full, updating the control page based on the current state data, and emptying the cache region.
In one embodiment, after the step of storing the current state data into the buffer, the method further includes:
if the next state data is not received under the condition that the first time length is reached, updating the control page based on the current state data, and clearing the cache region; the starting time of the first duration is the time when the current state data is received.
In one embodiment, after the step of storing the current state data into the buffer area, the method further includes:
if the second duration is confirmed to arrive, updating the control page based on the current state data, and clearing the cache region; the starting time of the second duration is the time of last control page updating.
In one embodiment, if the determination result is that the cache region is full, the step of updating the control page based on the current state data includes:
and under the condition that the cache region is full according to the judgment result, if the time length from the last time of updating the control page to the time of receiving the current state data is greater than or equal to the second time length, updating the control page based on the current state data.
In one embodiment, if the determination result is that the cache region is full, the step of updating the control page based on the current state data further includes:
if the judgment result is that the cache region is full, if the time length from the last time of controlling the page updating to the current state data receiving is less than a second time length, emptying the cache region and storing the current state data into the buffer region;
if the next state data is not received under the condition that the first time length is reached, updating the control page based on the current state data; the starting time of the first duration is the time when the current state data is received.
A page update apparatus, comprising:
the data receiving module is used for receiving state data sent by the smart home;
the data processing module is used for determining the time interval between the last time of receiving the state data and the current time of receiving the state data;
and the page updating module is used for selecting synchronous updating or asynchronous updating of the control page of the smart home based on the current state data according to the time interval.
A client comprises a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method when executing the computer program.
A page updating system comprises an intelligent home, a server and the client; the server is respectively connected with the smart home and the client;
and the intelligent home sends the state data to the client through the server.
One of the above technical solutions has at least the following advantages and beneficial effects:
according to the method and the device, the time interval between the last state data and the current state data is determined by receiving the state data sent by the smart home, and the synchronous updating or asynchronous updating of the control page of the smart home based on the received current state data is selected according to the time interval, so that the appropriate updating mode of the control page of the smart home can be intelligently selected according to the reporting frequency of the state data of the smart home, the problem that the smart home is in a high concurrent data reporting state in a short time, the phenomenon that due to excessive rendering times of the control page, the page backflow is redrawn to cause blocking is avoided, the problem that due to the fact that the resource consumption is increased, the client side is flashed backwards is avoided, and the rendering efficiency of the control page of the smart home and the stability of the page updating are effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the conventional technologies of the present application, the drawings used in the description of the embodiments or the conventional technologies will be briefly introduced below, it is obvious that the drawings in the description below are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating a page update method according to an embodiment;
FIG. 2 is a flowchart illustrating steps for selecting, according to a time interval, a control page of a smart home to be updated synchronously or asynchronously based on current status data in one embodiment;
FIG. 3 is a flowchart illustrating steps of asynchronously updating a control page based on current state data if the time interval is less than the first duration as a result of the comparison in one embodiment;
FIG. 4 is a flowchart illustrating a step of updating a control page based on current state data if the determination result indicates that the cache area is full in one embodiment;
FIG. 5 is a block diagram showing the structure of a page update apparatus according to an embodiment;
FIG. 6 is a block diagram that illustrates the structure of the page update system in one embodiment.
Detailed Description
To facilitate an understanding of the present application, the present application will now be described more fully with reference to the accompanying drawings. Embodiments of the present application are set forth in the accompanying drawings. This application may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another.
It will be understood that when an element is referred to as being "connected" to another element, it can be directly connected to the other element or be connected to the other element through intervening elements. Further, "connection" in the following embodiments is understood to mean "electrical connection", "communication connection", or the like, if there is a transfer of electrical signals or data between the connected objects.
As used herein, the singular forms "a", "an" and "the" may include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises/comprising," "includes" or "including," etc., specify the presence of stated features, integers, steps, operations, components, parts, or combinations thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, components, parts, or combinations thereof.
In one embodiment, as shown in fig. 1, a page updating method is provided and may include:
step 202, receiving state data sent by the smart home;
the intelligent home can be an intelligent water heater or an intelligent refrigerator and other intelligent household appliances.
Specifically, the client pre-supports webview rendering and loading of a control page, the client also supports bidirectional long connection communication with the server, and the intelligent device also supports bidirectional long connection communication with the server; the client provides an entrance of a control page, and can match the corresponding smart home according to device ID (equipment identity identification code) to acquire corresponding smart home data, wherein the smart home data comprises state data. And the client renders a control page of the correspondingly configured intelligent home according to the data configuration of the intelligent home.
When the working state of the smart home is changed by manual operation of a user and working parameters of the smart home are actively updated along with the change of the working state, the smart home can send current corresponding state data to the client, or the smart home can also actively send the state data to a client control page when running according to a certain logic degree; the client forwards data to change the variable value of the control page state (modifying the variable value changes the state of the control page control and triggers page backflow redrawing); the client side conducts backflow redrawing rendering on the control on the page through the modified variable, namely when the control page is loaded, the variable uses the accessor attribute (object), data bidirectional binding is conducted on the local variable of the control page and the corresponding control in the rendered html file, the corresponding control and the page are rendered according to state data reported currently by the intelligent home equipment, when the control page variable completes one-time synchronous operation, the local variable of the control page is updated through the accessor attribute, and one-time page backflow redrawing is completed. Therefore, the control page is updated, and the user can conveniently and timely master the running condition of the intelligent home.
When the client updates the page according to the received current state data, differential calculation can be carried out on the received current state data and the data bound with the current control page, the page data are controlled according to the differential calculation data, the page is controlled to be subjected to page backflow redrawing, page rendering updating is completed, and therefore the control page of the smart home only updates the data different from local cache, local hardware resource calling of the client is saved, page rendering efficiency is improved, and page updating stability is guaranteed.
Step 204, determining the time interval between the last time of receiving the state data and the current time of receiving the state data;
specifically, the client may calculate the time interval between the two times of receiving the state data according to the timestamp of receiving the last state data and the timestamp of receiving the current state data, or may start a timer at the time of receiving the state data, and read the time of the timer at the time of receiving the next state data, that is, the time interval between the two times of receiving the state data, and destroy the old timer and start a new timer. Similarly, other data related to calculating time intervals or durations may be obtained according to the above methods, and all include but are not limited to the above methods.
And step 206, selecting to synchronously update or asynchronously update the control page of the smart home based on the current state data according to the time interval.
The synchronous updating is that the control page of the smart home is updated based on the current state data under the condition that the current state data is received; the asynchronous updating is that the control page of the smart home is not updated immediately when the current state data is received, but the control page of the smart home is updated only when a certain condition is met.
Specifically, under the condition that state data sent by the intelligent home are received and the time interval between the last time of receiving the state data and the current time of receiving the state data is determined, a corresponding updating mode is selected according to the time interval to update a control page of the intelligent home; if the time interval meets the synchronous updating condition, the client synchronously updates the control page of the smart home based on the current state data; if the time interval meets the asynchronous updating condition, the client side asynchronously updates the control page of the smart home based on the current state data, so that a proper updating mode for updating the control page of the smart home can be intelligently selected according to the reporting frequency of the state data of the smart home.
According to the method and the device, the corresponding page synchronous updating mode or page asynchronous updating mode is intelligently selected through the time interval of receiving the last state data and receiving the current state data, so that the page rendering efficiency and the stability are improved, the problem of client page blockage caused by high-concurrency data reporting of the intelligent household equipment in a short time is solved, the problem that the client is subjected to flash backing and the like due to increase of resource consumption is effectively solved, and meanwhile, the method and the device help to save calling of client hardware resources and improve user experience.
In one embodiment, as shown in fig. 2, the step 206 of selecting, according to a time interval, a synchronous update or an asynchronous update to the control page of the smart home based on the current state data may include:
step 302, comparing the first duration with the time interval to obtain a comparison result;
step 304, if the time interval is greater than or equal to the first duration as a comparison result, synchronously updating the control page based on the current state data;
and step 306, if the time interval is smaller than the first duration as a result of the comparison, asynchronously updating the control page based on the current state data.
The first duration is set to reduce the updating frequency of the control page of the smart home and reduce the rendering times of the control page, so that the problem that the client application is flashed back due to page backflow redrawing and jamming and increased resource consumption when the smart home is in a high concurrent reporting state in a short time, namely when the smart home frequently sends state data to the client in a short time is solved. Therefore, the first duration is set to be compared with the time interval, whether the synchronous updating condition or the asynchronous updating condition is met or not is judged, and therefore the synchronous updating page or the asynchronous updating page is selected under the condition that the client side currently receives the state data sent by the smart home; the first time length can be set according to actual conditions, and is not suitable to be too long or too short.
Specifically, under the condition that a client receives state data sent by an intelligent home, a time interval from the current state data to the last state data is determined, the time interval is compared with a first time length, if the time interval is smaller than the first time length, the time interval from the current state data to the last state data received by the client is too short, namely the last state data is reported too frequently, so that a page cannot be updated immediately to avoid page update jam, a certain update interval is needed, the update frequency of the control page is reduced, asynchronous update is triggered, and the client asynchronously updates the control page based on the current state data without immediately updating the page; if the time interval is greater than or equal to the first duration, it indicates that the time from the current time to the time when the client receives the last state data is long enough, that is, the reporting of the state data of the smart home is not too frequent, and if the page is updated immediately, too much influence is not brought, so that synchronous updating is triggered, and the client performs synchronous updating on the control page of the smart home based on the current state data, that is, the control page of the smart home is updated immediately.
According to the method and the device, the first time length is set, whether the frequency of the state data reported by the smart home is too frequent or not is judged according to the result of comparing the time interval of the last state data received with the current state data received with the first time length, and the page is selected to be asynchronously updated under the condition that the state data reported by the smart home is judged to be frequent (namely, under the condition that the time interval is smaller than the first time length as a comparison result), so that the problems that the page backflow redrawing is caused by updating the control page under the condition that the state data reported by the smart device is high, the resource consumption is increased, the application of a mobile terminal is flashed back and the like are effectively avoided. Meanwhile, the method and the device can maximize the advantages of local calculation by intelligently selecting a proper page updating mode according to the time interval of receiving the state data so as to achieve the effect of saving the hardware resource calling of the mobile terminal and effectively improve the page rendering efficiency and the page updating stability.
In one embodiment, as shown in fig. 3, if the time interval is smaller than the first duration as a result of the comparison, the step 306 of asynchronously updating the control page based on the current state data may include:
step 402, judging whether the cache area is full or not under the condition that the time interval is smaller than the first duration as a comparison result, and obtaining a judgment result;
step 404, if the judgment result is that the cache area is not full, storing the current state data into the cache area;
in step 406, if the determination result is that the cache region is full, the control page is updated based on the current state data, and the cache region is cleared.
The cache region may store data in the form of a cache array.
Specifically, when the client compares the first duration with the time interval and the comparison result is that the time interval is smaller than the first duration, it indicates that the frequency of reporting the state data by the smart home is too frequent, and if the page is updated immediately, problems such as page blocking and the like are easily caused, so that asynchronous update is triggered, the control page is not updated immediately, but the control page can be updated only after a certain time interval, and the frequency of page update is reduced. Therefore, the received current state data can be cached until certain conditions are met, and the page is updated, so that the effects of reducing the page updating frequency and improving the page rendering efficiency and the page updating stability are achieved.
Therefore, when the comparison result is that the time interval is less than the first duration, the client needs to judge whether the cache region is full, if the cache region is not full, the client temporarily stores the received current state data into the cache region, and if the cache region is full, the state that the smart home is frequently reporting the state data is indicated, so that the client frequently triggers an asynchronous updating state, and the cache region caches the previously reported state data and does not update the previously reported state data. After the control page is updated, the cache region needs to be cleared, so that the state data can be continuously and temporarily stored in the cache region if asynchronous update is triggered again when the state data is received later.
In one embodiment, after the step 404 of storing the current state data in the buffer, the method may further include:
if the next state data is not received under the condition that the first time length is reached, updating the control page based on the current state data, and clearing the cache region; the starting time of the first duration is the time when the current state data is received.
Specifically, if the time interval is smaller than the first time length as a result of the comparison, if the client determines that the buffer is not full, the current state data is stored in the buffer, and the timer is restarted, if the first time length passes from the time when the current state data is received, and the next state data is not received when the first time length reaches, the update frequency of the state data of the smart home is reduced, and the time from the time when the last state data is received is long enough, so as to ensure that the update of the control page of the smart home is relatively timely on the basis of the update frequency of the control page, therefore, the client can read the last piece of data (i.e. the current state data) stored in the buffer when the client confirms that the next state data is not received when the first time length reaches from the time when the current state data is received, and the control page is updated based on the data, so that the updating of the control page can be ensured to be relatively timely under the conditions of reducing the updating frequency of the smart home control page and reducing the page rendering times, and the updating stability of the control page is further ensured.
After the current state data is stored in the cache region, if it is determined that the next state data is received when the first duration does not arrive, the time interval for receiving the state data twice is equal to that less than the first duration, and therefore asynchronous updating is also triggered when the next state data is received, and the client side still stores the received next state data in the cache region for caching.
In one embodiment, after the step 404 of storing the current state data in the buffer, the method may further include:
if the second duration is confirmed to arrive, updating the control page based on the current state data, and clearing the cache region; the starting time of the second duration is the last time of controlling the page updating.
Wherein the second duration is greater than the first duration; the second time period can be set according to actual conditions.
Specifically, the following is considered: the intelligent home is in a high-concurrency reporting state, the updating frequency of the state data of the intelligent home is high, the time intervals of the client receiving the state data twice are smaller than the first duration, namely asynchronous updating is triggered each time, so that the client stores the received state data into the cache region, but the storage space of the cache region is large, and the cache region is not full all the time; because a certain time interval exists between the two received state data, when more state data are stored in the cache region, a longer time may have elapsed from the last page updating time at the current time, if the control page of the smart home is not updated all the time, the state information of the smart home displayed by the control page may be seriously inconsistent with the actual state information of the current smart home, and the state data is seriously lagged, so that the use of the user may be influenced. In addition, since the time interval between the last time of receiving the status data and the current time of receiving the status data triggers the synchronous update when the time interval is greater than or equal to the first time length, in the above case, the second time length must be greater than the first time length.
Specifically, if the time interval between the last time of receiving the state data and the current time of receiving the state data by the client is less than the first time length and the buffer area is not full, the client stores the received current state data into the buffer area, and if the time interval between the last time of receiving the state data and the last time of receiving the current state data by the client is confirmed to reach the second time length, the control page needs to be updated based on the last state data (namely the current state data) stored into the buffer area even if the time interval between the last time of receiving the state data and the last time of receiving the current state data by the client is less than the first time length, so that the efficiency of page rendering is improved by reducing the update frequency of the control page of the smart home, the stability of page update is ensured, and meanwhile, the situations that the update time of the control page is too long and the state information is seriously delayed to influence the normal use of a user are avoided, the use feeling of the user is improved.
In one embodiment, if the determination result is that the cache region is full, the step 406 of updating the control page based on the current state data may include:
and under the condition that the cache region is full according to the judgment result, if the time length from the last time of updating the control page to the time of receiving the current state data is greater than or equal to the second time length, updating the control page based on the current state data.
Specifically, if the smart home is in a high-concurrency reporting state and frequently sends state data to the client, a time interval between the last state data received by the client and the current state data received by the client is less than a first time length, and the cache area is full, the client needs to confirm that the time of receiving the current state data reaches a second time length from the last time of controlling the page updating, which also indicates that a longer time may have elapsed from the last time of updating the page at the current time, and if the control page of the smart home is not updated all the time, the state information of the smart home displayed by the control page is seriously inconsistent with the actual state information of the current smart home, and the state data is seriously lagged, so that the use of a user may be affected. Therefore, under the condition that the cache region is full, if the client confirms that the time length from the last time of updating the control page to the time of receiving the current state data is greater than or equal to the second time length, the cache region can not store the state data, the client can directly update the control page based on the received current state data, so that the problem that the information is seriously lagged because the control page of the smart home is not updated for a long time, the normal use of a user is influenced is solved, the page rendering efficiency is high and the page updating is stable through reducing the updating frequency of the control page, the problem that the state information is seriously lagged is avoided, and the user experience is optimized.
In one embodiment, as shown in fig. 4, if the determination result is that the cache region is full, the step 406 of updating the control page based on the current state data may further include:
step 502, under the condition that the judgment result is that the cache region is full, if the time length from the last time of controlling the page updating to the time of receiving the current state data is less than a second time length, emptying the cache region and storing the current state data into the cache region;
step 504, if it is determined that the next state data is not received under the condition of the first time length, updating the control page based on the current state data; the starting time of the first duration is the time when the current state data is received.
Specifically, if the time interval between the last time of receiving the state data and the current time of receiving the state data by the client is less than the first time length, asynchronous updating is triggered, but the cache area is full, and the received current state data cannot be stored in the cache area, so that whether the time length from the last time of controlling the page updating to the current state data is less than the second time length needs to be determined, if the time length from the last time of controlling the page updating to the current state data is less than the second time length, it is described that the time length from the last time of controlling the page updating to the current time is not too long, or the time length needs to be stored in the cache area, otherwise, the situations that the page is controlled to be updated frequently, the page rendering times are large, the page backflow redrawing causes blocking, and the page updating is unstable occur. Therefore, the client can clear the buffer area and store the current state data into the buffer area.
When the client clears the cache region and stores the current state data into the cache region, the client updates the control page according to the asynchronous updating method, for example, when the current state data is confirmed to be received, the next state data is not received after a first time period, and the control page is updated by reading the last stored state data (namely the current state data) in the cache region; or the client reads the last stored state data (namely the current state data) in the cache region to update the control page when confirming that the time length from the last update of the control page to the received current state data reaches the second time length, and continuously stores the current state data in the cache region and the like if confirming that the time length from the last update of the control page to the received current state data does not reach the second time length.
In a specific example, the smart home is a smart water heater, and the status data sent by the smart water heater to the client is assumed to be [1,20,50], wherein the first value of the array is the air consumption, the second value is the water discharge temperature, and the third value is the set temperature; the first time length set by the client is 500 milliseconds, the maximum length of a cache array of the cache region is 10 times, and the second time length is 1 second; if the intelligent equipment is in a working state and reports the state data to the client at intervals of 50-200 milliseconds, asynchronous updating is triggered because the time interval is less than 500 milliseconds, and if the time length from the last time of controlling the page updating to the current state data receiving does not reach 1 second and the cache area is not full, the client continuously stores the received state data into the cache area; if the time length from the last time of controlling the page updating to the time of receiving the current state data does not reach 1 second and the cache area is full, the client empties the cache area and stores the current state data into the cache area; if the time length from the last control page updating to the time when the current state data is received reaches 1 second, the control page of the intelligent water heater is updated based on the current state data, and therefore the client and the page control are synchronized once every 1 second, namely the control page is updated once every 1 second. If the intelligent device is in a working state and reports the state data to the client at a time interval of 700 milliseconds, the client immediately synchronizes with the page space once when receiving the current state data, namely, the client controls the page update once at a time interval of 700 milliseconds, because the time interval is greater than 500 milliseconds.
In the above way, the application determines the time interval between the last time of receiving the state data sent by the smart home and the current time of receiving the current state data, and selects synchronous update or asynchronous update to the control page based on the current state data according to the time interval, and sets the first time and the second time, so as to ensure that the client stores the current state data into the cache area in the asynchronous update process of the page, and updates the control page under the condition of meeting the corresponding update condition of the control page, thereby reducing the rendering times of the page, reducing the page update frequency, avoiding the problem that the information is seriously lagged due to the long-time non-update of the control page to influence the normal use of the user, further solving the problem that the card pause is caused by the page backflow redrawing due to the update of the control page in the high-concurrency data reporting state of the smart home, the problem that the mobile terminal application is flashed off due to increased resource consumption and the like is solved, the problem that user experience is affected due to too late updating of state data of a control page is solved, and meanwhile, the data synchronization method described in the application maximizes the advantage of local computation, so that the effect of saving mobile terminal hardware resource calling is achieved, and the stability of updating the control page of the smart home is ensured.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a page updating apparatus for implementing the above-mentioned page updating method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so specific limitations in one or more embodiments of the page update device provided below can be referred to the limitations of the page update method in the foregoing, and details are not described here.
In one embodiment, as shown in fig. 5, a page updating apparatus is provided, which may include:
the data receiving module 110 is configured to receive state data sent by the smart home;
a data processing module 120, configured to determine a time interval between the last time of receiving the status data and the current time of receiving the status data;
and the page updating module 130 is configured to select, according to the time interval, synchronous updating or asynchronous updating of the control page of the smart home based on the current state data.
In one embodiment, the page update module 130 is further configured to compare the first duration with the time interval to obtain a comparison result; if the comparison result is that the time interval is greater than or equal to the first duration, synchronously updating the control page based on the current state data; and if the comparison result is that the time interval is smaller than the first duration, asynchronously updating the control page based on the current state data.
In one embodiment, the page updating module 130 is further configured to determine whether the cache area is full to obtain a determination result when the comparison result is that the time interval is less than the first duration; if the judgment result is that the cache region is not full, storing the current state data into the cache region; and if the judgment result is that the cache region is full, updating the control page based on the current state data, and emptying the cache region.
In one embodiment, the page updating apparatus may further include:
the first data clearing module is used for updating the control page based on the current state data and clearing the cache region if the next state data is not received under the condition that the first time length is reached; the starting time of the first duration is the time when the current state data is received.
In one embodiment, the page updating apparatus may further include:
the second data clearing module is used for updating the control page based on the current state data and clearing the cache region if the second duration is confirmed to arrive; the starting time of the second duration is the time of last control page updating.
In one embodiment, the page updating module 130 is further configured to update the control page based on the current state data if it is determined that the time length from the last time of updating the control page to the time of receiving the current state data is greater than or equal to the second time length when the determination result is that the cache region is full.
In one embodiment, the page updating module 130 is further configured to, when the determination result is that the buffer is full, clear the buffer if it is determined that the time length from the last time of controlling the page updating to the time when the current state data is received is less than the second time length, and store the current state data into the buffer; if the next state data is not received under the condition that the first time length is reached, updating the control page based on the current state data; the starting time of the first duration is the time when the current state data is received.
The various modules in the page update apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a client is provided, comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method described above when executing the computer program.
In an embodiment, as shown in fig. 6, a page updating system is provided, which may include a smart home, a server, and the client; the server is respectively connected with the smart home and the client;
and the intelligent home sends the state data to the client through the server.
The intelligent home can be intelligent household appliances such as an intelligent water heater or an intelligent refrigerator; the client can be but not limited to various personal computers, notebook computers, smart phones, tablet computers, internet of things equipment and portable wearable equipment, and the internet of things equipment can be smart sound boxes, smart televisions, smart air conditioners, smart vehicle-mounted equipment and the like. The portable wearable device can be an intelligent watch, an intelligent bracelet, a head-mounted device and the like; the server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
Specifically, a client pre-supports webview rendering and loading of a control page, and the client supports bidirectional long connection communication with a server; the intelligent home also supports bidirectional long connection communication with the server; the client provides an entrance of a control page, matches the corresponding smart home according to deviceiD, acquires corresponding smart home data, renders a correspondingly configured smart home control page according to the configuration of the smart home data, changes the state of the smart home enable the state data to be forwarded to the client through the server, the client forwards the data to change the variable value of a control variable of the state of the control page, modifies the variable value of the control variable to change the state of a control page control, triggers page backflow redrawing, uses accessor attributes when the control page is loaded, performs data bidirectional binding between the local variables of the control page and corresponding controls in a rendered html file, renders the corresponding controls and pages according to the state data currently reported by the smart home, uses the accessor attributes to update the local variables of the control page when the control page variables complete one-time synchronous operation, and completing one-time page reflow redrawing, so that the client modifies the variable value based on the received state data, and performing reflow redrawing rendering on the control on the page.
More than, the client of the application can intelligently select a proper page updating mode to update the control page of the smart home according to the time interval between the last time of receiving the state data and the current time of receiving the state data, and can reduce the rendering times of the smart home control page of the client under the condition that the smart home is in a high-concurrency reporting state, thereby avoiding the problems of blocking caused by page backflow redrawing and sudden backing of the application end of the client due to increased resource consumption, effectively improving the page updating efficiency, ensuring the page updating stability, and meanwhile avoiding the problem that the user use is influenced by serious delay of state data updating caused by long-time non-updating of the page.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the various embodiments provided herein may be, without limitation, general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, or the like.
In the description herein, references to the description of "some embodiments," "other embodiments," "desired embodiments," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, a schematic description of the above terminology may not necessarily refer to the same embodiment or example.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A page updating method is characterized by comprising the following steps:
receiving state data sent by the smart home;
determining the time interval between the last time of receiving the state data and the current time of receiving the state data;
and selecting synchronous updating or asynchronous updating of the control page of the smart home based on the current state data according to the time interval.
2. The page updating method according to claim 1, wherein the step of selecting, according to the time interval, synchronous updating or asynchronous updating of the control page of the smart home based on the current state data includes:
comparing the first duration with the time interval to obtain a comparison result;
if the comparison result is that the time interval is greater than or equal to the first duration, performing the synchronous updating on the control page based on the current state data;
and if the comparison result is that the time interval is smaller than the first duration, performing the asynchronous updating on the control page based on the current state data.
3. The page updating method according to claim 2, wherein if the comparison result indicates that the time interval is less than the first duration, the step of performing the asynchronous updating on the control page based on the current state data includes:
judging whether the cache region is full or not under the condition that the time interval is smaller than the first duration as a comparison result to obtain a judgment result;
if the judgment result is that the cache region is not full, storing the current state data into the cache region;
and if the judgment result is that the cache region is full, updating the control page based on the current state data, and emptying the cache region.
4. The page updating method according to claim 3, wherein after the step of storing the current state data in the buffer, the method further comprises:
if the next state data is not received under the condition that the first time length is reached, updating the control page based on the current state data, and emptying the cache region; the starting time of the first duration is the time when the current state data is received.
5. The page updating method according to claim 3, wherein after the step of storing the current state data in the buffer, the method further comprises:
if the second duration is confirmed to arrive, updating the control page based on the current state data, and emptying the cache region; and the starting moment of the second duration is the moment of last control page updating.
6. The page updating method according to claim 3, wherein the step of updating the control page based on the current state data if the determination result is that the cache region is full comprises:
and under the condition that the cache region is full according to the judgment result, if the time length from the last time of updating the control page to the time of receiving the current state data is greater than or equal to a second time length, updating the control page based on the current state data.
7. The page updating method according to claim 6, wherein if the determination result is that the cache area is full, the step of updating the control page based on the current state data further comprises:
if the judgment result is that the cache region is full, if the time length from the last time of the updating of the control page to the time of receiving the current state data is less than the second time length, emptying the cache region, and storing the current state data into the cache region;
if the next state data is not received under the condition that the first time length is reached, updating the control page based on the current state data; the starting time of the first duration is the time when the current state data is received.
8. A page update apparatus, comprising:
the data receiving module is used for receiving state data sent by the smart home;
the data processing module is used for determining the time interval between the last time of receiving the state data and the current time of receiving the state data;
and the page updating module is used for selecting synchronous updating or asynchronous updating of the control page of the intelligent home based on the current state data according to the time interval.
9. A client comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any one of claims 1 to 7.
10. A page updating system is characterized by comprising an intelligent home, a server and the client side of claim 9; the server is respectively connected with the intelligent home and the client;
and the intelligent home sends the state data to the client through the server.
CN202210316974.5A 2022-03-29 2022-03-29 Page updating method, device, system and storage medium Active CN114691269B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210316974.5A CN114691269B (en) 2022-03-29 2022-03-29 Page updating method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210316974.5A CN114691269B (en) 2022-03-29 2022-03-29 Page updating method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN114691269A true CN114691269A (en) 2022-07-01
CN114691269B CN114691269B (en) 2024-05-14

Family

ID=82140836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210316974.5A Active CN114691269B (en) 2022-03-29 2022-03-29 Page updating method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN114691269B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115329235A (en) * 2022-10-14 2022-11-11 深圳市欧瑞博科技股份有限公司 Method and device for updating equipment information page, computer equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140033019A1 (en) * 2010-04-05 2014-01-30 Zixiao Zhang Caching Pagelets of Structured Documents
CN104915384A (en) * 2015-05-19 2015-09-16 广东欧珀移动通信有限公司 Set page displaying method and terminal
CN105577492A (en) * 2015-12-25 2016-05-11 北京奇虎科技有限公司 Smart home device state pushing method and device
US20170031869A1 (en) * 2015-07-27 2017-02-02 WP Company LLC d/b/a The Washington Post Native integration of arbitrary data sources
CN108683546A (en) * 2018-05-29 2018-10-19 杨杰 A kind of smart home device synchronous updating method based on Internet of Things
CN108898839A (en) * 2018-09-13 2018-11-27 武汉摩尔数据技术有限公司 A kind of real-time dynamic information data system and its update method
CN109582890A (en) * 2018-10-25 2019-04-05 平安科技(深圳)有限公司 Page loading method, device, computer equipment and storage medium
US20190138424A1 (en) * 2017-11-07 2019-05-09 Facebook, Inc. Systems and methods for safely implementing web page updates
CN111221469A (en) * 2018-11-27 2020-06-02 杭州海康威视数字技术股份有限公司 Method, device and system for synchronizing cache data
CN111488167A (en) * 2020-05-07 2020-08-04 支付宝(杭州)信息技术有限公司 Applet updating method, device, equipment and computer readable medium
CN112395036A (en) * 2020-11-30 2021-02-23 北京博瑞彤芸科技股份有限公司 Page rendering method and system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140033019A1 (en) * 2010-04-05 2014-01-30 Zixiao Zhang Caching Pagelets of Structured Documents
CN104915384A (en) * 2015-05-19 2015-09-16 广东欧珀移动通信有限公司 Set page displaying method and terminal
US20170031869A1 (en) * 2015-07-27 2017-02-02 WP Company LLC d/b/a The Washington Post Native integration of arbitrary data sources
CN105577492A (en) * 2015-12-25 2016-05-11 北京奇虎科技有限公司 Smart home device state pushing method and device
US20190138424A1 (en) * 2017-11-07 2019-05-09 Facebook, Inc. Systems and methods for safely implementing web page updates
CN108683546A (en) * 2018-05-29 2018-10-19 杨杰 A kind of smart home device synchronous updating method based on Internet of Things
CN108898839A (en) * 2018-09-13 2018-11-27 武汉摩尔数据技术有限公司 A kind of real-time dynamic information data system and its update method
CN109582890A (en) * 2018-10-25 2019-04-05 平安科技(深圳)有限公司 Page loading method, device, computer equipment and storage medium
CN111221469A (en) * 2018-11-27 2020-06-02 杭州海康威视数字技术股份有限公司 Method, device and system for synchronizing cache data
CN111488167A (en) * 2020-05-07 2020-08-04 支付宝(杭州)信息技术有限公司 Applet updating method, device, equipment and computer readable medium
CN112395036A (en) * 2020-11-30 2021-02-23 北京博瑞彤芸科技股份有限公司 Page rendering method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115329235A (en) * 2022-10-14 2022-11-11 深圳市欧瑞博科技股份有限公司 Method and device for updating equipment information page, computer equipment and storage medium

Also Published As

Publication number Publication date
CN114691269B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
CN108235148B (en) Similar barrage merging method in live broadcast, storage medium, electronic device and system
US20080276248A1 (en) Visibility-aware services
CN106530080B (en) Dormant transaction matching method based on dynamic change of queue
CN114691269A (en) Page updating method, device, system and storage medium
US11734258B2 (en) Constraint data statistics
EP3440531B1 (en) Enhanced dynamic clock and voltage scaling (dcvs) scheme
CN110505679B (en) Power consumption control method and device of communication terminal and storage medium
CN114007235A (en) Scene rule writing method and device, storage medium, processor and electronic equipment
CN109471872A (en) Handle the method and device of high concurrent inquiry request
CN109684079A (en) Data display processing method, device and electronic equipment
CN108377409A (en) A kind of seamless play method, terminal device and the storage medium of multimedia file
CN108153847B (en) List paging method and device and electronic equipment
CN106233225B (en) Power mode unit based on delay of power mode for control processor core and associated method and system
CN108681469B (en) Page caching method, device, equipment and storage medium based on Android system
CN108495175B (en) Method and device for controlling communication message when smart television interconnects external equipment
CN109669528B (en) Terminal processing component control method and device, computer equipment and storage medium
CN105094575A (en) Information processing method and electronic device
CN115756143A (en) Energy-saving method and device for data packet processing, computer equipment and storage medium
CN113377396B (en) Upgrading method and device, electronic equipment and storage medium
CN107870811B (en) Application cleaning method and device, storage medium and electronic equipment
CN111443792A (en) Power consumption control method and device for processor, and electronic and storage device
US20190235712A1 (en) Application Navigation
CN114337896A (en) Equipment state processing method and device, storage medium and electronic device
CN108536271A (en) A kind of method, apparatus and storage medium reducing power consumption
CN102968175A (en) Method, device, controller and system for controlling memory

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