CN113434800A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN113434800A
CN113434800A CN202110723424.0A CN202110723424A CN113434800A CN 113434800 A CN113434800 A CN 113434800A CN 202110723424 A CN202110723424 A CN 202110723424A CN 113434800 A CN113434800 A CN 113434800A
Authority
CN
China
Prior art keywords
event
target
data corresponding
state data
component 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
CN202110723424.0A
Other languages
Chinese (zh)
Other versions
CN113434800B (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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202110723424.0A priority Critical patent/CN113434800B/en
Publication of CN113434800A publication Critical patent/CN113434800A/en
Application granted granted Critical
Publication of CN113434800B publication Critical patent/CN113434800B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a data processing method and a data processing device, wherein the method comprises the following steps: acquiring a target event received by a target webpage; judging whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event or not; and under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, refreshing the target webpage based on the component state data corresponding to the target event. By adopting the technical scheme, the problem of page blockage caused by frequent refreshing of the front-end page in the related technology is solved.

Description

Data processing method and device
Technical Field
The present invention relates to the field of communications, and in particular, to a data processing method and apparatus.
Background
With the increase of the iteration speed of online business, the continuous upgrade and evolution of the front-end development technology stack require development of applications which have short development period and fast online speed and can be used for constructing a user interface across platforms, for example, from fact which is a Facebook open source, Vue which is an open source community, and then Flutter which is released by Google.
It should be noted that, with the upgrade of the service complexity, the data interaction is frequent, the front-end UI page is frequently refreshed, so that the rendering frame reaches the page rendering bottleneck, which may cause the page to be stuck, and thus the application cannot be used. For example, in the Flutter scheme, when a large-scale page refresh occurs, after the page refresh frame rate is reduced to 16 frames/second, a page is obviously displayed and is stuck, and a user cannot continue to operate, so that an application cannot be used.
Aiming at the problem of page jamming caused by frequent front-end page refreshing in the related art, an effective solution is not provided yet.
Disclosure of Invention
The embodiment of the invention provides a data processing method and a data processing device, which are used for at least solving the problem of page jamming caused by frequent front-end page refreshing in the related technology.
According to an embodiment of the present invention, there is provided a data processing method including: acquiring a target event received by a target webpage, wherein the target event at least comprises one of the following events: a user operates an event on a page of a target webpage, and a service end reports the event on data of the target webpage; judging whether component state data corresponding to a target event is the same as component state data corresponding to a preset event or not, wherein the component state data is used for rendering components in the target webpage, and the preset event is an event received by the target webpage before the target event; and under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, refreshing the target webpage based on the component state data corresponding to the target event.
Optionally, after determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, the method further includes: and under the condition that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, discarding the component state data corresponding to the target event.
Optionally, when the target event is a page operation event, determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event includes: judging whether the type of the target event is the same as that of a preset event or not; under the condition that the type of the target event is the same as that of the preset event, determining that the component state data corresponding to the target event is the same as that corresponding to the preset event, wherein the type of the target event is at least characterized by the following information: the triggering mode of the target event and the triggering position of the target event.
Optionally, when the target event is a data reporting event, determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event includes: judging whether the reported data corresponding to the target event is the same as the reported data corresponding to the preset event or not; and under the condition that the reported data corresponding to the target event is the same as the reported data corresponding to the preset event, determining that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event.
Optionally, when the target event is a data reporting event, and when the component state data corresponding to the target event is different from the component state data corresponding to the preset event, the refreshing the target webpage based on the component state data corresponding to the target event includes: acquiring difference data between component state data corresponding to a target event and component state data corresponding to a preset event; and determining a page component corresponding to the difference data, and rendering the page component based on the difference data.
Optionally, before determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, the method further includes: the method comprises the steps of obtaining a plurality of events in a preset time period, and extracting the events from the events according to a preset extraction mode to obtain a target event, wherein the preset extraction mode at least comprises one of the following modes: and randomly extracting, namely extracting the first event from the plurality of events and extracting the last event from the plurality of events.
Optionally, a data reporting event is obtained by pushing data of the target web page subscription service end.
According to another embodiment of the present invention, there is also provided a data processing apparatus including: the acquisition unit is used for acquiring a target event received by a target webpage, wherein the target event at least comprises one of the following: a user operates an event on a page of a target webpage, and a service end reports the event on data of the target webpage; the device comprises a judging unit, a processing unit and a processing unit, wherein the judging unit is used for judging whether component state data corresponding to a target event is the same as component state data corresponding to a preset event or not, the component state data is used for rendering a component in a target webpage, and the preset event is an event received by the target webpage before the target event; and the refreshing unit is used for refreshing the target webpage based on the component state data corresponding to the target event under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event.
According to a further aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data processing method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the data processing method through the computer program.
In the embodiment of the present invention, a target event received by a target webpage is obtained, where the target event at least includes one of the following: a user operates an event on a page of a target webpage, and a service end reports the event on data of the target webpage; judging whether component state data corresponding to a target event is the same as component state data corresponding to a preset event or not, wherein the component state data is used for rendering components in the target webpage, and the preset event is an event received by the target webpage before the target event; and under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, refreshing the target webpage based on the component state data corresponding to the target event. By adopting the technical scheme, the problem of page blockage caused by frequent refreshing of the front-end page in the related technology is solved, and the effects of avoiding frequent refreshing of the front-end page and improving the smoothness of page display are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal of a data processing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a data processing method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a data processing method according to an embodiment of the invention;
FIG. 4 is a timing diagram of a data processing method according to an embodiment of the present invention;
fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method provided by the embodiment of the application can be executed in a computer terminal, a computer terminal or a similar operation device. Taking the example of being operated on a computer terminal, fig. 1 is a hardware structure block diagram of a computer terminal of a data processing method according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the data processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a data processing method is provided, which is applied to the computer terminal, and fig. 2 is a flowchart of a data processing method according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, a target event received by the target webpage is obtained, wherein the target event at least comprises one of the following: and operating an event on the page of the target webpage by the user, and reporting the event on the data of the target webpage by the service end.
Specifically, the target webpage is a page rendered by a rendering frame, where the rendering frame is a tool for building a user interface, for example, the rendering frame may be read, Vue, Flutter, and the like.
In the process of displaying the target webpage, the service end continuously uploads data to update the service information displayed on the webpage, and in order to acquire the data uploading action of the service end, in an exemplary embodiment, a data reporting event is obtained by pushing data of the target webpage subscription service end. Meanwhile, in the process of displaying the target webpage, page operation events such as clicking and sliding in the process of interacting with the webpage by the user can be received, and therefore the page is refreshed. That is, the rendering framework performs page refreshing according to the event received by the web page.
In an exemplary embodiment, before determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, the method further includes: the method comprises the steps of obtaining a plurality of events in a preset time period, and extracting the events from the events according to a preset extraction mode to obtain a target event, wherein the preset extraction mode at least comprises one of the following modes: and randomly extracting, namely extracting the first event from the plurality of events and extracting the last event from the plurality of events.
Specifically, the target event may be an event currently received by the web page, and when the frequency of receiving the event by the web page is too high, the target event may be selected from a plurality of events acquired in a current actual period according to a time period, and a preset event may be selected from a plurality of events acquired in a previous time period, so that component state data corresponding to the target event and the preset event are compared, and the overhead of a rendering frame is reduced without affecting user experience.
It should be noted that, in the service end, there is a case where data is uploaded at regular time but the content of the uploaded data does not change, which results in unnecessary page update of the page according to the currently uploaded content, and meanwhile, there is a case where the user frequently performs the same page operation on the target web page, which also results in unnecessary page refresh, and if the target web page needs to display service information with a large data amount, the page is stuck due to frequent refresh of the page. Therefore, the method and the device for processing the target events intercept the target events received by the target webpage, process the target events, and refresh the target webpage according to the processed target events.
Step S204, judging whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event, wherein the component state data is used for rendering the components in the target webpage, and the preset event is an event received by the target webpage before the target event.
It should be noted that, because the target event is an event for triggering page refresh, each target event is associated with component state data, and thus, the corresponding component in the target webpage is rendered through the component state data, so that a page refresh effect is obtained. Therefore, in order to avoid invalid page refreshing, whether the component state data corresponding to the target event changes relative to the component state data corresponding to the event before the target event is judged to determine whether to refresh the page.
In an exemplary embodiment, when the target event is a page operation event, determining whether component state data corresponding to the target event is the same as component state data corresponding to a preset event includes: judging whether the type of the target event is the same as that of a preset event or not; under the condition that the type of the target event is the same as that of the preset event, determining that the component state data corresponding to the target event is the same as that corresponding to the preset event, wherein the type of the target event is at least characterized by the following information: the triggering mode of the target event and the triggering position of the target event.
It should be noted that the same type of page operation event indicates the same page refresh request, the component state data corresponding to the same type of page operation event is the same, and when the target event is a page operation event, whether the corresponding component state data changes may be determined according to whether the type of the page operation event changes.
For example, a user performs multiple click operations on the same button, and since the multiple click operations are of the same page operation type, it is determined that component state data corresponding to the multiple click operations are the same.
In an exemplary embodiment, when the target event is a data reporting event, determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event includes: judging whether the reported data corresponding to the target event is the same as the reported data corresponding to the preset event or not; and under the condition that the reported data corresponding to the target event is the same as the reported data corresponding to the preset event, determining that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event.
Specifically, the service end reports the timing data and the uploaded data does not change, so that whether the component state data corresponding to the target event changes can be determined according to whether the reported data changes.
Step S206, under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, the target webpage is refreshed based on the component state data corresponding to the target event.
Specifically, when the component state data corresponding to the target event changes, it is described that the page refresh request corresponding to the target event is an effective refresh request, and the component corresponding to the target event can be rendered according to the component state data corresponding to the target event, so that the page refresh is realized.
In an exemplary embodiment, when the target event is a data reporting event, and when the component state data corresponding to the target event is different from the component state data corresponding to the preset event, the refreshing the target webpage based on the component state data corresponding to the target event includes: acquiring difference data between component state data corresponding to a target event and component state data corresponding to a preset event; and determining a page component corresponding to the difference data, and rendering the page component based on the difference data.
Specifically, the same data and the difference data between the component state data corresponding to the target event and the component state data corresponding to the preset event are determined, the display state of the component corresponding to the same data is kept unchanged, the component corresponding to the difference data is determined, and the corresponding component is rendered according to the difference data.
In an exemplary embodiment, after determining whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, the method further includes: and under the condition that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, discarding the component state data corresponding to the target event.
That is, when the component state data corresponding to the target event is not changed from the previous component state data, the component state data corresponding to the target event is discarded in order to avoid invalid refresh.
Through the steps, the target event received by the target webpage is obtained, wherein the target event at least comprises one of the following: a user operates an event on a page of a target webpage, and a service end reports the event on data of the target webpage; judging whether component state data corresponding to a target event is the same as component state data corresponding to a preset event or not, wherein the component state data is used for rendering components in the target webpage, and the preset event is an event received by the target webpage before the target event; and under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, refreshing the target webpage based on the component state data corresponding to the target event. By adopting the technical scheme, the problem of page blockage caused by frequent refreshing of the front-end page in the related technology is solved, and the effects of avoiding frequent refreshing of the front-end page and improving the smoothness of page display are achieved.
FIG. 3 is a schematic diagram of a data processing method according to an embodiment of the invention; as shown in fig. 3, includes:
when the Flutter page is rendered, an event interceptor and a state management center can be constructed, the event interceptor intercepts a page operation event received by the Flutter page and a data reporting event of a data source corresponding to a service end, and after the event is intercepted, the page operation event with a different type from the previous page operation event can be sent to the state management center; for the data reporting event, each data reporting event can be sent to the state management center.
The method comprises the steps that a state management center receives an event sent by an event interceptor, carries out secondary processing on state data of the event, specifically, for a page operation event, obtains difference data of component state data corresponding to a next event and component state data corresponding to a previous event, and renders corresponding components according to the difference data on the basis of component presentation corresponding to the previous event; for a data reporting event, if the data reported twice before and after are consistent, the repeated invalid refreshing is determined, the Flutter page does not need to be updated, if the data reported twice before and after are different, the difference data of the two reporting events is obtained, and on the basis of the presentation of the component corresponding to the previous event, the corresponding component is rendered according to the difference data, so that the refreshing of the Flutter page is completed;
specifically, as shown in fig. 4, it is a schematic time-efficiency diagram of the data processing method of this embodiment, as shown in fig. 4:
the Flutter page firstly initializes an event interceptor, that is, determines configuration data of the event interceptor, for example, which channel data reporting event is intercepted, which type of page operation event is intercepted, and the like;
the Flutter page reinitializes the state management center, that is, determines configuration data of the state management center, for example, which component state events correspond to the events are compared, and what manner to extract the events to compare the component state data when the number of the received events is large. (ii) a
The method comprises the following steps that (1) a Flutter page subscribes data state change, specifically, subscribes the data state change by intercepting a page operation event and a data reporting event;
when data change occurs, namely, a new surface operation event or a data reporting event is generated, the event interceptor intercepts the change, packages the component state data corresponding to the event and then sends the component state data to the state management center;
after receiving the transmission event of the intercepting distributor, the state management center compares whether the current state is updated according to component state data corresponding to the events transmitted at the previous and next times; when the component state data corresponding to the events of the previous and next times are consistent, discarding the component state data corresponding to the event, and not needing to refresh the flutter page; when the component state data corresponding to the two events are inconsistent, a latest state is generated according to the state data superposition of the two events, and the Flutter page is refreshed, so that unnecessary refreshing is reduced while the latest state is kept;
according to the method, the event interceptor and the state management center are established, the component state global management is introduced into the Flutter complex page logic, the service is split aiming at the complex service scene, the refresh event is shunted when the refresh is high in concurrency, and the refresh times are limited by adopting the component state data comparison strategy corresponding to the event, so that the refresh frame rate is reduced, the application smoothness is improved, and the user experience is improved.
Fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present invention; as shown in fig. 5, includes:
an obtaining unit 502, configured to obtain a target event received by a target webpage, where the target event includes at least one of: and operating an event on the page of the target webpage by the user, and reporting the event on the data of the target webpage by the service end.
Specifically, the target webpage is a page rendered by a rendering frame, where the rendering frame is a tool for building a user interface, for example, the rendering frame may be read, Vue, Flutter, and the like.
In the process of displaying the target webpage, the service end continuously uploads data to update the service information displayed on the webpage, and in order to acquire the data uploading action of the service end, in an exemplary embodiment, a data reporting event is obtained by pushing data of the target webpage subscription service end. Meanwhile, in the process of displaying the target webpage, page operation events such as clicking and sliding in the process of interacting with the webpage by the user can be received, and therefore the page is refreshed. That is, the rendering framework performs page refreshing according to the event received by the web page.
In one exemplary embodiment, the apparatus further comprises: the extraction unit is used for acquiring a plurality of events in a preset time period before judging whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event or not, and extracting the events from the plurality of events according to a preset extraction mode to obtain the target event, wherein the preset extraction mode at least comprises one of the following modes: and randomly extracting, namely extracting the first event from the plurality of events and extracting the last event from the plurality of events.
Specifically, the target event may be an event currently received by the web page, and when the frequency of receiving the event by the web page is too high, the target event may be selected from a plurality of events acquired in a current actual period according to a time period, and a preset event may be selected from a plurality of events acquired in a previous time period, so that component state data corresponding to the target event and the preset event are compared, and the overhead of a rendering frame is reduced without affecting user experience.
It should be noted that, in the service end, there is a case where data is uploaded at regular time but the content of the uploaded data does not change, which results in unnecessary page update of the page according to the currently uploaded content, and meanwhile, there is a case where the user frequently performs the same page operation on the target web page, which also results in unnecessary page refresh, and if the target web page needs to display service information with a large data amount, the page is stuck due to frequent refresh of the page. Therefore, the method and the device for processing the target events intercept the target events received by the target webpage, process the target events, and refresh the target webpage according to the processed target events.
The determining unit 504 is configured to determine whether component state data corresponding to a target event is the same as component state data corresponding to a preset event, where the component state data is used to render a component in a target web page, and the preset event is an event received by the target web page before the target event.
It should be noted that, because the target event is an event for triggering page refresh, each target event is associated with component state data, and thus, the corresponding component in the target webpage is rendered through the component state data, so that a page refresh effect is obtained. Therefore, in order to avoid invalid page refreshing, whether the component state data corresponding to the target event changes relative to the component state data corresponding to the event before the target event is judged to determine whether to refresh the page.
A refreshing unit 506, configured to refresh the target webpage based on the component state data corresponding to the target event when the component state data corresponding to the target event is different from the component state data corresponding to the preset event.
In one exemplary embodiment, the apparatus further comprises: and the discarding unit is used for discarding the component state data corresponding to the target event under the condition that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event after judging whether the component state data corresponding to the target event is the same as the component state data corresponding to the preset event.
That is, when the component state data corresponding to the target event is not changed from the previous component state data, the component state data corresponding to the target event is discarded in order to avoid invalid refresh.
In an exemplary embodiment, in the case that the target event is a page operation event, the determining unit 504 includes: the first judgment module is used for judging whether the type of the target event is the same as that of the preset event or not; the first determining module is configured to determine that component state data corresponding to a target event is the same as component state data corresponding to a preset event under the condition that the type of the target event is the same as the type of the preset event, where the type of the target event is at least characterized by the following information: the triggering mode of the target event and the triggering position of the target event.
It should be noted that the same type of page operation event indicates the same page refresh request, the component state data corresponding to the same type of page operation event is the same, and when the target event is a page operation event, whether the corresponding component state data changes may be determined according to whether the type of the page operation event changes.
For example, a user performs multiple click operations on the same button, and since the multiple click operations are of the same page operation type, it is determined that component state data corresponding to the multiple click operations are the same.
In an exemplary embodiment, in a case that the target event is a data reporting event, the determining unit 504 includes: the second judgment module is used for judging whether the reported data corresponding to the target event is the same as the reported data corresponding to the preset event or not; and the second determining module is used for determining that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event under the condition that the reported data corresponding to the target event is the same as the reported data corresponding to the preset event.
Specifically, the service end reports the timing data and the uploaded data does not change, so that whether the component state data corresponding to the target event changes can be determined according to whether the reported data changes.
In an exemplary embodiment, in case that the target event is a data reporting event, the refresh unit 506 includes: the acquisition module is used for acquiring difference data between component state data corresponding to a target event and component state data corresponding to a preset event; and the third determining module is used for determining the page assembly corresponding to the difference data and rendering the page assembly based on the difference data.
Specifically, the same data and the difference data between the component state data corresponding to the target event and the component state data corresponding to the preset event are determined, the display state of the component corresponding to the same data is kept unchanged, the component corresponding to the difference data is determined, and the corresponding component is rendered according to the difference data.
With the above embodiment, the obtaining unit 502 is configured to obtain a target event received by a target webpage, where the target event includes at least one of: a user operates an event on a page of a target webpage, and a service end reports the event on data of the target webpage; a determining unit 504, configured to determine whether component state data corresponding to a target event is the same as component state data corresponding to a preset event, where the component state data is used to render a component in a target web page, and the preset event is an event received by the target web page before the target event; the refreshing unit 506 refreshes the target webpage based on the component state data corresponding to the target event when the component state data corresponding to the target event is different from the component state data corresponding to the preset event. By adopting the technical scheme, the problem of page blockage caused by frequent refreshing of the front-end page in the related technology is solved, and the effects of avoiding frequent refreshing of the front-end page and improving the smoothness of page display are achieved.
An embodiment of the present invention further provides a storage medium including a stored program, wherein the program executes any one of the methods described above.
Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
s202, acquiring a target event received by the target webpage, wherein the target event at least comprises one of the following events: and operating an event on the page of the target webpage by the user, and reporting the event on the data of the target webpage by the service end.
And S204, judging whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event, wherein the component state data is used for rendering the components in the target webpage, and the preset event is an event received by the target webpage before the target event.
S206, under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, the target webpage is refreshed based on the component state data corresponding to the target event.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s202, acquiring a target event received by the target webpage, wherein the target event at least comprises one of the following events: and operating an event on the page of the target webpage by the user, and reporting the event on the data of the target webpage by the service end.
And S204, judging whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event, wherein the component state data is used for rendering the components in the target webpage, and the preset event is an event received by the target webpage before the target event.
S206, under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, the target webpage is refreshed based on the component state data corresponding to the target event.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A data processing method, comprising:
acquiring a target event received by a target webpage, wherein the target event at least comprises one of the following: a user operates an event on the page of the target webpage, and a service end reports the event on the data of the target webpage;
judging whether the component state data corresponding to the target event is the same as component state data corresponding to a preset event or not, wherein the component state data is used for rendering components in the target webpage, and the preset event is an event received by the target webpage before the target event;
and under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event, refreshing the target webpage based on the component state data corresponding to the target event.
2. The data processing method according to claim 1, wherein after the determining whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event, the method further comprises:
and under the condition that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event, discarding the component state data corresponding to the target event.
3. The data processing method according to claim 1, wherein, in a case that the target event is the page operation event, the determining whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event comprises:
judging whether the type of the target event is the same as that of the preset event or not;
determining that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event under the condition that the type of the target event is the same as the type of the preset event, wherein the type of the target event is characterized by at least the following information: the triggering mode of the target event and the triggering position of the target event.
4. The data processing method of claim 1, wherein, when the target event is the data reporting event, the determining whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event comprises:
judging whether the reported data corresponding to the target event is the same as the reported data corresponding to the preset event or not;
and determining that the component state data corresponding to the target event is the same as the component state data corresponding to the preset event under the condition that the reported data corresponding to the target event is the same as the reported data corresponding to the preset event.
5. The data processing method of claim 1, wherein when the target event is the data reporting event, and when the component state data corresponding to the target event is different from the component state data corresponding to the preset event, refreshing the target webpage based on the component state data corresponding to the target event comprises:
acquiring difference data between the component state data corresponding to the target event and the component state data corresponding to the preset event;
and determining a page component corresponding to the difference data, and rendering the page component based on the difference data.
6. The data processing method according to claim 1, wherein before the determining whether the component state data corresponding to the target event is the same as the component state data corresponding to a preset event, the method further comprises:
acquiring a plurality of events in a preset time period, and extracting the events from the plurality of events according to a preset extraction mode to obtain the target event, wherein the preset extraction mode at least comprises one of the following modes: and randomly extracting, namely extracting a first event from the plurality of events and extracting a last event from the plurality of events.
7. The data processing method of claim 1, wherein the data reporting event is obtained by subscribing to a change of the data of the service end through the target webpage.
8. A data processing apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a target event received by a target webpage, and the target event at least comprises one of the following: a user operates an event on the page of the target webpage, and a service end reports the event on the data of the target webpage;
a determining unit, configured to determine whether component state data corresponding to the target event is the same as component state data corresponding to a preset event, where the component state data is used to render a component in the target web page, and the preset event is an event received by the target web page before the target event;
and the refreshing unit is used for refreshing the target webpage based on the component state data corresponding to the target event under the condition that the component state data corresponding to the target event is different from the component state data corresponding to the preset event.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the data processing method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, and the processor is arranged to execute the data processing method of any of claims 1 to 7 by means of the computer program.
CN202110723424.0A 2021-06-28 2021-06-28 Data processing method and device Active CN113434800B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110723424.0A CN113434800B (en) 2021-06-28 2021-06-28 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110723424.0A CN113434800B (en) 2021-06-28 2021-06-28 Data processing method and device

Publications (2)

Publication Number Publication Date
CN113434800A true CN113434800A (en) 2021-09-24
CN113434800B CN113434800B (en) 2023-06-09

Family

ID=77757460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110723424.0A Active CN113434800B (en) 2021-06-28 2021-06-28 Data processing method and device

Country Status (1)

Country Link
CN (1) CN113434800B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105320747A (en) * 2015-09-25 2016-02-10 小米科技有限责任公司 Method and apparatus for stopping web page refreshing and terminal device
US20160092914A1 (en) * 2014-09-25 2016-03-31 Oracle International Corporation Evaluating page content to determine user interest
CN106547420A (en) * 2015-09-23 2017-03-29 阿里巴巴集团控股有限公司 A kind of page processing method and device
US20180018399A1 (en) * 2011-03-30 2018-01-18 Cbs Interactive Inc. Systems and methods for updating rich internet applications
CN110489116A (en) * 2018-05-15 2019-11-22 优酷网络技术(北京)有限公司 A kind of rendering method of the page, device and computer storage medium
CN111309216A (en) * 2020-02-10 2020-06-19 广州虎牙科技有限公司 List page display method and device, computer equipment and storage medium
CN111506848A (en) * 2019-01-30 2020-08-07 阿里巴巴集团控股有限公司 Webpage processing method, device, equipment and readable storage medium
CN111782490A (en) * 2019-04-04 2020-10-16 北京奇虎科技有限公司 Data acquisition method and device
CN112015408A (en) * 2020-07-08 2020-12-01 广州乐摇摇信息科技有限公司 Component rendering method and device, storage medium and electronic device
CN112328225A (en) * 2021-01-07 2021-02-05 北京安泰伟奥信息技术有限公司 Page operation method and operation system thereof
CN112558933A (en) * 2020-12-09 2021-03-26 北京字节跳动网络技术有限公司 Component rendering method and device, readable medium and electronic equipment
CN112800363A (en) * 2021-02-04 2021-05-14 北京字节跳动网络技术有限公司 Page display method and device, electronic equipment and computer readable medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180018399A1 (en) * 2011-03-30 2018-01-18 Cbs Interactive Inc. Systems and methods for updating rich internet applications
US20160092914A1 (en) * 2014-09-25 2016-03-31 Oracle International Corporation Evaluating page content to determine user interest
CN106547420A (en) * 2015-09-23 2017-03-29 阿里巴巴集团控股有限公司 A kind of page processing method and device
CN105320747A (en) * 2015-09-25 2016-02-10 小米科技有限责任公司 Method and apparatus for stopping web page refreshing and terminal device
CN110489116A (en) * 2018-05-15 2019-11-22 优酷网络技术(北京)有限公司 A kind of rendering method of the page, device and computer storage medium
CN111506848A (en) * 2019-01-30 2020-08-07 阿里巴巴集团控股有限公司 Webpage processing method, device, equipment and readable storage medium
CN111782490A (en) * 2019-04-04 2020-10-16 北京奇虎科技有限公司 Data acquisition method and device
CN111309216A (en) * 2020-02-10 2020-06-19 广州虎牙科技有限公司 List page display method and device, computer equipment and storage medium
CN112015408A (en) * 2020-07-08 2020-12-01 广州乐摇摇信息科技有限公司 Component rendering method and device, storage medium and electronic device
CN112558933A (en) * 2020-12-09 2021-03-26 北京字节跳动网络技术有限公司 Component rendering method and device, readable medium and electronic equipment
CN112328225A (en) * 2021-01-07 2021-02-05 北京安泰伟奥信息技术有限公司 Page operation method and operation system thereof
CN112800363A (en) * 2021-02-04 2021-05-14 北京字节跳动网络技术有限公司 Page display method and device, electronic equipment and computer readable medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AJAY SINGH DIKHIT 等: ""Result evaluation of field authentication based SQL injection and XSS attack exposure"", 《2017 INTERNATIONAL CONFERENCE ON INFORMATION, COMMUNICATION, INSTRUMENTATION AND CONTROL (ICICIC)》 *
唐明伟 等: ""RESTful Web 服务和知识库协同驱动的 突发事件网络舆情实时追踪"", 《山东大学学报(理学版)》 *

Also Published As

Publication number Publication date
CN113434800B (en) 2023-06-09

Similar Documents

Publication Publication Date Title
US11221743B2 (en) Information processing method, terminal, server, and computer storage medium
CN108182140B (en) Determining and monitoring performance capabilities of computer resource services
CN108721898B (en) Frame rate determination method and apparatus, storage medium, and electronic apparatus
CN108057243B (en) Data display method and device, storage medium and electronic device
CN107872534B (en) Information pushing method and device, server and readable storage medium
CN102681999A (en) Method and device for collecting and sending user action information
CN110727697B (en) Data processing method and device, storage medium and electronic device
CN112434039A (en) Data storage method, device, storage medium and electronic device
CN110427494B (en) Knowledge graph display method and device, storage medium and electronic device
CN112596768B (en) Updating method and device of equipment, storage medium and electronic device
CN111090533A (en) Notice information sending method and device, electronic equipment and storage medium
CN108462734B (en) Message receiving method and device
CN102769625A (en) Client-side Cookie information acquisition method and device
CN112748961A (en) Method and device for executing starting task
CN110874301B (en) Method and device for acquiring program pause information
CN104462166A (en) Report generation method and system
CN103699589A (en) Information push method and information push device
CN109388552B (en) Method and device for determining duration of starting application program and storage medium
CN107018166B (en) Service display method and terminal
CN113434800A (en) Data processing method and device
CN113688102A (en) File name modification method and device and storage medium
CN106294457B (en) Network information pushing method and device
CN111008032A (en) Page data updating method and device
CN109669601A (en) Information displaying method, device for displaying information, information presentation device and storage medium
CN115037654A (en) Flow statistical method and device, electronic equipment and readable 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