CN108874304B - Rule configuration method and device of cache system - Google Patents

Rule configuration method and device of cache system Download PDF

Info

Publication number
CN108874304B
CN108874304B CN201810276686.5A CN201810276686A CN108874304B CN 108874304 B CN108874304 B CN 108874304B CN 201810276686 A CN201810276686 A CN 201810276686A CN 108874304 B CN108874304 B CN 108874304B
Authority
CN
China
Prior art keywords
rule
data
cache
cache system
matching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810276686.5A
Other languages
Chinese (zh)
Other versions
CN108874304A (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810276686.5A priority Critical patent/CN108874304B/en
Publication of CN108874304A publication Critical patent/CN108874304A/en
Application granted granted Critical
Publication of CN108874304B publication Critical patent/CN108874304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a rule configuration method and a rule configuration device of a cache system, wherein the method and the device are used for judging whether a cache rule exists in the cache system; if so, performing data matching from the cache system according to the cache rule; if not, acquiring data and rule data from the outside; and storing the data and the rule data into a cache system. Through the process, the cache rule in the cache system can be automatically updated, and the manual configuration of the cache rule is not needed again, so that the development cost is reduced.

Description

Rule configuration method and device of cache system
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and an apparatus for rule configuration of a cache system.
Background
The caching technology is to store the network content which needs to be accessed frequently in a system which is close to the user and has a high access speed, so as to improve the access speed of the network content. The cache system is a server system storing frequently accessed contents, and can provide better access effect than the network contents are stored on a Web server.
In the existing cache system, if the parameter on which the access result of the data source depends changes, the cache configuration must be manually adjusted, and then the cache configuration is redeployed for operation, thereby requiring a large development cost. For example, the request parameters of one data source include A, B, C, D four parameters, the returned result at the beginning only needs to be related to A, B two parameters, and the matching is only needed to be performed according to A, B parameters during the caching; when the data source adjusts the policy afterwards, if the returned result needs to be related to A, B, C, the configuration of the cache must be modified, A, B, C parameters must be modified, and then the operation must be redeployed.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for rule configuration of a cache system, so as to solve the problem of high development cost of the existing cache system.
In order to solve the above problems, the present invention discloses a rule configuration method for a cache system, which is characterized by specifically comprising the following steps:
judging whether a cache rule exists in the cache system;
if the cache rule exists, data matching is carried out from a cache system according to the cache rule;
if the cache rule does not exist, acquiring data and rule data from the outside;
and storing the data and the rule data into the cache system.
Optionally, the storing the data and the rule data into the cache system includes:
judging whether the cache rule needs to be updated or not;
if so, updating the rule data and storing the updated rule data into the cache system.
Optionally, the performing data matching from the cache system according to the cache rule includes:
fetching data from the cache system;
transforming the data into a hash code according to the caching rule;
matching the hash codes according to the caching rule;
if the matching is successful, returning a matching value;
and if the matching fails, executing the step of acquiring the data and the rule data from the outside.
Also provided is a rule configuration device of a cache system, specifically comprising:
the rule judging module is used for judging whether a cache rule exists in the cache system;
the data matching module is used for matching data from a cache system according to the cache rule if the cache rule exists;
the data acquisition module is used for acquiring data and rule data from the outside if the cache rule does not exist;
and the data storage module is used for storing the data and the rule data into the cache system.
Optionally, the data storage module includes:
the condition judging unit is used for judging whether the cache rule needs to be updated or not;
and the first processing unit is used for updating the rule data and storing the updated rule data into the cache system if the rule data is positive.
Optionally, the data matching module includes:
the data fetching unit is used for fetching data from the cache system;
the code conversion unit is used for converting the data into a hash code according to the cache rule;
the code matching unit is used for matching the hash code according to the cache rule, and if the hash code fails, the code matching unit controls the data acquisition module to execute data acquisition and rule data acquisition operations from the outside;
and the numerical value returning unit is used for returning the matching value if the matching is successful.
The technical scheme can show that the invention provides a rule configuration method and a device of a cache system, and the method and the device are used for specifically judging whether a cache rule exists in the cache system; if so, performing data matching from the cache system according to the cache rule; if not, acquiring data and rule data from the outside; and storing the data and the rule data into the cache system. Through the process, the cache rule in the cache system can be automatically updated, and the manual configuration of the cache rule is not needed again, so that the development cost is reduced.
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 some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating steps of a method for configuring a rule of a cache system according to an embodiment of the present invention;
fig. 2 is a block diagram of a rule configuration apparatus of a cache system 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.
Example one
Fig. 1 is a flowchart illustrating steps of a method for configuring a rule of a cache system according to an embodiment of the present invention.
Referring to fig. 1, the rule configuration method provided in this embodiment is applied to a buffer system, and is used to automatically configure a buffer rule of the buffer system, where the specific rule configuration method includes the following steps:
s101: and judging whether a cache rule exists in the cache system.
That is, when the external system searches and matches data in the cache system, the external system first obtains the preset cache rule and corresponding data from the cache system to determine whether the corresponding cache rule exists. And executing corresponding operation according to whether the corresponding cache rule exists. The cache rule refers to a specific rule for searching, matching or obtaining data in a cache system, and if only data related to A, B parameters are searched, only A, B parameters are configured; if data related to the A, B, C parameters is found, the A, B, C parameters need to be reconfigured.
S102: and if so, matching data from the cache system according to the cache rule.
Namely, if the cache rule can be successfully acquired from the cache system, data search or data matching is performed from the cache system according to the cache rule. The specific process of data search or data matching from the cache system in the present application is as follows:
firstly, data is taken from a cache system; then, converting the acquired data into a hash code (HashCode) according to the acquired caching rule; then matching the hash codes according to a caching rule; if the matching is successful, returning a matching value; if the failure occurs, the next step is performed, namely, rule data is acquired from the outside. The acquiring of the rule data from the outside may include acquiring the corresponding rule data in a preset path or passively accepting rule data incoming from the outside.
S103: if not, the data and rule data are obtained from the outside.
That is, if the corresponding cache rule cannot be obtained from the cache system, data and rule data for specifying the cache rule of the cache system, that is, the cache rule of the cache system is specified, are obtained from the outside. The method specifically comprises the following operations:
firstly, judging whether a cache rule changes; if the rule data are changed, updating the rule data and storing the updated cache data into the cache system, wherein the updating means that the original rule data are covered by new rule data, and the new rule data prescribe a new cache rule, so that the system can operate according to the new cache rule when caching the data; on the contrary, if there is no change, the acquired data and rule data are directly stored in the cache system, and the new rule data is made unavailable.
S104: and storing the data and the rule data into a cache system.
After acquiring corresponding rule data from the outside, the rule data is stored in the cache system, so that a user can search data or match data according to the cache rule specified by the rule data when the user requests the data.
As can be seen from the foregoing technical solutions, the present embodiment provides a rule configuration method for a cache system, where the method specifically includes determining whether a cache rule exists in the cache system; if yes, performing data matching from the cache system according to the cache rule; if not, acquiring data and rule data from the outside; and storing the data and the rule data into a cache system. Through the process, the cache rule in the cache system can be automatically updated, and the manual configuration of the cache rule is not needed again, so that the development cost is reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Example two
Fig. 2 is a block diagram of a rule configuration apparatus of a cache system according to an embodiment of the present invention.
Referring to fig. 2, the rule configuration apparatus provided in this embodiment is applied to a cache system, and is configured to automatically configure a cache rule of the cache system, where the rule configuration apparatus includes a rule determining module 10, a data matching module 20, a data obtaining module 30, and a data storing module 40.
The rule judging module is used for judging whether a cache rule exists in the cache system.
That is, when the external system searches and matches data in the cache system, the external system first obtains preset data and cache rules from the cache system to determine whether corresponding cache rules exist therein. And executing corresponding operation according to whether the corresponding cache rule exists.
And the data matching module is used for matching data from the cache system according to the cache rule if the cache rule exists in the cache system.
Namely, if the cache rule can be successfully acquired from the cache system, data search or data matching is performed from the cache system according to the cache rule. The module comprises a data fetch unit 21, a code conversion unit 22, a code matching unit 23 and a value return unit 24.
The data fetching unit is used for fetching data from the cache system; the code conversion unit is used for converting the acquired data into a HashCode (HashCode) according to the acquired caching rule; the code matching unit is used for matching the hash code according to the cache rule, and if the hash code fails, the next step is executed, namely rule data are obtained from the outside; and the numerical value returning unit is used for returning the matching value if the matching is successful.
The data acquisition module is used for acquiring data and rule data from the outside if the cache rule does not exist in the cache system.
That is, if the corresponding cache rule cannot be obtained from the cache system, data and rule data for specifying the cache rule of the cache system, that is, the cache rule of the cache system is specified, are obtained from the outside. The module includes a condition judgment unit 31, a first processing unit number 32, and a second processing unit 33.
The condition judging unit is used for judging whether the cache rule needs to be updated or not; the first processing unit is used for updating the rule data if the cache rule needs to be updated, and storing the updated cache data into the cache system; the second processing unit is used for directly storing the acquired rule data into the cache system if the cache rule does not need to be updated.
The data storage module is used for storing the data and the rule data into the cache system.
After acquiring corresponding rule data from the outside, the rule data is stored in the cache system, so that a user can search data or match data according to the cache rule specified by the rule data when the user requests the data.
As can be seen from the foregoing technical solutions, the present embodiment provides a rule configuration method for a cache system, where the method specifically includes determining whether a cache rule exists in the cache system; if so, performing data matching from the cache system according to the cache rule; if not, acquiring data and rule data from the outside; and storing the data and the rule data into a cache system. Through the process, the cache rule in the cache system can be automatically updated, and the manual configuration of the cache rule is not needed again, so that the development cost is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of 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, embodiments of 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.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (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 terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, 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 terminal 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 terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The technical solutions provided by the present invention are described in detail above, and the principle and the implementation of the present invention are explained in this document by applying specific examples, and the descriptions of the above examples are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (6)

1. A rule configuration method of a cache system is characterized by comprising the following steps:
judging whether a cache rule exists in the cache system; the caching rules include: specific rules for data searching, matching or obtaining in the cache system;
if the cache rule exists, data matching is carried out from a cache system according to the cache rule;
if the cache rule does not exist, acquiring data and rule data from the outside, including: judging whether the rule data is changed; if there is a change, updating the rule data and storing the updated rule data in the cache system, the rule data specifying a new cache rule; if the rule data are not changed, the acquired data and the rule data are directly stored in the cache system, and the rule data acquired from the outside are in an unavailable state;
and storing the data and the rule data into the cache system.
2. The rule configuration method of claim 1 wherein said storing said data and said rule data into said cache system comprises:
judging whether the cache rule needs to be updated or not;
if so, updating the rule data and storing the updated rule data into the cache system.
3. The method for rule configuration according to claim 1, wherein the matching data from the cache system according to the cache rule comprises:
fetching data from the cache system;
transforming the data into a hash code according to the caching rule;
matching the hash codes according to the caching rule;
if the matching is successful, returning a matching value;
and if the matching fails, executing the step of acquiring the data and the rule data from the outside.
4. A rule configuration device of a cache system is characterized by specifically comprising:
the rule judging module is used for judging whether a cache rule exists in the cache system; the caching rules include: specific rules for data searching, matching or obtaining in the cache system;
the data matching module is used for matching data from a cache system according to the cache rule if the cache rule exists;
a data obtaining module, configured to obtain data and rule data from the outside if the caching rule does not exist, including: judging whether the rule data is changed; if there is a change, updating the rule data and storing the updated rule data in the cache system, the rule data specifying a new cache rule; if the rule data are not changed, the acquired data and the rule data are directly stored in the cache system, and the rule data acquired from the outside are in an unavailable state;
and the data storage module is used for storing the data and the rule data into the cache system.
5. The rule configuration apparatus of claim 4 wherein the data storage module comprises:
the condition judging unit is used for judging whether the cache rule needs to be updated or not;
and the first processing unit is used for updating the rule data and storing the updated rule data into the cache system if the rule data is positive.
6. The rule configuration apparatus of claim 4 wherein the data matching module comprises:
the data fetching unit is used for fetching data from the cache system;
the code conversion unit is used for converting the data into a hash code according to the cache rule;
the code matching unit is used for matching the hash code according to the cache rule, and if the hash code fails, the code matching unit controls the data acquisition module to execute data acquisition and rule data acquisition operations from the outside;
and the numerical value returning unit is used for returning the matching value if the matching is successful.
CN201810276686.5A 2018-03-30 2018-03-30 Rule configuration method and device of cache system Active CN108874304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810276686.5A CN108874304B (en) 2018-03-30 2018-03-30 Rule configuration method and device of cache system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810276686.5A CN108874304B (en) 2018-03-30 2018-03-30 Rule configuration method and device of cache system

Publications (2)

Publication Number Publication Date
CN108874304A CN108874304A (en) 2018-11-23
CN108874304B true CN108874304B (en) 2021-06-22

Family

ID=64326432

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810276686.5A Active CN108874304B (en) 2018-03-30 2018-03-30 Rule configuration method and device of cache system

Country Status (1)

Country Link
CN (1) CN108874304B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488179A (en) * 2019-01-28 2020-08-04 上海哔哩哔哩科技有限公司 Rule system and construction method thereof, business system and application method thereof
CN110968603B (en) * 2019-11-29 2023-07-04 中国银行股份有限公司 Data access method and device
CN112783909B (en) * 2021-01-29 2023-09-26 宁夏航天信息有限公司 Data updating method, device, terminal equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6347358B1 (en) * 1998-12-22 2002-02-12 Nec Corporation Disk control unit and disk control method
CN102902730A (en) * 2012-09-10 2013-01-30 新浪网技术(中国)有限公司 Method and device for reading data based on data cache
CN103019964A (en) * 2012-12-24 2013-04-03 北京搜狐新媒体信息技术有限公司 Cache data access method and data cache system
CN103763371A (en) * 2014-01-21 2014-04-30 深圳市脉山龙信息技术股份有限公司 Method for dynamically controlling mobile end application cache

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096712A (en) * 2011-01-28 2011-06-15 深圳市五巨科技有限公司 Method and device for cache-control of mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6347358B1 (en) * 1998-12-22 2002-02-12 Nec Corporation Disk control unit and disk control method
CN102902730A (en) * 2012-09-10 2013-01-30 新浪网技术(中国)有限公司 Method and device for reading data based on data cache
CN103019964A (en) * 2012-12-24 2013-04-03 北京搜狐新媒体信息技术有限公司 Cache data access method and data cache system
CN103763371A (en) * 2014-01-21 2014-04-30 深圳市脉山龙信息技术股份有限公司 Method for dynamically controlling mobile end application cache

Also Published As

Publication number Publication date
CN108874304A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
US8782635B2 (en) Reconfiguration of computer system to allow application installation
CN107451181B (en) Page rendering method and device
KR102096249B1 (en) Processing mutations for a remote database
CN108874304B (en) Rule configuration method and device of cache system
CN107766343B (en) Data storage method and device and storage server
US9507761B2 (en) Comparing webpage elements having asynchronous functionality
CN109450969B (en) Method and device for acquiring data from third-party data source server and server
US20140108469A1 (en) Software discovery with variable scan frequency
US10558571B2 (en) Second level database file cache for row instantiation
EP3107010B1 (en) Data integration pipeline
CN105635208A (en) Business processing method and device
US10394820B2 (en) Constructing and querying a bloom filter to detect the absence of data from one or more endpoints
CN105912357B (en) Starting method and device of hybrid application
US10152490B2 (en) Sequential replication with limited number of objects
CN111866197B (en) Domain name resolution method and system
CN110955460A (en) Service process starting method and device, electronic equipment and storage medium
CN108337317B (en) Method and device for processing route request
US20160182605A1 (en) Dynamic Content Aggregation
CN109429100B (en) Method, device and system for storing page path
CN107547607B (en) Cluster migration method and device
CN110717036A (en) Method and device for removing duplication of uniform resource locator and electronic equipment
CN110442433B (en) Method, equipment and storage medium for executing SQL (structured query language) task
US11003439B2 (en) Incorporating version control into packaging
US11153366B2 (en) Lightweight web font customization integrated with glyph demanding assessment
US10795875B2 (en) Data storing method using multi-version based data structure

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