CN117834548A - Message loss prevention method and device, electronic equipment and storage medium - Google Patents

Message loss prevention method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117834548A
CN117834548A CN202311849223.0A CN202311849223A CN117834548A CN 117834548 A CN117834548 A CN 117834548A CN 202311849223 A CN202311849223 A CN 202311849223A CN 117834548 A CN117834548 A CN 117834548A
Authority
CN
China
Prior art keywords
message
configuration
equipment
configuration messages
messages
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.)
Pending
Application number
CN202311849223.0A
Other languages
Chinese (zh)
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.)
Shenzhen Grandstream Networks Technologies Co ltd
Original Assignee
Shenzhen Grandstream Networks Technologies 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 Shenzhen Grandstream Networks Technologies Co ltd filed Critical Shenzhen Grandstream Networks Technologies Co ltd
Priority to CN202311849223.0A priority Critical patent/CN117834548A/en
Publication of CN117834548A publication Critical patent/CN117834548A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a method and a device for preventing message loss, electronic equipment and a storage medium. According to the method and the device, whether the configuration information issued to the device is lost or not is determined according to the number of the currently generated configuration information, the number of the received configuration information and the information queue corresponding to the device, the condition that whether the configuration information is lost or not can be monitored without adding complex redundant information or algorithms, preventive preparation is made for guaranteeing the integrity of the issued configuration information, when the configuration information is lost, the integrity of the configuration information applied to the device is guaranteed by issuing the full configuration information, meanwhile, the characteristic that the configuration information which is not successfully received by the device is stored according to the first-in first-out principle based on the information queue is adopted, when the configuration information is not lost, the configuration information in the information queue is issued to the device in sequence, and the occurrence sequence of the configuration information applied to the device can be guaranteed not to be changed.

Description

