Data calling method and device, electronic equipment and storage medium

By determining the data index information and the target distributed cache server in the business server, and pre-stored backup data in the local memory file, the resource cost and efficiency problems in the case of distributed cache failure are solved, and efficient and stable data calls are achieved.

CN118972402APending Publication Date: 2024-11-15BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310544876.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the case of a distributed cache failure, the addition of backup machines leads to an increase in hardware resources and operation and maintenance resources costs, and the master-slave switching operation reduces data call efficiency.

Method used

The service server determines the data index information of the service data to be called and the target distributed cache server, and pre-stores the backup service data that meets the pre-device share conditions in the local memory file. When the data call function of the target distributed cache server is abnormal, Determine directly from the local memory file and use backup business data to make data calls.

Benefits of technology

It realizes the data call process efficiently and quickly without adding a new backup machine, reduces the resource cost during disaster recovery processing in distributed cache, and improves the stability of data call services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972402A_ABST
    Figure CN118972402A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data calling method and device, electronic equipment and a storage medium. The method is applied to a service server communicating with at least one distributed cache server, and comprises the following steps: determining data index information of to-be-called service data and a target distributed cache server for storing the to-be-called service data; under the condition that the data calling function of the target distributed cache server is abnormal, target backup service data corresponding to the data index information is determined from the backup service data stored in the local memory file, and the target backup service data is determined as to-be-called service data; wherein backup service data meeting a preset backup condition in the target distributed cache server is pre-stored in the local memory file. According to the technical scheme provided by the embodiment of the invention, the data calling process can be efficiently and quickly completed, the stability of the data calling service is improved, and the resource cost during distributed cache disaster recovery processing is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a data calling method, device, electronic device and storage medium. Background Art

[0002] When providing Internet services or high-traffic services, distributed caching is usually used to improve system response speed. Once a problem occurs in the distributed cache, it often leads to data call errors.

[0003] In the prior art, the method for calling data when a distributed cache fails is to add a backup machine outside the distributed system to back up the data generated in the distributed system, and use a master-slave backup method to call data from the backup machine when a distributed cache fails to maintain normal business processing. However, in the process of implementing the present invention, it is found that the prior art has at least the following technical problems: adding a backup machine increases the cost of hardware resources. In order to ensure that data can be successfully obtained from the backup machine, it is necessary to provide separate operation and maintenance support for the master-slave switching operation, resulting in an increase in the cost of operation and maintenance resources; and the master-slave switching operation reduces the efficiency of data calling. Summary of the invention

[0004] The embodiments of the present invention provide a data calling method, device, electronic device and storage medium to efficiently and quickly complete the data calling process and achieve the purpose of reducing the resource cost during distributed cache disaster recovery processing.

[0005] According to one aspect of the present invention, there is provided a data calling method, which is applied to a service server communicating with at least one distributed cache server, the method comprising:

[0006] Determine data index information of the service data to be called, and a target distributed cache server for storing the service data to be called;

[0007] In the case where the data calling function of the target distributed cache server is abnormal, the target backup business data corresponding to the data index information is determined from among the backup business data stored in the local memory file, and the target backup business data is determined as the business data to be called;

[0008] The local memory file pre-stores the backup business data in the target distributed cache server that meets the preset backup conditions.

[0009] According to another aspect of the present invention, there is provided a data calling device, which is configured in a service server communicating with at least one distributed cache server, and the device comprises:

[0010] A data index information determination module, used to determine data index information of the business data to be called, and a target distributed cache server for storing the business data to be called;

[0011] A module for determining business data to be called, used for determining target backup business data corresponding to the data index information from among the backup business data stored in the local memory file when the data calling function of the target distributed cache server is abnormal, and determining the target backup business data as the business data to be called;

[0012] The local memory file pre-stores the backup business data in the target distributed cache server that meets the preset backup conditions.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data calling method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data calling method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention is applied to a business server that communicates with at least one distributed cache server, and determines the data index information of the business data to be called and the target distributed cache server for storing the business data to be called through the business server, and pre-stores the backup business data that meets the preset backup conditions in the target distributed cache server in a local memory file, thereby completing the data backup operation without adding a new backup machine; in the case of an abnormality in the data calling function of the target distributed cache server, directly determine the target backup business data corresponding to the data index information from the backup business data stored in the local memory file, and determine the target backup business data as the business data to be called, thereby efficiently and quickly completing the data calling process, improving the stability of the data calling service, and achieving the effect of reducing the resource cost during distributed cache disaster recovery processing.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a data calling method provided according to an embodiment of the present invention;

