WO2019200751A1 - Host and backup computer switching method, apparatus, computing device and storage medium - Google Patents

Host and backup computer switching method, apparatus, computing device and storage medium Download PDF

Info

Publication number
WO2019200751A1
WO2019200751A1 PCT/CN2018/095501 CN2018095501W WO2019200751A1 WO 2019200751 A1 WO2019200751 A1 WO 2019200751A1 CN 2018095501 W CN2018095501 W CN 2018095501W WO 2019200751 A1 WO2019200751 A1 WO 2019200751A1
Authority
WO
WIPO (PCT)
Prior art keywords
host
data
port
neo4j
relay device
Prior art date
Application number
PCT/CN2018/095501
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 WO2019200751A1 publication Critical patent/WO2019200751A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2033Failover techniques switching over of hardware resources

Definitions

  • the present application relates to the field of application of a graphics database, and in particular, to an active/standby switching method, apparatus, computer device, and storage medium.
  • Neo4j graphics database
  • the existing community version of Neo4j has only a single host. When it encounters a host failure, it can only discontinue the use of the community version of Neo4j, which seriously affects the user experience of the community version of Neo4j and affects the further promotion of the Neo4j community version.
  • the existing community version of Neo4j does not have a dual-system cluster system scheme, and it is difficult to achieve high availability. When the data request amount is large, accessing randomly distributed data is prone to cache miss, which affects the accuracy of the normal processing service of the community version Neo4j. .
  • the main purpose of the present application is to provide an active/standby switching method, which aims to solve the technical problem that the existing community version of Neo4j does not have a dual-system cluster system, resulting in low availability.
  • the present application proposes an active/standby switching method, in which a routing relay device connects the first host and the second host of the community version Neo4j, the first host is connected to the first port of the routing relay device, and the second host and the second routing device are connected. Ports are connected, including:
  • the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device.
  • the present application further provides an active/standby switching device, where the first host and the second host are connected by a routing relay device, the first host is connected to the first port of the routing device, and the second host is connected to the second port of the routing device.
  • a first determining module configured to determine whether a first host supporting the community version Neo4j is faulty
  • the switching module is configured to switch, when the first host fails, the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device.
  • the active/standby switching device includes:
  • a storage module configured to store first running data of the first host supporting community version Neo4j running process
  • a transfer module configured to transfer the first running data to the second host by using a specified manner to form second running data.
  • the application also provides a computer device comprising a memory and a processor, the memory storing computer readable instructions, the processor implementing the steps of the method when the computer readable instructions are executed.
  • the present application also provides a computer non-transitory readable storage medium having stored thereon computer readable instructions that, when executed by a processor, implement the steps of the methods described above.
  • the application has the beneficial technical effects: the present application implements the active/standby switchover of the community version of Neo4j through the routing relay device, and makes up for the existing community version of Neo4j with only a single host, and cannot continue to use the community version of Neo4j when a host failure occurs.
  • This application passes the active and standby hosts. Switching to improve the usage continuity of the community version of Neo4j, improve the user experience, and the master and backup hosts reduce the impact of the active and standby hosts on the community version of Neo4j work process before and after the switchover through data backup and data synchronization. For the community version of Neo4j The continued use of it has far-reaching implications.
  • the active/standby switchover of this application is completely automated, eliminating the need for personnel intervention, reducing costs, improving the timeliness of active/standby switchover, and improving efficiency. Moreover, this application improves the community version of Neo4j's fast response data request by creating an instance database, reducing cache misses and improving accuracy.
  • FIG. 1 is a schematic flowchart of an active/standby switching method according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an active/standby switching device according to an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an active/standby switching device according to another embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application.
  • FIG. 8 is a schematic diagram showing the internal structure of a computer device according to an embodiment of the present application.
  • an active/standby switching method of a community version of Neo4j connects a first host and a second host of a community version Neo4j through a routing relay device, and the first host is connected to a first port of a routing device, The second host is connected to the second port of the routing relay device.
  • the embodiment of the present invention implements the switching and data transfer between the first host and the second host of the community version Neo4j through the routing relay device, including:
  • the fault is identified by a preset fault identification condition.
  • the first host is continuously started three times or more according to the start command, and if it is not successfully turned on, it is determined to be a fault.
  • This embodiment is a handover of the active and standby hosts of the community version Neo4j, and improves the high availability of the community version Neo4j.
  • the community version Neo4j of this embodiment is a network-oriented database, based on an embedded, disk-based, Java persistence engine with full transaction characteristics.
  • the community version of Neo4j of this embodiment stores structured data in a network. A more agile and fast development model can be applied.
  • the above network refers to a flexible data structure, or mathematically called a graph.
  • Neo4j Equivalent to a high-performance graph engine with all the features of a mature database. Compared with the enterprise version of Neo4j, the community version of Neo4j is cheaper and easier to promote, but the technical features are far less powerful than the enterprise version of Neo4j, because the community version of Neo4j There is no dual-system cluster system, only one host with specified power, so the existing community version of Neo4j does not include functions such as database and query management, and does not have high availability.
  • the active/standby host of the community version Neo4j is switched through the route relay device set in the front end.
  • the host is switched to the second host in time to continue to support the smooth running of the community version of Neo4j, and the community version of Neo4j is improved.
  • the switching between the active and standby hosts of the community version Neo4j is implemented through a route relay device with equalization function, such as F5 (F5).
  • Nginx load balancing server developed by Igor Saysoyev
  • Keepalive similar to layer3, 4 & 7 switch system software, that is, Layer 3, Layer 4 and Layer 7 automatic switching, can be used for switching between hosts, etc., to achieve fast switching, and further improve the switching effect of the community version of Neo4j master and backup. For example, when switching through F5, the switching operation can be completed in one minute, and the smoothness of the switching between the active and standby hosts of the community version Neo4j is improved, and the user experience is improved.
  • the F5 set at the front end is started, and the connection relationship between the host device and the F5 connection port is changed, thereby realizing the switching from the first host to the second host, to Confirm the fault judgment and improve the utilization of the host device.
  • step S1 of this embodiment the method includes:
  • S11 Store first operation data of the first host supporting community version Neo4j running process.
  • the community version Neo4j stores the running data in real time, such as in the memory of the first host, for data sharing, data analysis, and the like.
  • S12 Transfer the first running data to the second host by using a specified manner to form second running data.
  • the first running data is transferred to the second host, so that the second host continues to support the normal operation of the community version of Neo4j on the basis of the first host processing business process, so as to avoid affecting the normal operation of the user.
  • the specified method of this step includes but is not limited to FTP (File Transfer Protocol), SFTP (Secure File Transfer Protocol), SCP (Secure) Copy).
  • the specified mode in the embodiment of the present application is FTP, and the FTP is TCP/IP (Transmission).
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • the protocol for transferring files between two computers on the network belongs to the application layer of the network protocol group.
  • the FTP client can issue commands to the server to download files, upload files, and create or change directories on the server.
  • the FTP of this embodiment uses two TCP connections, one is a command link for transmitting commands between the FTP host and the server, and the other is a data link for uploading or downloading data.
  • the FTP in this embodiment is based on the TCP protocol. Therefore, only the TCP protocol of the specified port needs to be released in the firewall setting. FTP allows plaintext transmission.
  • the FTP working mode of this embodiment includes a PORT (active) mode and a PASV (passive passive mode).
  • the PORT (active) connection process is: the host sends a connection request to a designated port of the server, and the server accepts the connection and establishes a command link.
  • the host uses the PORT command on the command link to tell the server that a random port of 1024+ has been opened and can be connected.
  • the server then sends a connection request from the designated port to the 1024+ random port on the host side, establishing a data link to transmit data.
  • the connection process of the PASV mode is: the host sends a connection request to the FTP port of the server, and the server accepts the connection and establishes a command link.
  • the server uses the PASV command on the command link to tell the host that a 1024+ random port has been opened and can be connected.
  • the host then sends a connection request to the designated port of the server, establishing a data link to transfer the data.
  • normal FTP only uses port 21 as a command transmission.
  • the server and the host negotiate another random port for data transfer.
  • PASV mode the server side needs to listen to another random port. If the server is behind a router or firewall, port mapping can be cumbersome because the data port number cannot be known in advance and cannot be mapped.
  • the specified method is SSH (Secure Shell) for data transmission
  • SSH is a security protocol based on the application layer and the transport layer.
  • SSH of this embodiment There are three main components: the transport layer protocol SSH-TRANS, the user authentication protocol SSH-USERAUTH, and the connection protocol SSH-CONNECT.
  • the SSH protocol can effectively prevent information leakage during remote management and provide security.
  • the SSH in this embodiment includes an SFTP secure file transfer subsystem, and SFTP can provide a secure encryption method for transmitting files, SFTP. Has almost the same syntax and functionality as FTP above.
  • the SFTP of this embodiment does not have a separate daemon process, and the SSH daemon must be used to complete the corresponding connection operation.
  • SFTP uses encryption to transmit authentication information and transmitted data, which is very secure. However, due to the use of encryption/decryption technology, the transmission efficiency is much lower than that of ordinary FTP. When the network security requirements are higher, SFTP is used instead of FTP.
  • the first operation data is transferred to the second host through the SCP, and the operation is simpler, more convenient, and the efficiency of data synchronization sharing is improved.
  • the SCP of this embodiment is based on SSH login and can be used for remote file copying, and is more suitable for synchronizing the first running data to the second host, and the entire copying process is encrypted.
  • the format of the command copied from the local to the remote is: scp local_file remote_username@remote_ip:remote_folder or scp local_file remote_username@remote_ip:remote_file or scp local_file Remote_ip:remote_folder or scp local_file remote_ip:remote_file
  • the user name is specified in the first and second command formats.
  • the password needs to be entered after the command is executed.
  • the first command format only specifies the remote directory, and the file name does not change.
  • the command format specifies the file name; the third and fourth command formats do not specify a user name, the user name and password are required after the command is executed, and the third command format specifies only the remote directory, the file name does not change, and the fourth command
  • the format specifies the file name; from remote copy to local, as long as the command will be copied locally to the remote
  • the parameter switching sequence in the last two command formats can be implemented.
  • the remote and local in this embodiment includes data synchronization between the remote server and the local server, and also includes data synchronization between the remote host terminal and the local host terminal.
  • SCP of this embodiment /SFTP is open source protocol free of charge, unlike FTP security or copyright issues, and SCP / SFTP transmission software is free and open source, easy to develop a variety of extensions and application components.
  • step S2 the method includes:
  • S21 Determine an intersection of the data of the second running data and the first running data.
  • the data intersection of this step is obtained by comparing the number of nodes of the first operational data with the second operational data. In other embodiments of the present application, the data intersection may also be obtained by other methods such as the number of data bytes.
  • the community version Neo4j of this embodiment is a high performance NOSQL (Not Only SQL) graph database, which stores structured data on the network.
  • NOSQL graph database there are two concepts: node set and node. The data display in the NOSQL graph database does not use a node set, but an independent node.
  • the NOSQL of this embodiment has the following features: no need to define a data pattern in advance, a predefined table structure, each record in the data may have different attributes and formats, and when inserting data, it is not necessary to define a pattern in advance;
  • the all-sharing architecture in the storage area network where all data is stored, NOSQL divides the data and stores it on each local server, because the performance of reading data from the local disk is better than the performance of reading data through the network transmission, thereby improving the system.
  • Performance can dynamically add or delete nodes while the system is running, no downtime maintenance, data can be automatically migrated; compared to the data stored in the same node, NOSQL database needs to partition the data, spread the records in multiple Above the node, and the partition has to be replicated at the same time, which improves the parallel performance and guarantees that there is no single point of failure; and RAID (Redundant) Arrays of Independent Disks (disk array) storage system is different, the replication in NOSQL is based on asynchronous replication of the log, the data is written to the node as soon as possible, reducing network transmission delay.
  • the NOSQL database does not have a unified architecture.
  • NOSQL has its own advantages.
  • the NOSQL graph database of this embodiment is particularly suitable for the community version Neo4j.
  • the data of the NOSQL graph database is synchronized between the first host and the second host, and is completed according to the data of the copy node.
  • the starting start label of the second host is determined by the data intersection of the first running data and the second running data.
  • the first running data includes node A, node B, node C, and node D; and the second running data includes node A, node B, and node C, and further determines whether the data of node C is complete, and if so, the second The host starts from the service processing performed by the first host at the node C or at the service data location corresponding to the node C, and continues to support the operation of the community version Neo4j; if it is determined that the data of the node C is incomplete, it is determined whether The data information at the end of the data of the node C can be obtained.
  • the second host is terminated from the first host at the end of the data of the node C or before the data of the node C is terminated.
  • the service processing performed at the corresponding service data location at the moment is started; if the data information at the data termination of the node C is not available, the second host performs the corresponding service data from the first host at any point before the node C.
  • the business process begins.
  • the starting node selected by the second host can continue to support the normal operation of the community version Neo4j, and does not affect the normal use of the user.
  • the data node in the second running data is data that has been processed by the service, and the node selected by the second host may be the node data just connected as the starting point. Or, it is just the node data before the node is connected as the starting point.
  • step S2 the method includes:
  • S23 Record the access data of the community version Neo4j and the access frequency corresponding to the access data.
  • Neo4j of this embodiment records the most recently accessed data by caching.
  • S24 Acquire, in the access data, the high frequency access data whose access frequency is greater than a preset threshold.
  • the preset threshold of this step is, for example, three times of access, and the number of accesses is greater than three times, which is high frequency access data.
  • S25 Form an instance database and store by summarizing the instance scenarios corresponding to the high frequency secondary access data and the high frequency secondary access data.
  • Neo4j of this embodiment is a graphics database, and the data is not stored in a table or a collection, but is saved as a node and a relationship between nodes.
  • nodes and relationships can contain attributes that hold values, zero or more tags (such as Author or Book) for the node, and each relationship corresponds to a type (such as WROTE or FRIEND_OF), the relationship is always Point from one node to another (but can do so without regard to directivity).
  • Neo4j of this embodiment comes with a set of easy-to-learn query language (called Cypher) that does not use Schema (a collection of database objects, a user generally corresponds to a Schema), so it can meet any form of requirements.
  • Cypher easy-to-learn query language
  • Schema a collection of database objects, a user generally corresponds to a Schema
  • the high-frequency access data is aggregated according to the relevance of the scenario, and a database of the instance scenario is formed and stored, so that the local data of the database is gradually modularized and modeled, so as to improve the community version of Neo4j rapid response data request, and Preventing the random distribution of data from being cached when the number of requests is very large.
  • the above example scenario includes a summary of scenario scenarios based on data types, such as summarizing data related to medical information, hospital information, case introduction, medical equipment, etc. into the medical industry.
  • Example scenario Compared with the relational database, the community version Neo4j of this embodiment is much faster to query highly correlated data (graphic data).
  • the entity and relationship structure of the community version Neo4j of this embodiment is very natural to meet the human intuitive feeling, and supports ACID (abbreviation of four basic elements of database transaction correct execution, including: atomic Atomicity, Consistency Consistency, Isolation Isolation) Transaction operation provides a high-availability model to support large-volume data queries, support for backup, data locality, and redundancy, providing a visual query console to avoid staff fatigue.
  • an instance database corresponding to the access data is aggregated to form an instance database and stored, so as to improve the community version of Neo4j fast response data request, and prevent a random distribution of data from being cached when the request amount is very large. .
  • step S25 the method further includes:
  • the similarity between the two instance scenarios is determined by using the classification label of the example scenario. For example, if the instance scenario label shows that the two instance scenarios are all medical fields, the determination is similar. If one scene label is displayed as a medical field and another scene label is displayed as a movie field, the determination is not similar.
  • the scene label classification in this embodiment may further refine the classification according to requirements to improve the reliability of calling data according to the instance scene label.
  • the example scene classification label of the embodiment may be classified by the feature of the picture component of the instance scene acquired by the convolutional neural network, and the similarity of the instance scene is determined according to the feature similarity of the picture component. In this embodiment, it is preferable to determine the feature similarity of the two picture constituent elements according to the Euclidean distance, and further determine the similarity between the two example scenes.
  • the tag is data in the medical field, which increases the speed.
  • step S2 the method includes:
  • a monitoring function is set on the application module that connects the first host and the second host to monitor the fault alarm of the first host. For example, after the first host fails, the application module receives the fault alarm information. For example, by monitoring the heartbeat packet for monitoring, and not receiving the heartbeat monitoring feedback information of the first host, determining that the first host is faulty, the fault alarm of the embodiment includes an audible fault alarm, such as a fault whistle, etc.; Alarm, fault light or flashing light; no performance fault alarm, such as no heartbeat or no feedback signal.
  • an audible fault alarm such as a fault whistle, etc.
  • Alarm fault light or flashing light
  • no performance fault alarm such as no heartbeat or no feedback signal.
  • S29 The first running data is synchronized to the node information of the second host when the fault alarm is marked.
  • the data synchronization status of the first host and the second host and the data request status of the community version Neo4j are simultaneously monitored, so as to switch to the second host, the connection is smoother.
  • a host continues to support the operation and application of the community version of Neo4j.
  • the data synchronization status of the first host and the second host is monitored by monitoring the change information of the data node in the data synchronization state.
  • the node information of this step includes but is not limited to node attributes, associations with other nodes, and node search paths.
  • the node information is transmitted to the second host, so that the second host quickly recognizes the difference of the synchronization data, and selects a more optimized manner to connect the work of the first host.
  • the specific determination method of the starting point of the running process of the second host in this embodiment is the same as step S22.
  • the community version of Neo4j can also handle "big data" by providing information about an entity and its neighboring data relationships (eg, you can provide a web page to return its results), such as The number of categories of books is calculated according to the location (city) where the author is located, and a different set of columns is returned by using the same design pattern.
  • a community-based version of Neo4j's interactive rendering of a document portal is based on a simple text file that describes the entire data model, architecture, and use case queries in textual descriptions and images, supporting online execution and maintaining visualization. The portal provides a list that allows users to view the details of each list.
  • the active/standby switchover of the community version of Neo4j is implemented by the route relay device, and the existing community version of Neo4j has only a single host. When the host fails, the community version of Neo4j cannot be used.
  • Improve the use of the community version of Neo4j to improve the user experience, and the master and backup hosts through data backup and data synchronization reduce the impact of the active and standby hosts on the community version of Neo4j work process before and after the switch, the continuation of the community version of Neo4j Use has far-reaching implications.
  • the active/standby host switching in the embodiment of the present application is completely automated, and no personnel intervention is required, which reduces costs, improves the timeliness of the active/standby switchover, and improves efficiency.
  • the embodiment of the present application improves the community version of the Neo4j fast response data request by reducing the instance database. Missing caches improve accuracy.
  • the primary and secondary switching devices of the embodiment are connected to the first host and the second host of the community version Neo4j through a routing relay device, and the first host is connected to the first port of the routing device, and the second host and the route are connected.
  • the second port of the transit device is connected to each other.
  • the embodiment of the present invention implements the switching and data transfer between the first host and the second host of the community version Neo4j through the routing relay device, including:
  • the first judging module 1 is configured to determine whether the first host supporting the community version Neo4j is faulty.
  • This embodiment is identified by the preset fault identification condition in the first judging module 1. For example, the first host is continuously started three times or more according to the start command, and if it is not successfully turned on, it is determined to be a fault.
  • This embodiment is a handover of the active and standby hosts of the community version Neo4j, and improves the high availability of the community version Neo4j.
  • the community version Neo4j of this embodiment is a network-oriented database, based on an embedded, disk-based, Java persistence engine with full transaction characteristics.
  • the community version of Neo4j of this embodiment stores structured data in a network. A more agile and fast development model can be applied.
  • the above network refers to a flexible data structure, or mathematically called a graph.
  • Neo4j Equivalent to a high-performance graph engine with all the features of a mature database. Compared with the enterprise version of Neo4j, the community version of Neo4j is cheaper and easier to promote, but the technical features are far less powerful than the enterprise version of Neo4j, because the community version of Neo4j There is no dual-system cluster system, only one host with specified power, so the existing community version of Neo4j does not include functions such as database and query management, and does not have high availability.
  • the switching module 2 is configured to switch, when the first host fails, the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device.
  • the switching between the active and standby hosts of the community version Neo4j is implemented by the routing relay device disposed in the front end of the switching module 2, and when the first host has an abnormal fault, the second host is switched to the second host to continue to support the community version of Neo4j. Run to improve the operational efficiency of the community version of Neo4j.
  • the switching between the active and standby hosts of the community version Neo4j is implemented through a route relay device with equalization function, such as F5 (F5).
  • Nginx load balancing server developed by Igor Saysoyev
  • Keepalive similar to layer3, 4 & 7 switch system software, ie, Layer 3, Layer 4 and Layer 7 automatic switching software, can be used for switching between hosts, etc., to achieve fast switching, and further improve the effect of the community version of Neo4j master and backup machine switching .
  • the switching operation can be completed in one minute, and the smoothness of the switching between the active and standby hosts of the community version Neo4j is improved, and the user experience is improved.
  • the F5 set at the front end is started, and the connection relationship between the host device and the F5 connection port is changed, thereby realizing the switching from the first host to the second host, to Confirm the fault judgment and improve the utilization of the host device.
  • an active/standby switching device of another embodiment of the present application includes:
  • the storage module 11 is configured to store first running data of the first host supporting community version Neo4j running process.
  • the running data is stored in real time through the storage module 11, for example, stored in the memory of the first host, for data sharing, data analysis, and the like.
  • the transferring module 12 is configured to transfer the first running data to the second host by using a specified manner to form second running data.
  • the first running data is synchronized to the second host by the transfer module 12, so that the second host continues to support the normal operation of the community version Neo4j on the basis of the first host processing business process to avoid the influence.
  • the normal use of the user improves the user experience.
  • the specified method of this step includes but is not limited to FTP (File Transfer Protocol), SFTP (Secure File Transfer Protocol), SCP (Secure) Copy).
  • the specified mode in the embodiment of the present application is FTP, and the FTP is TCP/IP (Transmission).
  • TCP/IP Transmission Control Protocol/Internet Protocol
  • the protocol for transferring files between two computers on the network belongs to the application layer of the network protocol group.
  • the FTP client can issue commands to the server to download files, upload files, and create or change directories on the server.
  • the FTP of this embodiment uses two TCP connections, one is a command link for transmitting commands between the FTP host and the server, and the other is a data link for uploading or downloading data.
  • the FTP in this embodiment is based on the TCP protocol. Therefore, only the TCP protocol of the specified port needs to be released in the firewall setting. FTP allows plaintext transmission.
  • the FTP working mode of this embodiment includes a PORT (active) mode and a PASV (passive passive mode).
  • the PORT (active) connection process is: the host sends a connection request to a designated port of the server, and the server accepts the connection and establishes a command link.
  • the host uses the PORT command on the command link to tell the server that a random port of 1024+ has been opened and can be connected.
  • the server then sends a connection request from the designated port to the 1024+ random port on the host side, establishing a data link to transmit data.
  • the connection process of the PASV mode is: the host sends a connection request to the FTP port of the server, and the server accepts the connection and establishes a command link.
  • the server uses the PASV command on the command link to tell the host that a 1024+ random port has been opened and can be connected.
  • the host then sends a connection request to the designated port of the server, establishing a data link to transfer the data.
  • normal FTP only uses port 21 as a command transmission.
  • the server and the host negotiate another random port for data transfer.
  • PASV mode the server side needs to listen to another random port. If the server is behind a router or firewall, port mapping can be cumbersome because the data port number cannot be known in advance and cannot be mapped.
  • the specified method is SSH (Secure Shell) for data transmission
  • SSH is a security protocol based on the application layer and the transport layer.
  • SSH of this embodiment There are three main components: the transport layer protocol SSH-TRANS, the user authentication protocol SSH-USERAUTH, and the connection protocol SSH-CONNECT.
  • the SSH protocol can effectively prevent information leakage during remote management and provide security.
  • the SSH in this embodiment includes an SFTP secure file transfer subsystem, and SFTP can provide a secure encryption method for transmitting files, SFTP. Has almost the same syntax and functionality as FTP above.
  • the SFTP of this embodiment does not have a separate daemon process, and the SSH daemon must be used to complete the corresponding connection operation.
  • SFTP uses encryption to transmit authentication information and transmitted data, which is very secure. However, due to the use of encryption/decryption technology, the transmission efficiency is much lower than that of ordinary FTP. When the network security requirements are higher, SFTP is used instead of FTP.
  • the first operation data is transferred to the second host through the SCP, and the operation is simpler, more convenient, and the efficiency of data synchronization sharing is improved.
  • the SCP of this embodiment is based on SSH login and can be used for remote file copying, and is more suitable for synchronizing the first running data to the second host, and the entire copying process is encrypted.
  • the format of the command copied from the local to the remote is: scp local_file remote_username@remote_ip:remote_folder or scp local_file remote_username@remote_ip:remote_file or scp local_file Remote_ip:remote_folder or scp local_file remote_ip:remote_file
  • the user name is specified in the first and second command formats.
  • the password needs to be entered after the command is executed.
  • the first command format only specifies the remote directory, and the file name does not change.
  • the command format specifies the file name; the third and fourth command formats do not specify a user name, the user name and password are required after the command is executed, and the third command format specifies only the remote directory, the file name does not change, and the fourth command
  • the format specifies the file name; from remote copy to local, as long as the command will be copied locally to the remote
  • the parameter switching sequence in the last two command formats can be implemented.
  • the remote and local in this embodiment includes data synchronization between the remote server and the local server, and also includes data synchronization between the remote host terminal and the local host terminal.
  • SCP of this embodiment /SFTP is open source protocol free of charge, unlike FTP security or copyright issues, and SCP / SFTP transmission software is free and open source, easy to develop a variety of extensions and application components.
  • an active/standby switching device includes:
  • the second determining module 21 is configured to determine an intersection of the data of the second running data and the first running data.
  • the data intersection of this embodiment is obtained by comparing the number of nodes of the first operational data with the second operational data. In other embodiments of the present application, the data intersection may also be obtained by other methods such as the number of data bytes.
  • the community version Neo4j of this embodiment is a high performance NOSQL (Not Only SQL) graph database, which stores structured data on the network. In the NOSQL graph database, there are two concepts: node set and node. The data display in the NOSQL graph database does not use a node set, but an independent node.
  • the NOSQL of this embodiment has the following features: no need to define a data pattern in advance, a predefined table structure, each record in the data may have different attributes and formats, and when inserting data, it is not necessary to define a pattern in advance;
  • the all-sharing architecture in the storage area network where all data is stored, NOSQL divides the data and stores it on each local server, because the performance of reading data from the local disk is better than the performance of reading data through the network transmission, thereby improving the system.
  • Performance can dynamically add or delete nodes while the system is running, no downtime maintenance, data can be automatically migrated; compared to the data stored in the same node, NOSQL database needs to partition the data, spread the records in multiple Above the node, and the partition has to be replicated at the same time, which improves the parallel performance and guarantees that there is no single point of failure; and RAID (Redundant) Arrays of Independent Disks (disk array) storage system is different, the replication in NOSQL is based on asynchronous replication of the log, the data is written to the node as soon as possible, reducing network transmission delay.
  • the NOSQL database does not have a unified architecture.
  • NOSQL has its own advantages.
  • the NOSQL graph database of this embodiment is particularly suitable for the community version Neo4j.
  • the data of the NOSQL graph database is synchronized between the first host and the second host, and is completed according to the data of the copy node.
  • the determining module 22 is configured to determine a starting point of the running process of the second host according to the data intersection.
  • the determining module 22 determines the starting start label of the second host, that is, the starting point of the running process of the second host, according to the data intersection of the first running data and the second running data.
  • the first running data includes node A, node B, node C, and node D; and the second running data includes node A, node B, and node C, and further determines whether the data of node C is complete, and if so, the second The host starts from the service processing performed by the first host at the node C or at the service data location corresponding to the node C, and continues to support the operation of the community version Neo4j; if it is determined that the data of the node C is incomplete, it is determined whether The data information at the end of the data of the node C can be obtained.
  • the second host is terminated from the first host at the end of the data of the node C or before the data of the node C is terminated.
  • the service processing performed at the corresponding service data location at the moment is started; if the data information at the data termination of the node C is not available, the second host performs the corresponding service data from the first host at any point before the node C.
  • the business process begins.
  • Other embodiments of the present application select a service state corresponding to a service state performed at the node A from the first host or from any point in time between the node A and the node C as a starting point.
  • the starting node selected by the second host can continue to support the normal operation of the community version Neo4j, and does not affect the normal use of the user. There is a time delay in the data sharing between the first host and the second host.
  • the data node in the second running data is data that has been processed by the service, and the node selected by the second host may be the node data just connected as the starting point. Or, it is just the node data before the node is connected as the starting point.
  • an active/standby switching device includes:
  • the recording module 23 is configured to record the access data of the community version Neo4j and the access frequency corresponding to the access data.
  • the community version Neo4j of this embodiment caches the most recently accessed data through the recording module 23.
  • the obtaining module 24 is configured to obtain, in the access data, the high frequency access data whose access frequency is greater than a preset threshold.
  • the preset threshold of the embodiment is, for example, three times of access, and the number of accesses is greater than three times, which is high frequency access data.
  • the forming module 25 is configured to form an instance database and store the instance scenario corresponding to the access data by collecting the instance data corresponding to the access data if the access frequency is greater than the preset threshold.
  • Neo4j of this embodiment is a graphics database, and the data is not stored in a table or a collection, but is saved as a node and a relationship between nodes.
  • nodes and relationships can contain attributes that hold values, zero or more tags (such as Author or Book) for the node, and each relationship corresponds to a type (such as WROTE or FRIEND_OF), the relationship is always Point from one node to another (but can do so without regard to directivity).
  • Neo4j of this embodiment comes with a set of easy-to-learn query language (called Cypher) that does not use Schema (a collection of database objects, a user generally corresponds to a Schema), so it can meet any form of requirements.
  • Cypher easy-to-learn query language
  • Schema a collection of database objects, a user generally corresponds to a Schema
  • the high-frequency access data is aggregated according to the relevance of the scenario, and a database of the instance scenario is formed and stored, so that the local data of the database is gradually modularized and modeled, so as to improve the community version of Neo4j rapid response data request, and Preventing the random distribution of data from being cached when the number of requests is very large.
  • the above example scenario includes a summary of scenario scenarios based on data types, such as summarizing data related to medical information, hospital information, case introduction, medical equipment, etc. into the medical industry.
  • Example scenario Compared with the relational database, the community version Neo4j of this embodiment is much faster to query highly correlated data (graphic data).
  • the entity and relationship structure of the community version Neo4j of this embodiment is very natural to meet the human intuitive feeling, and supports ACID (abbreviation of four basic elements of database transaction correct execution, including: atomic Atomicity, Consistency Consistency, Isolation Isolation) Transaction operation, providing a high-availability model to support large-volume data queries, support for backup, data locality, and redundancy, providing a visual query console to avoid staff fatigue.
  • ACID abbreviation of four basic elements of database transaction correct execution, including: atomic Atomicity, Consistency Consistency, Isolation Isolation
  • an example scenario corresponding to the access data and the access data is summarized by the forming module 25, and an instance database is formed and stored to improve the community version Neo4j fast response data request, and the data is randomly distributed when the request amount is very large. A cache miss has occurred.
  • the active/standby switching device of another embodiment of the present application further includes:
  • the third determining module 26 is configured to determine whether the instance scenario currently running by the second host has stored a backup.
  • the third determining module 26 determines whether the corresponding running database exists in the currently running instance scenario, and improves the efficiency of calling data. For example, in this embodiment, the similarity between the two instance scenarios is determined by using the classification label of the example scenario. For example, if the instance scenario label shows that the two instance scenarios are all medical fields, the determination is similar. If one scene label is displayed as a medical field and another scene label is displayed as a movie field, the determination is not similar.
  • the scene label classification in this embodiment may further refine the classification according to requirements to improve the reliability of calling data according to the instance scene label.
  • the example scene classification label of the embodiment may be classified by the feature of the picture component of the instance scene acquired by the convolutional neural network, and the similarity of the instance scene is determined according to the feature similarity of the picture component.
  • the calling module 27 is configured to invoke the access data that matches the currently running instance scenario if the backup has been stored.
  • the calling module 27 calls the data in the medical field to increase the speed.
  • an active/standby switching device includes:
  • the monitoring module 28 is configured to monitor a fault alarm of the first host.
  • a monitoring module 28 with a monitoring function is provided to monitor the fault alarm of the first host. For example, after the first host fails, the application module receives the fault alarm information. For example, by monitoring the heartbeat packet for monitoring, and not receiving the heartbeat monitoring feedback information of the first host, determining that the first host is faulty, the fault alarm of the embodiment includes an audible fault alarm, such as a fault whistle, etc.; Alarm, fault light or flashing light; no performance fault alarm, such as no heartbeat or no feedback signal.
  • an audible fault alarm such as a fault whistle, etc.
  • Alarm fault light or flashing light
  • no performance fault alarm such as no heartbeat or no feedback signal.
  • the marking module 29 is configured to synchronize the first running data to the node information of the second host when the fault alarm is marked.
  • the monitoring module 28 detects that the first host is faulty
  • the data synchronization status of the first host and the second host is simultaneously monitored and marked by the marking module 29, and the data request status of the community version Neo4j is monitored to switch to the second.
  • the first host is smoothly connected to continue to support the operation and application of the community version of Neo4j.
  • the data synchronization status of the first host and the second host is monitored by monitoring the change information of the data node in the data synchronization state.
  • the node information of this step includes but is not limited to node attributes, associations with other nodes, and node search paths.
  • the transmission module 30 is configured to transmit the node information to the second host, to determine a starting point of the running process of the second host according to the node information.
  • the node information is transmitted to the second host through the transmission module 30, so that the second host quickly identifies the difference of the synchronization data, and selects a more optimized manner to connect the work of the first host.
  • the specific determination method of the starting point of the running process of the second host in this embodiment is the same as the determining module 22.
  • the community version of Neo4j can also handle "big data" by providing information about an entity and its neighboring data relationships (eg, you can provide a web page to return its results), such as The number of categories of books is calculated according to the location (city) where the author is located, and a different set of columns is returned by using the same design pattern.
  • a community-based version of Neo4j's interactive rendering of a document portal is based on a simple text file that describes the entire data model, architecture, and use case queries in textual descriptions and images, supporting online execution and maintaining visualization. The portal provides a list that allows users to view the details of each list.
  • the computer device may be a server, and its internal structure may be as shown in FIG. 9.
  • the computer device includes a processor, memory, network interface, and database connected by a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the memory provides an environment for the operation of operating systems and computer readable instructions in a non-volatile storage medium.
  • the database of the computer device is used to store data such as active/standby switchover.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection.
  • the computer readable instructions when executed, perform the flow of an embodiment of the methods described above. It will be understood by those skilled in the art that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the present application is applied.
  • An embodiment of the present application also provides a computer non-volatile readable storage medium having stored thereon computer readable instructions that, when executed, perform the processes of the embodiments of the methods described above.
  • the above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of the present application.

