CN115086263B - IM message sending method, system, storage medium and computer equipment of IOS terminal - Google Patents
IM message sending method, system, storage medium and computer equipment of IOS terminal Download PDFInfo
- Publication number
- CN115086263B CN115086263B CN202210865948.8A CN202210865948A CN115086263B CN 115086263 B CN115086263 B CN 115086263B CN 202210865948 A CN202210865948 A CN 202210865948A CN 115086263 B CN115086263 B CN 115086263B
- Authority
- CN
- China
- Prior art keywords
- message
- app
- ios terminal
- keep
- retry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000005540 biological transmission Effects 0.000 claims description 62
- 238000004590 computer program Methods 0.000 claims description 17
- 230000007246 mechanism Effects 0.000 claims description 9
- 238000012544 monitoring process Methods 0.000 claims description 3
- 230000004083 survival effect Effects 0.000 claims description 3
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 238000012545 processing Methods 0.000 description 20
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 8
- 238000003491 array Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012550 audit Methods 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000008447 perception Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000000725 suspension Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/07—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
- H04L51/10—Multimedia information
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer And Data Communications (AREA)
- Communication Control (AREA)
Abstract
The invention provides a method, a system, a storage medium and computer equipment for sending IM information of an IOS terminal, which relate to the technical field of artificial intelligence and comprise the following steps: when an APP of an IOS terminal is switched to a background, finishing the IM message being transmitted by the APP within the keep-alive time, wherein the keep-alive time is used for the APP to finish the IM message being transmitted; and acquiring a retry parameter, and retransmitting the IM message based on the retry parameter when the IM message fails to be transmitted. The IM message sending method, the system, the storage medium and the computer equipment of the IOS terminal can greatly reduce the receiving and transmitting failure rate of the IM message, and the user does not feel, so that the user experience is greatly improved.
Description
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to an IM message sending method, an IM message sending system, a storage medium and computer equipment of an IOS terminal.
Background
As shown in fig. 1, in the application scenario of online inquiry, the inquiry function of the host client and doctor client as IOS terminals is instant messaging (Instant Messaging, IM) implemented based on socket. IM allows two or more people to communicate text messages, files, voice, and video in real time using a network.
In the case of good network conditions, messaging between the host client and the doctor client is completed within 1 second. However, with the rapid increase of the number of users, various unexpected situations can occur in the existing online inquiry system, such as that if users cannot send messages or receive messages in real time when using the online inquiry system, the failure rate of message sending is as high as 0.3% to 0.4%, so that the user experience is seriously affected.
The reasons for the failure of the IOS terminal message transmission mainly comprise the following steps:
(1) Due to the unique mechanism of IOS, APP will be suspended when the user switches to the background, and all ongoing network requests will be discontinued. Thus, if the message is not yet sent to the server, the message will fail to be sent.
(2) Since a picture or voice type file is large, a long transmission time is required. If APP hangs up during transmission, this results in message transmission failure.
Therefore, there is an urgent need to improve the failure rate of the IM messaging of the IOS terminal, so as to meet the actual requirement of the IOS terminal for messaging.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method, a system, a storage medium, and a computer device for sending IM messages for an IOS terminal, which can greatly reduce the failure rate of sending and receiving IM messages, and the user has no perception, so that the user experience is greatly improved.
To achieve the above and other related objects, the present invention provides a method for transmitting IM messages of an IOS terminal, comprising the steps of: when an APP of an IOS terminal is switched to a background, the IOS terminal establishes an APP keep-alive task to provide keep-alive time with preset duration, wherein the keep-alive time is used for the APP to send and finish IM messages being sent; and acquiring a retry parameter, and retransmitting the IM message based on the retry parameter when the IM message fails to be transmitted.
The invention provides an IM message sending system of an IOS terminal, which comprises:
the keep-alive module is used for establishing an APP keep-alive task by the IOS terminal to provide keep-alive time with preset duration when the APP of the IOS terminal is switched to the background, wherein the keep-alive time is used for the APP to send and finish the IM message being sent;
and the retry module is used for acquiring retry parameters, and retransmitting the IM message based on the retry parameters when the IM message transmission fails.
The invention provides a computer device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the IM message sending method of the IOS terminal when executing the computer program.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the IM messaging method of an IOS terminal described above.
As described above, the IM message sending method, the system, the storage medium and the computer device of the IOS terminal have the following beneficial effects:
(1) Through setting the APP keep-alive task and the retry mechanism, the IM message receiving and transmitting failure rate between the IOS terminals can be greatly reduced;
(2) The establishment of the keep-alive task and the retransmission of the IM message are carried out in the background, so that the user does not feel, and the user experience is greatly improved;
(3) The method has the advantages that the method plays a great role in functions of other interfaces, particularly in background keep-alive functions, and when the APP is switched to the background, the calling interface can be executed for a sufficient time, so that the interface failure rate is greatly reduced.
Drawings
FIG. 1 is a flow chart illustrating a prior art IM messaging method in one embodiment;
FIG. 2 is a flow chart of an IM messaging method for an IOS terminal according to one embodiment of the invention;
FIG. 3 is a schematic diagram showing the effect of the IM message sending method of the IOS terminal according to the invention;
FIG. 4 is a schematic diagram illustrating the structure of an IM messaging system for an IOS terminal according to one embodiment of the invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the invention.
Description of element reference numerals
41. Keep-alive module
42. Retry module
51. Processor/processing unit
52. Memory device
521. Random access memory
522. Cache memory
523. Storage system
524. Program/utility tool
5241. Program module
53. Bus line
54. Input/output interface
55. Network adapter
Detailed Description
Other advantages and effects of the present invention will become apparent to those skilled in the art from the following disclosure, which describes the embodiments of the present invention with reference to specific examples. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention.
It should be noted that, the illustrations provided in the present embodiment merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complex.
According to the IM message sending method, the system, the storage medium and the computer equipment of the IOS terminal, through setting the APP keep-alive task and the retry mechanism, the receiving and transmitting failure rate of the IM message can be greatly reduced, and even the receiving and transmitting failure rate can be reduced by one order of magnitude; meanwhile, the user does not feel the sending of the IM message, and the user experience is greatly improved.
As shown in fig. 2, in one embodiment, the IM message transmission method of the IOS terminal of the present invention includes the following steps:
step S1, when an APP of an IOS terminal is switched to a background, the IOS terminal establishes an APP keep-alive task to provide keep-alive time with preset duration, wherein the keep-alive time is used for the APP to send and finish IM messages being sent.
Specifically, at the IOS terminal, the APP exiting to the background is typically suspended for a few seconds or so. Different devices and operating states may affect the hang time of the APP. The suspension time of APP under different operating conditions may vary between 5S and 10S for the same device. In the invention, when the APP is switched to the background, in order to avoid interruption of the current message transmission, an APP keep-alive task is established, so that the APP can still transmit the IM message within the preset time length specified by the keep-alive task, and the socket connection is actively disconnected when the keep-alive task is ended. It should be noted that, adding the APP keep-alive task is allowed by the IOS system, and the APP audit is not affected, so the method has extremely strong safety and feasibility.
In an embodiment of the present invention, the preset duration is set to 30 seconds.
In one embodiment of the present invention, establishing an APP keep-alive task includes the steps of:
11 When the APP of the IOS terminal is switched to the background, wake-up information is sent to the APP.
12 Building the APP keep-alive task based on the wake-up information to place the APP in a surviving state.
Preferably, wake-up information is sent to the APP according to a preset period, so that the APP is always in a survival state.
And S2, acquiring retry parameters, and retransmitting the IM message based on the retry parameters when the IM message fails to be transmitted.
In an embodiment of the present invention, obtaining a retry parameter, and retransmitting the IM message based on the retry parameter when the transmission of the IM message fails, includes the steps of:
21 A total timeout period threshold, a single timeout period threshold, and a number of retries are obtained.
Specifically, the IOS terminal is preset with a total timeout duration threshold, a single timeout duration threshold and retry times.
The single timeout period threshold represents a timeout period threshold when the IM message is sent once. If the single transmission time length is smaller than the single timeout time length threshold, judging that the single transmission has no timeout; and if the single transmission time length is greater than or equal to the single timeout time length threshold, judging that the single transmission is timeout.
The total timeout period threshold represents a timeout threshold for a total duration of multiple transmissions of the IM message. If the time length of the multiple transmissions is smaller than the total timeout time length threshold, judging that the multiple transmissions have no timeout; and if the time length of the multiple transmissions is greater than or equal to the total timeout duration threshold, judging that the multiple transmissions are overtime.
The retry number indicates the number of times an IM message can be retransmitted after a transmission failure.
In an embodiment of the present invention, the total timeout period threshold is set to 120 seconds; the single timeout period threshold is set to 15 seconds; the number of retries was set to 8. It should be noted that the above parameter setting may be flexibly set according to different application scenarios and devices, and is not limited to the above limitation.
22 If the single transmission time of the IM message is longer than the single timeout period threshold, retransmitting the IM message.
Specifically, in order to ensure the effective transmission of the IM message, when the single transmission time of the IM message is longer than 15 seconds, it is determined that the transmission of the IM message is overtime, and retransmission is required. It should be noted that, the retransmission of the IM message is automatically performed by the system, and the user does not need to feel, or manually operate, and the use experience of the user is not affected.
Preferably, when the number of retransmission times of the IM message reaches a preset number of times, the APP actively disconnects the socket connection and then reestablishes the socket connection to retransmit the IM message, thereby improving the success rate of transmission of the IM message. Preferably, the preset number of times is 3.
23 Record the number of retransmissions in real time and the cumulative length.
Specifically, a real-time number counter and an accumulated time length counter can be set, the real-time number counter is updated according to the actual retransmission number, and the accumulated time length counter is updated according to the actual transmission time length.
24 When the real-time number is larger than the retry number or the accumulated time length is larger than the total timeout time length threshold, judging that the IM message transmission fails; and retransmitting the IM message when the real-time number is smaller than or equal to the retry number and the accumulated time length is smaller than or equal to the total timeout time length threshold.
Specifically, the real-time times and the accumulated time length are monitored, and when the two conditions that the real-time times are greater than the retry times and the accumulated time length is greater than the total timeout time length threshold value are met, the IM message transmission failure is judged, and retransmission is not performed.
In an embodiment of the present invention, the method for sending IM messages of the IOS terminal further includes monitoring a current network state, and controlling socket connection of the APP according to different network states, so as to ensure normal sending of the IM messages. Specifically, if the current network state is a disconnected state, the APP disconnects the socket connection. If the current network state is the connection state, the APP is caused to reestablish socket connection. When the network state is disconnected and reconnected, the APP is required to reestablish the socket connection.
In an embodiment of the present invention, the method for sending IM messages of the IOS terminal further includes setting an automatic retransmission mechanism when the type of the IM message is a picture or a voice file. Specifically, when the type of the IM message is a picture or a voice file, a transmission failure is liable to occur. Therefore, the invention automatically sets a retransmission mechanism with preset times for the IM information of the picture or the voice file. When the IM message of the picture or the voice file fails to be sent, the preset times of retransmission are automatically carried out, so that the sending success rate of the IM message is improved as much as possible.
The IM messaging method of the IOS terminal of the present invention is further illustrated by the following specific embodiments.
Example 1
In this embodiment, user a needs to send video information to user B based on the WeChat APP in the smartphone. After the user a sends the video information in the WeChat APP, the user may exit the WeChat APP. At this time, the WeChat APP runs in the background. Because the video information occupies a larger storage space, the WeChat APP needs to continue sending the video information in the background. First, an APP keep-alive task is established to provide a keep-alive time of 30 s. That is, the WeChat APP can still transmit the video information in the background within 30 s. And if the video information is failed to be sent, retransmitting. If the transmission is not successful within 60s or the retransmission is not successful 3 times, the retransmission of the video information is stopped.
Example two
In this embodiment, user a needs to send image information to user B based on the flybook APP in the smartphone. After user a sends image information in flyer APP, the user may exit flyer APP. At this time, the flyer APP runs in the background. Because the image information occupies a large storage space, the flyer book APP needs to continue sending the image information in the background. First, an APP keep-alive task is established to provide a keep-alive time of 20 s. That is, the flyer APP can still transmit the image information in the background within 20 s. And if the image information is failed to be sent, retransmitting. If the transmission is not successful within 40s or the retransmission is not successful 3 times, the retransmission of the image information is stopped.
Example III
In this embodiment, user a needs to send audio information to user B based on QQAPP in the smartphone. After user a sends the audio information in the QQAPP, the user may exit the QQAPP. At this time, the QQAPP runs in the background. Because the audio information occupies a larger storage space, the QQAPP needs to continue to transmit the audio information in the background. First, an APP keep-alive task is established to provide a keep-alive time of 20 s. That is, the QQAPP can still transmit the audio information in the background within 20 s. And if the audio information is failed to be sent, retransmitting. If the transmission is not successful within 60 seconds or the retransmission is not successful for 5 times, the retransmission of the audio information is stopped.
As shown in fig. 3, for IM message transmission between two IOS terminals, such as a doctor terminal and a host client, the IM message transmission method of the IOS terminal of the present invention can effectively reduce failure rate of IM message transmission, can meet requirements of actual application scenarios, and has no perception between the doctor terminal and the host client.
It should be noted that, the above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they contain the same logic relationship, and they are all within the protection scope of the present 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.
As shown in fig. 4, in one embodiment, the IM messaging system of the IOS terminal of the present invention comprises:
the keep-alive module 41 is configured to, when the APP of the IOS terminal switches to the background, establish an APP keep-alive task for the IOS terminal to provide a keep-alive time with a preset duration, where the keep-alive time is used for the APP to send an IM message that is being sent to complete.
Specifically, at the IOS terminal, the APP exiting to the background is typically suspended for a few seconds or so. Different devices and operating states may affect the hang time of the APP. The suspension time of APP under different operating conditions may vary between 5S and 10S for the same device. In the invention, when the APP is switched to the background, in order to avoid interruption of the current message transmission, an APP keep-alive task is established, so that the APP can still transmit the IM message within the preset time length specified by the keep-alive task, and the socket connection is actively disconnected when the keep-alive task is ended. It should be noted that, adding the APP keep-alive task is allowed by the IOS system, and the APP audit is not affected, so the method has extremely strong safety and feasibility.
In an embodiment of the present invention, the preset duration is set to 30 seconds.
In one embodiment of the present invention, establishing an APP keep-alive task includes the steps of:
11 When the APP of the IOS terminal is switched to the background, wake-up information is sent to the APP.
12 Building the APP keep-alive task based on the wake-up information to place the APP in a surviving state.
Preferably, wake-up information is sent to the APP according to a preset period, so that the APP is always in a survival state.
And S2, acquiring retry parameters, and retransmitting the IM message based on the retry parameters when the IM message fails to be transmitted.
In an embodiment of the present invention, obtaining a retry parameter, and retransmitting the IM message based on the retry parameter when the transmission of the IM message fails, includes the steps of:
21 A total timeout period threshold, a single timeout period threshold, and a number of retries are obtained.
Specifically, the IOS terminal is preset with a total timeout duration threshold, a single timeout duration threshold and retry times.
The single timeout period threshold represents a timeout period threshold when the IM message is sent once. If the single transmission time length is smaller than the single timeout time length threshold, judging that the single transmission has no timeout; and if the single transmission time length is greater than or equal to the single timeout time length threshold, judging that the single transmission is timeout.
The total timeout period threshold represents a timeout threshold for a total duration of multiple transmissions of the IM message. If the time length of the multiple transmissions is smaller than the total timeout time length threshold, judging that the multiple transmissions have no timeout; and if the time length of the multiple transmissions is greater than or equal to the total timeout duration threshold, judging that the multiple transmissions are overtime.
The retry number indicates the number of times an IM message can be retransmitted after a transmission failure.
In an embodiment of the present invention, the total timeout period threshold is set to 120 seconds; the single timeout period threshold is set to 15 seconds; the number of retries was set to 8. It should be noted that the above parameter setting may be flexibly set according to different application scenarios and devices, and is not limited to the above limitation.
22 If the single transmission time of the IM message is longer than the single timeout period threshold, retransmitting the IM message.
Specifically, in order to ensure the effective transmission of the IM message, when the single transmission time of the IM message is longer than 15 seconds, it is determined that the transmission of the IM message is overtime, and retransmission is required. It should be noted that, the retransmission of the IM message is automatically performed by the system, and the user does not need to feel, or manually operate, and the use experience of the user is not affected.
Preferably, when the number of retransmission times of the IM message reaches a preset number of times, the APP actively disconnects the socket connection and then reestablishes the socket connection to retransmit the IM message, thereby improving the success rate of transmission of the IM message. Preferably, the preset number of times is 3.
23 Record the number of retransmissions in real time and the cumulative length.
Specifically, a real-time number counter and an accumulated time length counter can be set, the real-time number counter is updated according to the actual retransmission number, and the accumulated time length counter is updated according to the actual transmission time length.
24 When the real-time number is larger than the retry number or the accumulated time length is larger than the total timeout time length threshold, judging that the IM message transmission fails; and retransmitting the IM message when the real-time number is smaller than or equal to the retry number and the accumulated time length is smaller than or equal to the total timeout time length threshold.
Specifically, the real-time times and the accumulated time length are monitored, and when the two conditions that the real-time times are greater than the retry times and the accumulated time length is greater than the total timeout time length threshold value are met, the IM message transmission failure is judged, and retransmission is not performed.
In an embodiment of the present invention, the IM message sending system of the IOS terminal further includes a monitoring module, configured to monitor a current network state, and control socket connection of the APP according to different network states, so as to ensure normal sending of the IM message. Specifically, if the current network state is a disconnected state, the APP disconnects the socket connection. If the current network state is the connection state, the APP is caused to reestablish socket connection. When the network state is disconnected and reconnected, the APP is required to reestablish the socket connection.
In an embodiment of the present invention, the IM messaging system of the IOS terminal further includes a setting module configured to set an automatic retransmission mechanism when the type of the IM message is a picture or a voice file. Specifically, when the type of the IM message is a picture or a voice file, a transmission failure is liable to occur. Therefore, the invention automatically sets a retransmission mechanism with preset times for the IM information of the picture or the voice file. When the IM message of the picture or the voice file fails to be sent, the preset times of retransmission are automatically carried out, so that the sending success rate of the IM message is improved as much as possible.
It should be noted that, the IM messaging system of the IOS terminal of the present invention may be implemented in a personal mobile terminal, or may be implemented in a server, which may be implemented in the device in the form of a program, or may be implemented as a system component in the device, or may be implemented as a cloud service program, where a specific operation mode is determined according to an actual scenario, and is not limited herein.
It should be noted that, it should be understood that the division of the modules of the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the x module may be a processing element that is set up separately, may be implemented in a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and the function of the x module may be called and executed by a processing element of the apparatus. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (Digital Singnal Processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
The computer readable storage medium of the present invention stores thereon a computer program which, when executed by a processor, implements the steps of the IM message transmission method of an IOS terminal described above. Preferably, the storage medium includes: various media capable of storing program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
Any combination of one or more storage media may be employed. The storage medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The present invention is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks (article of manufacture).
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
In one embodiment, the computer device of the present invention includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the IM messaging method of the IOS terminal described above when the computer program is executed.
The memory includes: various media capable of storing program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field programmable gate arrays (Field Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
As shown in FIG. 5, the computer device of the present invention is embodied in the form of a general purpose computing device. Components of a computer device may include, but are not limited to: one or more processors or processing units 51, a memory 52, a bus 53 that connects the various system components, including the memory 52 and the processing unit 51.
Bus 53 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer devices typically include a variety of computer system readable media. Such media can be any available media that can be accessed by the computer device and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 52 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 521 and/or cache memory 522. The computer device may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 523 may be used to read from or write to non-removable, nonvolatile magnetic media (commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be coupled to bus 53 through one or more data medium interfaces. Memory 52 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 524 having a set (at least one) of program modules 5241 may be stored in, for example, memory 52, such program modules 5241 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 5241 generally perform the functions and/or methods in the described embodiments of the invention.
A computer device may also communicate with one or more external devices (e.g., keyboard, pointing device, display, etc.), with one or more devices that enable a user to interact with the computer device, and/or with any device (e.g., network card, modem, etc.) that enables the computer device to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 54. Also, the computer device may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 55. As shown in fig. 5, the network adapter 55 communicates with other modules of the computer device via bus 53. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in connection with a computer device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
In summary, the IM message sending method, system, storage medium and computer device of the IOS terminal can greatly reduce the failure rate of IM message sending and receiving between the IOS terminals by setting the APP keep-alive task and retry mechanism; the establishment of the keep-alive task and the retransmission of the IM message are carried out in the background, so that the user does not feel, and the user experience is greatly improved; the method has the advantages that the method plays a great role in functions of other interfaces, particularly in background keep-alive functions, and when the APP is switched to the background, the calling interface can be executed for a sufficient time, so that the interface failure rate is greatly reduced. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. Accordingly, it is intended that all equivalent modifications and variations of the invention be covered by the claims, which are within the ordinary skill of the art, be within the spirit and scope of the present disclosure.
Claims (9)
1. An IM message transmission method of an IOS terminal, comprising the steps of:
when an APP of an IOS terminal is switched to a background, the IOS terminal establishes an APP keep-alive task to provide keep-alive time with preset duration, wherein the keep-alive time is used for the APP to send and finish IM messages being sent;
acquiring retry parameters, and retransmitting the IM message based on the retry parameters when the IM message transmission fails;
wherein, obtaining a retry parameter, and retransmitting the IM message based on the retry parameter when the IM message transmission fails, comprises the steps of:
acquiring a total timeout duration threshold, a single timeout duration threshold and retry times;
retransmitting the IM message when the single transmission time of the IM message is longer than the single timeout time threshold;
recording the real-time number and the accumulated time length of retransmission;
when the real-time times are larger than the retry times or the accumulated time length is larger than the total timeout time length threshold, judging that the IM message transmission fails;
and retransmitting the IM message when the real-time number is smaller than or equal to the retry number and the accumulated time length is smaller than or equal to the total timeout time length threshold.
2. The IM messaging method of an IOS terminal according to claim 1, wherein the IOS terminal establishing an APP keep-alive task to provide a keep-alive time of a preset duration comprises the steps of:
when an APP of an IOS terminal is switched to a background, wake-up information is sent to the APP;
and constructing the APP keep-alive task based on the wake-up information so as to enable the APP to be in a survival state.
3. The IM messaging method of an IOS terminal according to claim 2, wherein when an APP switches to a background, transmitting wake-up information to the APP comprises: and sending wake-up information to the APP according to a preset period.
4. The IM messaging method of an IOS terminal according to claim 1, wherein the IM messaging method of an IOS terminal further comprises: when the retransmission times of the IM message reach the preset times, the APP actively disconnects the socket connection and then reestablishes the socket connection so as to retransmit the IM message.
5. The IM messaging method of an IOS terminal according to claim 1, wherein the IM messaging method of an IOS terminal further comprises: monitoring the current network state, and controlling socket connection of the APP according to different network states.
6. The IM messaging method of an IOS terminal according to claim 1, wherein the IM messaging method of an IOS terminal further comprises: and when the type of the IM message is a picture or voice file, setting an automatic retransmission mechanism.
7. An IM messaging system for an IOS terminal, comprising:
the keep-alive module is used for establishing an APP keep-alive task by the IOS terminal to provide keep-alive time with preset duration when the APP of the IOS terminal is switched to the background, wherein the keep-alive time is used for the APP to send and finish the IM message being sent;
a retry module, configured to obtain a retry parameter, and resend the IM message based on the retry parameter when the sending of the IM message fails;
the IM message sending system of the IOS terminal is also used for
Acquiring a total timeout duration threshold, a single timeout duration threshold and retry times;
retransmitting the IM message when the single transmission time of the IM message is longer than the single timeout time threshold;
recording the real-time number and the accumulated time length of retransmission;
when the real-time times are larger than the retry times or the accumulated time length is larger than the total timeout time length threshold, judging that the IM message transmission fails;
and retransmitting the IM message when the real-time number is smaller than or equal to the retry number and the accumulated time length is smaller than or equal to the total timeout time length threshold.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the IM messaging method of the IOS terminal of any one of claims 1 to 6 when the computer program is executed by the processor.
9. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the IM messaging method of the IOS terminal of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210865948.8A CN115086263B (en) | 2022-07-22 | 2022-07-22 | IM message sending method, system, storage medium and computer equipment of IOS terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210865948.8A CN115086263B (en) | 2022-07-22 | 2022-07-22 | IM message sending method, system, storage medium and computer equipment of IOS terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115086263A CN115086263A (en) | 2022-09-20 |
CN115086263B true CN115086263B (en) | 2024-04-05 |
Family
ID=83243314
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210865948.8A Active CN115086263B (en) | 2022-07-22 | 2022-07-22 | IM message sending method, system, storage medium and computer equipment of IOS terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115086263B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104145466A (en) * | 2012-02-24 | 2014-11-12 | 诺基亚公司 | Method and apparatus for dynamic server|client controlled connectivity logic |
CN108768595A (en) * | 2018-05-16 | 2018-11-06 | 中国科学院信息工程研究所 | The monitoring retransmission method and system of the real-time new information of mobile terminal based on Android |
CN110928586A (en) * | 2019-11-15 | 2020-03-27 | 上海银基信息安全技术股份有限公司 | APP background keep-alive method and device |
CN111782431A (en) * | 2020-06-22 | 2020-10-16 | 深圳乐信软件技术有限公司 | Exception processing method, exception processing device, terminal and storage medium |
CN112769876A (en) * | 2019-10-21 | 2021-05-07 | 浙江宇视科技有限公司 | Method, device, equipment and medium for acquiring equipment channel information |
CN112887416A (en) * | 2021-02-04 | 2021-06-01 | 浙江大华技术股份有限公司 | Frequency adjustment method and device for sending keep-alive packets |
CN112951241A (en) * | 2021-01-29 | 2021-06-11 | 思必驰科技股份有限公司 | Pickup recognition method and system for IOS |
CN113890894A (en) * | 2021-10-19 | 2022-01-04 | 平安普惠企业管理有限公司 | Keep-alive method and device for client communication link, electronic equipment and storage medium |
-
2022
- 2022-07-22 CN CN202210865948.8A patent/CN115086263B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104145466A (en) * | 2012-02-24 | 2014-11-12 | 诺基亚公司 | Method and apparatus for dynamic server|client controlled connectivity logic |
CN108768595A (en) * | 2018-05-16 | 2018-11-06 | 中国科学院信息工程研究所 | The monitoring retransmission method and system of the real-time new information of mobile terminal based on Android |
CN112769876A (en) * | 2019-10-21 | 2021-05-07 | 浙江宇视科技有限公司 | Method, device, equipment and medium for acquiring equipment channel information |
CN110928586A (en) * | 2019-11-15 | 2020-03-27 | 上海银基信息安全技术股份有限公司 | APP background keep-alive method and device |
CN111782431A (en) * | 2020-06-22 | 2020-10-16 | 深圳乐信软件技术有限公司 | Exception processing method, exception processing device, terminal and storage medium |
CN112951241A (en) * | 2021-01-29 | 2021-06-11 | 思必驰科技股份有限公司 | Pickup recognition method and system for IOS |
CN112887416A (en) * | 2021-02-04 | 2021-06-01 | 浙江大华技术股份有限公司 | Frequency adjustment method and device for sending keep-alive packets |
CN113890894A (en) * | 2021-10-19 | 2022-01-04 | 平安普惠企业管理有限公司 | Keep-alive method and device for client communication link, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115086263A (en) | 2022-09-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109474688B (en) | Method, device, equipment and medium for sending instant communication network request message | |
CN110971922B (en) | Live broadcast and microphone connection state monitoring method, client, server, medium and system | |
US10530716B2 (en) | Voice chat mode self-adapting method and apparatus | |
CN110839084A (en) | Session management method, device, equipment and medium | |
US20110016190A1 (en) | Method and apparatus for realizing message service | |
CN104866290A (en) | Method and device for data transmission | |
CN111790159B (en) | Data processing method, device, equipment and computer readable storage medium | |
US9749825B2 (en) | Connection-oriented messaging and signaling in mobile heath networks | |
CN112769876B (en) | Method, device, equipment and medium for acquiring equipment channel information | |
CN115086263B (en) | IM message sending method, system, storage medium and computer equipment of IOS terminal | |
WO2020177731A1 (en) | Real-time communication method between hosted applications | |
CN112887420A (en) | Message pushing method and device, computer readable storage medium and electronic equipment | |
CN110365839B (en) | Shutdown method, shutdown device, shutdown medium and electronic equipment | |
CN114567536B (en) | Abnormal data processing method, device, electronic equipment and storage medium | |
CN115242972B (en) | Method and device for calling camera by application, electronic equipment and storage medium | |
CN115934378A (en) | Service data processing method and device, electronic equipment and storage medium | |
CN114286039A (en) | Audio and video call method and system | |
CN113452948B (en) | Conference terminal control method, device, equipment and storage medium | |
CN114189890A (en) | Method, device, equipment and storage medium for updating network service quality model | |
CN113259404B (en) | Industrial communication middleware based on TCP/IP protocol and use method thereof | |
CN111385167B (en) | Network connection recovery method, device, computer device and storage medium | |
CN114244700A (en) | Port processing method and device, electronic equipment and computer readable storage medium | |
CN102752743B (en) | Method, device and system for processing information of mobile equipment | |
CN112615916A (en) | File deployment method and device, electronic equipment and storage medium | |
CN110798398A (en) | Group message management method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |