WO2017080362A1 - Data managing method and device - Google Patents

Data managing method and device Download PDF

Info

Publication number
WO2017080362A1
WO2017080362A1 PCT/CN2016/103529 CN2016103529W WO2017080362A1 WO 2017080362 A1 WO2017080362 A1 WO 2017080362A1 CN 2016103529 W CN2016103529 W CN 2016103529W WO 2017080362 A1 WO2017080362 A1 WO 2017080362A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
node
configuration file
saved
Prior art date
Application number
PCT/CN2016/103529
Other languages
French (fr)
Chinese (zh)
Inventor
张朋飞
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017080362A1 publication Critical patent/WO2017080362A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/10Architectures or entities
    • H04L65/1016IP multimedia subsystem [IMS]

Definitions

  • the present application relates to the field of data management technologies in an IMS (IP Multimedia Subsystem) network, for example, to a data management method and apparatus.
  • IMS IP Multimedia Subsystem
  • IMS is a new form of multimedia service that meets the needs of users for more innovative and diverse multimedia services.
  • the ENUM-DNS (E.164 Number URI Mapping-Domain Name System) server provides the IMS with a phone number and domain name and a host resource correspondence query service.
  • ENUM-DNS servers With the development of technology, IMS has higher and higher performance requirements for ENUM-DNS servers, such as ensuring data consistency between ENUM-DNS servers and distributed cache systems.
  • the ENUM-DNS server is usually compared with the data in the distributed cache system, and the data is compared when the comparison result is different. Consistency maintenance. Because of the long time taken to compare data, it is less efficient to maintain data consistency between the ENUM-DNS server and the distributed cache system.
  • the embodiment of the invention provides a data management method and device, which aims to solve the technical problem of low maintenance efficiency of data consistency in the ENUM-DNS server and the distributed cache system.
  • the data management method is implemented by software, and the method includes the following steps:
  • the file identifier may be a file number added to the data file in the order of receiving, and the step of writing the file identifier corresponding to the data file into the first configuration file may include:
  • the steps of writing the file identifier corresponding to the data file successfully written into the distributed cache system into the second configuration file include:
  • the step of detecting the file identifiers in the first configuration file and the second configuration file, and writing the data files corresponding to the different file identifiers to the distributed cache system includes:
  • the number of the abnormal nodes in the distributed cache system is counted. If the number of the abnormal nodes is greater than the preset number threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed, and the first preset is separated. The duration no longer generates new data files until the system returns to normal.
  • the step of determining that the node corresponding to the preset space is an abnormal node may include:
  • the update does not receive the received message. The number of times the response message is reported;
  • the data management method may further include:
  • the data file corresponding to the file directory is sequentially copied from the standby node to the node according to the file directory of the node.
  • an embodiment of the present invention further provides a data management apparatus, where the data management apparatus includes:
  • Generating a module configured to generate a data file for the received data every other first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file In the first configuration file;
  • a processing module configured to write the data file into the distributed cache system, and write the file identifier corresponding to the saved data file to the second configuration file when the writing is successful;
  • the storage module is configured to detect that the first configuration file and the data file are saved to the distributed cache system every second preset duration.
  • the file identifier may be a file number added to the data file in the order of receiving, and the generating module may be further configured to write the file identifier corresponding to the generated data file into the first configuration file to update a file identifier saved in the first configuration file;
  • the processing module is further configured to write the file identifier corresponding to the successfully written data file into the second configuration file to update the file identifier saved in the second configuration file; wherein when a certain data file is not saved On success, the data file is continuously written repeatedly until the write is successful, or the alarm is reported when the write fails;
  • the storage module is further configured to: detect whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier and the file saved in the first configuration file When the file identifiers saved in the second configuration file are inconsistent, the data files corresponding to the file identifiers of the differences between the file identifiers saved in the first configuration file and the file identifiers saved in the second configuration file are written to In the distributed cache system.
  • the data management device may further include:
  • the sending module is configured to send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether a response of the node corresponding to each preset space is received.
  • the determining module is configured to receive a response message of the node corresponding to a certain preset space Determining, that the node corresponding to the preset space is an abnormal node;
  • the alarm module is configured to count the number of abnormal nodes in the distributed cache system. If the number of the abnormal nodes is greater than a preset threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. The new data file is no longer generated every first preset interval until the system returns to normal.
  • the determining module can be configured to:
  • the data management device may further include:
  • the data recovery module is configured to, when the data file of the node in the distributed cache system is faulty, sequentially copy the data file corresponding to the file directory from the standby node to the node according to the file directory of the node.
  • the embodiment of the invention further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable instructions being arranged to perform the above method.
  • An embodiment of the present invention further provides an electronic device, including:
  • At least one processor At least one processor
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
  • a data management method and apparatus in the data management method, periodically generating a data file from the received data, and writing a file identifier corresponding to the data file into the first configuration file, and successfully writing the data file
  • the file identifier corresponding to the successfully written data file is written into the second configuration file, and the file identifiers of the first configuration file and the second configuration file are compared, and
  • FIG. 1 is a schematic flowchart of a first embodiment of a data management method according to the present invention
  • FIG. 2 is a schematic flowchart of a third embodiment of a data management method according to the present invention.
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a data management apparatus according to the present invention.
  • FIG. 4 is a schematic diagram of functional modules of a third embodiment of a data management apparatus according to the present invention.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a first embodiment of a data management method according to the present invention.
  • the data management method includes the following steps:
  • Step S10 Generate a data file for the received data every first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file into the first configuration file. in;
  • the O&M system or the SPN delivers the data of the overhead household to the ENUM-DNS (E.164Number URI Mapping-Domain Name System) server.
  • the ENUM-DNS server is timed.
  • the data to be received is generated into a data file.
  • the first preset duration is set in advance, and the ENUM-DNS server generates a data file for the data received within the first preset duration every time the first preset duration is separated. And set the file identifier corresponding to the generated file. For example, if the first preset duration is 2 minutes, the ENUM-DNS server generates a data file for the data received within the 2 minute period every 2 minutes, and sets a file identifier corresponding to the generated data file.
  • the file identifier corresponding to the generated data file is set in order from small to large.
  • the file identifier corresponding to the generated first data file is set to 1; when the second data file is generated.
  • the file identifier corresponding to the generated second data file is set to 2; when the third data file is generated, the file identifier corresponding to the generated third data file is set to 3 or the like.
  • the first preset duration can be flexibly set according to actual conditions, and the file identifier corresponding to each data file generated can also be set according to other rules, and is not limited herein.
  • the file identifier corresponding to the generated data file is written into the first configuration file.
  • Step S20 the data file is written into the distributed cache system, and when the writing is successful, the file identifier corresponding to the data file successfully written is written into the second configuration file;
  • the ENUM-DNS server writes the generated data file to the distributed cache system each time the data file is generated and the file identifier corresponding to the data file is written into the first configuration file. And each time the data file is successfully saved, the file identifier corresponding to the successfully saved data file is written into the second configuration file.
  • Step S30 detecting, according to the second preset duration, the file identifiers different from the first configuration file and the second configuration file, and writing different data files corresponding to the file identifiers to the Distributed cache system.
  • the ENUM-DNS server periodically compares the file identifiers written in the first configuration file and the second configuration file, and detects whether different file identifiers exist in the first configuration file and the second configuration file.
  • the second preset duration is also set in advance.
  • the ENUM-DNS server detects whether there is a different file identifier in the first configuration file and the second configuration file when the second preset duration is separated, when the first configuration file is detected and the When different file identifiers exist in the second configuration file, the data files corresponding to the different file identifiers are written into the distributed cache system.
  • the file identifier in the first configuration file is file identifier 1 to file identifier 10
  • the file identifier in the second configuration file is file identifier 1 to file identifier 5
  • the first configuration file is The different file identifiers in the second configuration file are file identifier 6 to file identifier 10, that is, the data files corresponding to the file identifier 6 to the file identifier 10 are not successfully saved to the distributed cache system, and the ENUM-DNS server will The data files corresponding to the file identifier 6 to the file identifier 10 are written into the distributed cache system.
  • the ENUM-DNS server generates a data file by periodically receiving the data, and each time the data file is generated, setting a file identifier corresponding to the data file, and writing the file identifier to the first configuration file. And then, the generated data file is written into the distributed cache system, and when the writing is successful, the file identifier corresponding to the data file successfully written is written into the second configuration file, ENUM- The DNS server periodically detects whether there is a different file identifier in the first configuration file and the second configuration file. If there is a different file identifier in the first configuration file and the second configuration file, the ENUM-DNS server is configured. Inconsistent with the data in the distributed cache system.
  • the ENUM-DNS server saves the files corresponding to different file identifiers to the distributed cache system, because the data in the ENUM-DNS server and the distributed cache system are not required. Comparison of files greatly reduces the detection of data in the ENUM-DNS server and the distributed cache system. Time, which improves the efficiency of maintaining data consistency between the ENUM-DNS server and the distributed cache system, and improves the reliability of the ENUM-DNS server.
  • the step S10 includes: writing, by using the file identifier corresponding to the data file, the first configuration file to update the The file identifier saved in the first configuration file;
  • the step S20 includes: writing a file identifier corresponding to the saved data file to the second configuration file to update the file identifier saved in the second configuration file; wherein when a data file is not successfully saved , repeatedly write the data file until the write is successful, or report the alarm when the write fails;
  • the step S30 includes: detecting whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier saved in the first configuration file and the second When the file identifiers saved in the configuration file are inconsistent, the data file corresponding to the file identifier of the difference between the file identifier saved in the first configuration file and the file identifier saved in the second configuration file is written to the distribution. In the cache system.
  • the file identifier is a file number added to the data file according to the receiving order
  • the ENUM-DNS server writes the file identifier saved in the first configuration file by using the file identifier corresponding to the generated data file.
  • the file identifier saved in the first configuration file For example, when the ENUM-DNS server generates the data file for the first time, the file identifier corresponding to the first data file generated is set to 1, and the file identifier 1 corresponding to the generated data file is written into the first configuration file and saved.
  • the ENUM-DNS server When the ENUM-DNS server generates the data file for the second time, set the file identifier corresponding to the generated second data file to 2, write the file identifier 2 into the first configuration file, and replace the saved file identifier 1 with Update the file identifier saved in the first configuration file.
  • the file identifier corresponding to the third data file generated is set to 3
  • the file identifier 3 is written into the first configuration file, and the saved file identifier 2 is replaced.
  • the file identifier saved in the first configuration file is updated.
  • the file identifier 1 corresponding to the first data file successfully written is written into the second configuration file and saved.
  • the ENUM-DNS server successfully saves the generated second data file to the distributed cache system writes the file identifier 2 corresponding to the successfully saved second data file to the second configuration file, and replaces the saved file.
  • File ID 1 to update the file ID saved in the second configuration file.
  • the ENUM-DNS server successfully writes the generated third data file to the distributed cache system.
  • the file identifier 3 corresponding to the third data file successfully written is written into the second configuration file, the saved file identifier 2 is replaced.
  • the file identifier saved in the second configuration file is updated.
  • other generated data files that have not been written are not written, and the data file is continuously written repeatedly until the writing is successful, or an alarm is reported when the writing fails.
  • the ENUM-DNS server periodically detects whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file. And deleting, when the file identifier saved in the first configuration file is different from the file identifier saved in the second configuration file, the file identifier saved in the second configuration file and the file saved in the first configuration file A data file corresponding to the file identifier of the difference between the identifiers is written into the distributed cache system.
  • the file identifier saved in the first configuration file is 10 and the file identifier saved in the second configuration file is 5, the file identifier saved in the first configuration file and the second configuration file are The file identifiers saved in the file are inconsistent, and the ENUM-DNS server compares the file identifiers corresponding to the file identifiers of the file identifiers 5 saved in the second configuration file with the file identifiers 10 stored in the first configuration file, that is, The five data files corresponding to the file identifier 6 to the file identifier 10 are saved in the distributed cache system.
  • the ENUM-DNS server updates the file identifier saved in the first configuration file according to the file identifier corresponding to the data file each time the data file is generated, and successfully writes the generated data file.
  • the file identifier saved in the second configuration file is updated according to the file identifier corresponding to the data file, and the ENUM-DNS server periodically detects the first configuration file and the second configuration file. If the file identifiers are consistent, if the first configuration file is inconsistent with the file identifier saved in the second configuration file, the data in the ENUM-DNS server is different from the distributed cache system.
  • the ENUM-DNS server Saving a data file corresponding to the file identifier of the difference between the file identifier saved in the second configuration file and the file identifier saved in the first configuration file to the distributed cache system, so The first configuration file and the file identifier saved in the second configuration file reduce the detection of the ENUM-DNS server and the distributed Whether the data in the system is consistent or not, thereby improving the reliability of the ENUM-DNS server.
  • a third embodiment of the data management method of the present invention is proposed based on the first embodiment or the second embodiment.
  • the data management method further includes the following steps:
  • Step S40 Send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether a response of the node corresponding to each preset space is received.
  • step S50 when the response message fed back by the node corresponding to the preset space is not received, it is determined that the node corresponding to the preset space is an abnormal node;
  • Step S60 The number of abnormal nodes in the distributed cache system is counted. If the number of the abnormal nodes is greater than a preset number threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. A new data file is no longer generated for a preset duration until the system returns to normal.
  • a preset space corresponding to each node in the distributed cache system is preset, and a special space is set, for example, the special space is set to space 0, and the space 0 is used for
  • the ENUM-DNS server After the ENUM-DNS server generates the file of the data of the overhead user, the file generated by the ENUM-DNS server is saved, and the saved file is evenly loaded to the nodes corresponding to each preset space, thereby ensuring balanced storage of each node and Query data.
  • the preset space corresponds to the nodes one by one, that is, each node is completely loaded with one query space.
  • the ENUM-DNS server When the ENUM-DNS server is initialized, a fixed record is written to each preset space, and the fixed record is a fixed record corresponding to the ENUM-DNS server initialization, and the form is not limited herein.
  • the write record When the write record is repeatedly written, as long as the key value of the record repeatedly written is the same as the key value of the record previously written, the record repeatedly written overwrites the previously written record.
  • the write fails the ENUM-DNS server is not allowed to start, and the ENUM-DNS server fails to initialize; when the write is successful, the ENUM-DNS server is successfully initialized.
  • the ENUM-DNS server After the ENUM-DNS server is successfully initialized, the ENUM-DNS server periodically sends a detection message to each node corresponding to the preset space for each third preset duration. For example, the ENUM-DNS server provides each preset space every 5 minutes. The corresponding node sends a detection message. If the node corresponding to the preset space is a normal node, the node corresponding to the preset space feeds back the response message to the ENUM-DNS server when receiving the detection message; if the node corresponding to the preset space is an abnormal node, the node cannot be fed back. Response message to the ENUM-DNS server.
  • the ENUM-DNS server After sending the detection message to the node corresponding to each preset space, the ENUM-DNS server detects whether the response message fed back by the node corresponding to each preset space is received, and if the response of the node corresponding to the preset space is not received, The message is determined to be an abnormal node; if the response message fed back by the node corresponding to the preset space is received, the node corresponding to the preset space is determined to be a normal node.
  • the ENUM-DNS server counts the number of abnormal nodes in the distributed cache system. When the number of the abnormal nodes is greater than the preset threshold A, the data and the distributed data in the ENUM-DNS server cannot be guaranteed. ENUM-DNS server to operation and maintenance when the data in the cache system is consistent The system sends an alarm message. When the number of the abnormal nodes is less than or equal to the preset number threshold A, although there is theoretical possibility that the data in the ENUM-DNS server is inconsistent with the data in the distributed cache system, in order to balance the availability of data It can be considered that the data in the ENUM-DNS server can still be guaranteed to be consistent with the data in the distributed cache system.
  • the value of the preset number threshold A is set according to the NRW copy policy adopted by the distributed cache system, for example, if the distributed cache system adopts a 3-2-2 copy policy, the preset number threshold The value of A is set to 3.
  • the ENUM-DNS server sends an alarm to the operation and maintenance system, and does not allow the operation and maintenance system or the SPN to continue to send the data of the overhead household to the ENUM-DNS server to ensure the data in the ENUM-DNS server and the distributed cache system.
  • Data consistency That is, the function of receiving data sent by the operation and maintenance system or the SPN is closed, and a new data file is no longer generated every interval of the first preset duration until the system returns to normal.
  • the step S50 includes:
  • step a when the response message fed back by the node corresponding to the preset space is not received, the number of times the response message is not received is updated;
  • step b it is determined whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
  • the ENUM-DNS server sends a detection message to each node corresponding to the preset space each time. And if the response message fed back by the node corresponding to the preset space is not received, updating the number of times the response message fed back by the node corresponding to the preset space is not received.
  • the ENUM-DNS server determines whether the number of times is greater than or equal to a preset number of times.
  • the node corresponding to the preset space determines that the node corresponding to the preset space is Anomalous node. For example, if the preset number of times is set to 3 times, when the ENUM-DNS server sends the detection message 3 times to the node corresponding to each preset space, if the ENUM-DNS server does not receive a preset space 3 times.
  • the response message fed back by the corresponding node determines that the node corresponding to the preset space is an abnormal node.
  • the ENUM-DNS server periodically sends a detection message to the node corresponding to each preset space in the distributed cache system, and detects whether a response message fed back by the node corresponding to each preset space is received. When the response message fed back by the node corresponding to the preset space is not received, it is determined that the node corresponding to the preset space is an abnormal node, and the ENUM-DNS server collects the distributed information. The number of abnormal nodes in the cache system.
  • the operation and maintenance system is Sending alarm information, therefore, achieves consistency and availability of data, and improves the reliability of the ENUM-DNS server.
  • a fourth embodiment of the data management method of the present invention is provided based on any of the foregoing embodiments.
  • the data management method further includes:
  • step c when the data file of the node in the distributed cache system is faulty, the data file corresponding to the file directory is sequentially copied from the standby node to the node according to the file directory of the node.
  • each of the distributed cache systems has a backup system. Normally, the data stored in the standby node of the standby system is consistent with the data held by the distributed cache system. When the data of the abnormal node in the distributed cache system is restored, the data file corresponding to the file directory is sequentially copied to the abnormal node in the standby node of the standby system according to the file directory of the abnormal node, thereby The recovery of the data of the abnormal node is completed.
  • the preset space corresponding to each node in the distributed cache system is reset, and the ENUM-DNS server is re-initialized. After the initialization is completed, the data saved in the standby node of the backup system is sequentially copied to the node corresponding to each preset space in the distributed cache system.
  • the data file corresponding to the file directory is sequentially copied from the standby node to the abnormal node according to the file directory of the abnormal node, and the The recovery of the data of the abnormal node without copying all the data files, thus realizing the rapid recovery of the data, thereby improving the reliability of the ENUM-DNS server.
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a data management apparatus according to the present invention.
  • the data management device includes:
  • the generating module 10 is configured to generate a data file for the received data every other first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file.
  • the first configuration file is configured to generate a data file for the received data every other first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file.
  • the operation and maintenance system or the SPN delivers the data of the overhead household to the ENUM-DNS (E.164 Number URI Mapping-Domain Name System) server, and the generation module 10 receives the data. After the data is received, the received data is periodically generated to generate a data file.
  • the first preset duration is set in advance, and the generating module 10 generates a data file for the data received within the first preset duration every time the first preset duration is separated, and Set the file identifier corresponding to the generated data file.
  • the generating module 10 generates a data file for the data received within the 2 minute period every 2 minutes, and sets a file identifier corresponding to the generated data file, for example, The file identifier corresponding to the generated data file is set in order from small to large.
  • the file identifier corresponding to the first data file generated is set to 1; when the second data file is generated, The file identifier corresponding to the generated second data file is set to 2; when the third data file is generated, the file identifier corresponding to the generated third data file is set to 3 or the like.
  • the first preset duration can be flexibly set according to actual conditions, and the file identifier corresponding to each data file generated can also be set according to other rules, and is not limited herein.
  • the file identifier corresponding to the generated data file is written into the first configuration file.
  • the processing module 20 is configured to write the data file into the distributed cache system, and write the file identifier corresponding to the data file successfully written into the second configuration file when the writing is successful;
  • the processing module 20 After the generating module 10 generates a data file each time and writes the file identifier corresponding to the data file into the foreground first configuration file, the processing module 20 writes the generated data file into the distributed cache system. And each time the data file is successfully written, the file identifier corresponding to the successfully written data file is written into the second configuration file.
  • the storage module 30 is configured to detect the file identifiers different from the first configuration file and the second configuration file every second preset duration, and identify different data files corresponding to the different files. Saved to the distributed cache system.
  • the storage module 30 periodically compares the file identifiers written in the first configuration file and the second configuration file, and detects whether different file identifiers exist in the first configuration file and the second configuration file.
  • the second preset duration is also set in advance. The storage module 30 detects whether there is a different file identifier in the first configuration file and the second configuration file when the second preset duration is separated, when the first configuration file and the first When different file identifiers exist in the second configuration file, the data files corresponding to the different file identifiers are written into the distributed cache system.
  • the file identifier in the first configuration file is file identifier 1 to file identifier 10
  • the second configuration file The file identifiers in the file are file identifier 1 to file identifier 5, and the different file identifiers in the first configuration file and the second configuration file are file identifier 6 to file identifier 10, that is, the file identifier 6 to the file. If the data file corresponding to the identifier 10 is not successfully written into the distributed cache system, the storage module 30 writes the data file corresponding to the file identifier 6 to the file identifier 10 into the distributed cache system.
  • the generating module 10 periodically generates a data file by receiving the data, and each time the data file is generated, setting a file identifier corresponding to the data file, and writing the file identifier into the first configuration file.
  • the processing module 20 writes the generated data file into the distributed cache system, and writes the file identifier corresponding to the successfully written data file into the second configuration file when the write is successful, and the storage module
  • the timer detects whether there is a different file identifier in the first configuration file and the second configuration file. If there is a different file identifier in the first configuration file and the second configuration file, the ENUM-DNS server is The data in the distributed cache system is inconsistent.
  • the storage module 30 saves the data files corresponding to the different file identifiers to the distributed cache system, because the data files in the ENUM-DNS server and the distributed cache system are not required. Contrast, greatly reducing the time to detect whether the ENUM-DNS server is consistent with the data in the distributed cache system, thus improving the Data protection ENUM-DNS server with distributed cache coherence system efficiency, improve the reliability of ENUM-DNS server.
  • a second embodiment of the data management apparatus of the present invention is proposed based on the first embodiment.
  • the generating module 10 is further configured to write the file identifier corresponding to the generated data file into the first configuration file. To update the file identifier saved in the first configuration file;
  • the processing module 20 is further configured to write the file identifier corresponding to the saved data file to the second configuration file to update the file identifier saved in the second configuration file; wherein when a certain data file is not saved On success, the data file is continuously written repeatedly until the write is successful, or the alarm is reported when the write fails;
  • the storage module 30 is further configured to detect whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier saved in the first configuration file When the file identifiers saved in the second configuration file are inconsistent, the data files corresponding to the file identifiers of the difference between the file identifiers saved in the first configuration file and the file identifiers saved in the second configuration file are written. To the distributed cache system.
  • the file identifier is a file number added to the data file according to the receiving order
  • the generating module 10 writes the file identifier saved in the first configuration file by using the file identifier corresponding to the generated data file.
  • To update the file identifier saved in the first configuration file For example, when generating When the module 10 generates the data file for the first time, the file identifier corresponding to the first data file generated is set to 1, and the file identifier 1 corresponding to the generated data file is written into the first configuration file and saved.
  • the generating module 10 When the generating module 10 generates the data file for the second time, setting the file identifier corresponding to the generated second data file to 2, writing the file identifier 2 into the first configuration file, and replacing the saved file identifier 1 to update The file identifier saved in the first configuration file.
  • the file identifier corresponding to the generated third data file is set to 3, and the file identifier 3 is written into the first configuration file, and the saved file identifier 2 is replaced.
  • the file identifier saved in the first configuration file is updated.
  • the file identifier 1 corresponding to the successfully written first data file is written into the second configuration file and saved.
  • the file identifier 2 corresponding to the successfully written second data file is written into the second configuration file, and is replaced and saved.
  • the file identifier 1 is to update the file identifier saved in the second configuration file.
  • the file identifier 3 corresponding to the successfully saved third data file is written into the second configuration file, and the saved file is replaced.
  • the file identifier saved in the second configuration file is updated.
  • the processing module 20 does not write other unwritten data files, continuously writes the data file repeatedly until the writing is successful, or reports an alarm when the writing fails.
  • the storage module 30 periodically detects whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file, for example, detecting the saving in the first configuration file every second preset duration Whether the file identifier is consistent with the file identifier saved in the second configuration file. And deleting, when the file identifier saved in the first configuration file is different from the file identifier saved in the second configuration file, the file identifier saved in the second configuration file and the file saved in the first configuration file A data file corresponding to the file identifier of the difference between the identifiers is written into the distributed cache system.
  • the file identifier saved in the first configuration file is 10 and the file identifier saved in the second configuration file is 5, the file identifier saved in the first configuration file and the second configuration file are The file identifiers saved in the file are inconsistent, and the storage module 30 identifies the file identifiers stored in the second configuration file to a data file corresponding to the file identifier of the difference between the file identifiers 10 stored in the first configuration file, that is, the file.
  • the five data files corresponding to the identifier 6 to the file identifier 10 are written into the distributed cache system.
  • the generating module 10 updates the file identifier saved in the first configuration file according to the file identifier corresponding to the data file each time the data file is generated, and the processing module 20 succeeds in generating the data file.
  • the file identifier saved in the second configuration file is updated according to the file identifier corresponding to the data file, and the storage module 30 periodically detects the first configuration file and the second configuration file. If the file identifiers are consistent, if the first configuration file is inconsistent with the file identifier saved in the second configuration file, the data in the ENUM-DNS server is different from that in the distributed cache system.
  • the storage module 30 The data file corresponding to the file identifier of the difference between the file identifier saved in the second configuration file and the file identifier saved in the first configuration file is written into the distributed cache system, so only the comparison The first configuration file and the file identifier saved in the second configuration file reduce detection of ENUM-DNS server and distributed The data storage system is consistent in time, thereby improving the reliability of ENUM-DNS server.
  • the data management apparatus further includes:
  • the sending module 40 is configured to send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether the node corresponding to each preset space is received. Response message
  • the determining module 50 is configured to determine that the node corresponding to the preset space is an abnormal node when the response message fed back by the node corresponding to the preset space is not received;
  • the alarm module 60 is configured to count the number of abnormal nodes in the distributed cache system. If the number of the abnormal nodes is greater than a preset threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. The new data file is no longer generated every first preset interval until the system returns to normal.
  • a preset space corresponding to each node in the distributed cache system is preset, and a special space is set, for example, the special space is set to space 0, and the space 0 is used for
  • the file generated by the generating module 10 is saved, and the saved file is evenly loaded to the nodes corresponding to each of the preset spaces, thereby ensuring balanced storage and query data of each node.
  • the preset space corresponds to the nodes one by one, that is, each node is completely loaded with one query space.
  • the ENUM-DNS server When the ENUM-DNS server is initialized, a fixed record is written to each preset space, and the fixed record is a fixed record corresponding to the initialization of the ENUM-DNS server, and the form is not limited herein. system.
  • the write record When the write record is repeatedly written, as long as the key value of the record repeatedly written is the same as the key value of the record previously written, the record repeatedly written overwrites the previously written record.
  • the write fails the ENUM-DNS server is not allowed to start, and the ENUM-DNS server fails to initialize; when the write is successful, the ENUM-DNS server is successfully initialized.
  • the sending module 40 After the ENUM-DNS server is successfully initialized, the sending module 40 sends a detection message to each node corresponding to the preset space every third preset duration.
  • the sending module 40 corresponds to each preset space every 5 minutes.
  • the node sends a detection message. If the node corresponding to the preset space is a normal node, the node corresponding to the preset space feeds back the response message to the sending module 40 when receiving the detection message; if the node corresponding to the preset space is an abnormal node, the response cannot be fed back. The message is sent to the sending module 40.
  • the sending module 40 After sending the detection message to the node corresponding to each preset space, the sending module 40 detects whether the response message fed back by the node corresponding to each preset space is received, and if the response message of the node corresponding to the preset space is not received, The determining module 50 determines that the node corresponding to the preset space is an abnormal node. If the response message fed back by the node corresponding to the preset space is received, the determining module 50 determines that the node corresponding to the preset space is a normal node.
  • the number of abnormal nodes in the distributed cache system is counted.
  • the number of the abnormal nodes is greater than the preset number threshold A, the data in the ENUM-DNS server and the data in the distributed cache system cannot be guaranteed.
  • the alarm module 60 sends an alarm message to the operation and maintenance system.
  • the number of the abnormal nodes is less than or equal to the preset number threshold A, although there is theoretical possibility that the data in the ENUM-DNS server is inconsistent with the data in the distributed cache system, in order to balance the availability of data It can be considered that the data in the ENUM-DNS server can still be guaranteed to be consistent with the data in the distributed cache system.
  • the value of the preset number threshold A is set according to the NRW copy policy adopted by the distributed cache system, for example, if the distributed cache system adopts a 3-2-2 copy policy, the preset number threshold The value of A is set to 3.
  • the alarm module 60 sends an alarm to the operation and maintenance system, and does not allow the operation and maintenance system or the SPN to continue to send the data of the overhead household to the ENUM-DNS server to ensure the data in the ENUM-DNS server and the data in the distributed cache system. Consistency. That is, the function of receiving data sent by the operation and maintenance system or the SPN is closed, and a new data file is no longer generated every interval of the first preset duration until the system returns to normal.
  • the determining module 50 is further configured to:
  • the update does not receive the received message. The number of times the response message is reported;
  • the determining module 50 updates the number of times that the response message fed back by the node corresponding to the preset space is not received, and determines whether the number of times is greater than or equal to the preset number of times. And determining that the node corresponding to the preset space is an abnormal node, when the number of the response messages fed back by the node corresponding to the preset space is not greater than or equal to the preset number of times.
  • the sending module 40 sends the detection message 3 times to the node corresponding to each preset space
  • the node corresponding to a preset space is not received 3 times
  • the feedback is not received.
  • the determining module 50 determines that the node corresponding to the preset space is an abnormal node.
  • the sending module 40 periodically sends a detection message to the node corresponding to each preset space in the distributed cache system, and detects whether a response message fed back by the node corresponding to each preset space is received.
  • the determining module 50 determines that the node corresponding to the preset space is an abnormal node, and counts the number of abnormal nodes in the distributed cache system, and when the abnormal node
  • the alarm module 60 sends an alarm message to the operation and maintenance system, thereby achieving both Data consistency and availability improve the reliability of ENUM-DNS servers.
  • a fourth embodiment of the data management apparatus of the present invention is provided based on any of the foregoing embodiments.
  • the data management apparatus further includes:
  • the data recovery module is configured to, when the data file of the node in the distributed cache system is faulty, sequentially copy the data file corresponding to the file directory from the standby node to the node according to the file directory of the node.
  • each of the distributed cache systems has a backup system. Normally, the data stored in the standby node of the standby system is consistent with the data held by the distributed cache system.
  • the data recovery module is based on the file directory of the abnormal node. The data node corresponding to the file directory is sequentially copied to the abnormal node in the standby node of the standby system, thereby completing the recovery of the data of the abnormal node.
  • the data recovery module sequentially copies all the data saved in the standby node of the standby system to the node corresponding to each preset space in the distributed cache system.
  • the data recovery module sequentially copies the data file corresponding to the file directory from the standby node to the abnormal node according to the file directory of the abnormal node.
  • the recovery of the data of the abnormal node is completed without copying all the data files, thereby realizing the rapid recovery of the data, thereby improving the reliability of the ENUM-DNS server.
  • the embodiment of the present invention further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable instructions being configured to perform the method in any of the above embodiments.
  • the embodiment of the invention further provides a schematic structural diagram of an electronic device.
  • the electronic device includes:
  • At least one processor 50 which is exemplified by a processor 50 in FIG. 5; and a memory 51, may further include a communication interface 52 and a bus 53.
  • the processor 50, the communication interface 52, and the memory 51 can complete communication with each other through the bus 53.
  • Communication interface 52 can be used for information transmission.
  • Processor 50 can invoke logic instructions in memory 51 to perform the methods of the above-described embodiments.
  • logic instructions in the memory 51 described above may be implemented in the form of software functional units and sold or used as separate products, and may be stored in a computer readable storage medium.
  • the memory 51 is a computer readable storage medium, and can be used to store a software program, a computer executable program, and a program instruction/module corresponding to the method in the embodiment of the present invention.
  • the processor 50 executes the function application and the data processing by executing the software programs, the instructions, and the modules stored in the memory 51, that is, the data management method in the above method embodiments.
  • the memory 51 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the terminal device, and the like. Further, the memory 51 may include a high speed random access memory, and may also include a nonvolatile memory.
  • the technical solution of the embodiment of the present invention may be embodied in the form of a software product, the computer software
  • the product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
  • the foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
  • the present invention improves the efficiency of maintaining data consistency in an ENUM-DNS server and a distributed cache system.