Landscapes

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

Abstract

The present application discloses a host and backup computer switching method, an apparatus, a computing device and a storage medium, the method comprising: determining whether a host computer running a community edition of Neo4j is malfunctioning; if yes, then switching from a first host computer connected to a first port of a router to a second host computer connected to a second port of the router. The present application utilizes a router to implement switching of a community edition of Neo4j from a host computer to a backup computer, addressing the issue in the prior art wherein a single host computer running the community edition of Neo4j is unable to continue being used if a malfunction occurs.

Description

主备切换方法、装置、计算机设备和存储介质Active/standby switching method, device, computer device and storage medium
本申请要求于2018年4月20日提交中国专利局、申请号为2018103614287,发明名称为“主备切换方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 2018103614287 filed on Apr. 20, 2018, the entire disclosure of which is incorporated herein by reference. Combined in this application.
技术领域Technical field
本申请涉及到图形数据库的应用领域,特别是涉及到主备切换方法、装置、计算机设备和存储介质。The present application relates to the field of application of a graphics database, and in particular, to an active/standby switching method, apparatus, computer device, and storage medium.
背景技术Background technique
现有社区版Neo4j(Neo4j图形数据库)只有单一主机,遇到主机故障,只能中断继续使用社区版Neo4j,严重影响了社区版Neo4j的用户使用体验,影响Neo4j社区版进一步推广使用。而且现有社区版Neo4j没有双机集群体统的方案,难以做到高可用性,且在数据请求量较大时,访问随机分布的数据易发生缓存缺失,影响社区版Neo4j的正常处理业务的准确性。The existing community version of Neo4j (Neo4j graphics database) has only a single host. When it encounters a host failure, it can only discontinue the use of the community version of Neo4j, which seriously affects the user experience of the community version of Neo4j and affects the further promotion of the Neo4j community version. Moreover, the existing community version of Neo4j does not have a dual-system cluster system scheme, and it is difficult to achieve high availability. When the data request amount is large, accessing randomly distributed data is prone to cache miss, which affects the accuracy of the normal processing service of the community version Neo4j. .
技术问题technical problem
本申请的主要目的为提供一种主备切换方法,旨在解决现有社区版Neo4j没有双机集群体统的方案,导致可用性不高的技术问题。The main purpose of the present application is to provide an active/standby switching method, which aims to solve the technical problem that the existing community version of Neo4j does not have a dual-system cluster system, resulting in low availability.
技术解决方案Technical solution
本申请提出一种主备切换方法,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,包括:The present application proposes an active/standby switching method, in which a routing relay device connects the first host and the second host of the community version Neo4j, the first host is connected to the first port of the routing relay device, and the second host and the second routing device are connected. Ports are connected, including:
判断支撑社区版Neo4j的第一主机是否出现故障;Determine whether the first host supporting the community version Neo4j is faulty;
若是,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。If yes, the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device.
本申请还提供了一种主备切换装置,通过路由中转设备衔接第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,包括:The present application further provides an active/standby switching device, where the first host and the second host are connected by a routing relay device, the first host is connected to the first port of the routing device, and the second host is connected to the second port of the routing device. ,include:
第一判断模块,用于判断支撑社区版Neo4j的第一主机是否出现故障;a first determining module, configured to determine whether a first host supporting the community version Neo4j is faulty;
切换模块,用于若第一主机出现故障,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。The switching module is configured to switch, when the first host fails, the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device.
优选地,所述主备切换装置,包括:Preferably, the active/standby switching device includes:
存储模块,用于存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据;a storage module, configured to store first running data of the first host supporting community version Neo4j running process;
转移模块,用于将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。And a transfer module, configured to transfer the first running data to the second host by using a specified manner to form second running data.
本申请还提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述方法的步骤。The application also provides a computer device comprising a memory and a processor, the memory storing computer readable instructions, the processor implementing the steps of the method when the computer readable instructions are executed.
本申请还提供了一种计算机非易失性可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述的方法的步骤。The present application also provides a computer non-transitory readable storage medium having stored thereon computer readable instructions that, when executed by a processor, implement the steps of the methods described above.
有益效果Beneficial effect
本申请有益技术效果:本申请通过路由中转设备实现社区版Neo4j的主备切换,弥补了现有社区版Neo4j只有单一主机,遇到主机故障时无法继续使用社区版Neo4j,本申请通过主备主机切换,提高社区版Neo4j的使用持续性,提高用户使用体验,且主备两主机通过数据备份和数据同步,减小主备两主机在切换前后对社区版Neo4j工作进程的影响,对社区版Neo4j的持续使用具有深远意义。本申请的主备主机切换完全自动化,无需人员介入,降低成本,提高主备切换的时效性、提高效率;而且本申请通过创建实例数据库,提高社区版Neo4j快速响应数据请求,减少缓存缺失,提高准确性。The application has the beneficial technical effects: the present application implements the active/standby switchover of the community version of Neo4j through the routing relay device, and makes up for the existing community version of Neo4j with only a single host, and cannot continue to use the community version of Neo4j when a host failure occurs. This application passes the active and standby hosts. Switching to improve the usage continuity of the community version of Neo4j, improve the user experience, and the master and backup hosts reduce the impact of the active and standby hosts on the community version of Neo4j work process before and after the switchover through data backup and data synchronization. For the community version of Neo4j The continued use of it has far-reaching implications. The active/standby switchover of this application is completely automated, eliminating the need for personnel intervention, reducing costs, improving the timeliness of active/standby switchover, and improving efficiency. Moreover, this application improves the community version of Neo4j's fast response data request by creating an instance database, reducing cache misses and improving accuracy.
附图说明DRAWINGS
图1 本申请一实施例的主备切换方法流程示意图;1 is a schematic flowchart of an active/standby switching method according to an embodiment of the present application;
图2 本申请一实施例的主备切换装置结构示意图;2 is a schematic structural diagram of an active/standby switching device according to an embodiment of the present application;
图3 本申请另一实施例的主备切换装置结构示意图;3 is a schematic structural diagram of an active/standby switching device according to another embodiment of the present application;
图4 本申请再一实施例的主备切换装置结构示意图;4 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application;
图5 本申请又一实施例的主备切换装置结构示意图;FIG. 5 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application;
图6 本申请又一实施例的主备切换装置结构示意图;6 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application;
图7 本申请又一实施例的主备切换装置结构示意图;7 is a schematic structural diagram of an active/standby switching device according to still another embodiment of the present application;
图8 本申请一实施例的计算机设备内部结构示意图。FIG. 8 is a schematic diagram showing the internal structure of a computer device according to an embodiment of the present application.
本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION
参照图1,本申请一实施例的社区版Neo4j的主备切换方法,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,本发明实施例通过路由中转设备实现衔接社区版Neo4j的第一主机和第二主机的切换和数据转移,包括:Referring to FIG. 1 , an active/standby switching method of a community version of Neo4j according to an embodiment of the present invention connects a first host and a second host of a community version Neo4j through a routing relay device, and the first host is connected to a first port of a routing device, The second host is connected to the second port of the routing relay device. The embodiment of the present invention implements the switching and data transfer between the first host and the second host of the community version Neo4j through the routing relay device, including:
S1:判断支撑社区版Neo4j的第一主机是否出现故障。S1: Determine whether the first host supporting the community version Neo4j is faulty.
本实施例通过预设故障识别条件进行识别,举例地,根据启动指令连续启动第一主机三次以上,未成功开启,则判定为故障。本实施例为社区版Neo4j的主备主机的切换,提高社区版Neo4j的高可用性。本实施例的社区版Neo4j是一个面向网络的数据库,基于嵌入式的、基于磁盘的、具备完全的事务特性的Java持久化引擎,本实施例的社区版Neo4j将结构化数据存储在网络中,可以应用更加敏捷和快速的开发模式,上述网络指灵活的数据结构,或从数学角度叫做图。Neo4j 相当于一个高性能的图引擎,具有成熟数据库的所有特性,社区版Neo4j和企业版Neo4j相比,虽然价格低、易推广使用,但技术特性方面却远没有企业版Neo4j强大,因为社区版Neo4j不存在双机集群系统,只有一个指定功率的主机,所以现有社区版Neo4j不包括数据库和查询管理等功能,不具有高可用性。In this embodiment, the fault is identified by a preset fault identification condition. For example, the first host is continuously started three times or more according to the start command, and if it is not successfully turned on, it is determined to be a fault. This embodiment is a handover of the active and standby hosts of the community version Neo4j, and improves the high availability of the community version Neo4j. The community version Neo4j of this embodiment is a network-oriented database, based on an embedded, disk-based, Java persistence engine with full transaction characteristics. The community version of Neo4j of this embodiment stores structured data in a network. A more agile and fast development model can be applied. The above network refers to a flexible data structure, or mathematically called a graph. Neo4j Equivalent to a high-performance graph engine with all the features of a mature database. Compared with the enterprise version of Neo4j, the community version of Neo4j is cheaper and easier to promote, but the technical features are far less powerful than the enterprise version of Neo4j, because the community version of Neo4j There is no dual-system cluster system, only one host with specified power, so the existing community version of Neo4j does not include functions such as database and query management, and does not have high availability.
S2:若是,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。S2: If yes, the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device.
本步骤通过设置于前端的路由中转设备实现社区版Neo4j的主备主机的切换,在第一主机出现异常故障时,及时切换到第二主机以便继续支撑社区版Neo4j的顺利运行,提高社区版Neo4j的运行效率。本实施例通过具有均衡功能的路由中转设备实现社区版Neo4j的主备主机的切换,比如F5(F5 Network公司的负载均衡)、Nginx(伊戈尔·赛索耶夫开发的负载均衡服务器)、Keepalive(类似于layer3, 4 & 7交换机制的软件,即第3层、第4层和第7层自动交换,可用于主机间的切换)等,实现快速切换,进一步提升社区版Neo4j的主备机切换效果。比如通过F5进行切换时,可在一分钟内完成切换操作,提高社区版Neo4j的主备主机的切换的顺畅度,提升用户使用体验。本申请其他实施例也可通过人工核查第一主机故障后,启动设置于前端的F5,通过转换主机设备与F5的连接端口的连接关系,实现从第一主机到第二主机的切换,以再次确认故障判断,提高主机设备的利用率。In this step, the active/standby host of the community version Neo4j is switched through the route relay device set in the front end. When the first host has an abnormal fault, the host is switched to the second host in time to continue to support the smooth running of the community version of Neo4j, and the community version of Neo4j is improved. Operating efficiency. In this embodiment, the switching between the active and standby hosts of the community version Neo4j is implemented through a route relay device with equalization function, such as F5 (F5). Network's load balancing), Nginx (load balancing server developed by Igor Saysoyev), Keepalive (similar to layer3, 4 & 7 switch system software, that is, Layer 3, Layer 4 and Layer 7 automatic switching, can be used for switching between hosts, etc., to achieve fast switching, and further improve the switching effect of the community version of Neo4j master and backup. For example, when switching through F5, the switching operation can be completed in one minute, and the smoothness of the switching between the active and standby hosts of the community version Neo4j is improved, and the user experience is improved. In other embodiments of the present application, after manually detecting the first host failure, the F5 set at the front end is started, and the connection relationship between the host device and the F5 connection port is changed, thereby realizing the switching from the first host to the second host, to Confirm the fault judgment and improve the utilization of the host device.
进一步地,本实施例的步骤S1之前,包括:Further, before step S1 of this embodiment, the method includes:
 S11:存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据。S11: Store first operation data of the first host supporting community version Neo4j running process.
