A method for tracing the source based on error codes

By generating unique numbers for messages and updating error codes, the problem of difficult error location under multiple network element nodes is solved, achieving rapid traceability and cost savings.

CN116599832BActive Publication Date: 2025-12-02MATRICTIME DIGITAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310498001.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2025-12-02
Estimated Expiration
2043-05-06

AI Technical Summary

Technical Problem

In scenarios with multiple network element nodes, existing technologies struggle to quickly locate the network element node where the error occurred, resulting in high time and technical maintenance costs.

Method used

By generating a unique message number for each message and generating an error code corresponding to the network element during message transmission, and gradually updating the error code, a unified error code structure is formed for source tracing analysis.

Benefits of technology

This technology enables rapid location of the network element node where the error occurred among multiple network element nodes, reducing the reverse traversal process and saving time and technical maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116599832B_ABST
    Figure CN116599832B_ABST
Patent Text Reader

Abstract

This invention discloses a method for tracing the source of errors based on error codes, comprising the following steps: a first network element assigns message numbers to multiple messages to be transmitted; the first network element establishes an initial error code for each message to be transmitted after the message number; and selects whether to update the error code based on whether an error exists in the message to be transmitted, and then sends it to a second network element; the second network element receives the message and selects whether to update the error code based on whether an error exists in the message to be transmitted. This invention allows for the rapid location of one or more network element nodes where errors occurred in the transmission of messages using the error code on any network element node, avoiding the process of traversing network element nodes one by one in reverse; simultaneously, the message structure transmitted in the network element nodes also includes a message number corresponding to the service, which allows for the rapid location of the software module or service module in the network element node where the error occurred, facilitating quick problem resolution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software, and more specifically to a method for tracing the source of errors based on error codes. Background Technology

[0002] As message transmission distances increase, data interaction between different network element nodes becomes involved. This data interaction includes data manipulation and transmission, and during this process, logical, validation, and timeout errors inevitably occur. Especially in scenarios with multiple network element nodes, the probability of data interaction errors is significantly higher than in scenarios with a single or small number of network element nodes. To understand errors occurring within network element nodes, a commonly used method is to define custom error codes for each network element, querying these codes to identify the error. Since each custom error code corresponds one-to-one with a network element, it only reveals the error occurring at the current network element node.

[0003] In scenarios with multiple network element nodes, firstly, multiple error codes may occur across these nodes, and the custom error code structures for each node may differ, increasing storage pressure. Secondly, in multi-network element node deployments, when the final receiving end or message termination point (meaning the message stops at any node in the entire communication link, such as a checksum failure, in which case the service may not continue to the next node; in short, the last processing node of the message, but not the final expected destination) discovers erroneous data or messages, it is necessary to traverse each network element node in reverse order of data flow to trace the source of the problem. This operation also relies on the error output of the software business for individual querying. Thirdly, when network element nodes contain massive amounts of data, professional developers with expertise in the business are required to query the data or message scenarios where problems occurred on the network element nodes. Because this involves business processing and interaction, this operation requires highly skilled developers, and general operations and maintenance personnel often lack the necessary skills, thus increasing development and maintenance time costs.

[0004] Therefore, how to quickly locate the faulty network element node in a multi-network element node situation, saving time and technical maintenance costs, is a technical problem that needs to be solved. Summary of the Invention

[0005] Purpose of the invention: The purpose of this invention is to provide a method for tracing the source based on error codes, which solves the problem of how to quickly locate the network element node that has an error in the case of multiple network element nodes, thereby saving time and technical maintenance costs.

[0006] Technical solution: This invention provides a method for tracing the source of errors based on error codes, comprising the following steps:

[0007] (1) The first network element assigns message numbers to multiple messages to be transmitted. Then, the first network element establishes an initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted. Finally, it sends each message to be transmitted after the message number and the corresponding error code to the second network element.

[0008] (2) The second network element receives each message to be transmitted and the corresponding error code transmitted from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. Finally, it sends each message to be transmitted after the message number and the corresponding error code to the third network element.

[0009] (3) By analogy, the Nth network element receives each message to be transmitted and the corresponding error code transmitted from the N-1th network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted.

[0010] (4) Based on the final error code of the Nth network element, trace the source and complete the source analysis of the error code.

[0011] Furthermore, the specific process of assigning message numbers to multiple messages to be transmitted is as follows:

[0012] First, the first network element obtains the current time and generates a random number m based on the current time, and uses the random number m as the message number MsgID of the first message among multiple messages to be transmitted;

