CN111400350B - Configuration data reading method, system, electronic device and storage medium - Google Patents

Configuration data reading method, system, electronic device and storage medium Download PDF

Info

Publication number
CN111400350B
CN111400350B CN202010177947.5A CN202010177947A CN111400350B CN 111400350 B CN111400350 B CN 111400350B CN 202010177947 A CN202010177947 A CN 202010177947A CN 111400350 B CN111400350 B CN 111400350B
Authority
CN
China
Prior art keywords
configuration data
reading
cache
server
configuration
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
CN202010177947.5A
Other languages
Chinese (zh)
Other versions
CN111400350A (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.)
Shanghai Ctrip Business Co Ltd
Original Assignee
Shanghai Ctrip Business 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 Shanghai Ctrip Business Co Ltd filed Critical Shanghai Ctrip Business Co Ltd
Priority to CN202010177947.5A priority Critical patent/CN111400350B/en
Publication of CN111400350A publication Critical patent/CN111400350A/en
Application granted granted Critical
Publication of CN111400350B publication Critical patent/CN111400350B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of data processing, and provides a configuration data reading method, a system, electronic equipment and a storage medium. The configuration data reading method comprises the following steps: the interface server responds to the configuration data reading request and reads the configuration data from the local cache; if the configuration data matched with the configuration data reading request is read from the local cache, returning the configuration data read from the local cache; if the local cache has no configuration data matched with the configuration data reading request, reading the configuration data from the distributed cache, including: searching a readable cache server through a snapshot service configured in the distributed cache; reading configuration data matched with the configuration data reading request from the readable cache server; and returning the configuration data read from the readable cache server. The invention can realize the efficient reading of the variable relation configuration data and meet the reading requirements of real-time property, consistency, high concurrency, high performance and high availability.

Description