[0022] Figure 2 is a flow chart of another data calling method provided according to an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of a data calling process provided according to an embodiment of the present invention;

[0024] Figure 4 is a flow chart of executing a scheduled disaster recovery task provided according to an embodiment of the present invention;

[0025] Figure 5 is a schematic diagram of calling a distributed cache according to an embodiment of the present invention;

[0026] Figure 6 is a structural schematic diagram of a data calling device provided according to an embodiment of the present invention;

[0027] Figure 7 It is a structural schematic diagram of an electronic device for implementing the data calling method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "including" and "etc." in the specification and claims of the present invention and the above-mentioned drawings and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.

[0030] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0031] Before introducing the technical solution, an exemplary description of the application scenario can be given first. This technical solution can be applied to scenarios where data disaster recovery is performed through a business server and data calls are completed when a distributed cache fails. Exemplarily, a distributed cache server can be used to store the business data of users on a shopping platform, and the business server is used to process the business operations of users on the shopping platform; for example, business operations include at least one of browsing, item collection, settlement, and adding to a shopping cart, and business data includes at least one of browsing data, item collection data, settlement data, and adding to a shopping cart business data. The business data in the distributed cache server is stored in advance by the business server, and the data backup operation is completed without adding a new backup machine, which facilitates the efficient and rapid completion of the data call process, and helps reduce the resource cost when performing distributed cache disaster recovery processing.

[0032] Figure 1 This is a flow chart of a data calling method provided according to an embodiment of the present invention. This embodiment is applicable to the case where a distributed cache fails and data calling is completed through a business server. The method can be executed by a data calling device, which can be implemented in the form of hardware and / or software.

[0033] like Figure 1 As shown, the method of this embodiment is applied to a service server communicating with at least one distributed cache server, and may specifically include:

[0034] S110: Determine data index information of the business data to be called, and a target distributed cache server for storing the business data to be called.

[0035] The business data to be called may be data required by the business server for business processing; for example, if the business server is used for performing a collection business operation, the business data to be called may include data such as the type, quantity, and identification of the collection items. The data index information may be data identification information of the business data to be called, and the data may be stored according to a one-to-one correspondence between the data index information and the data; for example, the data may be stored in the form of a key-value pair, and the data index information may be used as a primary key.

[0036] In this embodiment, in order to reduce the pressure on the database and improve the response speed and concurrent throughput of the system in a high-concurrency environment, different distributed cache servers are used to store different data. In order to accurately obtain the business data to be called, the target distributed cache server used to store the business data to be called can be determined, and the business data to be called can be obtained by accessing the target distributed cache server.

[0037] Exemplarily, when the business data is stored in the distributed cache server, the corresponding relationship between the business data and the data index information can be determined, and the corresponding relationship and the distributed cache server information of the distributed cache server can be stored in the business server that has business communication with the distributed cache server. The distributed cache server information can be the name, identifier and other information of the distributed cache server. After determining the business data to be called, the data index information can be determined based on the corresponding relationship; and the target distributed cache server can be determined based on the server information stored on the business server.

[0038] Optionally, determining a target distributed cache server for storing the business data to be called includes: accessing a pre-set configuration file, and if the configuration file is configured with distributed cache server information that has a business communication relationship with the business server, then in at least one distributed cache server, determining the distributed cache server corresponding to the distributed cache server information as the target distributed cache server; if the distributed cache server information is not configured in the configuration file, then determining the target distributed cache server in at least one distributed cache server based on the business type information corresponding to the business server.

[0039] The configuration file is a file for configuring the distributed cache server information of the distributed cache server having a business communication relationship with the business server. The distributed cache server information may be the name, identification and other information of the distributed cache server.

[0040] In a specific implementation, if the configuration file is configured with distributed cache server information, it means that the distributed cache server corresponding to the distributed cache server information has a business communication relationship with the current business server, that is, the business server needs to call the data stored in the distributed cache server when performing business operations, and the distributed cache server corresponding to the distributed cache server information can be determined as the target distributed cache server; if the configuration file is not configured with distributed cache server information, it means that there is no distributed cache server with a business communication relationship with the business server currently recorded, and based on the business type information of the business server, a distributed cache server that caches the data of the business type information can be determined in at least one distributed cache server as the target distributed cache server. Exemplarily, the business type information includes at least one of browsing items, collecting items, checking out, and adding to a shopping cart.

[0041] In this embodiment, the target distributed cache server can be quickly determined through the distributed cache server information recorded in the configuration file; and, in the case where the distributed cache server information is not configured in the configuration file, the target distributed cache server can be effectively and accurately determined based on the business type information.

[0042] S120. When the data calling function of the target distributed cache server is abnormal, the target backup business data corresponding to the data index information is determined from among the backup business data stored in the local memory file, and the target backup business data is determined as the business data to be called.

[0043] Among them, the local memory file includes a local disk file and / or a local cache file; the local memory file pre-stores the backup business data in the target distributed cache server that meets the preset backup conditions. The storage method can be to take a snapshot of the data in the target distributed cache server. Exemplarily, the preset backup condition can be that the data index information of the business data is pre-specified allowed backup index information; it can also be that the business type corresponding to the business data is a pre-specified business type; or, the preset backup condition can also be set to business data with a data volume greater than a preset data volume threshold, which is determined as backup business data.

[0044] Specifically, the method for determining whether the data call function of the target distributed cache server is abnormal may include: determining whether a cache function abnormality notification sent by the target distributed cache server is received before the current moment, if the cache function abnormality notification is received, determining that the data call function of the target distributed cache server is abnormal; if the cache function abnormality notification is not received, sending a business connection request to the target distributed cache server, if the business connection request is sent successfully and feedback information from the target distributed cache server is received, determining that the data call function of the target distributed cache server is normal; if the business connection request fails to be sent, or no feedback information is received, or the received feedback information times out, determining that the data call function of the target distributed cache server is abnormal.

[0045] In a specific implementation, if the data call function of the target distributed cache server is normal, then when calling data, a data call request can be sent to the target distributed cache server, and the data call request includes data index information of the business data to be called. The target distributed cache server determines the storage data corresponding to the data index information, and determines the storage data as the business data to be called and sends it to the business server. If the data call function of the target distributed cache server is abnormal, there is no need to send a data call request to the target distributed cache server. The target backup business data corresponding to the data index information can be directly determined in the local memory file of the business server, and the target backup business data can be determined as the business data to be called. Specifically, the backup index information corresponding to each backup business data can be determined, and the backup business data corresponding to the backup index information consistent with the data index information can be determined as the target backup business data.

[0046] In this embodiment, the method for determining the target backup business data corresponding to the data index information among the backup business data stored in the local memory file can be: determining whether the data index information is the allowed backup index information stored in the pre-set configuration file; if it is the allowed backup index information, then determining the target backup business data corresponding to the data index information among the backup business data stored in the local memory file.

[0047] In order to save storage space in the business server, the business server may store backup business data that meets the preset backup conditions. Specifically, the preset backup conditions may be to back up and store business data corresponding to the preset backup-allowed index information. When determining the target backup business data, it may be determined whether the data index information is the backup-allowed index information stored in the preset configuration file. The backup-allowed index information is the index information pre-written into the configuration file that can be used for data backup in the business server.

[0048] When the data index information is the index information that allows backup, it means that the business data to be called corresponding to the data index information has been backed up in the local memory file of the business server, and the target backup business data can be directly determined in the various backup business data in the local memory file; when the data index information is not the index information that allows backup, it means that the business data to be called corresponding to the data index information has not been backed up in the local memory file of the business server, and the business data to be called cannot be obtained from the local memory file.

[0049] In this embodiment, by determining whether the data index information is the backup-allowed index information stored in a pre-set configuration file, it is possible to quickly determine whether the business data to be called has been stored in the local memory file, thereby improving the efficiency of determining the target backup business data; and, the backup business data that meets the backup conditions is stored in advance, while trying to ensure that the business data to be called has been backed up, saving storage space on the business server.

[0050] In a specific implementation, after determining whether the data index information is the backup-allowed index information stored in a preset configuration file, it also includes: if it is not the backup-allowed index information, generating error information corresponding to the data index information, and sending the error information to the operation and maintenance terminal.

[0051] Specifically, if the data index information is not the index information that allows backup, it means that the business data to be called corresponding to the data index information has not been backed up in the local memory file of the business server, and the business data to be called cannot be directly obtained from the local memory file. In order to ensure that business operations can proceed normally in a timely and rapid manner, an error message corresponding to the data index information can be generated to prompt that an error has occurred in the current data call and indicate the data index information of the business data to be called that needs to be obtained. By sending the error message to the operation and maintenance terminal, the operation and maintenance personnel are prompted to perform maintenance and processing in a timely manner, so as to quickly stop the data call function of the target distributed cache server and the business operation of the business server.