[0013] Then, the message numbers of other messages among the multiple messages to be transmitted are incremented by 1 based on the message number of the previous transmitted message, according to the transmission order.

[0014] Furthermore, the errors in the message to be transmitted include one or more of the following: errors occurring during the service push process, errors occurring during transmission, or verification errors occurring when verifying the message.

[0015] Furthermore, errors occurring during transmission include message packet loss during transmission.

[0016] Furthermore, the error code can be any one of binary, octal, or hexadecimal numbers.

[0017] Furthermore, the first network element establishes a corresponding initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The specific process is as follows:

[0018] 1) The first network element establishes an initial error code for each message to be transmitted. The initial error code is an L-bit binary number 0, where L≥N. The N bits of the initial error code correspond to N network elements in sequence.

[0019] 2) The first network element detects whether there is an error in the message to be transmitted. If there is an error, the first network element updates the binary value of the corresponding bit in the initial error code to 1; if there is no error, the first network element does not update the binary value of the corresponding bit in the initial error code.

[0020] Furthermore, the specific process by which the second network element receives each message to be transmitted and its corresponding error code from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted, is as follows:

[0021] First, the second network element receives each message to be transmitted and its corresponding error code. Then, the second network element checks whether there is an error in the message to be transmitted. If there is an error, the second network element updates the binary value of the corresponding bit in the error code to 1. If there is no error, the second network element does not update the binary value of the corresponding bit in the error code.

[0022] Furthermore, the first network element establishes a corresponding initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The specific process is as follows:

[0023] a) The first network element establishes an initial error code for each message to be transmitted, and the initial error code is a 1-bit binary number 0;

[0024] b) The first network element detects whether there is an error in the message to be transmitted. If there is an error, the first network element updates the initial error code binary value to 1; if there is no error, the first network element does not update the initial error code binary value.

[0025] Furthermore, the specific process by which the second network element receives each message to be transmitted and its corresponding error code from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted, is as follows:

[0026] First, the second network element receives each message to be transmitted and its corresponding error code. Then, the second network element pads the leftmost bit of the error code corresponding to the message to be transmitted with 0. Next, the second network element checks whether there is an error in the message to be transmitted. If there is an error, the binary value of the highest bit in the error code is updated to 1. If there is no error, the binary value of the highest bit in the error code is not updated.

[0027] The beneficial effects of this invention are:

[0028] (1) Multiple network elements transmitting messages do not need to define their own error codes. A single set of error codes can be used to complete the error location on the entire transmission link.

[0029] (2) Among the multiple network element nodes that transmit messages, the error code on any network element node can quickly locate one or more network element nodes that previously had an error, avoiding the process of traversing the network element nodes one by one in reverse.

[0030] (3) The message structure transmitted in the network element node includes both error codes and message numbers corresponding to services. Based on the message number, the software module or service module in the network element node where the error occurred can be quickly located so as to solve the problem quickly. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of the network element nodes involved in message transmission in this invention;

[0032] Figure 2 This is a schematic diagram of the message structure of the present invention;

[0033] Figure 3 This is a schematic diagram of the message transmission process in Example 1;

[0034] Figure 4 This is a schematic diagram of the message transmission process in Example 2. Detailed Implementation

[0035] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0036] In the case of multiple network element nodes, message transmission is continuous, thus forming an information transmission chain. For example... Figure 1 As shown, there can be N network element nodes participating in information transmission.

[0037] Example 1

[0038] For network elements that are coherent and participate in the same message transmission, this invention proposes a method for tracing the source based on error codes. This method transmits the error codes as part of the message, specifically including the following steps:

[0039] (1) The first network element assigns message numbers to multiple messages to be transmitted. Then, the first network element establishes an initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether an error exists in the message to be transmitted. Finally, it sends each message to be transmitted after the message number and its corresponding error code to the second network element; For example... Figure 2As shown, the message to be transmitted between network element nodes consists of a message number, an error code, and the message content data to be transmitted.

[0040] The specific process of assigning message numbers to multiple messages to be transmitted is as follows:

[0041] First, the first network element obtains the current time and generates a random number m based on the current time. The method for generating the random number can be the existing rand() function and the current system time, or the absolute value of the current time (the number of seconds from January 1, 1970 to the current system) can be used as the seed for the random algorithm. Then, the random number m is generated according to the general random number algorithm, that is, by calling the srandom interface of the libc library. The random number m is used as the message number MsgID of the first message among multiple messages to be transmitted; therefore, the message number MsgID of the first message is a time-related random number.

