CN114337935A - Message retransmission strategy determining method and device and electronic equipment - Google Patents

Message retransmission strategy determining method and device and electronic equipment Download PDF

Info

Publication number
CN114337935A
CN114337935A CN202111595123.0A CN202111595123A CN114337935A CN 114337935 A CN114337935 A CN 114337935A CN 202111595123 A CN202111595123 A CN 202111595123A CN 114337935 A CN114337935 A CN 114337935A
Authority
CN
China
Prior art keywords
target
weight
message
preset
retransmission
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.)
Granted
Application number
CN202111595123.0A
Other languages
Chinese (zh)
Other versions
CN114337935B (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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System 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 Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN202111595123.0A priority Critical patent/CN114337935B/en
Publication of CN114337935A publication Critical patent/CN114337935A/en
Application granted granted Critical
Publication of CN114337935B publication Critical patent/CN114337935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The embodiment of the invention provides a method and a device for determining a message retransmission strategy and electronic equipment, and relates to the technical field of data transmission. The method comprises the following steps: determining state change information of target equipment for receiving a message to be retransmitted and the utilization rate of each equipment resource of the target equipment; calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment; and determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target running state weight and a preset weight range. Compared with the prior art, the scheme provided by the embodiment of the invention can determine the target message retransmission strategy according to the running state of the equipment for receiving the message retransmission, so as to avoid invalid message retransmission, further improve the message retransmission efficiency and reduce the waste of equipment resources.

Description

Message retransmission strategy determining method and device and electronic equipment
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a method and an apparatus for determining a message retransmission policy, and an electronic device.
Background
Currently, with the continuous development of computer technology, various application systems are widely applied to the work and life of users, for example, data storage systems, video monitoring systems, enterprise office systems, and the like.
Among them, the interaction between the devices of the same application system and the interaction between the devices of different application systems are usually performed in a message notification manner. And, the message notification transmitted may be: various types of information such as tasks to be processed and collected data information. In the process of message transmission, due to the problems of equipment failure, transmission link failure and the like, the message may be lost in the transmission process, so that the message cannot be timely and reliably sent to a message receiver, and further, the message needs to be retransmitted.
For example, in the field of Video monitoring, a SAC (Storage Access Component Storage Access framework) may Access various Storage devices such as a CVR (Central Video Recorder) and the like, and the SAC may issue a Video recording plan to the various Storage devices in a message notification manner to control the various Storage devices to perform monitoring Video acquisition according to information such as time included in the received Video recording plan. When the SAC issues the video recording plans to the various storage devices, the issue may fail due to problems such as device failure, and the SAC needs to retransmit the video recording plans to the storage devices that do not receive the video recording plans.
In the related art, the message retransmission method is generally as follows: a retransmission cycle and a retransmission time threshold value are preset, when the message retransmission is needed, the message retransmission is continuously carried out to the device for receiving the message to be retransmitted according to the retransmission cycle, and when the retransmission time reaches the retransmission time threshold value, the message retransmission is stopped.
However, in the above-described related art, the operation state of the device for receiving the message to be retransmitted is not considered when the message retransmission is performed, resulting in the possibility of performing invalid message retransmission a plurality of times, resulting in a reduction in message retransmission efficiency and a waste of device resources.
Disclosure of Invention
An object of embodiments of the present invention is to provide a method and an apparatus for determining a message retransmission policy, and an electronic device, so as to determine a message retransmission policy according to an operating state of a device receiving message retransmission, so as to avoid invalid message retransmission, further improve message retransmission efficiency, and reduce waste of device resources. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for determining a message retransmission policy, where the method includes:
determining state change information of target equipment for receiving a message to be retransmitted and the utilization rate of each equipment resource of the target equipment;
calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment;
and determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target running state weight and a preset weight range.
Optionally, in a specific implementation manner, the calculating a target operation state weight of the target device based on the state change information and the resource utilization rate of each device includes:
calculating a product of a weight factor corresponding to the state change information and a preset first influence factor as a first weight, and calculating a second weight based on a numerical relationship between the utilization rate of each equipment resource and a preset utilization rate threshold;
and calculating the target operation state weight of the target equipment by using the first weight and the second weight.
Optionally, in a specific implementation manner, the calculating a second weight based on a numerical relationship between the usage rate of each device resource and a preset usage rate threshold includes:
if the utilization rate of each equipment resource is not less than a preset utilization rate threshold, setting a designated mark as a first numerical value;
if the utilization rate of each equipment resource is not less than the preset utilization rate threshold, setting the designated mark as a second numerical value;
calculating a second weight based on the respective device resource usage rates multiplied by the first; wherein the first product is: the product of the specified mark and a preset weight parameter.
Optionally, in a specific implementation manner, the resource utilization rate of each device includes: a first type of usage rate of various hardware resources of the target device, and a second type of usage rate of task thread resources of the target device;
calculating a second weight based on the product of the resource utilization rate of each device and the first weight comprises:
respectively calculating first difference values of a preset first target utilization rate and each first type utilization rate, and calculating a first sum value of each obtained first difference value;
determining a first sub-weight based on the product of the first sum and a preset second influence factor;
calculating a second difference value between a preset second target utilization rate and a second type utilization rate, and determining a second sub-weight based on the product of the second difference value and a preset third influence factor;
and calculating a second sum of the first sub-weight and the second sub-weight, and calculating a difference between the second sum and the first product as a second weight.
Optionally, in a specific implementation manner, the calculating a target operation state weight of the target device by using the first weight and the second weight includes:
calculating a third sum of the first weight and the second weight as a target operation state weight of the target device; or,
and calculating the target operation state weight of the target equipment by using the first weight and the second weight based on preset configuration parameters.
Optionally, in a specific implementation manner, the determining a target message retransmission policy of the target device according to a numerical relationship between the target operating state weight and a preset weight range includes:
if the target operation state weight is smaller than the lower limit value of a preset weight range, determining that a target message retransmission strategy of the target device is as follows: not retransmitting;
if the target operation state weight belongs to the preset weight range, calculating the target retransmission time of the message to be retransmitted based on the retransmission times and the last transmission time of the message to be retransmitted; and determining that the target message retransmission policy of the target device is: retransmitting the message to be retransmitted to the target device at the retransmission time;
if the target running state weight is larger than the upper limit value of the preset weight range, determining that a target message retransmission strategy of the target device is as follows: and retransmitting the message to be retransmitted to the target equipment every other preset retransmission time length from the current moment until the target equipment successfully receives the target message, or the retransmission times reach a preset retransmission time threshold value.
Optionally, in a specific implementation manner, the calculating a target retransmission time of the target message based on the number of retransmissions of the message to be retransmitted and the last transmission time includes:
determining a target time interval corresponding to the retransmission times of the message to be retransmitted from a preset retransmission time interval sequence;
and determining the time which is after the last sending time of the message to be retransmitted and has the interval with the last sending time as the target time interval as the target retransmission time of the message to be retransmitted.
Optionally, in a specific implementation manner, the method further includes:
and under the condition that the weight of the target running state is not less than the lower limit value of the preset weight range, retransmitting the message to be retransmitted to the target equipment according to the target message retransmission strategy.
Optionally, in a specific implementation manner, the step of retransmitting the message to be retransmitted to the target device according to the target message retransmission policy includes:
sending the target message retransmission strategy to a preset priority queue; wherein, the target message retransmission strategy carries the target operation state weight;
executing the target message retransmission strategy according to the target sequence of the target running state weight; wherein the target ordering is: and when the running state weights carried by the message retransmission strategies in the priority queue are arranged in the descending order, the target running state weights are sequenced.
In a second aspect, an embodiment of the present invention provides an apparatus for determining a message retransmission policy, where the apparatus includes:
the information determining module is used for determining state change information of target equipment for receiving the message to be retransmitted and the utilization rate of each equipment resource of the target equipment;
the weight calculation module is used for calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment;
and the strategy determining module is used for determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target running state weight and a preset weight range.
Optionally, in a specific implementation manner, the weight calculating module includes:
the first weight calculation submodule is used for calculating the product of a weight factor corresponding to the state change information and a preset first influence factor as a first weight, and calculating a second weight based on the numerical relationship between the utilization rate of each equipment resource and a preset utilization rate threshold;
and the second weight calculation submodule is used for calculating the target operation state weight of the target equipment by using the first weight and the second weight.
Optionally, in a specific implementation manner, the first weight calculating sub-module includes:
a first value setting unit, configured to set a designation flag to a first value if there is a usage rate that is not less than a preset usage rate threshold in the usage rates of the device resources;
a second numerical value setting unit, configured to set the designation flag to a second numerical value if there is no usage rate that is not less than the preset usage rate threshold among the resource usage rates of the respective devices;
a weight calculation unit for calculating a second weight based on the respective device resource usage rates multiplied by the first; wherein the first product is: the product of the specified mark and a preset weight parameter.
Optionally, in a specific implementation manner, the resource utilization rate of each device includes: a first type of usage rate of various hardware resources of the target device, and a second type of usage rate of task thread resources of the target device; the weight calculation unit is specifically configured to:
respectively calculating first difference values of a preset first target utilization rate and each first type utilization rate, and calculating a first sum value of each obtained first difference value;
determining a first sub-weight based on the product of the first sum and a preset second influence factor;
calculating a second difference value between a preset second target utilization rate and a second type utilization rate, and determining a second sub-weight based on the product of the second difference value and a preset third influence factor;
and calculating a second sum of the first sub-weight and the second sub-weight, and calculating a difference between the second sum and the first product as a second weight.
Optionally, in a specific implementation manner, the second weight calculating sub-module is specifically configured to:
calculating a third sum of the first weight and the second weight as a target operation state weight of the target device; or,
and calculating the target operation state weight of the target equipment by using the first weight and the second weight based on preset configuration parameters.
Optionally, in a specific implementation manner, the policy determining module includes:
a first policy determining sub-module, configured to determine that the target message retransmission policy of the target device is: not retransmitting;
a second strategy determining submodule, configured to calculate a target retransmission time of the message to be retransmitted based on the retransmission times and the last transmission time of the message to be retransmitted if the target operation state weight belongs to the preset weight range; and determining that the target message retransmission policy of the target device is: retransmitting the message to be retransmitted to the target device at the retransmission time;
a third policy determining sub-module, configured to determine that the target message retransmission policy of the target device is: and retransmitting the message to be retransmitted to the target equipment every other preset retransmission time length from the current moment until the target equipment successfully receives the target message, or the retransmission times reach a preset retransmission time threshold value.
Optionally, in a specific implementation manner, the second policy determining sub-module is specifically configured to:
determining a target time interval corresponding to the retransmission times of the message to be retransmitted from a preset retransmission time interval sequence;
and determining the time which is after the last sending time of the message to be retransmitted and has the interval with the last sending time as the target time interval as the target retransmission time of the message to be retransmitted.
Optionally, in a specific implementation manner, the apparatus further includes:
and the message retransmission module is used for retransmitting the message to be retransmitted to the target equipment according to the target message retransmission strategy under the condition that the target operation state weight is not smaller than the lower limit value of the preset weight range.
Optionally, in a specific implementation manner, the message retransmission module is specifically configured to:
sending the target message retransmission strategy to a preset priority queue; wherein, the target message retransmission strategy carries the target operation state weight;
executing the target message retransmission strategy according to the target sequence of the target running state weight; wherein the target ordering is: and when the running state weights carried by the message retransmission strategies in the priority queue are arranged in the descending order, the target running state weights are sequenced.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of any one of the message retransmission policy determination methods provided in the first aspect when executing a program stored in a memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of any one of the message retransmission policy determination methods provided in the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any of the message retransmission policy determination methods provided in the first aspect.
The embodiment of the invention has the following beneficial effects:
as can be seen from the above, with the solution provided in the embodiment of the present invention, when a certain device does not receive a message and needs to retransmit the message to the device, the device may be determined as a target device for receiving the message to be retransmitted, and accordingly, the message that needs to be retransmitted is the message to be retransmitted.
After the target device is determined, state change information of the target device and the resource utilization rate of each device of the target device can be obtained firstly; then, the target operation state weight of the target device can be calculated based on the state change information and the resource utilization rate of each device. Then, a target message retransmission strategy of the target device can be determined according to the numerical relationship between the target operation state weight and the preset weight range. In this way, the action corresponding to the target message retransmission strategy and related to the message retransmission can be executed, and the message retransmission aiming at the target device can be completed.
Based on this, with the solution provided by the embodiment of the present invention, for the target device for receiving the message to be retransmitted, since the target message retransmission policy of the target device is determined based on the state change information of the target device and the resource utilization rate of each device, the operation state of the target device is fully considered when retransmitting the message. In this way, the determined target message retransmission policy can be changed along with the change of the operating state of the target device, so as to ensure that the determined target message retransmission policy can be always matched with the operating state of the target device, thereby enabling the action which is executed and corresponds to the target message retransmission policy and is related to message retransmission to always accord with the operating state of the target device, avoiding invalid message retransmission, improving message retransmission efficiency, and reducing waste of device resources. That is to say, by applying the scheme provided by the embodiment of the present invention, it is possible to determine a message retransmission policy according to the operating state of the device that receives the message retransmission, so as to avoid invalid message retransmission, further improve the message retransmission efficiency, and reduce the waste of device resources.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by referring to these drawings.
Fig. 1 is a flowchart illustrating a method for determining a message retransmission policy according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another method for determining a message retransmission policy according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another method for determining a message retransmission policy according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an embodiment of S102 in FIG. 1;
FIG. 5 is a schematic flow chart of another specific implementation of S102 in FIG. 1;
fig. 6 is a flowchart illustrating an implementation manner of S1022C in fig. 5;
fig. 7 is a schematic structural diagram of a message retransmission policy determining apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In the related art, the message retransmission method is generally as follows: a retransmission cycle and a retransmission time threshold value are preset, when the message retransmission is needed, the message retransmission is continuously carried out to the device for receiving the message to be retransmitted according to the retransmission cycle, and when the retransmission time reaches the retransmission time threshold value, the message retransmission is stopped. However, in the above-described related art, the operation state of the device for receiving the message to be retransmitted is not considered when the message retransmission is performed, resulting in the possibility of performing invalid message retransmission a plurality of times, resulting in a reduction in message retransmission efficiency and a waste of device resources.
In order to solve the above technical problem, an embodiment of the present invention provides a method for determining a message retransmission policy.
The method can be applied to any application scene with message retransmission, for example, in the field of video monitoring, the SAC retransmits a video recording plan to various types of accessed storage equipment; for example, in the data storage field, a management server of a data storage system retransmits a data acquisition command to a data storage node. The method can be applied to any electronic device which is used as a message sender and has a message retransmission condition, for example, various servers for issuing various instructions in various systems, SAC, data storage nodes for performing data feedback in a data storage system, and the like, which are hereinafter referred to as electronic devices for short.
Based on this, the embodiment of the present invention does not limit the application scenario and the execution subject of the method.
The method for determining the message retransmission strategy provided by the embodiment of the invention can comprise the following steps:
determining state change information of target equipment for receiving a message to be retransmitted and the utilization rate of each equipment resource of the target equipment;
calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment;
and determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target running state weight and a preset weight range.
As can be seen from the above, with the solution provided in the embodiment of the present invention, when a certain device does not receive a message and needs to retransmit the message to the device, the device may be determined as a target device for receiving the message to be retransmitted, and accordingly, the message that needs to be retransmitted is the message to be retransmitted.
After the target device is determined, state change information of the target device and the resource utilization rate of each device of the target device can be obtained firstly; then, the target operation state weight of the target device can be calculated based on the state change information and the resource utilization rate of each device. Then, a target message retransmission strategy of the target device can be determined according to the numerical relationship between the target operation state weight and the preset weight range. In this way, the action corresponding to the target message retransmission strategy and related to the message retransmission can be executed, and the message retransmission aiming at the target device can be completed.
Based on this, with the solution provided by the embodiment of the present invention, for the target device for receiving the message to be retransmitted, since the target message retransmission policy of the target device is determined based on the state change information of the target device and the resource utilization rate of each device, the operation state of the target device is fully considered when retransmitting the message. In this way, the determined target message retransmission policy can be changed along with the change of the operating state of the target device, so as to ensure that the determined target message retransmission policy can be always matched with the operating state of the target device, thereby enabling the action which is executed and corresponds to the target message retransmission policy and is related to message retransmission to always accord with the operating state of the target device, avoiding invalid message retransmission, improving message retransmission efficiency, and reducing waste of device resources. That is to say, by applying the scheme provided by the embodiment of the present invention, it is possible to determine a message retransmission policy according to the operating state of the device that receives the message retransmission, so as to avoid invalid message retransmission, further improve the message retransmission efficiency, and reduce the waste of device resources.
Hereinafter, a method for determining a message retransmission policy according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for determining a message retransmission policy according to an embodiment of the present invention, as shown in fig. 1, the method may include the following steps S101 to S103:
s101: determining state change information of target equipment for receiving the message to be retransmitted and the utilization rate of each equipment resource of the target equipment;
in the data transmission field, after a message receiver successfully receives a message sent by a message sender, an Acknowledgement (ACK) is fed back to the message sender within a certain time range to notify the message sender that the message sender has successfully received the message, and the time range is usually preset and fixed for a certain message receiver.
In this way, after sending a message to a message receiver, a message sender can detect whether an ACK fed back by the message receiver is received within a time range corresponding to the message receiver. If the message is received, the message sender can determine that the message is successfully delivered to the message receiver, and if the message is not received, the message sender can determine that the message is not successfully delivered to the message receiver, and the message receiver needs to retransmit the message so as to re-deliver the message to the message receiver.
Based on this, in the embodiment of the present invention, the electronic device may serve as a message sender to send a message to other electronic devices serving as message receivers, and after sending the message, for each other electronic device serving as a message receiver, detect whether an ACK fed back by the other electronic device is received within a time range corresponding to the other electronic device.
When the electronic device detects that the message is not received, the electronic device may determine that the message is not successfully sent to the other electronic device, and need to resend the message to the other electronic device, so as to resend the message to the other electronic device.
Further, the electronic device may determine the message as a message to be retransmitted, and determine the other electronic devices that have not successfully received the message as target devices for receiving the message to be retransmitted.
For example, in the field of video surveillance, when a SAC is used as a message sender to send a video recording plan to an accessed CVR, and the CVR does not successfully receive the video recording plan, the SAC may determine the video recording plan as a message to be retransmitted and the CVR as a target device for receiving the message to be retransmitted.
After determining the target device and the message to be retransmitted, the electronic device may determine the state change information of the target device and the resource utilization rate of each device of the target device.
The state change information of the target device is: the change information of the target device between the offline state and the online state in a specified time range which is at the current moment and is before the current moment is included.
Optionally, the electronic device may periodically detect the state change information of the other electronic devices serving as the message recipients.
Optionally, the state change information of the target device is any one of the following state change information:
offline to online, online to online, and online to offline.
Wherein, the state from the off-line state to the on-line state means that: in the specified time range, the target equipment is converted from an off-line state to an on-line state, so that the target equipment is in the on-line state at the current moment; by presence to presence is meant: in the specified time range, the target equipment is always in an online state, so that the target equipment is in the online state at the current moment; the online state to the offline state means: in the specified time range, the target device is changed from the online state to the offline state, so that the target device is in the offline state at the current moment.
Optionally, the resource utilization rate of each device of the target device may include: usage of various hardware resources of each physical resource of the target device, for example, memory usage, storage space usage, network bandwidth usage, CPU (Central Processing Unit) usage, and the like.
Optionally, the resource utilization rate of each device of the target device may include: the usage of task thread resources of the target device.
The utilization rate of the task thread resources of the target device is as follows: the target device usually presets a certain number of threads for executing each received task, and when the target device receives a task, at least one thread is occupied for executing the task, so that the proportion of the occupied thread for executing each task in the preset bus thread is the utilization rate of the task thread resources of the target device.
For example, for the CVR, the total number of video recording plans that the CVR can receive may be preset, and then the ratio of the number of currently received video recording plans to the total number may be used as the utilization rate of the task thread resources of the CVR.
Optionally, the resource utilization rate of each device of the target device may include: the utilization rate of various hardware resources of various physical resources of the target device and the utilization rate of task thread resources of the target device.
S102: calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment;
after determining the state change information of the target device and the resource utilization rates of the devices of the target device, the electronic device may calculate the target operating state weight of the target device based on the state change information and the resource utilization rates of the devices.
The target operational state weight of the target device may be used to quantify the operational state of the target device, thereby characterizing the necessity for message retransmission to the target device. The higher the target operation state weight of the target device is, the better the operation state of the target device is, and thus the higher the necessity of retransmitting the message to the target device is; conversely, the lower the target operation state weight of the target device, the worse the operation state of the target device is, and thus the lower the necessity of retransmitting the message to the target device.
In this way, when the target operation state weight of the target device is lower than the preset lower limit value, it can be stated that the operation state of the target device is poor, so that the necessity of message retransmission to the target device is low, and even the message retransmission to the target device is not necessary.
The electronic device may execute the step S102 in various ways to obtain the target operation state weight of the target device, which is not limited in this embodiment of the present invention.
For example, a corresponding weight value may be set for each type of state change information, and then, a target weight value corresponding to the state change information of the target device is determined; moreover, since each device resource usage rate may belong to a numerical range [0,1], the numerical range [0,1] may be divided into a plurality of sub-ranges in advance, and a corresponding weight value may be set for each sub-range, so that a weight value corresponding to a sub-range to which each device resource usage rate of the target device belongs is determined as a target weight value corresponding to the device resource usage rate. Further, the sum of the determined respective target weight values may be determined as a target operation state weight of the target device.
For clarity, a specific implementation of the step S102 will be illustrated in the following.
S103: and determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target operation state weight and the preset weight range.
After determining the target operation state weight of the target device, the electronic device may first determine a numerical relationship between the target operation state weight and a preset weight range, and determine a target message retransmission policy of the target device according to the numerical relationship.
Optionally, in a specific implementation manner, as shown in fig. 2, the step S103 may include the following steps S1031 to S1033:
s1031: if the target running state weight is smaller than the lower limit value of the preset weight range, determining that the target message retransmission strategy of the target device is as follows: not retransmitting;
in this specific implementation manner, if the target operation state weight is smaller than the lower limit value of the preset weight range, it indicates that the operation state of the target device is poor, and thus, the necessity of retransmitting the message to the target device is low. For example, the target device is in an offline state, the network where the target device is located is abnormal, there is no available resource in the hardware resource of the target device, and the like, and therefore, it may be determined that there is no need to retransmit the message to the target device. In this way, the target message retransmission policy of the target device can be directly determined as: and does not retransmit.
S1032: if the target operation state weight belongs to the preset weight range, calculating the target retransmission time of the message to be retransmitted based on the retransmission times and the last transmission time of the message to be retransmitted; and determining that the target message retransmission policy of the target device is: retransmitting the message to be retransmitted to the target device at the retransmission time;
if the target operation state weight belongs to the preset weight range, the operation state of the target device is in a general state, and therefore, the necessity of retransmitting the message to the target device is in a general level. For example, the target device is always on-line and has retransmitted many times before, the available resources left in the hardware resources of the target device are small, and so on, and therefore, the message retransmission can be performed to the target device at a certain retransmission time interval without frequently performing the message retransmission to the target device at a short time interval.
In this way, the target retransmission time of the message to be retransmitted may be first calculated based on the retransmission number of times and the last transmission time of the message to be retransmitted, and then the target message retransmission policy of the target device may be determined as follows: and retransmitting the message to be retransmitted to the target equipment at the calculated retransmission time.
The number of retransmissions of a message to be retransmitted is: the number of times the message to be retransmitted has been retransmitted; and the last transmission time refers to: the time of sending the message to be retransmitted to the target equipment at the time closest to the current time; when the message to be retransmitted has not been retransmitted to the target device, the last transmission time is: the time when the electronic device first sends a message to be retransmitted to the target device.
For example, if the SAC has not yet retransmitted the recording plan to the CVR, the number of retransmissions is 0, and the last transmission time is the time when the SAC transmitted the recording plan to the CVR.
Optionally, in step S1032, calculating the target retransmission time of the target message based on the retransmission number of times of the message to be retransmitted and the last transmission time, may include the following steps 11-12:
step 11: determining a target time interval corresponding to the retransmission times of the message to be retransmitted from a preset retransmission time interval sequence;
step 12: and determining the time which is after the last transmission time of the message to be retransmitted and has the interval with the last transmission time as the target time interval as the target retransmission time of the message to be retransmitted.
In the embodiment shown in the above steps 11-12, a retransmission time interval sequence may be preset, the preset retransmission time interval sequence represents a time interval corresponding to the number of retransmissions, the number of bits included in the preset retransmission time interval sequence is a preset retransmission number threshold, and when the number of retransmissions exceeds the preset retransmission number threshold, the retransmission is stopped. And in the preset retransmission time interval sequence, the value positioned at the Nth bit is used for representing the time interval between the Nth retransmission of the data to be retransmitted and the last transmission of the data to be retransmitted, N is not less than 1, and N is not more than the preset retransmission time threshold.
For example, the sequence of the preset retransmission time intervals is as follows: 5,5,5,30,60,120,300,1800,3600,7200,14400, the 1 st 5 indicates that after a message to be retransmitted is sent to a target device for the first time, the message to be retransmitted is retransmitted at an interval of 5 seconds; and 30, the time interval between the time of retransmitting the message to be retransmitted to the target device for the fourth time and the time of retransmitting the message to be retransmitted to the target device for the third time is 30 seconds. And repeating the steps until the message to be retransmitted is retransmitted for the 11 th time, and stopping retransmission.
When it is determined that the target operation state weight of the target device belongs to the preset weight range, the electronic device may first determine the retransmission number of the message to be retransmitted and the last transmission time, and may further determine a target time interval corresponding to the retransmission number from a preset retransmission time interval sequence.
That is, the sum of the number of retransmissions and 1 is calculated first, and the value in the preset retransmission time interval sequence that is the same as the calculated sum is determined as the target time interval.
In this way, the time which is after the last transmission time of the message to be retransmitted and is separated from the last transmission time by the target time interval can be determined, and the time can be determined as the target retransmission time of the message to be retransmitted.
That is, the sum of the last transmission time and the above-described target time interval may be directly calculated, and thus, the calculated sum may be determined as the target retransmission time of the message to be retransmitted.
S1033: if the target running state weight is larger than the upper limit value of the preset weight range, determining that the target message retransmission strategy of the target equipment is as follows: and retransmitting the message to be retransmitted to the target equipment at intervals of a preset retransmission time length from the current moment until the target equipment successfully receives the target message.
If the target operation state weight is greater than the upper limit value of the preset weight range, the operation state of the target device is better, and therefore the necessity of retransmitting the message to the target device is higher. For example, the target device changes from an offline state to an online state, more available resources are left in hardware resources of the target device, and the like, and therefore, the constraint of the preset retransmission time interval sequence on the time interval of each retransmission can be ignored. In this way, the target message retransmission policy of the target device can be directly determined as: and retransmitting the message to be retransmitted to the target equipment at intervals of a preset retransmission time length from the current moment until the target equipment successfully receives the target message, or the retransmission times reach a preset retransmission time threshold.
For example, it may be directly determined that the message to be retransmitted is retransmitted to the target device every 5 seconds until the target device successfully receives the target message, or the retransmission number reaches a preset retransmission number threshold.
Optionally, in a specific implementation manner, as shown in fig. 3, the method for determining a target message retransmission policy according to an embodiment of the present invention may further include the following step S104:
s104: and under the condition that the weight of the target running state is not less than the lower limit value of the preset weight range, retransmitting the message to be retransmitted to the target equipment according to the target message retransmission strategy.
In this specific implementation manner, when it is determined that the target operation state weight of the target device is smaller than the lower limit value of the preset weight range, it may be directly determined that retransmission is not performed to the target device.
Correspondingly, when the target operation state weight of the target device is determined to belong to the preset weight range and the target operation state weight of the target device is determined to be larger than the lower limit value of the preset weight range, a target message retransmission strategy for retransmitting the message to be retransmitted to the target device can be determined.
That is, when it is determined that the target operating state weight of the target device is not less than the lower limit value of the preset weight range, the message to be retransmitted may be retransmitted to the target device according to the determined target message retransmission policy.
When it is determined that the target operation state weight of the target device belongs to the preset weight range, the message to be retransmitted can be retransmitted to the target device at the determined retransmission time.
Optionally, if the target device successfully receives the message to be retransmitted, which is retransmitted by the electronic device, the retransmission may be stopped; if the target device has not successfully received the message to be retransmitted, which is retransmitted by the electronic device, the steps S101 to S103 may be executed again, a new target message retransmission policy is determined, and then, an operation corresponding to the new target message retransmission policy is executed.
When it is determined that the target running state weight of the target device is greater than the upper limit value of the preset weight range, the message to be retransmitted can be retransmitted to the target device every other preset retransmission time length from the current moment until the target device successfully receives the target message, or the retransmission time reaches a preset retransmission time threshold value, and the retransmission is stopped.
Optionally, in a specific implementation manner, the step S104 may include the following steps 21 to 22:
step 21: sending the target message retransmission strategy to a preset priority queue; wherein, the target message retransmission strategy carries the target operation state weight;
step 22: executing a target message retransmission strategy according to the target sequence of the target running state weight;
wherein the target sequence is: and when the running state weights carried by the message retransmission strategies in the priority queue are arranged according to the sequence from large to small, sequencing the target running state weights.
In this specific implementation manner, a priority queue for storing the message retransmission policies may be preset, and each message retransmission policy in the priority queue carries an operation status weight for determining the message retransmission policy.
The priority queue is a special queue, and the message retransmission strategies stored in the priority queue are read and executed in sequence according to the sequence of the carried running state weights from large to small.
That is, when each message retransmission policy stored in the priority queue is executed, each message retransmission policy is sequentially executed in the descending order of the carried operation state weight, instead of following the first-in first-out rule.
For example, suppose that the time for storing the message retransmission policy a into the priority queue is a1 and the carried operating state weight is a2, while the time for storing the message retransmission policy B into the priority queue is B1 and the carried operating state weight is B2; then, in the case where a1 is earlier than B1, and a2< B2, the execution time of the message retransmission policy B is earlier than the execution time of the message retransmission policy a, i.e., the message retransmission policy B is executed, and then the message retransmission policy a is executed.
Thus, for the target device, under the condition that the determined target running state weight of the target device is not less than the lower limit value of the preset weight range, the determined target message retransmission policy can be issued to the preset priority queue, and the issued target message retransmission policy carries the target running state weight.
Furthermore, since the message retransmission policies stored in the priority queue are sequentially read and executed according to the ascending order of the carried operation state weights, the target operation state weights can be obtained by determining the sequence of the target operation state weights when the operation state weights carried by the message retransmission policies in the priority queue are arranged according to the ascending order. Then, the target message retransmission strategy can be executed according to the target sequence of the target operation state weight.
That is to say, after the target message retransmission policy is issued to the priority queue, the target message retransmission policy is in a state to be read, and the electronic device may sequentially read each message retransmission policy in the priority queue according to the descending order of the operation state weights carried by each message retransmission policy in the priority queue, and after reading each message retransmission policy, perform message retransmission according to the message retransmission policy.
Therefore, after the message retransmission strategy sequence obtained by sequencing all the message retransmission strategies according to the carried operation state weight from large to small is read, the target message retransmission strategy can be read, and further, the message to be retransmitted can be retransmitted to the target equipment according to the target message retransmission strategy.
As can be seen from the above, according to the scheme provided by the embodiment of the present invention, for a target device for receiving a message to be retransmitted, since a target message retransmission policy of the target device is determined based on state change information of the target device and resource utilization rates of each device, when the message is retransmitted, the operating state of the target device is fully considered. In this way, the determined target message retransmission policy can be changed along with the change of the operating state of the target device, so as to ensure that the determined target message retransmission policy can be always matched with the operating state of the target device, thereby enabling the action which is executed and corresponds to the target message retransmission policy and is related to message retransmission to always accord with the operating state of the target device, avoiding invalid message retransmission, improving message retransmission efficiency, and reducing waste of device resources. That is to say, by applying the scheme provided by the embodiment of the present invention, it is possible to determine a message retransmission policy according to the operating state of the device that receives the message retransmission, so as to avoid invalid message retransmission, further improve the message retransmission efficiency, and reduce the waste of device resources.
Optionally, in a specific implementation manner, as shown in fig. 4, the step S102 of calculating the target operation state weight of the target device based on the state change information and the resource utilization rate of each device may include the following steps S1021 to S1023:
s1021: calculating the product of a weight factor corresponding to the state change information and a preset first influence factor as a first weight;
in this specific implementation manner, corresponding weighting factors may be set in advance for various types of state change information that may exist, and a first influence factor may be set in advance for the state change information of the target device.
Therein, the so-called first impact factor may characterize: and influence components of the state change information of the target equipment on the target running state weight of the target equipment.
In this way, after the state change information of the target device is determined, the weight factor corresponding to the state change information of the target device may be further determined, and the product of the weight factor and the first influence factor may be calculated, so that the product may be used as the first weight.
Optionally, the various state change information that may exist may include: offline to online, online to online, and online to offline. And the weighting factor corresponding to the offline state to the online state is greater than the weighting factor corresponding to the online state, and the weighting factor corresponding to the online state is greater than the weighting factor corresponding to the online state to the offline state.
For example, if the weight factor corresponding to the state change information of the target device is W1, and the preset first influence factor is E2, the first weight can be calculated as: W1W 2.
S1022: calculating a second weight based on the numerical relationship between the utilization rate of each equipment resource and a preset utilization rate threshold;
when the device resource utilization rate of a certain type of device resource of the target device is higher, the remaining available resource of the type of device resource is less, so that the type of device resource used by the target device for processing the message to be retransmitted is smaller or even insufficient for processing the message to be retransmitted after the message retransmission is performed. Then, in this case, the necessity of message retransmission to the target device is reduced. Furthermore, for each device resource usage rate of the target device, as the device resource usage rate gradually increases, the influence component of the device resource usage rate on the target operation state weight of the target device gradually decreases.
In this way, a usage rate threshold may be preset, and when the usage rate of a certain device resource of the target device is not less than the preset usage rate threshold, the influence component of the usage rate of the device resource on the target operation state weight of the target device may be regarded as 0, that is, the usage rate of the device resource has no influence on the target operation state weight of the target device.
Based on this, a numerical relationship of the usage rate of each device resource to a preset usage rate threshold may be determined, and the second weight may be calculated based on the determined numerical relationship.
For example, a weight value of 0 is set for each device resource usage rate not less than a preset usage rate threshold, and a weight value of 1 is set for each device resource usage rate less than the preset usage rate threshold, so that the sum of the weight values of the set device resource usage rates is taken as the second weight.
The electronic device may perform the step S1022 to obtain the second weight in various ways, which is not limited in this embodiment of the present invention. For clarity, a specific implementation manner of the step S1022 will be illustrated in the following.
S1023: and calculating the target operation state weight of the target equipment by using the first weight and the second weight.
After the first weight and the second weight are obtained, the target operation state weight of the target device can be calculated by using the first weight and the second weight.
Optionally, the step S1023 may include the following step 31:
step 31: and calculating a third sum of the first weight and the second weight as a target operation state weight of the target equipment.
After obtaining the first weight and the second weight, the electronic device may directly calculate a third sum of the first weight and the second weight, and use the third sum as a target operation state weight of the target device.
Optionally, the step S1023 may include the following step 32:
step 32: and calculating the target operation state weight of the target equipment by using the first weight and the second weight based on the preset configuration parameters.
The electronic device can set configuration parameters in advance according to the requirements of the actual application scene, and the preset configuration parameters are fixed constants. Therefore, after obtaining the first weight and the second weight, the electronic device may calculate the target operating state weight of the target device by using the first weight and the second weight based on the preset configuration parameter.
For example, the target operating state weight of the target device may be calculated using the following formula:
Weight=log((Q1+Q2)/Divisor)*BaseWeight
wherein Weight is a target operation state Weight of the target device, Q1 is a first Weight, Q2 is a second Weight, and divsor and BaseWeight are respectively a preset configuration parameter.
Thus, with the log function, the Weight transformation can be made smoother when ((Q1+ Q2)/Divisor > 1.
Optionally, as shown in fig. 5, a specific implementation manner is that, in the step S1022, calculating the second weight based on the numerical relationship between the usage rate of each device resource and the preset usage rate threshold includes the following steps S1022A-S1022C:
S1022A: if the utilization rate of each equipment resource is not less than the preset utilization rate threshold, setting the designated mark as a first numerical value;
S1022B: if the utilization rate of each equipment resource is not less than the preset utilization rate threshold, setting the designated mark as a second numerical value;
S1022C: calculating a second weight based on the respective device resource usage rates multiplied by the first;
wherein the first product is: the product of the flag and the preset weight parameter is specified.
In this specific implementation, the weight parameter and the designation flag may be set first.
The weight parameter is a determined constant, and the value of the specified mark is determined according to the judgment result of whether the utilization rate of each device resource of the target device is not less than the preset utilization rate threshold.
When judging that the utilization rate of each equipment resource is not less than the preset utilization rate threshold, setting the specified mark as a first numerical value; and when judging that the utilization rate of each device resource is not less than the preset utilization rate threshold, setting the designated mark as a second value. And, the second value is less than the first value.
For example, the preset usage threshold may be 1, the first value is 1, and the second value is 0; the designation flag may be set to 1 when there is a usage rate equal to 1 among the respective device resource usage rates, and may be set to 0 when there is no usage rate equal to 1 among the respective device resource usage rates.
After the specific value of the designated mark is determined, the product of the designated mark and the preset weight parameter can be calculated, that is, the product of the specific value of the designated mark and the preset weight parameter is calculated, and the calculated product is used as a first product. Further, the second weight may be calculated based on the respective device resource usage rates of the target device and the first product.
In this embodiment of the present invention, the usage rate of each device resource of the target device may include: the utilization rate of various hardware resources of various physical resources of the target device, and/or the utilization rate of task thread resources of the target device.
Optionally, in a specific implementation manner, the resource utilization rate of each device of the target device includes: in the case of the first type of usage rate of various hardware resources of the target device and the second type of usage rate of task thread resources of the target device, as shown in fig. 6, the step S1022C mentioned above, calculating the second weight based on the product of the usage rate of various device resources and the first weight, may include the following steps S601-S604:
s601: respectively calculating first difference values of a preset first target utilization rate and each first type utilization rate, and calculating a first sum value of each obtained first difference value;
s602: determining a first sub-weight based on the product of the first sum and a preset second influence factor;
s603: calculating a second difference value between the preset second target utilization rate and the second type utilization rate, and determining a second sub-weight based on the product of the second difference value and a preset third influence factor;
s604: a second sum of the first sub-weight and the second sub-weight is calculated, and a difference between the second sum and the first product is calculated as a second weight.
In this specific implementation manner, a first target usage rate for various hardware resources of the target device, a second target usage rate for task thread resources of the target device, and a second influence factor and a third influence factor may be preset.
Wherein, the preset second influence factor can be characterized by: influence components of first class utilization rates of various hardware resources of the target equipment on the target running state weight of the target equipment; the preset third impact factor may be characterized by: and the influence component of the second type usage rate of the task thread resource of the target equipment on the target running state weight of the target equipment. The first target usage rate and the second target usage rate may be the same or different.
In this way, for the first type of usage rate of each hardware resource of the target device, a difference value between the first target usage rate and the first type of usage rate may be first calculated and used as a first difference value, and then a sum value of the obtained first difference values may be calculated and used as a first sum value. Then, the product of the first sum and the preset second influence factor is calculated, and a first sub-weight is determined based on the product.
For example, the product of the first sum and the preset second impact factor may be directly determined as the first sub-weight.
Wherein, the first sub-weight may represent: a first type of usage of various hardware resources of the target device has a composite impact component on the target operating state weight of the target device.
For the second type of usage rate of the task thread resource of the target device, a difference between the preset second target usage rate and the second usage rate may be first calculated, and the difference is used as a second difference, and then a product of the second difference and the preset third impact factor is calculated. Then, a second sub-weight may be determined based on the product calculated above.
For example, the product of the second difference and the preset third influence factor may be directly determined as the second sub-weight.
Further, the sum of the first sub-weight and the second sub-weight may be first calculated as a second sum, and then the difference between the second sum and the first product may be calculated as a second weight.
For example, when the target device is a CVR, a first type of usage of various hardware resources of the target device may include: a CPU usage rate1, a memory usage rate2, a storage space usage rate3 and a network bandwidth usage rate4, and a second influence factor is preset as E2; the task thread resource utilization rate of the target equipment is as follows: the ratio rate5 of the number of the currently received video plans to the total number of the preset CVR received video plans is preset, and a third influence factor is preset as E3; the preset utilization rate threshold, the first target utilization rate and the second target utilization rate are all 1, the designated mark is F, the first numerical value is 1, the second numerical value is 0, and the preset weight parameter is C.
If there is a usage rate equal to 1 in the above-mentioned rate1, rate2, rate3, rate4 and rate5, F is 1, and if the above-mentioned rate1, rate2, rate3, rate4 and rate5 are all less than 1, F is 0.
Based on this, a first sum can be calculated as: (1-rate1) + (1-rate2) + (1-rate3) + (1-rate 4); and calculating to obtain a first sub-weight as: [ (1-rate1) + (1-rate2) + (1-rate3) + (1-rate4) ] E2 x 100; for convenience of description, if [ (1-rate1) + (1-rate2) + (1-rate3) + (1-rate4) ] 100 can be abbreviated as W2, the first sub-weight is: w2 × E2;
further, a second difference may be calculated as: (1-rate5), calculating a second sub-weight: (1-rate5) E3 100; for convenience of description, the (1-rate5) × 100 may be abbreviated as W3, and the second sub-weight is: w3 × E3;
in this way, a second weight can be calculated: W2E 2+ W3E 3-CF.
Corresponding to the method for determining the message retransmission strategy provided by the embodiment of the invention, the embodiment of the invention also provides a device for determining the message retransmission strategy.
Fig. 7 is a schematic structural diagram of a message retransmission policy determining apparatus according to an embodiment of the present invention, and as shown in fig. 7, the apparatus may include the following modules:
an information determining module 710, configured to determine state change information of a target device for receiving a message to be retransmitted, and a resource utilization rate of each device of the target device;
a weight calculating module 720, configured to calculate a target operation state weight of the target device based on the state change information and the resource utilization rate of each device;
and a policy determining module 730, configured to determine a target message retransmission policy of the target device according to a numerical relationship between the target operating state weight and a preset weight range.
As can be seen from the above, with the solution provided in the embodiment of the present invention, when a certain device does not receive a message and needs to retransmit the message to the device, the device may be determined as a target device for receiving the message to be retransmitted, and accordingly, the message that needs to be retransmitted is the message to be retransmitted.
After the target device is determined, state change information of the target device and the resource utilization rate of each device of the target device can be obtained firstly; then, the target operation state weight of the target device can be calculated based on the state change information and the resource utilization rate of each device. Then, a target message retransmission strategy of the target device can be determined according to the numerical relationship between the target operation state weight and the preset weight range. In this way, the action corresponding to the target message retransmission strategy and related to the message retransmission can be executed, and the message retransmission aiming at the target device can be completed.
Based on this, with the solution provided by the embodiment of the present invention, for the target device for receiving the message to be retransmitted, since the target message retransmission policy of the target device is determined based on the state change information of the target device and the resource utilization rate of each device, the operation state of the target device is fully considered when retransmitting the message. In this way, the determined target message retransmission policy can be changed along with the change of the operating state of the target device, so as to ensure that the determined target message retransmission policy can be always matched with the operating state of the target device, thereby enabling the action which is executed and corresponds to the target message retransmission policy and is related to message retransmission to always accord with the operating state of the target device, avoiding invalid message retransmission, improving message retransmission efficiency, and reducing waste of device resources. That is to say, by applying the scheme provided by the embodiment of the present invention, it is possible to determine a message retransmission policy according to the operating state of the device that receives the message retransmission, so as to avoid invalid message retransmission, further improve the message retransmission efficiency, and reduce the waste of device resources.
Optionally, in a specific implementation manner, the weight calculating module 720 includes:
the first weight calculation submodule is used for calculating the product of a weight factor corresponding to the state change information and a preset first influence factor as a first weight, and calculating a second weight based on the numerical relationship between the utilization rate of each equipment resource and a preset utilization rate threshold;
and the second weight calculation submodule is used for calculating the target operation state weight of the target equipment by using the first weight and the second weight.
Optionally, in a specific implementation manner, the first weight calculating sub-module includes:
a first value setting unit, configured to set a designation flag to a first value if there is a usage rate that is not less than a preset usage rate threshold in the usage rates of the device resources;
a second numerical value setting unit, configured to set the designation flag to a second numerical value if there is no usage rate that is not less than the preset usage rate threshold among the resource usage rates of the respective devices;
a weight calculation unit for calculating a second weight based on the respective device resource usage rates multiplied by the first; wherein the first product is: the product of the specified mark and a preset weight parameter.
Optionally, in a specific implementation manner, the resource utilization rate of each device includes: a first type of usage rate of various hardware resources of the target device, and a second type of usage rate of task thread resources of the target device; the weight calculation unit is specifically configured to:
respectively calculating first difference values of a preset first target utilization rate and each first type utilization rate, and calculating a first sum value of each obtained first difference value;
determining a first sub-weight based on the product of the first sum and a preset second influence factor;
calculating a second difference value between a preset second target utilization rate and a second type utilization rate, and determining a second sub-weight based on the product of the second difference value and a preset third influence factor;
and calculating a second sum of the first sub-weight and the second sub-weight, and calculating a difference between the second sum and the first product as a second weight.
Optionally, in a specific implementation manner, the second weight calculating sub-module is specifically configured to:
calculating a third sum of the first weight and the second weight as a target operation state weight of the target device; or,
and calculating the target operation state weight of the target equipment by using the first weight and the second weight based on preset configuration parameters.
Optionally, in a specific implementation manner, the policy determining module 730 includes:
a first policy determining sub-module, configured to determine that the target message retransmission policy of the target device is: not retransmitting;
a second strategy determining submodule, configured to calculate a target retransmission time of the message to be retransmitted based on the retransmission times and the last transmission time of the message to be retransmitted if the target operation state weight belongs to the preset weight range; and determining that the target message retransmission policy of the target device is: retransmitting the message to be retransmitted to the target device at the retransmission time;
a third policy determining sub-module, configured to determine that the target message retransmission policy of the target device is: and retransmitting the message to be retransmitted to the target equipment every other preset retransmission time length from the current moment until the target equipment successfully receives the target message, or the retransmission times reach a preset retransmission time threshold value.
Optionally, in a specific implementation manner, the second policy determining sub-module is specifically configured to:
determining a target time interval corresponding to the retransmission times of the message to be retransmitted from a preset retransmission time interval sequence;
and determining the time which is after the last sending time of the message to be retransmitted and has the interval with the last sending time as the target time interval as the target retransmission time of the message to be retransmitted.
Optionally, in a specific implementation manner, the apparatus further includes:
and the message retransmission module is used for retransmitting the message to be retransmitted to the target equipment according to the target message retransmission strategy under the condition that the target operation state weight is not smaller than the lower limit value of the preset weight range.
Optionally, in a specific implementation manner, the message retransmission module is specifically configured to:
sending the target message retransmission strategy to a preset priority queue; wherein, the target message retransmission strategy carries the target operation state weight;
executing the target message retransmission strategy according to the target sequence of the target running state weight; wherein the target ordering is: and when the running state weights carried by the message retransmission strategies in the priority queue are arranged in the descending order, the target running state weights are sequenced.
Corresponding to the method for determining a message retransmission policy provided by the embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804,
a memory 803 for storing a computer program;
the processor 801 is configured to implement the steps of any message retransmission policy determining method provided in the above-described embodiment of the present invention when executing the program stored in the memory 803.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the message retransmission policy determination methods provided in the embodiments of the present invention.
In another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of any of the message retransmission policy determination methods provided in the embodiments of the present invention described above.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described for simplicity because they are substantially similar to method embodiments, as may be found in some descriptions of method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A method for determining a message retransmission policy, the method comprising:
determining state change information of target equipment for receiving a message to be retransmitted and the utilization rate of each equipment resource of the target equipment;
calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment;
and determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target running state weight and a preset weight range.
2. The method of claim 1, wherein calculating the target operating state weight of the target device based on the state change information and the respective device resource usage rates comprises:
calculating a product of a weight factor corresponding to the state change information and a preset first influence factor as a first weight, and calculating a second weight based on a numerical relationship between the utilization rate of each equipment resource and a preset utilization rate threshold;
and calculating the target operation state weight of the target equipment by using the first weight and the second weight.
3. The method according to claim 2, wherein calculating the second weight based on the numerical relationship between the respective device resource usage rates and the preset usage rate threshold comprises:
if the utilization rate of each equipment resource is not less than a preset utilization rate threshold, setting a designated mark as a first numerical value;
if the utilization rate of each equipment resource is not less than the preset utilization rate threshold, setting the designated mark as a second numerical value;
calculating a second weight based on the respective device resource usage rates multiplied by the first; wherein the first product is: the product of the specified mark and a preset weight parameter.
4. The method of claim 3, wherein the respective device resource usage rates comprise: a first type of usage rate of various hardware resources of the target device, and a second type of usage rate of task thread resources of the target device;
calculating a second weight based on the product of the resource utilization rate of each device and the first weight comprises:
respectively calculating first difference values of a preset first target utilization rate and each first type utilization rate, and calculating a first sum value of each obtained first difference value;
determining a first sub-weight based on the product of the first sum and a preset second influence factor;
calculating a second difference value between a preset second target utilization rate and a second type utilization rate, and determining a second sub-weight based on the product of the second difference value and a preset third influence factor;
and calculating a second sum of the first sub-weight and the second sub-weight, and calculating a difference between the second sum and the first product as a second weight.
5. The method of claim 2, wherein calculating the target operating state weight of the target device using the first weight and the second weight comprises:
calculating a third sum of the first weight and the second weight as a target operation state weight of the target device; or,
and calculating the target operation state weight of the target equipment by using the first weight and the second weight based on preset configuration parameters.
6. The method according to claim 1, wherein the determining the target message retransmission policy of the target device according to the numerical relationship between the target operation state weight and the preset weight range comprises:
if the target operation state weight is smaller than the lower limit value of a preset weight range, determining that a target message retransmission strategy of the target device is as follows: not retransmitting;
if the target operation state weight belongs to the preset weight range, calculating the target retransmission time of the message to be retransmitted based on the retransmission times and the last transmission time of the message to be retransmitted; and determining that the target message retransmission policy of the target device is: retransmitting the message to be retransmitted to the target device at the retransmission time;
if the target running state weight is larger than the upper limit value of the preset weight range, determining that a target message retransmission strategy of the target device is as follows: and retransmitting the message to be retransmitted to the target equipment every other preset retransmission time length from the current moment until the target equipment successfully receives the target message, or the retransmission times reach a preset retransmission time threshold value.
7. The method of claim 6, wherein calculating the target retransmission time of the target message based on the retransmission times and the last transmission time of the message to be retransmitted comprises:
determining a target time interval corresponding to the retransmission times of the message to be retransmitted from a preset retransmission time interval sequence;
and determining the time which is after the last sending time of the message to be retransmitted and has the interval with the last sending time as the target time interval as the target retransmission time of the message to be retransmitted.
8. The method of claim 6, further comprising:
and under the condition that the weight of the target running state is not less than the lower limit value of the preset weight range, retransmitting the message to be retransmitted to the target equipment according to the target message retransmission strategy.
9. The method of claim 8, wherein the step of retransmitting the message to be retransmitted to the target device according to the target message retransmission policy comprises:
sending the target message retransmission strategy to a preset priority queue; wherein, the target message retransmission strategy carries the target operation state weight;
executing the target message retransmission strategy according to the target sequence of the target running state weight; wherein the target ordering is: and when the running state weights carried by the message retransmission strategies in the priority queue are arranged in the descending order, the target running state weights are sequenced.
10. An apparatus for determining a message retransmission policy, the apparatus comprising:
the information determining module is used for determining state change information of target equipment for receiving the message to be retransmitted and the utilization rate of each equipment resource of the target equipment;
the weight calculation module is used for calculating the target running state weight of the target equipment based on the state change information and the resource utilization rate of each equipment;
and the strategy determining module is used for determining a target message retransmission strategy of the target equipment according to the numerical relationship between the target running state weight and a preset weight range.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-9 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-9.
CN202111595123.0A 2021-12-23 2021-12-23 Message retransmission strategy determining method and device and electronic equipment Active CN114337935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111595123.0A CN114337935B (en) 2021-12-23 2021-12-23 Message retransmission strategy determining method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111595123.0A CN114337935B (en) 2021-12-23 2021-12-23 Message retransmission strategy determining method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN114337935A true CN114337935A (en) 2022-04-12
CN114337935B CN114337935B (en) 2024-02-02

Family

ID=81012544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111595123.0A Active CN114337935B (en) 2021-12-23 2021-12-23 Message retransmission strategy determining method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114337935B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103326922A (en) * 2012-03-19 2013-09-25 日立民用电子株式会社 Message sending side device, message receiving side device and message receiving and sending system
CN104486049A (en) * 2014-12-30 2015-04-01 宇龙计算机通信科技(深圳)有限公司 Data receiving state feedback method, data retransmission method and device and terminal
CN109981232A (en) * 2017-12-27 2019-07-05 珠海市魅族科技有限公司 Data transmission method and device, data receiver method and device
CN110912654A (en) * 2019-11-28 2020-03-24 京东方科技集团股份有限公司 Data retransmission method, gateway device, terminal device, and storage medium
US20210051450A1 (en) * 2018-01-18 2021-02-18 Nec Corporation Message delivery device, method, and recording medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103326922A (en) * 2012-03-19 2013-09-25 日立民用电子株式会社 Message sending side device, message receiving side device and message receiving and sending system
CN104486049A (en) * 2014-12-30 2015-04-01 宇龙计算机通信科技(深圳)有限公司 Data receiving state feedback method, data retransmission method and device and terminal
CN109981232A (en) * 2017-12-27 2019-07-05 珠海市魅族科技有限公司 Data transmission method and device, data receiver method and device
US20210051450A1 (en) * 2018-01-18 2021-02-18 Nec Corporation Message delivery device, method, and recording medium
CN110912654A (en) * 2019-11-28 2020-03-24 京东方科技集团股份有限公司 Data retransmission method, gateway device, terminal device, and storage medium

Also Published As

Publication number Publication date
CN114337935B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
CN108632365B (en) Service resource adjusting method, related device and equipment
CN104753994B (en) Method of data synchronization and its device based on aggregated server system
CN111818159B (en) Management method, device, equipment and storage medium of data processing node
EP3072260B1 (en) Methods, systems, and computer readable media for a network function virtualization information concentrator
US20070168201A1 (en) Formula for automatic prioritization of the business impact based on a failure on a service in a loosely coupled application
US10970148B2 (en) Method, device and computer program product for managing input/output stack
CN116760509A (en) Power data transmission control method, system, terminal equipment and storage medium
CN111400045A (en) Load balancing method and device
US20150281008A1 (en) Automatic derivation of system performance metric thresholds
US11477098B2 (en) Identification of candidate problem network entities
CN109684130A (en) The method and device of data backup between a kind of computer room
CN114337935B (en) Message retransmission strategy determining method and device and electronic equipment
JP2008250669A (en) Web monitoring control system, web server control device and web server control program
CN117177276A (en) 5G customized private network adjustment method, device and storage medium
US8174974B2 (en) Voluntary admission control for traffic yield management
CN106341474B (en) It is a kind of that center and its contents management method are managed based on the data of ICN and SDN network
CN112671590B (en) Data transmission method and device, electronic equipment and computer storage medium
US10089149B2 (en) Method for scheduling multiple periodic requests and scheduling device
CN111555918B (en) Return source optimization method and device and electronic equipment
JP2020532224A (en) Systems and methods for evaluating communication resources
CN115277479A (en) Method and system for realizing system operation condition monitoring based on monitoring assistant
CN104348641A (en) Fault detection method and fault detection device
CN113190347A (en) Edge cloud system and task management method
CN108718285B (en) Flow control method and device of cloud computing cluster and server
CN116915584B (en) Method and device for processing online computing exception

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