Abstract

An ENUM-DNS big data processing method. The method manages ENUM-DNS background data via a distributed cache system. The method mainly comprises: a method for ensuring consistency of ENUM-DNS foreground-background data. The method ensures consistency of the foreground-background data of an ENUM-DNS system by regularly detecting file identifiers in a first configuration file and a second configuration file, improving maintenance efficiency for data consistency in an ENUM-DNS server and the distributed cache system.

Description

数据管理方法及装置Data management method and device 技术领域Technical field
本申请涉及IMS(IP Multimedia Subsystem,IP多媒体子系统)网络中数据管理技术领域,例如涉及数据管理方法及装置。The present application relates to the field of data management technologies in an IMS (IP Multimedia Subsystem) network, for example, to a data management method and apparatus.
背景技术Background technique
IMS是一种全新的多媒体业务形式,能够满足用户更新颖、更多样化的多媒体业务需求。ENUM-DNS(E.164Number URI Mapping-Domain Name System,电话号码映射-域名系统)服务器为IMS提供了电话号码和域名以及主机资源的对应关系查询服务。随着科技的发展,IMS对ENUM-DNS服务器的性能要求越来越高,例如需要保障ENUM-DNS服务器与分布式缓存系统中的数据一致性。相关技术中,在维护ENUM-DNS服务器与分布式缓存系统中的数据一致性时,通常是将ENUM-DNS服务器与分布式缓存系统中的数据进行比对,在比对结果不同时对数据进行一致性维护。由于比对数据的耗费时间长,使得维护ENUM-DNS服务器与分布式缓存系统中的数据一致性的效率较低。IMS is a new form of multimedia service that meets the needs of users for more innovative and diverse multimedia services. The ENUM-DNS (E.164 Number URI Mapping-Domain Name System) server provides the IMS with a phone number and domain name and a host resource correspondence query service. With the development of technology, IMS has higher and higher performance requirements for ENUM-DNS servers, such as ensuring data consistency between ENUM-DNS servers and distributed cache systems. In the related art, when maintaining data consistency between the ENUM-DNS server and the distributed cache system, the ENUM-DNS server is usually compared with the data in the distributed cache system, and the data is compared when the comparison result is different. Consistency maintenance. Because of the long time taken to compare data, it is less efficient to maintain data consistency between the ENUM-DNS server and the distributed cache system.
发明内容Summary of the invention
本发明实施例提出了一种数据管理方法及装置,旨在解决ENUM-DNS服务器与分布式缓存系统中的数据一致性的维护效率低的技术问题。The embodiment of the invention provides a data management method and device, which aims to solve the technical problem of low maintenance efficiency of data consistency in the ENUM-DNS server and the distributed cache system.
所述数据管理方法是通过软件实现的,该方法包括以下步骤:The data management method is implemented by software, and the method includes the following steps:
每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识,保存所述数据文件并将所述数据文件对应的文件标识写入第一配置文件中;Generating a data file for the received data every first preset duration, setting a file identifier corresponding to the data file, saving the data file, and writing the file identifier corresponding to the data file into the first configuration file;
将所述数据文件写入至分布式缓存系统中,并在写入成功时,将保存成功的所述数据文件对应的文件标识写入第二配置文件中;Writing the data file to the distributed cache system, and writing the file identifier corresponding to the saved data file to the second configuration file when the writing is successful;
每隔第二预设时长,检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件写入至所述分布式缓存系统中。 Detecting, differently, the file identifiers in the first configuration file and the second configuration file every second preset duration, and writing different data files corresponding to the file identifiers to the distributed cache In the system.
所述文件标识可以为按照接收顺序对所述数据文件添加的文件编号,所述将所述数据文件对应的文件标识写入第一配置文件中的步骤可以包括:The file identifier may be a file number added to the data file in the order of receiving, and the step of writing the file identifier corresponding to the data file into the first configuration file may include:
用所述数据文件对应的文件标识写入所述第一配置文件中,以更新所述第一配置文件中保存的文件标识;Writing, by using the file identifier corresponding to the data file, the first configuration file to update the file identifier saved in the first configuration file;
将成功写入分布式缓存系统的数据文件对应的文件标识写入第二配置文件中的步骤包括:The steps of writing the file identifier corresponding to the data file successfully written into the distributed cache system into the second configuration file include:
用写入分布式缓存系统成功的所述数据文件对应的文件标识写入第二配置文件中,以更新所述第二配置文件中保存的文件标识;其中当某一数据文件未写入成功时,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警;Writing, by using a file identifier corresponding to the data file successfully written in the distributed cache system, to the second configuration file, to update the file identifier saved in the second configuration file; wherein when a data file is not successfully written , repeatedly write the data file until the write is successful, or report the alarm when the write fails;
所述检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件写入至所述分布式缓存系统中的步骤包括:The step of detecting the file identifiers in the first configuration file and the second configuration file, and writing the data files corresponding to the different file identifiers to the distributed cache system includes:
检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致;Detecting whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file;
在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。And deleting, when the file identifier saved in the first configuration file is different from the file identifier saved in the second configuration file, the file identifier saved in the first configuration file and the file saved in the second configuration file A data file corresponding to the file identifier of the difference between the identifiers is written into the distributed cache system.
在执行所述每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识的步骤的同时,可以执行以下步骤:While performing the step of generating the data file by using the first preset duration, the received data, and setting the file identifier corresponding to the data file, the following steps may be performed:
每隔第三预设时长,发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息;Sending a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detecting whether a response message fed back by the node corresponding to each preset space is received;
在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点;When the response message fed back by the node corresponding to the preset space is not received, determining that the node corresponding to the preset space is an abnormal node;
统计所述分布式缓存系统中异常节点的个数,若所述异常节点的个数大于预设数量阈值,则向运维系统发送报警信息,同时关闭接收数据的功能,每间隔第一预设时长不再生成新的数据文件,直至系统恢复正常。The number of the abnormal nodes in the distributed cache system is counted. If the number of the abnormal nodes is greater than the preset number threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed, and the first preset is separated. The duration no longer generates new data files until the system returns to normal.
所述在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点的步骤可以包括:When the response message of the node corresponding to the preset space is not received, the step of determining that the node corresponding to the preset space is an abnormal node may include:
在未接收到某一预设空间对应的节点反馈的响应消息时,更新未接收到所 述响应消息的次数;When the response message fed back by the node corresponding to a certain preset space is not received, the update does not receive the received message. The number of times the response message is reported;
判断所述次数是否大于等于预设次数,其中当未接受到所述响应消息的次数大于等于预设次数时,所述预设空间对应的节点为异常节点。Determining whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
所述数据管理方法还可以包括:The data management method may further include:
在所述分布式缓存系统有节点的数据文件出现故障时,根据所述节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述节点。When the data file of the node in the distributed cache system is faulty, the data file corresponding to the file directory is sequentially copied from the standby node to the node according to the file directory of the node.
此外,本发明实施例还提出了一种数据管理装置,所述数据管理装置包括:In addition, an embodiment of the present invention further provides a data management apparatus, where the data management apparatus includes:
生成模块,被配置为在每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识,保存所述数据文件并将所述数据文件对应的文件标识写入第一配置文件中;Generating a module, configured to generate a data file for the received data every other first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file In the first configuration file;
处理模块,被配置为将所述数据文件写入至分布式缓存系统中,并在写入成功时,将保存成功的所述数据文件对应的文件标识写入第二配置文件中;a processing module, configured to write the data file into the distributed cache system, and write the file identifier corresponding to the saved data file to the second configuration file when the writing is successful;
存储模块,被配置为在每隔第二预设时长,检测所述第一配置文件与数据文件保存至所述分布式缓存系统中。The storage module is configured to detect that the first configuration file and the data file are saved to the distributed cache system every second preset duration.
所述文件标识可以为按照接收顺序对所述数据文件添加的文件编号,所述生成模块,还可以被配置为用生成的数据文件对应的文件标识写入所述第一配置文件中,以更新所述第一配置文件中保存的文件标识;The file identifier may be a file number added to the data file in the order of receiving, and the generating module may be further configured to write the file identifier corresponding to the generated data file into the first configuration file to update a file identifier saved in the first configuration file;
所述处理模块,还被配置为用写入成功的数据文件对应的文件标识写入第二配置文件中,以更新所述第二配置文件中保存的文件标识;其中当某一数据文件未保存成功时,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警;The processing module is further configured to write the file identifier corresponding to the successfully written data file into the second configuration file to update the file identifier saved in the second configuration file; wherein when a certain data file is not saved On success, the data file is continuously written repeatedly until the write is successful, or the alarm is reported when the write fails;
所述存储模块,还被配置为检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致;在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。The storage module is further configured to: detect whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier and the file saved in the first configuration file When the file identifiers saved in the second configuration file are inconsistent, the data files corresponding to the file identifiers of the differences between the file identifiers saved in the first configuration file and the file identifiers saved in the second configuration file are written to In the distributed cache system.
所述数据管理装置还可以包括:The data management device may further include:
发送模块,被配置为每隔第三预设时长,发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息;The sending module is configured to send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether a response of the node corresponding to each preset space is received. Message
判断模块,被配置为在未接收到某一预设空间对应的节点反馈的响应消息 时,判定所述预设空间对应的节点为异常节点;The determining module is configured to receive a response message of the node corresponding to a certain preset space Determining, that the node corresponding to the preset space is an abnormal node;
报警模块,被配置为统计所述分布式缓存系统中异常节点的个数,若所述异常节点的个数大于预设数量阈值,则向运维系统发送报警信息,同时关闭接收数据的功能,每间隔第一预设时长不再生成新的数据文件,直至系统恢复正常。The alarm module is configured to count the number of abnormal nodes in the distributed cache system. If the number of the abnormal nodes is greater than a preset threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. The new data file is no longer generated every first preset interval until the system returns to normal.
所述判断模块可以被配置为:The determining module can be configured to:
在未接收到某一预设空间对应的节点反馈的响应消息时,更新未接收到所述响应消息的次数;Updating the number of times the response message is not received when the response message fed back by the node corresponding to the preset space is not received;
判断所述次数是否大于等于预设次数,其中当未接受到所述响应消息的次数大于等于预设次数时,所述预设空间对应的节点为异常节点。Determining whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
所述数据管理装置还可以包括:The data management device may further include:
数据恢复模块,被配置为在所述分布式缓存系统有节点的数据文件出现故障时,根据所述节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述节点。The data recovery module is configured to, when the data file of the node in the distributed cache system is faulty, sequentially copy the data file corresponding to the file directory from the standby node to the node according to the file directory of the node.
本发明实施例还提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述方法。The embodiment of the invention further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable instructions being arranged to perform the above method.
本发明实施例还提供了一种电子设备,包括:An embodiment of the present invention further provides an electronic device, including:
至少一个处理器;以及At least one processor;
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行上述的方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
本发明实施例提出的数据管理方法及装置,在该数据管理方法中,定时将接收的数据生成数据文件,并将数据文件对应的文件标识写入第一配置文件中,在将数据文件成功写入至分布式缓存系统中时,将写入成功的数据文件对应的文件标识写入第二配置文件中,则通过比对第一配置文件与所述第二配置文件中不同的文件标识,并向分布式缓存系统写入不同的文件标识对应的数据文件即可实现数据的同步,而不用进行数据文件的依次比对,提高了维护ENUM-DNS服务器与分布式缓存系统中的数据一致性的效率。 A data management method and apparatus according to an embodiment of the present invention, in the data management method, periodically generating a data file from the received data, and writing a file identifier corresponding to the data file into the first configuration file, and successfully writing the data file When entering the distributed cache system, the file identifier corresponding to the successfully written data file is written into the second configuration file, and the file identifiers of the first configuration file and the second configuration file are compared, and By writing data files corresponding to different file identifiers to the distributed cache system, data synchronization can be realized without sequentially comparing the data files, thereby improving the consistency of data maintenance between the ENUM-DNS server and the distributed cache system. effectiveness.
附图概述BRIEF abstract
图1为本发明数据管理方法第一实施例的流程示意图;1 is a schematic flowchart of a first embodiment of a data management method according to the present invention;
图2为本发明数据管理方法第三实施例的流程示意图;2 is a schematic flowchart of a third embodiment of a data management method according to the present invention;
图3为本发明数据管理装置第一实施例的功能模块示意图;3 is a schematic diagram of functional modules of a first embodiment of a data management apparatus according to the present invention;
图4为本发明数据管理装置第三实施例的功能模块示意图;以及4 is a schematic diagram of functional modules of a third embodiment of a data management apparatus according to the present invention;
图5为本发明实施例提供的电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
应当理解,此处所描述的实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例提供一种数据管理方法,参照图1,图1为本发明数据管理方法第一实施例的流程示意图。The embodiment of the present invention provides a data management method. Referring to FIG. 1, FIG. 1 is a schematic flowchart of a first embodiment of a data management method according to the present invention.
在本实施例中,该数据管理方法包括以下步骤:In this embodiment, the data management method includes the following steps:
步骤S10,每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识,保存所述数据文件并将所述数据文件对应的文件标识写入第一配置文件中;Step S10: Generate a data file for the received data every first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file into the first configuration file. in;
运维系统或SPN(Service Provisioning Node,开销户网关)将开销户的数据下发至ENUM-DNS(E.164Number URI Mapping-Domain Name System,电话号码映射-域名系统)服务器,ENUM-DNS服务器定时将接收到的所述数据生成数据文件。在本实施例中,预先设置了第一预设时长,ENUM-DNS服务器在每间隔所述第一预设时长时,就将在所述第一预设时长内接收到的数据生成数据文件,并设置生成的文件对应的文件标识。例如,若所述第一预设时长为2分钟,则ENUM-DNS服务器每间隔2分钟就将在该2分钟时长内接收到的数据生成数据文件,并设置生成的数据文件对应的文件标识,比如,按照从小到大的顺序设置生成的数据文件对应的文件标识,在生成第一个数据文件时,设置生成的第一个数据文件对应的文件标识为1;在生成第二个数据文件时,设置生成的第二个数据文件对应的文件标识为2;在生成第三个数据文件时,设置生成的第三个数据文件对应的文件标识为3等。本领域技术人员可以理解的是,所述第一预设时长可根据实际情况灵活设置,生成的每个数据文件对应的文件标识也可按照其他规则进行设置,在此不做限制。同时,在每次生成数据文件时,将生成的数据文件对应的文件标识写入第一配置文件中。 The O&M system or the SPN (Service Provisioning Node) delivers the data of the overhead household to the ENUM-DNS (E.164Number URI Mapping-Domain Name System) server. The ENUM-DNS server is timed. The data to be received is generated into a data file. In this embodiment, the first preset duration is set in advance, and the ENUM-DNS server generates a data file for the data received within the first preset duration every time the first preset duration is separated. And set the file identifier corresponding to the generated file. For example, if the first preset duration is 2 minutes, the ENUM-DNS server generates a data file for the data received within the 2 minute period every 2 minutes, and sets a file identifier corresponding to the generated data file. For example, the file identifier corresponding to the generated data file is set in order from small to large. When the first data file is generated, the file identifier corresponding to the generated first data file is set to 1; when the second data file is generated. The file identifier corresponding to the generated second data file is set to 2; when the third data file is generated, the file identifier corresponding to the generated third data file is set to 3 or the like. It can be understood by those skilled in the art that the first preset duration can be flexibly set according to actual conditions, and the file identifier corresponding to each data file generated can also be set according to other rules, and is not limited herein. At the same time, each time the data file is generated, the file identifier corresponding to the generated data file is written into the first configuration file.
步骤S20,将所述数据文件写入至分布式缓存系统中,并在写入成功时,将写入成功的所述数据文件对应的文件标识写入第二配置文件中;Step S20, the data file is written into the distributed cache system, and when the writing is successful, the file identifier corresponding to the data file successfully written is written into the second configuration file;
ENUM-DNS服务器在每次生成数据文件并将数据文件对应的文件标识写入所述第一配置文件中后,将生成的数据文件写入至分布式缓存系统中。并在每次成功保存数据文件时,将成功保存的数据文件对应的文件标识写入第二配置文件中。The ENUM-DNS server writes the generated data file to the distributed cache system each time the data file is generated and the file identifier corresponding to the data file is written into the first configuration file. And each time the data file is successfully saved, the file identifier corresponding to the successfully saved data file is written into the second configuration file.
步骤S30,每隔第二预设时长,检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件写入至所述分布式缓存系统中。Step S30, detecting, according to the second preset duration, the file identifiers different from the first configuration file and the second configuration file, and writing different data files corresponding to the file identifiers to the Distributed cache system.
ENUM-DNS服务器定时对比所述第一配置文件与所述第二配置文件中写入的文件标识,检测所述第一配置文件与所述第二配置文件中是否存在不同的文件标识。在本实施例中,还预先设置了第二预设时长。ENUM-DNS服务器在每间隔所述第二预设时长时,检测所述第一配置文件与所述第二配置文件中是否存在不同的文件标识,当检测到所述第一配置文件与所述第二配置文件中存在不同文件标识时,则将所述不同文件标识对应的数据文件写入至所述分布式缓存系统中。例如,所述第一配置文件中的文件标识为文件标识1至文件标识10,所述第二配置文件中的文件标识为文件标识1至文件标识5,则所述第一配置文件与所述第二配置文件中不同的文件标识为文件标识6至文件标识10,也即说明文件标识6至文件标识10对应的数据文件未成功保存至所述分布式缓存系统中,则ENUM-DNS服务器将文件标识6至文件标识10对应的数据文件写入至所述分布式缓存系统中。The ENUM-DNS server periodically compares the file identifiers written in the first configuration file and the second configuration file, and detects whether different file identifiers exist in the first configuration file and the second configuration file. In this embodiment, the second preset duration is also set in advance. The ENUM-DNS server detects whether there is a different file identifier in the first configuration file and the second configuration file when the second preset duration is separated, when the first configuration file is detected and the When different file identifiers exist in the second configuration file, the data files corresponding to the different file identifiers are written into the distributed cache system. For example, the file identifier in the first configuration file is file identifier 1 to file identifier 10, and the file identifier in the second configuration file is file identifier 1 to file identifier 5, and the first configuration file is The different file identifiers in the second configuration file are file identifier 6 to file identifier 10, that is, the data files corresponding to the file identifier 6 to the file identifier 10 are not successfully saved to the distributed cache system, and the ENUM-DNS server will The data files corresponding to the file identifier 6 to the file identifier 10 are written into the distributed cache system.
本实施例提供的方案,ENUM-DNS服务器定时将接收的数据生成数据文件,在每次生成数据文件时,设置所述数据文件对应的文件标识,并将所述文件标识写入第一配置文件中,之后,将生成的所述数据文件写入至分布式缓存系统中,并在写入成功时,将写入成功的所述数据文件对应的文件标识写入第二配置文件中,ENUM-DNS服务器定时检测所述第一配置文件与所述第二配置文件中是否存在不同文件标识,若所述第一配置文件与所述第二配置文件中存在不同文件标识,则说明ENUM-DNS服务器与分布式缓存系统中的数据不一致,此时,ENUM-DNS服务器将不同文件标识对应的文件保存至所述分布式缓存系统中,由于不需要将ENUM-DNS服务器与分布式缓存系统中的数据文件进行对比,大大减少了检测ENUM-DNS服务器与分布式缓存系统中的数据是否一致的 时间,从而提高了维护ENUM-DNS服务器与分布式缓存系统中的数据一致性的效率,提高了ENUM-DNS服务器的可靠性。In the solution provided by the embodiment, the ENUM-DNS server generates a data file by periodically receiving the data, and each time the data file is generated, setting a file identifier corresponding to the data file, and writing the file identifier to the first configuration file. And then, the generated data file is written into the distributed cache system, and when the writing is successful, the file identifier corresponding to the data file successfully written is written into the second configuration file, ENUM- The DNS server periodically detects whether there is a different file identifier in the first configuration file and the second configuration file. If there is a different file identifier in the first configuration file and the second configuration file, the ENUM-DNS server is configured. Inconsistent with the data in the distributed cache system. At this time, the ENUM-DNS server saves the files corresponding to different file identifiers to the distributed cache system, because the data in the ENUM-DNS server and the distributed cache system are not required. Comparison of files greatly reduces the detection of data in the ENUM-DNS server and the distributed cache system. Time, which improves the efficiency of maintaining data consistency between the ENUM-DNS server and the distributed cache system, and improves the reliability of the ENUM-DNS server.
基于第一实施例提出本发明数据管理方法第二实施例,在本实施例中,所述步骤S10包括:用所述数据文件对应的文件标识写入所述第一配置文件中,以更新所述第一配置文件中保存的文件标识;The second embodiment of the data management method of the present invention is proposed based on the first embodiment. In this embodiment, the step S10 includes: writing, by using the file identifier corresponding to the data file, the first configuration file to update the The file identifier saved in the first configuration file;
所述步骤S20包括:用保存成功的所述数据文件对应的文件标识写入第二配置文件中,以更新所述第二配置文件中保存的文件标识;其中当某一数据文件未保存成功时,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警;The step S20 includes: writing a file identifier corresponding to the saved data file to the second configuration file to update the file identifier saved in the second configuration file; wherein when a data file is not successfully saved , repeatedly write the data file until the write is successful, or report the alarm when the write fails;
所述步骤S30包括:检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致;在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。The step S30 includes: detecting whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier saved in the first configuration file and the second When the file identifiers saved in the configuration file are inconsistent, the data file corresponding to the file identifier of the difference between the file identifier saved in the first configuration file and the file identifier saved in the second configuration file is written to the distribution. In the cache system.
在本实施例中,所述文件标识为按照接收顺序对所述数据文件添加的文件编号,ENUM-DNS服务器用生成的数据文件对应的文件标识写入所述第一配置文件中保存的文件标识,以更新所述第一配置文件中保存的文件标识。例如,当ENUM-DNS服务器第一次生成数据文件时,设置生成的第一个数据文件对应的文件标识为1,将生成的数据文件对应的文件标识1写入第一配置文件中并保存。当ENUM-DNS服务器第二次生成数据文件时,设置生成的第二个数据文件对应的文件标识为2,将所述文件标识2写入第一配置文件中,替换保存的文件标识1,以更新所述第一配置文件中保存的文件标识。当ENUM-DNS服务器第三次生成数据文件时,设置生成的第三个数据文件对应的文件标识为3,将所述文件标识3写入第一配置文件中,替换保存的文件标识2。依此下去,在ENUM-DNS服务器每次生成文件时,更新所述第一配置文件中保存的文件标识。In this embodiment, the file identifier is a file number added to the data file according to the receiving order, and the ENUM-DNS server writes the file identifier saved in the first configuration file by using the file identifier corresponding to the generated data file. To update the file identifier saved in the first configuration file. For example, when the ENUM-DNS server generates the data file for the first time, the file identifier corresponding to the first data file generated is set to 1, and the file identifier 1 corresponding to the generated data file is written into the first configuration file and saved. When the ENUM-DNS server generates the data file for the second time, set the file identifier corresponding to the generated second data file to 2, write the file identifier 2 into the first configuration file, and replace the saved file identifier 1 with Update the file identifier saved in the first configuration file. When the ENUM-DNS server generates the data file for the third time, the file identifier corresponding to the third data file generated is set to 3, and the file identifier 3 is written into the first configuration file, and the saved file identifier 2 is replaced. In response to this, each time the ENUM-DNS server generates a file, the file identifier saved in the first configuration file is updated.
ENUM-DNS服务器在成功将生成的第一个数据文件写入至分布式缓存系统中时,将成功写入的第一个数据文件对应的文件标识1写入第二配置文件中并保存。ENUM-DNS服务器在成功将生成的第二个数据文件保存至分布式缓存系统中时,将成功保存的第二个数据文件对应的文件标识2写入所述第二配置文件中,替换保存的文件标识1,以更新所述第二配置文件中保存的文件标识。ENUM-DNS服务器在成功将生成的第三个数据文件写入至分布式缓存系统中 时,将成功写入的第三个数据文件对应的文件标识3写入所述第二配置文件中,替换保存的文件标识2。依此下去,在ENUM-DNS服务器每次成功保存数据文件至分布式缓存系统中时,更新所述第二配置文件中保存的文件标识。当某一数据文件未保存成功时,生成的其他还未写入的数据文件不进行写入,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警。When the ENUM-DNS server successfully writes the first data file generated to the distributed cache system, the file identifier 1 corresponding to the first data file successfully written is written into the second configuration file and saved. When the ENUM-DNS server successfully saves the generated second data file to the distributed cache system, writes the file identifier 2 corresponding to the successfully saved second data file to the second configuration file, and replaces the saved file. File ID 1 to update the file ID saved in the second configuration file. The ENUM-DNS server successfully writes the generated third data file to the distributed cache system. When the file identifier 3 corresponding to the third data file successfully written is written into the second configuration file, the saved file identifier 2 is replaced. According to this, when the ENUM-DNS server successfully saves the data file to the distributed cache system, the file identifier saved in the second configuration file is updated. When a data file is not saved successfully, other generated data files that have not been written are not written, and the data file is continuously written repeatedly until the writing is successful, or an alarm is reported when the writing fails.
ENUM-DNS服务器定时检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致。在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第二配置文件中保存的文件标识与所述第一配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。例如,若所述第一配置文件中保存的文件标识为10,所述第二配置文件中保存的文件标识为5,则所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致,ENUM-DNS服务器将所述第二配置文件中保存的文件标识5与所述第一配置文件中保存的文件标识10之间差异的文件标识对应的数据文件,也即文件标识6至文件标识10对应的5个数据文件,保存至所述分布式缓存系统中。The ENUM-DNS server periodically detects whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file. And deleting, when the file identifier saved in the first configuration file is different from the file identifier saved in the second configuration file, the file identifier saved in the second configuration file and the file saved in the first configuration file A data file corresponding to the file identifier of the difference between the identifiers is written into the distributed cache system. For example, if the file identifier saved in the first configuration file is 10 and the file identifier saved in the second configuration file is 5, the file identifier saved in the first configuration file and the second configuration file are The file identifiers saved in the file are inconsistent, and the ENUM-DNS server compares the file identifiers corresponding to the file identifiers of the file identifiers 5 saved in the second configuration file with the file identifiers 10 stored in the first configuration file, that is, The five data files corresponding to the file identifier 6 to the file identifier 10 are saved in the distributed cache system.
本实施例提供的方案,ENUM-DNS服务器在每次生成数据文件时,根据所述数据文件对应的文件标识更新第一配置文件中保存的文件标识,并在将生成的所述数据文件成功写入至分布式缓存系统中时,根据所述数据文件对应的文件标识更新第二配置文件中保存的文件标识,ENUM-DNS服务器定时检测所述第一配置文件与所述第二配置文件中保存的文件标识是否一致,若所述第一配置文件与所述第二配置文件中保存的文件标识不一致,则说明ENUM-DNS服务器与分布式缓存系统中的数据不一致,此时,ENUM-DNS服务器将所述第二配置文件中保存的文件标识与所述第一配置文件中保存的文件标识之间差异的文件标识对应的数据文件保存至所述分布式缓存系统中,因此,只需对比所述第一配置文件与所述第二配置文件中保存的文件标识,减少了检测ENUM-DNS服务器与分布式缓存系统中的数据是否一致的时间,从而提高了ENUM-DNS服务器的可靠性。In the solution provided by the embodiment, the ENUM-DNS server updates the file identifier saved in the first configuration file according to the file identifier corresponding to the data file each time the data file is generated, and successfully writes the generated data file. When the data is added to the distributed cache system, the file identifier saved in the second configuration file is updated according to the file identifier corresponding to the data file, and the ENUM-DNS server periodically detects the first configuration file and the second configuration file. If the file identifiers are consistent, if the first configuration file is inconsistent with the file identifier saved in the second configuration file, the data in the ENUM-DNS server is different from the distributed cache system. In this case, the ENUM-DNS server Saving a data file corresponding to the file identifier of the difference between the file identifier saved in the second configuration file and the file identifier saved in the first configuration file to the distributed cache system, so The first configuration file and the file identifier saved in the second configuration file reduce the detection of the ENUM-DNS server and the distributed Whether the data in the system is consistent or not, thereby improving the reliability of the ENUM-DNS server.
如图2所示,基于第一实施例或第二实施例提出本发明数据管理方法第三实施例,在本实施例中,所述数据管理方法还包括步骤:As shown in FIG. 2, a third embodiment of the data management method of the present invention is proposed based on the first embodiment or the second embodiment. In this embodiment, the data management method further includes the following steps:
步骤S40,每隔第三预设时长,发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应 消息;Step S40: Send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether a response of the node corresponding to each preset space is received. Message
步骤S50,在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点;In step S50, when the response message fed back by the node corresponding to the preset space is not received, it is determined that the node corresponding to the preset space is an abnormal node;
步骤S60,统计所述分布式缓存系统中异常节点的个数,若所述异常节点的个数大于预设数量阈值,则向运维系统发送报警信息,同时关闭接收数据的功能,每间隔第一预设时长不再生成新的数据文件,直至系统恢复正常。Step S60: The number of abnormal nodes in the distributed cache system is counted. If the number of the abnormal nodes is greater than a preset number threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. A new data file is no longer generated for a preset duration until the system returns to normal.
在本实施例中,预先设置所述分布式缓存系统中每个节点对应的预设空间,并设置一特别空间,例如,将所述特别空间设置为0号空间,所述0号空间用于在ENUM-DNS服务器将开销户的数据生成文件后,保存ENUM-DNS服务器生成的文件,并将保存的文件均衡负载至其他每个预设空间对应的节点,从而保证每个节点均衡的存储及查询数据。所述预设空间与节点一一对应,也即保证了每个节点完全负载一个查询空间。In this embodiment, a preset space corresponding to each node in the distributed cache system is preset, and a special space is set, for example, the special space is set to space 0, and the space 0 is used for After the ENUM-DNS server generates the file of the data of the overhead user, the file generated by the ENUM-DNS server is saved, and the saved file is evenly loaded to the nodes corresponding to each preset space, thereby ensuring balanced storage of each node and Query data. The preset space corresponds to the nodes one by one, that is, each node is completely loaded with one query space.
ENUM-DNS服务器初始化时,分别向每个预设空间写入一条固定的记录,所述固定的记录为ENUM-DNS服务器初始化对应的固定记录,形式在此不作限制。当重复写入记录时,只要重复写入的所述记录的key值与前一次写入的记录的key值一样,则将重复写入的所述记录覆盖前一次写入的记录。当写入失败时,则不允许ENUM-DNS服务器启动,ENUM-DNS服务器初始化失败;当写入成功时,ENUM-DNS服务器初始化成功。当ENUM-DNS服务器初始化成功后,ENUM-DNS服务器定时每个第三预设时长向每个预设空间对应的节点发送检测消息,例如,ENUM-DNS服务器每间隔5分钟向每个预设空间对应的节点发送检测消息。若预设空间对应的节点为正常节点,则预设空间对应的节点在接收到所述检测消息时,反馈响应消息至ENUM-DNS服务器;若预设空间对应的节点为异常节点,则无法反馈响应消息至ENUM-DNS服务器。When the ENUM-DNS server is initialized, a fixed record is written to each preset space, and the fixed record is a fixed record corresponding to the ENUM-DNS server initialization, and the form is not limited herein. When the write record is repeatedly written, as long as the key value of the record repeatedly written is the same as the key value of the record previously written, the record repeatedly written overwrites the previously written record. When the write fails, the ENUM-DNS server is not allowed to start, and the ENUM-DNS server fails to initialize; when the write is successful, the ENUM-DNS server is successfully initialized. After the ENUM-DNS server is successfully initialized, the ENUM-DNS server periodically sends a detection message to each node corresponding to the preset space for each third preset duration. For example, the ENUM-DNS server provides each preset space every 5 minutes. The corresponding node sends a detection message. If the node corresponding to the preset space is a normal node, the node corresponding to the preset space feeds back the response message to the ENUM-DNS server when receiving the detection message; if the node corresponding to the preset space is an abnormal node, the node cannot be fed back. Response message to the ENUM-DNS server.
ENUM-DNS服务器向每个预设空间对应的节点发送检测消息后,检测是否接收到每个预设空间对应的节点反馈的响应消息,若未接收到某一预设空间对应的节点反馈的响应消息,则判定该预设空间对应的节点为异常节点;若接收到某一预设空间对应的节点反馈的响应消息,则判定该预设空间对应的节点为正常节点。After sending the detection message to the node corresponding to each preset space, the ENUM-DNS server detects whether the response message fed back by the node corresponding to each preset space is received, and if the response of the node corresponding to the preset space is not received, The message is determined to be an abnormal node; if the response message fed back by the node corresponding to the preset space is received, the node corresponding to the preset space is determined to be a normal node.
之后,ENUM-DNS服务器统计分布式缓存系统中异常节点的个数,当统计的所述异常节点的个数大于预设数量阈值A时,也即不能保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性时,ENUM-DNS服务器向运维 系统发送报警信息。当统计的所述异常节点的个数小于或等于所述预设数量阈值A时,虽然理论上存在ENUM-DNS服务器中的数据与分布式缓存系统中数据不一致的可能,但为了兼顾数据的可用性,可以认为依然能够保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性。所述预设数量阈值A的值根据所述分布式缓存系统采用的NRW副本策略进行设置,例如,若所述分布式缓存系统采用3-2-2副本策略时,则所述预设数量阈值A的值设置为3,当所述分布式缓存系统中存在3个以上的节点为异常节点时,则无法保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性。此时,ENUM-DNS服务器向运维系统发送告警,并且不允许运维系统或者SPN继续向ENUM-DNS服务器下发开销户的数据,以保证ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性。也即关闭接收运维系统或者SPN下发的数据的功能,每间隔所述第一预设时长不再生成新的数据文件,直至系统恢复正常。After that, the ENUM-DNS server counts the number of abnormal nodes in the distributed cache system. When the number of the abnormal nodes is greater than the preset threshold A, the data and the distributed data in the ENUM-DNS server cannot be guaranteed. ENUM-DNS server to operation and maintenance when the data in the cache system is consistent The system sends an alarm message. When the number of the abnormal nodes is less than or equal to the preset number threshold A, although there is theoretical possibility that the data in the ENUM-DNS server is inconsistent with the data in the distributed cache system, in order to balance the availability of data It can be considered that the data in the ENUM-DNS server can still be guaranteed to be consistent with the data in the distributed cache system. The value of the preset number threshold A is set according to the NRW copy policy adopted by the distributed cache system, for example, if the distributed cache system adopts a 3-2-2 copy policy, the preset number threshold The value of A is set to 3. When there are more than three nodes in the distributed cache system as abnormal nodes, the consistency between the data in the ENUM-DNS server and the data in the distributed cache system cannot be guaranteed. At this time, the ENUM-DNS server sends an alarm to the operation and maintenance system, and does not allow the operation and maintenance system or the SPN to continue to send the data of the overhead household to the ENUM-DNS server to ensure the data in the ENUM-DNS server and the distributed cache system. Data consistency. That is, the function of receiving data sent by the operation and maintenance system or the SPN is closed, and a new data file is no longer generated every interval of the first preset duration until the system returns to normal.
在本实施例中,所述步骤S50包括:In this embodiment, the step S50 includes:
步骤a,在未接收到某一预设空间对应的节点反馈的响应消息时,更新未接收到所述响应消息的次数;In step a, when the response message fed back by the node corresponding to the preset space is not received, the number of times the response message is not received is updated;
步骤b,判断所述次数是否大于等于预设次数,其中当未接受到所述响应消息的次数大于等于预设次数时,所述预设空间对应的节点为异常节点。In step b, it is determined whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
为了提高判断分布式缓存系统中每个预设空间对应的节点是否为异常节点的精确性,在本实施例中,ENUM-DNS服务器在每次发送检测消息至每个预设空间对应的节点后,若未接收到某一预设空间对应的节点反馈的响应消息,则更新未接收到所述预设空间对应的节点反馈的响应消息的次数。ENUM-DNS服务器判断所述次数是否大于等于预设次数,当未接收到所述预设空间对应的节点反馈的响应消息的次数大于等于预设次数时,判定所述预设空间对应的节点为异常节点。例如,若设置所述预设次数为3次,当ENUM-DNS服务器发送3次检测消息至每个预设空间对应的节点后,若ENUM-DNS服务器3次都未接收到某一预设空间对应的节点反馈的响应消息,则判定该预设空间对应的节点为异常节点。In order to improve the accuracy of determining whether the node corresponding to each preset space in the distributed cache system is an abnormal node, in this embodiment, the ENUM-DNS server sends a detection message to each node corresponding to the preset space each time. And if the response message fed back by the node corresponding to the preset space is not received, updating the number of times the response message fed back by the node corresponding to the preset space is not received. The ENUM-DNS server determines whether the number of times is greater than or equal to a preset number of times. When the number of response messages fed back by the node corresponding to the preset space is not greater than or equal to a preset number of times, determining that the node corresponding to the preset space is Anomalous node. For example, if the preset number of times is set to 3 times, when the ENUM-DNS server sends the detection message 3 times to the node corresponding to each preset space, if the ENUM-DNS server does not receive a preset space 3 times. The response message fed back by the corresponding node determines that the node corresponding to the preset space is an abnormal node.
本实施例提供的方案,ENUM-DNS服务器定时发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息,在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点,ENUM-DNS服务器统计所述分布式 缓存系统中异常节点的个数,当异常节点的个数大于预设数量阈值时,也即在不能保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性时,向运维系统发送报警信息,因此,实现了兼顾数据的一致性与可用性,提高了ENUM-DNS服务器的可靠性。In the solution provided by the embodiment, the ENUM-DNS server periodically sends a detection message to the node corresponding to each preset space in the distributed cache system, and detects whether a response message fed back by the node corresponding to each preset space is received. When the response message fed back by the node corresponding to the preset space is not received, it is determined that the node corresponding to the preset space is an abnormal node, and the ENUM-DNS server collects the distributed information. The number of abnormal nodes in the cache system. When the number of abnormal nodes is greater than the preset threshold, that is, when the data in the ENUM-DNS server cannot be guaranteed to be consistent with the data in the distributed cache system, the operation and maintenance system is Sending alarm information, therefore, achieves consistency and availability of data, and improves the reliability of the ENUM-DNS server.
基于上述任一实施例提出本发明数据管理方法第四实施例,在本实施例中,所述数据管理方法还包括:A fourth embodiment of the data management method of the present invention is provided based on any of the foregoing embodiments. In this embodiment, the data management method further includes:
步骤c,在所述分布式缓存系统有节点的数据文件出现故障时,根据所述节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述节点。In step c, when the data file of the node in the distributed cache system is faulty, the data file corresponding to the file directory is sequentially copied from the standby node to the node according to the file directory of the node.
由于IMS网络环境的复杂性,分布式缓存系统有可能会出现灾难性故障,导致某些预设空间对应的节点的数据全部丢失,或者数据不可靠等问题。此时,需要对这些出现数据故障的异常节点的数据进行恢复。在本实施例,每个分布式缓存系统都存在一个备用系统,正常情况下,所述备用系统的备用节点中保存的数据与所述分布式缓存系统保存的数据一致。在对所述分布式缓存系统中异常节点的数据进行恢复时,根据所述异常节点的文件目录,在备用系统的备用节点中依次拷贝所述文件目录对应的数据文件至所述异常节点,从而完成所述异常节点的数据的恢复。若异常节点的文件目录也已经损坏,也即不能通过文件目录从备用节点中拷贝数据文件时,则重新设置分布式缓存系统中每个节点对应的预设空间,ENUM-DNS服务器重新初始化,在初始化完成后将备用系统的备用节点中保存的数据依次全部拷贝至所述分布式缓存系统中每个预设空间对应的节点上。Due to the complexity of the IMS network environment, the distributed cache system may have catastrophic failures, resulting in the loss of data of nodes corresponding to some preset spaces or unreliable data. At this point, you need to recover the data of these abnormal nodes with data failures. In this embodiment, each of the distributed cache systems has a backup system. Normally, the data stored in the standby node of the standby system is consistent with the data held by the distributed cache system. When the data of the abnormal node in the distributed cache system is restored, the data file corresponding to the file directory is sequentially copied to the abnormal node in the standby node of the standby system according to the file directory of the abnormal node, thereby The recovery of the data of the abnormal node is completed. If the file directory of the abnormal node is also damaged, that is, the data file cannot be copied from the standby node through the file directory, the preset space corresponding to each node in the distributed cache system is reset, and the ENUM-DNS server is re-initialized. After the initialization is completed, the data saved in the standby node of the backup system is sequentially copied to the node corresponding to each preset space in the distributed cache system.
在本实施例中,在对异常节点的数据进行恢复时,只需根据所述异常节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述异常节点,即可完成异常节点的数据的恢复,而不需要拷贝所有的数据文件,因此,实现了数据的快速恢复,从而提高了ENUM-DNS服务器的可靠性。In this embodiment, when the data of the abnormal node is restored, the data file corresponding to the file directory is sequentially copied from the standby node to the abnormal node according to the file directory of the abnormal node, and the The recovery of the data of the abnormal node without copying all the data files, thus realizing the rapid recovery of the data, thereby improving the reliability of the ENUM-DNS server.
本发明实施例还提供一种数据管理装置,如图3所示,图3为本发明数据管理装置第一实施例的功能模块示意图。The embodiment of the present invention further provides a data management apparatus. As shown in FIG. 3, FIG. 3 is a schematic diagram of functional modules of a first embodiment of a data management apparatus according to the present invention.
在本实施例中,该数据管理装置包括:In this embodiment, the data management device includes:
生成模块10,被配置为在每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识,保存所述数据文件并将所述数据文件对应的文件标识写入第一配置文件中; The generating module 10 is configured to generate a data file for the received data every other first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file. Into the first configuration file;
运维系统或SPN(Service Provisioning Node,开销户网关)将开销户的数据下发至ENUM-DNS(E.164Number URI Mapping-Domain Name System,电话号码映射-域名系统)服务器,生成模块10在接收到所述数据后,定时将接收到的所述数据生成数据文件。在本实施例中,预先设置了第一预设时长,生成模块10在每间隔所述第一预设时长时,就将在所述第一预设时长内接收到的数据生成数据文件,并设置生成的数据文件对应的文件标识。例如,若所述第一预设时长为2分钟,则生成模块10每间隔2分钟就将在该2分钟时长内接收到的数据生成数据文件,并设置生成的数据文件对应的文件标识,比如,按照从小到大的顺序设置生成的数据文件对应的文件标识,在生成第一个数据文件时,设置生成的第一个数据文件对应的文件标识为1;在生成第二个数据文件时,设置生成的第二个数据文件对应的文件标识为2;在生成第三个数据文件时,设置生成的第三个数据文件对应的文件标识为3等。本领域技术人员可以理解的是,所述第一预设时长可根据实际情况灵活设置,生成的每个数据文件对应的文件标识也可按照其他规则进行设置,在此不做限制。同时,在每次生成数据文件时,将生成的数据文件对应的文件标识写入第一配置文件中。The operation and maintenance system or the SPN (Service Provisioning Node) delivers the data of the overhead household to the ENUM-DNS (E.164 Number URI Mapping-Domain Name System) server, and the generation module 10 receives the data. After the data is received, the received data is periodically generated to generate a data file. In this embodiment, the first preset duration is set in advance, and the generating module 10 generates a data file for the data received within the first preset duration every time the first preset duration is separated, and Set the file identifier corresponding to the generated data file. For example, if the first preset duration is 2 minutes, the generating module 10 generates a data file for the data received within the 2 minute period every 2 minutes, and sets a file identifier corresponding to the generated data file, for example, The file identifier corresponding to the generated data file is set in order from small to large. When the first data file is generated, the file identifier corresponding to the first data file generated is set to 1; when the second data file is generated, The file identifier corresponding to the generated second data file is set to 2; when the third data file is generated, the file identifier corresponding to the generated third data file is set to 3 or the like. It can be understood by those skilled in the art that the first preset duration can be flexibly set according to actual conditions, and the file identifier corresponding to each data file generated can also be set according to other rules, and is not limited herein. At the same time, each time the data file is generated, the file identifier corresponding to the generated data file is written into the first configuration file.
处理模块20,被配置为将所述数据文件写入至分布式缓存系统中,并在写入成功时,将写入成功的所述数据文件对应的文件标识写入第二配置文件中;The processing module 20 is configured to write the data file into the distributed cache system, and write the file identifier corresponding to the data file successfully written into the second configuration file when the writing is successful;
在生成模块10每次生成数据文件并将数据文件对应的文件标识写入前台第一配置文件中后,处理模块20将生成的数据文件写入至分布式缓存系统中。并在每次成功写入数据文件时,将成功写入的数据文件对应的文件标识写入第二配置文件中。After the generating module 10 generates a data file each time and writes the file identifier corresponding to the data file into the foreground first configuration file, the processing module 20 writes the generated data file into the distributed cache system. And each time the data file is successfully written, the file identifier corresponding to the successfully written data file is written into the second configuration file.
存储模块30,被配置为在每隔第二预设时长,检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件保存至所述分布式缓存系统中。The storage module 30 is configured to detect the file identifiers different from the first configuration file and the second configuration file every second preset duration, and identify different data files corresponding to the different files. Saved to the distributed cache system.
存储模块30定时对比所述第一配置文件与所述第二配置文件中写入的文件标识,检测所述第一配置文件与所述第二配置文件中是否存在不同的文件标识。在本实施例中,还预先设置了第二预设时长。存储模块30在每间隔所述第二预设时长时,检测所述第一配置文件与所述第二配置文件中是否存在不同的文件标识,当检测到所述第一配置文件与所述第二配置文件中存在不同文件标识时,则将所述不同文件标识对应的数据文件写入至所述分布式缓存系统中。例如,所述第一配置文件中的文件标识为文件标识1至文件标识10,所述第二配置文 件中的文件标识为文件标识1至文件标识5,则所述第一配置文件与所述第二配置文件中的不同文件标识为文件标识6至文件标识10,也即说明文件标识6至文件标识10对应的数据文件未成功写入至所述分布式缓存系统中,则存储模块30将文件标识6至文件标识10对应的数据文件写入至所述分布式缓存系统中。The storage module 30 periodically compares the file identifiers written in the first configuration file and the second configuration file, and detects whether different file identifiers exist in the first configuration file and the second configuration file. In this embodiment, the second preset duration is also set in advance. The storage module 30 detects whether there is a different file identifier in the first configuration file and the second configuration file when the second preset duration is separated, when the first configuration file and the first When different file identifiers exist in the second configuration file, the data files corresponding to the different file identifiers are written into the distributed cache system. For example, the file identifier in the first configuration file is file identifier 1 to file identifier 10, and the second configuration file The file identifiers in the file are file identifier 1 to file identifier 5, and the different file identifiers in the first configuration file and the second configuration file are file identifier 6 to file identifier 10, that is, the file identifier 6 to the file. If the data file corresponding to the identifier 10 is not successfully written into the distributed cache system, the storage module 30 writes the data file corresponding to the file identifier 6 to the file identifier 10 into the distributed cache system.
本实施例提供的方案,生成模块10定时将接收的数据生成数据文件,在每次生成数据文件时,设置所述数据文件对应的文件标识,并将所述文件标识写入第一配置文件中,处理模块20将生成的所述数据文件写入至分布式缓存系统中,并在写入成功时,将写入成功的所述数据文件对应的文件标识写入第二配置文件中,存储模块30定时检测所述第一配置文件与所述第二配置文件中是否存在不同文件标识,若所述第一配置文件与所述第二配置文件中存在不同文件标识,则说明ENUM-DNS服务器与分布式缓存系统中的数据不一致,此时,存储模块30将不同文件标识对应的数据文件保存至所述分布式缓存系统中,由于不需要将ENUM-DNS服务器与分布式缓存系统中的数据文件进行对比,大大减少了检测ENUM-DNS服务器与分布式缓存系统中的数据是否一致的时间,从而提高了维护ENUM-DNS服务器与分布式缓存系统中的数据一致性的效率,提高了ENUM-DNS服务器的可靠性。In the solution provided by the embodiment, the generating module 10 periodically generates a data file by receiving the data, and each time the data file is generated, setting a file identifier corresponding to the data file, and writing the file identifier into the first configuration file. The processing module 20 writes the generated data file into the distributed cache system, and writes the file identifier corresponding to the successfully written data file into the second configuration file when the write is successful, and the storage module The timer detects whether there is a different file identifier in the first configuration file and the second configuration file. If there is a different file identifier in the first configuration file and the second configuration file, the ENUM-DNS server is The data in the distributed cache system is inconsistent. At this time, the storage module 30 saves the data files corresponding to the different file identifiers to the distributed cache system, because the data files in the ENUM-DNS server and the distributed cache system are not required. Contrast, greatly reducing the time to detect whether the ENUM-DNS server is consistent with the data in the distributed cache system, thus improving the Data protection ENUM-DNS server with distributed cache coherence system efficiency, improve the reliability of ENUM-DNS server.
基于第一实施例提出本发明数据管理装置第二实施例,在本实施例中,所述生成模块10,还被配置为用生成的数据文件对应的文件标识写入所述第一配置文件中,以更新所述第一配置文件中保存的文件标识;A second embodiment of the data management apparatus of the present invention is proposed based on the first embodiment. In this embodiment, the generating module 10 is further configured to write the file identifier corresponding to the generated data file into the first configuration file. To update the file identifier saved in the first configuration file;
所述处理模块20,还被配置为用保存成功的数据文件对应的文件标识写入第二配置文件中,以更新所述第二配置文件中保存的文件标识;其中当某一数据文件未保存成功时,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警;The processing module 20 is further configured to write the file identifier corresponding to the saved data file to the second configuration file to update the file identifier saved in the second configuration file; wherein when a certain data file is not saved On success, the data file is continuously written repeatedly until the write is successful, or the alarm is reported when the write fails;
所述存储模块30,还被配置为检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致;在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。The storage module 30 is further configured to detect whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier saved in the first configuration file When the file identifiers saved in the second configuration file are inconsistent, the data files corresponding to the file identifiers of the difference between the file identifiers saved in the first configuration file and the file identifiers saved in the second configuration file are written. To the distributed cache system.
在本实施例中,所述文件标识为按照接收顺序对所述数据文件添加的文件编号,生成模块10用生成的数据文件对应的文件标识写入所述第一配置文件中保存的文件标识,以更新所述第一配置文件中保存的文件标识。例如,当生成 模块10第一次生成数据文件时,设置生成的第一个数据文件对应的文件标识为1,将生成的数据文件对应的文件标识1写入第一配置文件中并保存。当生成模块10第二次生成数据文件时,设置生成的第二个数据文件对应的文件标识为2,将所述文件标识2写入第一配置文件中,替换保存的文件标识1,以更新所述第一配置文件中保存的文件标识。当生成模块10第三次生成数据文件时,设置生成的第三个数据文件对应的文件标识为3,将所述文件标识3写入第一配置文件中,替换保存的文件标识2。依此下去,在生成模块10每次生成数据文件时,更新所述第一配置文件中保存的文件标识。In this embodiment, the file identifier is a file number added to the data file according to the receiving order, and the generating module 10 writes the file identifier saved in the first configuration file by using the file identifier corresponding to the generated data file. To update the file identifier saved in the first configuration file. For example, when generating When the module 10 generates the data file for the first time, the file identifier corresponding to the first data file generated is set to 1, and the file identifier 1 corresponding to the generated data file is written into the first configuration file and saved. When the generating module 10 generates the data file for the second time, setting the file identifier corresponding to the generated second data file to 2, writing the file identifier 2 into the first configuration file, and replacing the saved file identifier 1 to update The file identifier saved in the first configuration file. When the generating module 10 generates the data file for the third time, the file identifier corresponding to the generated third data file is set to 3, and the file identifier 3 is written into the first configuration file, and the saved file identifier 2 is replaced. In response to this, each time the generation module 10 generates a data file, the file identifier saved in the first configuration file is updated.
处理模块20在成功将生成的第一个数据文件写入至分布式缓存系统中时,将成功写入的第一个数据文件对应的文件标识1写入第二配置文件中并保存。处理模块20在成功将生成的第二个数据文件写入至分布式缓存系统中时,将成功写入的第二个数据文件对应的文件标识2写入所述第二配置文件中,替换保存的文件标识1,以更新所述第二配置文件中保存的文件标识。处理模块20在成功将生成的第三个数据文件保存至分布式缓存系统中时,将成功保存的第三个数据文件对应的文件标识3写入所述第二配置文件中,替换保存的文件标识2。依此下去,在处理模块20每次成功写入数据文件至分布式缓存系统中时,更新所述第二配置文件中保存的文件标识。当某一数据文件未写入成功时,处理模块20不将其他未写入的数据文件进行写入,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警。When the processing module 20 successfully writes the generated first data file into the distributed cache system, the file identifier 1 corresponding to the successfully written first data file is written into the second configuration file and saved. When the processing module 20 successfully writes the generated second data file to the distributed cache system, the file identifier 2 corresponding to the successfully written second data file is written into the second configuration file, and is replaced and saved. The file identifier 1 is to update the file identifier saved in the second configuration file. When the processing module 20 successfully saves the generated third data file to the distributed cache system, the file identifier 3 corresponding to the successfully saved third data file is written into the second configuration file, and the saved file is replaced. Logo 2. Accordingly, each time the processing module 20 successfully writes the data file to the distributed cache system, the file identifier saved in the second configuration file is updated. When a certain data file is not successfully written, the processing module 20 does not write other unwritten data files, continuously writes the data file repeatedly until the writing is successful, or reports an alarm when the writing fails.
存储模块30定时检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致,例如每间隔所述第二预设时长检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致。在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第二配置文件中保存的文件标识与所述第一配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。例如,若所述第一配置文件中保存的文件标识为10,所述第二配置文件中保存的文件标识为5,则所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致,存储模块30将所述第二配置文件中保存的文件标识5至所述第一配置文件中保存的文件标识10之间差异的文件标识对应的数据文件,也即文件标识6至文件标识10对应的5个数据文件,写入至所述分布式缓存系统中。 The storage module 30 periodically detects whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file, for example, detecting the saving in the first configuration file every second preset duration Whether the file identifier is consistent with the file identifier saved in the second configuration file. And deleting, when the file identifier saved in the first configuration file is different from the file identifier saved in the second configuration file, the file identifier saved in the second configuration file and the file saved in the first configuration file A data file corresponding to the file identifier of the difference between the identifiers is written into the distributed cache system. For example, if the file identifier saved in the first configuration file is 10 and the file identifier saved in the second configuration file is 5, the file identifier saved in the first configuration file and the second configuration file are The file identifiers saved in the file are inconsistent, and the storage module 30 identifies the file identifiers stored in the second configuration file to a data file corresponding to the file identifier of the difference between the file identifiers 10 stored in the first configuration file, that is, the file. The five data files corresponding to the identifier 6 to the file identifier 10 are written into the distributed cache system.
本实施例提供的方案,生成模块10在每次生成数据文件时,根据所述数据文件对应的文件标识更新第一配置文件中保存的文件标识,处理模块20在将生成的所述数据文件成功写入至分布式缓存系统中时,根据所述数据文件对应的文件标识更新第二配置文件中保存的文件标识,存储模块30定时检测所述第一配置文件与所述第二配置文件中保存的文件标识是否一致,若所述第一配置文件与所述第二配置文件中保存的文件标识不一致,则说明ENUM-DNS服务器与分布式缓存系统中的数据不一致,此时,存储模块30将所述第二配置文件中保存的文件标识与所述第一配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中,因此,只需对比所述第一配置文件与所述第二配置文件中保存的文件标识,减少了检测ENUM-DNS服务器与分布式缓存系统中的数据是否一致的时间,从而提高了ENUM-DNS服务器的可靠性。In the solution provided by the embodiment, the generating module 10 updates the file identifier saved in the first configuration file according to the file identifier corresponding to the data file each time the data file is generated, and the processing module 20 succeeds in generating the data file. When the file is written to the distributed cache system, the file identifier saved in the second configuration file is updated according to the file identifier corresponding to the data file, and the storage module 30 periodically detects the first configuration file and the second configuration file. If the file identifiers are consistent, if the first configuration file is inconsistent with the file identifier saved in the second configuration file, the data in the ENUM-DNS server is different from that in the distributed cache system. In this case, the storage module 30 The data file corresponding to the file identifier of the difference between the file identifier saved in the second configuration file and the file identifier saved in the first configuration file is written into the distributed cache system, so only the comparison The first configuration file and the file identifier saved in the second configuration file reduce detection of ENUM-DNS server and distributed The data storage system is consistent in time, thereby improving the reliability of ENUM-DNS server.
如图4所示,基于第一实施例或第二实施例提出本发明数据管理装置第三实施例,在本实施例中,所述数据管理装置还包括:As shown in FIG. 4, a third embodiment of the data management apparatus of the present invention is proposed based on the first embodiment or the second embodiment. In this embodiment, the data management apparatus further includes:
发送模块40,被配置为每隔第三预设时长,发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息;The sending module 40 is configured to send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether the node corresponding to each preset space is received. Response message
判断模块50,被配置为在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点;The determining module 50 is configured to determine that the node corresponding to the preset space is an abnormal node when the response message fed back by the node corresponding to the preset space is not received;
报警模块60,被配置为统计所述分布式缓存系统中异常节点的个数,若所述异常节点的个数大于预设数量阈值,则向运维系统发送报警信息,同时关闭接收数据的功能,每间隔第一预设时长不再生成新的数据文件,直至系统恢复正常。The alarm module 60 is configured to count the number of abnormal nodes in the distributed cache system. If the number of the abnormal nodes is greater than a preset threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. The new data file is no longer generated every first preset interval until the system returns to normal.
在本实施例中,预先设置所述分布式缓存系统中每个节点对应的预设空间,并设置一特别空间,例如,将所述特别空间设置为0号空间,所述0号空间用于在生成模块10将开销户的数据生成文件后,保存生成模块10生成的文件,并将保存的文件均衡负载至其他每个预设空间对应的节点,从而保证每个节点均衡的存储及查询数据。所述预设空间与节点一一对应,也即保证了每个节点完全负载一个查询空间。In this embodiment, a preset space corresponding to each node in the distributed cache system is preset, and a special space is set, for example, the special space is set to space 0, and the space 0 is used for After the generating module 10 generates the file of the data of the overhead user, the file generated by the generating module 10 is saved, and the saved file is evenly loaded to the nodes corresponding to each of the preset spaces, thereby ensuring balanced storage and query data of each node. . The preset space corresponds to the nodes one by one, that is, each node is completely loaded with one query space.
ENUM-DNS服务器初始化时,分别向每个预设空间写入一条固定的记录,所述固定的记录为ENUM-DNS服务器初始化对应的固定记录,形式在此不作限 制。当重复写入记录时,只要重复写入的所述记录的key值与前一次写入的记录的key值一样,则将重复写入的所述记录覆盖前一次写入的记录。当写入失败时,则不允许ENUM-DNS服务器启动,ENUM-DNS服务器初始化失败;当写入成功时,ENUM-DNS服务器初始化成功。当ENUM-DNS服务器初始化成功后,发送模块40定时每个第三预设时长向每个预设空间对应的节点发送检测消息,例如,发送模块40每间隔5分钟向每个预设空间对应的节点发送检测消息。若预设空间对应的节点为正常节点,则预设空间对应的节点在接收到所述检测消息时,反馈响应消息至发送模块40;若预设空间对应的节点为异常节点,则无法反馈响应消息至发送模块40。When the ENUM-DNS server is initialized, a fixed record is written to each preset space, and the fixed record is a fixed record corresponding to the initialization of the ENUM-DNS server, and the form is not limited herein. system. When the write record is repeatedly written, as long as the key value of the record repeatedly written is the same as the key value of the record previously written, the record repeatedly written overwrites the previously written record. When the write fails, the ENUM-DNS server is not allowed to start, and the ENUM-DNS server fails to initialize; when the write is successful, the ENUM-DNS server is successfully initialized. After the ENUM-DNS server is successfully initialized, the sending module 40 sends a detection message to each node corresponding to the preset space every third preset duration. For example, the sending module 40 corresponds to each preset space every 5 minutes. The node sends a detection message. If the node corresponding to the preset space is a normal node, the node corresponding to the preset space feeds back the response message to the sending module 40 when receiving the detection message; if the node corresponding to the preset space is an abnormal node, the response cannot be fed back. The message is sent to the sending module 40.
发送模块40向每个预设空间对应的节点发送检测消息后,检测是否接收到每个预设空间对应的节点反馈的响应消息,若未接收到某一预设空间对应的节点反馈的响应消息,则判断模块50判定该预设空间对应的节点为异常节点;若接收到某一预设空间对应的节点反馈的响应消息,则判断模块50判定该预设空间对应的节点为正常节点。After sending the detection message to the node corresponding to each preset space, the sending module 40 detects whether the response message fed back by the node corresponding to each preset space is received, and if the response message of the node corresponding to the preset space is not received, The determining module 50 determines that the node corresponding to the preset space is an abnormal node. If the response message fed back by the node corresponding to the preset space is received, the determining module 50 determines that the node corresponding to the preset space is a normal node.
之后,统计分布式缓存系统中异常节点的个数,当统计的所述异常节点的个数大于预设数量阈值A时,也即不能保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性时,报警模块60向运维系统发送报警信息。当统计的所述异常节点的个数小于或等于所述预设数量阈值A时,虽然理论上存在ENUM-DNS服务器中的数据与分布式缓存系统中数据不一致的可能,但为了兼顾数据的可用性,可以认为依然能够保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性。所述预设数量阈值A的值根据所述分布式缓存系统采用的NRW副本策略进行设置,例如,若所述分布式缓存系统采用3-2-2副本策略时,则所述预设数量阈值A的值设置为3,当所述分布式缓存系统中存在3个以上的节点为异常节点时,则无法保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性。此时,报警模块60向运维系统发送告警,并且不允许运维系统或者SPN继续向ENUM-DNS服务器下发开销户的数据,以保证ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性。也即关闭接收运维系统或者SPN下发的数据的功能,每间隔所述第一预设时长不再生成新的数据文件,直至系统恢复正常。After that, the number of abnormal nodes in the distributed cache system is counted. When the number of the abnormal nodes is greater than the preset number threshold A, the data in the ENUM-DNS server and the data in the distributed cache system cannot be guaranteed. When the consistency is reached, the alarm module 60 sends an alarm message to the operation and maintenance system. When the number of the abnormal nodes is less than or equal to the preset number threshold A, although there is theoretical possibility that the data in the ENUM-DNS server is inconsistent with the data in the distributed cache system, in order to balance the availability of data It can be considered that the data in the ENUM-DNS server can still be guaranteed to be consistent with the data in the distributed cache system. The value of the preset number threshold A is set according to the NRW copy policy adopted by the distributed cache system, for example, if the distributed cache system adopts a 3-2-2 copy policy, the preset number threshold The value of A is set to 3. When there are more than three nodes in the distributed cache system as abnormal nodes, the consistency between the data in the ENUM-DNS server and the data in the distributed cache system cannot be guaranteed. At this time, the alarm module 60 sends an alarm to the operation and maintenance system, and does not allow the operation and maintenance system or the SPN to continue to send the data of the overhead household to the ENUM-DNS server to ensure the data in the ENUM-DNS server and the data in the distributed cache system. Consistency. That is, the function of receiving data sent by the operation and maintenance system or the SPN is closed, and a new data file is no longer generated every interval of the first preset duration until the system returns to normal.
在本实施例中,所述判断模块50还被配置为:In this embodiment, the determining module 50 is further configured to:
在未接收到某一预设空间对应的节点反馈的响应消息时,更新未接收到所 述响应消息的次数;When the response message fed back by the node corresponding to a certain preset space is not received, the update does not receive the received message. The number of times the response message is reported;
判断所述次数是否大于等于预设次数,其中当未接受到所述响应消息的次数大于等于预设次数时,所述预设空间对应的节点为异常节点。Determining whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
为了提高判断分布式缓存系统中每个预设空间对应的节点是否为异常节点的精确性,在本实施例中,在发送模块40每次发送检测消息至每个预设空间对应的节点后,若未接收到某一预设空间对应的节点反馈的响应消息,判断模块50则更新未接收到所述预设空间对应的节点反馈的响应消息的次数,判断所述次数是否大于等于预设次数,当未接收到所述预设空间对应的节点反馈的响应消息的次数大于等于预设次数时,判定所述预设空间对应的节点为异常节点。例如,若设置所述预设次数为3次,当发送模块40发送3次检测消息至每个预设空间对应的节点后,若3次都未接收到某一预设空间对应的节点反馈的响应消息,则判断模块50判定该预设空间对应的节点为异常节点。In order to improve the accuracy of determining whether the node corresponding to each preset space in the distributed cache system is an abnormal node, in the embodiment, after the sending module 40 sends the detection message to the node corresponding to each preset space, If the response message fed back by the node corresponding to the preset space is not received, the determining module 50 updates the number of times that the response message fed back by the node corresponding to the preset space is not received, and determines whether the number of times is greater than or equal to the preset number of times. And determining that the node corresponding to the preset space is an abnormal node, when the number of the response messages fed back by the node corresponding to the preset space is not greater than or equal to the preset number of times. For example, if the preset number of times is set to 3 times, when the sending module 40 sends the detection message 3 times to the node corresponding to each preset space, if the node corresponding to a preset space is not received 3 times, the feedback is not received. In response to the message, the determining module 50 determines that the node corresponding to the preset space is an abnormal node.
本实施例提供的方案,发送模块40定时发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息,在未接收到某一预设空间对应的节点反馈的响应消息时,判断模块50判定所述预设空间对应的节点为异常节点,统计所述分布式缓存系统中异常节点的个数,当异常节点的个数大于预设数量阈值时,也即在不能保障ENUM-DNS服务器中的数据与分布式缓存系统中数据的一致性时,报警模块60向运维系统发送报警信息,因此,实现了兼顾数据的一致性与可用性,提高了ENUM-DNS服务器的可靠性。In the solution provided by the embodiment, the sending module 40 periodically sends a detection message to the node corresponding to each preset space in the distributed cache system, and detects whether a response message fed back by the node corresponding to each preset space is received. When the response message of the node corresponding to the preset space is not received, the determining module 50 determines that the node corresponding to the preset space is an abnormal node, and counts the number of abnormal nodes in the distributed cache system, and when the abnormal node When the number of the number is greater than the preset number threshold, that is, when the data in the ENUM-DNS server cannot be guaranteed to be consistent with the data in the distributed cache system, the alarm module 60 sends an alarm message to the operation and maintenance system, thereby achieving both Data consistency and availability improve the reliability of ENUM-DNS servers.
基于上述任一实施例提出本发明数据管理装置第四实施例,在本实施例中,所述数据管理装置还包括:A fourth embodiment of the data management apparatus of the present invention is provided based on any of the foregoing embodiments. In this embodiment, the data management apparatus further includes:
数据恢复模块,被配置为在所述分布式缓存系统有节点的数据文件出现故障时,根据所述节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述节点。The data recovery module is configured to, when the data file of the node in the distributed cache system is faulty, sequentially copy the data file corresponding to the file directory from the standby node to the node according to the file directory of the node.
由于IMS网络环境的复杂性,分布式缓存系统有可能会出现灾难性故障,导致某些预设空间对应的节点的数据全部丢失,或者数据不可靠等问题。此时,需要对这些出现数据故障的异常节点的数据进行恢复。在本实施例,每个分布式缓存系统都存在一个备用系统,正常情况下,所述备用系统的备用节点中保存的数据与所述分布式缓存系统保存的数据一致。在对所述分布式缓存系统中异常节点的数据进行恢复时,数据恢复模块根据所述异常节点的文件目录,在 备用系统的备用节点中依次拷贝所述文件目录对应的数据文件至所述异常节点,从而完成所述异常节点的数据的恢复。若异常节点的文件目录也已经损坏,也即不能通过文件目录从备用节点中拷贝数据文件时,则重新设置分布式缓存系统中每个节点对应的预设空间,ENUM-DNS服务器重新初始化,在初始化完成后,数据恢复模块将备用系统的备用节点中保存的数据依次全部拷贝至所述分布式缓存系统中每个预设空间对应的节点上。Due to the complexity of the IMS network environment, the distributed cache system may have catastrophic failures, resulting in the loss of data of nodes corresponding to some preset spaces or unreliable data. At this point, you need to recover the data of these abnormal nodes with data failures. In this embodiment, each of the distributed cache systems has a backup system. Normally, the data stored in the standby node of the standby system is consistent with the data held by the distributed cache system. When recovering data of the abnormal node in the distributed cache system, the data recovery module is based on the file directory of the abnormal node. The data node corresponding to the file directory is sequentially copied to the abnormal node in the standby node of the standby system, thereby completing the recovery of the data of the abnormal node. If the file directory of the abnormal node is also damaged, that is, the data file cannot be copied from the standby node through the file directory, the preset space corresponding to each node in the distributed cache system is reset, and the ENUM-DNS server is re-initialized. After the initialization is completed, the data recovery module sequentially copies all the data saved in the standby node of the standby system to the node corresponding to each preset space in the distributed cache system.
在本实施例中,在对异常节点的数据进行恢复时,数据恢复模块根据所述异常节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述异常节点,即可完成异常节点的数据的恢复,而不需要拷贝所有的数据文件,因此,实现了数据的快速恢复,从而提高了ENUM-DNS服务器的可靠性。In this embodiment, when the data of the abnormal node is restored, the data recovery module sequentially copies the data file corresponding to the file directory from the standby node to the abnormal node according to the file directory of the abnormal node. The recovery of the data of the abnormal node is completed without copying all the data files, thereby realizing the rapid recovery of the data, thereby improving the reliability of the ENUM-DNS server.
本发明实施例还提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述任一实施例中的方法。The embodiment of the present invention further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable instructions being configured to perform the method in any of the above embodiments.
本发明实施例还提供了一种电子设备的结构示意图。参见图5,该电子设备包括:The embodiment of the invention further provides a schematic structural diagram of an electronic device. Referring to FIG. 5, the electronic device includes:
至少一个处理器(processor)50,图5中以一个处理器50为例;和存储器(memory)51,还可以包括通信接口(Communications Interface)52和总线53。其中,处理器50、通信接口52、存储器51可以通过总线53完成相互间的通信。通信接口52可以用于信息传输。处理器50可以调用存储器51中的逻辑指令,以执行上述实施例的方法。At least one processor 50, which is exemplified by a processor 50 in FIG. 5; and a memory 51, may further include a communication interface 52 and a bus 53. The processor 50, the communication interface 52, and the memory 51 can complete communication with each other through the bus 53. Communication interface 52 can be used for information transmission. Processor 50 can invoke logic instructions in memory 51 to perform the methods of the above-described embodiments.
此外,上述的存储器51中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。Furthermore, the logic instructions in the memory 51 described above may be implemented in the form of software functional units and sold or used as separate products, and may be stored in a computer readable storage medium.
存储器51作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本发明实施例中的方法对应的程序指令/模块。处理器50通过运行存储在存储器51中的软件程序、指令以及模块,从而执行功能应用以及数据处理,即实现上述方法实施例中的数据管理方法。The memory 51 is a computer readable storage medium, and can be used to store a software program, a computer executable program, and a program instruction/module corresponding to the method in the embodiment of the present invention. The processor 50 executes the function application and the data processing by executing the software programs, the instructions, and the modules stored in the memory 51, that is, the data management method in the above method embodiments.
存储器51可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器51可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 51 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the terminal device, and the like. Further, the memory 51 may include a high speed random access memory, and may also include a nonvolatile memory.
本发明实施例的技术方案可以以软件产品的形式体现出来,该计算机软件 产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solution of the embodiment of the present invention may be embodied in the form of a software product, the computer software The product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention. The foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like. A medium that can store program code, or a transitory storage medium.
以上仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.
工业实用性Industrial applicability
本发明提高了维护ENUM-DNS服务器与分布式缓存系统中的数据一致性的效率。 The present invention improves the efficiency of maintaining data consistency in an ENUM-DNS server and a distributed cache system.