[0042] After determining the message ID (MsgID) of the first message transmitted by the first network element, the message IDs of the subsequent messages to be transmitted are incremented by 1 based on the transmission order of the previous message. That is, if the message ID (MsgID) of the first message transmitted by the first network element is m, then the message ID (MsgID) of the second message is m+1, the message ID (MsgID) of the third message is m+2, and so on.

[0043] The message ID (MsgID) can be a 32-bit data type, which can support over 4 billion unique messages. Considering the practicality and economy of transmission bandwidth, the message ID (MsgID) can also be a 64-bit integer. This allows the message ID to directly use built-in variables without defining complex data types, satisfying most application scenarios. Of course, the message ID can also be customized by extending the variable type length according to the specific software language used to implement it, thus using a custom data type.

[0044] After the message numbering is completed, the first network element then establishes a corresponding initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The error code can be any one of binary, octal, or hexadecimal numbers. This embodiment uses binary numbers. The specific process is as follows:

[0045] 1) The first network element establishes an initial error code for each message to be transmitted. The initial error code is an L-bit binary number 0, where L≥N. The N bits of the initial error code correspond sequentially to N network elements. Since it is impossible to know how many network elements the message will pass through before the message is transmitted, the initial error code should be as long as possible. 32-bit or 64-bit data can be directly selected. During the message transmission process, one bit of the corresponding binary number is assigned to each network element it passes through in sequence.

[0046] The initial error code consists of N binary bits, each corresponding to a network element involved in the message transmission. Taking an example where four network elements participate in the message transmission (N=4), the initial error code is constructed as follows: Four network elements represent the message transmission passing through four network elements. The initial error code is a 4-bit data value, denoted as 0000. The first, second, third, and fourth bits correspond to network elements 1, 2, 3, and 4, respectively, in the message transmission process.

[0047] 2) The first network element detects whether there are errors in the message to be transmitted. If an error exists, the first network element updates the binary value of the corresponding bit in the initial error code to 1; if no error exists, the first network element does not update the binary value of the corresponding bit in the initial error code. The errors include one or more of the following: errors occurring during service push, errors occurring during transmission, or verification errors occurring during message validation. Errors occurring during transmission include message packet loss, and may also include tampering, network errors, etc.

[0048] Finally, each message to be transmitted after the message number and its corresponding error code are sent to the second network element;

[0049] (2) The second network element receives each message to be transmitted and the corresponding error code transmitted from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. Finally, it sends each message to be transmitted after the message number and the corresponding error code to the third network element.

[0050] The specific process is as follows: First, the second network element receives each message to be transmitted and its corresponding error code. Each message to be transmitted at this stage has already been assigned a message number. Then, the second network element checks if there are any errors in the messages to be transmitted. If an error exists, the second network element updates the binary value of the corresponding bit in the error code to 1; if no error exists, the second network element does not update the binary value of the corresponding bit in the error code. The error mechanism is the same as described above and will not be repeated. Finally, each message to be transmitted after its message number and its corresponding error code are sent to the third network element.

[0051] (3) Similarly, the Nth network element receives each message to be transmitted and its corresponding error code from the (N-1)th network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The specific operation of the Nth network element is the same as that of the second network element, and will not be described further;

[0052] (4) Based on the final error code of the Nth network element, trace the source and complete the source analysis of the error code. By viewing the error code of the Nth network element, it is possible to quickly locate one or more network element nodes that have encountered errors among the multiple network element nodes that transmitted the message.

[0053] like Figure 3 As shown, taking an example with 4 network elements participating in message transmission (N=4), the changes in error codes during message transmission are illustrated. The first network element sends the message as required by the user, according to the aforementioned... Figure 2 The message structure shown constructs the message to be transmitted. The message to be transmitted consists of a message number, an error code, and the message content (data). Among the multiple messages to be transmitted, the message number MsgID of the first message remains unchanged during transmission. Based on the number of four transmission network elements, the first network element establishes an initial error code (0000) for each message to be transmitted. The initial error code can be 4 bits of data.

[0054] The first network element detects whether the message to be transmitted has errors. If an error exists in the message within the first network element, the first network element updates the binary value of the corresponding bit in the initial error code to 1, thus updating the error code to 0001. If no error exists in the message within the first network element, the first network element does not update the binary value of the corresponding bit in the initial error code, thus the error code is 0000. Here, a 0 in each bit indicates that the message in the corresponding network element has no errors; a 1 in each bit indicates that the message in the corresponding network element has errors.