Configuration data reading method, system, electronic device and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, a system, an electronic device, and a storage medium for reading configuration data.
Background
The internet industry has many business demands for efficient reading of configuration data. For example, a reader of an A/B experiment needs to read configuration data of the A/B experiment in order to split each version; an application program (APP) needs to read configuration data of different user preferences in order to perform personalized main interface presentation.
These business demands are usually realized by adopting an SOA interface and a Redis database, the reader calls the SOA interface, and the SOA interface directly reads the configuration data in the Redis database and returns the configuration data to the reader. This design can essentially guarantee real-time reading of configuration data, but there are two general disadvantages.
Firstly, efficient reading of relational configuration data cannot be supported, independent configuration data in a Redis database needs to be read out, and then association is carried out in an SOA interface. Therefore, the efficiency of the SOA interface is affected, and when the business changes, the SOA interface needs to recode the association relations and release the association relations to production to be effective;
secondly, the Redis database can expand the data storage nodes under the condition of data growth, but the Hash marking the positions of the data storage nodes needs to be calculated again. Therefore, some configuration data cannot be accessed under the condition of capacity expansion, and when the configuration data increment is large, a longer time is needed for writing the Redis database, so that different configuration data can be read by each node deploying the SOA interface at the same time, and data inconsistency is generated.
It should be noted that the information disclosed in the foregoing background section is only for enhancement of understanding of the background of the invention and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
In view of the above, the present invention provides a configuration data reading method, system, electronic device, and storage medium, which can realize efficient reading of variable relational configuration data.
One aspect of the present invention provides a configuration data reading method, including the steps of: the interface server responds to the configuration data reading request and reads the configuration data from the local cache; if the configuration data matched with the configuration data reading request is read from the local cache, returning the configuration data read from the local cache; if the local cache has no configuration data matched with the configuration data reading request, the interface server reads the configuration data from the distributed cache, and the method comprises the following steps: searching a readable cache server through a snapshot service configured in the distributed cache; reading configuration data matched with the configuration data reading request from the readable cache server; and returning the configuration data read from the readable cache server.
In some embodiments, the configuration data reading method further includes a step of periodically reading the full amount of configuration data, the step of periodically reading the full amount of configuration data including: the snapshot service periodically correlates all configuration data in the database cluster and writes the correlated configuration data into a configuration wide table of the database cluster; and the snapshot service reads the total configuration data from the configuration wide table and writes the total configuration data into the distributed cache.
In some embodiments, the step of writing to the distributed cache comprises: searching a writable cache server in the distributed cache; clearing the writable cache server, and writing the read full configuration data into the writable cache server; and marking the writable cache server as an updated readable cache server after the writing is completed, and marking the readable cache server as the updated writable cache server.
In some embodiments, the step of periodically reading the full amount of configuration data further comprises: and the interface server periodically reads configuration data corresponding to the interface server from the readable cache server and updates the configuration data into the local cache.
In some embodiments, the configuration data reading method further includes a step of reading the incremental configuration data in real time, the step of reading the incremental configuration data in real time including: when the database cluster receives the newly added configuration data, a configuration change notification carrying the newly added configuration data is initiated; the distributed cache writes the newly added configuration data into a configuration wide table of the database cluster in an associated manner through the snapshot service according to the configuration change notification; and the snapshot service reads the incremental configuration data from the configuration wide table and writes the incremental configuration data into the distributed cache.
In some embodiments, the step of reading the delta configuration data in real time further comprises: when the distributed cache receives the incremental configuration data, a configuration change notification carrying the incremental configuration data is initiated; and the interface server reads the incremental configuration data from the distributed cache according to the configuration change notification and writes the incremental configuration data into the local cache.
In some embodiments, in the step of reading the incremental configuration data in real time, the incremental configuration data is acquired by using a long polling mode.
In some embodiments, the distributed cache includes a plurality of distributed cache servers, the snapshot service is configured on one cache server, and when the cache server configuring the snapshot service fails, the snapshot service is automatically started on another cache server of the distributed cache in real time.
In some embodiments, the interface server is configured in an interface service cluster, where the interface service cluster includes a plurality of distributed interface servers, and each interface server responds to a configuration data reading request corresponding to the interface server.
Another aspect of the present invention provides a configuration data reading system including an interface server and a distributed cache, the interface server including: the read request response module is used for responding to the read request of the configuration data and reading the configuration data from the local cache; the local cache reading module is used for returning the configuration data read from the local cache when the configuration data matched with the configuration data reading request is read from the local cache; and a distributed cache reading module, configured to read configuration data from a distributed cache when the local cache has no configuration data matching the configuration data reading request, where the distributed cache reading module includes: searching a readable cache server through a snapshot service configured in the distributed cache; reading configuration data matched with the configuration data reading request from the readable cache server; and returning the configuration data read from the readable cache server.
Yet another aspect of the present invention provides an electronic device, comprising: a processor; a memory having stored therein executable instructions of the processor; wherein the processor is configured to perform the steps of the configuration data reading method of any of the embodiments described above via execution of the executable instructions.
A further aspect of the present invention provides a computer-readable storage medium storing a program which, when executed, implements the steps of the configuration data reading method described in any of the above embodiments.
Compared with the prior art, the invention has the beneficial effects that at least:
when receiving a configuration data reading request, the interface server searches the configuration data from the local cache to improve the response speed and realize efficient reading of the configuration data;
the snapshot service ensures that configuration data is read from the readable cache server when the interface server accesses the distributed cache, ensures complete reading of the configuration data, and ensures consistency of the configuration data.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is evident that the figures described below are only some embodiments of the invention, from which other figures can be obtained without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram illustrating an implementation architecture of a configuration data reading method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing steps of a configuration data reading method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram showing steps for periodically reading full configuration data in an embodiment of the present invention;
FIG. 4 is a schematic diagram of an implementation scenario in which full configuration data is periodically read in an embodiment of the present invention;
FIG. 5 is a schematic diagram showing steps for reading incremental configuration data in real time in an embodiment of the present invention;
FIG. 6 is a schematic diagram of an implementation scenario of reading incremental configuration data in real time in an embodiment of the present invention;
FIG. 7 is a block diagram of a configuration data reading system according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention; and
fig. 9 shows a schematic configuration of a computer-readable storage medium in an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus a repetitive description thereof will be omitted.
Fig. 1 shows an implementation architecture of a configuration data reading method in an embodiment, and referring to fig. 1, the implementation architecture for implementing the configuration data reading method includes an interface service layer 11 that provides an interface service, a distributed cache 12 that provides a distributed cache service, and a database cluster 13 that stores configuration data. The interface service layer 11 has a plurality of interface service clusters 110 disposed therein, and each interface service cluster 110 includes a plurality of distributed interface servers 111 therein. In this embodiment, the interface server 111 is based on SOA construction, and the SOA (Service-oriented architecture) uses interfaces to perform data interaction, so that the method has the advantages of agility, consistency, flexibility and the like. The interface service of the interface service layer 11 is distributed, and has high availability functions of fusing, degrading, double-activity in different places, automatic capacity reduction and expansion and the like. Distributed cache 12 has disposed therein a plurality of distributed cache clusters 120, each distributed cache cluster 120 including a plurality of cache servers 122. In this embodiment, the Cache server 122 is a Cache memory, and the platform layer of the distributed Cache 12 is located at the lower layer of the interface service layer 11, and the distributed Cache 12 has high availability functions such as data consistency, SQL query, remote dual activity, automatic capacity reduction and expansion, and the like. The database cluster 13 is disposed below the platform layer of the distributed cache 12, and includes a plurality of database servers 130, where the database cluster 13 has a disaster recovery function.
In a specific implementation scenario, the implementation architecture for implementing the configuration data reading method may be deployed on a background service of the a/B experiment splitter, and is configured to receive an a/B experiment splitting request, and efficiently read configuration data.
Fig. 2 shows main steps of a configuration data reading method in an embodiment, and the configuration data reading method in this embodiment may be implemented by the implementation architecture shown in fig. 1. Referring to fig. 2, the configuration data reading method in this embodiment mainly includes: in step S220, the interface server reads the configuration data from the local cache in response to the configuration data reading request; in step S230, if the configuration data matching the configuration data reading request is read from the local cache, returning the configuration data read from the local cache; in step S240, if there is no configuration data matching the configuration data reading request in the local cache, the interface server reads the configuration data from the distributed cache, which specifically includes: step S2402, searching a readable cache server through a snapshot service configured in the distributed cache; step S2404, reading the configuration data matched with the configuration data reading request from the readable cache server; and step S2406, returning the configuration data read from the readable cache server.
Configuration data is usually non-massive data with fewer writing times and more reading times, and the configuration data which a data reader wants to read is fixed regardless of the change of the relationship of the configuration data. For example, configuration data of a/B experiments, and no matter how the split ratio, position, index, etc. of the experiments are changed, the data reader of the a/B experiments only needs to know to which version, i.e., which experimental group, the a/B experiment number and the user ID are split. Therefore, the SOA interface of the configuration data can be fixed, and is not required to be changed after being on line, so that each interface server can respond to the corresponding configuration data reading request.
When the interface server receives the configuration data reading request, the configuration data is searched from a local cache (Localcache) to improve the response speed and realize efficient reading of the configuration data. The local cache has a certain storage limit, and can store relatively active configuration data according to a certain rule so as to improve the reading speed of the common configuration data. According to the memory usage of the interface server, if the configuration data is not much, all the configuration data can be stored in the local cache. The local cache of the interface server may employ a Copy-On-Write mechanism to efficiently handle Write-less read-more configuration data access requests. If the local cache has no matched configuration data, the configuration data is read from the distributed cache, and snapshot service deployed in the distributed cache ensures that the configuration data is read from the readable cache server when the interface server accesses the distributed cache, so that the complete reading of the configuration data is ensured, and the consistency of the configuration data is ensured. The snapshot service (snapshuthservice) is configured on one cache server of the distributed cache, and when the cache server fault configuring the snapshot service is pulled out of the distributed cache, the snapshot service is automatically started on the other cache server in real time.
The initiating client of the configuration data reading request has high requirement on the consistency of the configuration data, and the condition that different clients read different configuration data at the same time cannot occur, so that the interface server and the distributed cache are subjected to consistency design through the snapshot service to meet the requirement of consistency reading of the configuration data. The interface server periodically reads the configuration data from the lower layer in a pull mode, and the lower layer notifies the upper layer in a push mode when the configuration data is changed, so that the upper layer can read the configuration data in real time.
Fig. 3 illustrates main steps of periodically reading the full-scale configuration data in the embodiment, referring to fig. 3, the configuration data reading method further includes step S300 of periodically reading the full-scale configuration data, and the process of periodically reading the full-scale configuration data specifically includes: step S320, the snapshot service periodically correlates all configuration data in the database cluster and writes the correlated configuration data into a configuration wide table of the database cluster; and step S340, the snapshot service reads the total configuration data from the configuration wide table and writes the total configuration data into the distributed cache. Wherein the step of writing into the distributed cache comprises: step S3402, searching a writable cache server in the distributed cache; step S3404, emptying the writable cache server, and writing the read full configuration data into the writable cache server; and step S3406, marking the writable cache server as an updated readable cache server after the writing is completed, and marking the readable cache server as the updated writable cache server.
Specifically, referring to the implementation scenario of periodically reading the full amount of configuration data shown in fig. 4, it is a process of reading the configuration data in a pull mode. The snapshot service 121 deployed on the platform layer of the distributed cache 12 associates all configuration data at intervals of, for example, 5 minutes, writes the configuration data into the configuration wide table of the database cluster 13, and stores the configuration data and the association relationship of the configuration data in the configuration wide table. The snapshot service 121 then reads the full amount of configuration data from the configuration wide table and writes it to the distributed cache 12. The snapshot service 121 will empty the writable cache server 122a in the distributed cache 12, then write the full configuration data of the configuration wide table, mark the current writable cache server 122a as an updated readable cache server after the writing is completed, and mark the current readable cache server 122b as an updated writable cache server. Thus, the next time an interface server 111a accesses the distributed cache 12, the latest configuration data can be read from the updated readable cache server. In the process of writing in the writable cache server 122a, the interface server 111a accesses the current readable cache server 122b, so that the read configuration data cannot be inconsistent due to writing. The snapshot service 121 can allow the batch configuration data to be used by the interface servers under the condition of completing association and writing, so that each interface server can read consistent configuration data at the same time.
Further, referring to fig. 3, the step S300 of periodically reading the full configuration data further includes: in step S360, the interface server periodically reads the configuration data of the corresponding interface server from the readable cache server, and updates the configuration data to the local cache. The periodic reading of configuration data by the interface server and the periodic reading of data by the distributed cache may be performed simultaneously or separately, depending on the respective cycle time. In one embodiment, referring to FIG. 4, the interface server 111a actively pulls configuration data from the distributed cache 12 into the local cache 1110 every 5 minutes from the full point, so that even if the interface server 111a is pulled out of and into the interface service cluster, the interface server 111a reads configuration data from the distributed cache 12 at the same time as other interface servers at a point in time, and consistency of the configuration data is ensured.
In the above embodiment of periodically reading the full configuration data, the configuration data is periodically read to prevent the downstream data from being impacted, such as buffer penetration, buffer breakdown, buffer avalanche, etc.; and the configuration data itself is not much altered, so real-time full-scale reading is not required. In addition, if the configuration data in the distributed cache is not backed up to the permanent storage device, the service is completely failed when the local cache of the interface server fails, so the configuration wide table also has the function of allowing the interface server to have a record of recovering the data from the configuration wide table of the database cluster and further recovering the service.
Fig. 5 illustrates main steps of reading incremental configuration data in real time, and referring to fig. 5, the configuration data reading method further includes step S500 of reading the incremental configuration data in real time, where a process of reading the incremental configuration data in real time specifically includes: step S520, when the database cluster receives the newly added configuration data, a configuration change notification carrying the newly added configuration data is initiated; step S530, the distributed cache writes the newly added configuration data into a configuration wide table of the database cluster in an associated manner through a snapshot service according to the configuration change notification; and step S540, the snapshot service reads the incremental configuration data from the configuration wide table and writes the incremental configuration data into the distributed cache. Further, the process of reading the incremental configuration data in real time further includes: step S550, when the distributed cache receives the incremental configuration data, a configuration change notification carrying the incremental configuration data is initiated; and step S560, the interface server reads the incremental configuration data from the distributed cache and writes the incremental configuration data into the local cache according to the configuration change notification.
In one embodiment, the step S500 of reading the incremental configuration data in real time acquires the incremental configuration data by Long Polling (Long-Polling). The long polling is realized through a program coordination service which is deployed among an interface service layer, a distributed cache and a database cluster, and the program coordination service is a Zookeeper cluster, for example, so that the notification of the change message can be realized in real time.
Specifically, referring to the implementation scenario of reading incremental configuration data in real time shown in fig. 6, it is a process of reading changed configuration data in real time in a push mode. After the interface server 111a initiates a Long Polling Long-Polling request, it waits for the response of the distributed cache 12. When the configuration data in the distributed cache 12 changes, a configuration change notification is sent to the Zookeeper cluster 14, where the configuration change notification carries a relevant change flag of the incremental configuration data, and the Zookeeper cluster 14 generates a distributed cache data change item according to the configuration change notification, so as to respond to the Long Polling Long-Polling request of the interface server 111 a. The interface server 111a may then pull the incremental configuration data from the distributed cache 12 in real time and write it to the local cache based on the configuration change notification. Similarly, the distributed cache 12 waits for a response from the database cluster 13 after initiating a Long poll Long-poll request. When the configuration data in the database cluster 13 changes, a configuration change notification is sent to the Zookeeper cluster 14, where the configuration change notification carries a relevant change flag of the newly added configuration data, and the Zookeeper cluster 14 generates a database configuration data change item according to the configuration change notification, so as to respond to the Long Polling Long-Polling request of the distributed cache 12. The distributed cache 12 may then write the newly added configuration data association into the configuration wide table of the database cluster through the snapshot service according to the configuration change notification to refresh the configuration wide table, and then read the incremental configuration data in the configuration wide table to the distributed cache.
In the embodiment of reading the incremental configuration data, the Long-Polling mechanism rather than the message notification mechanism can solve the problem that the data of each node of the interface server and the distributed cache platform are inconsistent, and meanwhile, the problem that the number of Long network connections is too large is avoided. Traditional messaging has a delay in reaching each cluster node and the delay is due to the different network documents etc. which can lead to inconsistent data for each serving node. The embodiment adopts the scheme that when configuration data is changed, the configuration data is read through a configuration data reading channel, the data is safer than various channel change data through one channel change, the configuration data is often important, dirty data can be avoided, and later-stage maintenance of developers and change of configuration data service are facilitated.
In a specific application scenario, the configuration data reading method is deployed on the background service of the A/B experiment splitter, each A/B experiment splitting request is received, the peak of QPS (query rate per second) can reach 5000, along with continuous access of the A/B experiment, the QPS can also be continuously increased, an average QPS2000 or more can be realized, the P99 (the average delay of the slowest 1% of requests in the past 10 seconds) line is maintained below 10ms, and a good high-performance real-time reading effect of variable relational configuration data is obtained.
In summary, the configuration data reading method of the invention searches the configuration data from the local cache through the interface server when receiving the configuration data reading request, thereby improving the response speed and realizing the efficient reading of the configuration data; the snapshot service ensures that the interface server reads the configuration data from the readable cache server when accessing the distributed cache, ensures the complete reading of the configuration data and ensures the consistency of the configuration data; by periodically reading the full configuration data and reading the incremental configuration data in real time, the variable relational configuration data can be efficiently read, and the reading requirements of real-time property, consistency, high concurrency, high performance and high availability are met.
The embodiment of the present invention further provides a configuration data reading system, referring to fig. 7, where the configuration data reading system includes an interface server 111 and a distributed cache 12, and the interface server 111 includes: a read request response module 1112, configured to read the configuration data from the local cache in response to the configuration data read request; the local buffer reading module 1113 is configured to return the configuration data read from the local buffer when the configuration data matching the configuration data read request is read from the local buffer; and a distributed cache read module 1114 for reading configuration data from the distributed cache 12 when there is no configuration data in the local cache that matches the configuration data read request, comprising: searching for a readable cache server through a snapshot service configured in the distributed cache 12; reading configuration data matched with the configuration data reading request from the readable cache server; and returning the configuration data read from the readable cache server.
In some embodiments, the configuration data reading system may further comprise a functional module for implementing the steps in any of the configuration data reading method embodiments described above. The configuration data reading system searches the configuration data from the local cache through the interface server when receiving the configuration data reading request, improves the response speed and realizes the efficient reading of the configuration data; the snapshot service ensures that the interface server reads the configuration data from the readable cache server when accessing the distributed cache, ensures the complete reading of the configuration data and ensures the consistency of the configuration data; and the variable relational configuration data can be efficiently read by periodically reading the full configuration data and reading the incremental configuration data in real time, so that the reading requirements of real-time property, consistency, high concurrency, high performance and high availability are met.
An embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory stores executable instructions, and the processor is configured to perform the steps of the configuration data reading method in the above embodiment via executing the executable instructions.
As described above, the electronic device of the present invention can first search the configuration data from the local cache when receiving the request for reading the configuration data through the interface server, thereby improving the response speed and realizing efficient reading of the configuration data; the snapshot service ensures that the interface server reads the configuration data from the readable cache server when accessing the distributed cache, ensures the complete reading of the configuration data and ensures the consistency of the configuration data; and the variable relational configuration data can be efficiently read by periodically reading the full configuration data and reading the incremental configuration data in real time, so that the reading requirements of real-time property, consistency, high concurrency, high performance and high availability are met.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and it should be understood that fig. 8 is only a schematic diagram illustrating each module, and these modules may be virtual software modules or actual hardware modules, and the combination, splitting and addition of the remaining modules are all within the scope of the present invention.
Those skilled in the art will appreciate that the various aspects of the invention may be implemented as a system, method, or program product. Accordingly, aspects of the invention may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" platform.
The electronic device 600 of the present invention is described below with reference to fig. 8. The electronic device 600 shown in fig. 8 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 8, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including memory unit 620 and processing unit 610), a display unit 640, etc.
Wherein the storage unit stores program code executable by the processing unit 610 such that the processing unit 610 performs the steps of the configuration data reading method described in the above embodiments. For example, the processing unit 610 may perform the steps shown in fig. 2, 3, and 5.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having one or more program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700, which external devices 700 may be one or more of a keyboard, pointing device, bluetooth device, etc. These external devices 700 enable a user to interactively communicate with the electronic device 600. The electronic device 600 can also communicate with one or more other computing devices, including a router, modem, and the like. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage platforms, and the like.
The embodiment of the present invention also provides a computer-readable storage medium storing a program which, when executed, implements the steps of the configuration data reading method described in the above embodiment. In some possible implementations, the aspects of the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps of the configuration data reading method as described in the above embodiments, when the program product is run on the terminal device.
As described above, the computer readable storage medium of the present invention can first find configuration data from the local cache when receiving a configuration data reading request through the interface server, thereby improving the response speed and realizing efficient reading of the configuration data; the snapshot service ensures that the interface server reads the configuration data from the readable cache server when accessing the distributed cache, ensures the complete reading of the configuration data and ensures the consistency of the configuration data; and the variable relational configuration data can be efficiently read by periodically reading the full configuration data and reading the incremental configuration data in real time, so that the reading requirements of real-time property, consistency, high concurrency, high performance and high availability are met.
Fig. 9 is a schematic structural view of a computer-readable storage medium of the present invention. Referring to fig. 9, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the readable storage medium include, but are not limited to: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device, such as through the Internet using an Internet service provider.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.

Claims (11)

1. A method for reading configuration data, comprising the steps of:
the interface server responds to the configuration data reading request and reads the configuration data from the local cache;
if the configuration data matched with the configuration data reading request is read from the local cache, returning the configuration data read from the local cache;
if the local cache has no configuration data matched with the configuration data reading request, the interface server reads the configuration data from the distributed cache, and the method comprises the following steps:
searching a readable cache server through a snapshot service configured in the distributed cache;
reading configuration data matched with the configuration data reading request from the readable cache server; and
returning the configuration data read from the readable cache server;
the configuration data reading method further includes a step of periodically reading the full-quantity configuration data, the step of periodically reading the full-quantity configuration data including:
the snapshot service periodically correlates all configuration data in the database cluster and writes the correlated configuration data into a configuration wide table of the database cluster; and
and the snapshot service reads the total configuration data from the configuration wide table and writes the configuration data into the distributed cache.
2. The configuration data reading method according to claim 1, wherein the step of writing into the distributed cache includes:
searching a writable cache server in the distributed cache;
clearing the writable cache server, and writing the read full configuration data into the writable cache server; and
and marking the writable cache server as an updated readable cache server after the writing is completed, and marking the readable cache server as the updated writable cache server.
3. The configuration data reading method according to claim 1, wherein the step of periodically reading the full amount of configuration data further comprises:
and the interface server periodically reads configuration data corresponding to the interface server from the readable cache server and updates the configuration data into the local cache.
4. The configuration data reading method of claim 1, further comprising the step of reading the incremental configuration data in real time, the step of reading the incremental configuration data in real time comprising:
when the database cluster receives the newly added configuration data, a configuration change notification carrying the newly added configuration data is initiated;
the distributed cache writes the newly added configuration data into a configuration wide table of the database cluster in an associated manner through the snapshot service according to the configuration change notification; and
and the snapshot service reads the incremental configuration data from the configuration wide table and writes the incremental configuration data into the distributed cache.
5. The configuration data reading method of claim 4, wherein the step of reading incremental configuration data in real time further comprises:
when the distributed cache receives the incremental configuration data, a configuration change notification carrying the incremental configuration data is initiated; and
and the interface server reads the incremental configuration data from the distributed cache according to the configuration change notification and writes the incremental configuration data into the local cache.
6. The method for reading configuration data according to claim 4 or 5, wherein in the step of reading the incremental configuration data in real time, the incremental configuration data is acquired by means of long polling.
7. The method for reading configuration data according to claim 1, wherein the distributed cache includes a plurality of distributed cache servers, the snapshot service is configured on one cache server, and when the cache server configuring the snapshot service fails, the snapshot service is automatically started on another cache server of the distributed cache in real time.
8. The method for reading configuration data according to claim 1, wherein the interface servers are configured in an interface service cluster, and the interface service cluster includes a plurality of distributed interface servers, and each interface server responds to the configuration data reading request corresponding to the interface server.
9. A configuration data reading system comprising an interface server and a distributed cache, the interface server comprising:
the read request response module is used for responding to the read request of the configuration data and reading the configuration data from the local cache;
the local cache reading module is used for returning the configuration data read from the local cache when the configuration data matched with the configuration data reading request is read from the local cache; and
the distributed cache reading module is configured to read configuration data from a distributed cache when the local cache has no configuration data matched with the configuration data reading request, and includes: searching a readable cache server through a snapshot service configured in the distributed cache; reading configuration data matched with the configuration data reading request from the readable cache server; and returning the configuration data read from the readable cache server;
wherein the snapshot service also periodically reads the full configuration data, including: periodically associating all configuration data in a database cluster, and writing the associated configuration data into a configuration wide table of the database cluster; and reading the total configuration data from the configuration wide table and writing the total configuration data into the distributed cache.
10. An electronic device, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the steps of the configuration data reading method according to any of claims 1 to 8 via execution of the executable instructions.
11. A computer-readable storage medium storing a program, characterized in that the program when executed implements the steps of the configuration data reading method according to any one of claims 1 to 8.
CN202010177947.5A 2020-03-13 2020-03-13 Configuration data reading method, system, electronic device and storage medium Active CN111400350B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010177947.5A CN111400350B (en) 2020-03-13 2020-03-13 Configuration data reading method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010177947.5A CN111400350B (en) 2020-03-13 2020-03-13 Configuration data reading method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN111400350A CN111400350A (en) 2020-07-10
CN111400350B true CN111400350B (en) 2023-05-02