[0052] The technical solution of the embodiment of the present invention is applied to a business server that communicates with at least one distributed cache server, and determines the data index information of the business data to be called and the target distributed cache server for storing the business data to be called through the business server, and pre-stores the backup business data that meets the preset backup conditions in the target distributed cache server in a local memory file, thereby completing the data backup operation without adding a new backup machine; in the case of an abnormality in the data calling function of the target distributed cache server, directly determine the target backup business data corresponding to the data index information from the backup business data stored in the local memory file, and determine the target backup business data as the business data to be called, thereby efficiently and quickly completing the data calling process, improving the stability of the data calling service, and achieving the effect of reducing the resource cost during distributed cache disaster recovery processing.

[0053] Figure 2 1 is a flowchart of another data calling method provided according to an embodiment of the present invention. In this embodiment, after determining the data index information of the business data to be called, access the preset configuration file to determine the switch state of the degradation switch configured in the configuration file; if the degradation switch is in the on state, it is determined that the data calling function of the target distributed cache server is abnormal. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 As shown, the method includes:

[0054] S210: Determine data index information of the business data to be called, and a target distributed cache server for storing the business data to be called.

[0055] S220: Access a preset configuration file to determine the switch status of a degradation switch configured in the configuration file; if the degradation switch is in the on state, it is determined that the data call function of the target distributed cache server is abnormal.

[0056] The downgrade switch may be a variable of a Boolean data type, and may include two states: on and off. In the on state, it indicates that the data call function of the target distributed cache server is abnormal, and the data call function is downgraded; in the off state, it indicates that the data call function is not downgraded. In this embodiment, the downgrade process is to obtain the business data to be called in the local memory file of the business server; the non-downgrade process is to obtain the business data to be called by accessing the target distributed cache server.

[0057] Specifically, the switch state of the downgrade switch can be set in the configuration file, and the switch state can be used to determine whether the data call function of the target distributed cache server is abnormal. Exemplarily, in the initial state of the business server, the switch state of the downgrade switch can be set to the off state, and the data call function of the target distributed cache server is assumed to be normal; when the business server detects that the data call function of the target distributed cache server is abnormal, the switch state of the downgrade switch is set to the on state in the configuration file, and when the business data to be called is obtained later, it is not necessary to access the target distributed cache server, and it can be directly obtained from the local file memory. Furthermore, until it is determined that the data call function of the target distributed cache server is normal, the switch state of the downgrade switch can be set to the off state in the configuration file to complete the data call operation in the form of accessing the target distributed cache server.

[0058] In this embodiment, by setting a downgrade switch in the configuration file, it is possible to quickly determine whether the data calling function of the target distributed cache server is abnormal before obtaining the business data to be called each time. There is no need to access the target distributed cache server every time, which reduces unnecessary waiting time caused by access and improves the efficiency of obtaining the called business data.

[0059] In a specific implementation, after determining the switch state of the downgrade switch configured in the configuration file, it also includes: if the downgrade switch is in the off state, sending a data acquisition request to the target distributed cache server for obtaining the business data to be called; if fault information reflecting a failure of the distributed cache is received from the target distributed cache server, then determining the target backup business data corresponding to the data index information among the backup business data stored in the local memory file, and determining the target backup business data as the business data to be called.

[0060] When the downgrade switch is in the off state, it means that the data call function of the target distributed cache server is normal, and the downgrade process can be omitted, and the business data to be called can be obtained by accessing the target distributed cache server. Specifically, a data acquisition request can be sent to the target distributed cache server, and the data acquisition request contains data index information of the business data to be called. When feedback data corresponding to the data index information is received within a preset time period, the feedback data can be determined as the business data to be called; if no information is received within the preset time period, or fault information is received from the target distributed cache server to reflect that the distributed cache has a fault, it is determined that the target distributed cache server has a fault. In order to ensure that the business data to be called can be accurately obtained, the target backup business data corresponding to the data index information can be determined from the backup business data stored in the local memory file, and the target backup business data can be determined as the business data to be called.

[0061] In this embodiment, when the degradation switch is in the off state but the target distributed cache server has an abnormality, the business data to be called is obtained through the local memory file, thereby improving the stability of the distributed service and ensuring that valid business data to be called can be obtained.

[0062] In order to improve the accuracy of the switching state of the downgrade switch, after the target backup business data is determined as the business data to be called, it also includes: determining the number of failures in which the fault information is received within a preset time period; if the number of failures is greater than the preset number threshold, adjusting the switching state of the downgrade switch in the configuration file to the on state.

[0063] Specifically, the number of failures of the received fault information can be recorded in the configuration file; if the number of failures is greater than the preset number threshold, it means that the target distributed cache server has a fault. In order to avoid the business server still sending a data acquisition request to the target distributed cache server when the target distributed cache server fails, the switch state of the downgrade switch can be adjusted to the on state, that is, the downgrade process is started. If the number of failures is less than or equal to the preset number threshold, in order to avoid misdetermination of the state of the target distributed cache server due to accidental anomalies of the target distributed cache server, the switch state of the downgrade switch can still be kept in the off state. Exemplarily, accidental anomalies may include communication network anomalies, and the preset number threshold may be set to 3 times.