本实施例的社区版Neo4j在运行过程中,实时存储运行数据,比如存储于第一主机的内存上,以便数据共享、数据分析等。In the running process, the community version Neo4j stores the running data in real time, such as in the memory of the first host, for data sharing, data analysis, and the like.
 S12:将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。S12: Transfer the first running data to the second host by using a specified manner to form second running data.
本实施例通过将第一运行数据转移到第二主机上,以便第二主机在第一主机处理业务进程的基础上,接续第一主机继续支撑社区版Neo4j的正常运行,以避免影响用户的正常使用,提高用户的使用体验。本步骤的指定方式包括但不限于FTP(File Transfer Protocol) 、SFTP (Secure File Transfer Protocol,安全文件传送协议)、SCP(Secure Copy)。In this embodiment, the first running data is transferred to the second host, so that the second host continues to support the normal operation of the community version of Neo4j on the basis of the first host processing business process, so as to avoid affecting the normal operation of the user. Use to improve the user experience. The specified method of this step includes but is not limited to FTP (File Transfer Protocol), SFTP (Secure File Transfer Protocol), SCP (Secure) Copy).
本申请一实施例中的指定方式为FTP,FTP是TCP/IP(Transmission Control Protocol/Internet Protocol的简写,中译名为传输控制协议/因特网互联协议,又名网络通讯协议)网络上两台计算机传送文件的协议,属于网络协议组的应用层。FTP客户机可以给服务器发出命令来下载文件,上载文件,创建或改变服务器上的目录。本实施例的FTP用到两个TCP连接,一个是命令链路,用来在FTP主机端与服务器之间传递命令;另一个是数据链路,用来上传或下载数据。本实施例的FTP是基于TCP协议的,因此防火墙设置中只需要放开指定端口的TCP协议即可,FTP允许明文传输,当然也可根据需要设置为带SSL(Secure Sockets Layer 安全套接层)的加密FTP。本实施例的FTP工作模式包括PORT(主动)方式、PASV(Passive被动)方式。举例地,PORT(主动)方式的连接过程是:主机端向服务器的指定端口发送连接请求,服务器接受连接,建立一条命令链路。当需要传送数据时,主机端在命令链路上用PORT命令告诉服务器:已打开了一个1024+的随机端口,可连接。于是服务器从指定端口向主机端的1024+随机端口发送连接请求,建立一条数据链路来传送数据。再举例地,PASV方式的连接过程是:主机端向服务器的FTP端口发送连接请求,服务器接受连接,建立一条命令链路。当需要传送数据时,服务器在命令链路上用PASV命令告诉主机端:已打开了一个1024+的随机端口,可连接。于是主机端向服务器的指定端口发送连接请求,建立一条数据链路来传送数据。但普通FTP仅使用端口21作为命令传输。由服务器和主机端协商另外一个随机端口来进行数据传送。在PASV模式下,服务器端需要侦听另一个随机端口。假如服务器在路由器或者防火墙后面,端口映射会比较麻烦,因为无法提前知道数据端口编号,无法映射。The specified mode in the embodiment of the present application is FTP, and the FTP is TCP/IP (Transmission). Short for Control Protocol/Internet Protocol, the Chinese translation is called Transmission Control Protocol/Internet Protocol, also known as Network Communication Protocol. The protocol for transferring files between two computers on the network belongs to the application layer of the network protocol group. The FTP client can issue commands to the server to download files, upload files, and create or change directories on the server. The FTP of this embodiment uses two TCP connections, one is a command link for transmitting commands between the FTP host and the server, and the other is a data link for uploading or downloading data. The FTP in this embodiment is based on the TCP protocol. Therefore, only the TCP protocol of the specified port needs to be released in the firewall setting. FTP allows plaintext transmission. Of course, it can also be set to have SSL (Secure). Sockets Layer Secure Sockets Layer) Encrypted FTP. The FTP working mode of this embodiment includes a PORT (active) mode and a PASV (passive passive mode). For example, the PORT (active) connection process is: the host sends a connection request to a designated port of the server, and the server accepts the connection and establishes a command link. When data needs to be transmitted, the host uses the PORT command on the command link to tell the server that a random port of 1024+ has been opened and can be connected. The server then sends a connection request from the designated port to the 1024+ random port on the host side, establishing a data link to transmit data. For example, the connection process of the PASV mode is: the host sends a connection request to the FTP port of the server, and the server accepts the connection and establishes a command link. When data needs to be transmitted, the server uses the PASV command on the command link to tell the host that a 1024+ random port has been opened and can be connected. The host then sends a connection request to the designated port of the server, establishing a data link to transfer the data. However, normal FTP only uses port 21 as a command transmission. The server and the host negotiate another random port for data transfer. In PASV mode, the server side needs to listen to another random port. If the server is behind a router or firewall, port mapping can be cumbersome because the data port number cannot be known in advance and cannot be mapped.
本申请一实施例中指定方式为数据传输使用SSH(Secure Shell),SSH 为建立在应用层和传输层基础上的安全协议。本实施例的SSH 主要有三部分组成:传输层协议SSH-TRANS ,用户认证协议 SSH-USERAUTH ,连接协议 SSH-CONNECT。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题,提供安全保证。本实施例的SSH中包括SFTP安全文件传输子系统,SFTP可以为传输文件提供一种安全的加密方法,SFTP 与上述FTP有着几乎一样的语法和功能。本实施例的SFTP本身没有单独的守护进程,必须使用SSH守护进程来完成相应的连接操作。SFTP使用加密传输认证信息和传输的数据,非常安全。但是由于使用了加密/解密技术,传输效率比普通的FTP要低得多,只有对网络安全性要求更高时,使用SFTP代替FTP。In the embodiment of the present application, the specified method is SSH (Secure Shell) for data transmission, and SSH is a security protocol based on the application layer and the transport layer. SSH of this embodiment There are three main components: the transport layer protocol SSH-TRANS, the user authentication protocol SSH-USERAUTH, and the connection protocol SSH-CONNECT. The SSH protocol can effectively prevent information leakage during remote management and provide security. The SSH in this embodiment includes an SFTP secure file transfer subsystem, and SFTP can provide a secure encryption method for transmitting files, SFTP. Has almost the same syntax and functionality as FTP above. The SFTP of this embodiment does not have a separate daemon process, and the SSH daemon must be used to complete the corresponding connection operation. SFTP uses encryption to transmit authentication information and transmitted data, which is very secure. However, due to the use of encryption/decryption technology, the transmission efficiency is much lower than that of ordinary FTP. When the network security requirements are higher, SFTP is used instead of FTP.
本实施例优选通过SCP把第一运行数据转移到第二主机上,操作更加简单,更便于实现,提高数据同步共享的效率。本实施例的SCP基于SSH登录,可用来进行远程文件复制的,更加满足将第一运行数据同步到第二主机上,并且整个复制过程是加密的。举例地,要把第一运行数据的当前一个文件同步到远程第二主机上,从本地复制到远程的命令格式为: scp local_file remote_username@remote_ip:remote_folder或者scp local_file remote_username@remote_ip:remote_file或者scp local_file remote_ip:remote_folder 或者 scp local_file remote_ip:remote_file,第1,2个命令格式中指定了用户名,命令执行后需要再输入密码,第1个命令格式仅指定了远程的目录,文件名字不变,第2个命令格式指定了文件名;第3,4个命令格式没有指定用户名,命令执行后需要输入用户名和密码,第3个命令格式仅指定了远程的目录,文件名字不变,第4个命令格式指定了文件名;而从远程复制到本地,只要将从本地复制到远程的命令 的 后两个命令格式中的参数调换顺序即可实现,本实施例的远程和本地包括远程服务器与本地服务器之间的数据同步,也包括远程主机终端与本地主机终端之间的数据同步。本实施例的SCP /SFTP属于开源协议可免费使用,不像FTP存在安全或版权问题,且SCP /SFTP传输软件均免费并开源,方便开发各种扩展插件和应用组件。In this embodiment, the first operation data is transferred to the second host through the SCP, and the operation is simpler, more convenient, and the efficiency of data synchronization sharing is improved. The SCP of this embodiment is based on SSH login and can be used for remote file copying, and is more suitable for synchronizing the first running data to the second host, and the entire copying process is encrypted. For example, to synchronize the current file of the first running data to the remote second host, the format of the command copied from the local to the remote is: scp local_file remote_username@remote_ip:remote_folder or scp local_file remote_username@remote_ip:remote_file or scp local_file Remote_ip:remote_folder or scp local_file remote_ip:remote_file, the user name is specified in the first and second command formats. The password needs to be entered after the command is executed. The first command format only specifies the remote directory, and the file name does not change. The command format specifies the file name; the third and fourth command formats do not specify a user name, the user name and password are required after the command is executed, and the third command format specifies only the remote directory, the file name does not change, and the fourth command The format specifies the file name; from remote copy to local, as long as the command will be copied locally to the remote The parameter switching sequence in the last two command formats can be implemented. The remote and local in this embodiment includes data synchronization between the remote server and the local server, and also includes data synchronization between the remote host terminal and the local host terminal. SCP of this embodiment /SFTP is open source protocol free of charge, unlike FTP security or copyright issues, and SCP / SFTP transmission software is free and open source, easy to develop a variety of extensions and application components.
本申请另一实施例中,步骤S2之后,包括:In another embodiment of the present application, after step S2, the method includes:
S21:判断所述第二运行数据与所述第一运行数据的数据交集。S21: Determine an intersection of the data of the second running data and the first running data.
本步骤的数据交集通过比较第一运行数据与第二运行数据的节点数获得。本申请其他实施例中,数据交集也可通过数据字节数等其他方式获得。本实施例的社区版Neo4j是一个高性能的NOSQL(Not Only SQL)图形数据库,它将结构化数据存储在网络上,NOSQL图形数据库中,对应着两个概念:节点集和节点。NOSQL图形数据库中的数据展示并不使用节点集,而是独立的节点。本实施例的NOSQL具有如下特征:不需要事先定义数据模式,预定义表结构,数据中的每条记录都可能有不同的属性和格式,当插入数据时,并不需要预先定义模式;相对于将所有数据存储的存储区域网络中的全共享架构,NOSQL将数据划分后存储在各个本地服务器上,因为从本地磁盘读取数据的性能好于通过网络传输读取数据的性能,从而提高了系统的性能;可以在系统运行的时候,动态增加或者删除节点,不需要停机维护,数据可以自动迁移;相对于将数据存放于同一个节点,NOSQL数据库需要将数据进行分区,将记录分散在多个节点上面,并且分区的同时还要做复制,既提高了并行性能,又能保证没有单点失效的问题;和RAID(Redundant Arrays of Independent Disks,磁盘阵列)存储系统不同的是,NOSQL中的复制是基于日志的异步复制,数据尽快地写入节点,减少网络传输引起迟延。NOSQL数据库并没有一个统一的架构,两种NOSQL数据库之间的不同,甚至远远超过两种关系型数据库的不同。但NOSQL各有所长,本实施例的NOSQL图形数据库特别适用于社区版Neo4j,第一主机和第二主机之间同步NOSQL图形数据库的数据,依据复制节点数据进行完成。The data intersection of this step is obtained by comparing the number of nodes of the first operational data with the second operational data. In other embodiments of the present application, the data intersection may also be obtained by other methods such as the number of data bytes. The community version Neo4j of this embodiment is a high performance NOSQL (Not Only SQL) graph database, which stores structured data on the network. In the NOSQL graph database, there are two concepts: node set and node. The data display in the NOSQL graph database does not use a node set, but an independent node. The NOSQL of this embodiment has the following features: no need to define a data pattern in advance, a predefined table structure, each record in the data may have different attributes and formats, and when inserting data, it is not necessary to define a pattern in advance; The all-sharing architecture in the storage area network where all data is stored, NOSQL divides the data and stores it on each local server, because the performance of reading data from the local disk is better than the performance of reading data through the network transmission, thereby improving the system. Performance; can dynamically add or delete nodes while the system is running, no downtime maintenance, data can be automatically migrated; compared to the data stored in the same node, NOSQL database needs to partition the data, spread the records in multiple Above the node, and the partition has to be replicated at the same time, which improves the parallel performance and guarantees that there is no single point of failure; and RAID (Redundant) Arrays of Independent Disks (disk array) storage system is different, the replication in NOSQL is based on asynchronous replication of the log, the data is written to the node as soon as possible, reducing network transmission delay. The NOSQL database does not have a unified architecture. The difference between the two NOSQL databases is far more than the difference between the two relational databases. However, NOSQL has its own advantages. The NOSQL graph database of this embodiment is particularly suitable for the community version Neo4j. The data of the NOSQL graph database is synchronized between the first host and the second host, and is completed according to the data of the copy node.
S22:根据所述数据交集确定所述第二主机的运行进程起点。S22: Determine a starting point of the running process of the second host according to the data intersection.
本实施例中通过第一运行数据与第二运行数据的数据交集确定第二主机的启动起点标签,即第二主机的运行进程起点。比如,第一运行数据中包括节点A、节点B、节点C、节点D;第二运行数据中包括节点A、节点B、节点C,则进一步判断节点C的数据是否完整,若是,则第二主机则从第一主机在节点C处或节点C之前的任一时刻点对应的业务数据处所进行的业务处理开始,继续支撑社区版Neo4j的运行;若判定节点C的数据不完整,则判断是否可获取节点C的数据终止处的数据信息,若可获取节点C的数据终止处的数据信息,则第二主机从第一主机在上述节点C的数据终止处或节点C的数据终止之前的任一时刻点对应的业务数据处所进行的业务处理开始;若不可获取节点C的数据终止处的数据信息,则第二主机从第一主机在节点C之前的任一时刻点对应的业务数据处所进行的业务处理开始。第二主机选择的起始节点能够接续第一主机继续支撑社区版Neo4j的正常运行,不影响用户的正常使用即可。数据在第一主机与第二主机之间实现共享中存在时间延迟,第二运行数据中的数据节点为业务已进行过的数据,第二主机选择的节点可以是刚好接续的节点数据为起始点,也可是刚好接续节点之前的节点数据作为起始点。In this embodiment, the starting start label of the second host, that is, the starting point of the running process of the second host, is determined by the data intersection of the first running data and the second running data. For example, the first running data includes node A, node B, node C, and node D; and the second running data includes node A, node B, and node C, and further determines whether the data of node C is complete, and if so, the second The host starts from the service processing performed by the first host at the node C or at the service data location corresponding to the node C, and continues to support the operation of the community version Neo4j; if it is determined that the data of the node C is incomplete, it is determined whether The data information at the end of the data of the node C can be obtained. If the data information at the end of the data of the node C can be obtained, the second host is terminated from the first host at the end of the data of the node C or before the data of the node C is terminated. The service processing performed at the corresponding service data location at the moment is started; if the data information at the data termination of the node C is not available, the second host performs the corresponding service data from the first host at any point before the node C. The business process begins. The starting node selected by the second host can continue to support the normal operation of the community version Neo4j, and does not affect the normal use of the user. There is a time delay in the data sharing between the first host and the second host. The data node in the second running data is data that has been processed by the service, and the node selected by the second host may be the node data just connected as the starting point. Or, it is just the node data before the node is connected as the starting point.
本申请再一实施例中,步骤S2之后,包括:In still another embodiment of the present application, after step S2, the method includes:
S23:记录所述社区版Neo4j的访问数据和所述访问数据对应的访问频次。S23: Record the access data of the community version Neo4j and the access frequency corresponding to the access data.
本实施例的社区版Neo4j通过缓存记录最近访问的数据。The community version Neo4j of this embodiment records the most recently accessed data by caching.
S24:获取所述访问数据中,所述访问频次大于预设阈值的高频次访问数据。S24: Acquire, in the access data, the high frequency access data whose access frequency is greater than a preset threshold.
举例地,本步骤的预设阈值比如为访问三次,访问次数大于三次则为高频次访问数据。For example, the preset threshold of this step is, for example, three times of access, and the number of accesses is greater than three times, which is high frequency access data.
S25:通过汇总所述高频次访问数据与所述高频次访问数据对应的实例场景,形成实例数据库并存储。S25: Form an instance database and store by summarizing the instance scenarios corresponding to the high frequency secondary access data and the high frequency secondary access data.
本实施例的社区版Neo4j是一个图形数据库,数据并非保存在表或集合中,而是保存为节点以及节点之间的关系。在社区版Neo4j中,节点以及关系都能够包含保存值的属性,为节点设置零或多个标签(例如Author或Book),每个关系都对应一种类型(例如WROTE或FRIEND_OF),关系总是从一个节点指向另一个节点(但可以在不考虑指向性的情况下进行查询)。本实施例的社区版Neo4j自带一套易于学习的查询语言(名为Cypher)不使用Schema(数据库对象的集合,一个用户一般对应一个Schema),因此可以满足任何形式的需求。本实施例通过将高频次访问数据根据情景的相关性进行汇总,形成实例场景的数据库并存储,以实现数据库的局部数据逐渐模块化、模型化,以提高社区版Neo4j快速响应数据请求,且防止请求量非常大时而导致随机分布的数据发生缓存缺失,上述实例场景包括根据数据类型形成的场景情景汇总,比如将涉及医药信息、医院信息、病例介绍、医疗器材等的数据汇总为医疗行业的实例场景。本实施例的社区版Neo4j与关系型数据库相比,对于高度关联的数据(图形数据)的查询快速要快上许多。本实施例的社区版Neo4j的实体与关系结构非常自然地切合人类的直观感受,支持兼容ACID(数据库事务正确执行的四个基本要素的缩写,包含:原子性Atomicity、一致性Consistency、隔离性Isolation、持久性Durability)的事务操作,提供了一个高可用性模型,以支持大规模数据量的查询,支持备份、数据局部性以及冗余,提供了一个可视化的查询控制台,避免引起人员疲倦感。本实施例通过汇总所述访问数据与所述访问数据对应的实例场景,形成实例数据库并存储,以提高社区版Neo4j快速响应数据请求,且防止请求量非常大时而导致随机分布的数据发生缓存缺失。The community version Neo4j of this embodiment is a graphics database, and the data is not stored in a table or a collection, but is saved as a node and a relationship between nodes. In the community version of Neo4j, nodes and relationships can contain attributes that hold values, zero or more tags (such as Author or Book) for the node, and each relationship corresponds to a type (such as WROTE or FRIEND_OF), the relationship is always Point from one node to another (but can do so without regard to directivity). The community version of Neo4j of this embodiment comes with a set of easy-to-learn query language (called Cypher) that does not use Schema (a collection of database objects, a user generally corresponds to a Schema), so it can meet any form of requirements. In this embodiment, the high-frequency access data is aggregated according to the relevance of the scenario, and a database of the instance scenario is formed and stored, so that the local data of the database is gradually modularized and modeled, so as to improve the community version of Neo4j rapid response data request, and Preventing the random distribution of data from being cached when the number of requests is very large. The above example scenario includes a summary of scenario scenarios based on data types, such as summarizing data related to medical information, hospital information, case introduction, medical equipment, etc. into the medical industry. Example scenario. Compared with the relational database, the community version Neo4j of this embodiment is much faster to query highly correlated data (graphic data). The entity and relationship structure of the community version Neo4j of this embodiment is very natural to meet the human intuitive feeling, and supports ACID (abbreviation of four basic elements of database transaction correct execution, including: atomic Atomicity, Consistency Consistency, Isolation Isolation) Transaction operation provides a high-availability model to support large-volume data queries, support for backup, data locality, and redundancy, providing a visual query console to avoid staff fatigue. In this embodiment, an instance database corresponding to the access data is aggregated to form an instance database and stored, so as to improve the community version of Neo4j fast response data request, and prevent a random distribution of data from being cached when the request amount is very large. .
进一步地,步骤S25之后,还包括:Further, after step S25, the method further includes:
S26:判断所述第二主机当前运行的实例场景是否已存储备份。S26: Determine whether the instance scenario currently running by the second host has stored a backup.
通过判断当前运行的实例场景是否已存在相应的备份数据库,提高调用数据的效率。比如,本实施例通过实例场景的分类标签判断两个实例场景的相似度,比如,实例场景标签显示两个实例场景均为医疗领域,则判定相似。若一个场景标签显示为医疗领域,另一个场景标签显示为影视领域,则判定不相似。本实施例的场景标签分类可根据需要,进一步细化分类,以提高根据实例场景标签调用数据的可靠性。本实施例的实例场景分类标签可通过卷积神经网络获取的实例场景的图片组成要素的特征进行分类,并根据图片组成要素的特征相似度判断实例场景的相似度。本实施例优选根据欧式距离判断两个图片组成要素的特征相似度,进而判断两个实例场景的相似度。Improve the efficiency of calling data by judging whether the corresponding backup database exists in the currently running instance scenario. For example, in this embodiment, the similarity between the two instance scenarios is determined by using the classification label of the example scenario. For example, if the instance scenario label shows that the two instance scenarios are all medical fields, the determination is similar. If one scene label is displayed as a medical field and another scene label is displayed as a movie field, the determination is not similar. The scene label classification in this embodiment may further refine the classification according to requirements to improve the reliability of calling data according to the instance scene label. The example scene classification label of the embodiment may be classified by the feature of the picture component of the instance scene acquired by the convolutional neural network, and the similarity of the instance scene is determined according to the feature similarity of the picture component. In this embodiment, it is preferable to determine the feature similarity of the two picture constituent elements according to the Euclidean distance, and further determine the similarity between the two example scenes.
S27:若是,则调用与当前运行的所述实例场景匹配的访问数据。S27: If yes, the access data matching the currently running instance scenario is invoked.
举例地,当前运行的实例场景为医疗领域,则调用标签为医疗领域的数据,增加快捷性。For example, if the currently running instance scenario is in the medical field, the tag is data in the medical field, which increases the speed.
本申请又一实施例中,步骤S2之后,包括:In another embodiment of the present application, after step S2, the method includes:
S28:监测所述第一主机的故障报警。S28: Monitor the fault alarm of the first host.
本实施例在衔接第一主机和第二主机的应用模块上,设置了监测功能,以监测第一主机的故障报警。比如,第一主机故障后,应用模块接收故障报警信息。比如通过监听心跳包的方式进行监听,未接收到第一主机的心跳监听反馈信息,则判定第一主机故障,本实施例的故障报警包括声音式故障报警,如故障鸣笛等;灯光式故障报警,故障明灯或闪灯;无表现式故障报警,如无心跳信号或无反馈信号等。In this embodiment, a monitoring function is set on the application module that connects the first host and the second host to monitor the fault alarm of the first host. For example, after the first host fails, the application module receives the fault alarm information. For example, by monitoring the heartbeat packet for monitoring, and not receiving the heartbeat monitoring feedback information of the first host, determining that the first host is faulty, the fault alarm of the embodiment includes an audible fault alarm, such as a fault whistle, etc.; Alarm, fault light or flashing light; no performance fault alarm, such as no heartbeat or no feedback signal.
S29:标记故障报警时第一运行数据同步到所述第二主机的节点信息。S29: The first running data is synchronized to the node information of the second host when the fault alarm is marked.
本实施例通过在监测到第一主机故障时,会同时监测第一主机和第二主机的数据同步状况、以及社区版Neo4j的数据请求状态,以便切换到第二主机后,更顺畅地接续第一主机继续支撑社区版Neo4j的运行和应用。本实施例通过监测数据同步状态中数据节点的变化信息来监测第一主机和第二主机的数据同步状况。本步骤的节点信息包括但不限于节点属性、与其他节点的关联关系、节点查寻路径等节点信息。In this embodiment, when the first host failure is detected, the data synchronization status of the first host and the second host and the data request status of the community version Neo4j are simultaneously monitored, so as to switch to the second host, the connection is smoother. A host continues to support the operation and application of the community version of Neo4j. In this embodiment, the data synchronization status of the first host and the second host is monitored by monitoring the change information of the data node in the data synchronization state. The node information of this step includes but is not limited to node attributes, associations with other nodes, and node search paths.
S30:将所述节点信息传输至所述第二主机,以根据所述节点信息确定所述第二主机的运行进程起点。S30: transmitting the node information to the second host, to determine a starting point of the running process of the second host according to the node information.
将上述节点信息传输至第二主机,以便第二主机快速识别同步数据的差量,选择更优化的方式,接续第一主机的工作。本实施例的第二主机的运行进程起点的具体确定方法同步骤S22。The node information is transmitted to the second host, so that the second host quickly recognizes the difference of the synchronization data, and selects a more optimized manner to connect the work of the first host. The specific determination method of the starting point of the running process of the second host in this embodiment is the same as step S22.
除了上述应用之外,本申请一实施例中,通过提供关于某个实体及其相邻数据关系(比如你可以提供一个web页面返回其结果),社区版Neo4j也能够处理“大数据”,比如按照作者所处的地点(城市)计算书籍的分类数目,通过使用相同的设计模式,返回一组不同的列。比如,基于社区版Neo4j的一个互式地渲染生成的文档门户网站,基于一个简单的文本文件,其中用文字描述以及图片描述了整个数据模型、架构以及用例查询,支持在线执行并保持可视化。门户网站提供了一个列表,允许用户查看每个列表的详细内容。In addition to the above applications, in an embodiment of the present application, the community version of Neo4j can also handle "big data" by providing information about an entity and its neighboring data relationships (eg, you can provide a web page to return its results), such as The number of categories of books is calculated according to the location (city) where the author is located, and a different set of columns is returned by using the same design pattern. For example, a community-based version of Neo4j's interactive rendering of a document portal is based on a simple text file that describes the entire data model, architecture, and use case queries in textual descriptions and images, supporting online execution and maintaining visualization. The portal provides a list that allows users to view the details of each list.
本申请实施例通过路由中转设备实现社区版Neo4j的主备切换,弥补了现有社区版Neo4j只有单一主机,遇到主机故障时无法继续使用社区版Neo4j,本申请实施例通过主备主机切换,提高社区版Neo4j的使用持续性,提高用户使用体验,且主备两主机通过数据备份和数据同步,减小主备两主机在切换前后对社区版Neo4j工作进程的影响,对社区版Neo4j的持续使用具有深远意义。本申请实施例的主备主机切换完全自动化,无需人员介入,降低成本,提高主备切换的时效性、提高效率;而且本申请实施例通过创建实例数据库,提高社区版Neo4j快速响应数据请求,减少缓存缺失,提高准确性。In the embodiment of the present application, the active/standby switchover of the community version of Neo4j is implemented by the route relay device, and the existing community version of Neo4j has only a single host. When the host fails, the community version of Neo4j cannot be used. Improve the use of the community version of Neo4j to improve the user experience, and the master and backup hosts through data backup and data synchronization, reduce the impact of the active and standby hosts on the community version of Neo4j work process before and after the switch, the continuation of the community version of Neo4j Use has far-reaching implications. The active/standby host switching in the embodiment of the present application is completely automated, and no personnel intervention is required, which reduces costs, improves the timeliness of the active/standby switchover, and improves efficiency. Moreover, the embodiment of the present application improves the community version of the Neo4j fast response data request by reducing the instance database. Missing caches improve accuracy.
参照图2,本申请以实施例的主备切换装置,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,本发明实施例通过路由中转设备实现衔接社区版Neo4j的第一主机和第二主机的切换和数据转移,包括:Referring to FIG. 2, the primary and secondary switching devices of the embodiment are connected to the first host and the second host of the community version Neo4j through a routing relay device, and the first host is connected to the first port of the routing device, and the second host and the route are connected. The second port of the transit device is connected to each other. The embodiment of the present invention implements the switching and data transfer between the first host and the second host of the community version Neo4j through the routing relay device, including:
第一判断模块1,用于判断支撑社区版Neo4j的第一主机是否出现故障。The first judging module 1 is configured to determine whether the first host supporting the community version Neo4j is faulty.
本实施例通过第一判断模块1中的预设故障识别条件进行识别,举例地,根据启动指令连续启动第一主机三次以上,未成功开启,则判定为故障。本实施例为社区版Neo4j的主备主机的切换,提高社区版Neo4j的高可用性。本实施例的社区版Neo4j是一个面向网络的数据库,基于嵌入式的、基于磁盘的、具备完全的事务特性的Java持久化引擎,本实施例的社区版Neo4j将结构化数据存储在网络中,可以应用更加敏捷和快速的开发模式,上述网络指灵活的数据结构,或从数学角度叫做图。Neo4j 相当于一个高性能的图引擎,具有成熟数据库的所有特性,社区版Neo4j和企业版Neo4j相比,虽然价格低、易推广使用,但技术特性方面却远没有企业版Neo4j强大,因为社区版Neo4j不存在双机集群系统,只有一个指定功率的主机,所以现有社区版Neo4j不包括数据库和查询管理等功能,不具有高可用性。This embodiment is identified by the preset fault identification condition in the first judging module 1. For example, the first host is continuously started three times or more according to the start command, and if it is not successfully turned on, it is determined to be a fault. This embodiment is a handover of the active and standby hosts of the community version Neo4j, and improves the high availability of the community version Neo4j. The community version Neo4j of this embodiment is a network-oriented database, based on an embedded, disk-based, Java persistence engine with full transaction characteristics. The community version of Neo4j of this embodiment stores structured data in a network. A more agile and fast development model can be applied. The above network refers to a flexible data structure, or mathematically called a graph. Neo4j Equivalent to a high-performance graph engine with all the features of a mature database. Compared with the enterprise version of Neo4j, the community version of Neo4j is cheaper and easier to promote, but the technical features are far less powerful than the enterprise version of Neo4j, because the community version of Neo4j There is no dual-system cluster system, only one host with specified power, so the existing community version of Neo4j does not include functions such as database and query management, and does not have high availability.
切换模块2,用于若第一主机出现故障,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。The switching module 2 is configured to switch, when the first host fails, the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device.
本实施例通过切换模块2中的设置于前端的路由中转设备实现社区版Neo4j的主备主机的切换,在第一主机出现异常故障时,及时切换到第二主机以便继续支撑社区版Neo4j的顺利运行,提高社区版Neo4j的运行效率。本实施例通过具有均衡功能的路由中转设备实现社区版Neo4j的主备主机的切换,比如F5(F5 Network公司的负载均衡)、Nginx(伊戈尔·赛索耶夫开发的负载均衡服务器)、Keepalive(类似于layer3, 4 & 7交换机制的软件,即第3层、第4层和第7层自动交换的软件,可用于主机间的切换)等,实现快速切换,进一步提高社区版Neo4j的主备机切换的效果。比如通过F5进行切换时,可在一分钟内完成切换操作,提高社区版Neo4j的主备主机的切换的顺畅度,提升用户使用体验。本申请其他实施例也可通过人工核查第一主机故障后,启动设置于前端的F5,通过转换主机设备与F5的连接端口的连接关系,实现从第一主机到第二主机的切换,以再次确认故障判断,提高主机设备的利用率。In this embodiment, the switching between the active and standby hosts of the community version Neo4j is implemented by the routing relay device disposed in the front end of the switching module 2, and when the first host has an abnormal fault, the second host is switched to the second host to continue to support the community version of Neo4j. Run to improve the operational efficiency of the community version of Neo4j. In this embodiment, the switching between the active and standby hosts of the community version Neo4j is implemented through a route relay device with equalization function, such as F5 (F5). Network's load balancing), Nginx (load balancing server developed by Igor Saysoyev), Keepalive (similar to layer3, 4 & 7 switch system software, ie, Layer 3, Layer 4 and Layer 7 automatic switching software, can be used for switching between hosts, etc., to achieve fast switching, and further improve the effect of the community version of Neo4j master and backup machine switching . For example, when switching through F5, the switching operation can be completed in one minute, and the smoothness of the switching between the active and standby hosts of the community version Neo4j is improved, and the user experience is improved. In other embodiments of the present application, after manually detecting the first host failure, the F5 set at the front end is started, and the connection relationship between the host device and the F5 connection port is changed, thereby realizing the switching from the first host to the second host, to Confirm the fault judgment and improve the utilization of the host device.
参照图3,本申请另一实施例的主备切换装置,包括:Referring to FIG. 3, an active/standby switching device of another embodiment of the present application includes:
存储模块11,用于存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据。The storage module 11 is configured to store first running data of the first host supporting community version Neo4j running process.
本实施例的社区版Neo4j在运行过程中,通过存储模块11实时存储运行数据,比如存储于第一主机的内存上,以便数据共享、数据分析等。During the running of the community version Neo4j of this embodiment, the running data is stored in real time through the storage module 11, for example, stored in the memory of the first host, for data sharing, data analysis, and the like.
转移模块12,用于将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。The transferring module 12 is configured to transfer the first running data to the second host by using a specified manner to form second running data.
本实施例通过转移模块12将第一运行数据同步到第二主机上,以便第二主机在第一主机处理业务进程的基础上,接续第一主机继续支撑社区版Neo4j的正常运行,以避免影响用户的正常使用,提高用户的使用体验。本步骤的指定方式包括但不限于FTP(File Transfer Protocol) 、SFTP (Secure File Transfer Protocol,安全文件传送协议)、SCP(Secure Copy)。In this embodiment, the first running data is synchronized to the second host by the transfer module 12, so that the second host continues to support the normal operation of the community version Neo4j on the basis of the first host processing business process to avoid the influence. The normal use of the user improves the user experience. The specified method of this step includes but is not limited to FTP (File Transfer Protocol), SFTP (Secure File Transfer Protocol), SCP (Secure) Copy).
本申请一实施例中的指定方式为FTP,FTP是TCP/IP(Transmission Control Protocol/Internet Protocol的简写,中译名为传输控制协议/因特网互联协议,又名网络通讯协议)网络上两台计算机传送文件的协议,属于网络协议组的应用层。FTP客户机可以给服务器发出命令来下载文件,上载文件,创建或改变服务器上的目录。本实施例的FTP用到两个TCP连接,一个是命令链路,用来在FTP主机端与服务器之间传递命令;另一个是数据链路,用来上传或下载数据。本实施例的FTP是基于TCP协议的,因此防火墙设置中只需要放开指定端口的TCP协议即可,FTP允许明文传输,当然也可根据需要设置为带SSL(Secure Sockets Layer 安全套接层)的加密FTP。本实施例的FTP工作模式包括PORT(主动)方式、PASV(Passive被动)方式。举例地,PORT(主动)方式的连接过程是:主机端向服务器的指定端口发送连接请求,服务器接受连接,建立一条命令链路。当需要传送数据时,主机端在命令链路上用PORT命令告诉服务器:已打开了一个1024+的随机端口,可连接。于是服务器从指定端口向主机端的1024+随机端口发送连接请求,建立一条数据链路来传送数据。再举例地,PASV方式的连接过程是:主机端向服务器的FTP端口发送连接请求,服务器接受连接,建立一条命令链路。当需要传送数据时,服务器在命令链路上用PASV命令告诉主机端:已打开了一个1024+的随机端口,可连接。于是主机端向服务器的指定端口发送连接请求,建立一条数据链路来传送数据。但普通FTP仅使用端口21作为命令传输。由服务器和主机端协商另外一个随机端口来进行数据传送。在PASV模式下,服务器端需要侦听另一个随机端口。假如服务器在路由器或者防火墙后面,端口映射会比较麻烦,因为无法提前知道数据端口编号,无法映射。The specified mode in the embodiment of the present application is FTP, and the FTP is TCP/IP (Transmission). Short for Control Protocol/Internet Protocol, the Chinese translation is called Transmission Control Protocol/Internet Protocol, also known as Network Communication Protocol. The protocol for transferring files between two computers on the network belongs to the application layer of the network protocol group. The FTP client can issue commands to the server to download files, upload files, and create or change directories on the server. The FTP of this embodiment uses two TCP connections, one is a command link for transmitting commands between the FTP host and the server, and the other is a data link for uploading or downloading data. The FTP in this embodiment is based on the TCP protocol. Therefore, only the TCP protocol of the specified port needs to be released in the firewall setting. FTP allows plaintext transmission. Of course, it can also be set to have SSL (Secure). Sockets Layer Secure Sockets Layer) Encrypted FTP. The FTP working mode of this embodiment includes a PORT (active) mode and a PASV (passive passive mode). For example, the PORT (active) connection process is: the host sends a connection request to a designated port of the server, and the server accepts the connection and establishes a command link. When data needs to be transmitted, the host uses the PORT command on the command link to tell the server that a random port of 1024+ has been opened and can be connected. The server then sends a connection request from the designated port to the 1024+ random port on the host side, establishing a data link to transmit data. For example, the connection process of the PASV mode is: the host sends a connection request to the FTP port of the server, and the server accepts the connection and establishes a command link. When data needs to be transmitted, the server uses the PASV command on the command link to tell the host that a 1024+ random port has been opened and can be connected. The host then sends a connection request to the designated port of the server, establishing a data link to transfer the data. However, normal FTP only uses port 21 as a command transmission. The server and the host negotiate another random port for data transfer. In PASV mode, the server side needs to listen to another random port. If the server is behind a router or firewall, port mapping can be cumbersome because the data port number cannot be known in advance and cannot be mapped.
本申请一实施例中指定方式为数据传输使用SSH(Secure Shell),SSH 为建立在应用层和传输层基础上的安全协议。本实施例的SSH 主要有三部分组成:传输层协议SSH-TRANS ,用户认证协议 SSH-USERAUTH ,连接协议 SSH-CONNECT。利用 SSH 协议可以有效防止远程管理过程中的信息泄露问题,提供安全保证。本实施例的SSH中包括SFTP安全文件传输子系统,SFTP可以为传输文件提供一种安全的加密方法,SFTP 与上述FTP有着几乎一样的语法和功能。本实施例的SFTP本身没有单独的守护进程,必须使用SSH守护进程来完成相应的连接操作。SFTP使用加密传输认证信息和传输的数据,非常安全。但是由于使用了加密/解密技术,传输效率比普通的FTP要低得多,只有对网络安全性要求更高时,使用SFTP代替FTP。In the embodiment of the present application, the specified method is SSH (Secure Shell) for data transmission, and SSH is a security protocol based on the application layer and the transport layer. SSH of this embodiment There are three main components: the transport layer protocol SSH-TRANS, the user authentication protocol SSH-USERAUTH, and the connection protocol SSH-CONNECT. The SSH protocol can effectively prevent information leakage during remote management and provide security. The SSH in this embodiment includes an SFTP secure file transfer subsystem, and SFTP can provide a secure encryption method for transmitting files, SFTP. Has almost the same syntax and functionality as FTP above. The SFTP of this embodiment does not have a separate daemon process, and the SSH daemon must be used to complete the corresponding connection operation. SFTP uses encryption to transmit authentication information and transmitted data, which is very secure. However, due to the use of encryption/decryption technology, the transmission efficiency is much lower than that of ordinary FTP. When the network security requirements are higher, SFTP is used instead of FTP.
本实施例优选通过SCP把第一运行数据转移到第二主机上,操作更加简单,更便于实现,提高数据同步共享的效率。本实施例的SCP基于SSH登录,可用来进行远程文件复制的,更加满足将第一运行数据同步到第二主机上,并且整个复制过程是加密的。举例地,要把第一运行数据的当前一个文件同步到远程第二主机上,从本地复制到远程的命令格式为: scp local_file remote_username@remote_ip:remote_folder或者scp local_file remote_username@remote_ip:remote_file或者scp local_file remote_ip:remote_folder 或者 scp local_file remote_ip:remote_file,第1,2个命令格式中指定了用户名,命令执行后需要再输入密码,第1个命令格式仅指定了远程的目录,文件名字不变,第2个命令格式指定了文件名;第3,4个命令格式没有指定用户名,命令执行后需要输入用户名和密码,第3个命令格式仅指定了远程的目录,文件名字不变,第4个命令格式指定了文件名;而从远程复制到本地,只要将从本地复制到远程的命令 的 后两个命令格式中的参数调换顺序即可实现,本实施例的远程和本地包括远程服务器与本地服务器之间的数据同步,也包括远程主机终端与本地主机终端之间的数据同步。本实施例的SCP /SFTP属于开源协议可免费使用,不像FTP存在安全或版权问题,且SCP /SFTP传输软件均免费并开源,方便开发各种扩展插件和应用组件。In this embodiment, the first operation data is transferred to the second host through the SCP, and the operation is simpler, more convenient, and the efficiency of data synchronization sharing is improved. The SCP of this embodiment is based on SSH login and can be used for remote file copying, and is more suitable for synchronizing the first running data to the second host, and the entire copying process is encrypted. For example, to synchronize the current file of the first running data to the remote second host, the format of the command copied from the local to the remote is: scp local_file remote_username@remote_ip:remote_folder or scp local_file remote_username@remote_ip:remote_file or scp local_file Remote_ip:remote_folder or scp local_file remote_ip:remote_file, the user name is specified in the first and second command formats. The password needs to be entered after the command is executed. The first command format only specifies the remote directory, and the file name does not change. The command format specifies the file name; the third and fourth command formats do not specify a user name, the user name and password are required after the command is executed, and the third command format specifies only the remote directory, the file name does not change, and the fourth command The format specifies the file name; from remote copy to local, as long as the command will be copied locally to the remote The parameter switching sequence in the last two command formats can be implemented. The remote and local in this embodiment includes data synchronization between the remote server and the local server, and also includes data synchronization between the remote host terminal and the local host terminal. SCP of this embodiment /SFTP is open source protocol free of charge, unlike FTP security or copyright issues, and SCP / SFTP transmission software is free and open source, easy to develop a variety of extensions and application components.
参照图4,本申请再一实施例的主备切换装置,包括:Referring to FIG. 4, an active/standby switching device according to still another embodiment of the present application includes:
第二判断模块21,用于判断所述第二运行数据与所述第一运行数据的数据交集。The second determining module 21 is configured to determine an intersection of the data of the second running data and the first running data.
本实施例的数据交集通过比较第一运行数据与第二运行数据的节点数获得。本申请其他实施例中,数据交集也可通过数据字节数等其他方式获得。本实施例的社区版Neo4j是一个高性能的NOSQL(Not Only SQL)图形数据库,它将结构化数据存储在网络上,NOSQL图形数据库中,对应着两个概念:节点集和节点。NOSQL图形数据库中的数据展示并不使用节点集,而是独立的节点。本实施例的NOSQL具有如下特征:不需要事先定义数据模式,预定义表结构,数据中的每条记录都可能有不同的属性和格式,当插入数据时,并不需要预先定义模式;相对于将所有数据存储的存储区域网络中的全共享架构,NOSQL将数据划分后存储在各个本地服务器上,因为从本地磁盘读取数据的性能好于通过网络传输读取数据的性能,从而提高了系统的性能;可以在系统运行的时候,动态增加或者删除节点,不需要停机维护,数据可以自动迁移;相对于将数据存放于同一个节点,NOSQL数据库需要将数据进行分区,将记录分散在多个节点上面,并且分区的同时还要做复制,既提高了并行性能,又能保证没有单点失效的问题;和RAID(Redundant Arrays of Independent Disks,磁盘阵列)存储系统不同的是,NOSQL中的复制是基于日志的异步复制,数据尽快地写入节点,减少网络传输引起迟延。NOSQL数据库并没有一个统一的架构,两种NOSQL数据库之间的不同,甚至远远超过两种关系型数据库的不同。但NOSQL各有所长,本实施例的NOSQL图形数据库特别适用于社区版Neo4j,第一主机和第二主机之间同步NOSQL图形数据库的数据,依据复制节点数据进行完成。The data intersection of this embodiment is obtained by comparing the number of nodes of the first operational data with the second operational data. In other embodiments of the present application, the data intersection may also be obtained by other methods such as the number of data bytes. The community version Neo4j of this embodiment is a high performance NOSQL (Not Only SQL) graph database, which stores structured data on the network. In the NOSQL graph database, there are two concepts: node set and node. The data display in the NOSQL graph database does not use a node set, but an independent node. The NOSQL of this embodiment has the following features: no need to define a data pattern in advance, a predefined table structure, each record in the data may have different attributes and formats, and when inserting data, it is not necessary to define a pattern in advance; The all-sharing architecture in the storage area network where all data is stored, NOSQL divides the data and stores it on each local server, because the performance of reading data from the local disk is better than the performance of reading data through the network transmission, thereby improving the system. Performance; can dynamically add or delete nodes while the system is running, no downtime maintenance, data can be automatically migrated; compared to the data stored in the same node, NOSQL database needs to partition the data, spread the records in multiple Above the node, and the partition has to be replicated at the same time, which improves the parallel performance and guarantees that there is no single point of failure; and RAID (Redundant) Arrays of Independent Disks (disk array) storage system is different, the replication in NOSQL is based on asynchronous replication of the log, the data is written to the node as soon as possible, reducing network transmission delay. The NOSQL database does not have a unified architecture. The difference between the two NOSQL databases is far more than the difference between the two relational databases. However, NOSQL has its own advantages. The NOSQL graph database of this embodiment is particularly suitable for the community version Neo4j. The data of the NOSQL graph database is synchronized between the first host and the second host, and is completed according to the data of the copy node.
确定模块22,用于根据所述数据交集确定所述第二主机的运行进程起点。The determining module 22 is configured to determine a starting point of the running process of the second host according to the data intersection.
本实施例中通过确定模块22根据第一运行数据与第二运行数据的数据交集确定第二主机的启动起点标签,即第二主机的运行进程起点。比如,第一运行数据中包括节点A、节点B、节点C、节点D;第二运行数据中包括节点A、节点B、节点C,则进一步判断节点C的数据是否完整,若是,则第二主机则从第一主机在节点C处或节点C之前的任一时刻点对应的业务数据处所进行的业务处理开始,继续支撑社区版Neo4j的运行;若判定节点C的数据不完整,则判断是否可获取节点C的数据终止处的数据信息,若可获取节点C的数据终止处的数据信息,则第二主机从第一主机在上述节点C的数据终止处或节点C的数据终止之前的任一时刻点对应的业务数据处所进行的业务处理开始;若不可获取节点C的数据终止处的数据信息,则第二主机从第一主机在节点C之前的任一时刻点对应的业务数据处所进行的业务处理开始。本申请其他实施例选择从第一主机在节点A处所进行的业务处理开始或从第一主机在节点A处到节点C处之间的任一时刻点对应的业务状态作为起点。第二主机选择的起始节点能够接续第一主机继续支撑社区版Neo4j的正常运行,不影响用户的正常使用即可。数据在第一主机与第二主机之间实现共享中存在时间延迟,第二运行数据中的数据节点为业务已进行过的数据,第二主机选择的节点可以是刚好接续的节点数据为起始点,也可是刚好接续节点之前的节点数据作为起始点。In this embodiment, the determining module 22 determines the starting start label of the second host, that is, the starting point of the running process of the second host, according to the data intersection of the first running data and the second running data. For example, the first running data includes node A, node B, node C, and node D; and the second running data includes node A, node B, and node C, and further determines whether the data of node C is complete, and if so, the second The host starts from the service processing performed by the first host at the node C or at the service data location corresponding to the node C, and continues to support the operation of the community version Neo4j; if it is determined that the data of the node C is incomplete, it is determined whether The data information at the end of the data of the node C can be obtained. If the data information at the end of the data of the node C can be obtained, the second host is terminated from the first host at the end of the data of the node C or before the data of the node C is terminated. The service processing performed at the corresponding service data location at the moment is started; if the data information at the data termination of the node C is not available, the second host performs the corresponding service data from the first host at any point before the node C. The business process begins. Other embodiments of the present application select a service state corresponding to a service state performed at the node A from the first host or from any point in time between the node A and the node C as a starting point. The starting node selected by the second host can continue to support the normal operation of the community version Neo4j, and does not affect the normal use of the user. There is a time delay in the data sharing between the first host and the second host. The data node in the second running data is data that has been processed by the service, and the node selected by the second host may be the node data just connected as the starting point. Or, it is just the node data before the node is connected as the starting point.
参照图5,本申请又一实施例的主备切换装置,包括:Referring to FIG. 5, an active/standby switching device according to still another embodiment of the present application includes:
记录模块23,用于记录所述社区版Neo4j的访问数据和所述访问数据对应的访问频次。The recording module 23 is configured to record the access data of the community version Neo4j and the access frequency corresponding to the access data.
本实施例的社区版Neo4j通过记录模块23缓存记录最近访问的数据。The community version Neo4j of this embodiment caches the most recently accessed data through the recording module 23.
获取模块24,用于获取所述访问数据中,所述访问频次大于预设阈值的高频次访问数据。The obtaining module 24 is configured to obtain, in the access data, the high frequency access data whose access frequency is greater than a preset threshold.
举例地,本实施例的预设阈值比如为访问三次,访问次数大于三次则为高频次访问数据。For example, the preset threshold of the embodiment is, for example, three times of access, and the number of accesses is greater than three times, which is high frequency access data.
形成模块25,用于若访问频次大于预设阈值,则通过汇总所述访问数据与所述访问数据对应的实例场景,形成实例数据库并存储。The forming module 25 is configured to form an instance database and store the instance scenario corresponding to the access data by collecting the instance data corresponding to the access data if the access frequency is greater than the preset threshold.
本实施例的社区版Neo4j是一个图形数据库,数据并非保存在表或集合中,而是保存为节点以及节点之间的关系。在社区版Neo4j中,节点以及关系都能够包含保存值的属性,为节点设置零或多个标签(例如Author或Book),每个关系都对应一种类型(例如WROTE或FRIEND_OF),关系总是从一个节点指向另一个节点(但可以在不考虑指向性的情况下进行查询)。本实施例的社区版Neo4j自带一套易于学习的查询语言(名为Cypher)不使用Schema(数据库对象的集合,一个用户一般对应一个Schema),因此可以满足任何形式的需求。本实施例通过将高频次访问数据根据情景的相关性进行汇总,形成实例场景的数据库并存储,以实现数据库的局部数据逐渐模块化、模型化,以提高社区版Neo4j快速响应数据请求,且防止请求量非常大时而导致随机分布的数据发生缓存缺失,上述实例场景包括根据数据类型形成的场景情景汇总,比如将涉及医药信息、医院信息、病例介绍、医疗器材等的数据汇总为医疗行业的实例场景。本实施例的社区版Neo4j与关系型数据库相比,对于高度关联的数据(图形数据)的查询快速要快上许多。本实施例的社区版Neo4j的实体与关系结构非常自然地切合人类的直观感受,支持兼容ACID(数据库事务正确执行的四个基本要素的缩写,包含:原子性Atomicity、一致性Consistency、隔离性Isolation、持久性Durability)的事务操作,提供了一个高可用性模型,以支持大规模数据量的查询,支持备份、数据局部性以及冗余,提供了一个可视化的查询控制台,避免人员疲倦感。本实施例通过形成模块25汇总所述访问数据与所述访问数据对应的实例场景,形成实例数据库并存储,以提高社区版Neo4j快速响应数据请求,且防止请求量非常大时而导致随机分布的数据发生缓存缺失。The community version Neo4j of this embodiment is a graphics database, and the data is not stored in a table or a collection, but is saved as a node and a relationship between nodes. In the community version of Neo4j, nodes and relationships can contain attributes that hold values, zero or more tags (such as Author or Book) for the node, and each relationship corresponds to a type (such as WROTE or FRIEND_OF), the relationship is always Point from one node to another (but can do so without regard to directivity). The community version of Neo4j of this embodiment comes with a set of easy-to-learn query language (called Cypher) that does not use Schema (a collection of database objects, a user generally corresponds to a Schema), so it can meet any form of requirements. In this embodiment, the high-frequency access data is aggregated according to the relevance of the scenario, and a database of the instance scenario is formed and stored, so that the local data of the database is gradually modularized and modeled, so as to improve the community version of Neo4j rapid response data request, and Preventing the random distribution of data from being cached when the number of requests is very large. The above example scenario includes a summary of scenario scenarios based on data types, such as summarizing data related to medical information, hospital information, case introduction, medical equipment, etc. into the medical industry. Example scenario. Compared with the relational database, the community version Neo4j of this embodiment is much faster to query highly correlated data (graphic data). The entity and relationship structure of the community version Neo4j of this embodiment is very natural to meet the human intuitive feeling, and supports ACID (abbreviation of four basic elements of database transaction correct execution, including: atomic Atomicity, Consistency Consistency, Isolation Isolation) Transaction operation, providing a high-availability model to support large-volume data queries, support for backup, data locality, and redundancy, providing a visual query console to avoid staff fatigue. In this embodiment, an example scenario corresponding to the access data and the access data is summarized by the forming module 25, and an instance database is formed and stored to improve the community version Neo4j fast response data request, and the data is randomly distributed when the request amount is very large. A cache miss has occurred.
参照图6,本申请又一实施例的主备切换装置,还包括:Referring to FIG. 6, the active/standby switching device of another embodiment of the present application further includes:
第三判断模块26,用于判断所述第二主机当前运行的实例场景是否已存储备份。The third determining module 26 is configured to determine whether the instance scenario currently running by the second host has stored a backup.
通过第三判断模块26判断当前运行的实例场景是否已存在相应的备份数据库,提高调用数据的效率。比如,本实施例通过实例场景的分类标签判断两个实例场景的相似度,比如,实例场景标签显示两个实例场景均为医疗领域,则判定相似。若一个场景标签显示为医疗领域,另一个场景标签显示为影视领域,则判定不相似。本实施例的场景标签分类可根据需要,进一步细化分类,以提高根据实例场景标签调用数据的可靠性。本实施例的实例场景分类标签可通过卷积神经网络获取的实例场景的图片组成要素的特征进行分类,并根据图片组成要素的特征相似度判断实例场景的相似度。本实施例优选根据欧式距离判断两个图片组成要素的特征相似度,进而判断两个实例场景的相似度。The third determining module 26 determines whether the corresponding running database exists in the currently running instance scenario, and improves the efficiency of calling data. For example, in this embodiment, the similarity between the two instance scenarios is determined by using the classification label of the example scenario. For example, if the instance scenario label shows that the two instance scenarios are all medical fields, the determination is similar. If one scene label is displayed as a medical field and another scene label is displayed as a movie field, the determination is not similar. The scene label classification in this embodiment may further refine the classification according to requirements to improve the reliability of calling data according to the instance scene label. The example scene classification label of the embodiment may be classified by the feature of the picture component of the instance scene acquired by the convolutional neural network, and the similarity of the instance scene is determined according to the feature similarity of the picture component. In this embodiment, it is preferable to determine the feature similarity of the two picture constituent elements according to the Euclidean distance, and further determine the similarity between the two example scenes.
调用模块27,用于若已存储备份,则调用与当前运行的所述实例场景匹配的访问数据。The calling module 27 is configured to invoke the access data that matches the currently running instance scenario if the backup has been stored.
举例地,当前运行的实例场景为医疗领域,则通过调用模块27调用标签为医疗领域的数据,增加快捷性。For example, if the currently running instance scenario is the medical field, the calling module 27 calls the data in the medical field to increase the speed.
参照图7,本申请又一实施例的主备切换装置,包括:Referring to FIG. 7, an active/standby switching device according to another embodiment of the present application includes:
监测模块28,用于监测所述第一主机的故障报警。The monitoring module 28 is configured to monitor a fault alarm of the first host.
本实施例在衔接第一主机和第二主机的应用模块上,设置了具有监测功能的监测模块28,以监测第一主机的故障报警。比如,第一主机故障后,应用模块接收故障报警信息。比如通过监听心跳包的方式进行监听,未接收到第一主机的心跳监听反馈信息,则判定第一主机故障,本实施例的故障报警包括声音式故障报警,如故障鸣笛等;灯光式故障报警,故障明灯或闪灯;无表现式故障报警,如无心跳信号或无反馈信号等。In this embodiment, on the application module that connects the first host and the second host, a monitoring module 28 with a monitoring function is provided to monitor the fault alarm of the first host. For example, after the first host fails, the application module receives the fault alarm information. For example, by monitoring the heartbeat packet for monitoring, and not receiving the heartbeat monitoring feedback information of the first host, determining that the first host is faulty, the fault alarm of the embodiment includes an audible fault alarm, such as a fault whistle, etc.; Alarm, fault light or flashing light; no performance fault alarm, such as no heartbeat or no feedback signal.
标记模块29,用于标记故障报警时第一运行数据同步到所述第二主机的节点信息。The marking module 29 is configured to synchronize the first running data to the node information of the second host when the fault alarm is marked.
本实施例通过监测模块28监测到第一主机故障时,会同时监测第一主机和第二主机的数据同步状况并通过标记模块29标记,监测社区版Neo4j的数据请求状态,以便切换到第二主机后,更顺畅地接续第一主机继续支撑社区版Neo4j的运行和应用。本实施例通过监测数据同步状态中数据节点的变化信息来监测第一主机和第二主机的数据同步状况。本步骤的节点信息包括但不限于节点属性、与其他节点的关联关系、节点查寻路径等节点信息。In this embodiment, when the monitoring module 28 detects that the first host is faulty, the data synchronization status of the first host and the second host is simultaneously monitored and marked by the marking module 29, and the data request status of the community version Neo4j is monitored to switch to the second. After the host, the first host is smoothly connected to continue to support the operation and application of the community version of Neo4j. In this embodiment, the data synchronization status of the first host and the second host is monitored by monitoring the change information of the data node in the data synchronization state. The node information of this step includes but is not limited to node attributes, associations with other nodes, and node search paths.
传输模块30,用于将所述节点信息传输至所述第二主机,以根据所述节点信息确定所述第二主机的运行进程起点。The transmission module 30 is configured to transmit the node information to the second host, to determine a starting point of the running process of the second host according to the node information.
本实施例通过传输模块30将上述节点信息传输至第二主机,以便第二主机快速识别同步数据的差量,选择更优化的方式,接续第一主机的工作。本实施例的第二主机的运行进程起点的具体确定方法同确定模块22。In this embodiment, the node information is transmitted to the second host through the transmission module 30, so that the second host quickly identifies the difference of the synchronization data, and selects a more optimized manner to connect the work of the first host. The specific determination method of the starting point of the running process of the second host in this embodiment is the same as the determining module 22.
除了上述应用之外,本申请一实施例中,通过提供关于某个实体及其相邻数据关系(比如你可以提供一个Web页面返回其结果),社区版Neo4j也能够处理“大数据”,比如按照作者所处的地点(城市)计算书籍的分类数目,通过使用相同的设计模式,返回一组不同的列。比如,基于社区版Neo4j的一个互式地渲染生成的文档门户网站,基于一个简单的文本文件,其中用文字描述以及图片描述了整个数据模型、架构以及用例查询,支持在线执行并保持可视化。门户网站提供了一个列表,允许用户查看每个列表的详细内容。In addition to the above applications, in an embodiment of the present application, the community version of Neo4j can also handle "big data" by providing information about an entity and its neighboring data relationships (eg, you can provide a web page to return its results), such as The number of categories of books is calculated according to the location (city) where the author is located, and a different set of columns is returned by using the same design pattern. For example, a community-based version of Neo4j's interactive rendering of a document portal is based on a simple text file that describes the entire data model, architecture, and use case queries in textual descriptions and images, supporting online execution and maintaining visualization. The portal provides a list that allows users to view the details of each list.
参照图8,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储主备切换等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令在执行时,执行如上述各方法的实施例的流程。本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。Referring to FIG. 8, a computer device is provided in the embodiment of the present application. The computer device may be a server, and its internal structure may be as shown in FIG. 9. The computer device includes a processor, memory, network interface, and database connected by a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The non-volatile storage medium stores an operating system, computer readable instructions, and a database. The memory provides an environment for the operation of operating systems and computer readable instructions in a non-volatile storage medium. The database of the computer device is used to store data such as active/standby switchover. The network interface of the computer device is used to communicate with an external terminal via a network connection. The computer readable instructions, when executed, perform the flow of an embodiment of the methods described above. It will be understood by those skilled in the art that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the present application is applied.
本申请一实施例还提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,该计算机可读指令在执行时,执行如上述各方法的实施例的流程。以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。An embodiment of the present application also provides a computer non-volatile readable storage medium having stored thereon computer readable instructions that, when executed, perform the processes of the embodiments of the methods described above. The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of the present application.

