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

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

Info

Publication number
CN114691269B
CN114691269B CN202210316974.5A CN202210316974A CN114691269B CN 114691269 B CN114691269 B CN 114691269B CN 202210316974 A CN202210316974 A CN 202210316974A CN 114691269 B CN114691269 B CN 114691269B
Authority
CN
China
Prior art keywords
state data
page
updating
current state
control page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210316974.5A
Other languages
Chinese (zh)
Other versions
CN114691269A (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

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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a page updating method, a page updating device, a page updating system and a storage medium. The page updating method comprises the following steps: receiving state data sent by an intelligent home; determining a time interval between the last time state data is received and the current state data is received; and selecting to synchronously update or asynchronously update the control page of the intelligent home based on the current state data according to the time interval. According to the method and the device for updating the intelligent home control page, a proper 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 intelligent home control page is blocked due to excessive control page rendering times and redrawing caused by page backflow in a short time under the condition that the intelligent home is in a high concurrency data reporting state is avoided, the problem that a client terminal is suddenly returned due to increased resource consumption is avoided, and the intelligent home control page rendering efficiency and page updating stability 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 method, an apparatus, a system, and a storage medium for updating a page.
Background
When the existing smart home equipment is in a high-concurrency reporting state, the rendering times of a control page corresponding to the smart home equipment by a mobile terminal are too high, so that problems of blocking, resource consumption increase and the like are caused by page backflow redrawing, for example, when the smart home equipment is in a frequently reporting state under the high-frequency operation of a user or the smart home equipment itself, or when state data such as the water outlet temperature, the air consumption, the electric quantity and the water quantity of a water heater in a working state are frequently updated, the situation that the page is blocked easily due to the fact that the equipment is frequently updated when the mobile client APP (Application) is used by the user is caused, and the user experience is poor.
In the implementation process, the inventor finds that at least the following problems exist in the conventional technology: the existing updating method of the control page of the intelligent home equipment is not high in stability.
Disclosure of Invention
Based on the foregoing, it is necessary to provide a method, an apparatus, a system and a storage medium for updating a page.
A page update method, comprising:
Receiving state data sent by an intelligent home;
Determining a time interval between the last time state data is received and the current state data is received;
And selecting to synchronously update or asynchronously update the control page of the intelligent home based on the current state data according to the time interval.
In one embodiment, the step of selecting to update the control page of the smart home synchronously or asynchronously based on the current status 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 time length, asynchronously updating the control page based on the current state data.
In one embodiment, if the comparison result is that the time interval is smaller than the first duration, the step of asynchronously updating the control page based on the current state data includes:
Judging whether the buffer area is full or not under the condition that the time interval is smaller than the first time length as a comparison result, and obtaining a judgment result;
if the judging result is that the buffer area is not full, storing the current state data into the buffer area;
If the buffer area is full, updating the control page based on the current state data, and emptying the buffer area.
In one embodiment, after the step of storing the current state data in the buffer, the method further includes:
if the condition that the next state data is not received under the condition that the first time length arrives is confirmed, updating the control page based on the current state data, and emptying the buffer area; 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 in the buffer, the method further includes:
if the second time length is confirmed to be reached, updating the control page based on the current state data, and emptying the buffer area; the starting time of the second duration is the time of last control page update.
In one embodiment, if the cache area is full, updating the control page based on the current status data includes:
And under the condition that the buffer area is full as a judging result, if the time length from the last control page updating distance to the current state data is longer than or equal to the second time length, updating the control page based on the current state data.
In one embodiment, if the cache area is full, updating the control page based on the current status data further includes:
If the judgment result shows that the buffer area is full, if the last time the control page updating distance receives the current state data is less than the second time, the buffer area is emptied, and the current state data is stored in the buffer area;
if the condition that the next state data is not received under the condition that the first time length arrives is confirmed, 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 updating apparatus comprising:
the data receiving module is used for receiving state data sent by the intelligent home;
The data processing module is used for determining the time interval between the last time of receiving the state data and the current state data;
And the page updating module is used for selecting to synchronously update or asynchronously update the control page of the intelligent home based on the current state data according to the time interval.
A client comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
A page updating system comprises an intelligent home, a server and the client; 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.
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 receiving and the current state data receiving is determined through receiving the state data sent by the intelligent home, and the control page of the intelligent home is selected to be synchronously updated or asynchronously updated based on the received current state data according to the time interval, so that the method and the device can intelligently select a proper mode for updating the control page of the intelligent home according to the reporting frequency of the state data of the intelligent home, avoid the problem that the control page is blocked due to excessive rendering times of the control page under the condition that the intelligent home is in a high-concurrence data reporting state in a short time, and prevent the problem that a client side is suddenly retracted due to increased resource consumption, and effectively improve the rendering efficiency of the control page of the intelligent home and the stability of page updating.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments or the conventional techniques of the present application, the drawings required for the descriptions of the embodiments or the conventional techniques will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a flow chart of a page update method in one embodiment;
FIG. 2 is a flowchart illustrating steps for selecting whether to update a control page of a smart home synchronously or asynchronously based on current status data according to an embodiment;
FIG. 3 is a flowchart illustrating a step of asynchronously updating a control page based on current status data if the comparison result indicates that the time interval is smaller than the first duration;
FIG. 4 is a flowchart illustrating a step of updating a control page based on current status data if the buffer is full in one embodiment;
FIG. 5 is a block diagram of a page update apparatus in one embodiment;
FIG. 6 is a block diagram of the architecture of a page update system in one embodiment.
Detailed Description
In order that the application may be readily understood, a more complete description of the application will be rendered by reference to the appended drawings. Embodiments of the application are illustrated 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 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 the terms first, second, etc. as used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element.
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 should be understood as "electrical connection", "communication connection", and the like if there is transmission of electrical signals or data between objects to be connected.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," and/or the like, specify the presence of stated features, integers, steps, operations, elements, components, or groups thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof.
In one embodiment, as shown in fig. 1, a page update method is provided, which may include:
Step 202, receiving state data sent by an intelligent home;
The intelligent home can be an intelligent household appliance such as an intelligent water heater or an intelligent refrigerator.
Specifically, the client pre-supports webview rendering and loading control pages, 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 entry for a control page, and can obtain corresponding intelligent home data according to the corresponding intelligent home matched with the device ID (equipment identity) and the intelligent home data comprises state data. And the client renders a control page of the intelligent home correspondingly configured according to the intelligent home data configuration.
When the working state of the intelligent home is changed by manual operation of a user and the working parameters of the intelligent home are actively updated along with the change of the working state, the intelligent home can send the current corresponding state data to the client, or the intelligent home can also actively send the state data to a client control page when running according to a certain logic degree; the client forwards the control variable value of which the data will change the state of the control page (modifying the variable value will change the state of the control page control, triggering the page reflow redrawing); and the client performs reflow redrawing rendering on the control on the page by the modified variable, namely when the page is controlled to be loaded, the variable uses an accessor attribute (object. Definition), the local variable of the control page and the corresponding control in the rendered html file are subjected to data bidirectional binding, the corresponding control and the page are rendered according to the state data currently reported by the intelligent home equipment, and when the control page variable finishes one-time synchronous operation, the local variable of the control page is updated by using the accessor attribute, so that one-time page reflow redrawing is finished. Therefore, the control page is updated, and the intelligent home operation condition is convenient for a user to grasp in time.
When the client side updates the page according to the received current state data, the received current state data and the data bound with the current control page can be subjected to differential calculation, the page data is controlled according to the differential calculation data, and the page is controlled to carry out page reflow redrawing to complete page rendering updating, so that the control page of the intelligent home only updates data different from the local cache, further, the local hardware resource call of the client side is saved, the page rendering efficiency is improved, and the page updating stability is ensured.
Step 204, determining a time interval between the last time the status data was received and the current status data was received;
Specifically, the client may calculate, according to the timestamp of the last state data received and the timestamp of the current state data received, a time interval of receiving the state data twice, or start a timer at the moment of receiving the state data, and at the moment of receiving the next state data, read the time of the timer, that is, the time interval of receiving the state data twice, 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 method, and all the methods include but are not limited to the above method.
Step 206, selecting to update the control page of the smart home synchronously or asynchronously based on the current state data according to the time interval.
The synchronous updating is to update a control page of the intelligent home based on the current state data under the condition of receiving the current state data; asynchronous updating is to not update the control page of the intelligent home immediately under the condition that the current state data is received, but update the control page of the intelligent home under the condition that a certain condition is met.
Specifically, when state data sent by the smart home is received and a time interval between the last state data and the current state data is determined, a corresponding updating mode is selected according to the time interval to update a control page of the smart home; if the time interval meets the synchronous updating condition, the client synchronously updates the control page of the intelligent home based on the current state data; if the time interval meets the asynchronous updating condition, the client asynchronously updates the control page of the intelligent home based on the current state data, so that the application can intelligently select a proper updating mode for updating the control page of the intelligent home according to the reporting frequency of the state data of the intelligent home.
According to the method and the device, through receiving the last state data and the time interval of receiving the current state data, the corresponding page synchronous updating mode or page asynchronous updating mode is intelligently selected, so that page rendering efficiency and stability are improved, the problem of client page blocking caused by high concurrency of data reporting of intelligent home equipment in a short time is reduced, the problem of client flash back and the like caused by increased resource consumption is effectively prevented, and meanwhile, the method and the device are beneficial to saving calling of client hardware resources and improving user experience.
In one embodiment, as shown in fig. 2, the step 206 of selecting to update the control page of the smart home synchronously or asynchronously based on the current status data according to the time interval may include:
step 302, comparing the first duration with the time interval to obtain a comparison result;
Step 304, 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 306, if the comparison result is that the time interval is smaller than the first time length, asynchronously updating the control page based on the current state data.
The first duration is set to reduce the update 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 flashes back due to page backflow redrawing and resource consumption increase caused by the fact that the smart home frequently sends state data to the client in a short time under the condition that the smart home is in a high concurrency reporting state in a short time is prevented. Therefore, by setting the first duration and comparing the time interval, judging whether the synchronous updating condition or the asynchronous updating condition is met, and selecting a synchronous updating page or an asynchronous updating page under the condition that the client side currently receives the state data sent by the intelligent home; the first duration may be set according to practical situations, and is not suitable to be too long or too short.
Specifically, when the client receives the state data sent by the smart home, determining a time interval between the current state data and the last state data received, comparing the time interval with the first time, if the time interval is smaller than the first time, the client indicates that the time interval between the current state data received by the client and the last state data is too short, that is, the report of the state data of the smart home is too frequent, so that the page cannot be updated immediately to avoid the page update blocking, a certain update interval is needed, the update frequency of the control page is reduced, and asynchronous update is triggered, so that the client carries out asynchronous update on the control page based on the current state data, and the page cannot be updated immediately; if the time interval is greater than or equal to the first time, the current time from the client to the last time is long enough, that is, the report of the state data of the smart home is not too frequent, and the page is not too affected if the page is updated immediately, so that the synchronous update is triggered, and the client synchronously updates 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 reporting the state data of the intelligent home is too high is judged according to the result of comparing the time interval between the last received state data and the current received state data with the first time length, and the page is selected to be asynchronously updated under the condition that the state data of the intelligent home is frequently judged (namely, the comparison result is that the time interval is smaller than the first time length), so that the problems that the page is updated and controlled to be redrawn to cause blocking under the condition that the state data of the intelligent device is highly and concurrently reported are effectively avoided, and the mobile terminal application flash is caused by the increase of resource consumption. Meanwhile, the application intelligently selects the proper page updating mode according to the time interval of receiving the state data, so that the advantage of local calculation can be maximized, the effect of saving the calling of hardware resources of the mobile terminal is achieved, and the page rendering efficiency and the page updating stability are effectively improved.
In one embodiment, as shown in fig. 3, if the comparison result is that the time interval is less than the first duration, the step 306 of asynchronously updating the control page based on the current state data may include:
Step 402, judging whether the buffer area is full or not to obtain a judging result when the time interval is smaller than the first time length as a result of the comparison;
Step 404, if the result is that the buffer area is not full, storing the current state data into the buffer area;
Step 406, if the buffer is full, updating the control page based on the current status data, and emptying the buffer.
The buffer area may store data in the form of a buffer array.
Specifically, when the first duration and the time interval are compared, and the comparison result is that the time interval is smaller than the first duration, the frequency of reporting the state data of the smart home is too frequent, if the page is updated immediately, the problem of page blocking and the like is easily caused, so that asynchronous update is triggered, the control page is not updated immediately, but 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 a certain condition is 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, if the comparison result is that the time interval is smaller than the first duration, the client needs to determine whether the buffer area is full, if the buffer area is not full, the client temporarily stores the received current state data into the buffer area, if the buffer area is full, the state that the smart home is in the state of frequently reporting the state data is indicated, the client frequently triggers the state of asynchronously updating, and the buffer area has cached the state data which is reported before and is not updated, and under the condition that the buffer area is full, the control page updating distance possibly last time has elapsed for a period of time, so that the control page can be updated based on the current latest state data, and the effect of reducing the update frequency of the control page of the smart home is achieved. After the control page is updated, the buffer area needs to be emptied, so that when the asynchronous update is triggered again after the state data is received, the state data can be continuously temporarily stored in the buffer area.
In one embodiment, after the step 404 of storing the current state data in the buffer, the method may further include:
if the condition that the next state data is not received under the condition that the first time length arrives is confirmed, updating the control page based on the current state data, and emptying the buffer area; the starting time of the first duration is the time when the current state data is received.
Specifically, if the comparison result is that the time interval is smaller than the first duration, if the client side judges that the buffer area is not full, the current state data is stored in the buffer area, and timing is repeated, if the first duration passes from the moment of receiving the current state data, the next state data is not received when the first duration reaches, the state data updating frequency of the smart home is reduced, the time from the moment of receiving the last state data is long enough, and in order to ensure that the updating of the smart home control page is relatively timely on the basis of the control page updating frequency, the client side can read the last data (namely the current state data) stored in the buffer area when the moment of receiving the current state data is confirmed and the next state data is not received when the first duration arrives, and update the control page on the basis of the data, so that the updating of the control page is relatively timely under the condition of reducing the update frequency of the smart control page and the page rendering times, and the updating stability of the control page is ensured.
When the current state data is stored in the buffer, if the next state data is received when the first time period does not arrive, the time interval corresponding to the time interval of receiving the state data for two times is smaller than the first time period, so that asynchronous update is triggered under the condition of receiving the next state data, and the client side stores the received next state data in the buffer for buffering.
In one embodiment, after the step 404 of storing the current state data in the buffer, the method may further include:
if the second time length is confirmed to be reached, updating the control page based on the current state data, and emptying the buffer area; the starting time of the second duration is the time of last control page update.
Wherein the second time period is longer than the first time period; the second time period may be set according to actual conditions.
Specifically, the following is considered: the intelligent home is in a high concurrency reporting state, the update frequency of the state data of the intelligent home is faster, the time interval of the client for receiving the state data for two times before and after is smaller than the first time length, namely asynchronous update is triggered each time, so that the client stores the received state data into a cache area, the storage space of the cache area is larger, and the cache area is not full all the time; because a certain time interval exists between the two times of state data receiving, when more state data are stored in the buffer memory area, the time corresponding to the current time is longer than the last page updating 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 is seriously inconsistent with the actual state information of the current smart home, and the state data are seriously delayed, so that the use of a user is possibly influenced. In addition, since the time interval between the last time of receiving the state data and the current time of receiving the state data is greater than or equal to the first time period, the second time period must be greater than the first time period in the above case.
Specifically, if the time interval between the last state data received by the client and the current state data received by the client is smaller 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 of confirming the last control page update of the client reaches the second time length from the time of receiving the current state data, even if the time interval between the last state data received by the client and the current state data received by the client is smaller than the first time length, the last state data (i.e. the current state data) stored in the buffer area is needed to update the control page, so that the page rendering efficiency is improved by reducing the control page update frequency of the smart home, the page update stability is ensured, and meanwhile, the situation that the normal use of a user is influenced by the fact that the update stopping time of the control page is too long and the state information is seriously lagged is avoided, and the use feeling of the user is improved.
In one embodiment, if the buffer is full, the step 406 of updating the control page based on the current status data may include:
And under the condition that the buffer area is full as a judging result, if the time length from the last control page updating distance to the current state data is longer 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, status data is frequently sent to the client, a time interval between the last time status data received by the client and the current status data received by the client is smaller than a first time length, and the buffer area is full, the client needs to confirm that a time length of the current status data received from a time of last control page update reaches a second time length, which also indicates that a time length of the current time from the time of last page update may have elapsed, if the control page of the smart home is not updated, the status information of the smart home displayed by the control page is seriously inconsistent with actual status information of the current smart home, and the status data is seriously lagged, so that use of a user may be affected. Therefore, under the condition that the cache area is full, if the client confirms that the last time the control page updating distance receives the current state data is longer than or equal to the second time, the client can directly update the control page based on the received current state data because the cache area cannot store the state data, so that the problem that the control page of the smart home is seriously lagged due to the fact that the information is seriously lagged because the control page is not updated for a long time is solved, the problem of normal use of a user is affected, and further, the problem that the state information is seriously lagged when the page rendering efficiency is high and the page updating is stable is solved by reducing the updating frequency of the control page, and the user experience is optimized.
In one embodiment, as shown in fig. 4, if the buffer is full, the step 406 of updating the control page based on the current status data may further include:
step 502, if the buffer is full as a result of the determination, if it is confirmed that the duration of the last control page update distance from the current state data is less than the second duration, the buffer is emptied, and the current state data is stored in the buffer;
Step 504, if it is confirmed that the next state data is not received when the first time arrives, 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 state data is smaller than the first time, asynchronous update is triggered, but the buffer area is full, the received current state data cannot be stored in the buffer area, so that whether the time length from the last time of controlling the page update to the current state data is smaller than the second time length needs to be confirmed, if the time length from the last time of controlling the page update to the current state data is smaller than the second time length, whether the time length from the last time of controlling the page update to the current time is longer is not calculated, or the last time of controlling the page update to the current time is required to be stored in the buffer area is indicated, otherwise, frequent controlling the page update, page backflow redrawing caused by more times of page rendering cause clamping, and unstable page update occur. Therefore, the client can empty the buffer and store the current state data into the buffer.
Under the condition that the client empties the buffer area and stores the current state data into the buffer area, the control page is still updated according to the asynchronous updating method, for example, when the current state data is confirmed to be received and the next state data is not received after the first time, the last stored state data (namely the current state data) of the buffer area is read to update the control page; or the client reads the last stored state data (i.e. the current state data) of the cache area to update the control page when confirming that the time length for receiving the last control page update according to the current state data reaches the second time length, and continuously stores the current state data into the cache area and the like when confirming that the time length for receiving the last control page update according to the current state data does not reach the second time length.
In a specific example, the smart home is an intelligent water heater, and the state data sent to the client by the intelligent water heater is [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 the cache array of the cache area is 10 times, and the second time length is 1 second; if the intelligent equipment is in a working state and status data is reported to the client at intervals of 50-200 milliseconds, asynchronous update is triggered because the time interval is less than 500 milliseconds, and if the last time the control page update distance receives the current status data for less than 1 second and the buffer area is not full, the client continuously stores the received status data into the buffer area; if the last time the control page updating distance receives the current state data does not reach 1 second and the buffer area is full, the client side empties the buffer area and stores the current state data into the buffer area; if the last control page updating distance is 1 second after receiving the current state data, the control page of the intelligent water heater is updated based on the current state data, so that the client side synchronizes with the page control once every 1 second, namely, the control page is updated once every 1 second. If the intelligent device is in a working state and status data is reported to the client at intervals of 700 milliseconds, because the time interval is more than 500 milliseconds, synchronous update is triggered, and therefore the client immediately performs synchronization with the page space once under the condition of receiving the current status data, namely, controls the page update once at intervals of 700 milliseconds.
The method and the system have the advantages that the last time the state data sent by the smart home is received and the time interval of the current state data is received are determined, synchronous update or asynchronous update is carried out on the control page based on the current state data according to the time interval, the first time length and the second time length are set, the client side stores the current state data into the cache area in the process of asynchronous update of the page, the control page is updated under the condition that corresponding control page update conditions are met, the problem that the normal use of a user is affected due to serious hysteresis of information caused by long-time non-update of the control page is solved while the page rendering times are reduced, the page update frequency is reduced, and therefore the problem that the control page is blocked due to backflow redrawing caused by updating of the control page in a high concurrent data reporting state of the smart home is solved, the problem that the mobile terminal application is flashed due to resource consumption is increased is solved, the problem that user experience is affected due to excessive hysteresis of the state data update of the control page is avoided.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. 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.
Based on the same inventive concept, the embodiment of the application also provides a page updating device for realizing the above-mentioned page updating method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of one or more page updating devices provided below may refer to the limitation of the page updating method hereinabove, and will not be repeated 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 status data sent by the smart home;
A data processing module 120, configured to determine a time interval between receiving the last state data and receiving the current state data;
The page update module 130 is configured to select to update the control page of the smart home synchronously or asynchronously based on the current status data according to the time interval.
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 time length, 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 buffer is full if the comparison result indicates that the time interval is less than the first duration, so as to obtain a determination result; if the judging result is that the buffer area is not full, storing the current state data into the buffer area; if the buffer area is full, updating the control page based on the current state data, and emptying the buffer area.
In one embodiment, the page updating apparatus may further include:
The first data emptying module is used for updating the control page based on the current state data and emptying the buffer area if the fact that the next state data is not received under the condition that the first time length is reached is confirmed; 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 emptying module is used for updating the control page based on the current state data and emptying the buffer area if the second time length is confirmed to be reached; the starting time of the second duration is the time of last control page update.
In one embodiment, the page updating module 130 is further configured to, if the determination result is that the buffer is full, update the control page based on the current state data if it is determined that the time period from the last control page update to the current state data is greater than or equal to the second time period.
In one embodiment, the page updating module 130 is further configured to, if the determination result is that the buffer area is full, empty the buffer area and store the current state data into the buffer area if it is determined that the duration of the last control page updating distance from receiving the current state data is less than the second duration; if the condition that the next state data is not received under the condition that the first time length arrives is confirmed, 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 respective modules in the above page updating apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In an embodiment, a client is provided comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
In one embodiment, as shown in fig. 6, a page update system is provided, which may include an intelligent home, a server, and the client described above; 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.
The intelligent home can be an intelligent household appliance such as an intelligent water heater or an intelligent refrigerator; the client may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices and the like. The portable wearable device can be a smart watch, a smart bracelet, a headset, or the like; the server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers.
Specifically, a client pre-supports webview rendering and loading a control page, and the client supports bidirectional long-connection communication with a server; the intelligent home also supports two-way long-connection communication with the server; the client provides an entry of a control page, corresponding intelligent home data is obtained according to the deviceID matching of the corresponding intelligent home, the corresponding intelligent home control page is rendered according to the intelligent home data configuration, the state data is forwarded to the client through the server by the change of the intelligent home state, the control variable value of the control page is changed by the change of the control variable value of the control page, the state of the control page control is triggered to be redrawn by the modification of the control variable value, when the control page is loaded, the data bidirectional binding is carried out between the control page local variable and the corresponding control in the rendered html file by using the accessor attribute, the corresponding control and the page are rendered according to the state data currently reported by the intelligent home, and when the control page variable completes one-time synchronous operation, the control page local variable is updated by using the accessor attribute, and one-time page backflow redrawing is completed.
In the above way, the client can intelligently select a proper page update mode to update the control page of the intelligent home according to the time interval between the last state data receiving and the current state data receiving, and can reduce the number of times of rendering the control page of the intelligent home of the client under the condition that the intelligent home is in a high concurrency reporting state, thereby avoiding the problem of flashing back of the client application end caused by blocking caused by page back flow redrawing and increased resource consumption, effectively improving the page update efficiency, ensuring the page update stability, and simultaneously avoiding the problem that the use is influenced by serious hysteresis of the state data update caused by long-time non-update of the page.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in 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), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
In the description of the present specification, reference to the terms "some embodiments," "other embodiments," "desired embodiments," and the like, means 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, schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (8)

1. The page updating method is characterized by being applied to a client, wherein the client is connected with an intelligent home through a server; the method comprises the following steps:
receiving state data sent by the intelligent home;
Determining a time interval between the last time state data is received and the current state data is received;
Selecting to synchronously update or asynchronously update the control page of the intelligent home based on the current state data according to the time interval;
The step of 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 comprises the following steps:
Comparing the first time length 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, the control page is synchronously updated based on the current state data;
If the comparison result is that the time interval is smaller than the first duration, the control page is asynchronously updated 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 update on the control page based on the current state data, including:
Judging whether the buffer area is full or not under the condition that the time interval is smaller than the first time length as a comparison result, and obtaining a judgment result;
If the judging result is that the buffer area is not full, storing the current state data into the buffer area;
and if the judging result is that the buffer area is full, updating the control page based on the current state data, and emptying the buffer area.
2. The page updating method according to claim 1, wherein after the step of storing the current status data in the buffer, further comprising:
If the condition that the next state data is not received under the condition that the first time length arrives is confirmed, updating the control page based on the current state data, and emptying the buffer area; the starting time of the first duration is the time when the current state data is received.
3. The page updating method according to claim 1, wherein after the step of storing the current status data in the buffer, further comprising:
If the second time length is confirmed to be reached, updating the control page based on the current state data, and emptying the cache area; the starting time of the second time length is the time of last control page update.
4. The page updating method according to claim 1, wherein the step of updating the control page based on the current status data if the determination result is that the buffer is full, comprises:
And if the judging result shows that the buffer area is full, if the last time the control page updating distance receives the current state data is longer than or equal to the second time, updating the control page based on the current state data.
5. The method for updating a page according to claim 4, wherein the step of updating the control page based on the current status data if the determination result is that the buffer is full, further comprises:
If the judging result shows that the buffer area is full, if the last time the control page updating distance receives the current state data is less than the second time, the buffer area is emptied, and the current state data is stored in the buffer area;
If the condition that the next state data is not received under the condition that the first time length arrives is confirmed, 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.
6. The page updating device is characterized by being applied to a client, and the client is connected with an intelligent home through a server; the device comprises:
the data receiving module is used for receiving the state data sent by the intelligent home;
The data processing module is used for determining the time interval between the last time of receiving the state data and the current state data;
The page updating module is used for selecting to synchronously update or asynchronously update the control page of the intelligent home based on the current state data according to the time interval;
The page updating module is also used for comparing the first time length 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, the control page is synchronously updated based on the current state data; if the comparison result is that the time interval is smaller than the first duration, the control page is asynchronously updated based on the current state data;
The page updating module is further configured to determine whether a buffer area is full or not to obtain a determination result when the comparison result indicates that the time interval is smaller than the first duration; if the judging result is that the buffer area is not full, storing the current state data into the buffer area; and if the judging result is that the buffer area is full, updating the control page based on the current state data, and emptying the buffer area.
7. A client comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
8. A page updating system, comprising an intelligent home, a server and the client of claim 7; 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 CN114691269A (en) 2022-07-01
CN114691269B true 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)

