CN107360207B - Submit method, interface issuing means, storage medium and electronic device in interface - Google Patents

Submit method, interface issuing means, storage medium and electronic device in interface Download PDF

Info

Publication number
CN107360207B
CN107360207B CN201710385593.1A CN201710385593A CN107360207B CN 107360207 B CN107360207 B CN 107360207B CN 201710385593 A CN201710385593 A CN 201710385593A CN 107360207 B CN107360207 B CN 107360207B
Authority
CN
China
Prior art keywords
predetermined interface
data
order
interface
network
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
CN201710385593.1A
Other languages
Chinese (zh)
Other versions
CN107360207A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710385593.1A priority Critical patent/CN107360207B/en
Publication of CN107360207A publication Critical patent/CN107360207A/en
Application granted granted Critical
Publication of CN107360207B publication Critical patent/CN107360207B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/568Storing data temporarily at an intermediate stage, e.g. caching

Abstract

The present invention provides a kind of interfaces to submit method, interface issuing means, storage medium and electronic device, this method to include:Determine that user equipment (UE) disconnects network connection or the network connection quality of user equipment (UE) is less than predetermined threshold;The information of predetermined interface to being operated on above-mentioned UE caches, wherein, the predetermined interface is to treat the interface submitted by above-mentioned network, the information of above-mentioned predetermined interface is included in the data operated in the predetermined interface, operation in the predetermined interface for operating the region of above-mentioned data and being performed to the data on above-mentioned zone;Determine that above-mentioned UE is attached again with network or the network connection quality of above-mentioned UE is not less than above-mentioned predetermined threshold;Above-mentioned predetermined interface is submitted by above-mentioned network according to the information of the above-mentioned predetermined interface of caching.By the present invention, the problem of solving the data that can not submit user's operation present in correlation technique due to network, and cause the loss of data of user's operation.

Description