Claims (20)

  1. 一种主备切换方法,其特征在于,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,包括:An active/standby switching method is characterized in that: the first host and the second host of the community version Neo4j are connected by the routing relay device, the first host is connected to the first port of the routing relay device, and the second host and the routing relay device are connected. Two ports are connected, including:
    判断支撑社区版Neo4j的第一主机是否出现故障;Determine whether the first host supporting the community version Neo4j is faulty;
    若是,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。If yes, the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device.
  2. 根据权利要求1所述的主备切换方法,其特征在于,所述判断支撑社区版Neo4j的第一主机是否出现故障的步骤之前,包括:The master/slave switching method according to claim 1, wherein the step of determining whether the first host supporting the community version Neo4j is faulty comprises:
    存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据;Storing the first running data of the running process of the first host supporting community version Neo4j;
    将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。Transferring the first operational data to the second host in a specified manner to form second operational data.
  3. 根据权利要求2所述的主备切换方法,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The active/standby switching method according to claim 2, wherein after the step of switching the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device, :
    判断所述第二运行数据与所述第一运行数据的数据交集;Determining an intersection of the data of the second running data and the first running data;
    根据所述数据交集确定所述第二主机的运行进程起点。Determining a starting point of the running process of the second host according to the data intersection.
  4. 根据权利要求1所述的主备切换方法,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The active/standby switching method according to claim 1, wherein after the step of switching the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device, :
    记录所述第二主机的访问数据和所述访问数据对应的访问频次;Recording access frequency of the second host and access frequency corresponding to the access data;
    获取所述访问数据中,所述访问频次大于预设阈值的高频次访问数据;Obtaining, in the access data, the high frequency access data whose access frequency is greater than a preset threshold;
    通过汇总所述高频次访问数据与所述高频次访问数据对应的实例场景,形成实例数据库并存储。An instance database is formed and stored by summarizing the instance scenarios corresponding to the high frequency secondary access data and the high frequency secondary access data.
  5. 根据权利要求4所述的主备切换方法,其特征在于,所述通过汇总所述高频次访问数据与所述高频次访问数据对应的实例场景,形成实例数据库并存储的步骤之后,还包括:The master/slave switching method according to claim 4, wherein the step of summing the high frequency secondary access data and the high frequency secondary access data to form an instance database and storing the steps include:
    判断所述第二主机当前运行的实例场景是否已存储备份;Determining whether the instance scenario currently running by the second host has stored a backup;
    若是,则调用与当前运行的所述实例场景匹配的访问数据。If so, the access data that matches the currently running instance scenario is invoked.
  6. 根据权利要求2所述的主备切换方法,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The active/standby switching method according to claim 2, wherein after the step of switching the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device, :
    监测所述第一主机的故障报警;Monitoring a fault alarm of the first host;
    标记故障报警时第一运行数据同步到所述第二主机的节点信息;The first running data is synchronized to the node information of the second host when the fault alarm is marked;
    将所述节点信息传输至所述第二主机,以根据所述节点信息确定所述第二主机的运行进程起点。Transmitting the node information to the second host to determine a starting point of the running process of the second host according to the node information.
  7. 一种主备切换装置,其特征在于,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,装置包括:An active/standby switching device is characterized in that: the first host and the second host of the community version Neo4j are connected by the routing relay device, the first host is connected to the first port of the routing device, and the second host and the routing device are connected. The two ports are connected, and the device includes:
    第一判断模块,用于判断支撑社区版Neo4j的第一主机是否出现故障;a first determining module, configured to determine whether a first host supporting the community version Neo4j is faulty;
    切换模块,用于若第一主机出现故障,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。The switching module is configured to switch, when the first host fails, the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device.
  8. 根据权利要求7所述的主备切换装置,其特征在于,包括:The master/slave switching device according to claim 7, comprising:
    存储模块,用于存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据;a storage module, configured to store first running data of the first host supporting community version Neo4j running process;
    转移模块,用于将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。And a transfer module, configured to transfer the first running data to the second host by using a specified manner to form second running data.
  9. 根据权利要求8所述的主备切换装置,其特征在于,包括:The master/slave switching device according to claim 8, comprising:
    第二判断模块,用于判断所述第二运行数据与所述第一运行数据的数据交集;a second determining module, configured to determine an intersection of the data of the second running data and the first running data;
    确定模块,用于根据所述数据交集确定所述第二主机的运行进程起点。And a determining module, configured to determine a starting point of the running process of the second host according to the data intersection.
  10. 根据权利要求7所述的主备切换装置,其特征在于,包括:The master/slave switching device according to claim 7, comprising:
    记录模块,用于记录所述第二主机的访问数据和所述访问数据对应的访问频次;a recording module, configured to record access data of the second host and an access frequency corresponding to the access data;
    获取模块,用于获取所述访问数据中,所述访问频次大于预设阈值的高频次访问数据;An obtaining module, configured to acquire, in the access data, the high frequency access data whose access frequency is greater than a preset threshold;
    形成模块,用于若访问频次大于预设阈值,则通过汇总所述高频次访问数据与所述高频次访问数据对应的实例场景,形成实例数据库并存储。The forming module is configured to form an instance database and store the instance scenario corresponding to the high frequency secondary access data by summarizing the instance scenarios corresponding to the high frequency secondary access data if the access frequency is greater than a preset threshold.
  11. 根据权利要求10所述的主备切换装置,其特征在于,还包括:The master/slave switching device according to claim 10, further comprising:
    第三判断模块,用于判断所述第二主机当前运行的实例场景是否已存储备份;a third determining module, configured to determine whether an instance scenario currently running by the second host has stored a backup;
    调用模块,用于若已存储备份,则调用与当前运行的所述实例场景匹配的访问数据。The calling module is configured to call the access data that matches the currently running instance scenario if the backup has been stored.
  12. 根据权利要求8所述的主备切换装置,其特征在于,包括:The master/slave switching device according to claim 8, comprising:
    监测模块,用于监测所述第一主机的故障报警;a monitoring module, configured to monitor a fault alarm of the first host;
    标记模块,用于标记故障报警时第一运行数据同步到所述第二主机的节点信息;a marking module, configured to: when the fault alarm is marked, the first running data is synchronized to the node information of the second host;
    传输模块,用于将所述节点信息传输至所述第二主机,以根据所述节点信息确定所述第二主机的运行进程起点。And a transmission module, configured to transmit the node information to the second host, to determine a starting point of the running process of the second host according to the node information.
  13. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现主备切换方法,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,方法包括:A computer device, comprising a memory and a processor, wherein the memory stores computer readable instructions, wherein the processor implements an active/standby switching method when the computer readable instructions are executed, and connects to a community version through a routing relay device The first host and the second host of the Neo4j, the first host is connected to the first port of the routing device, and the second host is connected to the second port of the routing device, and the method includes:
    判断支撑社区版Neo4j的第一主机是否出现故障;Determine whether the first host supporting the community version Neo4j is faulty;
    若是,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。If yes, the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device.
  14. 根据权利要求13所述的计算机设备,其特征在于,所述判断支撑社区版Neo4j的第一主机是否出现故障的步骤之前,包括:The computer device according to claim 13, wherein the step of determining whether the first host supporting the community version Neo4j is faulty comprises:
    存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据;Storing the first running data of the running process of the first host supporting community version Neo4j;
    将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。Transferring the first operational data to the second host in a specified manner to form second operational data.
  15. 根据权利要求14所述的计算机设备,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The computer device according to claim 14, wherein the step of switching the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device comprises:
    判断所述第二运行数据与所述第一运行数据的数据交集;Determining an intersection of the data of the second running data and the first running data;
    根据所述数据交集确定所述第二主机的运行进程起点。Determining a starting point of the running process of the second host according to the data intersection.
  16. 根据权利要求1所述的计算机设备,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The computer device according to claim 1, wherein the step of switching the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device comprises:
    记录所述第二主机的访问数据和所述访问数据对应的访问频次;Recording access frequency of the second host and access frequency corresponding to the access data;
    获取所述访问数据中,所述访问频次大于预设阈值的高频次访问数据;Obtaining, in the access data, the high frequency access data whose access frequency is greater than a preset threshold;
    通过汇总所述高频次访问数据与所述高频次访问数据对应的实例场景,形成实例数据库并存储。An instance database is formed and stored by summarizing the instance scenarios corresponding to the high frequency secondary access data and the high frequency secondary access data.
  17. 一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现主备切换方法,通过路由中转设备衔接社区版Neo4j的第一主机和第二主机,第一主机与路由中转设备的第一端口相连,第二主机与路由中转设备的第二端口相连,方法包括:A computer non-readable readable storage medium having stored thereon computer readable instructions, wherein the computer readable instructions are implemented by a processor to implement an active/standby switching method, and the community relay device is connected to the community version Neo4j The first host and the second host are connected to the first port of the routing device, and the second host is connected to the second port of the routing device. The method includes:
    判断支撑社区版Neo4j的第一主机是否出现故障;Determine whether the first host supporting the community version Neo4j is faulty;
    若是,则将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机。If yes, the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device.
  18. 根据权利要求17所述的计算机非易失性可读存储介质,其特征在于,所述判断支撑社区版Neo4j的第一主机是否出现故障的步骤之前,包括:The computer non-volatile readable storage medium according to claim 17, wherein the step of determining whether the first host supporting the community version Neo4j is faulty comprises:
    存储所述第一主机支撑社区版Neo4j运行过程的第一运行数据;Storing the first running data of the running process of the first host supporting community version Neo4j;
    将所述第一运行数据通过指定方式转移到所述第二主机上,形成第二运行数据。Transferring the first operational data to the second host in a specified manner to form second operational data.
  19. 根据权利要求18所述的计算机非易失性可读存储介质,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The computer non-volatile readable storage medium according to claim 18, wherein said switching the first host connected to the first port of the routing relay device to the second host connected to the second port of the routing relay device After the steps, including:
    判断所述第二运行数据与所述第一运行数据的数据交集;Determining an intersection of the data of the second running data and the first running data;
    根据所述数据交集确定所述第二主机的运行进程起点。Determining a starting point of the running process of the second host according to the data intersection.
  20. 根据权利要求17所述的计算机非易失性可读存储介质,其特征在于,所述将与路由中转设备第一端口相连的第一主机切换为与路由中转设备第二端口相连的第二主机的步骤之后,包括:The computer non-volatile readable storage medium according to claim 17, wherein the first host connected to the first port of the routing relay device is switched to the second host connected to the second port of the routing relay device After the steps, including:
    记录所述第二主机的访问数据和所述访问数据对应的访问频次;Recording access frequency of the second host and access frequency corresponding to the access data;
    获取所述访问数据中,所述访问频次大于预设阈值的高频次访问数据;Obtaining, in the access data, the high frequency access data whose access frequency is greater than a preset threshold;
    通过汇总所述高频次访问数据与所述高频次访问数据对应的实例场景,形成实例数据库并存储。An instance database is formed and stored by summarizing the instance scenarios corresponding to the high frequency secondary access data and the high frequency secondary access data.
