CN112765503A - Static processing method and device for page loading data - Google Patents

Static processing method and device for page loading data Download PDF

Info

Publication number
CN112765503A
CN112765503A CN202110061190.8A CN202110061190A CN112765503A CN 112765503 A CN112765503 A CN 112765503A CN 202110061190 A CN202110061190 A CN 202110061190A CN 112765503 A CN112765503 A CN 112765503A
Authority
CN
China
Prior art keywords
service data
data
user terminal
interface
type
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.)
Pending
Application number
CN202110061190.8A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110061190.8A priority Critical patent/CN112765503A/en
Publication of CN112765503A publication Critical patent/CN112765503A/en
Pending legal-status Critical Current

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

Abstract

The invention provides a method and a device for statically processing page loading data, wherein the method comprises the following steps: acquiring a service data access request sent by a user terminal, wherein the service data access request packet block comprises: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal; judging whether the user terminal accesses the service data for the first time or not according to the first access identifier; if not, judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier; and replying the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal, wherein the interfaces with different magnitudes and different service scenes are respectively processed, so that a static storage frame for classifying the service data is realized, the dependence on designers and developers is low, repeated data transmission is prevented, and the pressure of a server and a database is reduced.

Description

Static processing method and device for page loading data
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for statically processing page loading data.
Background
Currently, a mainstream Web project mainly uses front-end separation or dynamic-static separation on a front-end technology for page loading, and a background generally performs cache processing on a service data request only in a special scene, so that the page loading speed is low.
In the aspect of improving the page loading speed, the framework layer mainly uses dynamic and static separation (for example, a static resource server is independently built), CDN deployment, the framework layer uses technologies such as front-end and back-end separation (for example, Vue and React) to solve the loading speed problem, the compiling layer generally uses Webpack to realize reference as required, and the background code layer generally performs data caching according to a specific service scene.
However, in the prior art, in terms of increasing the page loading speed, optimization is performed at a static resource level, for example, static resources such as pictures, JS, CSS, HTML, and the like, and in an actual project, the response speed of interfaces with different magnitudes and different service scenes is an extremely important part of the loading speed. Due to the lack of a static storage frame for classification of business data, the dependency on designers and developers is high, and meanwhile, a lot of requests are always to acquire repeated data, so that the pressure of a server and a database is increased due to the lack of the static storage frame.
Disclosure of Invention
The invention provides a method and a device for statically processing page loading data, an electronic device and a computer-readable storage medium, which can at least partially solve the problems in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, a method for statically processing page load data is provided, including:
acquiring a service data access request sent by a user terminal, wherein the service data access request packet block comprises: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal;
judging whether the user terminal accesses the service data for the first time or not according to the first access identifier;
if not, judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier;
and replying the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal.
Further, the replying to the user terminal according to the access interface type and the update time of the service data local to the user terminal includes:
if the type of the access interface is permanent, feeding back an instruction for reading local historical service data to the user terminal;
if the type of the access interface is a dynamic update type or a timing update type, judging whether the service data exists in the local cache or not;
and if so, replying the user terminal according to the updating time of the service data local to the user terminal and the updating time of the service data in the local cache.
Further, the replying to the user terminal according to the update time of the service data local to the user terminal and the update time of the service data in the local cache includes:
judging whether the updating time of the service data in the local of the user terminal is consistent with the updating time of the service data in the local cache;
if the historical service data are consistent with the historical service data, feeding back an instruction for reading the local historical service data to the user terminal;
and if not, feeding back the service data and the updating time thereof in the local cache to the user terminal.
Further, the replying to the user terminal according to the type of the access interface and the update time of the service data local to the user terminal further includes:
if the service data does not exist in the local cache, accessing a corresponding database according to the access interface identifier to acquire the service data;
and feeding back the service data and the current time to the user terminal, and storing the service data and the current time in the local cache, wherein the current time is used as the update time of the service data.
Further, the method for statically processing the page loading data further comprises the following steps:
if the user terminal accesses the service data for the first time, judging whether the service data exists in the local cache or not;
if yes, judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier;
and replying to the user terminal according to the type of the access interface.
Further, said replying to said user terminal according to said access interface type comprises:
if the type of the access interface is permanent, the service data is fed back to the user terminal;
and if the type of the access interface is a dynamic update type or a timing update type, feeding back the service data and the update time thereof to the user terminal.
Further, the method for statically processing the page loading data further comprises the following steps:
if the service data does not exist in the local cache, accessing a corresponding database according to the access interface identifier to acquire the service data;
and feeding back the service data and the current time to the user terminal, and storing the service data and the current time in the local cache, wherein the current time is used as the update time of the service data.
Further, the method for statically processing the page loading data further comprises the following steps:
setting the type of each interface and the data updating triggering condition of the dynamic updating interface to form an interface configuration file;
storing the interface configuration file in the local cache;
wherein the types of the interface include: permanent, timed, dynamic update class 3.
Further, the method for statically processing the page loading data further comprises the following steps:
and maintaining corresponding data in the local cache according to the interface configuration file.
Further, the maintaining the corresponding data in the local cache according to the interface configuration file includes:
and deleting the data corresponding to the timing updating type interface in the local cache at regular time.
Further, the maintaining the corresponding data in the local cache according to the interface configuration file includes:
judging whether a data updating triggering condition of a dynamic updating interface in the interface configuration file is met;
and if so, deleting the data corresponding to the dynamic update interface meeting the data update triggering condition in the local cache.
In a second aspect, a device for statically processing page load data is provided, including:
an access request obtaining module, for obtaining a service data access request sent by a user terminal, wherein the service data access request packet block: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal;
the first-time judging module is used for judging whether the user terminal accesses the service data for the first time according to the first-time access identifier;
the first interface type judging module is used for judging the type of an access interface according to an interface configuration file in a local cache and the access interface identifier if the user terminal does not access the service data for the first time;
and the first reply module replies the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal.
Further, the first reply module includes:
the first feedback unit feeds back an instruction for reading local historical service data to the user terminal if the type of the access interface is permanent;
the first judging unit is used for judging whether the service data exists in the local cache or not if the type of the access interface is a dynamic update type or a timing update type;
and if the service data exists, replying to the user terminal according to the updating time of the service data in the local cache of the user terminal and the updating time of the service data in the local cache.
Further, the second feedback unit includes:
a first judging subunit, configured to judge whether an update time of the service data in the local cache of the user terminal is consistent with an update time of the service data in the local cache;
the first feedback subunit feeds back an instruction for reading local historical service data to the user terminal if the historical service data are consistent with the local historical service data;
and the second feedback subunit feeds back the service data and the updating time thereof in the local cache to the user terminal if the service data and the updating time are not consistent.
Further, the first reply module further comprises:
the data access unit accesses a corresponding database according to the access interface identifier to acquire the service data if the service data does not exist in the local cache;
a third feedback unit, configured to feed back the service data and the current time to the user terminal;
and the data caching unit is used for storing the service data and the current time in the local cache, wherein the current time is used as the updating time of the service data.
Further, the device for statically processing page loading data further comprises:
the first data judgment module is used for judging whether the service data exists in the local cache or not if the user terminal accesses the service data for the first time;
the second interface type judging module judges the type of the access interface according to the interface configuration file in the local cache and the access interface identifier if the second interface type judging module exists;
and the second reply module replies to the user terminal according to the access interface type.
Further, the second reply module includes:
a fourth feedback unit, configured to feed back the service data to the user terminal if the access interface type is a permanent type;
and a fifth feedback unit, configured to feed back the service data and the update time thereof to the user terminal if the access interface type is a dynamic update type or a timing update type.
Further, the device for statically processing page loading data further comprises:
the data access module accesses a corresponding database according to the access interface identifier to acquire the service data if the service data does not exist in the local cache;
the third reply module feeds back the service data and the current time to the user terminal;
and the data cache module is used for storing the service data and the current time in the local cache, wherein the current time is used as the updating time of the service data.
Further, the device for statically processing page loading data further comprises:
the interface configuration module is used for setting the type of each interface and dynamically updating the data updating triggering condition of the interface to form an interface configuration file;
the configuration cache module is used for storing the interface configuration file in the local cache;
wherein the types of the interface include: permanent, timed, dynamic update class 3.
Further, the device for statically processing page loading data further comprises:
and the data maintenance module is used for maintaining the corresponding data in the local cache according to the interface configuration file.
Further, the data maintenance module includes:
and the timing deleting unit is used for deleting the data corresponding to the timing updating type interface in the local cache at a timing.
Further, the data maintenance module includes:
the updating judgment unit is used for judging whether the data updating triggering condition of the dynamic updating interface in the interface configuration file is met;
and the data updating unit deletes the data corresponding to the dynamic updating interface meeting the data updating triggering condition in the local cache.
In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of the method for processing the page load data statically.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for staticizing page load data described above.
The invention provides a method and a device for statically processing page loading data, wherein the method comprises the following steps: acquiring a service data access request sent by a user terminal, wherein the service data access request packet block comprises: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal; judging whether the user terminal accesses the service data for the first time or not according to the first access identifier; if not, judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier; and replying the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal, wherein the interfaces with different magnitudes and different service scenes are respectively processed, so that a static storage frame for classifying the service data is realized, the dependence on designers and developers is low, repeated data transmission is prevented, and the pressure of a server and a database is reduced.
In order to make the aforementioned and other objects, features and advantages of the invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. In the drawings:
FIG. 1 is a schematic diagram of an application scenario architecture in an embodiment of the present invention;
FIG. 2 is a first flowchart illustrating a method for statically processing page load data according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second method for statically handling page load data according to an embodiment of the present invention;
FIG. 4 shows the detailed steps of step S400 in an embodiment of the present invention;
FIG. 5 shows the detailed steps of step S440 in the embodiment of the present invention;
FIG. 6 shows the detailed steps of step S700 in the embodiment of the present invention;
FIG. 7 is a third flowchart illustrating a method for statically handling page load data according to an embodiment of the present invention;
FIG. 8 is a fourth flowchart illustrating a method for statically handling page load data according to an embodiment of the present invention;
FIG. 9 is a block diagram of a device for statically processing page load data according to an embodiment of the present invention;
FIG. 10 shows a block diagram of the structure of a first reply module in an embodiment of the invention;
fig. 11 shows a block diagram of the second feedback unit in the embodiment of the present invention;
fig. 12 is a block diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all 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 application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the above-described drawings, 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.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In the prior art, more static resources such as pictures, JS, CSS, HTML and the like are optimized in the aspect of increasing the page loading speed, and in an actual project, the response speeds of interfaces with different magnitudes and different service scenes are an important part of the loading speed. Due to the lack of a static storage frame for classification of business data, the dependency on designers and developers is high, and meanwhile, a lot of requests are always to acquire repeated data, so that the pressure of a server and a database is increased due to the lack of the static storage frame.
The bottleneck of the current mainstream solution is mainly that the static independent storage is only carried out on the traditional static resource level, the invention overcomes the defects to a certain extent, and the static independent storage of the interface data according to the service scene can be realized according to the requirement.
FIG. 1 is a schematic diagram of an application scenario architecture in an embodiment of the present invention; as shown in fig. 1, a user accesses interfaces a1 to AM of databases C1 to CK through user terminals B1 to BN, and when service data is requested, a front-end user terminal sends an MD5 value of a message while sending parameters, and reaches an application server layer and is intercepted uniformly at an AOP layer S1. On the basis of accessing the cache in the traditional appointed service scene, the AOP layer is added with a strong cache and a weak cache imitating http requests and a real-time updating mechanism, so that the processing pressure of a server and the pressure of a database can be greatly reduced, and the requirements on development and designers are reduced.
FIG. 2 is a first flowchart illustrating a method for statically processing page load data according to an embodiment of the present invention; as shown in fig. 2, the staticizing processing method for page load data is executed at the AOP layer, and may specifically include the following steps:
step S100: acquiring a service data access request sent by a user terminal, wherein the service data access request packet block comprises: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal;
the first access identifier is used to identify whether the user terminal accesses the service data for the first time, and the access interface identifier may be an ID of a database interface.
In addition, when the user terminal accesses the service data for the first time, the update time of the service data local to the user terminal is empty, and when the user terminal does not access the service data for the first time, the update time of the service data local to the user terminal represents the update time of the service data locally stored by the user terminal and accessed last time.
Step S200: judging whether the user terminal accesses the service data for the first time or not according to the first access identifier;
if not, executing step S300;
step S300: judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier;
wherein, the interface type is preset, and the type of the interface comprises: permanent, timed, dynamic update class 3.
Firstly, finding a corresponding interface in an interface configuration file according to an access interface identifier, and then acquiring the type of the interface.
Step S400: and replying the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal.
The static storage frame for classifying the service data is realized by respectively processing the interfaces with different magnitudes and different service scenes, the dependence on designers and developers is low, repeated data transmission is prevented, and the pressure of a server and a database is reduced.
In an optional embodiment, referring to fig. 3, the method for statically processing page load data may further include the following steps:
step S500: judging whether the service data exists in the local cache or not;
if yes, executing step S600; if not, go to step S800.
And searching whether the required data exists in the local cache according to the data identification in the request.
It should be noted that, when the determination result in step S200 is yes, step S500 is executed.
Step S600: judging the type of an access interface according to the interface configuration file in the local cache and the access interface identifier;
and if the required data exists in the cache, feeding back the corresponding data to the user terminal according to the interface type.
Step S700: and replying to the user terminal according to the type of the access interface.
Specifically, for a permanent interface, data of the permanent interface is not changed, and a user terminal can directly read service data locally stored by the user terminal; if the interface type is a timing update type or a dynamic update type, it is necessary to determine whether to send data to the user terminal or directly allow the user terminal to read service data locally stored in the user terminal according to the update time of service data locally stored in the user terminal and the update time of service data in a local cache.
Step S800: accessing a corresponding database according to the access interface identifier to acquire the service data;
specifically, when the required service data is not in the local cache, the database is accessed to obtain the data.
Step S900: and feeding back the service data and the current time to the user terminal, and storing the service data and the current time in the local cache, wherein the current time is used as the update time of the service data.
The data is fed back to the user terminal and stored in the local cache, so that the database does not need to be accessed when a request for accessing the service data is made next time, and the pressure of the database is reduced.
In an alternative embodiment, referring to fig. 4, this step S400 may include the following:
step S410: judging whether the type of the access interface is a permanent type;
if yes, go to step S420; if not, go to step S430.
Step S420: and feeding back an instruction for reading local historical service data to the user terminal.
The data of the permanent interface is not changed, so that the service data does not need to be fed back to the user terminal, and the user terminal directly reads the service data locally stored by the user terminal, so that the data transmission quantity can be reduced, the speed is improved, and the pressure of the server is reduced.
Step S430: judging whether the service data exists in the local cache or not;
if yes, go to step S440; if not, go to step S450.
Step S440: replying to the user terminal according to the updating time of the service data in the local of the user terminal and the updating time of the service data in the local cache;
and if the required data exists in the cache, feeding back the corresponding data to the user terminal according to the data updating time.
Step S450: accessing a corresponding database according to the access interface identifier to acquire the service data;
specifically, when the required service data is not in the local cache, the database is accessed to obtain the data.
Step S460: and feeding back the service data and the current time to the user terminal, and storing the service data and the current time in the local cache, wherein the current time is used as the update time of the service data.
The data is fed back to the user terminal and stored in the local cache, so that the database does not need to be accessed when a request for accessing the service data is made next time, and the pressure of the database is reduced.
In an alternative embodiment, referring to fig. 5, this step S440 may include the following:
step S441: judging whether the updating time of the service data in the local of the user terminal is consistent with the updating time of the service data in the local cache;
if yes, go to step S442; if not, go to step S443.
Step S442: feeding back an instruction for reading local historical service data to the user terminal;
when the update time of the service data in the local cache of the user terminal is consistent with the update time of the service data in the local cache, the data is not updated, the service data does not need to be fed back to the user terminal, and the user terminal is directly made to read the service data stored in the local cache of the user terminal, so that the data transmission quantity can be reduced, the speed is increased, and the pressure of a server is reduced.
Step S443: and feeding back the service data and the updating time thereof in the local cache to the user terminal.
And when the updating time of the service data in the local cache of the user terminal is not consistent with the updating time of the service data in the local cache, indicating that the data is updated, and feeding back the service data in the local cache and the updating time thereof to the user terminal.
In an alternative embodiment, referring to fig. 6, this step S700 may include the following:
step S710: judging whether the type of the access interface is a permanent type;
if yes, go to step S720; if not, go to step S730.
Step S720: and feeding back the service data to the user terminal.
When the type of the access interface is a permanent type, the data is invariable all the time, and the data updating time is not required to be fed back to the user terminal.
Optionally, the service data and the interface type corresponding to the service data may be sent to the user terminal, and when the user terminal requests the service data next time, the user terminal directly uses the service data locally stored in the user terminal without accessing the service data based on the identifier of the permanent type interface, so as to improve the processing speed and efficiency, reduce the pressure of the database, reduce the communication pressure, and the like.
Step S730: and feeding back the service data and the updating time thereof to the user terminal.
Specifically, when the interface type is a timing update type or a dynamic update type, the service data and the update time corresponding to the same period need to be sent to the user terminal, so that the user terminal sends the service data and the update time to the AOP layer along with the request when requesting the service data next time, so as to be used for the AOP layer to determine the response mode.
In an optional embodiment, referring to fig. 7, the method for statically processing page load data may further include:
step S10: setting the type of each interface and the data updating triggering condition of the dynamic updating interface to form an interface configuration file;
step S20: storing the interface configuration file in the local cache;
wherein the types of the interface include: permanent, timed, dynamic update class 3.
Because the change frequency of a plurality of service data in the use process is very low, namely the data of a plurality of interfaces in a certain time range is idempotent, the service data can be statically stored, and the access pressure of the database is reduced while the page response speed is improved.
In the background management page, interfaces with low changing frequency are registered in a static interface register, the types of the interfaces are permanent, timing and dynamic updating, and after the registration is finished, the data can be written into a cache.
The following two cases are classified according to interface registration:
1. permanent;
and adding a cache-Control to a Header of the Http Response to ensure that the browser walks a strong cache every time and reduces 304 requests.
2. Timed or dynamic updates;
adding a modify timing control on a Header of an Http Response, intercepting a request sent by a unified AOP layer, generating an MD5 according to a URL and a sending parameter, acquiring Metadata corresponding to an MD5 from an OaaS, acquiring a data change date from the Metadata, comparing the data update date according to a modify attribute in the browser Header, if the data update date is consistent with the sent Header, returning by a 304, and if the log is inconsistent or the cache is penetrated, configuring a cache modify time on the Header.
In the above processing, all keys corresponding to the URLs are stored in the NosDB as an association.
It should be noted that when the service data changes, the code is required to trigger the relevant data cache, search the key corresponding to the corresponding URL in the service data storage manager, and clear the corresponding static data.
In an optional embodiment, referring to fig. 8, the method for statically processing page load data may further include:
step S30: and maintaining corresponding data in the local cache according to the interface configuration file.
Specifically, the method comprises the following steps: and updating data corresponding to the timing updating type interface in the local cache at a fixed time and updating data corresponding to the dynamic updating type interface in the local cache dynamically.
Specifically, the data corresponding to the timing update type interface in the local cache may be deleted at regular time according to a preset interval time, and when the data is cached again next time, the cached data is the updated data.
In addition, dynamically updating the data corresponding to the dynamically updated interface in the local cache may include the following steps:
step I: judging whether a data updating triggering condition of a dynamic updating interface in the interface configuration file is met;
if yes, executing the step II; if not, executing the step III.
Step II: and deleting the data corresponding to the dynamic update interface meeting the data update triggering condition in the local cache.
Step III: the data in the local cache is not modified, and the next data update trigger is monitored.
Based on the same inventive concept, the embodiment of the present application further provides a device for statically processing page load data, which can be used to implement the method described in the foregoing embodiment, as described in the following embodiments. Because the principle of the static processing device for page loading data to solve the problem is similar to that of the method, the implementation of the static processing device for page loading data can refer to the implementation of the method, and repeated details are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 9 is a block diagram of a static processing apparatus for page load data in the embodiment of the present invention. As shown in fig. 9, the apparatus for statically processing page load data specifically includes: the device comprises an access request acquisition module 10, a first judgment module 20, a first interface type judgment module 30 and a first reply module 40.
An access request obtaining module 10 obtains a service data access request sent by a user terminal, where the service data access request packet block: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal;
the first-time judging module 20 judges whether the user terminal accesses the service data for the first time according to the first-time access identifier;
if the user terminal does not access the service data for the first time, the first interface type determining module 30 determines the type of the access interface according to the interface configuration file in the local cache and the access interface identifier;
the first reply module 40 replies to the user terminal according to the access interface type and the update time of the service data local to the user terminal.
The static storage frame for classifying the service data is realized by respectively processing the interfaces with different magnitudes and different service scenes, the dependence on designers and developers is low, repeated data transmission is prevented, and the pressure of a server and a database is reduced.
In an alternative embodiment, referring to fig. 10, the first reply module comprises: a first feedback unit 41, a first determination unit 42, and a second feedback unit 43.
If the access interface type is permanent, the first feedback unit 41 feeds back an instruction for reading local historical service data to the user terminal;
if the type of the access interface is a dynamic update type or a timing update type, the first determining unit 42 determines whether the service data exists in the local cache;
if the service data exists, the second feedback unit 43 replies to the user terminal according to the update time of the service data in the local cache and the update time of the service data in the local cache.
In an alternative embodiment, referring to fig. 11, the second feedback unit may include: a first judging subunit 431, a first feedback subunit 432, and a second feedback subunit 433.
The first determining subunit 431 determines whether the update time of the service data in the local cache of the user terminal is consistent with the update time of the service data in the local cache;
if the first feedback sub-unit 432 is consistent, an instruction for reading local historical service data of the user terminal is fed back to the user terminal;
if the service data and the update time thereof in the local cache are not consistent, the second feedback subunit 433 feeds back the service data and the update time thereof to the user terminal.
In an alternative embodiment, the first reply module further comprises: the device comprises a data access unit, a third feedback unit and a data cache unit.
The data access unit accesses a corresponding database according to the access interface identifier to acquire the service data if the service data does not exist in the local cache;
a third feedback unit, configured to feed back the service data and the current time to the user terminal;
and the data caching unit is used for storing the service data and the current time in the local cache, wherein the current time is used as the updating time of the service data.
In an optional embodiment, the apparatus for statically processing page load data further includes: the device comprises a first data judgment module, a second interface type judgment module and a second reply module.
The first data judgment module is used for judging whether the service data exists in the local cache or not if the user terminal accesses the service data for the first time;
the second interface type judging module judges the type of the access interface according to the interface configuration file in the local cache and the access interface identifier if the second interface type judging module exists;
and the second reply module replies to the user terminal according to the access interface type.
In an alternative embodiment, the second reply module comprises: a fourth feedback unit and a fifth feedback unit.
A fourth feedback unit, configured to feed back the service data to the user terminal if the access interface type is a permanent type;
and a fifth feedback unit, configured to feed back the service data and the update time thereof to the user terminal if the access interface type is a dynamic update type or a timing update type.
In an optional embodiment, the apparatus for statically processing page load data further includes: the system comprises a data access module, a third reply module and a data cache module.
The data access module accesses a corresponding database according to the access interface identifier to acquire the service data if the service data does not exist in the local cache;
the third reply module feeds back the service data and the current time to the user terminal;
and the data cache module is used for storing the service data and the current time in the local cache, wherein the current time is used as the updating time of the service data.
In an optional embodiment, the apparatus for statically processing page load data further includes: the interface configuration module and the configuration cache module.
The interface configuration module is used for setting the type of each interface and dynamically updating the data updating triggering condition of the interface to form an interface configuration file;
the configuration cache module is used for storing the interface configuration file in the local cache;
wherein the types of the interface include: permanent, timed, dynamic update class 3.
In an optional embodiment, the apparatus for statically processing page load data further includes: and the data maintenance module is used for maintaining the corresponding data in the local cache according to the interface configuration file.
In an optional embodiment, the data maintenance module comprises: and the timing deleting unit is used for deleting the data corresponding to the timing updating type interface in the local cache at a timing.
In an optional embodiment, the data maintenance module comprises: an update judgment unit and a data update unit.
The updating judgment unit is used for judging whether the data updating triggering condition of the dynamic updating interface in the interface configuration file is met;
and the data updating unit deletes the data corresponding to the dynamic updating interface meeting the data updating triggering condition in the local cache.
The apparatuses, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or implemented by a product with certain functions. A typical implementation device is an electronic device, which may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
In a typical example, the electronic device specifically includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method for statically processing page load data when executing the program.
Referring now to FIG. 12, shown is a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present application.
As shown in fig. 12, the electronic apparatus 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate works and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM)) 603. In the RAM603, various programs and data necessary for the operation of the system 600 are also stored. The CPU601, ROM602, and RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted as necessary on the storage section 608.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, an embodiment of the present invention includes a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the method for staticizing page load data described above.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (24)