Message loss prevention method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a device for preventing message loss, electronic equipment and a storage medium.
Background
Using internet communication technology, a communication connection between the device and the server may be created, for example, by means of WebSocket protocol to enable data exchange between the device and the server. However, due to network fluctuation, network congestion, network interruption and the like, normal communication between the device and the server is affected, and data packet loss occurs.
The existing technologies for preventing data packet loss in network transmission are relatively more, however, the inventor finds that at least the following problems exist in the related technologies: the implementation process is complex, redundant information needs to be added, and the bandwidth occupation of data transmission is increased, for example, the forward error correction coding technology is adopted; the sequential characteristic of lost data is ignored, and the integrity of the data is guaranteed, but the condition of messy information exists, so that the equipment side is configured with errors, for example, an automatic retransmission technology.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, electronic equipment and a storage medium for preventing message loss, and the integrity and the sequence of data in network transmission are ensured.
In order to solve the above technical problems, an embodiment of the present invention provides a method for preventing message loss, including: determining whether the configuration information issued to the equipment is lost or not according to the number of the currently generated configuration information, the number of the received configuration information and the information queue corresponding to the equipment, wherein the information queue is used for storing the configuration information which is not successfully received by the equipment according to the first-in first-out principle; when the configuration information is lost, transmitting the full configuration information corresponding to the equipment; and when the configuration message is not lost, sequentially issuing the configuration message in the message queue to the equipment.
The embodiment of the invention also provides a message loss prevention device, which comprises: the message loss judging module is used for determining whether the configuration message issued to the equipment is lost or not according to the number of the currently generated configuration messages, the number of the received configuration messages and a message queue corresponding to the equipment, wherein the message queue is used for storing the configuration message which is not successfully received by the equipment according to the first-in first-out principle; the message loss processing module is used for issuing the full configuration message corresponding to the equipment; and the message non-loss processing module is used for sequentially issuing the configuration messages in the message queue to the equipment.
The embodiment of the invention also provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message loss prevention method described above.
The embodiment of the invention also provides a computer readable storage medium which stores a computer program, and the computer program realizes the method for preventing message loss when being executed by a processor.
In the embodiment of the invention, according to the number of the currently generated configuration messages, the number of the received configuration messages and the message queue corresponding to the equipment, whether the configuration messages issued to the equipment are lost or not is determined, the condition that whether the configuration messages are lost or not can be monitored without adding complex redundant information or algorithms is prepared for guaranteeing the integrity of the issued configuration messages, when the configuration messages are lost, the integrity of the configuration messages applied to the equipment is guaranteed by issuing a full quantity of configuration messages, meanwhile, the characteristic of the configuration messages which are not successfully received by the equipment is stored on the basis of the message queue according to the first-in first-out principle, and when the configuration messages are not lost, the configuration messages in the message queue are issued to the equipment in sequence, so that the occurrence sequence of the configuration messages applied to the equipment can be guaranteed not to be changed.
In addition, before determining whether the configuration message issued to the device is lost according to the number of the currently generated configuration messages, the number of the received configuration messages and the message queue corresponding to the device, the number of the currently generated configuration messages and the number of the received configuration messages are recorded by creating a configuration message record table in Mysql.
Additionally, the recording the current generated number of configuration messages and the received number of configuration messages by creating a configuration message record table in Mysql includes: creating a configuration message record table in Mysql, wherein the configuration message record table comprises the number of currently generated configuration messages and the number of received configuration messages; when the generation of the configuration message corresponding to the equipment is monitored, updating the number of the currently generated configuration messages corresponding to the equipment; and after receiving the message returned by the equipment and having successful configuration message reception, updating the number of the received configuration messages corresponding to the equipment.
In addition, the updating the number of received configuration messages corresponding to the device includes: analyzing an ID node carried in a message returned by the equipment and having successful configuration message reception, wherein the value of the ID node is a sequence number generated by the corresponding configuration message, and when the value of the ID node obtained by analysis corresponds to the value of the ID node carried in the configuration message sent to the equipment, taking the value of the ID node obtained by analysis as the number of the received configuration messages corresponding to the equipment.
In addition, before determining whether the configuration message issued to the device is lost or not according to the number of the currently generated configuration messages, the number of the received configuration messages and the message queues corresponding to the device, a List is created in the Redis, and the message queues are stored by using the List.
In addition, the determining whether the configuration message issued to the device is lost according to the number of the currently generated configuration messages, the number of the received configuration messages and the message queue corresponding to the device comprises: calculating the length of the message queue and calculating the difference between the number of the currently generated configuration messages and the number of the received configuration messages; when the queue length is not equal to the message quantity difference value, determining that the configuration message required to be issued to the equipment is lost; and when the queue length is equal to the message quantity difference value, determining that the configuration message which needs to be issued to the equipment is not lost.
In addition, after the full configuration message corresponding to the device is issued to the device, the number of the currently generated configuration messages and the number of the received configuration messages corresponding to the device are cleared, and the message queue corresponding to the device is cleared.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
FIG. 1 is a flow chart of a method for preventing message loss according to an embodiment of the present invention;
FIG. 2 is a flow chart of a detailed implementation of recording the number of currently generated configuration messages and the number of received configuration messages corresponding to the device using Mysql in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of another embodiment of a message loss prevention apparatus according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to another embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the following detailed description of the embodiments of the present invention will be given with reference to the accompanying drawings. However, those of ordinary skill in the art will understand that in various embodiments of the present invention, numerous technical details have been set forth in order to provide a better understanding of the present application. However, the technical solutions claimed in the present application can be implemented without these technical details and with various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not be construed as limiting the specific implementation of the present invention, and the embodiments can be mutually combined and referred to without contradiction.
In this embodiment, according to the number of currently generated configuration messages, the number of received configuration messages and a message queue corresponding to a device, it is determined whether the configuration messages issued to the device are lost, and whether the configuration messages are lost or not can be monitored without adding complex redundant information or algorithms.
The implementation details of the message loss prevention method of the present embodiment are specifically described below, and the following details are provided only for facilitating understanding, and are not necessary for implementing the present embodiment.
As shown in fig. 1, in step 101, according to the number of currently generated configuration messages, the number of received configuration messages and a message queue corresponding to a device, determining whether a configuration message issued to the device is lost;
in one example, a communication connection between the device and the server is created using the Websocket protocol. And the user operates the client to create or edit configuration data for the equipment, and the server generates a configuration message according to the configuration data and issues the configuration message to the equipment based on a Websocket protocol.
The Websocket protocol is a full duplex communication protocol based on TCP (Transmission Control Protocol ) that provides the ability to communicate bi-directionally over a single TCP connection. Compared with the traditional HTTP protocol (HyperText Transfer Protocol ), the WebSocket protocol has lower delay and higher instantaneity, and is suitable for real-time communication and push scenes.
It can be understood that the configuration messages for the device are generated sequentially according to the time sequence, a plurality of configuration messages may be generated in a time period, and the server issues the configuration messages to the device one by one according to the time sequence of the configuration messages. In one example, the number of currently generated configuration messages and the number of received configuration messages corresponding to the device are recorded by Mysql.
The current generated configuration message number refers to the accumulated number of configuration messages generated by a server and oriented to the equipment in a specific time period, and the received configuration message number refers to the number of messages that the server receives the equipment and returns to successfully receive the configuration messages. The two data can reflect the overall status of the sending and receiving of the configuration message between the device and the server in the specific time period through the current generated configuration message number and the received configuration message number.
Mysql is a powerful relational database management system that provides a persistence mechanism that can persist the number of currently generated and received configuration messages for the device. Even in the event of an abnormal shutdown or crash of the Mysql database, the consistency of the number of currently generated configuration messages and the number of received configuration messages of the device with the actual situation can still be maintained.
In a specific example, through the detailed implementation flow of the current generated configuration message number and the received configuration message number corresponding to the device recorded by Mysql, as shown in fig. 2, in step 11, a configuration message record table is created in Mysql, where the configuration message record table includes the current generated configuration message number and the received configuration message number, in step 12, when the generation of the configuration message corresponding to the device is monitored, the current generated configuration message number corresponding to the device is updated, for example, the current generated configuration message number+1 corresponding to the device is updated, in step 13, after receiving a message that the received configuration message returned by the device is successful, the received configuration message number corresponding to the device is updated, for example, the received configuration message number+1 corresponding to the device is updated.
The configuration message record table may further include an equipment address, and the number of currently generated configuration messages and the number of received configuration messages corresponding to different equipment are distinguished through the equipment address.
The generation and receiving conditions of the configuration message corresponding to the equipment can be centrally managed through the configuration message record table. Before the server issues the configuration message to the device, the server can quickly acquire the generation condition and the receiving condition of the configuration message of the corresponding device by querying the configuration message record table.
In a specific example, an ID node may be added to the configuration message, where the value of the ID node is a sequence number generated by the corresponding configuration message; analyzing the ID node carried in the message returned by the equipment and having successful configuration message reception, and when the value of the ID node obtained by analysis corresponds to the value of the ID node carried in the configuration message sent to the equipment, taking the value of the ID node obtained by analysis as the number of received configuration messages corresponding to the equipment.
For example, if the value of the ID node is set to the sequence number generated by the configuration message, the value of the ID node corresponding to the first configuration message is 1, the value of the ID node corresponding to the second configuration message is 2, and so on, the value of the ID node corresponding to the nth configuration message is N, where N is a natural number greater than or equal to 1.
By analyzing whether the obtained value of the ID node corresponds to the value of the ID node carried in the configuration message sent to the equipment, whether the configuration message carrying the ID node corresponds to the configuration message is successfully issued or not can be determined, the value of the ID node is set to be the sequence number generated by the configuration message, the accumulated number of the configuration messages of the equipment which is successfully issued at present can be determined, and the accuracy of the number of the received configuration messages corresponding to the equipment is ensured.
It will be appreciated that when the communication network between the server and the device fluctuates, breaks or is congested, there may be situations where the configuration messages are lost or the order in which the configuration messages are received by the device is turbulent. Therefore, in order to prevent the loss and the sequence disorder of the configuration messages, when the device cannot normally receive the configuration messages, the message queue can be used for storing the configuration messages which are not successfully received by the device according to the first-in first-out principle.
In one example, the List may be utilized to store the message queue by creating a List in Redis. Redis is a memory database, list is a data structure carried by Redis, and a message queue created by using List has the characteristics of first-in first-out, batch operation support and message persistence to disk support, and is suitable for a scene requiring quick message transmission. The data type of list in Redis can ensure the sequence of configuration messages.
It can be understood that, after the network between the server and the device is restored to be stable or the device is on line, it is required to preferentially determine whether the configuration message sent to the device is lost, so as to remedy the situation that the configuration message is lost, and ensure the integrity and the sequence of the configuration message of the device.
In a specific example, determining that a configuration message to be issued to the device is lost by calculating a queue length of the message queue, calculating a message number difference between the number of currently generated configuration messages and the number of received configuration messages, and determining whether the queue length is equal to the message number difference, when the queue length is not equal to the message number difference; and when the queue length is equal to the message quantity difference value, determining that the configuration message which needs to be issued to the equipment is not lost. And determining whether the configuration message issued to the equipment is lost or not according to the number of the currently generated configuration messages, the number of the received configuration messages and the message queue corresponding to the equipment.
The message queue stores the unsuccessfully received configuration messages of the device according to a first-in first-out principle, so that the length of the message queue indicates how many configuration messages are unsuccessfully issued to the device. In an exemplary embodiment, in a specific period of time, the number of currently generated configuration messages corresponding to the device a is 5, the number of received configuration messages is 3, and the length of the message queue is 2, which means that 5 configuration messages are currently accumulated, 3 configuration messages are actually successfully issued, 2 configuration messages are not issued, and 2 configuration messages are stored in the message queue, so that it can be determined that the configuration messages required to be issued to the device are not lost. Assuming that the number of currently generated configuration messages corresponding to the device a is 5, the number of received configuration messages is 3, and the queue length of the message queue is less than 2, it can be determined that the configuration message required to be issued to the device is lost.
According to the number of the currently generated configuration messages, the number of the received configuration messages and the message queue corresponding to the equipment, whether the configuration messages issued to the equipment are lost or not is determined, the condition that whether the configuration messages are lost or not can be monitored without adding complex redundant information or algorithms, preparation is made for guaranteeing the integrity of the configuration messages issued to the equipment, meanwhile, the configuration messages which are not successfully received by the equipment are stored by utilizing the message queue according to the first-in first-out principle, so that the configuration messages can be prevented from being lost, and the accuracy of the sequence of the configuration messages issued to the equipment can be guaranteed.
In step 102, when the configuration message is lost, transmitting a full configuration message corresponding to the device;
when the device is down or off-line, or when the communication network between the device and the server is unstable, the configuration message issued to the device may be lost. And under the condition that the configuration information is lost, the length of a message queue corresponding to the equipment, namely the number of the configuration information which is stored in the message queue and is not successfully received by the equipment, is not equal to the difference between the number of the configuration information which is currently generated by the equipment and the number of the received configuration information, namely the number of the configuration information which is not successfully issued to the equipment at present.
For the situation that the configuration message is lost, no matter how many configuration messages remain in the message queue corresponding to the device, the actual situation cannot be completely restored, and in order to ensure the integrity of the configuration message applied by the device finally, in one example, the full configuration message corresponding to the device needs to be obtained again, and when the device is online or the communication network is stable, the full configuration message is issued to the device.
In a specific example, the full configuration message may be obtained from a client operated by a user, for example, the user inputs configuration data related to the device through a specific Web interface, and the server generates the full configuration message corresponding to the device according to the configuration data input by the user.
When the device returns a message that the configuration message is successfully received, the message queue needs to be emptied, and the number of the currently generated configuration messages and the number of the received configuration messages corresponding to the device are cleared, so that preparation is made for sending a new round of configuration messages.
When the configuration message is lost, the integrity of the configuration message of the device application can be ensured by issuing the full configuration message.
In step 103, when the configuration message is not lost, the configuration message in the message queue is sequentially issued to the device.
In the case that the configuration message is not lost, the number of configuration messages which are not successfully received by the device and stored in the message queue are consistent with the number of configuration messages which are not successfully received by the device at present. I.e. the length of the message queue corresponding to the device is equal to the difference between the number of currently generated configuration messages and the number of received configuration messages corresponding to the device.
In the case that the configuration message is not lost, there are two cases, respectively:
in the first case, the message queue is empty, that is, the number of configuration messages currently generated by the device is equal to the number of received configuration messages, at this time, if the device is online or online, the newly generated configuration messages can be directly issued to the device, and if the device is offline, the newly generated configuration messages are written into the message queue.
In the second case, the message queue is not empty, which indicates that there is a configuration message that has not been successfully delivered, at this time, the currently generated configuration message is first inserted into the tail of the message queue, and then the configuration messages in the message queue are sequentially delivered to the device.
Similarly, after the device returns a message that the configuration message is successfully received, the message queue needs to be emptied, and the number of currently generated configuration messages and the number of received configuration messages corresponding to the device are cleared, so as to prepare for sending a new round of configuration messages.
Based on the characteristic that the message queue stores the unsuccessfully received configuration messages according to the first-in first-out principle, when the configuration messages are not lost, the configuration messages in the message queue are sequentially issued to the device, so that the occurrence sequence of the configuration messages applied by the device can be ensured not to be changed.
In this embodiment, according to the number of currently generated configuration messages, the number of received configuration messages and the message queue corresponding to the device, it is determined whether the configuration messages issued to the device are lost, and it is not necessary to add complex redundant information or an algorithm, so that whether the configuration messages are lost or not can be monitored, preparation is made for guaranteeing the integrity of the issued configuration messages, when the configuration messages are lost, the integrity of the configuration messages applied to the device is guaranteed by issuing a full amount of configuration messages, and meanwhile, based on the characteristics of the configuration messages which are not successfully received by the device and are stored by the message queue according to the first-in first-out principle, when the configuration messages are not lost, the configuration messages in the message queue are issued to the device in sequence, so that the occurrence sequence of the configuration messages applied to the device can be guaranteed.
The above method is divided into steps, which are only for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
Another embodiment of the present invention relates to a message loss preventing apparatus, as shown in fig. 3, comprising: the message loss judging module 301 is configured to determine whether a configuration message sent to a device is lost according to a number of currently generated configuration messages, a number of received configuration messages, and a message queue corresponding to the device, where the message queue is configured to store configuration messages that the device has not successfully received according to a first-in first-out principle; a message loss processing module 302, configured to issue a full configuration message corresponding to the device; and the message non-loss processing module 303 is configured to sequentially issue configuration messages in the message queue to the device.
In one example, the message loss judging module 301 is configured to determine whether the configuration message sent to the device is lost according to the number of currently generated configuration messages, the number of received configuration messages, and the message queue corresponding to the device.
In one example, the number of currently generated configuration messages and the number of received configuration messages corresponding to the device are recorded by Mysql. Comprising the following steps: creating a configuration message record table in Mysql, wherein the configuration message record table comprises the number of currently generated configuration messages and the number of received configuration messages; when the generation of the configuration message corresponding to the equipment is monitored, updating the number of the currently generated configuration messages corresponding to the equipment; and after receiving the message returned by the equipment and having successful configuration message reception, updating the number of the received configuration messages corresponding to the equipment.
In a specific example, an ID node may be added to the configuration message, where the value of the ID node is a sequence number generated by the corresponding configuration message; analyzing the ID node carried in the message returned by the equipment and having successful configuration message reception, and when the value of the ID node obtained by analysis corresponds to the value of the ID node carried in the configuration message sent to the equipment, taking the value of the ID node obtained by analysis as the number of received configuration messages corresponding to the equipment.
In one example, the List may be utilized to store the message queue by creating a List in Redis. Redis is a memory database, list is a data structure carried by Redis, and a message queue created by using List has the characteristics of first-in first-out, batch operation support and message persistence to disk support, and is suitable for a scene requiring quick message transmission. The data type of list in Redis can ensure the sequence of configuration messages.
In a specific example, determining that a configuration message to be issued to the device is lost by calculating a queue length of the message queue, calculating a message number difference between the number of currently generated configuration messages and the number of received configuration messages, and determining whether the queue length is equal to the message number difference, when the queue length is not equal to the message number difference; and when the queue length is equal to the message quantity difference value, determining that the configuration message which needs to be issued to the equipment is not lost. And determining whether the configuration message issued to the equipment is lost or not according to the number of the currently generated configuration messages, the number of the received configuration messages and the message queue corresponding to the equipment.
It is to be noted that this embodiment is an example of an apparatus corresponding to the above-described method embodiment, and this embodiment may be implemented in cooperation with the above-described method embodiment. The details of the related technology mentioned in the above method embodiment are still valid in this embodiment, and in order to reduce repetition, details are not repeated here. Accordingly, the related technical details mentioned in the present embodiment can also be applied to the above-described method embodiment.
It should be noted that each module in this embodiment is a logic module, and in practical application, one logic unit may be one physical unit, or may be a part of one physical unit, or may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, units that are not so close to solving the technical problem presented by the present invention are not introduced in the present embodiment, but this does not indicate that other units are not present in the present embodiment.
Another embodiment of the invention is directed to an electronic device, as shown in fig. 4, comprising at least one processor 401; and a memory 402 communicatively coupled to the at least one processor; the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401, so that the at least one processor 401 can execute the message loss prevention method as described above.
Where the memory 402 and the processor 401 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting the various circuits of the one or more processors 401 and the memory 402 together. The bus may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or may be a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 401 is transmitted over a wireless medium via an antenna, which further receives and transmits the data to the processor 401.
The processor 401 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 402 may be used to store data used by processor 401 in performing operations.
Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program implements the above-described method embodiments when executed by a processor.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments described herein. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples of carrying out the invention and that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (10)