Submit method, interface issuing means, storage medium and electronic device in interface
Technical field
The present invention relates to the communications fields, in particular to a kind of interface method, interface issuing means, storage are submitted to be situated between Matter and electronic device.
Background technology
With society and the development of internet, people can register the article that some accounts are published an article or delivered other people It is commented on, personal information will necessarily be related to when register account number is either being made comments fills in or comment on content Fill in and submit online etc. (it is certainly, online that information is submitted to be not limited solely to register account number and commented on, can also The online situation for submitting information is needed suitable for other), it is illustrated below exemplified by filling in personal information:
When personal information is filled in operation application (Application, referred to as APP) on the mobile apparatus, filling in After one big section of content, if suspension at this time or network signal are bad, it will prompt carry due to network Hand over the content filled in.User works laboriously many things write just without very poor so as to cause user experience at this time.
The data of user's operation can not be submitted due to network for above-mentioned, and cause the loss of data of user's operation Problem does not suggest that effective solution in correlation technique.
The content of the invention
An embodiment of the present invention provides a kind of interfaces to submit method, interface issuing means, storage medium and electronic device, with It at least solves that present in correlation technique the data of user's operation can not be submitted due to network, and causes the number of user's operation The problem of according to losing.
According to one embodiment of present invention, provide a kind of interface and submit method, including:Determine that user equipment (UE) disconnects The network connection quality of network connection or user equipment (UE) is less than predetermined threshold;To the predetermined interface that is operated on the UE Information is cached, wherein, the predetermined interface is to treat the interface submitted by the network, the letter of the predetermined interface Breath is included in the data that are operated in the predetermined interface, for operating the region of the data and right in the predetermined interface The operation that the data perform over the region;Determine that the UE is attached or the net of the UE with the network again Network quality of connection is not less than the predetermined threshold;According to the information of the predetermined interface of caching by network submission Predetermined interface.
Optionally, the information of the predetermined interface to being operated on the UE, which carries out caching, includes:It determines to pre-establish Cache model, and encapsulate the data using the cache model;The behaviour that the data are performed using command mode encapsulation Make;The data after encapsulation are cached, are used to operate the data in the operation and the predetermined interface after encapsulation The region.
Optionally, the command mode includes herein below:For representing the abstract order of the abstract method of order execution Role;For representing the order recipient role of the concrete behavior implementation method of order;For represent order recipient and Call the specific instructions role of the method for the recipient;For receiving the order tune for the specific instructions object that client is transferred User role.
Optionally, by the network predetermined interface is submitted to include according to the information of the predetermined interface of caching: Using the thread queue pending order of poll in buffer zone established when caching the information of the predetermined interface, In, the buffer zone is for caching the region of the information of the predetermined interface, and the pending order is described in utilization The order obtained after the operation that command mode encapsulation performs the data;It is passed sequentially through using the thread queue as follows Mode concurrently performs more than two pending orders being polled to:The pending order is called in the buffer zone Corresponding data and region, and in the region of calling the data are performed with the operation that the pending order indicates; After having performed all pending orders, the predetermined interface is submitted by the network.
Optionally, the pending order being polled to using thread queue execution is included:Utilizing the line When journey queue performs the pending command timeout, the pending order is re-executed;It described waits to hold when re-executing When the number of capable command timeout is more than pre-determined number, determine that the UE disconnects network connection or the network of user equipment (UE) connects Quality is connect less than the predetermined threshold, and the pending order is placed back in the buffer zone;Described in determining UE is attached again with the network or the network connection quality of the UE is not less than after the predetermined threshold, is delayed from described It deposits and the pending order is reacquired in region is performed.
Optionally, after suspending the thread queue and performing the pending order, the method further includes:To described Pending order is marked;And the pending order is reacquired from the buffer zone and carries out execution bag It includes:Using the mark carried out to the pending order, reacquired from the buffer zone described pending Order is performed.
Optionally, after the information of the predetermined interface to being operated on the UE caches, the method further includes: It determines to have carried out data update operation in the predetermined interface;It is grasped using in the update operation in the predetermined interface The new data made, for operating the new region of the new data and to the new data in the predetermined interface The information of the predetermined interface of the operation update caching performed on the new region.
Optionally, after the information of the predetermined interface to being operated on the UE caches, the method further includes: It determines to exit the application belonging to the predetermined interface;The information of the predetermined interface of caching is saved in database, so that Obtain described in restarting in application, passing through the network according to the information for preserving the predetermined interface in the database Submit the predetermined interface.
According to another aspect of the present invention, a kind of interface issuing means is additionally provided, including:First determining module, is used for Determine that user equipment (UE) disconnects network connection or the network connection quality of user equipment (UE) is less than predetermined threshold;Cache module, It is cached for the information to the predetermined interface operated on the UE, wherein, the predetermined interface is to treat through the net The interface that network is submitted, the information of the predetermined interface are included in the data operated in the predetermined interface, the pre- demarcation Operation on face for operating the region of the data and being performed over the region to the data;Second determining module, For determining that the UE is attached again with the network or the network connection quality of the UE is not less than the predetermined threshold Value;Module is submitted, the predetermined interface is submitted by the network for the information of the predetermined interface according to caching.
Optionally, the cache module includes:First encapsulation unit, for determining the cache model pre-established, and profit The data are encapsulated with the cache model;Second encapsulation unit, for what is performed using command mode encapsulation to the data Operation;Buffer unit for caching the data after encapsulating, is used in the operation and the predetermined interface after encapsulation Operate the region of the data.
Optionally, the submission module includes:Poll units, for utilizing the information when institute in the caching predetermined interface The pending order of the thread queue of foundation poll in buffer zone, wherein, the buffer zone is described pre- for caching The region of the information in demarcation face, the pending order are to described in data execution using command mode encapsulation The order obtained after operation;Execution unit, for using the thread queue pass sequentially through following manner execution be polled to treat The order of execution:The corresponding data of the pending order and region are called in the buffer zone, and in the area of calling In domain the data are performed with the operation that the pending order indicates;Submit unit, for performed it is all pending Order after, pass through the network and submit the predetermined interface;Wherein, the thread queue, which possesses, concurrently performs more than two lives The ability of order.
Optionally, the execution unit includes:First determination subelement, for using described in thread queue execution During pending command timeout, determine to perform the pending order failure;Subelement is performed, for re-executing described treat The order of execution;Second determination subelement, for being more than predetermined time when the number for re-executing the pending order failure During number, determine that the UE disconnects the network connection quality of network connection or user equipment (UE) less than the predetermined threshold, pause The thread queue performs the pending order, and the pending order is placed back in the buffer zone; Subelement is obtained, for being attached again with the network in the definite UE or the network connection quality of the UE is not low After the predetermined threshold, the pending order is reacquired from the buffer zone and is performed.
Optionally, the execution unit further includes:Subelement is marked, for being treated described in the pause thread queue execution After the order of execution, the pending order is marked;And the acquisition subelement includes:Time subelement is obtained, For using the mark carried out to the pending order, being reacquired from the buffer zone described pending Order is performed.
According to another aspect of the present invention, a kind of storage medium is additionally provided, the storage medium includes the program of storage, Wherein, method described in any one of the above embodiments is performed when described program is run.
According to another aspect of the present invention, a kind of electronic device is additionally provided, including memory, processor and is stored in institute State the computer program that can be run on memory and on the processor, which is characterized in that the processor passes through the meter Calculation machine program performs method described in any one of the above embodiments.
By the present invention, due to behaviour that can be in suspension or during network connection quality difference to user in predetermined interface It is cached, and the interface after operation is submitted after network recovery, so as to be avoided by way of caching in suspension or net Therefore the situation of the loss of data of user's operation when network is of poor quality, can be solved present in correlation technique due to network The problem of data of user's operation can not be submitted, and cause the loss of data of user's operation, reach and avoid in suspension or network matter The loss of data of user's operation during amount difference provides the effect of user experience.
Description of the drawings
Attached drawing described herein is used for providing a further understanding of the present invention, forms the part of the application, this hair Bright schematic description and description does not constitute improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the hardware block diagram for the mobile terminal that method is submitted at interface according to embodiments of the present invention;
Fig. 2 is the flow chart that method is submitted at interface according to embodiments of the present invention;
Fig. 3 is the schematic diagram of cache model according to embodiments of the present invention;
Fig. 4 is the relation schematic diagram between each role in command mode according to embodiments of the present invention;
Fig. 5 is the schematic diagram of thread queue according to embodiments of the present invention;
Fig. 6 is the process chart of pending order according to embodiments of the present invention;
Fig. 7 is the flow chart of caching process according to embodiments of the present invention;
Fig. 8 is the structure diagram of interface issuing means according to embodiments of the present invention.
Specific embodiment
Come that the present invention will be described in detail below with reference to attached drawing and in conjunction with the embodiments.It should be noted that do not conflicting In the case of, the feature in embodiment and embodiment in the application can be mutually combined.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, " Two " etc. be the object for distinguishing similar, without being used to describe specific order or precedence.
Embodiment 1
The embodiment of the method that the embodiment of the present application one is provided can be at terminal (for example, mobile terminal, terminal) Or it is performed in similar arithmetic unit.Exemplified by running on mobile terminals, Fig. 1 is that interface according to embodiments of the present invention carries The hardware block diagram of the mobile terminal of friendship method.As shown in Figure 1, mobile terminal 10 can include one or more (in Fig. 1 only Showing one) (processor 102 can include but is not limited to Micro-processor MCV or programmable logic device FPGA etc. to processor 102 Processing unit), the memory 104 for storing data and the transmitting device 106 for communication function.This field is common Technical staff is appreciated that structure shown in FIG. 1 is only to illustrate, and the structure of above-mentioned electronic device is not caused to limit.Example Such as, mobile terminal 10 may also include more either less components than shown in Fig. 1 or match somebody with somebody with different from shown in Fig. 1 It puts.
Memory 104 can be used for the software program and module of storage application software, such as the interface in the embodiment of the present invention Corresponding program instruction/the module of submission method, processor 102 by operation be stored in software program in memory 104 and Module so as to perform various functions application and data processing, that is, realizes above-mentioned method.Memory 104 may include at a high speed with Machine memory, may also include nonvolatile memory, as one or more magnetic storage device, flash memory or other it is non-easily The property lost solid-state memory.In some instances, memory 104 can further comprise depositing compared with processor 102 is remotely located Reservoir, these remote memories can pass through network connection to mobile terminal 10.The example of above-mentioned network is including but not limited to mutual Networking, intranet, LAN, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of mobile terminal 10 provide.In an example, transmitting device 106 includes a Network adaptation Device (Network Interface Controller, referred to as NIC), can be connected by base station with other network equipments thus It can be communicated with internet.In an example, transmitting device 106 can be that (Radio Frequency are referred to as radio frequency RF) module is used to wirelessly be communicated with internet.
Embodiment 2
As previously mentioned, in the prior art, if after suspension or network connection quality are deteriorated, can lead to not submit and use The data of family operation, but if user has submitted the number of operation in the case of no network condition or network connection quality difference at this time According to rear, be able to record the operation of lower user, and using proprietary interface go to record user operation (certainly, have network it Preceding user can also cancel this operation at any time), improve in networking or network connection quality again and then online user is submitted to grasp The data of work, can to avoid user's operation loss of data, it is necessary to the problem of user re-starts operation.The embodiment of the present invention In then provide scheme as described above, so as to realize delay submit intelligent buffer purpose.The present invention is implemented below Example illustrates:
A kind of interface is provided in the present embodiment and submits method, and Fig. 2 is interface submission side according to embodiments of the present invention The flow chart of method, as shown in Fig. 2, the flow includes the following steps:
Step S202 determines that user equipment (User Equipment, referred to as UE) disconnects network connection or user sets The network connection quality of standby UE is less than predetermined threshold;
Step S204, the information of the predetermined interface to being operated on above-mentioned UE cache, wherein, which is to treat The interface submitted by above-mentioned network, the information of above-mentioned predetermined interface are included in the data operated in the predetermined interface, should Operation in predetermined interface for operating the region of above-mentioned data and being performed to the data on above-mentioned zone;
Step S206 determines that above-mentioned UE is attached again with network or the network connection quality of above-mentioned UE is not less than upper State predetermined threshold;
Step S208 submits above-mentioned predetermined interface according to the information of the above-mentioned predetermined interface of caching by above-mentioned network.
In the present embodiment, predetermined interface can be for inputting the interface of subscriber data or being commented for filling in The interface of opinion or other interfaces for submission data online.Here, it does not limit.Above-mentioned predetermined threshold is It can flexibly be set according to actual conditions.It should be noted that the information of above-mentioned predetermined interface can include multiple types The information (information of data as described above, the information of operation, the information in region) of type, so in each letter to predetermined interface When breath is cached, the caching of the information (that is, the information of data, the information of operation, the information in region) of each concrete type does not have Inevitable sequencing, may be performed simultaneously the caching of each information, can also be performed separately the caching of each information, and separately hold During the caching of each information of row, caching order can flexibly be set.
The executive agent of each step can be terminal in above-described embodiment.
By the present invention, due to behaviour that can be in suspension or during network connection quality difference to user in predetermined interface It is cached, and the interface after operation is submitted after network recovery, so as to be avoided by way of caching in suspension or net Therefore the situation of the loss of data of user's operation when network is of poor quality, can be solved present in correlation technique due to network The problem of data of user's operation can not be submitted, and cause the loss of data of user's operation, reach and avoid in suspension or network matter The loss of data of user's operation during amount difference provides the effect of user experience.
In one optionally way of example, it can utilize the information of predetermined interface specifically into the mode of entity object It is cached come the information to predetermined interface, it optionally, can first really in the data operated on being buffered in above-mentioned predetermined interface The fixed predetermined cache model established, then encapsulates the data using definite cache model.It should be noted that cache model can To build up in advance, also, for the data on different interfaces (in other words for different types of data, data type Data or the other kinds of data that the data of subscriber data are made comments can be filled in), it may be employed not Same cache model, it is understood that classify by the operation of user, for example, in practical operation, it can be by as follows Mode will operate subscriber data, fill in comment etc. different operatings be abstracted into it is different types of enumerate, it is different so as to be directed to The different cache model of operation calls:
In a preferred embodiment mode, a cache model storehouse can be pre-established, is deposited in the cache model storehouse The cache model for various types data is placed with, when needing data cached, is directly called from caching model library corresponding Cache model, cache model can be designed to model as shown in Figure 3, it is of course also possible to according to actual conditions design not With the cache model of pattern.Optionally, when caching to above-mentioned data in the operation performed on above-mentioned zone, order mould can be used The operation that formula encapsulation performs above-mentioned data, that is to say, that user's operation can be packaged into the model of entity with command mode, (that is, each operation) will can each be asked to be packaged into the object of an entity, so as to realize the parameter of different requests Change.The operation for encapsulating above-mentioned data using above-mentioned cache model and above-mentioned data being performed using mentioned order Mode encapsulations it Afterwards, following information can be cached:Data after encapsulation, for operating above-mentioned number in the operation and above-mentioned predetermined interface after encapsulation According to region.
In the above embodiments mode, encapsulation to above-mentioned data perform operation when, can utilize command mode into Row encapsulation, is below illustrated the command mode:
Mentioned order pattern can include herein below (it should be noted that according to practical application scene, mentioned order mould Formula can also include at least one following role):Abstract order role for representing the abstract method of order execution (can also Referred to as Command, for abstract order);Order recipient role for representing the concrete behavior implementation method of order (also may be used To be known as Receiver);For represent the recipient of order and call the recipient method specific instructions role ( It is properly termed as Concrete Command);For receiving the command calls person role for the specific instructions object that client is transferred (being referred to as Invoker).Above-mentioned several roles can also be included using the operation after mentioned order Mode encapsulations, from And realize the hypostazation of operation.Relation in command mode between each role may be referred to relation shown in Fig. 4, in Fig. 4, Client is client, for inputting specific order.
In an optional embodiment, submitted in the information of the above-mentioned predetermined interface according to caching by above-mentioned network When stating predetermined interface, it can be handled in the following way:Utilize what is established when caching the information of above-mentioned predetermined interface The pending order of thread queue poll in buffer zone, wherein, which is for caching above-mentioned predetermined interface The region of information, the pending order are the life that is obtained after the aforesaid operations that are performed using mentioned order Mode encapsulations to data Order;Following manner, which is passed sequentially through, using above-mentioned thread queue concurrently performs more than two pending orders being polled to:Upper It states and the corresponding data of pending order and region is called in buffer zone, and the execution of above-mentioned data is treated in the region of calling The operation of the order instruction of execution;After all pending orders have been performed, above-mentioned predetermined interface is submitted by above-mentioned network. From above-described embodiment, when caching the information of above-mentioned predetermined interface, the thread queue (structure of the thread queue can be established May be referred to Fig. 5), after thread queue is established, the thread queue can be utilized to complete the operation to above-mentioned predetermined interface, under It is illustrated in face of above-mentioned thread queue:
In the present embodiment, the operating process in thread queue is as follows:First start a number of thread, and allow these lines Journey is all in sleep state, and when client, there are one (that is, during new operation there are one users), will wake up thread during new request Some sleep thread in pond allows the thread being waken up to handle this request of client, is asked when having handled this Afterwards, which can be in sleep state, when being handled using thread queue the request of user, Ke Yishi again Existing thread multiplexing and con current control request, smoothening peak request.That is, it can realize active line using Thread Pool Technology Processing multiple tasks can be performed during the multiplexing of journey, i.e. a worker thread establishment and the life cycle destroyed (that is, to perform More than two tasks), so as to generally reduce thread creation and the frequency destroyed and time, lifting system performance.Also, thread Task queue in pond can play the role of buffering, since server resource is limited, more than the mistake high concurrent of server performance The burden of system can be become by setting, and cause central processing unit (Central Processing Unit, referred to as CPU) a large amount of consumptions Take and switch in context, consequently, it is possible to memory is led to problems such as to overflow, so, it can be realized using thread queue and concurrently controlled System, smoothening peak request.In addition, task amount can be handled with control system maximum number of concurrent and maximum by Thread Pool Technology, from And effectively realize flow control, ensure that system is unlikely to collapse.
In an optional embodiment, thread queue can be established when user's operation is put into caching, in utilization Following operation can be included by stating the pending order that thread queue execution is polled to:It waits to hold performing using above-mentioned thread queue During capable command timeout, determine to perform above-mentioned pending order failure;Re-execute above-mentioned pending order;When holding again When the number of the above-mentioned pending order failure of row is more than pre-determined number (for example, could be provided as 3 times, naturally it is also possible to according to Actual requirement is configured pre-determined number, for example, being arranged to 2 times is either arranged to 4 times or according to the different periods To set the pre-determined number), determine that above-mentioned UE disconnects the network connection quality of network connection or user equipment (UE) less than above-mentioned Predetermined threshold suspends above-mentioned thread queue and performs pending order, and above-mentioned pending order is placed back in buffer area In domain;After definite above-mentioned UE is attached again with network or the network connection quality of UE is not less than above-mentioned predetermined threshold, Above-mentioned pending order is reacquired from above-mentioned buffer zone to be performed.That is, thread queue can cache Whether poll has order (that is, above-mentioned pending order) to perform in region, if there is ordering, and present terminal and network It just goes to perform order when connecting good, otherwise just suspends polling procedure, while the variation of simultaneous auditory network data.If it monitors To there is network, then continue with thread queue and go to perform order by data from buffer zone.If performing time-out at this time, very It is likely to be network midway to there is a problem suddenly, then can attempt to retry at this time to perform order, for example, can retry 3 times. If still not all right, order is continued to be put into buffer zone.When network change (that is, again network after or Person's network connection quality be more than predetermined threshold after) reattempt perform the order.It, can be from caching if succeeded at this time Remove this order.(or network connection quality bad when) thread queue is it should be noted that when not having network Pause, it can just recover to perform when having network (or after network connection quality improves).
Concrete operations flow in above-described embodiment can also be with reference to the flow chart shown in figure 6, in the flow shown in Fig. 6 In, cache model (S602) can be initially set up, bidding model is recycled to be packaged (that is, by user's operation user's operation It is packaged into the entity of similar command model) (S604), it then can obtain operation interface (that is, the above-mentioned pre- demarcation of user Face), and the operation interface of user is put into caching and is cached (S606-610), above-mentioned thread team can be utilized afterwards Row perform subsequent operation, (are referred to as submitting queue) (S612) including establishing thread queue, and monitor network in real time and become Change (S614), pending order (S616) is submitted after network connection well, and is retried when performing time-out (S618) and, when running succeeded, this order (S620-622) is removed from caching.
In an optional embodiment, then successfully order will be not carried out, can be to the life when being put into buffer zone Order is marked, and can be subsequently quickly found out the order, concrete operations are as follows:It is performed in the above-mentioned thread queue of pause and waits to hold After capable order, the above method further includes:To this, pending order is marked;And from above-mentioned buffer zone again Obtaining above-mentioned pending order and perform includes:The above-mentioned mark carried out using the order pending to this, from the caching Above-mentioned pending order is reacquired in region to be performed.
In an optional embodiment, after the information of the predetermined interface to being operated on above-mentioned UE caches, The above method further includes:Determine that data update operation has been carried out in above-mentioned predetermined interface (to be updated to operate and can include data It replaces, delete, the operations such as newly adds, recalls);Using the new data that are operated in above-mentioned predetermined interface in update operation, It is used to operate the new region of above-mentioned new data and to above-mentioned new data in above-mentioned new region in above-mentioned predetermined interface The information of the above-mentioned predetermined interface of the operation update caching of upper execution.Replacement operation and withdrawal operation are illustrated below:
When performing replacement operation, i.e. user operates personal information (the present embodiment is only to replace personal information for the first time Exemplified by illustrate, other replacement operations are readily applicable to, for example, the replacement of comment content), second goes to operate again Once, then the respective type order inside cache model can be replaced, it, can be with if user has carried out withdrawal operation It goes to delete corresponding order in cache model.On withdrawal operation, order can be put into inside a storehouse, it is only necessary in turn It pops up can be realized.Command mode mainly seeks to know from experience the thought that encapsulation is called, and in actual development, message queue is one A mechanism being in daily use, it performing what task, network request or data operation, nothing, no matter they be inside queue It need to consider specific business, it is only necessary to perform order.For example can be used in database journal, reach day by recording order The various functions of will, such as database recovery, etc..
In an optional embodiment, after the information of the predetermined interface to being operated on above-mentioned UE caches, The above method further includes:It determines to exit the APP belonging to above-mentioned predetermined interface;The information of the above-mentioned predetermined interface of caching is saved in In database, so that when restarting above-mentioned APP, passed through according to the information for the predetermined interface being stored in above-mentioned database Network submits above-mentioned predetermined interface.Idiographic flow may be referred to Fig. 7, that is to say, that when exiting APP (S702), can incite somebody to action Caching is saved in database (S704).When restarting APP (S706), it can be looked in the caching being saved in database Whether have pending order (S708), the thread queue for starting poll if having goes execution task (S710) if seeking.In this implementation In example, it can go to carry out data storage across android and iOS platforms by sqlite.
By the various embodiments described above, can realize when the scheme of intelligent buffer is submitted to solve Network Abnormal by being delayed Or network it is slow when user's operation loss of data situation, so as to greatly save the response time, improve user Experience.
Embodiment 3
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but it is very much In the case of the former be more preferably embodiment.Based on such understanding, technical scheme is substantially in other words to existing The part that technology contributes can be embodied in the form of software product, which is stored in a storage In medium (such as ROM/RAM, magnetic disc, CD), used including some instructions so that a station terminal equipment (can be mobile phone, calculate Machine, server or network equipment etc.) perform method described in each embodiment of the present invention.
A kind of interface issuing means is additionally provided in the present embodiment, which is used to implement above-described embodiment and preferred reality Mode is applied, had carried out repeating no more for explanation.As used below, term " module " can realize the soft of predetermined function The combination of part and/or hardware.Although following embodiment described device is preferably realized with software, hardware or The realization of the combination of software and hardware is also what may and be contemplated.
Fig. 8 is the structure diagram of interface issuing means according to embodiments of the present invention, as shown in figure 8, the device includes the One determining module 82, cache module 84, the second determining module 86 and submission module 88, below illustrate the device:
First determining module 82, for determining that user equipment (UE) disconnects network connection or the network connection of user equipment (UE) Quality is less than predetermined threshold;Cache module 84 is connected to above-mentioned first determining module 82, for pre- to what is operated on above-mentioned UE The information in demarcation face is cached, wherein, which is to treat the interface submitted by above-mentioned network, the predetermined interface Information be included in the data operated in above-mentioned predetermined interface, in the predetermined interface for operate above-mentioned data region and The operation that above-mentioned data are performed on above-mentioned zone;Second determining module 86 is connected to above-mentioned cache module 84, for determining Above-mentioned UE is attached again with above-mentioned network or the network connection quality of UE is not less than above-mentioned predetermined threshold;Submit module 88, above-mentioned second determining module 86 is connected to, the information for the above-mentioned predetermined interface according to caching is submitted by above-mentioned network Above-mentioned predetermined interface.
In an optional embodiment, above-mentioned cache module 84 includes:First encapsulation unit, for determining to pre-establish Cache model, and encapsulate above-mentioned data using above-mentioned cache model;Second encapsulation unit, for utilizing command mode encapsulation pair The operation that the data perform;Buffer unit, for caching the above-mentioned data after encapsulating, aforesaid operations after encapsulation and above-mentioned It is used to operate the above-mentioned zone of above-mentioned data in predetermined interface.
In an optional embodiment, mentioned order pattern includes herein below:For representing that order performs abstract The abstract order role of method;For representing the order recipient role of the concrete behavior implementation method of order;For representing to order The recipient of order and the specific instructions role of the method for the calling recipient;For receiving the specific life that client is transferred Make the command calls person role of object.
In an optional embodiment, above-mentioned submission module 88 includes:Poll units, it is above-mentioned pre- in caching for utilizing The pending order of the thread queue established during the information in demarcation face poll in buffer zone, wherein, which is For caching the region of the information of above-mentioned predetermined interface, above-mentioned pending order is to data using mentioned order Mode encapsulations The order obtained after the aforesaid operations of execution;Execution unit, it is concurrent for passing sequentially through following manner using above-mentioned thread queue Perform more than two pending orders being polled to:The corresponding number of above-mentioned pending order is called in above-mentioned buffer zone According to and region, and in the region of calling above-mentioned data are performed with the operation that pending order indicates;Submit unit, for After having performed all pending orders, above-mentioned predetermined interface is submitted by above-mentioned network;Wherein, which possesses concurrently Perform the ability of more than two orders.
In an optional embodiment, above-mentioned execution unit includes:First determination subelement, for utilizing above-mentioned line When journey queue performs pending command timeout, determine to perform above-mentioned pending order failure;Subelement is performed, for again Perform above-mentioned pending order;Second determination subelement, for when the number for re-executing above-mentioned pending order failure During more than pre-determined number, determine that above-mentioned UE disconnects network connection or the network connection quality of user equipment (UE) is predetermined less than above-mentioned Threshold value, pause thread queue performs pending order, and above-mentioned pending order is placed back in buffer zone;It obtains Subelement, for being attached again with network in definite above-mentioned UE or the network connection quality of above-mentioned UE is not less than above-mentioned pre- After determining threshold value, above-mentioned pending order is reacquired from buffer zone and is performed.
In an optional embodiment, above-mentioned execution unit further includes:Subelement is marked, for suspending above-mentioned thread After queue performs above-mentioned pending order, pending order is marked;And above-mentioned acquisition subelement includes:It obtains Time subelement is taken, for using the mark carried out to above-mentioned pending order, being reacquired from above-mentioned buffer zone and waiting to hold Capable order is performed.
In an optional embodiment, above device further includes:3rd determining module, for being grasped on above-mentioned UE After the information of the predetermined interface of work is cached, determine to have carried out data update operation in above-mentioned predetermined interface;Update mould Block for utilizing the new data operated in above-mentioned update operation in above-mentioned predetermined interface, is used in above-mentioned predetermined interface Operate the new region of new data and the predetermined interface of the operation update caching performed to new data on new region Information.
In an optional embodiment, above device further includes:4th determining module, for being grasped on above-mentioned UE After the information of the predetermined interface of work is cached, determine to exit the application belonging to above-mentioned predetermined interface;Preserving module, for inciting somebody to action The information of above-mentioned predetermined interface of caching is saved in database, so that described in restarting in application, according to being stored in The information of predetermined interface in above-mentioned database submits above-mentioned predetermined interface by above-mentioned network.
It should be noted that above-mentioned modules can be realized by software or hardware, for the latter, Ke Yitong In the following manner realization is crossed, but not limited to this:Above-mentioned module is respectively positioned in same processor;Alternatively, above-mentioned modules are with arbitrary The form of combination is located in different processors respectively.
The embodiment of the present invention additionally provides a kind of storage medium, which includes the program of storage, wherein, it is above-mentioned Program performs method described in any one of the above embodiments when running.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only memory (Read- Only Memory, referred to as ROM), it is random access memory (RandomAccess Memory, referred to as RAM), mobile hard The various media that can store program code such as disk, magnetic disc or CD.
The embodiment of the present invention additionally provides a kind of electronic device, including memory, processor and is stored in the storage On device and the computer program that can run on the processor, which is characterized in that the processor passes through the computer journey Sequence performs method described in any one of the above embodiments.
Obviously, those skilled in the art should be understood that each module of the above-mentioned present invention or each step can be with general Computing device realize that they can concentrate on single computing device or be distributed in multiple computing devices and be formed Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored Performed in the storage device by computing device, and in some cases, can be performed with the order being different from herein shown in The step of going out or describing they are either fabricated to each integrated circuit modules respectively or by multiple modules in them or Step is fabricated to single integrated circuit module to realize.It to be combined in this way, the present invention is not limited to any specific hardware and softwares.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All any modifications within the principle of the present invention, made, etc. With replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (13)

1. method is submitted at a kind of interface, which is characterized in that including:
Determine that user equipment (UE) disconnects network connection or the network connection quality of user equipment (UE) is less than predetermined threshold;
The information of predetermined interface to being operated on the UE caches, wherein, the predetermined interface is to treat through the net The interface that network is submitted, the information of the predetermined interface are included in the data operated in the predetermined interface, the pre- demarcation Operation on face for operating the region of the data and being performed over the region to the data;
Determine that the UE is attached again with the network or the network connection quality of the UE is not less than the predetermined threshold Value;
The predetermined interface is submitted by the network according to the information of the predetermined interface of caching;
Wherein, the information of the predetermined interface to being operated on the UE, which carries out caching, includes:Determine the caching pre-established Model, and encapsulate the data using the cache model;The operation that the data are performed using command mode encapsulation;Caching The data after encapsulation, for operating the area of the data in the operation and the predetermined interface after encapsulation Domain.
2. according to the method described in claim 1, it is characterized in that, the command mode includes herein below:
For representing the abstract order role of the abstract method of order execution;
For representing the order recipient role of the concrete behavior implementation method of order;
For representing the specific instructions role of the method for the recipient of order and the calling recipient;
For receiving the command calls person role for the specific instructions object that client is transferred.
3. according to the method described in claim 1, it is characterized in that, passed through according to the information of the predetermined interface of caching described Network submits the predetermined interface to include:
Using the thread queue established when caching the information of the predetermined interface in buffer zone the pending life of poll Order, wherein, the buffer zone is for caching the region of the information of the predetermined interface, and the pending order is utilization The order obtained after the operation that the command mode encapsulation performs the data;
Following manner, which is passed sequentially through, using the thread queue concurrently performs more than two pending orders being polled to:Institute It states and the corresponding data of the pending order and region is called in buffer zone, and the data are held in the region of calling The operation of the row pending order instruction;
After all pending orders have been performed, the predetermined interface is submitted by the network.
4. according to the method described in claim 3, it is characterized in that, using the thread queue execution be polled to described in wait to hold Capable order includes:
When performing the pending command timeout using the thread queue, the pending order is re-executed;
When the number for re-executing the pending command timeout is more than pre-determined number, determine that the UE disconnects network connection Or the network connection quality of user equipment (UE) is less than the predetermined threshold, and the pending order placed back in described In buffer zone;
It is attached again with the network in the definite UE or the network connection quality of the UE is predetermined not less than described After threshold value, the pending order is reacquired from the buffer zone and is performed.
5. according to the method described in claim 4, it is characterized in that,
After suspending the thread queue and performing the pending order, the method further includes:To the pending life Order is marked;And
The pending order is reacquired from the buffer zone and perform includes:Using to the pending life The mark carried out is made, the pending order is reacquired from the buffer zone and is performed.
6. according to the method described in claim 1, it is characterized in that, the predetermined interface to being operated on the UE information into After row caching, the method further includes:
It determines to have carried out data update operation in the predetermined interface;
Using the new data operated in the predetermined interface in the update operation, it is used to operate in the predetermined interface The new region of the new data and to the new data performed on the new region operation update caching The information of the predetermined interface.
7. according to the method described in claim 1, it is characterized in that, the predetermined interface to being operated on the UE information into After row caching, the method further includes:
It determines to exit the application belonging to the predetermined interface;
The information of the predetermined interface of caching is saved in database so that it is described in restarting in application, according to The information for preserving the predetermined interface in the database submits the predetermined interface by the network.
8. a kind of interface issuing means, which is characterized in that including:
First determining module, for determining that the network connection quality of user equipment (UE) disconnection network connection or user equipment (UE) is low In predetermined threshold;
Cache module caches for the information to the predetermined interface operated on the UE, wherein, the predetermined interface is Treat the interface submitted by the network, the information of the predetermined interface is included in the number operated in the predetermined interface According to the operation in the predetermined interface for operating the region of the data and being performed over the region to the data;
Second determining module, for determining that the UE is attached or the network connection quality of the UE with the network again Not less than the predetermined threshold;
Module is submitted, the predetermined interface is submitted by the network for the information of the predetermined interface according to caching;
Wherein, the cache module includes:First encapsulation unit, for determining the cache model pre-established, and described in utilization Cache model encapsulates the data;Second encapsulation unit, for the operation performed using command mode encapsulation to the data;It is slow Memory cell for caching the data after encapsulating, is used to operate institute in the operation and the predetermined interface after encapsulation State the region of data.
9. device according to claim 8, which is characterized in that the submission module includes:
Poll units, for being taken turns using the thread queue established when caching the information of the predetermined interface in buffer zone Ask pending order, wherein, the buffer zone be for cache the predetermined interface information region, it is described pending Order to utilize obtained order after the operation that command mode encapsulation performs the data;
Execution unit performs the pending order being polled to for passing sequentially through following manner using the thread queue: The corresponding data of the pending order and region are called in the buffer zone, and to the data in the region of calling Perform the operation of the pending order instruction;
Unit is submitted, for after all pending orders have been performed, the predetermined interface to be submitted by the network;
Wherein, the thread queue possesses the ability for concurrently performing more than two orders.
10. device according to claim 9, which is characterized in that the execution unit includes:
First determination subelement, for when performing the pending command timeout using the thread queue, determining to perform The pending order failure;
Subelement is performed, for re-executing the pending order;
Second determination subelement, for when the number for re-executing the pending order failure is more than pre-determined number, really The fixed UE disconnects the network connection quality of network connection or user equipment (UE) less than the predetermined threshold, suspends the thread Queue performs the pending order, and the pending order is placed back in the buffer zone;
Subelement is obtained, for being attached again with the network or the network connection quality of the UE in the definite UE After the predetermined threshold, the pending order is reacquired from the buffer zone and is performed.
11. device according to claim 10, which is characterized in that
The execution unit further includes:Subelement is marked, for suspending the thread queue execution pending order Afterwards, the pending order is marked;And
The acquisition subelement includes:Time subelement is obtained, for using the mark to the pending order progress, The pending order is reacquired from the buffer zone to be performed.
12. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein, when described program is run Method any one of perform claim requirement 1 to 7.
13. a kind of electronic device, including memory, processor and it is stored on the memory and can transports on the processor Capable computer program, which is characterized in that the processor is performed by the computer program in the claims 1 to 7 Any one of them method.
CN201710385593.1A 2017-05-26 2017-05-26 Submit method, interface issuing means, storage medium and electronic device in interface Active CN107360207B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710385593.1A CN107360207B (en) 2017-05-26 2017-05-26 Submit method, interface issuing means, storage medium and electronic device in interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710385593.1A CN107360207B (en) 2017-05-26 2017-05-26 Submit method, interface issuing means, storage medium and electronic device in interface

Publications (2)

Publication Number Publication Date
CN107360207A CN107360207A (en) 2017-11-17
CN107360207B true CN107360207B (en) 2018-05-22

Family

ID=60271730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710385593.1A Active CN107360207B (en) 2017-05-26 2017-05-26 Submit method, interface issuing means, storage medium and electronic device in interface

Country Status (1)

Country Link
CN (1) CN107360207B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109461072A (en) * 2018-11-07 2019-03-12 中国银行股份有限公司 A kind of transaction execution method and device
CN111459675B (en) * 2020-03-31 2023-09-15 拉扎斯网络科技(上海)有限公司 Data processing method and device, readable storage medium and electronic equipment
CN114598664A (en) * 2020-12-03 2022-06-07 武汉斗鱼鱼乐网络科技有限公司 Task execution method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787511A (en) * 2004-12-07 2006-06-14 联想(北京)有限公司 Method and system for realizing off-line application of computer
CN102457499A (en) * 2010-10-26 2012-05-16 腾讯科技(深圳)有限公司 Offline working method for client, and offline working client
CN102468989A (en) * 2010-11-11 2012-05-23 腾讯科技(深圳)有限公司 Method and system for processing network data
WO2015192660A1 (en) * 2014-06-20 2015-12-23 Tencent Technology (Shenzhen) Company Limited Method and system for caching input content

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455603B (en) * 2013-09-03 2016-08-17 小米科技有限责任公司 Web page contents caching, webpage loading method, device and terminal unit
CN106095999A (en) * 2016-06-22 2016-11-09 腾讯科技(深圳)有限公司 Obtain the method and device of content of pages

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787511A (en) * 2004-12-07 2006-06-14 联想(北京)有限公司 Method and system for realizing off-line application of computer
CN102457499A (en) * 2010-10-26 2012-05-16 腾讯科技(深圳)有限公司 Offline working method for client, and offline working client
CN102468989A (en) * 2010-11-11 2012-05-23 腾讯科技(深圳)有限公司 Method and system for processing network data
WO2015192660A1 (en) * 2014-06-20 2015-12-23 Tencent Technology (Shenzhen) Company Limited Method and system for caching input content

Also Published As

Publication number Publication date
CN107360207A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN107360207B (en) Submit method, interface issuing means, storage medium and electronic device in interface
CN105245373B (en) A kind of container cloud platform system is built and operation method
CN107222426A (en) The method of flow control, apparatus and system
CN107483418A (en) Login process method, method for processing business, device and server
CN103827820B (en) The data of management computing device are used
CN105871587A (en) Log uploading method and device
CN102222010B (en) A kind of method of mobile terminal edition upgrading and realize system
CN105847367A (en) Service request processing method and apparatus
CN108287751A (en) Task executing method and device, distributed system
CN106102850A (en) Games system, memory control device, program and information storage medium
CN108616668B (en) Method for monitoring dialing task, electronic device and computer readable storage medium
CN111181774A (en) High-availability method, system, terminal and storage medium for MapReduce task
CN107045472A (en) Mobile device information acquisition system
CN109032635A (en) Method for upgrading software, device and the network equipment
CN107196777A (en) A kind of method and apparatus of application processing
CN105871958A (en) Method for managing account information in centralized manner and terminal
CN106897126A (en) A kind of picture grasping means and server
CN105718243A (en) Data batch operating method and system in ERP system
CN105049225B (en) A kind of electric system front-end processor system based on dynamic character weight
CN107491350A (en) Interface task call method and device
CN106445610A (en) Application processing method and device
CN105094947B (en) The quota management method and system of a kind of virtual computing resource
CN109643296A (en) The server of the depolymerization of alternative upgrading
CN107688592A (en) The method and terminal of data cleansing
CN107493307A (en) A kind of HTTP request time-out management method and device

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