1. A static processing method for page loading data is characterized by comprising the following steps:
acquiring a service data access request sent by a user terminal, wherein the service data access request packet block comprises: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal;
judging whether the user terminal accesses the service data for the first time or not according to the first access identifier;
if not, judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier;
and replying the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal.
2. The method for statically processing page loading data according to claim 1, wherein the replying to the user terminal according to the access interface type and the update time of the service data local to the user terminal includes:
if the type of the access interface is permanent, feeding back an instruction for reading local historical service data to the user terminal;
if the type of the access interface is a dynamic update type or a timing update type, judging whether the service data exists in the local cache or not;
and if so, replying the user terminal according to the updating time of the service data local to the user terminal and the updating time of the service data in the local cache.
3. The method for statically processing page loading data according to claim 2, wherein the replying to the user terminal according to the update time of the service data local to the user terminal and the update time of the service data in the local cache comprises:
judging whether the updating time of the service data in the local of the user terminal is consistent with the updating time of the service data in the local cache;
if the historical service data are consistent with the historical service data, feeding back an instruction for reading the local historical service data to the user terminal;
and if not, feeding back the service data and the updating time thereof in the local cache to the user terminal.
4. The method for statically processing page loading data according to claim 2, wherein the replying to the user terminal according to the access interface type and the update time of the service data local to the user terminal further comprises:
if the service data does not exist in the local cache, accessing a corresponding database according to the access interface identifier to acquire the service data;
and feeding back the service data and the current time to the user terminal, and storing the service data and the current time in the local cache, wherein the current time is used as the update time of the service data.
5. The method for statically processing page load data according to claim 1, further comprising:
if the user terminal accesses the service data for the first time, judging whether the service data exists in the local cache or not;
if yes, judging the type of the access interface according to the interface configuration file in the local cache and the access interface identifier;
and replying to the user terminal according to the type of the access interface.
6. The method for statically processing page loading data according to claim 5, wherein the replying to the user terminal according to the access interface type includes:
if the type of the access interface is permanent, the service data is fed back to the user terminal;
and if the type of the access interface is a dynamic update type or a timing update type, feeding back the service data and the update time thereof to the user terminal.
7. The method for statically processing page load data according to claim 5, further comprising:
if the service data does not exist in the local cache, accessing a corresponding database according to the access interface identifier to acquire the service data;
and feeding back the service data and the current time to the user terminal, and storing the service data and the current time in the local cache, wherein the current time is used as the update time of the service data.
8. The method for statically processing page load data according to claim 1, further comprising:
setting the type of each interface and the data updating triggering condition of the dynamic updating interface to form an interface configuration file;
storing the interface configuration file in the local cache;
wherein the types of the interface include: permanent, timed, dynamic update class 3.
9. The method for staticizing page load data according to claim 8, further comprising:
and maintaining corresponding data in the local cache according to the interface configuration file.
10. The method for statically processing page loading data according to claim 9, wherein the maintaining the corresponding data in the local cache according to the interface configuration file includes:
and deleting the data corresponding to the timing updating type interface in the local cache at regular time.
11. The method for statically processing page loading data according to claim 9, wherein the maintaining the corresponding data in the local cache according to the interface configuration file includes:
judging whether a data updating triggering condition of a dynamic updating interface in the interface configuration file is met;
and if so, deleting the data corresponding to the dynamic update interface meeting the data update triggering condition in the local cache.
12. A device for statically processing page loading data is characterized by comprising:
an access request obtaining module, for obtaining a service data access request sent by a user terminal, wherein the service data access request packet block: the first access identifier, the access interface identifier and the local update time of the service data of the user terminal;
the first-time judging module is used for judging whether the user terminal accesses the service data for the first time according to the first-time access identifier;
the first interface type judging module is used for judging the type of an access interface according to an interface configuration file in a local cache and the access interface identifier if the user terminal does not access the service data for the first time;
and the first reply module replies the user terminal according to the type of the access interface and the updating time of the service data local to the user terminal.
13. The apparatus for staticizing page load data according to claim 12, wherein the first reply module includes:
the first feedback unit feeds back an instruction for reading local historical service data to the user terminal if the type of the access interface is permanent;
the first judging unit is used for judging whether the service data exists in the local cache or not if the type of the access interface is a dynamic update type or a timing update type;
and if the service data exists, replying to the user terminal according to the updating time of the service data in the local cache of the user terminal and the updating time of the service data in the local cache.
14. The apparatus for staticizing page load data according to claim 13, wherein the second feedback unit includes:
a first judging subunit, configured to judge whether an update time of the service data in the local cache of the user terminal is consistent with an update time of the service data in the local cache;
the first feedback subunit feeds back an instruction for reading local historical service data to the user terminal if the historical service data are consistent with the local historical service data;
and the second feedback subunit feeds back the service data and the updating time thereof in the local cache to the user terminal if the service data and the updating time are not consistent.
15. The apparatus for staticizing page load data according to claim 13, wherein the first reply module further comprises:
the data access unit accesses a corresponding database according to the access interface identifier to acquire the service data if the service data does not exist in the local cache;
a third feedback unit, configured to feed back the service data and the current time to the user terminal;
and the data caching unit is used for storing the service data and the current time in the local cache, wherein the current time is used as the updating time of the service data.
16. The apparatus for staticizing page load data according to claim 12, further comprising:
the first data judgment module is used for judging whether the service data exists in the local cache or not if the user terminal accesses the service data for the first time;
the second interface type judging module judges the type of the access interface according to the interface configuration file in the local cache and the access interface identifier if the second interface type judging module exists;
and the second reply module replies to the user terminal according to the access interface type.
17. The apparatus for staticizing page load data according to claim 16, wherein the second reply module includes:
a fourth feedback unit, configured to feed back the service data to the user terminal if the access interface type is a permanent type;
and a fifth feedback unit, configured to feed back the service data and the update time thereof to the user terminal if the access interface type is a dynamic update type or a timing update type.
18. The apparatus for staticizing page load data according to claim 16, further comprising:
the data access module accesses a corresponding database according to the access interface identifier to acquire the service data if the service data does not exist in the local cache;
the third reply module feeds back the service data and the current time to the user terminal;
and the data cache module is used for storing the service data and the current time in the local cache, wherein the current time is used as the updating time of the service data.
19. The apparatus for staticizing page load data according to claim 12, further comprising:
the interface configuration module is used for setting the type of each interface and dynamically updating the data updating triggering condition of the interface to form an interface configuration file;
the configuration cache module is used for storing the interface configuration file in the local cache;
wherein the types of the interface include: permanent, timed, dynamic update class 3.
20. The apparatus for staticizing page load data according to claim 19, further comprising:
and the data maintenance module is used for maintaining the corresponding data in the local cache according to the interface configuration file.
21. The apparatus for staticizing page load data according to claim 20, wherein the data maintenance module comprises:
and the timing deleting unit is used for deleting the data corresponding to the timing updating type interface in the local cache at a timing.
22. The apparatus for staticizing page load data according to claim 20, wherein the data maintenance module comprises:
the updating judgment unit is used for judging whether the data updating triggering condition of the dynamic updating interface in the interface configuration file is met;
and the data updating unit deletes the data corresponding to the dynamic updating interface meeting the data updating triggering condition in the local cache.
23. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for staticizing page load data according to any one of claims 1 to 11 when executing the program.
24. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for staticizing page load data according to any one of claims 1 to 11.
CN202110061190.8A 2021-01-18 2021-01-18 Static processing method and device for page loading data Pending CN112765503A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110061190.8A CN112765503A (en) 2021-01-18 2021-01-18 Static processing method and device for page loading data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110061190.8A CN112765503A (en) 2021-01-18 2021-01-18 Static processing method and device for page loading data