1. A method for preventing message loss, the method comprising:
determining whether the configuration information issued to the equipment is lost or not according to the number of the currently generated configuration information, the number of the received configuration information and the information queue corresponding to the equipment, wherein the information queue is used for storing the configuration information which is not successfully received by the equipment according to the first-in first-out principle;
when the configuration information is lost, transmitting the full configuration information corresponding to the equipment;
and when the configuration message is not lost, sequentially issuing the configuration message in the message queue to the equipment.
2. The method for preventing message loss according to claim 1, wherein determining whether the configuration message sent to the device is lost according to the number of currently generated configuration messages, the number of received configuration messages and the message queue corresponding to the device further comprises:
the number of currently generated configuration messages and the number of received configuration messages are recorded by creating a configuration message record table in Mysql.
3. The method of claim 2, wherein the recording the current generated number of configuration messages and the received number of configuration messages by creating a configuration message record table in Mysql comprises:
creating a configuration message record table in Mysql, wherein the configuration message record table comprises the number of currently generated configuration messages and the number of received configuration messages;
when the generation of the configuration message corresponding to the equipment is monitored, updating the number of the currently generated configuration messages corresponding to the equipment;
and after receiving the message returned by the equipment and having successful configuration message reception, updating the number of the received configuration messages corresponding to the equipment.
4. The method for preventing message loss according to claim 1, wherein updating the number of received configuration messages corresponding to the device includes:
analyzing an ID node carried in a message returned by the equipment and having successful configuration message reception, wherein the value of the ID node is a sequence number generated by the corresponding configuration message, and when the value of the ID node obtained by analysis corresponds to the value of the ID node carried in the configuration message sent to the equipment, taking the value of the ID node obtained by analysis as the number of the received configuration messages corresponding to the equipment.
5. The method for preventing message loss according to claim 1, wherein determining whether the configuration message sent to the device is lost according to the number of currently generated configuration messages, the number of received configuration messages and the message queue corresponding to the device further comprises:
creating a List in Redis, and storing the message queue by using the List.
6. The method for preventing message loss according to claim 1, wherein determining whether the configuration message sent to the device is lost according to the number of currently generated configuration messages, the number of received configuration messages and the message queue corresponding to the device comprises:
calculating the length of the message queue and calculating the difference between the number of the currently generated configuration messages and the number of the received configuration messages;
when the queue length is not equal to the message quantity difference value, determining that the configuration message required to be issued to the equipment is lost;
and when the queue length is equal to the message quantity difference value, determining that the configuration message which needs to be issued to the equipment is not lost.
7. The method for preventing message loss according to claim 1, wherein after the transmitting the full configuration message corresponding to the device, the method further comprises:
clearing a message queue corresponding to the equipment and
and clearing the number of the currently generated configuration messages and the number of the received configuration messages corresponding to the equipment.
8. A message loss prevention apparatus, comprising:
the message loss judging module is used for determining whether the configuration message issued to the equipment is lost or not according to the number of the currently generated configuration messages, the number of the received configuration messages and a message queue corresponding to the equipment, wherein the message queue is used for storing the configuration message which is not successfully received by the equipment according to the first-in first-out principle;
the message loss processing module is used for issuing the full configuration message corresponding to the equipment;
and the message non-loss processing module is used for sequentially issuing the configuration messages in the message queue to the equipment.
9. An electronic device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message loss prevention method of any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method of preventing message loss of any one of claims 1 to 7.
CN202311849223.0A 2023-12-28 2023-12-28 Message loss prevention method and device, electronic equipment and storage medium Pending CN117834548A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311849223.0A CN117834548A (en) 2023-12-28 2023-12-28 Message loss prevention method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311849223.0A CN117834548A (en) 2023-12-28 2023-12-28 Message loss prevention method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117834548A true CN117834548A (en) 2024-04-05