[0064] In this embodiment, a preset number threshold is set to avoid misjudgment of the abnormal function state of the target distributed cache server, and the switch state of the degradation switch is adjusted according to the number of failures, thereby paying attention to improving the accuracy of the switch state.

[0065] S230. When the data calling function of the target distributed cache server is abnormal, the target backup business data corresponding to the data index information is determined from among the backup business data stored in the local memory file, and the target backup business data is determined as the business data to be called.

[0066] In order to provide a downgrade processing function when the distributed cache server is inaccessible, the present embodiment also includes: if the current moment is a pre-set backup moment, accessing the pre-set configuration file to determine the allowed backup index information stored in the configuration file; traversing each allowed backup index information, obtaining the backup business data corresponding to the allowed backup index information stored by the target distributed cache server before the current moment, and storing the backup business data in a local memory file.

[0067] The local memory files include local disk files and / or local cache files.

[0068] In a specific implementation, the backup time can be set according to a preset cycle. For example, a backup time is set every five minutes. If the current time is the preset backup time, the business data can be backed up, thereby realizing the regular backup of the business data in the distributed cache server.

[0069] Specifically, if the current moment is a pre-set backup moment, the allowed backup index information corresponding to the business data that is allowed to be stored in the local memory file of the business server can be determined by accessing the configuration file. Each allowed backup index information is traversed, and for each allowed backup index information, the backup business data corresponding to the allowed backup index information stored before the current moment is obtained in the distributed cache server. Furthermore, the newly added data that has not been stored in the local memory file before the current moment can be stored in the local memory file as backup business data to reduce the memory usage of the business server.

[0070] In order to facilitate the acquisition of backup business data, the backup business data can be first stored in the local cache file, and then stored in the local disk file. When acquiring backup business data, you can first acquire it from the local cache file to improve the efficiency of acquiring backup business data; when the corresponding backup business data does not exist in the local cache file, the backup business data is acquired from the local disk file.

[0071] In this embodiment, by backing up the business data in advance at each backup time, it is ensured that when there is an access anomaly on the target distributed cache server, the business data can be obtained from the local memory file, ensuring that the data call process can be completed normally, thereby improving the stability of the business service.

[0072] In this embodiment, determining the backup-allowed index information stored in the configuration file includes: determining the switch state of the downgrade switch configured in the configuration file at the current moment; if the downgrade switch is in the off state, determining the backup-allowed index information stored in the configuration file.

[0073] In order to avoid accessing the target distributed cache server when the target distributed cache server fails, thereby causing operational errors or unnecessary waiting time, the business data can be backed up when the data call function of the target distributed cache server is normal.

[0074] Specifically, before backing up the business data, the switch status of the downgrade switch configured in the configuration file at the current moment can be determined; if the switch status is on, it means that the downgrade operation is currently started, and there is an abnormality in the data call function of the target distributed cache server, and the operation of obtaining business data from the target distributed cache server cannot be completed; if the switch status is off, it means that the downgrade operation is not currently started, and the data call function of the target distributed cache server is normal, and the backup index information can be determined, and the backup business data can be obtained in the target distributed cache server according to the backup index information, and the backup business data can be stored.

[0075] Before backing up the backup business data, this embodiment determines the switch state of the downgrade switch in the configuration file, and determines that the backup index information is allowed when the downgrade switch is in the off state, thereby avoiding access to the target distributed cache server when a fault occurs in the target distributed cache server, which is beneficial to improving data backup efficiency and avoiding operational errors.

[0076] The embodiments corresponding to the data calling method are described in detail above. In order to make the technical scheme of the method further clear to those skilled in the art, a specific application scenario is given below.

[0077] Figure 3 is a schematic diagram of a data calling process provided according to an embodiment of the present invention, such as Figure 3 As shown, the distributed configuration center can be used to maintain the configuration information of downgrade disaster recovery and synchronize it to the business server in real time, such as configuring the switch status of the downgrade switch in the configuration file, the index information of the business data, and other configuration information; for example, the distributed configuration center can be the ducc ​​configuration center. The distributed cache server may include a Jimdb server, which is used to reduce the pressure on the database in a high-concurrency environment and improve the system's response speed and concurrent throughput.