[0055] Then, the first network element sends each message to be transmitted, along with its corresponding error code, after the message number to the second network element. The second network element receives each message to be transmitted and its corresponding error code from the first network element. If the received message corresponds to error code 0001, the second network element detects an error in the message to be transmitted. In this case, the second network element updates the binary value of the corresponding bit in the error code to 1, and the error code becomes 0011. This error can be an error that occurs during transmission (e.g., packet loss) or a verification error that occurs when the second network element verifies the message. If the received message corresponds to error code 0001, the second network element detects no error in the message to be transmitted. In this case, the second network element does not update the binary value of the corresponding bit in the error code, and the error code remains 0001. Similarly, if the error code in the received message is 0000, the second network element detects an error in the message to be transmitted and updates the error code to 0010; if the second network element detects no error in the message to be transmitted, the error code is 0000; the second network element sends each message to be transmitted after the message number and the corresponding error code to the third network element.

[0056] Similarly, the third network element receives each message to be transmitted after the message number transmitted from the second network element, along with its corresponding error code. Following the same working mechanism as the second network element, the third network element selects whether to update the error code based on the error code corresponding to the message to be transmitted and whether an error exists in the message. The updated error code is the third binary bit value corresponding to the third network element. For example, if the received message has an error code of 0011, and an error has occurred in the message from the third network element, then the updated error code is 0111. The third network element then transmits the message with the updated error code to the fourth network element. The error codes carried in the message transmitted by the third network element can include 0000, 0100, 0010, 0110, 0001, 0101, 0011, and 0111.

[0057] The fourth network element receives each message to be transmitted, along with its corresponding error code, after the message number transmitted from the third network element. Following the same working mechanism as the second or third network element, the fourth network element selects whether to update the error code based on the error code corresponding to the message to be transmitted and whether an error exists in the message. The error codes carried in the messages transmitted by the fourth network element can include 0000, 1000, 0100, 1100, 0010, 1010, 0110, 1110, 0001, 1001, 0101, 1101, 0011, 1011, 0111, and 1111.

[0058] Error codes transmitted by the aforementioned network elements are stored in the log records of each network element. If the number of network elements the message traverses is large, such as 32 or 64, the number of bits in the error code will increase accordingly, which will increase the storage pressure on the log module in the network element. Therefore, as mentioned above, error codes can be any of binary, octal, or hexadecimal numbers. This embodiment uses binary numbers, but appropriate data representations can be selected according to the software code used. Taking hexadecimal as an example, error code 0011 in the third network element can be represented as 0x00000003.

[0059] Therefore, this invention addresses any network element in the message transmission process, such as the third network element. Based on the bit with a value of 1 in the error code carried by the message in the third network element, the network element corresponding to that bit can be identified. These network elements are the ones where the message error occurred. For example, based on the error code 0010 in the third network element, the user can intuitively determine that the message in the first network element that transmitted the preceding message has not yet encountered an error, but the message in the second network element has. Accordingly, the user can directly locate the error in the second network element to troubleshoot the message transmission process. In this invention, multiple network elements do not need to define their own error codes; a single set of error codes can be used to complete error location across the entire transmission link. Moreover, the error code on any network element node can quickly locate one or more network element nodes where an error previously occurred, avoiding the process of traversing network element nodes one by one in reverse.

[0060] Meanwhile, in some embodiments, message transmission may not be a single message transmission, but rather multiple messages transmitted in parallel. Since the message structure proposed in this invention also includes a message number MsgID corresponding to each message, users can use the message number MsgID plus the error code to troubleshoot erroneous messages and the network element where the error exists.

[0061] Example 2

[0062] This embodiment is basically the same as Embodiment 1, except that: in this embodiment, the first network element establishes a corresponding initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether the message to be transmitted has an error; and the second network element receives each message to be transmitted and the corresponding error code transmitted by the first network element, and selects whether to update the error code based on whether the message to be transmitted has an error.

[0063] like Figure 4 As shown, the specific process by which the first network element establishes an initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted, is as follows:

[0064] a) The first network element establishes an initial error code for each message to be transmitted, and the initial error code is a 1-bit binary number 0;

[0065] b) The first network element detects whether there is an error in the message to be transmitted. If there is an error, the first network element updates the initial error code binary value to 1; if there is no error, the first network element does not update the initial error code binary value.

[0066] In this way, no matter how many network elements it passes through, the error code corresponding to the message to be transmitted in the first network element is either 0 or 1; the corresponding bit consumption is less, the memory usage is also reduced, and there is no need to create data with a length of 32 bits or 64 bits at the beginning;