PCT/CN2018/095501 2018-04-20 2018-07-12 Host and backup computer switching method, apparatus, computing device and storage medium WO2019200751A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810361428.7A CN108762992B (en) 2018-04-20 2018-04-20 Main/standby switching method and device, computer equipment and storage medium
CN201810361428.7 2018-04-20

Publications (1)

Publication Number Publication Date
WO2019200751A1 true WO2019200751A1 (en) 2019-10-24

Family

ID=64011157

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/095501 WO2019200751A1 (en) 2018-04-20 2018-07-12 Host and backup computer switching method, apparatus, computing device and storage medium

Country Status (2)

Country Link
CN (1) CN108762992B (en)
WO (1) WO2019200751A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111628880A (en) * 2019-02-27 2020-09-04 深圳迈瑞生物医疗电子股份有限公司 Method for transferring failure of in-hospital equipment and monitoring system
CN111352995A (en) * 2020-02-25 2020-06-30 中信银行股份有限公司 Server service method, system, device and storage medium based on database Neo4j
CN111382284A (en) * 2020-03-09 2020-07-07 中国建设银行股份有限公司 Neo4j graphic database system, Neo4j graphic database system access method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252500A (en) * 2013-06-29 2014-12-31 北京新媒传信科技有限公司 Method and device for carrying out fault repairing on database management platform
CN105760260A (en) * 2016-02-19 2016-07-13 浙江大华系统工程有限公司 Backup system and backup method
US20170372043A1 (en) * 2016-06-24 2017-12-28 Scripps Networks Interactive, Inc. Satellite and central asset registry systems and methods and rights management systems
US20170374392A1 (en) * 2016-06-24 2017-12-28 Scripps Networks Interactive, Inc. Central asset registry system and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100437504C (en) * 2006-04-06 2008-11-26 英业达股份有限公司 Hard disc data backup system and method
CN100543684C (en) * 2007-09-18 2009-09-23 中兴通讯股份有限公司 A kind of apparatus and method that realize transparent course migration
CN105447029B (en) * 2014-08-27 2019-06-21 阿里巴巴集团控股有限公司 Method for processing business and equipment when a kind of database failure
US9846624B2 (en) * 2014-09-26 2017-12-19 Microsoft Technology Licensing, Llc Fast single-master failover

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252500A (en) * 2013-06-29 2014-12-31 北京新媒传信科技有限公司 Method and device for carrying out fault repairing on database management platform
CN105760260A (en) * 2016-02-19 2016-07-13 浙江大华系统工程有限公司 Backup system and backup method
US20170372043A1 (en) * 2016-06-24 2017-12-28 Scripps Networks Interactive, Inc. Satellite and central asset registry systems and methods and rights management systems
US20170374392A1 (en) * 2016-06-24 2017-12-28 Scripps Networks Interactive, Inc. Central asset registry system and method

Also Published As

Publication number Publication date
CN108762992A (en) 2018-11-06
CN108762992B (en) 2021-10-08

Similar Documents

Publication Publication Date Title
US11262931B2 (en) Synchronous replication
US7783763B2 (en) Managing stateful data in a partitioned application server environment
KR101923245B1 (en) Transparent failover
US7653682B2 (en) Client failure fencing mechanism for fencing network file system data in a host-cluster environment
US20170192986A1 (en) Content class for object storage indexing system
CN105144105B (en) System and method for the expansible consistent snapshot operation of collapse
CN103890729B (en) computerized method, storage server and management server
US8938604B2 (en) Data backup using distributed hash tables
US9342417B2 (en) Live NV replay for enabling high performance and efficient takeover in multi-node storage cluster
US20110276578A1 (en) Obtaining file system view in block-level data storage systems
US7966517B2 (en) Method and apparatus for virtual network attached storage remote migration
KR100450400B1 (en) A High Avaliability Structure of MMDBMS for Diskless Environment and data synchronization control method thereof
US10572466B2 (en) Multiple collections of user-defined metadata for self-describing objects
JP2005267327A (en) Storage system
US20220382484A1 (en) Gransets for managing consistency groups of dispersed storage items
US8756338B1 (en) Storage server with embedded communication agent
US10708379B1 (en) Dynamic proxy for databases
WO2019200751A1 (en) Host and backup computer switching method, apparatus, computing device and storage medium
US11343308B2 (en) Reduction of adjacent rack traffic in multi-rack distributed object storage systems
CN113849136B (en) Automatic FC block storage processing method and system based on domestic platform
US20080065847A1 (en) Apparatus for facilitating disaster recovery
US10409504B2 (en) Soft-switch in storage system
US7146484B2 (en) Method and apparatus for caching storage system
US8850132B1 (en) Method and system for providing a shared data resource coordinator within a storage virtualizing data processing system
US11169728B2 (en) Replication configuration for multiple heterogeneous data stores

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: 18915438

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: 18915438

Country of ref document: EP

Kind code of ref document: A1