[0078] The configuration information of the distributed configuration center may include: 1. Distributed cache server information, such as the name and identifier of the distributed cache server; if the distributed cache server information is not configured in the configuration file, a target distributed cache server is determined in at least one distributed cache server based on the business type information corresponding to the business server. The distributed cache server information may be represented by a string type.

[0079] 2. The switch status of the downgrade switch. For example, the downgrade switch can be a boolean type variable, where true represents the distributed cache downgrade process, and false represents no downgrade process.

[0080] 3. The execution interval of the disaster recovery task can be represented by an integer type; for example, it can be set to perform a data backup operation every 5 minutes.

[0081] 4. A collection of data index information. The data index information can be a primary key, and can support four key types. Only cache keys configured in this collection support disaster recovery. Exemplarily, the key type can include at least one of a string, a hash table, a list, and a collection.

[0082] like Figure 3 As shown, the business server can obtain the configuration information of downgraded disaster recovery from the distributed configuration center, and when obtaining the business data to be called, determine whether to perform downgrade processing based on the switch status of the downgrade switch in the configuration information; if the call is intercepted, that is, downgrade processing, the business data to be called is written and read from the local memory file of the business server; if the call is normal, that is, no downgrade processing, the distributed cache server is accessed to obtain the corresponding business data to be called.

[0083] In this embodiment, the downgrade disaster recovery component SDK can be used to implement the distributed cache downgrade and disaster recovery functions; the business server can introduce the SDK integration through Maven. The component SDK mainly includes two processes, namely, executing scheduled disaster recovery tasks and controlling the call to the distributed cache; Figure 4 is a flow chart of executing a scheduled disaster recovery task provided according to an embodiment of the present invention; Figure 5 It is a schematic diagram of calling a distributed cache according to an embodiment of the present invention.

[0084] To clearly understand the process of executing scheduled disaster recovery tasks through component SDK, please refer to Figure 4 , when the business server starts, the component SDK starts with it. The component SDK obtains the configuration information through the distributed configuration center and initializes the local cache. Among them, when the version update, expansion and other operations are triggered, the business server starts. Start the scheduled backup task. When the downgrade switch is in the on state, the data backup of the distributed cache server cannot be completed; when the downgrade switch is in the off state. During the task execution, the configured disaster recovery key set is obtained, and each key in the disaster recovery key set is looped. The distributed cache server is called to obtain the business data of the corresponding key, and the business data is cached to the local cache file and written to the local disk file. The task execution is completed once, and the task is executed again after a fixed execution interval. This cycle is repeated to realize the backup of the business data snapshot in the distributed cache server.

[0085] To clearly explain the process of calling the distributed cache through the component SDK, see Figure 5When the business server is started, the component SDK is started and generates a call request for obtaining the business data to be called. Based on the call request, the business server determines whether the degradation switch in the configuration file is in the started state.

[0086] If it is in the startup state, determine whether the key in the call request is a key that allows disaster recovery. If so, obtain the value corresponding to the key in the local cache file or local disk file as the business data to be called corresponding to the call request; if it is not a disaster recovery key, generate an exception message to indicate that the business data to be called of the current request has not been backed up.

[0087] If the downgrade switch in the configuration file is in the off state, the call request will be sent to the corresponding distributed cache server; if the distributed cache server is in a normal state, the business data to be called corresponding to the call request will be fed back to the business server; if the distributed cache server is in an abnormal state, it is determined whether the key in the call request is a key that allows disaster recovery. If so, the value corresponding to the key is obtained in the local cache file or local disk file as the business data to be called corresponding to the call request; if it is not a key that allows disaster recovery, fault information indicating that there is an abnormality in the distributed cache server is generated.

[0088] This embodiment uses the business server to perform disaster recovery processing on the cache data in the distributed cache server, thereby completing the data backup operation without adding a new backup machine; and through the switch state of the downgrade switch, it is quickly determined whether the data call function of the distributed cache server is abnormal, without the need to access the distributed cache server every time, reducing unnecessary waiting time due to access and improving the efficiency of obtaining and calling business data.

[0089] Figure 6 1 is a schematic diagram of the structure of a data calling device provided according to an embodiment of the present invention, and the device is used to execute the data calling method provided by any of the above embodiments. The device and the data calling method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the data calling device can refer to the embodiment of the above data calling method. Figure 6 As shown, the device is configured on a business server communicating with at least one distributed cache server, including:

[0090] A data index information determination module 10, used to determine data index information of the service data to be called, and a target distributed cache server for storing the service data to be called;

[0091] The to-be-called business data determination module 11 is used to determine the target backup business data corresponding to the data index information from the backup business data stored in the local memory file when the data calling function of the target distributed cache server is abnormal, and determine the target backup business data as the to-be-called business data;