Claims (11)

  1. 一种数据管理方法,包括:A data management method that includes:
    每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识,保存所述数据文件并将所述数据文件对应的文件标识写入第一配置文件中;Generating a data file for the received data every first preset duration, setting a file identifier corresponding to the data file, saving the data file, and writing the file identifier corresponding to the data file into the first configuration file;
    将所述数据文件写入至分布式缓存系统中,并在写入成功时,将写入成功的所述数据文件对应的文件标识写入第二配置文件中;Writing the data file to the distributed cache system, and writing the file identifier corresponding to the successfully written data file to the second configuration file when the writing is successful;
    每隔第二预设时长,检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件写入至所述分布式缓存系统中。Detecting, differently, the file identifiers in the first configuration file and the second configuration file every second preset duration, and writing different data files corresponding to the file identifiers to the distributed cache In the system.
  2. 如权利要求1所述的方法,其中,所述数据文件对应的文件标识为按照接收顺序对所述数据文件添加的文件编号,将所述数据文件对应的文件标识写入第一配置文件中的步骤包括:The method of claim 1, wherein the file identifier corresponding to the data file is a file number added to the data file in a receiving order, and the file identifier corresponding to the data file is written in the first configuration file. The steps include:
    用所述数据文件对应的文件标识写入所述第一配置文件中,以更新所述第一配置文件中保存的文件标识;Writing, by using the file identifier corresponding to the data file, the first configuration file to update the file identifier saved in the first configuration file;
    将成功写入分布式缓存系统的数据文件对应的文件标识写入第二配置文件的步骤包括:The steps of writing the file identifier corresponding to the data file successfully written into the distributed cache system into the second configuration file include:
    用写入分布式缓存系统成功的所述数据文件对应的文件标识写入第二配置文件中,以更新所述第二配置文件中保存的文件标识;其中当某一数据文件未写入成功时,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警;Writing, by using a file identifier corresponding to the data file successfully written in the distributed cache system, to the second configuration file, to update the file identifier saved in the second configuration file; wherein when a data file is not successfully written , repeatedly write the data file until the write is successful, or report the alarm when the write fails;
    所述检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件写入至所述分布式缓存系统中的步骤包括:The step of detecting the file identifiers in the first configuration file and the second configuration file, and writing the data files corresponding to the different file identifiers to the distributed cache system includes:
    检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致;Detecting whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file;
    在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。And deleting, when the file identifier saved in the first configuration file is different from the file identifier saved in the second configuration file, the file identifier saved in the first configuration file and the file saved in the second configuration file A data file corresponding to the file identifier of the difference between the identifiers is written into the distributed cache system.
  3. 如权利要求1所述的方法,其中,在执行所述每隔第一预设时长,将接 收的数据生成数据文件,设置所述数据文件对应的文件标识的步骤的同时,执行以下操作:The method of claim 1 wherein said every other first predetermined duration is performed The collected data generates a data file, and the steps of setting the file identifier corresponding to the data file are performed, and the following operations are performed:
    每隔第三预设时长,发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息;Sending a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detecting whether a response message fed back by the node corresponding to each preset space is received;
    在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点;When the response message fed back by the node corresponding to the preset space is not received, determining that the node corresponding to the preset space is an abnormal node;
    统计所述分布式缓存系统中异常节点的个数,若所述异常节点的个数大于预设数量阈值,则向运维系统发送报警信息,同时关闭接收数据的功能,每间隔第一预设时长不再生成新的数据文件,直至系统恢复正常。The number of the abnormal nodes in the distributed cache system is counted. If the number of the abnormal nodes is greater than the preset number threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed, and the first preset is separated. The duration no longer generates new data files until the system returns to normal.
  4. 如权利要求3所述的方法,其中,所述在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点,包括:The method of claim 3, wherein, when the response message fed back by the node corresponding to the preset space is not received, determining that the node corresponding to the preset space is an abnormal node comprises:
    在未接收到某一预设空间对应的节点反馈的响应消息时,更新未接收到所述响应消息的次数;Updating the number of times the response message is not received when the response message fed back by the node corresponding to the preset space is not received;
    判断所述次数是否大于等于预设次数,其中当未接受到所述响应消息的次数大于等于预设次数时,所述预设空间对应的节点为异常节点。Determining whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
  5. 如权利要求1-4任一项所述的方法,还包括:The method of any of claims 1-4, further comprising:
    在所述分布式缓存系统有节点的数据文件出现故障时,根据所述节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述节点。When the data file of the node in the distributed cache system is faulty, the data file corresponding to the file directory is sequentially copied from the standby node to the node according to the file directory of the node.
  6. 一种数据管理装置,包括:A data management device comprising:
    生成模块,被配置为在每隔第一预设时长,将接收的数据生成数据文件,设置所述数据文件对应的文件标识,保存所述数据文件并将所述数据文件对应的文件标识写入第一配置文件中;Generating a module, configured to generate a data file for the received data every other first preset duration, set a file identifier corresponding to the data file, save the data file, and write the file identifier corresponding to the data file In the first configuration file;
    处理模块,被配置为将所述数据文件写入至分布式缓存系统中,并在写入成功时,将写入成功的所述数据文件对应的文件标识写入第二配置文件中;The processing module is configured to write the data file into the distributed cache system, and write the file identifier corresponding to the data file successfully written into the second configuration file when the writing is successful;
    存储模块,被配置为在每隔第二预设时长,检测所述第一配置文件与所述第二配置文件中不同的所述文件标识,并将不同的所述文件标识对应的数据文件写入至所述分布式缓存系统中。The storage module is configured to detect the file identifiers different from the first configuration file and the second configuration file every second preset duration, and write different data files corresponding to the file identifiers Into the distributed cache system.
  7. 如权利要求6所述的装置,其中,所述文件标识为按照接收顺序对所述数据文件添加的文件编号;所述生成模块,还被配置为用生成的数据文件对应的文件标识写入所述第一配置文件中,以更新所述第一配置文件中保存的文件标识; The apparatus of claim 6, wherein the file identifier is a file number added to the data file in a receiving order; the generating module is further configured to write a file with a file identifier corresponding to the generated data file In the first configuration file, to update the file identifier saved in the first configuration file;
    所述处理模块,还被配置为用写入分布式缓存系统成功的数据文件对应的文件标识写入第二配置文件中,以更新所述第二配置文件中保存的文件标识;其中当某一数据文件未保存成功时,持续重复写入该数据文件直至写入成功,或在写入失败时上报告警;The processing module is further configured to be written in the second configuration file by using a file identifier corresponding to the data file successfully written to the distributed cache system, to update the file identifier saved in the second configuration file; When the data file is not saved successfully, the data file is continuously written repeatedly until the writing is successful, or the alarm is reported when the writing fails;
    所述存储模块,还被配置为检测所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识是否一致;在所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识不一致时,将所述第一配置文件中保存的文件标识与所述第二配置文件中保存的文件标识之间差异的文件标识对应的数据文件写入至所述分布式缓存系统中。The storage module is further configured to: detect whether the file identifier saved in the first configuration file is consistent with the file identifier saved in the second configuration file; and the file identifier and the file saved in the first configuration file When the file identifiers saved in the second configuration file are inconsistent, the data files corresponding to the file identifiers of the differences between the file identifiers saved in the first configuration file and the file identifiers saved in the second configuration file are written to In the distributed cache system.
  8. 如权利要求6所述的装置,还包括:The apparatus of claim 6 further comprising:
    发送模块,被配置为每隔第三预设时长,发送检测消息至所述分布式缓存系统中每个预设空间对应的节点,并检测是否接收到每个预设空间对应的节点反馈的响应消息;The sending module is configured to send a detection message to a node corresponding to each preset space in the distributed cache system every third preset duration, and detect whether a response of the node corresponding to each preset space is received. Message
    判断模块,被配置为在未接收到某一预设空间对应的节点反馈的响应消息时,判定所述预设空间对应的节点为异常节点;The determining module is configured to determine that the node corresponding to the preset space is an abnormal node when the response message fed back by the node corresponding to the preset space is not received;
    报警模块,被配置为统计所述分布式缓存系统中异常节点的个数,若所述异常节点的个数大于预设数量阈值,则向运维系统发送报警信息,同时关闭接收数据的功能,每间隔第一预设时长不再生成新的数据文件,直至系统恢复正常。The alarm module is configured to count the number of abnormal nodes in the distributed cache system. If the number of the abnormal nodes is greater than a preset threshold, the alarm information is sent to the operation and maintenance system, and the function of receiving data is closed. The new data file is no longer generated every first preset interval until the system returns to normal.
  9. 如权利要求8所述的装置,其中,所述判断模块被配置为:The apparatus of claim 8 wherein said determining module is configured to:
    在未接收到某一预设空间对应的节点反馈的响应消息时,更新未接收到所述响应消息的次数;Updating the number of times the response message is not received when the response message fed back by the node corresponding to the preset space is not received;
    判断所述次数是否大于等于预设次数,其中当未接受到所述响应消息的次数大于等于预设次数时,所述预设空间对应的节点为异常节点。Determining whether the number of times is greater than or equal to a preset number of times, wherein the node corresponding to the preset space is an abnormal node when the number of times the response message is not received is greater than or equal to a preset number of times.
  10. 如权利要求6-9任一项所述的装置,还包括:The apparatus of any of claims 6-9, further comprising:
    数据恢复模块,被配置为在所述分布式缓存系统有节点的数据文件出现故障时,根据所述节点的文件目录,从备用节点中依次拷贝所述文件目录对应的数据文件至所述节点。The data recovery module is configured to, when the data file of the node in the distributed cache system is faulty, sequentially copy the data file corresponding to the file directory from the standby node to the node according to the file directory of the node.
  11. 一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行权利要求1-5中任一项的方法。 A non-transitory computer readable storage medium storing computer executable instructions arranged to perform the method of any of claims 1-5.
PCT/CN2016/103529 2015-11-11 2016-10-27 Data managing method and device WO2017080362A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510765678.3 2015-11-11
CN201510765678.3A CN106682040A (en) 2015-11-11 2015-11-11 Data management method and device

Publications (1)

Publication Number Publication Date
WO2017080362A1 true WO2017080362A1 (en) 2017-05-18

Family

ID=58695917

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/103529 WO2017080362A1 (en) 2015-11-11 2016-10-27 Data managing method and device

Country Status (2)

Country Link
CN (1) CN106682040A (en)
WO (1) WO2017080362A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199332A (en) * 2020-10-16 2021-01-08 杭州安森智能信息技术有限公司 Distributed explosion-proof inspection robot cluster intelligent file management method and system
CN113568891A (en) * 2021-08-05 2021-10-29 深圳墨世科技有限公司 Distributed ID generation method, device, server and readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542338B (en) * 2018-10-19 2022-02-18 郑州云海信息技术有限公司 Method and device for realizing node information consistency in distributed storage system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404338A (en) * 2011-12-13 2012-04-04 华为技术有限公司 File synchronization method and device
CN102667772A (en) * 2010-03-01 2012-09-12 株式会社日立制作所 File level hierarchical storage management system, method, and apparatus
CN103946844A (en) * 2011-11-29 2014-07-23 国际商业机器公司 Synchronizing updates across cluster filesystems
US9015180B1 (en) * 2007-05-09 2015-04-21 Vmware, Inc. Repository including file identification

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101483576B (en) * 2008-01-11 2012-07-25 上海博达数据通信有限公司 Version management implementing method in distributed system
CN104750738B (en) * 2013-12-30 2018-06-26 中国移动通信集团公司 A kind of method for updating the data information, back end, management node and system
CN104182182B (en) * 2014-08-18 2017-04-12 四川航天系统工程研究所 Intelligent terminal and data backup method thereof
CN104219327B (en) * 2014-09-27 2017-05-10 上海瀚之友信息技术服务有限公司 Distributed cache system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9015180B1 (en) * 2007-05-09 2015-04-21 Vmware, Inc. Repository including file identification
CN102667772A (en) * 2010-03-01 2012-09-12 株式会社日立制作所 File level hierarchical storage management system, method, and apparatus
CN103946844A (en) * 2011-11-29 2014-07-23 国际商业机器公司 Synchronizing updates across cluster filesystems
CN102404338A (en) * 2011-12-13 2012-04-04 华为技术有限公司 File synchronization method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199332A (en) * 2020-10-16 2021-01-08 杭州安森智能信息技术有限公司 Distributed explosion-proof inspection robot cluster intelligent file management method and system
CN113568891A (en) * 2021-08-05 2021-10-29 深圳墨世科技有限公司 Distributed ID generation method, device, server and readable storage medium
CN113568891B (en) * 2021-08-05 2024-02-20 深圳墨世科技有限公司 Distributed ID generation method, device, server and readable storage medium

Also Published As

Publication number Publication date
CN106682040A (en) 2017-05-17

Similar Documents

Publication Publication Date Title
US10298436B2 (en) Arbitration processing method after cluster brain split, quorum storage apparatus, and system
WO2017177941A1 (en) Active/standby database switching method and apparatus
US20150213100A1 (en) Data synchronization method and system
US11892922B2 (en) State management methods, methods for switching between master application server and backup application server, and electronic devices
CN107656705B (en) Computer storage medium and data migration method, device and system
CN107506266B (en) Data recovery method and system
US8775859B2 (en) Method, apparatus and system for data disaster tolerance
WO2022036901A1 (en) Implementation method and apparatus for redis replica set
US20210320977A1 (en) Method and apparatus for implementing data consistency, server, and terminal
US20190227710A1 (en) Incremental data restoration method and apparatus
WO2017080362A1 (en) Data managing method and device
US8612799B2 (en) Method and apparatus of backing up subversion repository
CN111901176B (en) Fault determination method, device, equipment and storage medium
CN109165112B (en) Fault recovery method, system and related components of metadata cluster
US11500812B2 (en) Intermediate file processing method, client, server, and system
US8719622B2 (en) Recording and preventing crash in an appliance
US20180121531A1 (en) Data Updating Method, Device, and Related System
CN111342986B (en) Distributed node management method and device, distributed system and storage medium
US20160050113A1 (en) Methods for managing storage virtual machine configuration changes in a distributed storage system and devices thereof
CN108509296B (en) Method and system for processing equipment fault
CN110858168B (en) Cluster node fault processing method and device and cluster node
EP4300314A2 (en) Data backup method, apparatus and system
CN112015593B (en) Disaster recovery backup method for Kubernetes cluster and related components
CN106599006B (en) Data recovery method and device
CN115314361B (en) Server cluster management method and related components thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16863539

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16863539

Country of ref document: EP

Kind code of ref document: A1