Node Monitoring Method and Device
By sending tracking instructions in the data transmission channel, obtaining the address and reception time of the data transmission node, and generating node monitoring information, the problems of data synchronization delay and incomplete monitoring in off-site multi-living scenarios are solved, and real-time monitoring and fault location of the data transmission link are realized.
Patent Information
- Application Number
- CN202310142359.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-09
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2043-02-09
AI Technical Summary
In the multi-living scenario in the off-site data synchronization process, due to the deployment of intermediate transmission nodes across regions, the data transmission delay is large, the monitoring information is incomplete, and the delay node cannot be accurately located.
By constructing a data transmission channel including multiple data transmission nodes, in response to the source master node sending synchronous data to the target node, the source master node controls to send a first tracking instruction, obtains the node addresses and reception time of the multiple data transmission nodes, and generates node monitoring information corresponding to the data transmission channel.
It realizes monitoring of each data transmission node in the data transmission channel, reflects the delay of the data synchronization full link, and can realize real-time monitoring of the synchronous link and precise positioning of the fault node.
Smart Images

Figure CN116132340B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the fields of computer technology and Internet technology, specifically to the field of information and communication technology, and particularly to a node monitoring method and apparatus. Background Art
[0002] Currently, with the continuous development and progress of technology, in order to improve the system disaster tolerance ability and concurrency ability, the core system will be deployed in multiple computer rooms to improve the concurrency ability and high availability, such as adopting multi-site active-active, etc. And data synchronization is the basis of multi-site active-active. All components with data storage capabilities, such as databases, caches, MQ, etc., need to perform data synchronization in the multi-site active-active scenario to ensure low-latency data transmission between multiple computer rooms.
[0003] During the data synchronization process, the intermediate transmission nodes need to be deployed across regions. The data synchronization passes through multiple nodes, resulting in a large transmission delay. In this case, most of the data node monitoring is performed by embedding points on the peripheral pipeline to collect monitoring information, which leads to incomplete monitoring information. There are nodes that are missed in the collection on the link, and when network delays and other anomalies occur, it is impossible to accurately locate the delay nodes. Summary of the Invention
[0004] Embodiments of the present disclosure provide a node monitoring method, apparatus, electronic device, and computer-readable medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a node monitoring method, the method including: constructing a data transmission channel including a plurality of data transmission nodes based on a source master node and a target node; in response to determining that the source master node sends synchronization data to the target node, controlling the source master node to send a first tracking instruction based on the data transmission channel; in response to receiving a second tracking instruction corresponding to the first tracking instruction, obtaining the node addresses and reception times of the plurality of data transmission nodes based on the second tracking instruction; generating node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes.
[0006] In some embodiments, in response to determining that the source master node sends synchronization data to the target node, controlling the source master node to send a first tracking instruction based on the data transmission channel includes: in response to determining that the source master node sends synchronization data to the target node, obtaining the working state of the source master node; determining whether the working state of the source master node is a preset state; in response to determining that the working state of the source master node is the preset state, controlling the source master node to send a first tracking instruction based on the data transmission channel.
[0007] In some embodiments, in response to determining that the source master node sends synchronization data to the target node, controlling the source master node to send a first tracking instruction based on the data transmission channel further includes: in response to determining that the working state of the source master node is not the preset state, obtaining a plurality of slave nodes corresponding to the source master node; determining a new source master node based on the plurality of slave nodes; and in response to determining that the new source master node is connected to the data transmission channel, controlling the new source master node to send a first tracking instruction based on the data transmission channel.
[0008] In some embodiments, controlling the source master node to send a first tracking instruction based on the data transmission channel includes: determining whether the target node corresponding to the data transmission channel is a preset node; and in response to determining that the target node is the preset node, controlling the source master node to send a first tracking instruction based on the data transmission channel.
[0009] In some embodiments, the plurality of data transmission nodes include consumer nodes; and in response to receiving a second tracking instruction corresponding to the first tracking instruction, obtaining the node addresses and reception times of the plurality of data transmission nodes based on the second tracking instruction includes: in response to receiving the second tracking instruction sent by the consumer node, determining whether the second tracking instruction corresponds to the first tracking instruction; and in response to determining that the second tracking instruction corresponds to the first tracking instruction, parsing the second tracking instruction to obtain the parsed tracking instruction, where the second tracking instruction is an instruction obtained by sequentially adding the node addresses and reception times of the plurality of data transmission nodes to the first tracking instruction in the data transmission channel; and obtaining the node addresses and reception times of the plurality of data transmission nodes from the parsed tracking instruction.
[0010] In some embodiments, generating node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes includes: obtaining the data transmission duration corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes; comparing the data transmission duration with a preset duration; and generating node monitoring information corresponding to the data transmission channel based on the comparison result.
[0011] In a second aspect, an embodiment of the present disclosure provides a node monitoring device, including: a construction module configured to construct a data transmission channel including a plurality of data transmission nodes based on a source master node and a target node; a control module configured to control the source master node to send a first tracking instruction based on the data transmission channel in response to determining that the source master node sends synchronization data to the target node; an acquisition module configured to obtain the node addresses and reception times of the plurality of data transmission nodes based on a second tracking instruction in response to receiving the second tracking instruction corresponding to the first tracking instruction; and a generation module configured to generate node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes.
[0012] In some embodiments, the control module is further configured to: in response to determining that the source master node sends synchronization data to the target node, obtain the working state of the source master node; determine whether the working state of the source master node is a preset state; in response to determining that the working state of the source master node is the preset state, control the source master node to send a first tracking instruction based on the data transmission channel.
[0013] In some embodiments, the control module is further configured to: in response to determining that the working state of the source master node is not the preset state, obtain multiple slave nodes corresponding to the source master node; determine a new source master node based on the multiple slave nodes; in response to determining that the new source master node is connected to the data transmission channel, control the new source master node to send a first tracking instruction based on the data transmission channel.
[0014] In some embodiments, the control module is further configured to: determine whether the target node corresponding to the data transmission channel is a preset node; in response to determining that the target node is the preset node, control the source master node to send a first tracking instruction based on the data transmission channel.
[0015] In some embodiments, the multiple data transmission nodes include consumer nodes; and the obtaining module is further configured to: in response to receiving a second tracking instruction sent by a consumer node, determine whether the second tracking instruction corresponds to the first tracking instruction; in response to determining that the second tracking instruction corresponds to the first tracking instruction, parse the second tracking instruction to obtain a parsed tracking instruction, where the second tracking instruction is an instruction obtained by sequentially adding node addresses and reception times of the first tracking instruction by multiple data transmission nodes in the data transmission channel; obtain the node addresses and reception times of the multiple data transmission nodes from the parsed tracking instruction.
[0016] In some embodiments, the generating module is further configured to: based on the node addresses and reception times of the multiple data transmission nodes, obtain the data transmission duration corresponding to the data transmission channel; compare the data transmission duration with a preset duration, and based on the comparison result, generate node monitoring information corresponding to the data transmission channel.
[0017] In a third aspect, an embodiment of the present disclosure provides an electronic device, which includes: one or more processors; a storage device storing one or more programs thereon; when the one or more programs are executed by the one or more processors, the one or more processors implement the node monitoring method described in any embodiment of the first aspect.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the node monitoring method described in any embodiment of the first aspect is implemented.
[0019] The node monitoring method provided by the embodiments of the present disclosure. The above-mentioned execution entity first constructs a data transmission channel including multiple data transmission nodes based on the source master node and the target node, and then in response to determining that the source master node sends synchronization data to the target node, controls the source master node to send a first tracking instruction based on the data transmission channel, and in response to receiving a second tracking instruction corresponding to the first tracking instruction, based on the second tracking instruction, obtains the node addresses and reception times of the multiple data transmission nodes, and finally generates node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the multiple data transmission nodes. By transmitting the tracking instruction in the data transmission pipeline and obtaining the reception time and node address when the tracking instruction passes through each data transmission node, the monitoring of each data transmission node in the data transmission channel is realized, the delay situation of the entire data synchronization link is reflected, the real-time monitoring of the synchronization link and the accurate positioning of the faulty node can be realized, and the data transmission node with problems can be located in time. Description of the Drawings
[0020] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, purposes and advantages of the present disclosure will become more obvious:
[0021] Figure 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
[0022] Figure 2 is a flowchart of an embodiment of the node monitoring method according to the present disclosure;
[0023] Figure 3 is a flowchart of an embodiment of controlling the source master node to send a first tracking instruction based on the data transmission channel according to the present disclosure;
[0024] Figure 4 is a flowchart of another embodiment of controlling the source master node to send a first tracking instruction based on the data transmission channel according to the present disclosure;
[0025] Figure 5 is a flowchart of an embodiment of obtaining the node addresses and reception times of multiple data transmission nodes according to the present disclosure;
[0026] Figure 6 is a schematic structural diagram of an embodiment of the node monitoring device according to the present disclosure;
[0027] Figure 7 is a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. Detailed Embodiments
[0028] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are merely for explaining the relevant disclosure and not for limiting the disclosure. Additionally, it should be noted that for the convenience of description, only the parts related to the relevant disclosure are shown in the drawings.
[0029] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the drawings and embodiments.
[0030] Figure 1 An exemplary system architecture 100 of a node monitoring method and apparatus to which embodiments of the present disclosure can be applied is shown.
[0031] As Figure 1 shown, the system architecture 100 may include Data Center A, Data Center B, a producer node disposed on one side of Data Center A, a consumer node disposed on one side of Data Center B, and a monitoring center.
[0032] Among them, Data Center A includes a source master node, and Data Center B includes a target node. The source master node is connected to the producer node, the consumer node, and the target node to construct a data transmission channel, and this data transmission channel can be used to synchronize the data in the source master node to the target node.
[0033] Among them, the source master node and the target node can be data cache nodes in remote data centers, or data cache nodes in different data centers in the same city, or the master node and the slave node in the same data center.
[0034] Among them, the producer node is used to pull, parse, and transmit the data in the source master node. The consumer node is used to receive the data and write it into the target node.
[0035] The monitoring center can be connected to the producer node and the consumer node, and can construct a data transmission channel including multiple data transmission nodes according to the source master node and the target node, so that the source master node can use the data transmission channel to synchronize the data to the target node. Then the monitoring center can determine that the source master node sends synchronization data to the target node, control the source master node to send a first tracking instruction based on the data transmission channel, so that the first tracking instruction can be sequentially sent to each data transmission node along the data transmission channel. And the monitoring center can receive a second tracking instruction corresponding to the first tracking instruction, and this second tracking instruction can be the instruction after the first tracking instruction passes through each data transmission node. Based on the second tracking instruction, obtain the node addresses and reception times of multiple data transmission nodes, and finally generate node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of multiple data transmission nodes
[0036] It should be noted that the node monitoring method provided by the embodiments of the present disclosure can be executed by a monitoring center. Correspondingly, the node monitoring device is arranged in the monitoring center.
[0037] Referring to Figure 2 , a flowchart 200 of an embodiment of the node monitoring method according to the present disclosure is shown. The node monitoring method includes the following steps:
[0038] Step 210, based on a source master node and a target node, construct a data transmission channel including a plurality of data transmission nodes.
[0039] In this step, the execution entity (such as Figure 1 the monitoring center in
[0040] on which the node monitoring method runs) can receive a data synchronization request, and the data synchronization request can be a request between the source master node and the target node.
[0041] Then the above execution entity parses the data synchronization request, determines the source master node and the target node corresponding to the data synchronization request, and constructs a data transmission channel corresponding to the source master node and the target node according to the source master node and the target node. The data transmission channel can include a plurality of data transmission nodes, and each data transmission node is connected to realize the connection between the source master node and the target node. The data transmission channel can be used to transmit the data of the source master node to the target node to realize data synchronization between the source master node and the target node.
[0041] Step 220, in response to determining that the source master node sends synchronization data to the target node, control the source master node to send a first tracking instruction based on the data transmission channel.
[0042] In this step, the data transmission nodes can include producer nodes and consumer nodes. After the data transmission channel is constructed, the producer nodes can pull data from the source master node, parse and encapsulate the extracted data, and transmit the encapsulated data to the next data transmission node. After being transmitted through a plurality of data transmission nodes until the consumer nodes receive the encapsulated data and write the encapsulated data into the target node, thus completing data synchronization between the source master node and the target node.
[0043] The above execution entity can pre-configure the tracking instruction for the source master node through a config set, so that the source master node can send the tracking instruction according to a preset period. The above execution entity can detect the data transmission channel between the source master node and the target node. After determining that the source master node sends synchronization data to the target node through the data transmission channel, it can control the source master node to send a first tracking instruction through the data transmission channel, so that the first tracking instruction can be transmitted through each data transmission channel in the same way as the synchronization data.
[0044] Each data transmission node in the data transmission channel can successively receive the first tracking instruction, parse the first tracking instruction, and after determining that the received instruction is a tracking instruction, obtain its own node address and reception time, and add the node address and reception time to the first tracking instruction, so as to obtain a second tracking instruction attached with the node addresses and reception times of each data transmission node.
[0045] The above-mentioned source master node can send the first tracking instruction through the data transmission channel according to a preset period, and the first tracking instruction can include the node address and transmission time of the source master node.
[0046] Step 230, in response to receiving the second tracking instruction corresponding to the first tracking instruction, based on the second tracking instruction, obtain the node addresses and reception times of multiple data transmission nodes.
[0047] In this step, the above-mentioned execution entity can obtain the second tracking instruction corresponding to the first tracking instruction, parse the second tracking instruction, and obtain the node addresses and reception times of multiple data transmission nodes in the data transmission channel. Among them, the node address can represent the local IP address of each data transmission node, and the reception time can represent the time when each data transmission node receives the tracking instruction.
[0048] Step 240, generate node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of multiple data transmission nodes.
[0049] In this step, after the above-mentioned execution entity obtains the node addresses and reception times of multiple data transmission nodes, it can calculate the first transmission duration from the source master node to the target node according to the connection order between each data transmission node in the data transmission channel and the reception times of multiple data transmission nodes. And, the above-mentioned execution entity calculates the second transmission duration between every two data transmission nodes according to the connection order between each data transmission node and the reception times of multiple data transmission nodes.
[0050] Then the above-mentioned execution entity can compare the first transmission duration with the first preset duration to determine whether the first transmission duration is greater than the first preset duration, and can also compare the second transmission duration with the second preset duration to determine whether the second transmission duration is greater than the second preset duration. After the above-mentioned execution entity respectively obtains the comparison results of the first transmission duration and the second transmission duration, it can generate node monitoring information corresponding to the data transmission channel according to the comparison results.
[0051] As an example, if the first transmission duration is greater than the first preset duration, it is determined that the data transmission channel is abnormal. Further, based on the second transmission duration and the comparison result, the abnormal data transmission node is determined. Finally, node monitoring information indicating the abnormality of the data transmission channel is generated according to the abnormal data transmission node.
[0052] As an example, if the first transmission duration is not greater than the first preset duration, it is determined that the data transmission channel is normal, and node monitoring information indicating the normality of the data transmission channel is generated.
[0053] As an optional implementation manner, step 240 above, generating node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of multiple data transmission nodes, may include the following steps:
[0054] First step, based on the node addresses and reception times of multiple data transmission nodes, obtain the data transmission duration corresponding to the data transmission channel.
[0055] Specifically, after the above execution entity obtains the node addresses and reception times of multiple data transmission nodes, it may determine the reception time for the target node to receive data according to the connection order between each data transmission node in the data transmission channel and the reception times of multiple data transmission nodes. Then, the above execution entity calculates the data transmission duration corresponding to the data transmission channel according to the transmission time of the source master node and the reception time of the target node.
[0056] Second step, compare the data transmission duration with the preset duration, and based on the comparison result, generate node monitoring information corresponding to the data transmission channel.
[0057] Specifically, after the above execution entity obtains the data transmission duration, it compares the data transmission duration with the preset duration to determine whether the data transmission duration is greater than the preset duration. If it is determined that the data transmission duration is greater than the preset duration, the above execution entity determines that the data transmission channel is abnormal, and generates node monitoring information indicating the abnormality of the data transmission channel; if it is determined that the data transmission duration is not greater than the preset duration, the above execution entity determines that the data transmission channel is normal, and generates node monitoring information indicating the normality of the data transmission channel.
[0058] In this implementation manner, by obtaining the data transmission duration corresponding to the data transmission channel based on the node addresses and reception times of multiple data transmission nodes, comparing the data transmission duration with the preset duration, and generating node monitoring information corresponding to the data transmission channel based on the comparison result, it is possible to monitor the data transmission duration of the data transmission channel and generate node monitoring information according to the data transmission duration, which can reflect the delay situation of the entire data synchronization link.
[0059] The node monitoring method provided by the embodiments of the present disclosure. The above-mentioned execution entity first constructs a data transmission channel including multiple data transmission nodes based on the source master node and the target node, and then in response to determining that the source master node sends synchronization data to the target node, controls the source master node to send a first tracking instruction based on the data transmission channel, and in response to receiving a second tracking instruction corresponding to the first tracking instruction, based on the second tracking instruction, obtains the node addresses and reception times of the multiple data transmission nodes, and finally generates node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the multiple data transmission nodes. By transmitting the tracking instruction in the data transmission pipeline and obtaining the reception time and node address each time the tracking instruction passes through a data transmission node, the monitoring of each data transmission node in the data transmission channel is realized, the delay situation of the entire data synchronization link is reflected, the real-time monitoring of the synchronization link and the accurate positioning of the faulty node can be realized, and the data transmission node with problems can be located in time.
[0060] See Figure 3 , Figure 3 FIG. 300 shows a flowchart of an embodiment for controlling the source master node to send a first tracking instruction based on the data transmission channel, that is, the above-mentioned step 220. In response to determining that the source master node sends synchronization data to the target node, controlling the source master node to send a first tracking instruction based on the data transmission channel may include the following steps:
[0061] Step 310, in response to determining that the source master node sends synchronization data to the target node, obtain the working state of the source master node.
[0062] In this step, the above-mentioned execution entity may detect the data transmission channel between the source master node and the target node. After determining that the source master node sends synchronization data to the target node through the data transmission channel, the source master node may be detected to obtain its working state. Among them, the working state includes a normal state and an abnormal state. The normal state may represent the normal working state of the source master node, and the abnormal state may represent the state where the source master node fails and cannot work properly.
[0063] Step 320, determine whether the working state of the source master node is a preset state.
[0064] In this step, after the above-mentioned execution entity obtains the working state of the source master node, it may determine whether the working state of the source master node is a preset state, and the preset state may be a normal state.
[0065] In response to determining that the working state of the source master node is the preset state, execute step 330. In response to determining that the working state of the source master node is the preset state, control the source master node to send a first tracking instruction based on the data transmission channel.
[0066] In this step, after the above-mentioned execution entity determines through judgment that the working state of the source master node is the preset state, it controls the source master node to send a first tracking instruction through the data transmission channel, so that the first tracking instruction can be transmitted through each data transmission channel in accordance with the synchronization data.
[0067] In this implementation manner, by judging the working state of the source master node, after determining that the working state of the source master node is the preset state, controlling the source master node to send a first tracking instruction based on the data transmission channel can judge the working state of the source master node. Only when the source master node is in the preset state, will it control the source master node to send a first tracking instruction based on the data transmission channel, improving the accuracy of sending the first tracking instruction.
[0068] Continue to refer to Figure 3 , step 220 above, in response to determining that the source master node sends synchronization data to the target node, controlling the source master node to send a first tracking instruction based on the data transmission channel may further include the following steps:
[0069] Step 340, in response to determining that the working state of the source master node is not the preset state, obtain multiple slave nodes corresponding to the source master node.
[0070] In this step, after the above-mentioned execution entity determines through judgment that the working state of the source master node is not the preset state, it obtains multiple local slave nodes corresponding to the source master node, where the data in the multiple local slave nodes is the same as that in the source master node.
[0071] Step 350, determine a new source master node based on the multiple slave nodes.
[0072] In this step, after the above-mentioned execution entity obtains multiple slave nodes corresponding to the source master node, it selects a new source master node from the multiple slave nodes.
[0073] Step 360, in response to determining that the new source master node is connected to the data transmission channel, control the new source master node to send a first tracking instruction based on the data transmission channel.
[0074] In this step, after the above-mentioned execution entity determines the new source master node, it can control the new source master node to be connected to the data transmission channel. If it is determined that the new source master node is connected to the data transmission channel, the above-mentioned execution entity can control the new source master node to send a first tracking instruction through the data transmission channel, so that the first tracking instruction can be transmitted through each data transmission channel in accordance with the synchronization data.
[0075] In this implementation manner, by judging the working state of the source master node, after determining that the working state of the source master node is not the preset state, a new source master node is determined among multiple slave nodes, so as to control the new source master node to send a first tracking instruction based on the data transmission channel. When the source master node is not in the preset state, the sending of the first tracking instruction can be controlled, realizing the diversity of the sending of the first tracking instruction.
[0076] Reference Figure 4 , Figure 4 shows a flowchart 400 of another embodiment for controlling the source master node to send a first tracking instruction based on the data transmission channel. That is, the above-mentioned controlling the source master node to send a first tracking instruction based on the data transmission channel may include the following steps:
[0077] Step 410, determine whether the target node corresponding to the data transmission channel is a preset node.
[0078] In this step, the above-mentioned execution entity can also determine the corresponding target node according to the data transmission channel, and judge the target node to determine whether the target node corresponding to the data transmission channel is a preset node. The preset node may be a node representing a different data center from the source master node.
[0079] Step 420, in response to determining that the target node is a preset node, control the source master node to send a first tracking instruction based on the data transmission channel.
[0080] In this step, after the above-mentioned execution entity determines through judgment that the target node is a preset node, it can determine that the data transmission channel is a data synchronization pipeline between different data centers, and then control the source master node to send a first tracking instruction based on the data transmission channel.
[0081] As an optional implementation manner, in response to determining that the target node is not a preset node, it is determined that the data transmission channel is a data synchronization pipeline between the same data centers, that is, it can be determined that the data transmission channel is a master-slave synchronization pipeline, and only the source master node needs to be controlled to send data to multiple data transmission nodes based on the data transmission channel, without sending the first tracking instruction.
[0082] In this implementation manner, by judging the target node, thereby judging whether the data transmission channel is a master-slave synchronization pipeline, and then determining whether to send the first tracking instruction, the pertinence of the sending of the first tracking instruction is realized.
[0083] Reference Figure 5 , Figure 5The flowchart 500 of an embodiment for obtaining the node addresses and reception times of multiple data transmission nodes is shown, that is, the above step 230. In response to receiving a second tracking instruction corresponding to the first tracking instruction, based on the second tracking instruction, obtaining the node addresses and reception times of multiple data transmission nodes may include the following steps:
[0084] Step 510, in response to receiving the second tracking instruction sent by the consumer node, determine whether the second tracking instruction corresponds to the first tracking instruction.
[0085] Among them, the multiple data transmission nodes may include a consumer node and a producer node. The producer node is connected to the source master node, the consumer node is connected to the target node, and other data transmission nodes are connected between the producer node and the consumer node.
[0086] In this step, the above execution entity can obtain the second tracking instruction corresponding to the first tracking instruction and the instruction identifier corresponding to the second tracking instruction. Then the above execution entity compares the instruction identifier corresponding to the second tracking instruction with the instruction identifier of the first tracking instruction to determine whether the instruction identifiers are the same, so as to determine whether the second tracking instruction corresponds to the first tracking instruction.
[0087] Step 520, in response to determining that the second tracking instruction corresponds to the first tracking instruction, parse the second tracking instruction to obtain the parsed tracking instruction.
[0088] In this step, the above execution entity determines through judgment that the second tracking instruction corresponds to the first tracking instruction, and parses the second tracking instruction to obtain the parsed tracking instruction.
[0089] Among them, the second tracking instruction may be an instruction obtained by multiple data transmission nodes in the data transmission channel adding the node address and reception time to the first tracking instruction in sequence. That is, the first tracking instruction is sent by the source master node and passes through the producer node, the intermediate node of the data transmission channel, the consumer node, and the target node in sequence. Each data transmission node parses the first tracking instruction and attaches the local node address and reception time after the first tracking instruction, so as to obtain the second tracking instruction.
[0090] Among them, the reception time of the target node may be that after the consumer node receives the first tracking instruction, parses it, and the consumer node sends a feedback message. The consumer node can determine the time from the consumer node to the target node according to the sending time of the first tracking instruction to the target node and the time of receiving the feedback message, so as to determine the reception time of the target node.
[0091] Step 530, obtain the node addresses and reception times of multiple data transmission nodes from the parsed tracking instruction.
[0092] In this step, after the above-mentioned execution entity obtains the parsed tracking instruction, it can read the node address corresponding to each data transfer node and the reception time corresponding to each data transfer node from the parsed tracking instruction, so as to obtain the node addresses and reception times of multiple data transfer nodes.
[0093] In this embodiment, by determining whether the second tracking instruction corresponds to the first tracking instruction, after determining that the second tracking instruction corresponds to the first tracking instruction, the second tracking instruction can be parsed to obtain the parsed tracking instruction, and the node addresses and reception times of multiple data transfer nodes can be obtained, so as to accurately parse and read the second tracking instruction, improve the accuracy of the node addresses and reception times of multiple data transfer nodes, and thus accurately analyze the node monitoring information of the data transfer channel.
[0094] Further referring to Figure 6 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a node monitoring device. This device embodiment corresponds to Figure 2 the method embodiment shown.
[0095] As Figure 6 shown, the node monitoring device 600 in this embodiment may include: a construction module 610, a control module 620, an acquisition module 630, and a generation module 640.
[0096] Among them, the construction module 610 is configured to construct a data transfer channel including multiple data transfer nodes based on the source master node and the target node;
[0097] The control module 620 is configured to control the source master node to send a first tracking instruction based on the data transfer channel in response to determining that the source master node sends synchronization data to the target node;
[0098] The acquisition module 630 is configured to obtain the node addresses and reception times of multiple data transfer nodes based on the second tracking instruction in response to receiving a second tracking instruction corresponding to the first tracking instruction;
[0099] The generation module 640 is configured to generate node monitoring information corresponding to the data transfer channel based on the node addresses and reception times of multiple data transfer nodes.
[0100] In some optional implementation manners of this embodiment, the control module is further configured to: obtain the working state of the source master node in response to determining that the source master node sends synchronization data to the target node; determine whether the working state of the source master node is a preset state; and control the source master node to send a first tracking instruction based on the data transfer channel in response to determining that the working state of the source master node is the preset state.
[0101] In some alternative implementation manners of this embodiment, the control module is further configured to: in response to determining that the working state of the source master node is not the preset state, obtain a plurality of slave nodes corresponding to the source master node; determine a new source master node based on the plurality of slave nodes; and in response to determining that the new source master node is connected to the data transmission channel, control the new source master node to send a first tracking instruction based on the data transmission channel.
[0102] In some alternative implementation manners of this embodiment, the control module is further configured to: determine whether the target node corresponding to the data transmission channel is a preset node; and in response to determining that the target node is the preset node, control the source master node to send a first tracking instruction based on the data transmission channel.
[0103] In some alternative implementation manners of this embodiment, the plurality of data transmission nodes include consumer nodes; and the obtaining module is further configured to: in response to receiving a second tracking instruction sent by a consumer node, determine whether the second tracking instruction corresponds to the first tracking instruction; and in response to determining that the second tracking instruction corresponds to the first tracking instruction, parse the second tracking instruction to obtain a parsed tracking instruction, where the second tracking instruction is an instruction obtained by sequentially adding a node address and a reception time to the first tracking instruction by a plurality of data transmission nodes in the data transmission channel; and obtain the node addresses and reception times of the plurality of data transmission nodes from the parsed tracking instruction.
[0104] In some alternative implementation manners of this embodiment, the generating module is further configured to: obtain the data transmission duration corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes; compare the data transmission duration with a preset duration, and generate node monitoring information corresponding to the data transmission channel based on the comparison result.
[0105] The node monitoring device provided in the above embodiment of the present disclosure first constructs a data transmission channel including a plurality of data transmission nodes based on the source master node and the target node, then in response to determining that the source master node sends synchronization data to the target node, controls the source master node to send a first tracking instruction based on the data transmission channel, and in response to receiving a second tracking instruction corresponding to the first tracking instruction, obtains the node addresses and reception times of the plurality of data transmission nodes based on the second tracking instruction, and finally generates node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes, transmits the tracking instruction in the data transmission pipeline, obtains the reception time and node address when the tracking instruction passes through each data transmission node, realizes the monitoring of each data transmission node in the data transmission channel, reflects the delay situation of the entire data synchronization link, can realize the real-time monitoring of the synchronization link and the accurate positioning of the faulty node, and can timely locate the problematic data transmission node.
[0106] Those skilled in the art can understand that the above device also includes some other well-known structures, such as a processor, a memory, etc. To avoid unnecessarily obscuring the embodiments of the present disclosure, these well-known structures are not shown in Figure 6 the following.
[0107] Reference is made below to Figure 7 , which shows a schematic structural diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as smart screens, laptop computers, PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The terminal device shown is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0108] As Figure 7 shown, the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0109] Generally, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 7 the electronic device 700 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices may be alternatively implemented or had. Figure 7 Each block shown in may represent a device or, as needed, multiple devices.
[0110] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above functions defined in the method of the embodiment of the present disclosure are performed. It should be noted that the computer-readable medium of the embodiment of the present disclosure 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 of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiment of the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device. In the embodiment of the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0111] Computer program code for performing the operations of the embodiments of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0113] The units described in the embodiments of the present application may be implemented in software or in hardware. The described units may also be provided in a processor. For example, it may be described as: a processor includes a construction module, a control module, an acquisition module, and a generation module, where the names of these modules do not, in some cases, limit the module itself.
[0114] As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the above-mentioned electronic device; or it may exist separately without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device is caused to: construct a data transmission channel including a plurality of data transmission nodes based on a source master node and a target node; in response to determining that the source master node sends synchronization data to the target node, control the source master node to send a first tracking instruction based on the data transmission channel; in response to receiving a second tracking instruction corresponding to the first tracking instruction, obtain the node addresses and reception times of the plurality of data transmission nodes based on the second tracking instruction; and generate node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the plurality of data transmission nodes.
[0115] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) disclosed in the embodiments of the present disclosure that have similar functions.
Claims
1. A node monitoring method, the method comprising: Construct a data transmission channel including multiple data transmission nodes based on a source master node and a target node; In response to determining that the source master node sends synchronization data to the target node, control the source master node to send a first tracking instruction based on the data transmission channel, where the first tracking instruction includes the node address and sending time of the source master node; In response to receiving a second tracking instruction corresponding to the first tracking instruction, obtain the node addresses and receiving times of the multiple data transmission nodes based on the second tracking instruction; Generate node monitoring information corresponding to the data transmission channel based on the node addresses and receiving times of the multiple data transmission nodes; Among them, the generating node monitoring information corresponding to the data transmission channel based on the node addresses and receiving times of the multiple data transmission nodes includes: Obtain the data transmission duration corresponding to the data transmission channel based on the node addresses and receiving times of the multiple data transmission nodes; Compare the data transmission duration with a preset duration, and generate node monitoring information corresponding to the data transmission channel based on the comparison result.
2. The method according to claim 1, wherein, The controlling the source master node to send a first tracking instruction based on the data transmission channel in response to determining that the source master node sends synchronization data to the target node includes: In response to determining that the source master node sends synchronization data to the target node, obtain the working state of the source master node; Judge whether the working state of the source master node is a preset state; In response to determining that the working state of the source master node is the preset state, control the source master node to send a first tracking instruction based on the data transmission channel.
3. The method according to claim 2, wherein, The controlling the source master node to send a first tracking instruction based on the data transmission channel in response to determining that the source master node sends synchronization data to the target node further includes: In response to determining that the working state of the source master node is not the preset state, obtain multiple slave nodes corresponding to the source master node; Determine a new source master node based on the multiple slave nodes; In response to determining that the new source master node is connected to the data transmission channel, control the new source master node to send a first tracking instruction based on the data transmission channel.
4. The method according to claim 2 or 3, wherein, The controlling the source master node to send a first tracking instruction based on the data transmission channel includes: Judge whether the target node corresponding to the data transmission channel is a preset node; In response to determining that the target node is the preset node, control the source master node to send a first tracking instruction based on the data transmission channel.
5. The method according to claim 1, wherein, The multiple data transmission nodes include consumer nodes; and, The obtaining the node addresses and receiving times of the multiple data transmission nodes based on the second tracking instruction in response to receiving the second tracking instruction corresponding to the first tracking instruction includes: In response to receiving the second tracking instruction sent by the consumer node, judge whether the second tracking instruction corresponds to the first tracking instruction; In response to determining that the second tracking instruction corresponds to the first tracking instruction, the second tracking instruction is parsed to obtain the parsed tracking instruction, where the second tracking instruction is an instruction obtained by sequentially adding node addresses and reception times to the first tracking instruction by multiple data transmission nodes in the data transmission channel; The node addresses and reception times of the multiple data transmission nodes are obtained from the parsed tracking instruction.
6. A data transmission device, the device comprising: A construction module, configured to construct a data transmission channel including multiple data transmission nodes based on a source master node and a target node; A control module, configured to, in response to determining that the source master node sends synchronization data to the target node, control the source master node to send a first tracking instruction based on the data transmission channel, where the first tracking instruction includes the node address and transmission time of the source master node; An acquisition module, configured to, in response to receiving a second tracking instruction corresponding to the first tracking instruction, obtain the node addresses and reception times of the multiple data transmission nodes based on the second tracking instruction; A generation module, configured to generate node monitoring information corresponding to the data transmission channel based on the node addresses and reception times of the multiple data transmission nodes; Wherein, the generation module is further configured to: Obtain the data transmission duration corresponding to the data transmission channel based on the node addresses and reception times of the multiple data transmission nodes; Compare the data transmission duration with a preset duration, and generate node monitoring information corresponding to the data transmission channel based on the comparison result.
7. The device according to claim 6, wherein, The control module is further configured to: In response to determining that the source master node sends synchronization data to the target node, obtain the working state of the source master node; Judge whether the working state of the source master node is a preset state; In response to determining that the working state of the source master node is the preset state, control the source master node to send a first tracking instruction based on the data transmission channel.
8. The apparatus according to claim 7, wherein, The control module is further configured to: In response to determining that the working state of the source master node is not the preset state, obtain multiple slave nodes corresponding to the source master node; Determine a new source master node based on the multiple slave nodes; In response to determining that the new source master node is connected to the data transmission channel, control the new source master node to send a first tracking instruction based on the data transmission channel.
9. The apparatus according to claim 7 or 8, wherein, The control module is further configured to: Judge whether the target node corresponding to the data transmission channel is a preset node; In response to determining that the target node is the preset node, control the source master node to send a first tracking instruction based on the data transmission channel.
10. The apparatus according to claim 6, wherein, The multiple data transmission nodes include consumer nodes; and, the acquisition module is further configured to: In response to receiving a second tracking instruction sent by the consumer node, judge whether the second tracking instruction corresponds to the first tracking instruction; In response to determining that the second tracking instruction corresponds to the first tracking instruction, the second tracking instruction is parsed to obtain the parsed tracking instruction, where the second tracking instruction is an instruction obtained by adding node addresses and reception times to the first tracking instruction by multiple data transmission nodes in the data transmission channel in sequence; The node addresses and reception times of the multiple data transmission nodes are obtained from the parsed tracking instruction.
11. An electronic device, comprising: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-5.
12. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the method according to any one of claims 1-5 is implemented.
Citation Information
Patent Citations
Distributed service full-link monitoring method and device, electronic equipment and storage medium
CN113987074A