[0092] The backup business data satisfying the preset backup conditions in the target distributed cache server are pre-stored in the local memory file.

[0093] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:

[0094] A switch state determination module, configured to access a preset configuration file after determining the data index information of the service data to be called, and determine the switch state of the degradation switch configured in the configuration file;

[0095] The data call function abnormality determination is used to determine that the data call function of the target distributed cache server is abnormal if the degradation switch is in the on state.

[0096] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:

[0097] A data acquisition request sending module is used to send a data acquisition request for acquiring the service data to be called to the target distributed cache server after determining the switch state of the degradation switch configured in the configuration file, if the degradation switch is in the off state;

[0098] The fault information receiving module is used to determine the target backup business data corresponding to the data index information from the backup business data stored in the local memory file if the fault information reflecting the distributed cache failure is received from the target distributed cache server, and determine the target backup business data as the business data to be called.

[0099] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:

[0100] A failure number determination module is used to determine the number of failures of receiving failure information within a preset time period after determining the target backup business data as the business data to be called;

[0101] The switch state adjustment module is used to adjust the switch state of the degradation switch in the configuration file to the on state if the number of failures is greater than a preset number threshold.

[0102] Based on any optional technical solution in the embodiment of the present invention, optionally, the to-be-called business data determination module 11 includes:

[0103] The backup-allowed index information determination unit is used to determine whether the data index information is the backup-allowed index information stored in a preset configuration file;

[0104] The target backup business data determination unit is used to determine the target backup business data corresponding to the data index information from among the backup business data stored in the local memory file if the backup index information is allowed.

[0105] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:

[0106] The error information generating unit is used to determine whether the data index information is the backup-allowed index information stored in the preset configuration file. If it is not the backup-allowed index information, it generates error information corresponding to the data index information and sends the error information to the operation and maintenance terminal.

[0107] Based on any optional technical solution in the embodiments of the present invention, optionally, the following further includes:

[0108] The configuration file access module is used to access the preset configuration file if the current time is the preset backup time, and determine the backup-allowed index information stored in the configuration file;

[0109] The backup business data acquisition module is used to traverse each backup-allowed index information, obtain the backup business data corresponding to the backup-allowed index information stored by the target distributed cache server before the current time, and store the backup business data in a local memory file;

[0110] The local memory files include local disk files and / or local cache files.

[0111] Based on any optional technical solution in the embodiments of the present invention, optionally, the configuration file access module includes:

[0112] The switch state determination unit is used to determine the switch state of the downgrade switch configured in the configuration file at the current moment; if the downgrade switch is in the off state, the backup-allowed index information stored in the configuration file is determined.

[0113] Based on any optional technical solution in the embodiment of the present invention, optionally, the data index information determination module 10 includes:

[0114] A configuration file access unit, configured to access a preset configuration file, and if the configuration file is configured with information of a distributed cache server having a business communication relationship with the business server, then in at least one distributed cache server, a distributed cache server corresponding to the distributed cache server information is determined as a target distributed cache server;

[0115] The target distributed cache server determining unit is configured to determine a target distributed cache server from at least one distributed cache server based on business type information corresponding to the business server if the distributed cache server information is not configured in the configuration file.

[0116] The technical solution of the embodiment of the present invention is applied to a business server that communicates with at least one distributed cache server, and determines the data index information of the business data to be called and the target distributed cache server for storing the business data to be called through the business server, and pre-stores the backup business data that meets the preset backup conditions in the target distributed cache server in a local memory file, thereby completing the data backup operation without adding a new backup machine; in the case of an abnormality in the data calling function of the target distributed cache server, directly determine the target backup business data corresponding to the data index information from the backup business data stored in the local memory file, and determine the target backup business data as the business data to be called, thereby efficiently and quickly completing the data calling process, improving the stability of the data calling service, and achieving the effect of reducing the resource cost during distributed cache disaster recovery processing.

[0117] It is worth noting that in the embodiment of the above-mentioned data calling device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0118] Figure 7 1 is a schematic diagram of the structure of an electronic device that implements the data calling method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0119] like Figure 7As shown, the electronic device 20 includes at least one processor 21, and a memory connected to the at least one processor 21, such as a read-only memory (ROM) 22, a random access memory (RAM) 23, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 21 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 22 or the computer program loaded from the storage unit 28 to the random access memory (RAM) 23. In RAM23, various programs and data required for the operation of the electronic device 20 can also be stored. The processor 21, ROM22 and RAM23 are connected to each other through a bus 24. An input / output (I / O) interface 25 is also connected to the bus 24.

