[go: up one dir, main page]

CN114003844A - A method and system for loading page resources - Google Patents

A method and system for loading page resources Download PDF

Info

Publication number
CN114003844A
CN114003844A CN202111295187.9A CN202111295187A CN114003844A CN 114003844 A CN114003844 A CN 114003844A CN 202111295187 A CN202111295187 A CN 202111295187A CN 114003844 A CN114003844 A CN 114003844A
Authority
CN
China
Prior art keywords
data entity
rule
parameter
verification
target resource
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
CN202111295187.9A
Other languages
Chinese (zh)
Other versions
CN114003844B (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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202111295187.9A priority Critical patent/CN114003844B/en
Publication of CN114003844A publication Critical patent/CN114003844A/en
Application granted granted Critical
Publication of CN114003844B publication Critical patent/CN114003844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a page resource loading method and a page resource loading system, which can be applied to the field of mobile interconnection. When an instruction for requesting a target resource sent by a page is received, a check rule contained in a data entity corresponding to the target resource is obtained from a cache, and the check rule is obtained by analyzing a preset rule configuration file; acquiring a parameter set corresponding to each data entity, wherein the parameter set is acquired from a cache or a database based on a preset parameter loading file; for each data entity, verifying a parameter set corresponding to the data entity by using a verification rule contained in the data entity to obtain a verification result; and if all the verification results indicate that the verification is passed, feeding the target resource back to the page, and loading and displaying the target resource on the page. By presetting a rule configuration file and a parameter loading file, all parameter fields needing service logic control are defined, complete service logic control is realized, and the accuracy of the service logic control is improved.

Description

Page resource loading method and system
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a system for loading page resources.
Background
When a user accesses a specified resource (such as a button, a hyperlink and other resources) through a web page, it is required to determine whether the user can access the specified resource or not according to a specific service stage and a specific service state, that is, to perform service logic control on the specified resource.
Currently, the method for performing service logic control on the designated resource accessed by the user is as follows: and performing service logic control on the fields on the webpage by using the page script program. However, this method can only perform service logic control on fields on a web page, cannot perform service logic control on fields not included in the web page, and cannot implement complete service logic control, thereby resulting in poor accuracy of service logic control.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for loading a page resource, so as to solve the problems that the existing service logic control method cannot implement complete service logic control and has poor accuracy.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
the first aspect of the embodiments of the present invention discloses a method for loading page resources, where the method includes:
when an instruction for requesting a target resource sent by a page is received, acquiring a check rule contained in a data entity corresponding to the target resource from a cache, wherein the check rule is obtained by analyzing a preset rule configuration file and is stored in the cache in advance, and each data entity at least contains one check rule;
acquiring a parameter set corresponding to each data entity, wherein the parameter set is acquired from the cache or is acquired from a database based on a preset parameter loading file;
for each data entity, verifying the parameter set corresponding to the data entity by using the verification rule contained in the data entity to obtain a verification result;
and if all the verification results indicate that the verification is passed, feeding the target resource back to the page, and loading and displaying the target resource on the page.
Preferably, when receiving an instruction for requesting a target resource sent by a page, the obtaining, from a cache, a check rule included in a data entity corresponding to the target resource includes:
when an instruction for requesting a target resource sent by a page is received, a Uniform Resource Locator (URL) of the target resource is utilized, and a verification rule contained in a data entity corresponding to the target resource is obtained from a cache.
Preferably, the process of analyzing a preset rule configuration file to obtain the check rule and storing the check rule in the cache includes:
analyzing a preset rule configuration file corresponding to a target resource to obtain a data entity corresponding to the target resource and a verification rule contained in the data entity;
and storing the check rule obtained by analyzing the rule configuration file into a cache.
Preferably, the obtaining of the parameter set corresponding to each data entity includes:
for each data entity, determining whether a parameter set corresponding to the data entity exists in the cache;
if yes, acquiring a parameter set corresponding to the data entity from the cache;
if the data entity does not exist, acquiring the parameter set corresponding to the data entity from a database based on a preset parameter loading file corresponding to the data entity, and storing the parameter set in the cache, wherein the parameter loading file is used for defining the specific content and the acquisition mode of the parameter set corresponding to the data entity.
Preferably, the check rule is a parameter check rule or a script check rule.
Preferably, the parameter set includes a page parameter and/or a database parameter.
Preferably, for each data entity, in the case that the type of the data entity is a script check entity, the script check entity includes a script check rule.
Preferably, the verifying the parameter set corresponding to the data entity by using the verification rule included in the data entity to obtain a verification result for each data entity includes:
for each data entity, if the check rule included in the data entity is a parameter check rule, checking a first designated parameter in the parameter set corresponding to the data entity in combination with the parameter check rule and a regular expression to obtain a check result, wherein the first designated parameter is a parameter designated by the parameter check rule;
and if the verification rule contained in the data entity is a script verification rule, verifying a second specified parameter in the parameter set corresponding to the data entity by combining the script verification rule and a corresponding preset script execution program to obtain a verification result, wherein the second specified parameter is 1 or more parameters specified by the script verification rule.
A second aspect of the present invention discloses a system for loading page resources, where the system includes:
the first obtaining unit is used for obtaining a check rule contained in a data entity corresponding to a target resource from a cache when an instruction for requesting the target resource sent by a page is received, wherein the check rule is obtained by analyzing a preset rule configuration file and is stored in the cache in advance, and each data entity at least contains one check rule;
a second obtaining unit, configured to obtain a parameter set corresponding to each data entity, where the parameter set is obtained from the cache or obtained from a database based on a preset parameter loading file;
the verification unit is used for verifying the parameter set corresponding to the data entity by using the verification rule contained in the data entity aiming at each data entity to obtain a verification result;
and the feedback unit is used for feeding the target resource back to the page if all the verification results indicate that the verification is passed, so that the page loads and displays the target resource.
Preferably, the first obtaining unit is specifically configured to: when an instruction for requesting a target resource sent by a page is received, a Uniform Resource Locator (URL) of the target resource is utilized, and a verification rule contained in a data entity corresponding to the target resource is obtained from a cache.
Based on the above method and system for loading page resources provided by the embodiments of the present invention, the method includes: when an instruction for requesting a target resource sent by a page is received, a check rule contained in a data entity corresponding to the target resource is obtained from a cache; acquiring a parameter set corresponding to each data entity; for each data entity, verifying the parameter set corresponding to the data entity by using the verification rule contained in the data entity to obtain a verification result; and if all the verification results indicate that the verification is passed, feeding the target resource back to the page, and loading and displaying the target resource on the page. In the scheme, the rule configuration file corresponding to the target resource is analyzed in advance to obtain the check rule and the check rule is stored in the cache. When the page requests the target resource, the verification rules contained in the data entity corresponding to the target resource are obtained from the cache, and the parameter set corresponding to each data entity is obtained from the cache or by using the parameter loading file. And verifying the parameter set corresponding to the data entity according to a verification rule contained in the data entity to obtain a verification result. And when all the verification results indicate that the verification is passed, feeding the target resource back to the page for loading and displaying. By presetting a rule configuration file and a parameter loading file, all parameter fields needing service logic control are defined, complete service logic control is realized, and the accuracy of the service logic control is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for loading a page resource according to an embodiment of the present invention;
fig. 2 is a schematic tree diagram of a verification rule obtained by parsing a rule configuration file according to an embodiment of the present invention;
fig. 3 is a flowchart of checking a parameter set of each data entity according to an embodiment of the present invention;
fig. 4 is a block diagram of a loading system of a page resource according to an embodiment of the present invention.
Detailed Description
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.
In this application, 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 identical elements in a process, method, article, or apparatus that comprises the element.
It should be noted that the method and the system for loading the page resources provided by the invention can be used in the field of mobile internet. The above is only an example, and does not limit the application field of the page resource loading method and system provided by the present invention.
As known in the background art, page script programs are commonly used to perform business logic control on fields on web pages. However, this method can only perform service logic control on fields on a web page, cannot perform service logic control on fields not included in the web page, and cannot implement complete service logic control, thereby resulting in poor accuracy of service logic control.
Therefore, the embodiment of the invention provides a method and a system for loading a page resource, which previously analyze a rule configuration file corresponding to a target resource to obtain a check rule and store the check rule in a cache. When the page requests the target resource, the verification rules contained in the data entity corresponding to the target resource are obtained from the cache, and the parameter set corresponding to each data entity is obtained from the cache or by using the parameter loading file. And verifying the parameter set corresponding to the data entity according to a verification rule contained in the data entity to obtain a verification result. And when all the verification results indicate that the verification is passed, feeding the target resource back to the page for loading and displaying. All parameter fields needing to be subjected to service logic control are defined by presetting a rule configuration file and a parameter loading file, so that complete service logic control is realized and the accuracy of the service logic control is improved.
It should be noted that, the loading method of page resources mentioned in the embodiments of the present invention may be used to load resources such as buttons and hyperlinks.
Referring to fig. 1, a flowchart of a method for loading a page resource provided by an embodiment of the present invention is shown, where the method for loading a page resource includes:
step S101: and when an instruction for requesting the target resource sent by the page is received, acquiring the check rule contained in the data entity corresponding to the target resource from the cache.
It should be noted that, for all resources (such as buttons) that need to be subjected to service logic control, a corresponding rule configuration file is configured in advance for each resource subjected to service logic control, and a corresponding relationship between Uniform Resource Locators (URLs) of the resources and the rule configuration file is established. That is, for each resource under the control of the service logic, the corresponding rule configuration file can be obtained through the URL of the resource.
It should be further noted that the URL may also be used to locate the resource, and the rule configuration file defines a data entity corresponding to the resource (i.e., a data entity that the resource needs to be checked) and a check rule included in the data entity. And analyzing the rule configuration file corresponding to each resource to obtain a corresponding check rule, and storing the check rule obtained by analyzing the rule configuration file into a cache, wherein each data entity at least comprises one check rule.
In some embodiments, the verification rule is a parameter verification rule or a script verification rule.
As can be seen from the above, the rule configuration file includes a plurality of check rules, and in order to better understand the contents of the check rules, the following contents in table 1 are used for illustration, and it should be noted that table 1 is used for example only. Table 1 is information included in one check rule, and the resource shown in table 1 is a button.
Table 1:
Figure BDA0003336347530000061
as shown in table 1, the button information is generally defined in the form of a URL, and the button information may be used to indicate one or more resources to which the check rule applies, that is, one check rule may apply to a plurality of resources; the data entity is a set of page parameters or a database entity; parameter checking rules are checking rules for a single parameter field (i.e. field in a data entity), and are usually configured using regular expressions; the script checks the rule: for complex service logic, a script verification rule can be configured, and a preset script execution program is called to verify parameters.
As shown in table 1, the configured parameter check rule or script check rule is a check rule subordinate to the data entity.
It should be noted that the above mentioned parameters are mainly divided into two types, namely page parameters and database parameters; the page parameters are information submitted by a user from a page (such as a website page) or information recorded by the page according to user operation; the database parameter is the existing information loaded from the database according to the information submitted by the user, such as the information of the name of the cardholder of the bank card and the like according to the transaction card number of the user.
When configuring a rule configuration file corresponding to a certain resource, each check rule contained in the rule configuration file is configured in a manner such as table 1.
It can be understood that, for a resource that does not need to be controlled by the service logic, a corresponding rule configuration file may not be configured, that is, any page can load a resource that requests the resource that does not need to be controlled by the service logic, for example, a resource that is refreshed by a transaction page is a resource that does not need to be controlled by the service logic.
After the rule configuration files corresponding to the resources are configured, the rule configuration files need to be analyzed to obtain the check rules, and the check rules are stored in the cache. Taking the analysis of the rule configuration file of a certain resource as an example, the process of analyzing the rule configuration file to obtain the check rule is illustrated with reference to fig. 2.
Analyzing a rule configuration file of a certain resource to obtain a rule set containing a plurality of check rules, as shown in fig. 2, where the check rules in the configuration rule file are stored in a tree MAP structure, and a key (key) of the resource is a URL of the resource, that is, the check rules in the rule configuration file of the resource can be obtained through the URL of the resource.
As shown in FIG. 2, "Button" is the URL of the resource, "Datas" is the set of all Data entities defined by the rule configuration file, the set contains multiple Data entities (i.e., "Data 1", "Data 2", and "JSData") that the resource needs to check, and the key of each Data entity is the entity name; each Data entity contains one or more check rules, such as "Data 1" contains two parameter check rules (i.e., "Chk" in FIG. 2), the key of which is the name of the parameter field being checked.
It is understood that "JSData" is a data entity of the type of Script checking entity, each Script checking entity contains only one Script checking rule (i.e., "Script" in fig. 2), and the key of the Script checking rule is the name of the Script checking entity.
After the rule configuration file of each resource is analyzed, a tree graph such as that shown in fig. 2 can be obtained, and all the check rules included in each obtained rule configuration file are stored in a cache.
As noted above, in some embodiments, for each data entity, where the type of the data entity is a script checking entity, the script checking entity comprises a script checking rule.
In the process of implementing step S101 specifically, when an instruction for requesting a target resource is received from a page, a URL of the target resource is used to obtain a check rule included in a data entity corresponding to the target resource from a cache.
It can be understood that the target resource is a resource that needs to be controlled by the service logic.
In some specific embodiments, the process of storing the check rule corresponding to the target resource in the cache is as follows: analyzing a preset rule configuration file corresponding to the target resource to obtain a data entity corresponding to the target resource and a verification rule contained in the data entity; storing a verification rule obtained by analyzing a rule configuration file corresponding to the target resource into a cache; for a specific storage manner, reference may be made to the above contents, which are not described herein again.
Step S102: and acquiring a parameter set corresponding to each data entity.
It should be noted that, for a data entity whose resource (including a target resource) needs to be checked, a parameter loading file of the data entity is configured in advance, where the parameter loading file defines specific contents and an obtaining manner of a parameter set corresponding to the data entity, that is, the parameter loading file defines: when checking a data entity, it is necessary to obtain which parameters (e.g. database parameters) and the parameter obtaining manner. In other words, the parameter loading file is used to define parameters and a parameter acquiring method required for verifying the service logic parameters of the resources.
It should be further noted that, for the same kind of parameters used by different resources, only one parameter loading file (including the parameter obtaining method) needs to be defined.
The content of the parameter loading file is shown in table 2, where table 2 is only for illustration and is not intended to be specific limiting.
Table 2:
name of field Means of
dataName Data entity name
DaoBean Class of data access
Method Data query method
paraType Type of parameter
paraNames Parameter aliasing
In table 2, the data entity name is: variable names used by the data entities in the caching and checking rules; the data access class and the data query method are used for positioning and querying specific methods when parameters such as database parameters are queried; the parameter type is used for specifying the parameter type for data query; parameter alias, alias of data query parameters in passing process variables.
In the process of implementing step S102 specifically, a parameter set corresponding to each data entity of the target resource is obtained from the cache or is obtained from the database based on a preset parameter loading file, specifically, for each data entity of the target resource, it is determined whether a parameter set corresponding to the data entity exists in the cache; if yes, acquiring a parameter set corresponding to the data entity from the cache; if the parameter set does not exist, the parameter set corresponding to the data entity is acquired from the database and stored in the cache based on a preset parameter loading file corresponding to the data entity, and the parameter loading file is used for defining the specific content and the acquisition mode of the parameter set corresponding to the data entity.
In some embodiments, the set of parameters includes page parameters and/or database parameters.
It should be noted that a parameter set is an aggregate of parameters having a relationship, such as: the consumption card number, amount, transaction time, transaction date, merchant and other parameters belong to the same consumption transaction, and the parameters can be combined together to form a parameter set.
For a certain data entity of a target resource, before checking a parameter set of the data entity, it is required to check whether the parameter set of the data entity is in a cache; if the parameter set exists in the cache, acquiring the parameter set of the data entity from the cache for subsequent verification processes; if the parameter set does not exist in the cache, the parameter set corresponding to the data entity needs to be used for loading a file, reading the parameter set corresponding to the data entity from the database and storing the parameter set in the cache.
Step S103: and aiming at each data entity, verifying the parameter set corresponding to the data entity by using a verification rule contained in the data entity to obtain a verification result.
In the process of implementing step S103 specifically, after acquiring the check rule (1 or more) included in each data entity and acquiring the parameter set corresponding to each data entity; for each data entity, each check rule of the data entity is used for checking the parameter set to obtain a check result, each check rule returns a corresponding check result, and the check result is used for indicating whether the parameter set passes the check of the check rule or not.
For example: in connection with the content shown in fig. 2, a plurality of Data entities such as "Data 1", "Data 2", and "JSData" are included under "Data", and each Data entity includes 1 or more check rules; and for each data entity, verifying the parameter set by using each verification rule of the data entity to obtain a verification result.
In some specific embodiments, for each data entity, if a check rule included in the data entity is a parameter check rule, a first designated parameter in a parameter set corresponding to the data entity is checked in combination with the parameter check rule and a regular expression to obtain a check result, where the first designated parameter is a parameter designated by the parameter check rule; and if the verification rule contained in the data entity is a script verification rule, verifying a second specified parameter in the parameter set corresponding to the data entity by combining the script verification rule and a corresponding preset script execution program to obtain a verification result, wherein the second specified parameter is 1 or more parameters specified by the script verification rule.
That is, when the parameter verification rule is used for verifying the page parameters and the database entity parameters, the parameters and the regular expression are subjected to matching check in a mode of calling the regular expression to execute a program, and whether the parameters pass the verification of the parameter verification rule is determined; for the script verification rule, a preset script execution program can be used for verifying the parameters.
It should be noted that the parameter verification rule is mainly used for verifying 1 parameter, for example: assuming that the parameter verification rule is that the cardholder's age must be 18 years or more in the consumption transaction, the age parameter can be verified by the parameter verification rule.
The script checking rules may be used to check 1 or more parameters, such as: assuming that the script verification rule is that the age of the cardholder in the consumption transaction is required to be more than or equal to 18 years old, the consumption amount of the current day is less than 1 ten thousand, and no bad consumption record exists, the age parameter, the consumption parameter and the consumption record parameter can be verified through the script verification rule.
Step S104: and if all the verification results indicate that the verification is passed, feeding the target resource back to the page, and loading and displaying the target resource on the page.
As can be seen from the above, when the parameter set is verified by using the verification rules of the target resource, each verification rule returns a corresponding verification result, and in the process of the specific implementation step S104, if the verification result returned by any verification rule of the target resource indicates that the verification fails (that is, the parameter set fails to be verified by the verification rules), the service logic control on the target resource is ended, that is, the page is not allowed to load the target resource, and the service logic control on the next resource is entered; if the check results returned by all the check rules of the target resource indicate that the check is passed (that is, the parameter set passes the check of all the check rules), it indicates that the target resource passes the service logic control, allows the page to load the target resource, and feeds the target resource back to the page, so that the page loads and displays the target resource.
It should be noted that the resource requested by the page and needing to be subjected to service logic control is the above-mentioned target resource, and the content such as the content from step S101 to step S104 is executed for each target resource, so as to determine whether each target resource passes through service logic control, and further determine that the page can load and display the target resource.
In the embodiment of the invention, the rule configuration file corresponding to the target resource is analyzed in advance to obtain the check rule and the check rule is stored in the cache. When the page requests the target resource, the verification rules contained in the data entity corresponding to the target resource are obtained from the cache, and the parameter set corresponding to each data entity is obtained from the cache or by using the parameter loading file. And verifying the parameter set corresponding to the data entity according to a verification rule contained in the data entity to obtain a verification result. And when all the verification results indicate that the verification is passed, feeding the target resource back to the page for loading and displaying. By presetting a rule configuration file and a parameter loading file, all parameter fields needing service logic control are defined, complete service logic control is realized, and the accuracy of the service logic control is improved.
To better explain the process of checking the parameter set of each data entity involved in step S103, the content shown in fig. 3 is used for example, and referring to fig. 3, a flowchart of checking the parameter set of each data entity provided in the embodiment of the present invention is shown, and includes the following steps:
step S301: and acquiring the check rule contained in each data entity.
Step S302: and determining a parameter set corresponding to the data entity to be verified.
Step S303: judging whether the parameter set is in a cache or not; if the parameter set is not in the cache, go to step S304; if the parameter set is in the cache, go to step S305;
step S304: loading a file by using a parameter corresponding to the data entity to be verified, acquiring a parameter set, storing the parameter set in a cache, and executing step S305;
step S305: and carrying out single check rule check by using the check rule contained in the data entity to be checked.
In the process of implementing step S305 specifically, a single check rule check is performed on the parameter set by using any check rule (a check rule that does not perform a check on the parameter set) included in the data entity to be checked.
Step S306: and judging whether the verification is passed or not. If not, ending the whole process; if the step S307 is passed.
Step S307: and judging whether a next check rule exists. If there is no next check rule, go to step S308; if there is a next verification rule, the process returns to step S305.
It should be noted that, in the specific implementation step S307, it is specifically determined whether there is any check rule that has not checked the parameter set.
Step S308: and judging whether the next parameter set to be checked still exists. If the next parameter set is to be checked, returning to execute the step S302; and if no next parameter set is to be checked, ending the process.
In the process of implementing step S308, it is specifically determined whether there is a parameter set of a data entity that has not been verified, and if yes, the data entity is used as the data entity to be verified and the step S302 is executed again; if not, the process is finished.
It should be noted that the execution principle of steps S301 to S308 has been described in detail in fig. 1 of the above embodiment of the present invention, and is not described herein again.
Corresponding to the above method for loading a page resource provided in the embodiment of the present invention, referring to fig. 4, an embodiment of the present invention further provides a structural block diagram of a system for loading a page resource, where the system for loading a page resource includes: a first acquisition unit 401, a second acquisition unit 402, a verification unit 403, and a feedback unit 404;
the first obtaining unit 401 is configured to, when receiving an instruction for requesting a target resource sent by a page, obtain, from a cache, a check rule included in a data entity corresponding to the target resource, where the check rule is obtained by analyzing a preset rule configuration file and is stored in the cache in advance, and each data entity includes at least one check rule.
In a specific implementation, the first obtaining unit 401 is specifically configured to: and when an instruction for requesting the target resource sent by the page is received, acquiring a verification rule contained in a data entity corresponding to the target resource from the cache by using the URL of the target resource.
In a specific implementation, the first obtaining unit 401 is further configured to: analyzing a preset rule configuration file corresponding to the target resource to obtain a data entity corresponding to the target resource and a verification rule contained in the data entity; and storing the verification rule obtained by analyzing the rule configuration file into a cache.
In some embodiments, the verification rule is a parameter verification rule or a script verification rule.
In some embodiments, for each data entity, in the case that the type of the data entity is a script check entity, the script check entity comprises a script check rule.
A second obtaining unit 402, configured to obtain a parameter set corresponding to each data entity, where the parameter set is obtained from a cache or obtained from a database based on a preset parameter loading file.
In a specific implementation, the second obtaining unit 402 is specifically configured to: for each data entity, determining whether a parameter set corresponding to the data entity exists in a cache; if yes, acquiring a parameter set corresponding to the data entity from the cache; if the parameter set does not exist, the parameter set corresponding to the data entity is acquired from the database and stored in the cache based on a preset parameter loading file corresponding to the data entity, and the parameter loading file is used for defining the specific content and the acquisition mode of the parameter set corresponding to the data entity.
In some embodiments, the set of parameters includes page parameters and/or database parameters.
The verifying unit 403 is configured to, for each data entity, verify a parameter set corresponding to the data entity by using a verifying rule included in the data entity to obtain a verifying result.
In a specific implementation, the checking unit 403 is specifically configured to: for each data entity, if the check rule contained in the data entity is a parameter check rule, checking a first designated parameter in a parameter set corresponding to the data entity by combining the parameter check rule and a regular expression to obtain a check result, wherein the first designated parameter is a parameter designated by the parameter check rule; and if the verification rule contained in the data entity is a script verification rule, verifying a second specified parameter in the parameter set corresponding to the data entity by combining the script verification rule and a corresponding preset script execution program to obtain a verification result, wherein the second specified parameter is 1 or more parameters specified by the script verification rule.
And a feedback unit 404, configured to feed the target resource back to the page if all the verification results indicate that the verification passes, so that the page loads and displays the target resource.
In the embodiment of the invention, the rule configuration file corresponding to the target resource is analyzed in advance to obtain the check rule and the check rule is stored in the cache. When the page requests the target resource, the verification rules contained in the data entity corresponding to the target resource are obtained from the cache, and the parameter set corresponding to each data entity is obtained from the cache or by using the parameter loading file. And verifying the parameter set corresponding to the data entity according to a verification rule contained in the data entity to obtain a verification result. And when all the verification results indicate that the verification is passed, feeding the target resource back to the page for loading and displaying. By presetting a rule configuration file and a parameter loading file, all parameter fields needing service logic control are defined, complete service logic control is realized, and the accuracy of the service logic control is improved.
In summary, embodiments of the present invention provide a method and a system for loading a page resource, which define all parameter fields that need to be subjected to service logic control by presetting a rule configuration file and a parameter loading file. When the resource is requested, the rule configuration file and the parameter loading file are utilized to verify the parameter set of the data entity to be checked, so that the complete service logic control is realized and the accuracy of the service logic control is improved.
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, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for loading page resources is characterized by comprising the following steps:
when an instruction for requesting a target resource sent by a page is received, acquiring a check rule contained in a data entity corresponding to the target resource from a cache, wherein the check rule is obtained by analyzing a preset rule configuration file and is stored in the cache in advance, and each data entity at least contains one check rule;
acquiring a parameter set corresponding to each data entity, wherein the parameter set is acquired from the cache or is acquired from a database based on a preset parameter loading file;
for each data entity, verifying the parameter set corresponding to the data entity by using the verification rule contained in the data entity to obtain a verification result;
and if all the verification results indicate that the verification is passed, feeding the target resource back to the page, and loading and displaying the target resource on the page.
2. The method according to claim 1, wherein the obtaining, when receiving the instruction for requesting the target resource sent by the page, the check rule included in the data entity corresponding to the target resource from the cache includes:
when an instruction for requesting a target resource sent by a page is received, a Uniform Resource Locator (URL) of the target resource is utilized, and a verification rule contained in a data entity corresponding to the target resource is obtained from a cache.
3. The method according to claim 1, wherein the process of parsing a preset rule configuration file to obtain the verification rule and storing the verification rule in the cache comprises:
analyzing a preset rule configuration file corresponding to a target resource to obtain a data entity corresponding to the target resource and a verification rule contained in the data entity;
and storing the check rule obtained by analyzing the rule configuration file into a cache.
4. The method according to claim 1, wherein the obtaining the parameter set corresponding to each of the data entities comprises:
for each data entity, determining whether a parameter set corresponding to the data entity exists in the cache;
if yes, acquiring a parameter set corresponding to the data entity from the cache;
if the data entity does not exist, acquiring the parameter set corresponding to the data entity from a database based on a preset parameter loading file corresponding to the data entity, and storing the parameter set in the cache, wherein the parameter loading file is used for defining the specific content and the acquisition mode of the parameter set corresponding to the data entity.
5. The method of claim 1, wherein the verification rule is a parameter verification rule or a script verification rule.
6. The method of claim 1, wherein the set of parameters comprises page parameters and/or database parameters.
7. The method according to claim 5, wherein for each of the data entities, the script checking entity contains a script checking rule in case the type of the data entity is a script checking entity.
8. The method according to claim 5, wherein the verifying the parameter set corresponding to the data entity by using the verification rule included in the data entity for each data entity to obtain a verification result includes:
for each data entity, if the check rule included in the data entity is a parameter check rule, checking a first designated parameter in the parameter set corresponding to the data entity in combination with the parameter check rule and a regular expression to obtain a check result, wherein the first designated parameter is a parameter designated by the parameter check rule;
and if the verification rule contained in the data entity is a script verification rule, verifying a second specified parameter in the parameter set corresponding to the data entity by combining the script verification rule and a corresponding preset script execution program to obtain a verification result, wherein the second specified parameter is 1 or more parameters specified by the script verification rule.
9. A system for loading page resources, the system comprising:
the first obtaining unit is used for obtaining a check rule contained in a data entity corresponding to a target resource from a cache when an instruction for requesting the target resource sent by a page is received, wherein the check rule is obtained by analyzing a preset rule configuration file and is stored in the cache in advance, and each data entity at least contains one check rule;
a second obtaining unit, configured to obtain a parameter set corresponding to each data entity, where the parameter set is obtained from the cache or obtained from a database based on a preset parameter loading file;
the verification unit is used for verifying the parameter set corresponding to the data entity by using the verification rule contained in the data entity aiming at each data entity to obtain a verification result;
and the feedback unit is used for feeding the target resource back to the page if all the verification results indicate that the verification is passed, so that the page loads and displays the target resource.
10. The system of claim 9, wherein the first obtaining unit is specifically configured to: when an instruction for requesting a target resource sent by a page is received, a Uniform Resource Locator (URL) of the target resource is utilized, and a verification rule contained in a data entity corresponding to the target resource is obtained from a cache.
CN202111295187.9A 2021-11-03 2021-11-03 A method and system for loading page resources Active CN114003844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111295187.9A CN114003844B (en) 2021-11-03 2021-11-03 A method and system for loading page resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111295187.9A CN114003844B (en) 2021-11-03 2021-11-03 A method and system for loading page resources

Publications (2)

Publication Number Publication Date
CN114003844A true CN114003844A (en) 2022-02-01
CN114003844B CN114003844B (en) 2025-04-18

Family

ID=79926897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111295187.9A Active CN114003844B (en) 2021-11-03 2021-11-03 A method and system for loading page resources

Country Status (1)

Country Link
CN (1) CN114003844B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115965470A (en) * 2022-12-28 2023-04-14 中国建设银行股份有限公司 Wind control verification method and device, electronic equipment and storage medium
CN116684407A (en) * 2023-08-01 2023-09-01 腾讯科技(深圳)有限公司 Resource downloading method, device, equipment and readable storage medium
CN116723228A (en) * 2023-05-26 2023-09-08 中国银行股份有限公司 Unitized configuration file loading method, unitized configuration file loading device, unitized configuration file loading equipment and unitized configuration file loading medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9158845B1 (en) * 2004-04-29 2015-10-13 Aol Inc. Reducing latencies in web page rendering
CN106897433A (en) * 2017-02-27 2017-06-27 福建中金在线信息科技有限公司 A kind of data capture method and device
CN108287757A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 The method and device that a kind of data acquisition, data are shown
CN108319575A (en) * 2018-01-30 2018-07-24 百度在线网络技术(北京)有限公司 A kind of method of calibration of page assembly, device, server and storage medium
CN111026619A (en) * 2019-11-04 2020-04-17 贝壳技术有限公司 Page monitoring method and device and storage medium
CN111371643A (en) * 2020-02-28 2020-07-03 京东数字科技控股有限公司 Authentication method, device and storage medium
CN112769802A (en) * 2020-12-31 2021-05-07 微医云(杭州)控股有限公司 Access verification method and device based on server, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9158845B1 (en) * 2004-04-29 2015-10-13 Aol Inc. Reducing latencies in web page rendering
CN108287757A (en) * 2017-01-09 2018-07-17 阿里巴巴集团控股有限公司 The method and device that a kind of data acquisition, data are shown
CN106897433A (en) * 2017-02-27 2017-06-27 福建中金在线信息科技有限公司 A kind of data capture method and device
CN108319575A (en) * 2018-01-30 2018-07-24 百度在线网络技术(北京)有限公司 A kind of method of calibration of page assembly, device, server and storage medium
CN111026619A (en) * 2019-11-04 2020-04-17 贝壳技术有限公司 Page monitoring method and device and storage medium
CN111371643A (en) * 2020-02-28 2020-07-03 京东数字科技控股有限公司 Authentication method, device and storage medium
CN112769802A (en) * 2020-12-31 2021-05-07 微医云(杭州)控股有限公司 Access verification method and device based on server, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
(美)CRAIG UTLEY著;宫丽杰译: "SQL Server 2000 Web应用开发指南", 31 October 2001, 清华大学出版社, pages: 5 - 6 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115965470A (en) * 2022-12-28 2023-04-14 中国建设银行股份有限公司 Wind control verification method and device, electronic equipment and storage medium
CN116723228A (en) * 2023-05-26 2023-09-08 中国银行股份有限公司 Unitized configuration file loading method, unitized configuration file loading device, unitized configuration file loading equipment and unitized configuration file loading medium
CN116723228B (en) * 2023-05-26 2025-08-29 中国银行股份有限公司 Unitized configuration file loading method, device, equipment and medium
CN116684407A (en) * 2023-08-01 2023-09-01 腾讯科技(深圳)有限公司 Resource downloading method, device, equipment and readable storage medium
CN116684407B (en) * 2023-08-01 2023-10-27 腾讯科技(深圳)有限公司 Resource downloading method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN114003844B (en) 2025-04-18

Similar Documents

Publication Publication Date Title
CN114003844B (en) A method and system for loading page resources
US11880821B2 (en) Systems and methods for automatically identifying a checkout webpage and injecting a virtual token
US20090006646A1 (en) System and Method of Auto Populating Forms on Websites With Data From Central Database
CN108804548B (en) Test data query method, device, computer equipment and storage medium
US20110047146A1 (en) Systems, Methods, and Computer Program Product for Mobile Service Data Browser
CN108595681B (en) Method, device and system for displaying form
CN101989294B (en) Distributed file resolving method and resolving system
CN106844730B (en) Method and device for displaying file content
WO2020088104A1 (en) Method and apparatus for performing block chain record-keeping on webpage by means of file acquisition
US9454535B2 (en) Topical mapping
CN101523393A (en) Locally storing web-based database data
CN111563051A (en) Crawler-based data verification method and device, computer equipment and storage medium
CN106681921A (en) Method and device for achieving data parameterization
CN110119489A (en) The automatic register method of information, device, computer equipment and storage medium
US9355269B2 (en) Method and system for managing uniquely identifiable bookmarklets
CN108846741B (en) Payment processing method and approval document processing method
CN108388796B (en) Dynamic domain name verification method, system, computer equipment and storage medium
KR20120039397A (en) Business information providing system and method for providing business information using the same
CN109447806B (en) Front-end control method and device, storage medium and electronic equipment
US6728703B1 (en) System and method for processing movement/delta metrics
US20020188541A1 (en) Methods and systems for soliciting, submitting and managing appraisals
CN114282093A (en) Search engine performance evaluation method, device, equipment and storage medium
CN113283797A (en) Business approval method, device, equipment and storage medium
JP7449886B2 (en) Information sharing support method and information sharing support device
RU2741869C1 (en) Automated system for searching, loading, storing data and generating legal documents

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