Family

ID=90512633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311849223.0A Pending CN117834548A (en) 2023-12-28 2023-12-28 Message loss prevention method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117834548A (en)

Similar Documents

Publication Publication Date Title
CN113411264B (en) Network queue monitoring method and device, computer equipment and storage medium
JP2515075B2 (en) Local area network for digital data processing system
US8041832B2 (en) Network data distribution system and method
US20070073822A1 (en) Deferred acknowledgment communications and alarm management
CN112804078B (en) Bandwidth adjustment method, service transmission method, network device and readable storage medium
US20080028090A1 (en) System for managing messages transmitted in an on-chip interconnect network
KR20060063652A (en) Efficient transfer of messages using reliable messaging protocols for web services
US20240007404A1 (en) Local and global quality of service shaper on ingress in a distributed system
US8185912B1 (en) Rerouting messages to parallel queue instances
US20170289066A1 (en) Facilitating communication of data packets using credit-based flow control
CN115174432B (en) RDMA network state monitoring method, device, equipment and readable storage medium
JP5738324B2 (en) Transmission device, communication device, communication system, and transmission method
US7453808B2 (en) Throttling network management and element management system messaging
US10673768B2 (en) Managing data compression
CN114978433A (en) Data transmission method, device, equipment, storage medium and computer program product
CN117834548A (en) Message loss prevention method and device, electronic equipment and storage medium
CN111064768B (en) Printer data transmission control method, device, equipment and storage medium
CN110460486B (en) Service node monitoring method and system
US6657961B1 (en) System and method for enhanced end station to end station data flow control
KR101427871B1 (en) Apparatus for monitoring status of ecu based on can communication in heterogeneous network and method thereof
CN111131066A (en) Traffic shaping method and device
US8254380B2 (en) Managing messages transmitted in an interconnect network
CN112506735B (en) Service quality monitoring method, system, server and storage medium
CN114640385B (en) Data transmission method based on Beidou communication system and electronic equipment
CN112749398B (en) Data transmission channel control method and system

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