CN115086263A - 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
- CN115086263A CN115086263A CN202210865948.8A CN202210865948A CN115086263A CN 115086263 A CN115086263 A CN 115086263A CN 202210865948 A CN202210865948 A CN 202210865948A CN 115086263 A CN115086263 A CN 115086263A
- Authority
- CN
- China
- Prior art keywords
- message
- app
- ios terminal
- keep
- alive
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 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
- 230000005540 biological transmission Effects 0.000 description 26
- 238000012545 processing Methods 0.000 description 18
- 230000006870 function Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000012550 audit Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
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 an IM message sending method, a system, a storage medium and computer equipment of an IOS terminal, which relate to the technical field of artificial intelligence and comprise the following steps: when the APP of the IOS terminal is switched to a background, the APP sends an IM message which is sent in the keep-alive time, and the keep-alive time is used for the APP to send the IM message which is sent in the keep-alive time; 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 IM message sending system, the IM message sending storage medium and the IM message sending computer equipment of the IOS terminal can greatly reduce the receiving and sending failure rate of the IM messages, and users can not perceive the IM messages, 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, a system, a storage medium and computer equipment of an IOS terminal.
Background
As shown in fig. 1, in an application scenario of online inquiry, an inquiry function of a host client and a doctor client as IOS terminals is 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.
Under the condition of good network condition, the message receiving and sending between the main client end and the doctor end are completed within 1 second. However, with the rapid increase of the number of users, various unexpected situations may occur in the existing online inquiry system, and if some users cannot send or receive messages instantly when in use, the failure rate of message sending is as high as 0.3% to 0.4%, thereby seriously affecting the user experience.
Through analysis, the reasons for the failure of sending the message by the IOS terminal mainly include the following:
(1) due to the mechanism specific to IOS, when the user switches to the background, APP will hang and all ongoing network requests will be interrupted. Therefore, if the message is not sent to the server, the message is sent unsuccessfully.
(2) Since the picture or voice type file is large, a long transmission time is required. If the APP is suspended during the transmission process, the message transmission will fail.
Therefore, it is urgently needed to increase the failure rate of receiving and sending IM messages of the IOS terminal so as to meet the actual requirements of receiving and sending messages of the IOS terminal.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide an IM message sending method, system, storage medium, and computer device for an IOS terminal, which can greatly reduce the failure rate of sending and receiving IM messages, make users unaware, and greatly improve user experience.
In order to achieve the above and other related objects, the present invention provides an IM message sending 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 an IM message which is 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 system comprises a keep-alive module, a keep-alive module and a control module, wherein 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 a background, and the keep-alive time is used for allowing the APP to send an IM message which is sent when the APP finishes sending;
and the retry module is used for acquiring retry parameters and resending the IM message based on the retry parameters when the IM message fails to be sent.
The invention provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run 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 message transmission method of the IOS terminal described above.
As described above, the IM message sending method, system, storage medium, and computer device of the IOS terminal of the present invention have the following beneficial effects:
(1) by setting the APP keep-alive task and retry mechanism, the IM message receiving and sending 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 sense the IM message, and the user experience is greatly improved;
(3) the method has the advantages that the method has a great effect on functions of other interfaces, particularly a background keep-alive function, and can enable the called interface to have sufficient time to be executed and completed when the APP is switched to the background, so that the interface failure rate is greatly reduced.
Drawings
FIG. 1 is a flow chart illustrating an embodiment of a prior art IM message sending method;
fig. 2 is a flowchart illustrating an IM message transmission method of an IOS terminal according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating an effect of an IM message sending method of an IOS terminal according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an IM messaging system of an IOS terminal according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a computer apparatus according to an embodiment of the invention.
Description of the element reference numerals
41 keep-alive module
42 retry module
51 processor/processing unit
52 memory
521 random access memory
522 cache memory
523 storage system
524 program/utility
5241 program module
53 bus
54 input/output interface
55 network adapter
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention.
It should be noted that the drawings provided in the present embodiment are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
The IM message sending method, the IM message sending system, the IM message sending storage medium and the IM message sending computer equipment of the IOS terminal can greatly reduce the receiving and sending failure rate of the IM messages by setting the APP keep-alive task and the retry mechanism, and even can reduce the receiving and sending failure rate by one order of magnitude; meanwhile, the user does not sense the transmission of the IM message, and the user experience is greatly improved.
As shown in fig. 2, in an embodiment, the IM message sending method of the IOS terminal of the present invention includes the following steps:
step S1, when the APP of the IOS terminal is switched to the background, the IOS terminal establishes an APP keep-alive task to provide keep-alive time with preset duration, and the keep-alive time is used for the APP to send the IM message which is being sent.
Specifically, at the IOS terminal, APPs that exit to the background are typically suspended for a few seconds or so. Different devices and operating states may affect the hang time of the APP. For the same device, the hang time of APP in different operating states may vary between 5S and 10S. In the invention, when the APP is switched to the background, in order to avoid interruption of the current message sending, an APP keep-alive task is established, so that the APP can still send IM messages within the preset time length specified by the keep-alive task, and the socket connection is actively disconnected when the keep-alive task is finished. It should be noted that, the addition of the APP keep-alive task is allowed by the IOS system, and APP audit is not affected, so that the method has extremely high security and feasibility.
In an embodiment of the present invention, the preset time period is set to 30 seconds.
In an embodiment of the present invention, establishing the APP keep-alive task includes the following steps:
11) and when the APP of the IOS terminal is switched to the background, sending awakening information to the APP.
12) 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.
Preferably, the wake-up message is sent to the APP according to a preset period, so that the APP is always in a alive state.
And step S2, obtaining retry parameters, and resending the IM message based on the retry parameters when the IM message fails to be sent.
In an embodiment of the present invention, obtaining a retry parameter, and when the IM message fails to be sent, resending the IM message based on the retry parameter includes the following steps:
21) and acquiring a total timeout duration threshold, a single timeout duration threshold and retry times.
Specifically, the IOS terminal is preset with a total timeout duration threshold, a single timeout duration threshold, and retry times.
The single timeout duration threshold represents a timeout duration threshold for a single transmission of an IM message. If the single sending time length is smaller than the single overtime time length threshold, judging that the single sending is not overtime; and if the single sending time length is greater than or equal to the single overtime time length threshold, judging that the single sending is overtime.
The total timeout duration threshold represents a timeout threshold of the total duration of multiple IM message transmissions. If the multi-time sending time length is smaller than the total overtime time length threshold value, judging that the multi-time sending is not overtime; and if the multi-time sending time length is greater than or equal to the total overtime time length threshold value, judging that the multi-time sending is overtime.
The number of retries represents the number of times the IM message can be resent after a failed transmission.
In an embodiment of the present invention, the total timeout period threshold is set to 120 seconds; the single timeout duration threshold is set to 15 seconds; the number of retries is set to 8. It should be noted that the parameter setting can be flexibly set according to different application scenarios and devices, and is not limited to the above definition.
22) And when the single sending time length of the IM message is greater than the single overtime time length threshold value, resending the IM message.
Specifically, in order to ensure effective transmission of the IM message, when the time length of a single transmission of the IM message is longer than 15 seconds, it is determined that the IM message is overtime, and retransmission is required. It should be noted that the resending of the IM message is performed automatically by the system, and the user does not perceive and need no manual operation, and the user experience is not affected.
Preferably, when the number of times of resending the IM message reaches a preset number of times, the APP actively disconnects the socket connection and then reestablishes the socket connection to resend the IM message, thereby improving the success rate of sending the IM message. Preferably, the preset number of times is 3 times.
23) And recording the real-time times and the accumulated time length of the retransmission.
Specifically, a real-time number counter and an accumulated time counter may be set, and the real-time number counter may be updated according to the actual retransmission number, and the accumulated time counter may be updated according to the actual transmission time.
24) When the real-time times are larger than the retry times or the accumulated duration is larger than the total timeout duration threshold, determining that the IM message is failed to be sent; and when the real-time times are less than or equal to the retry times and the accumulated time length is less than or equal to the total overtime length threshold value, retransmitting the IM message.
Specifically, the real-time times and the accumulated time length are monitored, and when any one of the two conditions, that is, the real-time times are greater than the retry times and the accumulated time length is greater than the total timeout time length threshold, it is determined that the IM message is failed to be sent, and retransmission is not performed any more.
In an embodiment of the present invention, the method for sending an IM message of an IOS terminal further includes monitoring a current network state, and controlling socket connection of an 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 is made to disconnect the socket connection. And if the current network state is the connection state, the APP is enabled 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 message sending method 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 situation of transmission failure easily occurs. Therefore, the invention automatically sets a retransmission mechanism for a preset number of times for the IM messages of the picture or voice file. Namely, 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 message sending method of the IOS terminal of the present invention is further described below by specific embodiments.
Example one
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 can quit the WeChat APP. At this time, the WeChat APP runs in the background. Because the video information occupies a large 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 30s keep-alive time. That is, the sending of the video information can still be done in the background by the WeChat APP within 30 s. And if the video information fails to be sent, resending the video information. And if the video information is not transmitted successfully within 60s or is not transmitted successfully for 3 times, stopping the retransmission of the video information.
Example two
In this embodiment, user a needs to send image information to user B based on the flybook APP in the smartphone. After the user A sends the image information in the fly book APP, the user can quit the fly book APP. At this time, the book flying APP runs in the background. Because the image information occupies a large storage space, the flybook APP needs to continue sending the image information in the background. First, an APP keep-alive task is established to provide 20s keep-alive time. That is, the flybook APP can still perform the transmission of the image information in the background within 20 s. And if the image information fails to be sent, resending the image information. If the transmission is not successful within 40s or if the retransmission is not successful for 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 audio information in QQAPP, the user can exit QQAPP. At this point, QQAPP runs in the background. Because the audio information occupies a large storage space, the QQAPP needs to continue sending the audio information in the background. First, an APP keep-alive task is established to provide 20s keep-alive time. That is, the QQAPP can still transmit the audio information in the background within 20 s. And if the audio information fails to be sent, resending the audio information. And stopping the retransmission of the audio information if the successful retransmission is not performed within 60s or if the successful retransmission is not performed for 5 times.
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 the failure rate of IM message transmission, can meet the requirements of practical application scenarios, and is unaware by both the doctor terminal and the host client.
It should be noted that, the steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, and as long as the steps contain the same logical relationship, the steps are within the scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
As shown in fig. 4, in an embodiment, an IM messaging system of an IOS terminal of the present invention includes:
the keep-alive module 41 is configured to, when the APP of the IOS terminal is switched to the background, establish an APP keep-alive task by the IOS terminal to provide 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 after the APP finishes sending.
Specifically, at the IOS terminal, APPs that exit to the background are typically suspended for a few seconds or so. Different devices and operating states may affect the hang time of the APP. For the same device, the hang time of APP in different operating states may vary between 5S and 10S. In the invention, when the APP is switched to the background, in order to avoid interruption of the current message sending, an APP keep-alive task is established, so that the APP can still send the IM messages within the preset time length specified by the keep-alive task, and the socket connection is actively disconnected when the keep-alive task is finished. It should be noted that, the addition of the APP keep-alive task is allowed by the IOS system, and APP audit is not affected, so that the method has extremely high security and feasibility.
In an embodiment of the present invention, the preset time period is set to 30 seconds.
In an embodiment of the present invention, establishing the APP keep-alive task includes the following steps:
11) and when the APP of the IOS terminal is switched to the background, sending wake-up information to the APP.
12) And constructing the APP keep-alive task based on the awakening information so as to enable the APP to be in a survival state.
Preferably, the wake-up message is sent to the APP according to a preset period, so that the APP is always in a alive state.
Step S2, obtaining a retry parameter, and when the IM message fails to be sent, resending the IM message based on the retry parameter.
In an embodiment of the present invention, obtaining a retry parameter, and when the IM message fails to be sent, resending the IM message based on the retry parameter includes the following steps:
21) and acquiring a total overtime length threshold value, a single overtime length threshold value and retry times.
Specifically, the IOS terminal is preset with a total timeout duration threshold, a single timeout duration threshold, and retry times.
The single timeout duration threshold represents a timeout duration threshold for a single transmission of an IM message. If the single sending time length is less than the single overtime time length threshold, judging that the single sending is not overtime; and if the single sending time length is greater than or equal to the single overtime time length threshold, judging that the single sending is overtime.
The total timeout duration threshold represents a timeout threshold of the total duration of multiple IM message transmissions. If the multi-time sending time length is smaller than the total overtime time length threshold value, judging that the multi-time sending is not overtime; and if the multi-time sending time length is greater than or equal to the total overtime time length threshold value, judging that the multi-time sending is overtime.
The number of retries represents the number of times the IM message can be resent after a failed transmission.
In an embodiment of the present invention, the total timeout period threshold is set to 120 seconds; the single timeout duration threshold is set to 15 seconds; the number of retries is set to 8. It should be noted that the parameter setting can be flexibly set according to different application scenarios and devices, and is not limited to the above definition.
22) And when the single sending time length of the IM message is greater than the single overtime time length threshold value, resending the IM message.
Specifically, in order to ensure effective transmission of the IM message, when the time length of a single transmission of the IM message is longer than 15 seconds, it is determined that the IM message is overtime, and retransmission is required. It should be noted that the resending of the IM message is performed automatically by the system, and the user does not perceive and need no manual operation, and the user experience is not affected.
Preferably, when the number of times of resending the IM message reaches a preset number of times, the APP actively disconnects the socket connection and then reestablishes the socket connection to resend the IM message, thereby improving the success rate of sending the IM message. Preferably, the preset number of times is 3 times.
23) And recording the real-time times and the accumulated time length of the retransmission.
Specifically, a real-time number counter and an accumulated time counter may be set, and the real-time number counter may be updated according to the actual retransmission number, and the accumulated time counter may be updated according to the actual transmission time.
24) When the real-time times are larger than the retry times or the accumulated duration is larger than the total timeout duration threshold, determining that the IM message is failed to be sent; and when the real-time times are less than or equal to the retry times and the accumulated time length is less than or equal to the total overtime length threshold value, retransmitting the IM message.
Specifically, the real-time times and the accumulated time length are monitored, and when any one of the two conditions, that is, the real-time times are greater than the retry times and the accumulated time length is greater than the total timeout time length threshold, it is determined that the IM message is failed to be sent, and retransmission is not performed any more.
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 the disconnected state, the APP is made to disconnect the socket connection. And if the current network state is the connection state, the APP is enabled 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 message sending 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 situation of transmission failure easily occurs. Therefore, the invention automatically sets a retransmission mechanism for a preset number of times for the IM messages of the picture or voice file. Namely, 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 run in a personal mobile terminal, may also run in a server, may run in the above-mentioned device in a program form, may also run as a system component in the above-mentioned device, and may also be one of cloud service programs, where a specific operation mode is determined by an actual scene, and is not limited herein.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or can be implemented in the form of hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the x module may be a processing element that is set up separately, or may be implemented by being integrated 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. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. 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 the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules 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 (CPU) or other processor capable of calling program code. For another example, these 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 that, when executed by a processor, implements the steps of the IM message transmission method of the IOS terminal described above. Preferably, the storage medium includes: various media that can store 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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 the context of 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, 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 thereof. 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 for aspects 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made 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.
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 an 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, and when the processor executes the computer program, the processor implements the steps of the IM message sending method of the IOS terminal.
The memory includes: various media that can store program codes, such as ROM, RAM, magnetic disk, U-disk, memory card, or optical disk.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components.
As shown in FIG. 5, the computer device of the present invention is embodied in a general purpose computing device. Components of the computer device may include, but are not limited to: one or more processors or processing units 51, a memory 52, and a bus 53 that couples the various system components (including the memory 52 and the processing unit 51).
The computer device typically includes a variety of computer system readable media. Such media may be any available media that can be accessed by the computing device and includes both volatile and nonvolatile media, removable and non-removable media.
The 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 and write to non-removable, nonvolatile magnetic media (commonly referred to as "hard disk drives"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 53 by one or more data media interfaces. Memory 52 may include at least one program product having a set (e.g., at least one) of program modules that are 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, such program modules 5241 including but not limited to an operating system, one or more application programs, other program modules, and program data, may be stored in, for example, the memory 52, each of which examples or some combination thereof may include an implementation of a network environment. The program modules 5241 generally perform the functions and/or methods of the described embodiments of the invention.
The 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 devices (e.g., network card, modem, etc.) that enable the computer device to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 54. Also, the computer device may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) through the network adapter 55. As shown in FIG. 5, the network adapter 55 communicates with the other modules of the computer device via the bus 53. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, to name a few.
In summary, the IM message sending method, system, storage medium, and computer device of the IOS terminal of the present invention can greatly reduce the IM message transceiving failure rate between 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 sense the IM message, and the user experience is greatly improved; the method has the advantages that the method has a great effect on functions of other interfaces, particularly a background keep-alive function, and can enable the called interface to have sufficient time to be executed and completed when the APP is switched to the background, 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 foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.
Claims (10)
1. An IM message sending method of an IOS terminal is characterized by comprising the following steps:
when the APP of the 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 an IM message which is sent;
and acquiring a retry parameter, and retransmitting the IM message based on the retry parameter when the IM message fails to be transmitted.
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 the APP of the IOS terminal is switched to a background, sending wakeup information to the APP;
and constructing the APP keep-alive task based on the awakening information so as to enable the APP to be in a survival state.
3. The method of claim 2, wherein sending wake-up information to the APP when the APP switches to the background comprises: and sending wake-up information to the APP according to a preset period.
4. The IM messaging method of an IOS terminal of claim 1, wherein a retry parameter is obtained, and when the IM messaging fails to be sent, resending the IM message based on the retry parameter comprises the steps of:
acquiring a total timeout duration threshold, a single timeout duration threshold and retry times;
when the single sending time length of the IM message is larger than the single overtime time length threshold value, the IM message is sent again;
recording the real-time times and the accumulated duration of the resending;
when the real-time times are larger than the retry times or the accumulated duration is larger than the total timeout duration threshold, determining that the IM message is failed to be sent;
and when the real-time times are less than or equal to the retry times and the accumulated time length is less than or equal to the total overtime length threshold value, retransmitting the IM message.
5. The IM messaging method of an IOS terminal according to claim 4, wherein the IM messaging method of an IOS terminal further comprises: and when the resending times of the IM message reach preset times, the APP is enabled to actively disconnect the socket connection and then reestablish the socket connection so as to resend the IM message.
6. 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.
7. 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 a voice file, setting an automatic retransmission mechanism.
8. An IM messaging system of an IOS terminal, comprising:
the system comprises a keep-alive module, a keep-alive module and a control module, wherein 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 a background, and the keep-alive time is used for allowing the APP to send an IM message which is sent when the APP finishes sending;
and the retry module is used for acquiring retry parameters and resending the IM message based on the retry parameters when the IM message fails to be sent.
9. 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 of claims 1 to 7 when executing the computer program.
10. 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 7.
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 true CN115086263A (en) | 2022-09-20 |
CN115086263B 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 |
---|---|
CN115086263B (en) | 2024-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109474688B (en) | Method, device, equipment and medium for sending instant communication network request message | |
WO2020221190A1 (en) | Applet state synchronization method, device and computer storage medium | |
CN110971922B (en) | Live broadcast and microphone connection state monitoring method, client, server, medium and system | |
CN110166791B (en) | Connection establishing method, device, equipment and storage medium | |
WO2021237433A1 (en) | Message pushing method and apparatus, and electronic device and computer-readable medium | |
US10417062B2 (en) | Method and apparatus of unloading out of memory processing flow to user space | |
US20150026325A1 (en) | Notification normalization | |
US10044766B2 (en) | Managing mid-dialog session initiation protocol (SIP) messages | |
CN112416632B (en) | Event communication method and device, electronic equipment and computer readable medium | |
CN109446204B (en) | Data storage method and device for instant messaging, electronic equipment and medium | |
CN112769876B (en) | Method, device, equipment and medium for acquiring equipment channel information | |
CN115297164A (en) | Network proxy method, device, electronic equipment and computer readable storage medium | |
CN113254274A (en) | Message processing method, device, storage medium and server | |
US20140164523A1 (en) | Automated enabling of instant messaging communications in a client system | |
CN114567536B (en) | Abnormal data processing method, device, electronic equipment and storage medium | |
CN115086263A (en) | IM message sending method, system, storage medium and computer equipment of IOS terminal | |
CN114257632B (en) | Method and device for reconnecting broken wire, electronic equipment and readable storage medium | |
CN111290873B (en) | Fault processing method and device | |
CN115242972A (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 | |
CN113452948B (en) | Conference terminal control method, device, equipment and storage medium | |
CN114244700A (en) | Port processing method and device, electronic equipment and computer readable storage medium | |
CN114091909A (en) | Collaborative development method, system, device and electronic equipment | |
CN115250276A (en) | Distributed system and data processing method and device | |
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 |