[0067] The specific process by which the second network element receives each message to be transmitted and its corresponding error code from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted, is as follows:

[0068] First, the second network element receives each message to be transmitted and its corresponding error code. Then, the second network element pads the leftmost bit of the error code corresponding to the message to be transmitted with 0. Next, the second network element checks whether there is an error in the message to be transmitted. If there is an error, the binary value of the highest bit in the error code is updated to 1. If there is no error, the binary value of the highest bit in the error code is not updated.

[0069] Assuming the error code corresponding to the message to be transmitted by the first network element is 1, the second network element fills the left side of the highest bit of this error code with 0, so the error code is 01. Then the second network element checks whether there is an error in the message to be transmitted. If there is an error, it updates the binary value of the highest bit of the error code to 1, so the error code is 11; if there is no error, it does not update the binary value of the highest bit of the error code, so the error code is 01.

[0070] After passing through N network elements, the final generated error code is also N bits, and the memory usage rate is relatively low compared to Example 1.

Claims

1. A method for tracing the source based on error codes, characterized in that, Includes the following steps: (1) The first network element assigns message numbers to multiple messages to be transmitted. Then, the first network element establishes an initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted. Finally, it sends each message to be transmitted after the message number and the corresponding error code to the second network element. (2) The second network element receives each message to be transmitted and the corresponding error code transmitted from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. Finally, it sends each message to be transmitted after the message number and the corresponding error code to the third network element. (3) By analogy, the Nth network element receives each message to be transmitted and the corresponding error code transmitted from the N-1th network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. (4) Based on the final error code of the Nth network element, trace the source and complete the source analysis of the error code; The specific process by which the first network element establishes an initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted, is as follows: 1) The first network element establishes an initial error code for each message to be transmitted. The initial error code is an L-bit binary number 0, where L≥N. The N bits of the initial error code correspond to N network elements in sequence. 2) The first network element detects whether there is an error in the message to be transmitted. If there is an error, the first network element updates the binary value of the corresponding bit in the initial error code to 1; if there is no error, the first network element does not update the binary value of the corresponding bit in the initial error code. The second network element receives each message to be transmitted and its corresponding error code from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The specific process is as follows: First, the second network element receives each message to be transmitted and its corresponding error code; then, the second network element checks whether there is an error in the message to be transmitted. If there is an error, the second network element updates the binary value of the bit corresponding to the second network element in the error code to 1; if there is no error, the second network element does not update the binary value of the bit corresponding to the second network element in the error code. or, The first network element establishes a corresponding initial error code for each message to be transmitted after the message number, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The specific process is as follows: a) The first network element establishes an initial error code for each message to be transmitted, and the initial error code is a 1-bit binary number 0; b) The first network element detects whether there is an error in the message to be transmitted. If there is an error, the first network element updates the initial error code binary value to 1; if there is no error, the first network element does not update the initial error code binary value. The second network element receives each message to be transmitted and its corresponding error code from the first network element, and selects whether to update the error code based on whether there is an error in the message to be transmitted. The specific process is as follows: First, the second network element receives each message to be transmitted and its corresponding error code. Then, the second network element pads the leftmost bit of the error code corresponding to the message to be transmitted with 0. Next, the second network element checks whether there is an error in the message to be transmitted. If there is an error, the binary value of the highest bit in the error code is updated to 1. If there is no error, the binary value of the highest bit in the error code is not updated.

2. The method for tracing the source based on error codes according to claim 1, characterized in that, The specific process of assigning message numbers to multiple messages to be transmitted is as follows: First, the first network element obtains the current time and generates a random number m based on the current time, and uses the random number m as the message number MsgID of the first message among multiple messages to be transmitted; Then, the message numbers of other messages among the multiple messages to be transmitted are incremented by 1 based on the message number of the previous transmitted message, according to the transmission order.

3. The method for tracing the source based on error codes according to claim 1, characterized in that: The errors in the message to be transmitted include one or more of the following: errors that occur during the service push process, errors that occur during transmission, or verification errors that occur when verifying the message.

4. The method for tracing the source based on error codes according to claim 3, characterized in that: Errors occurring during transmission include message packet loss.

5. The method for tracing the source based on error codes according to claim 1, characterized in that: The error code can be any of a binary number, an octal number, or a hexadecimal number.

Citation Information

Patent Citations

  • Software error code transferring method, device and system

    CN101980176A