CN109688195B - Device, method and storage medium for realizing asynchronous information release - Google Patents

Device, method and storage medium for realizing asynchronous information release Download PDF

Info

Publication number
CN109688195B
CN109688195B CN201811369225.9A CN201811369225A CN109688195B CN 109688195 B CN109688195 B CN 109688195B CN 201811369225 A CN201811369225 A CN 201811369225A CN 109688195 B CN109688195 B CN 109688195B
Authority
CN
China
Prior art keywords
local
data object
local data
picture
asynchronous
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811369225.9A
Other languages
Chinese (zh)
Other versions
CN109688195A (en
Inventor
谢东华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Huazhong Shixun Technology Co ltd
Original Assignee
Wuhan Huazhong Shixun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Huazhong Shixun Technology Co ltd filed Critical Wuhan Huazhong Shixun Technology Co ltd
Priority to CN201811369225.9A priority Critical patent/CN109688195B/en
Publication of CN109688195A publication Critical patent/CN109688195A/en
Application granted granted Critical
Publication of CN109688195B publication Critical patent/CN109688195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The invention discloses a device, a method and a storage medium for realizing asynchronous information release. The method comprises the steps of obtaining text information of at least one content; serializing the text information into local data; adding the local data into an asynchronous sending list; judging whether the asynchronous sending list has at least one local data in real time; after judging that the asynchronous sending list has at least one local data, sending the local data positioned at the front position in the asynchronous sending list to a server; and after the local data is successful, updating the content according to the return data of the server. The invention can realize the synchronous storage and asynchronous release of the characters and the pictures.

Description

Device, method and storage medium for realizing asynchronous information release
Technical Field
The invention relates to the technical field of mobile terminals, in particular to a device, a method and a storage medium for realizing asynchronous information release.
Background
Serialization is the execution of a program in multithreading, which is the execution of the program in execution order. All program segments of the configuration must be executed in order. It is important to implement asynchronous information distribution of content serialization in ios systems.
Disclosure of Invention
The embodiment of the invention at least provides a method for realizing asynchronous information release, which can realize synchronous storage and asynchronous release of characters and pictures. The method comprises the following steps:
the method comprises the following steps:
step110, acquiring text information of at least one content;
step120, serializing the text information into local data;
step200, adding the local data into an asynchronous sending list;
step300, judging whether the asynchronous sending list has at least one piece of local data in real time;
step400, after judging that the asynchronous sending list has at least one piece of local data, sending the local data positioned at the front position in the asynchronous sending list to a server;
and Step500, updating the content according to the returned data of the server after the local data is successful.
Preferably, Step120 is configured to:
step121, serializing the text information into local data;
step122, storing the local data in a local database;
step123, acquiring the local data stored in the local database in real time for displaying on a local interface.
Preferably, Step500 is configured with:
step510, after the local data is successfully sent, replacing the local data stored in the local database with the returned data;
and Step520, updating and displaying the content according to the return data.
Preferably, Step110 is configured to obtain text information of at least one content, where the display state of the content is a to-be-released state;
step520 is configured to update and display the content and the display state of the content according to the return data.
Preferably, Step110, obtaining text information and picture files of at least one content;
step120, serializing the text information into local data;
step210, sending the picture file to a server and receiving a remote picture address returned by the server;
step220, adding the local data object into the asynchronous sending list after the local data object is added into the remote picture address.
Step300, judging whether the asynchronous sending list has at least one local data in real time;
step400, after judging that the asynchronous sending list has at least one piece of local data, sending the local data positioned at the front position in the asynchronous sending list to a server;
and Step500, updating the content according to the returned data of the server after the local data is successful.
Preferably, Step120 is configured with:
step121, serializing the text information;
step122, storing the picture file in the local database.
Preferably, Step212 is configured to store the picture file in the local database and generate a local picture address for reading the picture;
the Step210 is configured to:
step211, reading the picture file through the local picture address;
step212, sequencing the read pictures and adding the pictures into a picture sending list;
step213, sending the picture file to a server through a picture sending list;
step214, receiving the returned remote picture address after the transmission is successful.
The embodiment of the invention discloses a storage medium for storing computer instructions, which is characterized in that the instructions are executed by a processor to realize the steps of the method.
The embodiment of the invention discloses a device for realizing asynchronous information release, which is characterized in that,
the device comprises:
the acquisition module acquires character information of at least one content;
the processing module serializes the text information into local data;
the list module is used for adding the local data into an asynchronous sending list;
the communication module is used for judging whether the asynchronous sending list has at least one piece of local data in real time and sending the local data positioned at the front position in the asynchronous sending list to a server after judging that the asynchronous sending list has at least one piece of local data;
and the display module updates the content according to the return data of the server after the local data is successful.
The embodiment of the invention discloses a device for realizing asynchronous information release, which comprises:
the acquisition module acquires character information and picture files of at least one content;
the word processing module serializes the word information into local data;
the picture processing module is used for sending the picture file to a server and receiving a remote picture address returned by the server;
the list module is used for adding the local data object into the asynchronous sending list after the local data object is added into the remote picture address;
the communication module is used for judging whether the asynchronous sending list has at least one piece of local data in real time and sending the local data positioned at the front position in the asynchronous sending list to a server after judging that the asynchronous sending list has at least one piece of local data;
and the display module updates the content according to the return data of the server after the local data is successful.
In view of the above, other features and advantages of the disclosed exemplary embodiments will become apparent from the following detailed description of the disclosed exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of an implementation one;
FIG. 2 is a flowchart of the second embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
To implement the above scheme, please refer to fig. 1; the embodiment takes the implementation of asynchronous information publishing of local posts in the server as a preferred example. The preferred embodiment is implemented as follows after the user fills in the post content of the local post through a local interface provided by the user and confirms that the local post is published.
Step110, acquiring the text information of the local post.
And Step120, generating a local data object and assigning the unique identity of the local data object.
Step130, performing serialization operation on the text information through a function method of the iOS system, converting the text information into binary local data and storing the binary local data through a local data object.
Step140, cache all local data objects generated by CoreData to the local database.
Step200, adding the local data object into the asynchronous transmission list and generating a message notification notifier.
And Step300, judging whether the asynchronous transmission list has a local data object in real time.
Step400, after it is determined that the asynchronous sending list has at least one local data object, in this embodiment, a dispatch _ async function of a GCD multithreading API of the iOS system is used to send text information stored in the local data object to the server according to the queue order.
Step510, receiving the return data sent by the server after the sending is successful, and generating a message notification notifier B; the return data includes the latest content issued by the server, and the return data sent by the server in the embodiment is binary data for facilitating communication and storage.
Alternatively, Step510 of this embodiment is configured to generate a notification message noticeC after the failure of transmission.
Step520, a return data object for storing return data is generated.
Step530 assigns the same id in Step120 to the returned data object.
Step540, searching the local data object stored in the local database according to the identity, and replacing the local data object in the local database by the returned data object.
Step550, updating the post content of the local post display through the return data stored in the return data object.
By the aid of the scheme, the method can send the post content of the local post to the server through the asynchronous sending list for displaying on a remote interface, and asynchronous information publishing of the local post is achieved.
Further, Step540 of the present embodiment is further configured to delete the local data object cached in the local database by using the dispatch _ async function of the GCD multithreading API of the iOS system after replacing the local data object by the returned data object. Then, by the above scheme, the present embodiment can maintain the synchronous display of the server and the local interface, and clear redundant data in the local database.
Furthermore, the embodiment updates the post content of the local post and displays the state of the post on the local interface by responding to the notification message and reading the local data object or returning the data object.
After the response message notifies the notifier a, the embodiment configures the local data object at the forefront end of the view queue sendingArray corresponding to the local interface and refreshes the local interface; then, the post corresponding to the local data object and the post to be issued state can be displayed at the forefront end after the local interface is refreshed.
In this embodiment, after the notice of notifier b in the response message, the successfully sent local data object is searched in the view queue sendingArray through the identity; and replacing the searched local data object with the returned data object and refreshing the local interface. Then, the post content returned from the server and the post publishing success status can be displayed after the local interface is refreshed.
In this embodiment, after the response message notifies the noticeC, the local data object that has failed to be sent is searched in the view queue sendingArray through the identity, and the local interface is refreshed. Then, the post's posting failure status can be displayed after the local interface is refreshed.
The present embodiment further discloses a storage medium for storing computer instructions, which when executed by a processor implement the steps of the method as described above.
The embodiment of the invention discloses a device for realizing asynchronous information release. The system of the device of the embodiment is composed as follows.
The acquisition module is configured to acquire text information of at least one content;
the processing module is configured to serialize the text information into local data;
the list module is configured to add the local data to an asynchronous send list;
the communication module is configured to judge whether the asynchronous transmission list has at least one piece of local data in real time, and after judging that the asynchronous transmission list has at least one piece of local data, the communication module sends the local data located at the front position in the asynchronous transmission list to a server;
the display module is configured to update the content according to the return data of the server after the local data is successful.
Example two
The difference between the embodiment and the embodiment one is that the asynchronous information of the picture file is sent; the second embodiment includes the following steps.
Step110, acquiring text information and picture files of the local posts.
And Step120, generating a local data object and assigning the unique identity of the local data object.
Step130, performing serialization operation on the text information through a function method of the iOS system, converting the text information into binary local data and storing the binary local data through a local data object.
Step140, generating a picture object and assigning the picture object with a unique picture identifier which can be used for sequencing;
step150, acquiring a local picture address of the picture object in the disk and storing the picture file in the local picture address; at the same time, the currently generated local data objects are cached by the CoreData to the local database.
Step211, establishing a picture file sending list and reading a picture file in the picture file sending list through a local picture address;
step212, after the picture files are completely read, sorting all the picture files according to the picture file identifications to form a picture file array.
And Step213, sending the picture file array to the server through the picture file sending list.
Step214, obtaining the remote picture address returned by the server after the transmission is successful.
And Step220, adding the remote picture address into the local data object and then adding the local data object into the asynchronous sending list.
By the scheme, the synchronous storage and asynchronous uploading of the text information and the picture file can be realized.
The embodiment of the invention discloses a device for realizing asynchronous information release. The system of the device of the embodiment is composed as follows.
The acquisition module is configured to acquire text information and picture files of at least one content;
the word processing module is configured to serialize the word information into local data;
the picture processing module is configured to send the picture file to a server and receive a remote picture address returned by the server;
the list module is configured to add the local data object to the asynchronous sending list after the local data object is added to the remote picture address;
the communication module is configured to judge whether the asynchronous transmission list has at least one piece of local data in real time, and after judging that the asynchronous transmission list has at least one piece of local data, the communication module sends the local data located at the front position in the asynchronous transmission list to a server;
the display module is configured to update the content according to the return data of the server after the local data is successful.
The present invention has been described in terms of the preferred embodiment, and it is not intended to be limited to the embodiment. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (3)

1. A method for realizing asynchronous information release is characterized in that the method comprises the following steps:
step110, acquiring text information and an image file of at least one content;
step120, generating a local data object and assigning a unique identity of the local data object;
step130, performing serialization operation on the text information through a function method of the iOS system, converting the text information into binary local data and storing the binary local data through the local data object;
step140, generating a picture object and assigning a unique picture identifier which can be used for sequencing to the picture object;
step150, acquiring a local picture address of a picture object in a disk, storing the picture file in the local picture address, and caching the currently generated local data object to a local database through CoreData;
step211, establishing a picture file sending list and reading a picture file in the picture file sending list through a local picture address;
step212, after the picture files are read, sequencing all the picture files according to the picture file identifications to form a picture file array;
step213, sending the picture file array to a server through the picture file sending list;
step214, acquiring a remote picture address returned by the server after the sending is successful;
step220, adding the local data object into an asynchronous sending list after the local data object is added into the remote picture address, and generating a message notification notifier;
step300, judging whether the asynchronous sending list has at least one local data in real time;
step400, after judging that the asynchronous transmission list has at least one piece of local data, using a dispatch _ async function of a GCD multithreading API of the iOS system to transmit the text information stored in the local data object to the server according to the queue sequence;
step510, receiving return data sent by the server after the return data is successfully sent, and generating a message notification notifier B, wherein the return data comprises the latest content issued by the server; and generating a notice message noticeC after the failure of sending;
step520, generating a return data object for storing the return data;
step530, assigning the same identity identifier in Step120 to the returned data object;
step540, after the local data object is replaced by the returned data object, deleting the local data object cached in the local database by using a dispatch _ async function of a GCD multithreading API of the iOS system;
step550, updating the content and the display state of the local post through the return data stored in the return data object;
the step of updating the local post comprises the steps of configuring a local data object at the forefront end of a view queue sendingArray corresponding to the local interface and refreshing the local interface after the response message informs the notifier;
after the response message informs the notcheB, searching for a successfully sent local data object in the view queue sendingArray through the identity; replacing the searched local data object with the returned data object and refreshing a local interface;
after the response message informs the noticeC, searching the local data object which fails to be sent in the view queue sendingArray through the identity, and refreshing a local interface.
2. A storage medium storing computer instructions for implementing the steps of the method of claim 1 when executed by a processor.
3. An apparatus for implementing asynchronous information distribution, the apparatus comprising:
the acquisition module acquires character information and picture files of at least one content;
the word processing module is used for generating a local data object and assigning a unique identity of the local data object; serializing the text information by a function method of the iOS system, converting the text information into binary local data and storing the binary local data by the local data object;
the image processing module is used for generating an image object and assigning a unique image identifier which can be used for sequencing to the image object; acquiring a local picture address of a picture object in a disk, storing the picture file in the local picture address, and caching the currently generated local data object to a local database through CoreData; establishing a picture file sending list and reading a picture file in the picture file sending list through a local picture address; after the picture files are read, sequencing all the picture files according to the picture file identifications to form a picture file array; sending the picture file array to a server through the picture file sending list; acquiring a remote picture address returned by the server after the transmission is successful;
the list module is used for adding the local data object into an asynchronous sending list after the local data object is added into the remote picture address, and generating a message notification notifier;
the communication module is used for judging whether the asynchronous sending list has at least one piece of local data in real time; after judging that the asynchronous transmission list has at least one piece of local data, transmitting the text information stored in the local data object to a server according to the queue sequence by using a dispatch _ async function of a GCD multithreading API of the iOS system;
the display module receives the return data sent by the server after the transmission is successful and generates a message notification notifier B, wherein the return data comprises the latest content issued by the server; and generating a notice message noticeC after the failure of sending; generating a return data object for storing the return data; assigning the identity to the returned data object; deleting the local data object cached in the local database by using a dispatch _ async function of a GCD multithreading API of the iOS system after the returned data object replaces the local data object; updating the content and the display state of the local post through the return data stored in the return data object; the step of updating the local post comprises the steps of configuring a local data object at the forefront end of a view queue sendingArray corresponding to the local interface and refreshing the local interface after the response message informs the notifier; after the response message informs the notcheB, searching for a successfully sent local data object in the view queue sendingArray through the identity; replacing the searched local data object with the returned data object and refreshing a local interface; after the response message informs the noticeC, searching the local data object which fails to be sent in the view queue sendingArray through the identity, and refreshing a local interface.
CN201811369225.9A 2018-11-16 2018-11-16 Device, method and storage medium for realizing asynchronous information release Active CN109688195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811369225.9A CN109688195B (en) 2018-11-16 2018-11-16 Device, method and storage medium for realizing asynchronous information release

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811369225.9A CN109688195B (en) 2018-11-16 2018-11-16 Device, method and storage medium for realizing asynchronous information release

Publications (2)

Publication Number Publication Date
CN109688195A CN109688195A (en) 2019-04-26
CN109688195B true CN109688195B (en) 2022-05-20

Family

ID=66184801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811369225.9A Active CN109688195B (en) 2018-11-16 2018-11-16 Device, method and storage medium for realizing asynchronous information release

Country Status (1)

Country Link
CN (1) CN109688195B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478755B (en) * 2020-04-03 2023-08-01 上海银欣高新技术发展股份有限公司 Asynchronous data communication method, medium, equipment and asynchronous data communication system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310926A (en) * 1998-07-21 2001-08-29 摩托罗拉公司 Origination time and update lifetime with updatable messages
CN102520922A (en) * 2011-11-14 2012-06-27 上海交通大学 Remote development method and system under coordination environment
CN102890631A (en) * 2012-09-13 2013-01-23 新浪网技术(中国)有限公司 Method for transmitting message based on persistent message queue and message transmission device
CN103577511A (en) * 2013-01-22 2014-02-12 网易(杭州)网络有限公司 Method, device and system for realizing media application
CN104239426A (en) * 2014-08-25 2014-12-24 武汉天喻信息产业股份有限公司 System and method for realizing cross-platform document reading
CN104820701A (en) * 2015-05-11 2015-08-05 北京瑞星信息技术有限公司 Method and system for recording and synchronizing data
CN106874145A (en) * 2017-02-15 2017-06-20 山东浪潮商用系统有限公司 A kind of asynchronous data backup method based on message queue

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107306219A (en) * 2016-04-21 2017-10-31 上海神计信息系统工程有限公司 Picture transmission method and device in instant messaging

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310926A (en) * 1998-07-21 2001-08-29 摩托罗拉公司 Origination time and update lifetime with updatable messages
CN102520922A (en) * 2011-11-14 2012-06-27 上海交通大学 Remote development method and system under coordination environment
CN102890631A (en) * 2012-09-13 2013-01-23 新浪网技术(中国)有限公司 Method for transmitting message based on persistent message queue and message transmission device
CN103577511A (en) * 2013-01-22 2014-02-12 网易(杭州)网络有限公司 Method, device and system for realizing media application
CN104239426A (en) * 2014-08-25 2014-12-24 武汉天喻信息产业股份有限公司 System and method for realizing cross-platform document reading
CN104820701A (en) * 2015-05-11 2015-08-05 北京瑞星信息技术有限公司 Method and system for recording and synchronizing data
CN106874145A (en) * 2017-02-15 2017-06-20 山东浪潮商用系统有限公司 A kind of asynchronous data backup method based on message queue

Also Published As

Publication number Publication date
CN109688195A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN110597595B (en) Method for providing multi-language information, method for configuring multi-language information, device, equipment and medium
US9426102B1 (en) Efficient conversation transmission to mobile clients
CN110912803B (en) IM message transmission method and terminal
US10122665B2 (en) Distributed synchronization data in a message management service
CN111353773B (en) Identification processing method and device, storage medium and electronic device
CN107391277B (en) Information processing method and device
CN109688195B (en) Device, method and storage medium for realizing asynchronous information release
US20200403850A1 (en) Facilitating resilient and fault tolerant asynchronous messaging
CN104639974B (en) A kind of information-pushing method and device
CN107798078B (en) Billboard data display method and device, computer equipment and storage medium
CN113138827A (en) Method, device, electronic equipment and medium for displaying data
CN105635291A (en) Information pushing method, information pushing device, information displaying method and information displaying device
CN112702255A (en) Instant messaging message processing method and device and electronic equipment
CN107291931B (en) Note generation method and device and user terminal
CN101414984B (en) Method, system and server for showing group honey words of group set
CN111597107B (en) Information output method and device and electronic equipment
US20170171128A1 (en) Method and electronic device for email processing
CN115563134A (en) Interaction method, interaction device, electronic equipment and computer readable medium
CN113672488A (en) Log text processing method and device
CN112612401A (en) Prompt message processing method, device, system, equipment and storage medium
CN106844502B (en) Data consistency processing method and equipment
CN115955450B (en) Instant message display and push method and device, electronic equipment and storage medium
CN114741147B (en) Method for displaying page on mobile terminal and mobile terminal
CN113973096A (en) Data processing method and sending terminal
CN104519084A (en) Method and device for displaying messages

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