Publications (1)

Publication Number Publication Date
CN112765503A true CN112765503A (en) 2021-05-07

Family

ID=75702297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110061190.8A Pending CN112765503A (en) 2021-01-18 2021-01-18 Static processing method and device for page loading data

Country Status (1)

Country Link
CN (1) CN112765503A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961292A (en) * 2021-10-21 2022-01-21 安天科技集团股份有限公司 Security product generation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070078810A1 (en) * 2005-09-30 2007-04-05 Keith Hackworth Methods, systems, and products for updating web content
CN101127783A (en) * 2007-09-28 2008-02-20 北京金山软件有限公司 A website buffering method and device
CN110287432A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Network information processing method and device and electronic equipment
CN110990736A (en) * 2019-12-05 2020-04-10 秒针信息技术有限公司 Page loading method and device, terminal equipment and storage medium
CN111367596A (en) * 2018-12-25 2020-07-03 阿里巴巴集团控股有限公司 Method and device for realizing service data processing and client
CN111666517A (en) * 2020-05-07 2020-09-15 曙光信息产业股份有限公司 Webpage access method and device and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070078810A1 (en) * 2005-09-30 2007-04-05 Keith Hackworth Methods, systems, and products for updating web content
CN101127783A (en) * 2007-09-28 2008-02-20 北京金山软件有限公司 A website buffering method and device
CN111367596A (en) * 2018-12-25 2020-07-03 阿里巴巴集团控股有限公司 Method and device for realizing service data processing and client
CN110287432A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Network information processing method and device and electronic equipment
CN110990736A (en) * 2019-12-05 2020-04-10 秒针信息技术有限公司 Page loading method and device, terminal equipment and storage medium
CN111666517A (en) * 2020-05-07 2020-09-15 曙光信息产业股份有限公司 Webpage access method and device and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961292A (en) * 2021-10-21 2022-01-21 安天科技集团股份有限公司 Security product generation method and device, electronic equipment and storage medium
CN113961292B (en) * 2021-10-21 2024-03-26 安天科技集团股份有限公司 Security product generation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109857755B (en) Rule checking method and device
CA2954294C (en) Website access method, apparatus, and website system
CN109976667B (en) Mirror image management method, device and system
CN103064960B (en) Data base query method and equipment
US9602622B2 (en) Flexible caching of resource oriented web services
WO2017167050A1 (en) Configuration information generation and transmission method, and resource loading method, apparatus and system
CN110597739A (en) Configuration management method, system and equipment
US20140143647A1 (en) Method for improving browser cache by reducing duplicate stored content
CN113420051B (en) Data query method and device, electronic equipment and storage medium
CN107103011B (en) Method and device for realizing terminal data search
CN112579319B (en) Service calling method and device based on LRU Cache optimization
CN112711730A (en) Data caching method and device, storage medium and electronic equipment
CN112433921A (en) Method and apparatus for dynamic point burying
JP7366664B2 (en) Offline briefcase sync
CN109428872B (en) Data transmission method, equipment, server, starting method and system
CN112765503A (en) Static processing method and device for page loading data
CN115842733A (en) Resource sharing method, micro front-end system, application and computer readable storage medium
US20190050266A1 (en) Software application runtime having dynamic evaluation functions and parameters
CN112491943B (en) Data request method, device, storage medium and electronic equipment
US9088463B1 (en) Container contract for data dependencies
CN115858978A (en) Page loading method and device based on updated resources
CN117056033A (en) Data processing method, device, MEC server and storage medium
US10114864B1 (en) List element query support and processing
CN106940660B (en) Method and device for realizing cache
CN113824675B (en) Method and device for managing login state

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