[0120] A number of components in the electronic device 20 are connected to the I / O interface 25, including: an input unit 26, such as a keyboard, a mouse, etc.; an output unit 27, such as various types of displays, speakers, etc.; a storage unit 28, such as a disk, an optical disk, etc.; and a communication unit 29, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 29 allows the electronic device 20 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0121] The processor 21 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 21 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 21 executes the various methods and processes described above, such as a data call method.

[0122] In some embodiments, the data call method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 28. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 20 via the ROM 22 and / or the communication unit 29. When the computer program is loaded into the RAM 23 and executed by the processor 21, one or more steps of the data call method described above may be performed. Alternatively, in other embodiments, the processor 21 may be configured to execute the data call method in any other appropriate manner (e.g., by means of firmware).

[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0124] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0125] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0126] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0127] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0128] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0130] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A data calling method, characterized in that: A service server for communicating with at least one distributed cache server, the method comprising: Determine data index information of the service data to be called, and a target distributed cache server for storing the service data to be called; In the case where the data calling function of the target distributed cache server is abnormal, the target backup business data corresponding to the data index information is determined from among the backup business data stored in the local memory file, and the target backup business data is determined as the business data to be called; The local memory file pre-stores the backup business data in the target distributed cache server that meets the preset backup conditions.

2. The method according to claim 1, characterized in that After determining the data index information of the service data to be called, the method further includes: Accessing a preset configuration file to determine the switch status of a degradation switch configured in the configuration file; If the degradation switch is in the on state, it is determined that the data calling function of the target distributed cache server is abnormal.

3. The method according to claim 2, characterized in that After determining the switch state of the degradation switch configured in the configuration file, the method further includes: If the downgrade switch is in the off state, sending a data acquisition request for acquiring the to-be-called business data to the target distributed cache server; If fault information reflecting a fault in the distributed cache is received from the target distributed cache server, the target backup business data corresponding to the data index information is determined among the backup business data stored in the local memory file, and the target backup business data is determined as the business data to be called.

4. The method according to claim 3, characterized in that After determining the target backup service data as the service data to be called, the method further includes: Determine the number of faults in which the fault information is received within a preset time period; If the number of failures is greater than a preset number threshold, the switch state of the degradation switch in the configuration file is adjusted to the on state.

5. The method according to claim 1 or 3, characterized in that: Determining target backup business data corresponding to the data index information from among the backup business data stored in the local memory file includes: Determining whether the data index information is the backup-allowed index information stored in a preset configuration file; If it is the backup-allowed index information, then the target backup business data corresponding to the data index information is determined from among the backup business data stored in the local memory file.

6. The method according to claim 5, characterized in that After determining whether the data index information is the backup-allowed index information stored in the preset configuration file, the method further includes: If it is not the backup-allowed index information, an error message corresponding to the data index information is generated and the error message is sent to the operation and maintenance terminal.

7. The method according to claim 1, characterized in that Also includes: If the current time is a preset backup time, accessing a preset configuration file to determine the backup-allowed index information stored in the configuration file; Traversing each of the backup-allowed index information, acquiring the backup business data corresponding to the backup-allowed index information stored by the target distributed cache server before the current moment, and storing the backup business data in the local memory file; The local memory file includes a local disk file and / or a local cache file.

8. The method according to claim 7, characterized in that The step of determining the backup-allowed index information stored in the configuration file includes: Determine the switch state of the degradation switch configured in the configuration file at the current moment; If the downgrade switch is in an off state, the backup-allowed index information stored in the configuration file is determined.

9. The method according to any one of claims 1-4 or 6-8, characterized in that: Determining a target distributed cache server for storing the service data to be called includes: Accessing a preset configuration file, if the configuration file is configured with information of a distributed cache server having a business communication relationship with the business server, then in at least one of the distributed cache servers, determining a distributed cache server corresponding to the distributed cache server information as the target distributed cache server; If the distributed cache server information is not configured in the configuration file, the target distributed cache server is determined from at least one of the distributed cache servers based on the service type information corresponding to the service server.

10. A data calling device, characterized in that: A service server configured to communicate with at least one distributed cache server, the device comprising: A data index information determination module, used to determine data index information of the business data to be called, and a target distributed cache server for storing the business data to be called; A module for determining business data to be called, used for determining target backup business data corresponding to the data index information from among the backup business data stored in the local memory file when the data calling function of the target distributed cache server is abnormal, and determining the target backup business data as the business data to be called; The local memory file pre-stores the backup business data in the target distributed cache server that meets the preset backup conditions.

11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data calling method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data calling method according to any one of claims 1 to 9 when executed.