Families Citing this family (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 (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9626343B2 (en) * 2010-04-05 2017-04-18 Facebook, Inc. Caching pagelets of structured documents
US11449560B2 (en) * 2015-07-27 2022-09-20 WP Company, LLC Native integration of arbitrary data sources
US20190138424A1 (en) * 2017-11-07 2019-05-09 Facebook, Inc. Systems and methods for safely implementing web page updates

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Also Published As

Publication number Publication date
CN114691269A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN106951163B (en) Display control method and device
CN114691269B (en) Page updating method, device, system and storage medium
US20140075220A1 (en) Method and device of controlling power saving
CN108701079A (en) The system and method that flash memory with adaptive prefetching reads cache
CN105373369A (en) Asynchronous caching method, server and system
CN110505679B (en) Power consumption control method and device of communication terminal and storage medium
EP3149594B1 (en) Method and apparatus for cache access mode selection
CN114007235A (en) Scene rule writing method and device, storage medium, processor and electronic equipment
CN111240621B (en) Method and device for controlling display frequency of display screen and electronic equipment
CN113009842A (en) Intelligent reminding control method and device based on electric appliance, medium and electric appliance
CN111857477B (en) Display control method and device, mobile terminal and storage medium
EP4345654A1 (en) Data processing method, apparatus and device and storage medium
WO2018076698A1 (en) Terminal delay display method and apparatus, and terminal and computer storage medium
CN109669528B (en) Terminal processing component control method and device, computer equipment and storage medium
CN111970749A (en) Network connection method and device, intelligent household equipment and intelligent household system
TWI391814B (en) A data trafficking device, a data trafficking system and a method performed at a data trafficking device
CN115633056A (en) Intelligent information prompting method, device, equipment and medium in operating system of Internet of things
CN115576386A (en) Signal delay adjusting chip, method, equipment and storage medium
CN114205885A (en) Network connection control method and device of 5G mobile terminal, storage medium and mobile terminal
CN116700602B (en) Method and equipment for inquiring and expanding service life of memory
WO2016177072A1 (en) Network topology display method and device, and network management system
CN105654529B (en) A kind of image processing method, device and system
CN114666779B (en) Device connection method, device, computer device, and storage medium
CN109041047A (en) Method for down loading, terminal and the storage medium of terminal data
CN109725978B (en) Window refreshing method and device, electronic equipment and storage medium

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