Family

ID=71432506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010177947.5A Active CN111400350B (en) 2020-03-13 2020-03-13 Configuration data reading method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN111400350B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112487028A (en) * 2020-11-09 2021-03-12 杭州电魂网络科技股份有限公司 Method, system, electronic device and storage medium for server data storage
CN112333036B (en) * 2021-01-06 2021-03-30 广州技象科技有限公司 Multi-storage-node-based power Internet of things configuration data backup method and device
CN115269660A (en) * 2022-09-26 2022-11-01 平安银行股份有限公司 Cache data processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102843396A (en) * 2011-06-22 2012-12-26 中兴通讯股份有限公司 Data writing and reading method and device in distributed caching system
CN104052824A (en) * 2014-07-04 2014-09-17 哈尔滨工业大学深圳研究生院 Distributed cache method and system
US8880812B1 (en) * 2010-03-31 2014-11-04 Marvell International Ltd. WWN table management systems and methods
CN107071059A (en) * 2017-05-25 2017-08-18 腾讯科技(深圳)有限公司 Distributed caching service implementing method, device, terminal, server and system
CN110555041A (en) * 2018-03-30 2019-12-10 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8341363B2 (en) * 2010-05-03 2012-12-25 Panzura, Inc. Efficient cloud network attached storage

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8880812B1 (en) * 2010-03-31 2014-11-04 Marvell International Ltd. WWN table management systems and methods
CN102843396A (en) * 2011-06-22 2012-12-26 中兴通讯股份有限公司 Data writing and reading method and device in distributed caching system
CN104052824A (en) * 2014-07-04 2014-09-17 哈尔滨工业大学深圳研究生院 Distributed cache method and system
CN107071059A (en) * 2017-05-25 2017-08-18 腾讯科技(深圳)有限公司 Distributed caching service implementing method, device, terminal, server and system
CN110555041A (en) * 2018-03-30 2019-12-10 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Mikio Kataoka et al.Distributed Cache System for Large-Scale Networks.《2006 International Multi-Conference on Computing in the Global Information Technology - (ICCGI'06)》.2007,第1-6页. *
鲍远松 等.一种分布式时序数据库的存储架构设计及实现方法.《冶金自动化》.2018,第第2018年卷卷(第第2018年卷期),第250-253页. *

Also Published As

Publication number Publication date
CN111400350A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
US11475038B2 (en) Automatic repair of corrupted blocks in a database
CN111400350B (en) Configuration data reading method, system, electronic device and storage medium
US20170329528A1 (en) Efficient data volume replication for block-based storage
US20170206260A1 (en) Reducing data volume durability state for block-based storage
RU2598991C2 (en) Data recovery client for moveable client data
CN110633320A (en) Processing method, system, equipment and storage medium of distributed data service
JP2019519025A (en) Division and movement of ranges in distributed systems
CN102938784A (en) Method and system used for data storage and used in distributed storage system
US20170318099A1 (en) Method and system for processing tasks in a cloud service
CN104506643A (en) Server of distributed storage system and data synchronizing method between servers
US20120278429A1 (en) Cluster system, synchronization controlling method, server, and synchronization controlling program
US11249854B2 (en) Method and device for failover in HBase system, and non-transitory computer-readable storage medium
CN112905537B (en) File processing method and device, electronic equipment and storage medium
CN113961510A (en) File processing method, device, equipment and storage medium
CN113760847A (en) Log data processing method, device, equipment and storage medium
CN110781159B (en) Ceph directory file information reading method and device, server and storage medium
CN111338834A (en) Data storage method and device
CN112131214A (en) Method, system, equipment and storage medium for data writing and data query
CN111414356A (en) Data storage method and device, non-relational database system and storage medium
CN113791798B (en) Model updating method and device, computer storage medium and electronic equipment
CN114746854A (en) Data provider agnostic change handling in mobile client applications
KR102247247B1 (en) Method to manage database
US20230169079A1 (en) Scaling query processing resources for efficient utilization and performance
CN115981559A (en) Distributed data storage method and device, electronic equipment and readable medium
US20230169048A1 (en) Detecting idle periods at network endpoints for management actions at processing clusters for managed databases

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