[go: up one dir, main page]

CN115484004B - Error message retry method and device, electronic equipment and storage medium - Google Patents

Error message retry method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115484004B
CN115484004B CN202210913934.9A CN202210913934A CN115484004B CN 115484004 B CN115484004 B CN 115484004B CN 202210913934 A CN202210913934 A CN 202210913934A CN 115484004 B CN115484004 B CN 115484004B
Authority
CN
China
Prior art keywords
target
error message
target error
error
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210913934.9A
Other languages
Chinese (zh)
Other versions
CN115484004A (en
Inventor
何智勇
王伟
吴学含
白亚文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Cloud Technology Co Ltd
Original Assignee
China Telecom Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Cloud Technology Co Ltd filed Critical China Telecom Cloud Technology Co Ltd
Priority to CN202210913934.9A priority Critical patent/CN115484004B/en
Publication of CN115484004A publication Critical patent/CN115484004A/en
Application granted granted Critical
Publication of CN115484004B publication Critical patent/CN115484004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The present invention relates to the field of retry of error messages, and in particular, to a method, an apparatus, an electronic device, and a storage medium for retry of error messages. The method comprises the following steps: acquiring target error information corresponding to the target error message; analyzing the target error information and determining an error source corresponding to the target error message; wherein the error source is used to characterize the device that returned the target error information; determining other error messages with the same error sources as the target error message according to the error sources; and retransmitting the target error message according to the relation between the target error message and other error messages, and prohibiting retransmitting the other error messages before the target error message is successfully transmitted. The method reduces the number of error messages needing to be retransmitted, reduces the occupied CPU resources of the computer equipment and lightens the burden of the computer equipment.

Description

报错报文重试方法、装置、电子设备及存储介质Error message retry method, device, electronic device and storage medium

技术领域Technical Field

本发明涉及报错报文重试领域,具体涉及一种报错报文重试方法、装置、电子设备及存储介质。The present invention relates to the field of error message retry, and in particular to an error message retry method, device, electronic equipment and storage medium.

背景技术Background technique

Kubernetes(K8S)CSI Sidecar Containers是一组标准容器,旨在简化Kubernetes上CSI驱动程序的开发和部署。这些容器会观察Kubernetes API的通用逻辑,触发针对CSI卷驱动程序容器的适当操作,并根据需要更新Kubernetes API。Kubernetes (K8S) CSI Sidecar Containers is a set of standard containers designed to simplify the development and deployment of CSI drivers on Kubernetes. These containers observe the common logic of the Kubernetes API, trigger appropriate actions for the CSI volume driver container, and update the Kubernetes API as needed.

在批量操作K8S资源时,由于后端网络问题/存储资源不足/参数错误等问题失败后,CSI Sidecar会根据指数退避算法,下发重试请求,即使这样也会产生大量的需要重新发送的错误报文,大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担。When operating K8S resources in batches, if there is a failure due to backend network problems/insufficient storage resources/parameter errors, CSI Sidecar will send a retry request based on the exponential backoff algorithm. Even so, a large number of error messages that need to be resent will be generated. The continuous sending of a large number of error messages occupies a large amount of CPU resources of the computer device, increasing the burden on the computer device.

发明内容Summary of the invention

有鉴于此,本发明实施例提供了一种报错报文重试方法,旨在解决现有技术会导致大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担的问题。In view of this, an embodiment of the present invention provides an error message retry method, which aims to solve the problem that the prior art causes a large number of error messages to be continuously sent, occupying a large amount of CPU resources of the computer device and increasing the burden of the computer device.

根据第一方面,本发明实施例提供了一种报错报文重试方法,包括:According to a first aspect, an embodiment of the present invention provides an error message retry method, comprising:

获取目标报错报文对应的目标错误信息;Get the target error information corresponding to the target error message;

对目标错误信息进行解析,确定目标报错报文对应的错误来源;其中,错误来源用于表征返回目标错误信息的设备;Parse the target error information to determine the error source corresponding to the target error message; wherein the error source is used to characterize the device that returns the target error information;

根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文;According to the error source, determine other error messages with the same error source as the target error message;

根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。According to the relationship between the target error message and other error messages, the target error message is resent, and before the target error message is successfully sent, resending of other error messages is prohibited.

本发明实施例提供的报错报文重试方法,获取目标报错报文对应的目标错误信息,然后,对目标错误信息进行解析,确定目标报错报文对应的错误来源,保证了确定的目标报错报文对应的错误来源的准确性。根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文,保证了确定的与目标报错报文对应的错误来源相同的其他报错报文的准确性。根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。上述方法,不需要重新发送大量的错误报文,大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担。因此,上述方法减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry method provided by the embodiment of the present invention obtains the target error information corresponding to the target error message, and then parses the target error information to determine the error source corresponding to the target error message, thereby ensuring the accuracy of the error source corresponding to the determined target error message. According to the error source, other error messages with the same error source as the target error message corresponding to the target error message are determined, thereby ensuring the accuracy of other error messages with the same error source as the target error message corresponding to the target error message. According to the relationship between the target error message and other error messages, the target error message is resent, and resending of other error messages is prohibited before the target error message is successfully sent. The above method does not need to resend a large number of error messages. The continuous sending of a large number of error messages occupies a large amount of CPU resources of the computer device and increases the burden of the computer device. Therefore, the above method reduces the number of error messages that need to be resent, reduces the CPU resources of the computer device occupied, and reduces the burden of the computer device.

结合第一方面,在第一方面第一实施方式中,根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,包括:In combination with the first aspect, in a first implementation of the first aspect, resending the target error message according to the relationship between the target error message and other error messages includes:

对目标错误信息进行解析,确定目标报错报文对应的目标等待时间;Analyze the target error information and determine the target waiting time corresponding to the target error message;

获取其他报错报文对应的其他等待时间;Get other waiting times corresponding to other error messages;

根据目标等待时间与其他等待时间之间的关系,确定目标报错报文对应的候选重试时间;Determine the candidate retry time corresponding to the target error message according to the relationship between the target waiting time and other waiting times;

根据候选重试时间,对目标报错报文进行重新发送。Resend the target error message based on the candidate retry time.

本发明实施例提供的报错报文重试方法,对目标错误信息进行解析,确定目标报错报文对应的目标等待时间,保证了确定目标报错报文对应的目标等待时间的准确性。然后,获取其他报错报文对应的其他等待时间;根据目标等待时间与其他等待时间之间的关系,确定目标报错报文对应的候选重试时间,保证了确定的目标报错报文对应的候选重试时间的准确性。根据候选重试时间,对目标报错报文进行重新发送,保证了对目标报错报文进行重新发送的准确性,减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry method provided in the embodiment of the present invention parses the target error information, determines the target waiting time corresponding to the target error message, and ensures the accuracy of the target waiting time corresponding to the target error message. Then, other waiting times corresponding to other error messages are obtained; based on the relationship between the target waiting time and the other waiting times, the candidate retry time corresponding to the target error message is determined, and the accuracy of the candidate retry time corresponding to the determined target error message is ensured. According to the candidate retry time, the target error message is resent, and the accuracy of the resending of the target error message is ensured, the number of error messages that need to be resent is reduced, the CPU resources occupied by the computer device are reduced, and the burden on the computer device is reduced.

结合第一方面第一实施方式,在第一方面第二实施方式中,根据目标等待时间与其他等待时间之间的关系,确定目标报错报文对应的候选重试时间,包括:In combination with the first implementation of the first aspect, in the second implementation of the first aspect, determining a candidate retry time corresponding to the target error message according to a relationship between the target waiting time and other waiting times includes:

对目标错误信息进行解析,确定目标报错报文对应的第一权重信息;Parse the target error information to determine the first weight information corresponding to the target error message;

获取其他报错报文对应的第二权重信息;Obtain the second weight information corresponding to other error messages;

基于第一权重信息、第二权重信息、目标等待时间以及其他等待时间之间的关系,确定目标报错报文对应的候选重试时间。Based on the relationship between the first weight information, the second weight information, the target waiting time and other waiting times, a candidate retry time corresponding to the target error message is determined.

本发明实施例提供的报错报文重试方法,对目标错误信息进行解析,确定目标报错报文对应的第一权重信息,保证了确定的目标报错报文对应的第一权重信息的准确性。获取其他报错报文对应的第二权重信息,然后,基于第一权重信息、第二权重信息、目标等待时间以及其他等待时间之间的关系,确定目标报错报文对应的候选重试时间,保证了确定的目标报错报文对应的候选重试时间的准确性,减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry method provided in the embodiment of the present invention parses the target error information, determines the first weight information corresponding to the target error message, and ensures the accuracy of the first weight information corresponding to the determined target error message. The second weight information corresponding to other error messages is obtained, and then, based on the relationship between the first weight information, the second weight information, the target waiting time and other waiting times, the candidate retry time corresponding to the target error message is determined, ensuring the accuracy of the candidate retry time corresponding to the determined target error message, reducing the number of error messages that need to be resent, reducing the CPU resources occupied by the computer device, and alleviating the burden on the computer device.

结合第一方面第二实施方式,在第一方面第三实施方式中,基于第一权重信息、第二权重信息、目标等待时间以及其他等待时间之间的关系,确定目标报错报文对应的候选重试时间,包括:In combination with the second implementation of the first aspect, in the third implementation of the first aspect, based on the relationship between the first weight information, the second weight information, the target waiting time, and other waiting times, determining the candidate retry time corresponding to the target error message includes:

利用第一权重信息除以第一权重信息与第二权重信息的和,得到目标报错报文对应的目标权重信息;Dividing the first weight information by the sum of the first weight information and the second weight information to obtain target weight information corresponding to the target error message;

利用第二权重信息除以第一权重信息与第二权重信息的和,得到其他报错报文对应的其他权重信息;Dividing the second weight information by the sum of the first weight information and the second weight information to obtain other weight information corresponding to other error messages;

将目标权重信息乘以目标等待时间的积加上其他权重信息乘以其他等待时间的积,计算得到目标报错报文对应的候选重试时间。The product of the target weight information multiplied by the target waiting time is added to the product of other weight information multiplied by other waiting times to calculate the candidate retry time corresponding to the target error message.

本发明实施例提供的报错报文重试方法,利用第一权重信息除以第一权重信息与第二权重信息的和,得到目标报错报文对应的目标权重信息,保证了得到的目标报错报文对应的目标权重信息的准确性。利用第二权重信息除以第一权重信息与第二权重信息的和,得到其他报错报文对应的其他权重信息,保证了计算得到的其他报错报文对应的其他权重信息的准确性,将目标权重信息乘以目标等待时间的积加上其他权重信息乘以其他等待时间的积,计算得到目标报错报文对应的候选重试时间,保证了计算得到的候选重试时间的准确性。The error message retry method provided in the embodiment of the present invention obtains the target weight information corresponding to the target error message by dividing the first weight information by the sum of the first weight information and the second weight information, thereby ensuring the accuracy of the target weight information corresponding to the obtained target error message. The second weight information is divided by the sum of the first weight information and the second weight information to obtain other weight information corresponding to other error messages, thereby ensuring the accuracy of the other weight information corresponding to other error messages calculated. The product of the target weight information multiplied by the target waiting time is added to the product of the other weight information multiplied by the other waiting time to calculate the candidate retry time corresponding to the target error message, thereby ensuring the accuracy of the calculated candidate retry time.

结合第一方面第一实施方式,在第一方面第四实施方式中,根据候选重试时间,对目标报错报文进行重新发送,包括:In combination with the first implementation manner of the first aspect, in a fourth implementation manner of the first aspect, resending the target error message according to the candidate retry time includes:

获取目标报错报文对应的发送次数;Get the number of times the target error message is sent;

利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间;Using the exponential backoff algorithm, the candidate waiting time corresponding to the target error message is calculated based on the number of times the target error message is sent;

将候选重试时间与候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间;Compare the candidate retry time with the candidate waiting time, determine the maximum value from the candidate retry time and the candidate waiting time, and use it as the target retry time corresponding to the target error message;

在目标重试时间之后,对目标报错报文进行重新发送。After the target retry time, the target error message is resent.

本发明实施例提供的报错报文重试方法,获取目标报错报文对应的发送次数,利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间,保证了计算得到的目标报错报文对应的候选等待时间的准确性。将候选重试时间与候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间,保证了确定的目标报错报文对应的目标重试时间的准确性。然后,在目标重试时间之后,对目标报错报文进行重新发送,保证了发送目标报错报文的时间间隔不会太长也不会太短,从而减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry method provided in the embodiment of the present invention obtains the number of transmissions corresponding to the target error message, and uses an exponential backoff algorithm to calculate the candidate waiting time corresponding to the target error message based on the number of transmissions corresponding to the target error message, thereby ensuring the accuracy of the candidate waiting time corresponding to the calculated target error message. The candidate retry time is compared with the candidate waiting time, and the maximum value is determined from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message, thereby ensuring the accuracy of the target retry time corresponding to the determined target error message. Then, after the target retry time, the target error message is resent, thereby ensuring that the time interval for sending the target error message is neither too long nor too short, thereby reducing the number of error messages that need to be resent, reducing the CPU resources occupied by the computer device, and alleviating the burden on the computer device.

结合第一方面第四实施方式,在第一方面第六实施方式中,方法还包括:In combination with the fourth implementation of the first aspect, in a sixth implementation of the first aspect, the method further includes:

在对目标报错报文重新发送失败之后,再次计算目标报错报文对应的候选重试时间;After the target error message fails to be resent, the candidate retry time corresponding to the target error message is calculated again;

利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间;Using the exponential backoff algorithm, the candidate waiting time corresponding to the target error message is calculated based on the number of times the target error message is sent;

将目标报错报文对应的候选重试时间与目标报错报文对应的候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间;Compare the candidate retry time corresponding to the target error message with the candidate waiting time corresponding to the target error message, and determine the maximum value from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message;

在目标重试时间之后,对目标报错报文进行重新发送。After the target retry time, the target error message is resent.

本发明实施例提供的报错报文重试方法,在对目标报错报文重新发送失败之后,再次计算目标报错报文对应的候选重试时间,保证了计算得到的候选重试时间的准确性。然后,指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间,保证了计算得到的目标报错报文对应的候选等待时间的准确性。将目标报错报文对应的候选重试时间与目标报错报文对应的候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间,保证了确定的目标报错报文对应的目标重试时间的准确性。在目标重试时间之后,对目标报错报文进行重新发送,从而保证了可以对目标报错报文进行多次发送,且保证了发送目标报错报文的时间间隔不会太长也不会太短,从而减少了需要重新发送的错误报文的数量,减轻了计算机设备的负担。The error message retry method provided by the embodiment of the present invention calculates the candidate retry time corresponding to the target error message again after the target error message fails to be resent, thereby ensuring the accuracy of the calculated candidate retry time. Then, the exponential backoff algorithm calculates the candidate waiting time corresponding to the target error message based on the number of times the target error message is sent, thereby ensuring the accuracy of the calculated candidate waiting time corresponding to the target error message. The candidate retry time corresponding to the target error message is compared with the candidate waiting time corresponding to the target error message, and the maximum value is determined from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message, thereby ensuring the accuracy of the target retry time corresponding to the determined target error message. After the target retry time, the target error message is resent, thereby ensuring that the target error message can be sent multiple times, and ensuring that the time interval for sending the target error message is neither too long nor too short, thereby reducing the number of error messages that need to be resent and alleviating the burden on computer equipment.

结合第一方面,在第一方面第六实施方式中,方法还包括:In combination with the first aspect, in a sixth implementation of the first aspect, the method further includes:

获取其他报错报文对应的其他错误信息;Get other error information corresponding to other error messages;

将其他错误信息和目标错误信息存储至同一存储空间;Storing other error information and target error information in the same storage space;

在目标报错报文发送成功后,从存储空间中删除其他错误信息,并重新发送其他报错报文。After the target error message is sent successfully, other error information is deleted from the storage space, and other error messages are resent.

本发明实施例提供的报错报文重试方法,获取其他报错报文对应的其他错误信息;将其他错误信息和目标错误信息存储至同一存储空间,可以保证电子设备可以对目标报错报文以及其他报错报文进行更新和记录,在目标报错报文发送成功后,电子设备确定从电子设备到目标报错报文对应的错误来源设备之间的通信链路正常。电子设备不需要在记录目标报错报文和其他报错报文,因此,从存储空间中删除其他错误信息,并重新发送其他报错报文,保证了目标报错报文和其他报错报文均可以正常发送。The error message retry method provided in the embodiment of the present invention obtains other error information corresponding to other error messages; stores other error information and target error information in the same storage space, which can ensure that the electronic device can update and record the target error message and other error messages. After the target error message is successfully sent, the electronic device determines that the communication link from the electronic device to the error source device corresponding to the target error message is normal. The electronic device does not need to record the target error message and other error messages, so it deletes other error information from the storage space and resends other error messages, ensuring that the target error message and other error messages can be sent normally.

根据第二方面,本发明实施例还提供了一种报错报文重试装置,包括:According to the second aspect, an embodiment of the present invention further provides an error message retry device, comprising:

第一获取模块,用于获取目标报错报文对应的目标错误信息;A first acquisition module is used to acquire target error information corresponding to the target error message;

第一确定模块,用于对所述目标错误信息进行解析,确定所述目标报错报文对应的错误来源;其中,所述错误来源用于表征返回所述目标错误信息的设备;A first determination module is used to parse the target error information and determine the error source corresponding to the target error message; wherein the error source is used to characterize the device that returns the target error information;

第二确定模块,用于根据所述错误来源,确定与所述目标报错报文对应的错误来源相同的其他报错报文;A second determining module is used to determine other error messages having the same error source as the target error message according to the error source;

发送模块,用于根据所述目标报错报文与所述其他报错报文之间的关系,对所述目标报错报文进行重新发送,并在所述目标报错报文发送成功之前禁止对所述其他报错报文进行重新发送。The sending module is used to resend the target error message according to the relationship between the target error message and the other error messages, and prohibit the resending of the other error messages before the target error message is successfully sent.

本发明实施例提供的报错报文重试装置,获取目标报错报文对应的目标错误信息,然后,对目标错误信息进行解析,确定目标报错报文对应的错误来源,保证了确定的目标报错报文对应的错误来源的准确性。根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文,保证了确定的与目标报错报文对应的错误来源相同的其他报错报文的准确性。根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。上述装置,不需要重新发送大量的错误报文,大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担。因此,减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry device provided by the embodiment of the present invention obtains the target error information corresponding to the target error message, and then parses the target error information to determine the error source corresponding to the target error message, thereby ensuring the accuracy of the error source corresponding to the determined target error message. According to the error source, other error messages with the same error source as the target error message corresponding to the target error message are determined, thereby ensuring the accuracy of other error messages with the same error source as the target error message corresponding to the determined target error message. According to the relationship between the target error message and other error messages, the target error message is resent, and resending of other error messages is prohibited before the target error message is successfully sent. The above device does not need to resend a large number of error messages. The continuous sending of a large number of error messages occupies a large amount of CPU resources of the computer device and increases the burden of the computer device. Therefore, the number of error messages that need to be resent is reduced, the CPU resources of the computer device occupied are reduced, and the burden of the computer device is alleviated.

根据第三方面,本发明实施例提供了一种电子设备,包括存储器和处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机指令,处理器通过执行计算机指令,从而执行第一方面或者第一方面的任意一种实施方式中的报错报文重试方法。According to the third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the error message retry method in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.

根据第四方面,本发明实施例提供了一种计算机可读存储介质,计算机可读存储介质存储计算机指令,计算机指令用于使计算机执行第一方面或者第一方面的任意一种实施方式中的报错报文重试方法。According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the error message retry method in the first aspect or any one of the implementations of the first aspect.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

图1是应用本发明实施例提供的sidecar容器的工作流程示意图;FIG1 is a schematic diagram of a workflow of applying a sidecar container provided by an embodiment of the present invention;

图2是应用本发明另一实施例提供的报错报文重试方法的流程图;FIG2 is a flow chart of an error message retry method provided by another embodiment of the present invention;

图3是应用本发明另一实施例提供的报错报文重试方法中错误码调用和配置的流程图;3 is a flowchart of error code calling and configuration in an error message retry method provided by another embodiment of the present invention;

图4是应用本发明另一实施例提供的报错报文重试方法的流程图;FIG4 is a flow chart of an error message retry method provided by another embodiment of the present invention;

图5是应用本发明另一实施例提供的报错报文重试方法的流程图;5 is a flow chart of an error message retry method provided by another embodiment of the present invention;

图6是应用本发明另一实施例提供的根据错误来源对报错报文进行分类的示意图;6 is a schematic diagram of classifying error messages according to error sources provided by another embodiment of the present invention;

图7是应用本发明实施例提供的报错报文重试装置的功能模块图;7 is a functional module diagram of an error message retry device provided by an embodiment of the present invention;

图8是应用本发明实施例提供的报错报文重试装置的功能模块图;8 is a functional module diagram of an error message retry device provided by an embodiment of the present invention;

图9是应用本发明实施例提供的电子设备的硬件结构示意图。FIG. 9 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

Kubernetes CSI Sidecar Containers是一组标准容器,旨在简化Kubernetes上CSI驱动程序的开发和部署。这些容器会观察Kubernetes API的通用逻辑,触发针对CSI卷驱动程序容器的适当操作,并根据需要更新Kubernetes API。Kubernetes CSI Sidecar Containers is a set of standard containers designed to simplify the development and deployment of CSI drivers on Kubernetes. These containers observe the common logic of the Kubernetes API, trigger appropriate actions for the CSI volume driver container, and update the Kubernetes API as needed.

CSI是容器存储接口(Container Storage Interface)的简写,旨在能为容器编排引擎CO(Container Orchestrator System)和存储供应商SP(Storage Provider)之间建立一套标准的存储调用接口,从而定义行业标准,使存储供应商(SP)能够开发一个符合CSI标准的插件并使其可以在多个容器编排(CO)系统中工作。CSI is the abbreviation of Container Storage Interface, which aims to establish a set of standard storage call interfaces between container orchestration engine CO (Container Orchestrator System) and storage provider SP (Storage Provider), thereby defining industry standards and enabling storage providers (SP) to develop a plug-in that complies with the CSI standard and enable it to work in multiple container orchestration (CO) systems.

CSI规定CO通过RPC(RPC是远程过程调用(Remote Procedure Call))方式与插件交互。每个SP必须提供:CSI stipulates that CO interacts with plug-ins through RPC (RPC is Remote Procedure Call). Each SP must provide:

Node Plugin:一个gRPC端点,提供必须在节点上运行的CSI RPC接口,这些接口一般用于挂载/卸载卷相关的功能。Node Plugin: A gRPC endpoint that provides CSI RPC interfaces that must be run on the node. These interfaces are generally used for functions related to mounting/unmounting volumes.

Controller Plugin:一个gRPC端点,提供可以在任何地方运行的CSI RPC接口,一般用于创建/删除卷相关的的功能。Controller Plugin: A gRPC endpoint that provides a CSI RPC interface that can run anywhere, generally used for creating/deleting volume-related functions.

Kubernetes开发团队维护以下Kubernetes CSI Sidecar Containers的功能,示例性的如下表1所示。The Kubernetes development team maintains the following Kubernetes CSI Sidecar Containers features, as shown in Table 1 below.

表1 Kubernetes CSI Sidecar Containers的功能Table 1. Functions of Kubernetes CSI Sidecar Containers

示例性的,如图1所示,sidecar容器主动通过gRPC请求,调用CSI的接口时,完成以下功能动作:Exemplarily, as shown in Figure 1, when the sidecar container actively calls the CSI interface through a gRPC request, the following functional actions are completed:

创建/删除/扩容PVC;Create/delete/expand PVC;

创建/删除/回滚volumesnapshot;Create/delete/rollback volumesnapshot;

挂载/卸载PVC。Mount/unmount PVC.

当底层CSI出现错误时,sidecar会通过把请求重新入队,来完成后续的重试动作,为了避免错误后的重试风暴,采用了指数退避算法来解决重试风暴的问题。但是,这样会产生大量的需要重新发送的错误报文,大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担。When an error occurs in the underlying CSI, the sidecar will complete the subsequent retry actions by requeuing the request. In order to avoid retry storms after errors, an exponential backoff algorithm is used to solve the problem of retry storms. However, this will generate a large number of error messages that need to be resent. The continuous sending of a large number of error messages occupies a large amount of CPU resources of computer devices, increasing the burden on computer devices.

因此,本申请实施例提供了一种报错报文重试方法,旨在解决现有技术会导致大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担的问题。Therefore, an embodiment of the present application provides an error message retry method, which aims to solve the problem that the prior art causes the continuous sending of a large number of error messages, occupying a large amount of CPU resources of the computer device and increasing the burden on the computer device.

需要说明的是,本申请实施例提供的报错报文重试的方法,其执行主体可以是报错报文重试的装置,该报错报文重试的装置可以通过软件、硬件或者软硬件结合的方式实现成为计算机设备的部分或者全部,其中,该计算机设备可以是服务器或者终端,其中,本申请实施例中的服务器可以为一台服务器,也可以为由多台服务器组成的服务器集群,本申请实施例中的终端可以是智能手机、个人电脑、平板电脑、可穿戴设备以及智能机器人等其他智能硬件设备。下述方法实施例中,均以执行主体是电子设备为例来进行说明。It should be noted that the method for retrying an error message provided in the embodiment of the present application, its execution subject can be a device for retrying an error message, and the device for retrying an error message can be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware, wherein the computer device can be a server or a terminal, wherein the server in the embodiment of the present application can be a single server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application can be a smart phone, a personal computer, a tablet computer, a wearable device, and other intelligent hardware devices such as an intelligent robot. In the following method embodiments, the execution subject is an electronic device as an example for explanation.

在本申请一个实施例中,如图2所示,提供了一种报错报文重试方法,以该方法应用于电子设备为例进行说明,包括以下步骤:In one embodiment of the present application, as shown in FIG. 2 , a method for retrying an error message is provided, and the method is described by taking the application of the method to an electronic device as an example, including the following steps:

S11、获取目标报错报文对应的目标错误信息。S11. Obtain target error information corresponding to the target error message.

在本申请一种可选的实施方式中,电子设备可以向其他设备发送报文消息,在报文消息发送失败之后,获取目标报错报文,并获取目标报错报文对应的目标错误信息。In an optional implementation of the present application, the electronic device may send a message to other devices, and after the message sending fails, obtain a target error message and obtain target error information corresponding to the target error message.

在本申请另一种可选的实施方式中,电子设备还可以接收其他设备发送的目标报错报文对应的目标错误信息,或者接收用户输入的目标报错报文对应的目标错误信息,本申请实施例对电子设备获取目标报错报文对应的目标错误信息的具体方式不做具体限定。In another optional implementation of the present application, the electronic device can also receive target error information corresponding to a target error message sent by other devices, or receive target error information corresponding to a target error message input by a user. The embodiment of the present application does not specifically limit the specific method for the electronic device to obtain the target error information corresponding to the target error message.

S12、对目标错误信息进行解析,确定目标报错报文对应的错误来源。S12. Analyze the target error information to determine the error source corresponding to the target error message.

其中,错误来源用于表征返回目标错误信息的设备。The error source is used to characterize the device that returns the target error information.

具体地,电子设备在获取到目标报错报文对应的目标错误信息之后,电子设备可以对目标错误信息进行读取并进行解析,从而确定目标报错报文对应的错误来源。Specifically, after the electronic device obtains the target error information corresponding to the target error message, the electronic device may read and parse the target error information to determine the error source corresponding to the target error message.

在本申请一种可选的实施方式中,目标报错报文对应的目标错误信息中可以包括目标报错报文对应的错误来源和错误原因。其中,错误来源用于表征返回目标错误信息的设备。In an optional implementation manner of the present application, the target error information corresponding to the target error message may include the error source and error cause corresponding to the target error message, wherein the error source is used to characterize the device that returns the target error information.

示例性的,假设电子设备将目标报错报文发送给设备D,需要经过设备A、B、C,当电子设备将目标报错报文发送给设备A之后,发送成功,但是当设备A将目标报错报文转发给设备B时,目标报错报文发送失败。因此,设备B会向设备A返回目标报文信息对应的目标错误信息,设备B再次将目标报文信息对应的目标错误信息返回给电子设备,此时,目标错误信息中包括的错误来源用于表征设备B向电子设备返回的目标错误信息。For example, suppose that the electronic device sends a target error message to device D, which needs to pass through devices A, B, and C. After the electronic device sends the target error message to device A, the sending is successful, but when device A forwards the target error message to device B, the target error message fails to be sent. Therefore, device B returns the target error information corresponding to the target message information to device A, and device B returns the target error information corresponding to the target message information to the electronic device again. At this time, the error source included in the target error information is used to characterize the target error information returned by device B to the electronic device.

示例性的,假设目标错误信息中包括错误原因和错误来源。示例性的,错误原因可以包括网络错误、参数错误、资源不足等,错误来源可以是存储资源A有故障、网关资源B、集群C等。当错误原因和错误来源两者结合后,目标错误信息就可以呈现以下的效果:xxyyyy。是举个例子:目标错误信息为01000A,其中01表示错误来源,例如存储集群A,网关B等等。这一项内容,来至于CSI自身识别到的错误来源而决定。因为CSI是直接对接后端存储的,所以从CSI自身可以明确设定出01表示哪一个来源。只要保证同一个来源是同一个错误码即可。而000A表示具体的错误原原因,例如网络错误、参数错误等等。这一项内容,则由用户来进行配置。示例性的,错误码调用和配置的流程可以如下图3所示。具体地,SIDECAR向CIS下发请求,CIS转发请求到后端存储,后端存储向CIS返回错误,CIS根据错误,查询configmap,返回给SIDECAR。Exemplarily, it is assumed that the target error information includes the cause of the error and the source of the error. Exemplarily, the cause of the error may include network error, parameter error, insufficient resources, etc., and the source of the error may be a faulty storage resource A, gateway resource B, cluster C, etc. When the cause of the error and the source of the error are combined, the target error information can present the following effect: xxyyyy. For example: the target error information is 01000A, where 01 represents the source of the error, such as storage cluster A, gateway B, etc. This content is determined by the source of the error identified by the CSI itself. Because the CSI is directly connected to the backend storage, it can be clearly set from the CSI itself which source 01 represents. Just ensure that the same source is the same error code. And 000A represents the specific cause of the error, such as a network error, parameter error, etc. This content is configured by the user. Exemplarily, the process of error code calling and configuration can be shown in Figure 3 below. Specifically, SIDECAR sends a request to CIS, CIS forwards the request to the backend storage, the backend storage returns an error to CIS, and CIS queries the configmap based on the error and returns it to SIDECAR.

S13、根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文。S13. According to the error source, determine other error messages having the same error source as the target error message.

具体地,电子设备在确定了目标报错报文对应的错误来源,可以根据错误来源与存储空间之间的对应关系,确定目标报错报文对应的存储空间,将目标报错报文对应的目标错误信息,存储至对应的存储空间。然后,在存储空间中确定与目标报错报文对应的错误来源相同的其他报错报文。Specifically, after determining the error source corresponding to the target error message, the electronic device can determine the storage space corresponding to the target error message according to the corresponding relationship between the error source and the storage space, and store the target error information corresponding to the target error message in the corresponding storage space. Then, other error messages with the same error source as the target error message are determined in the storage space.

其中,其他报错报文的数量可以是1个、2个和多个,电子设备对其他报错报文的数量不做具体限定。Among them, the number of other error messages can be 1, 2 or more, and the electronic device does not specifically limit the number of other error messages.

S14、根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。S14. According to the relationship between the target error message and other error messages, the target error message is resent, and before the target error message is successfully sent, resending of other error messages is prohibited.

在本申请一种可选的实施方式中,电子设备可以基于预设方法计算目标报错报文对应的发送时间,在确定目标报错报文对应的发送时间之后,在发送时间对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。In an optional implementation of the present application, the electronic device can calculate the sending time corresponding to the target error message based on a preset method, and after determining the sending time corresponding to the target error message, resend the target error message at the sending time, and prohibit resending other error messages before the target error message is successfully sent.

本发明实施例提供的报错报文重试方法,获取目标报错报文对应的目标错误信息,然后,对目标错误信息进行解析,确定目标报错报文对应的错误来源,保证了确定的目标报错报文对应的错误来源的准确性。根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文,保证了确定的与目标报错报文对应的错误来源相同的其他报错报文的准确性。根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。上述方法,不需要重新发送大量的错误报文,大量错误报文的不断发送占用计算机设备大量的CPU资源,增加计算机设备的负担。因此,减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry method provided by the embodiment of the present invention obtains the target error information corresponding to the target error message, and then parses the target error information to determine the error source corresponding to the target error message, thereby ensuring the accuracy of the error source corresponding to the determined target error message. According to the error source, other error messages with the same error source as the target error message corresponding to the target error message are determined, thereby ensuring the accuracy of other error messages with the same error source as the target error message corresponding to the determined target error message. According to the relationship between the target error message and other error messages, the target error message is resent, and resending of other error messages is prohibited before the target error message is successfully sent. The above method does not need to resend a large number of error messages. The continuous sending of a large number of error messages occupies a large amount of CPU resources of the computer device and increases the burden of the computer device. Therefore, the number of error messages that need to be resent is reduced, the CPU resources of the computer device occupied are reduced, and the burden of the computer device is alleviated.

在本申请一个实施例中,如图4所示,提供了一种报错报文重试方法,以该方法应用于电子设备为例进行说明,包括以下步骤:In one embodiment of the present application, as shown in FIG4 , a method for retrying an error message is provided, which is described by taking the method applied to an electronic device as an example, and includes the following steps:

S21、获取目标报错报文对应的目标错误信息。S21. Obtain target error information corresponding to the target error message.

关于该步骤请参见图2对S11的介绍,在此不进行赘述。For this step, please refer to the introduction of S11 in FIG. 2 , which will not be described in detail here.

S22、对目标错误信息进行解析,确定目标报错报文对应的错误来源。S22. Analyze the target error information to determine the error source corresponding to the target error message.

关于该步骤请参见图2对S12的介绍,在此不进行赘述。For this step, please refer to the introduction of S12 in FIG. 2 , which will not be described in detail here.

S23、根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文。S23. Determine, according to the error source, other error messages having the same error source as that corresponding to the target error message.

关于该步骤请参见图2对S13的介绍,在此不进行赘述。For this step, please refer to the introduction of S13 in FIG. 2 , which will not be described in detail here.

S24、根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。S24. According to the relationship between the target error message and other error messages, the target error message is resent, and before the target error message is successfully sent, resending of other error messages is prohibited.

在本申请一种可选的实施方式中,上述S24“根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送”,可以包括如下步骤:In an optional implementation manner of the present application, the above S24 "retransmitting the target error message according to the relationship between the target error message and other error messages, and prohibiting retransmitting other error messages before the target error message is successfully sent" may include the following steps:

S241、对目标错误信息进行解析,确定目标报错报文对应的目标等待时间。S241. Analyze the target error information and determine the target waiting time corresponding to the target error message.

在本申请一种可选的实施方式中,电子设备在获取目标报错报文对应的目标错误信息之后,电子设备可以对目标错误信息进行读取并进行解析,确定目标报错报文对应的目标等待时间。In an optional implementation of the present application, after the electronic device obtains the target error information corresponding to the target error message, the electronic device may read and parse the target error information to determine the target waiting time corresponding to the target error message.

在本申请另一种可选的实施方式中,电子设备还可以将目标错误信息与预设错误信息表中的错误信息进行对比,根据对比结果,确定目标报错报文对应的目标等待时间。In another optional implementation of the present application, the electronic device may also compare the target error information with the error information in a preset error information table, and determine the target waiting time corresponding to the target error message according to the comparison result.

其中,预设错误信息表中可以包括各个报错报文对应的报错信息以及报错报文对应的等待时间。The preset error information table may include error information corresponding to each error message and a waiting time corresponding to the error message.

S242、获取其他报错报文对应的其他等待时间。S242. Obtain other waiting times corresponding to other error messages.

在本申请一种可选的实施方式中,电子设备可以接收其他设备发送的其他报错报文对应的其他等待时间,或者接收用户输入的其他报错报文对应的其他等待时间。In an optional implementation of the present application, the electronic device may receive other waiting times corresponding to other error messages sent by other devices, or receive other waiting times corresponding to other error messages input by the user.

在本申请另一种可选的实施方式中,电子设备可以获取其他报错报文对应的其他错误信息,并将其他错误信息与预设错误信息表中的错误信息进行对比,根据对比结果,确定其他报错报文对应的其他等待时间。In another optional implementation of the present application, the electronic device can obtain other error information corresponding to other error messages, and compare the other error information with the error information in a preset error information table, and determine other waiting times corresponding to other error messages based on the comparison results.

其中,预设错误信息表中可以包括各个报错报文对应的报错信息以及报错报文对应的等待时间。The preset error information table may include error information corresponding to each error message and a waiting time corresponding to the error message.

S243、根据目标等待时间与其他等待时间之间的关系,确定目标报错报文对应的候选重试时间。S243. Determine a candidate retry time corresponding to the target error message according to the relationship between the target waiting time and other waiting times.

在本申请一种可选的实施方式中,电子设备在获取到目标报错报文对应的目标等待时间以及其他报错报文对应的其他等待时间之后,电子设备可以将目标等待时间与其他等待时间进行对比,从目标等待时间与其他等待时间中确定最大时间为目标报错报文对应的候选重试时间。In an optional implementation of the present application, after the electronic device obtains the target waiting time corresponding to the target error message and other waiting times corresponding to other error messages, the electronic device can compare the target waiting time with the other waiting times, and determine the maximum time from the target waiting time and the other waiting times as the candidate retry time corresponding to the target error message.

在本申请另一种可选的实施方式中,上述S243“根据目标等待时间与其他等待时间之间的关系,确定目标报错报文对应的候选重试时间”,可以包括如下步骤:In another optional implementation of the present application, the above S243 "determining the candidate retry time corresponding to the target error message according to the relationship between the target waiting time and other waiting times" may include the following steps:

(1)对目标错误信息进行解析,确定目标报错报文对应的第一权重信息。(1) Analyze the target error information to determine the first weight information corresponding to the target error message.

在本申请一种可选的实施方式中,电子设备还可以将目标错误信息与预设错误信息表中的错误信息进行对比,根据对比结果,确定目标报错报文对应的第一权重信息。In an optional implementation of the present application, the electronic device may also compare the target error information with the error information in a preset error information table, and determine the first weight information corresponding to the target error message according to the comparison result.

其中,预设错误信息表中可以包括各个报错报文对应的报错信息以及报错报文对应的权重信息。The preset error information table may include error information corresponding to each error message and weight information corresponding to the error message.

在本申请另一种可选的实施方式中,电子设备还可以接收其他设备发送的目标报错报文对应的第一权重信息,或者接收用户输入的目标报错报文对应的第一权重信息。In another optional implementation of the present application, the electronic device may also receive first weight information corresponding to a target error message sent by other devices, or receive first weight information corresponding to a target error message input by a user.

(2)获取其他报错报文对应的第二权重信息。(2) Obtain the second weight information corresponding to other error messages.

在本申请一种可选的实施方式中,电子设备还可以接收其他设备发送的其他报错报文对应的第二权重信息,或者接收用户输入的其他报错报文对应的第二权重信息。In an optional implementation of the present application, the electronic device may also receive second weight information corresponding to other error messages sent by other devices, or receive second weight information corresponding to other error messages input by a user.

在本申请另一种可选的实施方式中,电子设备可以获取其他报错报文对应的其他错误信息,并将其他错误信息与预设错误信息表中的错误信息进行对比,根据对比结果,确定其他报错报文对应的第二权重信息。In another optional implementation of the present application, the electronic device can obtain other error information corresponding to other error messages, and compare the other error information with the error information in a preset error information table, and determine the second weight information corresponding to the other error messages based on the comparison result.

其中,预设错误信息表中可以包括各个报错报文对应的报错信息以及报错报文对应的权重信息。The preset error information table may include error information corresponding to each error message and weight information corresponding to the error message.

(3)基于第一权重信息、第二权重信息、目标等待时间以及其他等待时间之间的关系,确定目标报错报文对应的候选重试时间。(3) Based on the relationship between the first weight information, the second weight information, the target waiting time and other waiting times, determine the candidate retry time corresponding to the target error message.

在本申请一种可选的实施方式中,电子设备可以将第一权重信息乘以目标等待时间的积加上第二权重信息乘以其他等待时间的积进行相加,得到目标报错报文对应的候选重试时间。In an optional implementation of the present application, the electronic device may add the product of the first weight information multiplied by the target waiting time and the product of the second weight information multiplied by other waiting times to obtain a candidate retry time corresponding to the target error message.

在本申请另一种可选的实施方式中,上述步骤(3)“基于第一权重信息、第二权重信息、目标等待时间以及其他等待时间之间的关系,确定目标报错报文对应的候选重试时间”,可以包括如下步骤:In another optional implementation of the present application, the above step (3) "determining the candidate retry time corresponding to the target error message based on the relationship between the first weight information, the second weight information, the target waiting time and other waiting times" may include the following steps:

(31)利用第一权重信息除以第一权重信息与第二权重信息的和,得到目标报错报文对应的目标权重信息;(31) Dividing the first weight information by the sum of the first weight information and the second weight information to obtain target weight information corresponding to the target error message;

(32)利用第二权重信息除以第一权重信息与第二权重信息的和,得到其他报错报文对应的其他权重信息;(32) Dividing the second weight information by the sum of the first weight information and the second weight information to obtain other weight information corresponding to other error messages;

(33)将目标权重信息乘以目标等待时间的积加上其他权重信息乘以其他等待时间的积,计算得到目标报错报文对应的候选重试时间。(33) The product of the target weight information multiplied by the target waiting time is added to the product of other weight information multiplied by other waiting times to calculate the candidate retry time corresponding to the target error message.

具体地,电子设备可以利用第一权重信息除以第一权重信息与第二权重信息的和,得到目标报错报文对应的目标权重信息,并利用第二权重信息除以第一权重信息与第二权重信息的和,得到其他报错报文对应的其他权重信息。然后,电子设备将目标权重信息乘以目标等待时间的积加上其他权重信息乘以其他等待时间的积,计算得到目标报错报文对应的候选重试时间。Specifically, the electronic device can divide the first weight information by the sum of the first weight information and the second weight information to obtain the target weight information corresponding to the target error message, and divide the second weight information by the sum of the first weight information and the second weight information to obtain other weight information corresponding to other error messages. Then, the electronic device multiplies the product of the target weight information and the target waiting time by adding the product of the other weight information and the other waiting time to calculate the candidate retry time corresponding to the target error message.

S244、根据候选重试时间,对目标报错报文进行重新发送。S244. Resend the target error message according to the candidate retry time.

在本申请一种可选的实施方式中,电子设备在确定了目标报错报文对应的候选重试时间之后,电子设备可以在重试时间之后,对目标报错报文进行重新发送。In an optional implementation of the present application, after the electronic device determines the candidate retry time corresponding to the target error message, the electronic device may resend the target error message after the retry time.

在本申请另一种可选的实施方式中,上述S244“根据候选重试时间,对目标报错报文进行重新发送”,可以包括如下步骤:In another optional implementation manner of the present application, the above S244 “re-sending the target error message according to the candidate retry time” may include the following steps:

(1)获取目标报错报文对应的发送次数。(1) Obtain the number of times the target error message is sent.

具体地,电子设备在确定目标报错报文对应的候选重试时间之后,电子设备可以根据对目标报错报文发送次数的记录,获取目标报错报文对应的发送次数。Specifically, after the electronic device determines the candidate retry time corresponding to the target error message, the electronic device may obtain the number of times the target error message is sent according to the record of the number of times the target error message is sent.

(2)利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间。(2) Using the exponential backoff algorithm, based on the number of times the target error message is sent, the candidate waiting time corresponding to the target error message is calculated.

具体地,电子设备在获取到目标报错报文对应的发送次数之后,电子设备可以利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间。Specifically, after obtaining the number of transmissions corresponding to the target error message, the electronic device may calculate the candidate waiting time corresponding to the target error message based on the number of transmissions corresponding to the target error message using an exponential backoff algorithm.

其中,退避算法就是网络上的节点在发送数据冲突后,等待一定时间后再发,等待时间是随指数增长,从而避免频繁的触发冲突。在计算机网络中,二进制指数退避算法或截断指数退避算法常常作为避免网络堵塞的一部分用于同一数据块的重发策略。发生n次冲突后,等待时间在0~2^n-1个间隙时间(slot times)之间选择随机选择。比如,发生第一次冲突后,每个发送方将会等待0或1个间隙时间(slot times);第二次冲突后,每个发送方的等待时间将会在0到3个间隙时间(slot times)之间任意选择;第三次冲突后,每个发送方的等待时间将会在0到7个间隙时间(slot times)之间任意选择,以此类推,随着冲突次数的增加,发送方的等待时间将会有成倍增加的可能性。而从“截断(truncated)”的是意思是指,到一定次数,指数运算会停止,也就是说等待时间不会再无限的增加下去。比如,设置上限n=10,则最长等待时间为1023个间隙时间。因为在等待时间内某些场景同样有冲突发生的可能性,所以一般流程会在16次重试后终止。具体的退避算法如下:Among them, the backoff algorithm is that after the nodes on the network send data conflicts, they wait for a certain time before sending again. The waiting time increases exponentially, so as to avoid frequent triggering conflicts. In computer networks, binary exponential backoff algorithm or truncated exponential backoff algorithm is often used as a part of the retransmission strategy of the same data block to avoid network congestion. After n conflicts occur, the waiting time is randomly selected between 0 and 2^n-1 slot times. For example, after the first conflict, each sender will wait for 0 or 1 slot times; after the second conflict, the waiting time of each sender will be arbitrarily selected between 0 and 3 slot times; after the third conflict, the waiting time of each sender will be arbitrarily selected between 0 and 7 slot times, and so on. As the number of conflicts increases, the waiting time of the sender will have the possibility of doubling. And the meaning of "truncated" is that after a certain number of times, the exponential operation will stop, that is, the waiting time will no longer increase indefinitely. For example, if the upper limit n is set to 10, the maximum waiting time is 1023 slot times. Because conflicts may occur in some scenarios during the waiting time, the general process will terminate after 16 retries. The specific backoff algorithm is as follows:

确定基本退避时间,它就是争用期(总线上的单程端到端传播时延记为x,以太网的端到端往返时间2x)。以太网把争用期定为51.2us。对于10Mb/s以太网,在争用期内可发送512bit,即64字节。也可以说争用期是512比特时间。1比特时间就是发送1比特所需要的时间。所以这种时间单位与数据率密切相关。Determine the basic backoff time, which is the contention period (the one-way end-to-end propagation delay on the bus is x, and the end-to-end round-trip time of Ethernet is 2x). Ethernet sets the contention period to 51.2us. For 10Mb/s Ethernet, 512 bits, or 64 bytes, can be sent during the contention period. It can also be said that the contention period is 512 bit times. 1 bit time is the time required to send 1 bit. Therefore, this time unit is closely related to the data rate.

从离散的整数集合[0,1,…,]中随机取出一个数,记为r。重传应推后的时间就是r倍的争用期。上面的参数k按下面的公式计算:k=Min[重传次数,10]可见当重传次数不超过10时,参数k等于重传次数;但当重传次数超过10时,k就不在增大而一直等于10。Randomly pick a number from the discrete integer set [0,1,…,] and record it as r. The time that retransmission should be postponed is r times the contention period. The above parameter k is calculated according to the following formula: k = Min [number of retransmissions, 10] It can be seen that when the number of retransmissions does not exceed 10, the parameter k is equal to the number of retransmissions; but when the number of retransmissions exceeds 10, k will no longer increase and will always be equal to 10.

当重传达16次仍不能成功时(这表明同时打算发送的数据站太多,以致连续发生冲突),则丢弃该,并向高层报告。例如,在第1次重传时,k=1,随机数r从整数{0,1}中选一个数。因此重传推迟的时间是0或争用期,在这两个时间中随机选择一个。若再发生碰撞,则重传时,k=2,随机数r就从整数{0,1,2,3}中选一个数。因此重传推迟的时间是在0,2x,4x和6x这4个时间中随机抽取一个。同样,若在发生碰撞,则重传时k=3,随机数r就从整数{0,1,2,3,4,5,6,7}中选一个数。以此类推。若连续多次发生冲突,就表明可能有较多的站参与争用信道。但使用退避算法可使重传需要推迟的平均时间随重传次数而增大(这也称为动态退避),因而减小发生碰撞的概率,有利于整个系统的稳定。When retransmission fails after 16 times (this indicates that there are too many stations that intend to send data at the same time, resulting in continuous collisions), the data is discarded and reported to the upper layer. For example, in the first retransmission, k = 1, and the random number r selects a number from the integers {0,1}. Therefore, the time for retransmission to be delayed is 0 or the contention period, and one of these two times is randomly selected. If a collision occurs again, k = 2 in the retransmission, and the random number r selects a number from the integers {0,1,2,3}. Therefore, the time for retransmission to be delayed is randomly selected from the four times of 0, 2x, 4x and 6x. Similarly, if a collision occurs, k = 3 in the retransmission, and the random number r selects a number from the integers {0,1,2,3,4,5,6,7}. And so on. If conflicts occur repeatedly, it means that there may be more stations participating in the contention channel. However, the use of the backoff algorithm can increase the average time required for retransmission to be delayed with the number of retransmissions (this is also called dynamic backoff), thereby reducing the probability of collisions and facilitating the stability of the entire system.

(3)将候选重试时间与候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间。(3) Compare the candidate retry time with the candidate waiting time, and determine the maximum value from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message.

具体地,电子设备在计算得到目标报错报文对应的候选等待时间之后,电子设备可以将候选重试时间与候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间。Specifically, after calculating the candidate waiting time corresponding to the target error message, the electronic device can compare the candidate retry time with the candidate waiting time, determine the maximum value from the candidate retry time and the candidate waiting time, and use it as the target retry time corresponding to the target error message.

(4)在目标重试时间之后,对目标报错报文进行重新发送。(4) After the target retry time, the target error message is resent.

具体地,电子设备在确定目标报错报文对应的目标重试时间之后,可以在目标重试时间之后,对目标报错报文进行重新发送。Specifically, after determining the target retry time corresponding to the target error message, the electronic device may resend the target error message after the target retry time.

在本申请一种可选的实施方式中,上述方法还可以包括如下步骤:In an optional implementation manner of the present application, the above method may further include the following steps:

(5)在对目标报错报文重新发送失败之后,再次计算目标报错报文对应的候选重试时间。(5) After the target error message fails to be resent, the candidate retry time corresponding to the target error message is calculated again.

(6)利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间。(6) Using the exponential backoff algorithm, based on the number of times the target error message is sent, the candidate waiting time corresponding to the target error message is calculated.

(7)将目标报错报文对应的候选重试时间与目标报错报文对应的候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间;(7) Compare the candidate retry time corresponding to the target error message with the candidate waiting time corresponding to the target error message, and determine the maximum value from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message;

(8)在目标重试时间之后,对目标报错报文进行重新发送。(8) After the target retry time, the target error message is resent.

具体地,当第一次在目标重试时间之后发送目标报错报文,且目标报错报文发送失败之后,电子设备需要再次计算目标报错报文对应的候选重试时间,并利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间。然后,电子设备将目标报错报文对应的候选重试时间与目标报错报文对应的候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间。在目标重试时间之后,对目标报错报文进行重新发送。其中,电子设备计算目标报错报文对应的候选重试时间以及候选等待时间的方式可以参见上文,再次不进行赘述。Specifically, when the target error message is sent for the first time after the target retry time, and the target error message fails to be sent, the electronic device needs to calculate the candidate retry time corresponding to the target error message again, and use the exponential backoff algorithm to calculate the candidate waiting time corresponding to the target error message based on the number of times the target error message is sent. Then, the electronic device compares the candidate retry time corresponding to the target error message with the candidate waiting time corresponding to the target error message, and determines the maximum value from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message. After the target retry time, the target error message is resent. Among them, the way in which the electronic device calculates the candidate retry time and the candidate waiting time corresponding to the target error message can be found above, and will not be repeated again.

本发明实施例提供的报错报文重试方法,对目标错误信息进行解析,确定目标报错报文对应的目标等待时间,保证了确定目标报错报文对应的目标等待时间的准确性。然后,对目标错误信息进行解析,确定目标报错报文对应的第一权重信息,保证了确定的目标报错报文对应的第一权重信息的准确性。获取其他报错报文对应的第二权重信息。然后,利用第一权重信息除以第一权重信息与第二权重信息的和,得到目标报错报文对应的目标权重信息,保证了得到的目标报错报文对应的目标权重信息的准确性。利用第二权重信息除以第一权重信息与第二权重信息的和,得到其他报错报文对应的其他权重信息,保证了计算得到的其他报错报文对应的其他权重信息的准确性,将目标权重信息乘以目标等待时间的积加上其他权重信息乘以其他等待时间的积,计算得到目标报错报文对应的候选重试时间,保证了计算得到的候选重试时间的准确性。在计算得到目标报错报文对应的候选重试时间之后,电子设备获取目标报错报文对应的发送次数,利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间,保证了计算得到的目标报错报文对应的候选等待时间的准确性。将候选重试时间与候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间,保证了确定的目标报错报文对应的目标重试时间的准确性。然后,在目标重试时间之后,对目标报错报文进行重新发送,保证了发送目标报错报文的时间间隔不会太长也不会太短,从而减少了需要重新发送的错误报文的数量,减少了占用的计算机设备的CPU资源,减轻了计算机设备的负担。The error message retry method provided by the embodiment of the present invention parses the target error information, determines the target waiting time corresponding to the target error message, and ensures the accuracy of the target waiting time corresponding to the target error message. Then, the target error information is parsed to determine the first weight information corresponding to the target error message, and the accuracy of the first weight information corresponding to the determined target error message is ensured. The second weight information corresponding to other error messages is obtained. Then, the first weight information is divided by the sum of the first weight information and the second weight information to obtain the target weight information corresponding to the target error message, and the accuracy of the target weight information corresponding to the obtained target error message is ensured. The second weight information is divided by the sum of the first weight information and the second weight information to obtain other weight information corresponding to other error messages, and the accuracy of the other weight information corresponding to the calculated other error messages is ensured. The product of the target weight information multiplied by the target waiting time is added to the product of the other weight information multiplied by the other waiting time, and the candidate retry time corresponding to the target error message is calculated, and the accuracy of the calculated candidate retry time is ensured. After calculating the candidate retry time corresponding to the target error message, the electronic device obtains the number of transmissions corresponding to the target error message, and uses the exponential backoff algorithm to calculate the candidate waiting time corresponding to the target error message based on the number of transmissions corresponding to the target error message, thereby ensuring the accuracy of the candidate waiting time corresponding to the calculated target error message. The candidate retry time is compared with the candidate waiting time, and the maximum value is determined from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message, thereby ensuring the accuracy of the target retry time corresponding to the determined target error message. Then, after the target retry time, the target error message is resent, thereby ensuring that the time interval for sending the target error message is neither too long nor too short, thereby reducing the number of error messages that need to be resent, reducing the CPU resources occupied by the computer device, and alleviating the burden on the computer device.

此外,在对目标报错报文重新发送失败之后,再次计算目标报错报文对应的候选重试时间,保证了计算得到的候选重试时间的准确性。然后,指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间,保证了计算得到的目标报错报文对应的候选等待时间的准确性。将目标报错报文对应的候选重试时间与目标报错报文对应的候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间,保证了确定的目标报错报文对应的目标重试时间的准确性。在目标重试时间之后,对目标报错报文进行重新发送,从而保证了可以对目标报错报文进行多次发送,且保证了发送目标报错报文的时间间隔不会太长也不会太短,从而减少了需要重新发送的错误报文的数量,减轻了计算机设备的负担。In addition, after the target error message fails to be resent, the candidate retry time corresponding to the target error message is calculated again, ensuring the accuracy of the calculated candidate retry time. Then, the exponential backoff algorithm calculates the candidate waiting time corresponding to the target error message based on the number of times the target error message is sent, ensuring the accuracy of the calculated candidate waiting time corresponding to the target error message. The candidate retry time corresponding to the target error message is compared with the candidate waiting time corresponding to the target error message, and the maximum value is determined from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message, ensuring the accuracy of the determined target retry time corresponding to the target error message. After the target retry time, the target error message is resent, thereby ensuring that the target error message can be sent multiple times, and ensuring that the time interval for sending the target error message is not too long or too short, thereby reducing the number of error messages that need to be resent and reducing the burden on computer equipment.

在本申请一个实施例中,如图5所示,提供了一种报错报文重试方法,以该方法应用于电子设备为例进行说明,包括以下步骤:In one embodiment of the present application, as shown in FIG5 , a method for retrying an error message is provided, and the method is described by taking the application of the method to an electronic device as an example, including the following steps:

S31、获取目标报错报文对应的目标错误信息。S31. Obtain target error information corresponding to the target error message.

关于该步骤请参见图4对S21的介绍,在此不进行赘述。For the description of this step, please refer to the description of S21 in FIG. 4 , which will not be described in detail here.

S32、对目标错误信息进行解析,确定目标报错报文对应的错误来源。S32: Analyze the target error information to determine the error source corresponding to the target error message.

关于该步骤请参见图4对S22的介绍,在此不进行赘述。For this step, please refer to the introduction of S22 in FIG. 4 , which will not be described in detail here.

S33、根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文。S33. According to the error source, determine other error messages having the same error source as the target error message.

关于该步骤请参见图4对S23的介绍,在此不进行赘述。For the description of this step, please refer to the description of S23 in FIG. 4 , which will not be described in detail here.

S34、根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。S34. According to the relationship between the target error message and other error messages, the target error message is resent, and before the target error message is successfully sent, resending of other error messages is prohibited.

关于该步骤请参见图4对S24的介绍,在此不进行赘述。For the description of this step, please refer to the description of S24 in FIG. 4 , which will not be described in detail here.

S35、获取其他报错报文对应的其他错误信息。S35. Obtain other error information corresponding to other error messages.

在本申请一种可选的实施方式中,电子设备可以接收其他设备发送的其他报错报文对应的其他错误信息,或者接收其他设备发送的其他报错报文对应的其他错误信息。In an optional implementation of the present application, the electronic device may receive other error information corresponding to other error messages sent by other devices, or receive other error information corresponding to other error messages sent by other devices.

在本申请另一种可选的实施方式中,电子设备还可以根据对报错报文进行记录的结果,其他报错报文对应的其他错误信息。In another optional implementation of the present application, the electronic device may also obtain other error information corresponding to other error messages based on the result of recording the error message.

S36、将其他错误信息和目标错误信息存储至同一存储空间。S36. Store other error information and target error information in the same storage space.

具体地,在确定了目标报错报文对应的目标错误信息以及其他报错报文对应的其他报错信息之后,电子设备可以将其他错误信息和目标错误信息存储至同一存储空间。Specifically, after determining the target error information corresponding to the target error message and other error information corresponding to other error messages, the electronic device may store the other error information and the target error information in the same storage space.

示例性的,电子设备可以将其他错误信息和目标错误信息放入到不同的错误池中。不同池里的错误原因可以相同,因为他们的错误来源不同。示例性的,如图6所示,电子设备根据报错报文对应的错误来源进行分类,分为错误来源1、错误来源2以及错误来源3,其中,错误来源1中可以包括同属于错误来源1的目标错误信息以及其他错误信息。其中,目标错误信息以及其他错误信息对应的错误来源相同,但是错误原因可以相同也可以不同。Exemplarily, the electronic device may put other error information and target error information into different error pools. The error causes in different pools may be the same because their error sources are different. Exemplarily, as shown in FIG6 , the electronic device is classified according to the error source corresponding to the error message, into error source 1, error source 2, and error source 3, wherein error source 1 may include target error information and other error information belonging to error source 1. Among them, the error sources corresponding to the target error information and other error information are the same, but the error causes may be the same or different.

S37、在目标报错报文发送成功后,从存储空间中删除其他错误信息,并重新发送其他报错报文。S37. After the target error message is sent successfully, other error information is deleted from the storage space, and other error messages are resent.

具体地,电子设备在将目标报错报文发送成功之后,电子设备确定该目标报错报文对应的错误来源问题已经解决,因此,电子设备可以从存储空间中删除其他错误信息,并重新发送其他报错报文。Specifically, after the electronic device successfully sends the target error message, the electronic device determines that the error source problem corresponding to the target error message has been resolved. Therefore, the electronic device can delete other error information from the storage space and resend other error messages.

本发明实施例提供的报错报文重试方法,获取其他报错报文对应的其他错误信息;将其他错误信息和目标错误信息存储至同一存储空间,可以保证电子设备可以对目标报错报文以及其他报错报文进行更新和记录,在目标报错报文发送成功后,电子设备确定从电子设备到目标报错报文对应的错误来源设备之间的通信链路正常。电子设备不需要在记录目标报错报文和其他报错报文,因此,从存储空间中删除其他错误信息,并重新发送其他报错报文,保证了目标报错报文和其他报错报文均可以正常发送。The error message retry method provided in the embodiment of the present invention obtains other error information corresponding to other error messages; stores other error information and target error information in the same storage space, which can ensure that the electronic device can update and record the target error message and other error messages. After the target error message is successfully sent, the electronic device determines that the communication link from the electronic device to the error source device corresponding to the target error message is normal. The electronic device does not need to record the target error message and other error messages, so it deletes other error information from the storage space and resends other error messages, ensuring that the target error message and other error messages can be sent normally.

应该理解的是,虽然图2、图4以及图5的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2、图4以及图5中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowcharts of Fig. 2, Fig. 4 and Fig. 5 are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in Fig. 2, Fig. 4 and Fig. 5 may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

如图7所示,本实施例提供一种报错报文重试装置,包括:As shown in FIG. 7 , this embodiment provides an error message retry device, including:

第一获取模块41,用于获取目标报错报文对应的目标错误信息;A first acquisition module 41 is used to acquire target error information corresponding to the target error message;

第一确定模块42,用于对目标错误信息进行解析,确定目标报错报文对应的错误来源;其中,所述错误来源用于表征返回所述目标错误信息的设备;A first determination module 42 is used to parse the target error information and determine the error source corresponding to the target error message; wherein the error source is used to characterize the device that returns the target error information;

第二确定模块43,用于根据错误来源,确定与目标报错报文对应的错误来源相同的其他报错报文;A second determination module 43 is used to determine other error messages having the same error source as the target error message according to the error source;

发送模块44,用于根据目标报错报文与其他报错报文之间的关系,对目标报错报文进行重新发送,并在目标报错报文发送成功之前禁止对其他报错报文进行重新发送。The sending module 44 is used to resend the target error message according to the relationship between the target error message and other error messages, and prohibit resending other error messages before the target error message is successfully sent.

在本申请一个实施例中,上述发送模块44,具体用于对目标错误信息进行解析,确定目标报错报文对应的目标等待时间;获取其他报错报文对应的其他等待时间;根据目标等待时间与其他等待时间之间的关系,确定目标报错报文对应的候选重试时间;根据候选重试时间,对目标报错报文进行重新发送。In one embodiment of the present application, the above-mentioned sending module 44 is specifically used to parse the target error information, determine the target waiting time corresponding to the target error message; obtain other waiting times corresponding to other error messages; determine the candidate retry time corresponding to the target error message based on the relationship between the target waiting time and other waiting times; and resend the target error message based on the candidate retry time.

在本申请一个实施例中,上述发送模块44,具体用于对目标错误信息进行解析,确定目标报错报文对应的第一权重信息;获取其他报错报文对应的第二权重信息;基于第一权重信息、第二权重信息、目标等待时间以及其他等待时间之间的关系,确定目标报错报文对应的候选重试时间。In one embodiment of the present application, the above-mentioned sending module 44 is specifically used to parse the target error information, determine the first weight information corresponding to the target error message; obtain the second weight information corresponding to other error messages; based on the relationship between the first weight information, the second weight information, the target waiting time and other waiting times, determine the candidate retry time corresponding to the target error message.

在本申请一个实施例中,上述发送模块44,具体用于利用第一权重信息除以第一权重信息与第二权重信息的和,得到目标报错报文对应的目标权重信息;利用第二权重信息除以第一权重信息与第二权重信息的和,得到其他报错报文对应的其他权重信息;将目标权重信息乘以目标等待时间的积加上其他权重信息乘以其他等待时间的积,计算得到目标报错报文对应的候选重试时间。In one embodiment of the present application, the above-mentioned sending module 44 is specifically used to obtain the target weight information corresponding to the target error message by dividing the first weight information by the sum of the first weight information and the second weight information; obtain other weight information corresponding to other error messages by dividing the second weight information by the sum of the first weight information and the second weight information; and calculate the candidate retry time corresponding to the target error message by adding the product of the target weight information multiplied by the target waiting time and the product of the other weight information multiplied by the other waiting time.

在本申请一个实施例中,上述发送模块44,具体用于获取目标报错报文对应的发送次数;利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间;将候选重试时间与候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间;在目标重试时间之后,对目标报错报文进行重新发送。In one embodiment of the present application, the above-mentioned sending module 44 is specifically used to obtain the number of sending times corresponding to the target error message; use the exponential backoff algorithm to calculate the candidate waiting time corresponding to the target error message based on the number of sending times corresponding to the target error message; compare the candidate retry time with the candidate waiting time, and determine the maximum value from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message; after the target retry time, resend the target error message.

在本申请一个实施例中,上述发送模块44,具体用于在对目标报错报文重新发送失败之后,再次计算目标报错报文对应的候选重试时间;利用指数退避算法,基于目标报错报文对应的发送次数,计算目标报错报文对应的候选等待时间;目标报错报文对应的候选重试时间与目标报错报文对应的候选等待时间进行对比,从候选重试时间和候选等待时间中确定最大值,为目标报错报文对应的目标重试时间;在目标重试时间之后,对目标报错报文进行重新发送。In one embodiment of the present application, the above-mentioned sending module 44 is specifically used to recalculate the candidate retry time corresponding to the target error message after the resending of the target error message fails; use the exponential backoff algorithm to calculate the candidate waiting time corresponding to the target error message based on the number of times the target error message is sent; the candidate retry time corresponding to the target error message is compared with the candidate waiting time corresponding to the target error message, and the maximum value is determined from the candidate retry time and the candidate waiting time, which is the target retry time corresponding to the target error message; after the target retry time, the target error message is resent.

在本申请一个实施例中,如图8所示,上述报错报文重试装置,还可以包括如下步骤:In one embodiment of the present application, as shown in FIG8 , the above-mentioned error message retry device may further include the following steps:

第二获取模块45,用于获取其他报错报文对应的其他错误信息;The second acquisition module 45 is used to obtain other error information corresponding to other error messages;

存储模块46,用于将其他错误信息和目标错误信息存储至同一存储空间;A storage module 46, used for storing other error information and target error information in the same storage space;

删除模块47,用于在目标报错报文发送成功后,从存储空间中删除其他错误信息,并重新发送其他报错报文。The deletion module 47 is used to delete other error information from the storage space and resend other error messages after the target error message is sent successfully.

关于报错报文重试装置的具体限定以及有益效果可以参见上文中对于报错报文重试方法的限定,在此不再赘述。上述报错报文重试装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitations and beneficial effects of the error message retry device, please refer to the limitations of the error message retry method above, which will not be repeated here. Each module in the above-mentioned error message retry device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

本发明实施例还提供一种电子设备,具有上述图7或/和图8所示的报错报文重试装置。An embodiment of the present invention further provides an electronic device having the error message retry device shown in FIG. 7 or/and FIG. 8 above.

如图9所示,图9是本发明可选实施例提供的一种电子设备的结构示意图,如图9所示,该电子设备可以包括:至少一个处理器51,例如CPU(Central Processing Unit,中央处理器),至少一个通信接口53,存储器54,至少一个通信总线52。其中,通信总线52用于实现这些组件之间的连接通信。其中,通信接口53可以包括显示屏(Display)、键盘(Keyboard),可选通信接口53还可以包括标准的有线接口、无线接口。存储器54可以是高速RAM存储器(Random Access Memory,易挥发性随机存取存储器),也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器54可选的还可以是至少一个位于远离前述处理器51的存储装置。其中处理器51可以结合图7或图8所描述的装置,存储器54中存储应用程序,且处理器51调用存储器54中存储的程序代码,以用于执行上述任一方法步骤。As shown in FIG. 9 , FIG. 9 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention. As shown in FIG. 9 , the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, a memory 54, and at least one communication bus 52. Among them, the communication bus 52 is used to realize the connection and communication between these components. Among them, the communication interface 53 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a wireless interface. The memory 54 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 54 may also be at least one storage device located away from the aforementioned processor 51. Among them, the processor 51 may be combined with the device described in FIG. 7 or FIG. 8, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 to perform any of the above method steps.

其中,通信总线52可以是外设部件互连标准(peripheral componentinterconnect,简称PCI)总线或扩展工业标准结构(extended industry standardarchitecture,简称EISA)总线等。通信总线52可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus 52 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 52 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, FIG9 only uses one thick line to represent, but does not mean that there is only one bus or one type of bus.

其中,存储器54可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器也可以包括非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(英文:hard diskdrive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器54还可以包括上述种类的存储器的组合。Among them, the memory 54 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 54 may also include a combination of the above types of memory.

其中,处理器51可以是中央处理器(英文:central processing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。The processor 51 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.

其中,处理器51还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic arraylogic,缩写:GAL)或其任意组合。The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

可选地,存储器54还用于存储程序指令。处理器51可以调用程序指令,实现如本申请图2、图4以及图5实施例中所示的报错报文重试方法。Optionally, the memory 54 is also used to store program instructions. The processor 51 can call the program instructions to implement the error message retry method shown in the embodiments of FIG. 2, FIG. 4 and FIG. 5 of the present application.

本发明实施例还提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的报错报文重试方法。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(Flash Memory)、硬盘(Hard DiskDrive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;所述存储介质还可以包括上述种类的存储器的组合。The embodiment of the present invention also provides a non-transitory computer storage medium, which stores computer executable instructions, and the computer executable instructions can execute the error message retry method in any of the above method embodiments. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.

虽然结合附图描述了本发明的实施例,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims (8)

1. The method for retrying the error message is characterized by comprising the following steps of:
Acquiring target error information corresponding to the target error message;
Analyzing the target error information and determining an error source corresponding to the target error message; wherein the error source is used to characterize the device that returned the target error information;
Determining other error messages with the same error sources corresponding to the target error message according to the error sources;
Retransmitting the target error message according to the relation between the target error message and the other error messages, and prohibiting retransmitting the other error messages before the target error message is successfully transmitted;
wherein, the retransmitting the target error message according to the relation between the target error message and the other error messages includes:
analyzing the target error information and determining target waiting time corresponding to the target error message;
Acquiring other waiting time corresponding to the other error message;
According to the relation between the target waiting time and the other waiting time, determining candidate retry time corresponding to the target error message;
Retransmitting the target error message according to the candidate retry time;
wherein, the retransmitting the target error message according to the candidate retry time includes:
Acquiring the number of times of transmission corresponding to the target error message;
Calculating candidate waiting time corresponding to the target error message based on the sending times corresponding to the target error message by using an exponential backoff algorithm;
Comparing the candidate retry time with the candidate waiting time, and determining the maximum value from the candidate retry time and the candidate waiting time as the target retry time corresponding to the target error message;
and retransmitting the target error message after the target retry time.
2. The method according to claim 1, wherein the determining the candidate retry time corresponding to the target error message according to the relationship between the target wait time and the other wait time includes:
Analyzing the target error information and determining first weight information corresponding to the target error message;
acquiring second weight information corresponding to the other error message;
and determining candidate retry time corresponding to the target error message based on the relation among the first weight information, the second weight information, the target waiting time and the other waiting time.
3. The method of claim 2, wherein the determining the candidate retry time for the target error message based on the relationship between the first weight information, the second weight information, the target wait time, and the other wait time comprises:
Dividing the first weight information by the sum of the first weight information and the second weight information to obtain target weight information corresponding to the target error message;
Dividing the second weight information by the sum of the first weight information and the second weight information to obtain other weight information corresponding to the other error message;
and multiplying the product of the target weight information and the target waiting time by the product of the other weight information and the other waiting time, and calculating to obtain the candidate retry time corresponding to the target error message.
4. The method according to claim 1, wherein the method further comprises:
after the retransmission of the target error message fails, calculating candidate retry time corresponding to the target error message again;
Calculating candidate waiting time corresponding to the target error message based on the sending times corresponding to the target error message by using an exponential backoff algorithm;
Comparing the candidate retry time corresponding to the target error message with the candidate waiting time corresponding to the target error message, and determining the maximum value from the candidate retry time and the candidate waiting time to be the target retry time corresponding to the target error message;
and retransmitting the target error message after the target retry time.
5. The method according to claim 1, wherein the method further comprises:
acquiring other error information corresponding to the other error message;
storing the other error information and the target error information into the same storage space;
and deleting the other error information from the storage space after the target error message is successfully sent, and resending the other error message.
6. An error message retry apparatus, comprising:
The first acquisition module is used for acquiring target error information corresponding to the target error message;
The first determining module is used for analyzing the target error information and determining an error source corresponding to the target error message; wherein the error source is used to characterize the device that returned the target error information;
The second determining module is used for determining other error messages with the same error sources as the target error message according to the error sources;
The sending module is used for resending the target error message according to the relation between the target error message and the other error messages and prohibiting resending the other error messages before the target error message is sent successfully; wherein, the retransmitting the target error message according to the relation between the target error message and the other error messages includes: analyzing the target error information and determining target waiting time corresponding to the target error message;
Acquiring other waiting time corresponding to the other error message; according to the relation between the target waiting time and the other waiting time, determining candidate retry time corresponding to the target error message; retransmitting the target error message according to the candidate retry time; wherein, the retransmitting the target error message according to the candidate retry time includes: acquiring the number of times of transmission corresponding to the target error message; calculating candidate waiting time corresponding to the target error message based on the sending times corresponding to the target error message by using an exponential backoff algorithm; comparing the candidate retry time with the candidate waiting time, and determining the maximum value from the candidate retry time and the candidate waiting time as the target retry time corresponding to the target error message; and retransmitting the target error message after the target retry time.
7. An electronic device comprising a memory having stored therein computer instructions and a processor that, upon execution of the computer instructions, performs the method of error message retry of any of claims 1-5.
8. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform the error message retry method of any one of claims 1-5.
CN202210913934.9A 2022-07-29 2022-07-29 Error message retry method and device, electronic equipment and storage medium Active CN115484004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210913934.9A CN115484004B (en) 2022-07-29 2022-07-29 Error message retry method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210913934.9A CN115484004B (en) 2022-07-29 2022-07-29 Error message retry method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115484004A CN115484004A (en) 2022-12-16
CN115484004B true CN115484004B (en) 2024-07-09

Family

ID=84423240

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210913934.9A Active CN115484004B (en) 2022-07-29 2022-07-29 Error message retry method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115484004B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5388254A (en) * 1992-03-27 1995-02-07 International Business Machines Corporation Method and means for limiting duration of input/output (I/O) requests
CN1881863A (en) * 2005-06-13 2006-12-20 中兴通讯股份有限公司 Apparatus and method for confirming re-transmission policy in arrangement

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7185221B1 (en) * 2002-07-01 2007-02-27 Cisco Technologies, Inc. Method and system for signaling a system fault
CN101572584B (en) * 2008-04-30 2012-01-04 华为技术有限公司 Error detection method, equipment and system for message

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5388254A (en) * 1992-03-27 1995-02-07 International Business Machines Corporation Method and means for limiting duration of input/output (I/O) requests
CN1881863A (en) * 2005-06-13 2006-12-20 中兴通讯股份有限公司 Apparatus and method for confirming re-transmission policy in arrangement

Also Published As

Publication number Publication date
CN115484004A (en) 2022-12-16

Similar Documents

Publication Publication Date Title
CN106850402B (en) Message transmission method and device
CN110659151B (en) Data verification method and device and storage medium
CN109451032B (en) Message transmission system
CN110430135B (en) Message processing method and device
CN105103500A (en) Communication method, communication device and communication program
JP2019106697A (en) Method for dynamically managing message retransmission delay in interconnection network and device
CN111404872A (en) Message processing method, device and system
CN109525376B (en) Fast retransmission method and device and terminal equipment
CN111224756A (en) Method and device for determining data transmission abnormity, storage medium and electronic equipment
US10469328B2 (en) Opportunistic forwarding method of using delay tolerant network for content-based information centric network and apparatus for performing the method
CN113259490B (en) Multi-level node network data transmission method based on UDP transmission protocol
CN115484004B (en) Error message retry method and device, electronic equipment and storage medium
US10951732B2 (en) Service processing method and device
CN109428684B (en) A data transmission method, RLC entity and PDCP entity
CN111132231B (en) A kind of data transmission method, device, terminal and medium of polarized time slot ALOHA
CN109660589B (en) Request processing method and device and electronic equipment
CN117040692A (en) Method and device for transmitting service data, electronic equipment and storage medium
CN111385069A (en) Data transmission method and computer equipment
CN115344405A (en) Data processing method, network interface card, electronic equipment and storage medium
CN116074274A (en) Message receiving optimization method and device, electronic equipment and storage medium
CN110784518A (en) Static resource acquisition method and device
CN112860449A (en) Method, system, equipment and medium for preventing restart caused by message overtime
CN111913911A (en) Service data forwarding method and server
CN110971535A (en) Communication congestion control method, device, equipment and storage medium
CN113364880B (en) Information exchange method, system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant