A novel method and system for digitizing and structuring campus information.
By using a three-node construction method, selecting slave nodes at different distances and monitoring the status of the master node, the problem of data recovery difficulties caused by slave node downtime is solved, and the stability and efficiency of campus information digitization and structuring are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2026-04-03
AI Technical Summary
In existing methods for digitizing and structuring campus information, slave nodes are prone to crashing simultaneously with master nodes due to their proximity, leading to difficulties in node recovery and impacting data access efficiency and stability.
A three-node construction method is adopted, and a distance recognition algorithm is set to select the first slave node and the second slave node. The first slave node is close to the master node, and the second slave node is far away from the master node. The status of the master node and the first slave node is monitored through a heartbeat connection, and the new master node is automatically switched to ensure the stability and efficiency of data processing.
It improves the efficiency of data storage and interaction, solves the problem of poor node data recovery stability caused by near-field node downtime, and ensures the stability and efficiency of information data processing.
Smart Images

Figure CN120238420B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of campus information digitization technology, and in particular to a novel digitized and structured method and system for campus information. Background Technology
[0002] Current methods for digitizing and structuring campus information primarily rely on dual-node data storage and interaction. For example, in diverse and heterogeneous data nodes across different campuses, master-slave replication is commonly used for data security and fault tolerance, such as with Redis nodes. Generally, signal strength and available bandwidth are affected by communication distance, regardless of whether it's wired or wireless transmission. Therefore, in Redis's master-slave replication mechanism, to improve replication efficiency, network storage efficiency, and reduce fault recovery latency, existing digitizing and structuring methods for campus information typically select slave nodes that are physically closer to the master node. However, in practical applications, due to limitations of campus equipment or environmental factors, slave nodes are prone to simultaneous downtime due to their proximity to the master node, making node recovery more difficult. Similarly, this applies to other master-slave control-related campus database nodes such as Kubernetes. Therefore, how to balance data access permissions and integrity with campus data access efficiency is a crucial technical challenge that needs to be addressed in existing digitizing and structuring technologies for campus information. Summary of the Invention
[0003] One objective of this invention is to provide a novel method and system for digitizing and structuring campus information. This method and system constructs a three-node data interaction, analysis, and storage approach based on a campus database with one master and two slave nodes. During the construction of these three nodes, a distance identification algorithm is implemented to identify the distance characteristics of each slave node relative to the master node. Based on these distance characteristics, the master node and slave nodes are constructed and tasks are assigned. In this invention, after the master node is constructed, the first slave node is selected based on the identified distance to the slave nodes, prioritizing closer nodes for primary tasks. A second slave node, located further away, is selected as an auxiliary slave node for remote communication. Different tasks between the master node and slave nodes at different distances effectively address the efficiency issues of dual-node data storage and interaction, while simultaneously resolving the problem of poor stability in node data and function recovery caused by simultaneous failures of nearby nodes.
[0004] Another objective of this invention is to provide a novel method and system for digitizing and structuring campus information. In this method and system, a second slave node, acting as a backup auxiliary node, simultaneously establishes a heartbeat connection with both the selected master node and the first slave node to determine whether the master node and the first slave node performing the main task have crashed. If they crash, the second slave node automatically becomes the new master node and generates two new slave nodes according to a node construction strategy related to node distance characteristics, thereby ensuring the stability and efficiency of information digitization processing.
[0005] Another objective of this invention is to provide a novel method and system for digitizing and structuring campus information. This method and system calculates the distance between different nodes using a first common ancestor (CCA) tracing method. In the network topology of the nodes, the CCA tracing process can trace upwards from the node itself to different nodes on the same rack, different nodes on different racks of the same node cluster, nodes in different clusters of the same data center, nodes in different data centers, etc. In this invention, the distance values from the master node and different slave nodes to the first common ancestor are calculated using the hop count method, and the first and second slave nodes are configured according to the calculated distance values, thereby improving the fault tolerance of the structured data.
[0006] To achieve at least one of the above-mentioned objectives, the present invention provides a novel method for digitizing and structuring campus information, the method comprising:
[0007] A master node is pre-constructed, and the distance between the corresponding idle node and the master node is calculated by tracing the level values of other idle nodes and the master node back to the first common ancestor according to the hop count method.
[0008] A slave node selection strategy is constructed, which selects a first slave node and a second slave node based on the distance value between the corresponding idle node and the master node; a first distance threshold is preset, and the idle node whose distance value from the master node is less than the first distance threshold is selected as the first slave node; a second distance threshold is preset, and the idle node whose distance value from the master node is greater than the second distance threshold is selected as the second slave node.
[0009] The master node establishes communication connections and synchronizes data with the first slave node and the second slave node respectively. The master node and the first slave node execute the main task, and the second slave node obtains the heartbeat data of the master node and the first slave node respectively.
[0010] The second slave node determines whether it has crashed simultaneously based on the heartbeat data of the master node and the first slave node. If it is determined that they have crashed simultaneously, the second slave node automatically becomes a new second master node, and automatically constructs a new slave node after calculating the distance between the idle node and the second master node.
[0011] According to a preferred embodiment of the present invention, the slave node selection strategy includes: tracing the master node and idle node upwards according to the network node topology, calculating the maximum level value that the master node and idle node experience in the upward tracing process to reach the first common ancestor, calculating the distance value between the master node and the corresponding idle node according to the maximum level value, and selecting the first slave node and the second slave node according to the distance value.
[0012] According to another preferred embodiment of the present invention, the slave node selection strategy includes: defining the hop count of the master node and the idle node as n, and the maximum number of levels that the master node and the idle node traverse to reach their first common ancestor after tracing back are x and y, respectively, then the distance L between the master node and the idle node is L = (n x +n y -2) / 2, where n is a value greater than 1, and the preset first distance threshold L. s1 Second distance threshold L s2 The second distance threshold L s2 Greater than the first distance threshold L s1 When the distance L between the master node and the idle node is less than the first distance threshold L s1 If the idle node is selected as a candidate node for the first slave node, then the distance L between the master node and the idle node is greater than the second distance threshold L. s2 If so, the idle node will be used as a candidate node for the second slave node.
[0013] According to another preferred embodiment of the present invention, the method for selecting the first slave node and the second slave node includes: the hop value n represents the total number of nodes traversed from the master node to the idle node according to the network topology, wherein the hop value includes the master node and the corresponding idle node, and when the distance L between the master node and the idle node is less than the first distance threshold L... s1 When the distance L between the master node and the idle node is greater than the second distance threshold L, the idle node with the smallest hop count n from the master node to the idle node is selected as the first slave node; when the distance L between the master node and the idle node is greater than the second distance threshold L, the idle node is selected as the first slave node. s2 When the time comes, the idle node with the smallest hop count n among all nodes traversed from the master node to the idle node is selected as the second slave node.
[0014] According to another preferred embodiment of the present invention, the method for selecting the first slave node and the second slave node further includes: obtaining communication delay data of all network nodes from the master node to the idle node according to the network node topology; constructing an adjustment coefficient λ of the hop value n according to the communication delay data; calculating an updated hop value m = n * λ according to the adjustment coefficient λ of the hop value n; and calculating the distance L1 = (m * λ) between the master node and the idle node using the updated hop value m = n * λ. x +m y -2) / 2, and based on the distance L1 between the node and the idle node and the first distance threshold L s1 Second distance threshold L s2 Filter the candidate nodes for the first slave node and the candidate nodes for the second slave node.
[0015] According to another preferred embodiment of the present invention, after the master node establishes communication connections with the first slave node and the second slave node respectively, it obtains the node identifiers of the first slave node and the second slave node respectively. The master node packages its own master node identifier, the first slave node identifier, and the second slave node identifier into data and encrypts them with an encryption algorithm before sending them to the first slave node and the second slave node respectively. After obtaining the node identifiers of the master node and the first slave node, the second slave node monitors the heartbeat data from the master node and the first slave node. When the time interval of the heartbeat data of the master node or the first slave node is greater than a preset heartbeat interval threshold, it is determined that the corresponding master node or the first slave node has crashed. The normal master node or the first slave node reconstructs the master node or the first slave node according to the distance to the idle node and the selection strategy of the first slave node.
[0016] According to another preferred embodiment of the present invention, the master node synchronizes data to the first slave node and the second slave node; when the time interval between the heartbeat data obtained by the second slave node from the master node and the first slave node is greater than a preset heartbeat interval threshold, the second slave node automatically transforms into a new second master node, and a new first slave node and a new second slave node are regenerated according to the distance between the idle node and the second master node and the slave node selection strategy.
[0017] According to another preferred embodiment of the present invention, the definition of the maximum number of levels includes: based on the network node topology, the level value of the current master node and idle node is incremented by 1 for each of the upstream routers, upstream servers, or upstream switches encountered during the tracing process of the master node and idle node upwards, until the current master node and idle node trace back to the first common ancestor. The cumulative level value of the corresponding master node and idle node above the common ancestor is calculated as the maximum number of levels encountered by the corresponding master node and idle node.
[0018] To achieve at least one of the above-mentioned objectives, the present invention provides a novel campus information digitization and structuring system, wherein the system executes the aforementioned novel campus information digitization and structuring method.
[0019] The present invention further provides a computer-readable storage medium storing a computer program, which is executed by a processor to implement the above-described novel method for digitizing and structuring campus information. Attached Figure Description
[0020] Figure 1 The diagram shown is a flowchart of a novel method for digitizing and structuring campus information according to the present invention.
[0021] Figure 2 The diagram shown is a schematic representation of the three-node interaction structure in this invention.
[0022] Figure 3 This diagram illustrates the distance structure between the master node and different slave nodes in this invention. Detailed Implementation
[0023] The following description is intended to disclose the present invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art. The basic principles of the invention defined in the following description can be applied to other embodiments, modifications, improvements, equivalents, and other technical solutions that do not depart from the spirit and scope of the invention.
[0024] It is understood that the term "a" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple, and the term "a" should not be understood as a limitation on the number.
[0025] Please combine Figures 1-3This invention discloses a novel method and system for digitizing and structuring campus information. The method mainly includes the following steps: First, a master node needs to be built in a node cluster, wherein the node cluster can be, but is not limited to, a Redis cluster and a Kubernetes cluster, wherein the Redis cluster and the Kubernetes cluster can be configured as multiple clusters, and the multiple clusters constitute an information data center. After the master node is built, a slave node selection strategy is further configured in the master node, and a first slave node and a second slave node are selected from idle nodes according to the slave node selection strategy; wherein the master node establishes a communication connection with the first slave node and the second slave node, and the master node and the first slave node are assigned a master task, and the second slave node receives heartbeat data from the master node and the first slave node respectively, for monitoring the status of the master node and the first slave node. The slave node selection strategy described in this invention includes configuring the distances between the first and second slave nodes and the master node. This ensures that the first slave node selected according to the strategy better meets the high efficiency requirements of the master node's main task processing and fault recovery, while the second slave node selected according to the strategy also meets the requirement of rapid fault recovery in the event of a complete failure of both the master node and the first slave node. Therefore, the data processing and structured configuration of the three nodes in this invention enable the data cluster to maintain both system stability and task processing efficiency.
[0026] Specifically, the master node in this invention is defined as P0. In one preferred embodiment, when a node in the selected node cluster is designated as the master node P0, a slave node selection strategy is injected into the master node P0. For example, in a Redis cluster system, a sentinel node can inject the slave node selection strategy into the corresponding master node P0. In a Kubernetes cluster system, the slave node selection strategy can be injected into each worker node, and after determining the distance of the worker node relative to the master node according to the node selection strategy, the worker node is added to the master node as a slave node using the kubeadm join command. The master node and worker node selection configurations in the Kubernetes cluster are configured through Kubernetes components, which will not be described in detail here. It should be noted that the above master node and slave node selection configurations are only illustrative examples. Those skilled in the art can configure them independently according to the actual node type and node configuration tools. How to use node configuration tools for master-slave node configuration is existing public technology, which will not be described in detail here.
[0027] Furthermore, after selecting and registering the master node P0, it is necessary to calculate the distance value L between the remaining idle nodes and the selected master node P0, and then filter out the first slave node for the main task and the second slave node for temporary monitoring based on the distance value L. The calculation method of the distance value L includes the following steps: First, it is necessary to obtain the network node connection topology, which includes the connection hierarchy and connection method between different nodes. The network node topology includes the connection hierarchy of nodes, including the node itself, the rack layer above the node, the cluster layer above the rack, the data center layer above the cluster, etc. It should be noted that different layers can establish hierarchical connections between network nodes through devices including but not limited to upper-level servers, upper-level routers, and upper-level switches. Based on the network node connection topology, the master node and idle node are traced upwards. The maximum level value traversed by the master node and idle node during the upward tracing process to reach the first common ancestor is calculated. The distance value L between the master node and the corresponding idle node is then calculated based on the maximum level value. The first slave node and the second slave node are selected based on this distance value. The purpose of tracing the master node P0 and idle node upwards to their common ancestor is to query the topological distance between the master node and idle node in the network node connection. Generally, the larger the level traversed by the common ancestor traversed by the master node and idle node, the greater the distance between the master node and idle node in the network node connection topology. In this case, the probability of mutual influence between the two nodes in the event of a node cluster failure is lower. However, the greater the distance between the master node and idle node in the network node connection topology, the lower the communication efficiency between them, resulting in increased latency in main task processing and node failure recovery. Therefore, the distance relationship between the master node and slave node needs to be considered comprehensively. Conversely, the closer the master node and idle node are in the network node connection topology, the opposite is true.
[0028] The common ancestor hierarchy is defined as follows: When the master node and the idle node are the same node, the current common ancestor tracing level is 1. When the master node and the idle node trace upwards to the same rack, the first common ancestor tracing level for the master node and the idle node is 2. When the master node and the idle node trace upwards to the same cluster, and the master node and the idle node experience different rack levels before finally reaching the cluster level of the first common ancestor, the level at which the master node and the idle node trace to the first common ancestor is 3. Similarly, tracing to the data center level is 4. It should be noted that the above hierarchical division of the master node and idle node tracing process is only illustrative. Those skilled in the art can divide more levels according to the topological relationship of network nodes. Furthermore, the slave node and the master node can be a node in the upper-level server, so the tracing level values of the slave node and the master node are not necessarily the same. This invention will not elaborate on this further. In this invention, the calculation of the tracing level of the first common ancestor can effectively obtain the topological distance between the master node and the idle node, which can provide a reference for the subsequent selection of the first slave node and the second slave node.
[0029] This invention selects the first and second slave nodes based on the node selection strategy using the following method: The maximum number of levels reached by the master node and the idle node after tracing back to their first common ancestor are defined as x and y, respectively. The hop count from the master node to the slave node is defined as n, where the hop count can represent the total number of nodes from the master node to the corresponding slave node. Then, the distance L between the master node and the idle node is L = (n * ... x +n y -2) / 2, where n is a value greater than 1. Without adding network latency parameters, the hop value n is generally an integer greater than or equal to 2.
[0030] Furthermore, a first distance threshold L is preset. s1 Second distance threshold L s2 The second distance threshold L s2 Greater than the first distance threshold L s1 At this time, the first distance threshold L s1 To select the upper limit threshold for the first slave node, the second distance threshold L s2 To select the lower threshold for the second slave node, when the distance L between the master node and the idle node is less than the first distance threshold L... s1 The idle node is then considered as a candidate node for the first slave node P1, when the distance L between the master node and the idle node is greater than the second distance threshold L. s2 If the idle node is selected, it will be used as a candidate node for the second slave node P2. It should be noted that the first distance threshold L mentioned above...s1 Second distance threshold L s2 The number of candidate slave nodes P1 and P2 obtained from the screening is still quite large. Therefore, considering the communication performance and stability of slave nodes, it is necessary to further screen them according to the hop count n from the master node to the slave node.
[0031] When filtering from candidate nodes for the first slave node P1, since the first slave node P1 is the core node used for main task processing, the design of the master node P0 (low latency, high bandwidth) needs to be considered. Therefore, the first slave node P1 needs to select the node with the smallest hop value n compared to the master node from the candidate nodes for the first slave node P1 as the final selected first slave node P1. For the second slave node P2, since the second distance threshold L... s2 The lower threshold has already filtered out the second slave node P2, which is relatively far away and generally located in a different rack or cluster from the master node P0. In this invention, among the candidate nodes for the second slave node P2, the one with the smallest hop value n from the master node P0 to the candidate slave node is selected as the second slave node P2. At this time, since the second slave node P2 has the smallest hop value n from the master node P0 among the candidate nodes, the selected second slave node P2 still has good network communication performance.
[0032] It is worth mentioning that after selecting the first slave node P1 and the second slave node P2 from the corresponding candidate nodes, the first slave node P1 and the second slave node P2 respectively establish communication connections with the master node P0, and the second slave node P2 receives heartbeat data from the master node and the first slave node P1 respectively. In one preferred embodiment of the present invention, the master node data needs to be encrypted and synchronized to the first slave node P1 and the second slave node P2 respectively. The encryption algorithm can be, but is not limited to, hash encryption algorithms and elliptic cryptography algorithms, etc., which will not be described in detail in the present invention.
[0033] In this invention, after determining the first slave node P1 and the second slave node P2, the master node can obtain the node identifiers of the first slave node P1 and the second slave node P2 respectively. The master node P0 packages its own master node P0 identifier, the first slave node P1 identifier, and the second slave node P2 identifier into data, encrypts it using an encryption algorithm, and sends it to the first slave node P1 and the second slave node P2 respectively. After obtaining the node identifiers of the master node and the first slave node P1, the second slave node P2 monitors the heartbeat data from the master node P0 and the first slave node P1. When the time interval between the heartbeat data of the master node P0 or the first slave node P1 is greater than a preset heartbeat interval threshold, it is determined that the corresponding master node P0 or the first slave node P1 has crashed. The normal master node P0 or the first slave node P1 is reconstructed according to the distance to the idle node and the selection strategy of the first slave node P1. It should be noted that in the construction process of the newly constructed master node or the first slave node in this invention, it is still necessary to follow the above-mentioned distance L being less than the first distance threshold L. s1 Furthermore, the hop count n is minimized to obtain the result. Similarly, the master node can also receive heartbeat data from the second slave node. When the second slave node fails, the master node can determine the cause of failure based on the aforementioned distance L being greater than the second distance threshold L. s2 Furthermore, the newly constructed second slave node is obtained by minimizing the jump value n.
[0034] In another preferred embodiment of the present invention, when the time interval between the heartbeat data obtained by the second slave node from both the master node and the first slave node is greater than a preset heartbeat interval threshold, the second slave node automatically transforms into a new second master node, and a new first slave node and a new second slave node are regenerated based on the distance between the idle node and the second master node and the slave node selection strategy. At this time, the distance L between the new second master node and the corresponding new first slave node and new second slave node still satisfies the first distance threshold L. s1 Second distance threshold L s2 And the selection criteria that minimize the jump value n.
[0035] It is worth mentioning that the hop value n designed in this invention is from the perspective of network latency. Generally speaking, the larger the hop value n is, the higher the corresponding network latency. However, in complex network topologies, the above hop value n can only represent a trend and cannot fully represent the actual network latency state. Therefore, this invention further proposes the following correction algorithm: Based on the network node topology, obtain the communication latency data of all network nodes from the master node to the idle node; construct the adjustment coefficient λ of the hop value n based on the communication latency data; calculate the updated hop value m = n * λ based on the adjustment coefficient λ of the hop value n; and calculate the distance L1 = (m * λ) between the master node and the idle node using the updated hop value m = n * λ.x +m y -2) / 2, and based on the distance L1 between the node and the idle node and the first distance threshold L s1 Second distance threshold L s2 The candidate nodes for the first slave node and the candidate nodes for the second slave node are selected. The adjustment coefficients can be obtained, but are not limited to, calculating the average network latency data of all network nodes traversed from the master node to the slave node.
[0036] The processes described above with reference to the flowcharts in the embodiments disclosed in this invention can be implemented as computer software programs. The embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs the functions defined in the methods of this application. It should be noted that the computer-readable medium described above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wire segments, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless segments, wire segments, optical fibers, RF, etc., or any suitable combination thereof.
[0037] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0038] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are merely examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functions and structural principles of the present invention have been shown and explained in the embodiments. Without departing from the stated principles, the implementation of the present invention may have any variations or modifications.
Claims
1. A novel method for digitizing and structuring campus information, characterized in that, The method includes: Pre-construct a master node, and calculate the maximum number of levels that other idle nodes and the master node can trace back to their first common ancestor using the hop count method; then calculate the distance between the corresponding idle node and the master node. The maximum number of levels is as follows: during the process of tracing upwards from the master node and idle node according to the network node topology, the level value of the current master node or idle node is incremented by 1 for each upstream router, upstream server or upstream switch that the current master node or idle node traverses to the first common ancestor, and the cumulative level value of the corresponding master node and idle node above the common ancestor is calculated as the maximum number of levels experienced by the corresponding master node and idle node respectively; A slave node selection strategy is constructed, which selects a first slave node and a second slave node based on the distance value between the corresponding idle node and the master node; a first distance threshold is preset, and the idle node whose distance value from the master node is less than the first distance threshold is selected as the first slave node; a second distance threshold is preset, and the idle node whose distance value from the master node is greater than the second distance threshold is selected as the second slave node. The master node establishes communication connections and synchronizes data with the first slave node and the second slave node respectively. The master node and the first slave node execute the main task, and the second slave node obtains the heartbeat data of the master node and the first slave node respectively. The second slave node determines whether it has crashed simultaneously based on the heartbeat data of the master node and the first slave node. If it is determined that they have crashed simultaneously, the second slave node automatically becomes a new second master node, and automatically constructs a new slave node after calculating the distance between the idle node and the second master node.
2. The novel method for digitizing and structuring campus information according to claim 1, characterized in that, The distance between the master node and the idle node is defined as follows: The hop count for the master node and the idle node is defined as n, where n represents the total number of nodes traversed from the master node to the idle node according to the network topology. The maximum number of levels traversed by the master node and the idle node to reach their first common ancestor after tracing back are x and y, respectively. Therefore, the distance L between the master node and the idle node is L = Where n is a value greater than 1, and the preset first distance threshold L s1 Second distance threshold L s2 The second distance threshold L s2 Greater than the first distance threshold L s1 When the distance L between the master node and the idle node is less than the first distance threshold L s1 The idle node then becomes a candidate node for the first slave node, when the distance L between the master node and the idle node is greater than the second distance threshold L. s2 If so, the idle node will be used as a candidate node for the second slave node.
3. A novel method for digitizing and structuring campus information according to claim 2, characterized in that, Wherein all nodes include the master node and the corresponding idle node, when the distance L between the master node and the idle node is less than the first distance threshold L s1 When the time is right, select the idle node with the smallest hop count n among all nodes traversed from the master node to the idle node as the first slave node; When the distance L between the master node and the idle node is greater than the second distance threshold L s2 When the time comes, the idle node with the smallest hop count n among all nodes traversed from the master node to the idle node is selected as the second slave node.
4. A novel method for digitizing and structuring campus information according to claim 3, characterized in that, Furthermore, based on the network node topology, communication delay data for all network nodes from the master node to the idle node is obtained. An adjustment coefficient λ for the hop value n is constructed based on this communication delay data. An updated hop value m = n * λ is calculated based on the adjustment coefficient λ for hop value n. Finally, the distance L1 between the master node and the idle node is calculated using the updated hop value m = n * λ. And based on the distance value L1 between the master node and the idle node and the first distance threshold L... s1 Second distance threshold L s2 Filter the candidate nodes for the first slave node and the candidate nodes for the second slave node.
5. A novel method for digitizing and structuring campus information according to claim 1, characterized in that, After establishing communication connections with the first slave node and the second slave node respectively, the master node obtains the node identifiers of the first slave node and the second slave node respectively. The master node packages its own master node identifier, the first slave node identifier, and the second slave node identifier into data, encrypts them with an encryption algorithm, and sends them to the first slave node and the second slave node respectively. After obtaining the node identifiers of the master node and the first slave node, the second slave node monitors the heartbeat data from the master node and the first slave node in a targeted manner. When the time interval between the heartbeat data of the master node or the first slave node is greater than the preset heartbeat interval threshold, the corresponding master node or the first slave node is determined to be down.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement a novel campus information digitization and structuring method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and device for determining backup link
CN106161230A
Multi-node network master node selection method and device, equipment and storage medium
CN118200123A