CN110300163A - A kind of acquisition methods of network data, device, equipment and storage medium - Google Patents

A kind of acquisition methods of network data, device, equipment and storage medium Download PDF

Info

Publication number
CN110300163A
CN110300163A CN201910554535.6A CN201910554535A CN110300163A CN 110300163 A CN110300163 A CN 110300163A CN 201910554535 A CN201910554535 A CN 201910554535A CN 110300163 A CN110300163 A CN 110300163A
Authority
CN
China
Prior art keywords
network
network request
network data
data
cached
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910554535.6A
Other languages
Chinese (zh)
Other versions
CN110300163B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910554535.6A priority Critical patent/CN110300163B/en
Publication of CN110300163A publication Critical patent/CN110300163A/en
Application granted granted Critical
Publication of CN110300163B publication Critical patent/CN110300163B/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/566Grouping or aggregating service requests, e.g. for unified processing
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The embodiment of the present disclosure discloses acquisition methods, device, equipment and the storage medium of a kind of network data.This method comprises: determining whether trigger event meets preset cache condition when current display page detects the trigger event for sending network request;If so, obtaining network data corresponding with network request from the data cached;If it is not, then sending network request to server-side to obtain the corresponding network data of network request.The technical solution of the embodiment of the present disclosure, it can be in the same display page or when being switched to other display pages and needing to obtain identical network data again, the network data can be directly obtained from the data cached, without repeating to send network request to server-side, to reduce the number that client sends network request, network flow has been saved.

Description

A kind of acquisition methods of network data, device, equipment and storage medium
Technical field
The embodiment of the present disclosure be related to application-development technologies field more particularly to a kind of acquisition methods of network data, Device, equipment and storage medium.
Background technique
Currently, when based on the display page of the application program (Application, APP) in client, if user executes When the operations of the certain network datas of request, client can send network request to server-side, to download server-side transmission Institute's request network data, such as the author information of article etc..
During the same page is shown or after being switched to other pages, if user needs to obtain identical network data, Client needs to send identical network request to server-side again, to download the network data of institute's request again.It is above-mentioned In scheme, when user needs when different moments obtaining identical network data, client needs repeatedly to send phase to server-side Same network request, more network request number is the larger waste for network flow.
Summary of the invention
The embodiment of the present disclosure provides acquisition methods, device, equipment and the storage medium of a kind of network data, it is possible to reduce Client sends the number of network request, saves network flow.
In a first aspect, the embodiment of the present disclosure provides a kind of acquisition methods of network data, may include:
When current display page detects the trigger event for sending network request, it is default to determine whether trigger event meets Caching condition;
If so, obtaining network data corresponding with network request from the data cached;
If it is not, then sending network request to server-side to obtain the corresponding network data of network request.
In above scheme, optionally, network request is being sent to obtain the corresponding network number of network request to server-side According to later, can also include:
The corresponding cold signal of network request is converted into thermal signal, and caches thermal signal, wherein the thermal signal packet cached Include the corresponding network data of network request.
In above scheme, optionally, if so, obtaining network number corresponding with network request from the data cached According to may include:
If in the thermal signal cached including network data corresponding with network request, from the thermal signal cached It is middle to obtain network data corresponding with network request.
In above scheme, optionally, if it is not, then sending network request to server-side to obtain the corresponding net of network request Network data may include:
If trigger event be trigger for the first time, alternatively, trigger event be again triggering and in the thermal signal cached not Including the corresponding network data of network request, then network request is sent to obtain the corresponding network number of network request to server-side According to.
In above scheme, optionally, the acquisition methods of the network data can also include:
When detecting the trigger action into current display page, each network for will being related in current display page Request is encapsulated as cold signal respectively.
In above scheme, optionally, thermal signal is cached, may include: that thermal signal is cached in memory.
In above scheme, optionally, thermal signal is cached in memory, may include: that thermal signal is cached in queue In, queue is cached in memory;The buffer memory of queue is less than or equal to default value.
In above scheme, optionally, before thermal signal is cached in queue, the acquisition methods of the network data, If can also include: queue current cache amount be equal to default value, delete queue in team head position thermal signal.
Second aspect, the embodiment of the present disclosure additionally provide a kind of acquisition device of network data, may include:
Caching condition judgment module, when for detecting the trigger event of transmission network request in current display page, really Determine whether trigger event meets preset cache condition;
Network data acquisition module, for if so, obtaining network corresponding with network request from the data cached Data;
Network data request module, for if it is not, then corresponding to obtain network request to server-side transmission network request Network data.
In above scheme, optionally, the acquisition device of the network data can also include:
Thermal signal cache module for the corresponding cold signal of network request to be converted to thermal signal, and caches thermal signal, In, the thermal signal cached includes the corresponding network data of network request.
In above scheme, optionally, network data acquisition module specifically can be used for:
If in the thermal signal cached including network data corresponding with network request, from the thermal signal cached It is middle to obtain network data corresponding with network request.
In above scheme, optionally, network data request module specifically can be used for:
If trigger event be trigger for the first time, alternatively, trigger event be again triggering and in the thermal signal cached not Including the corresponding network data of network request, then network request is sent to obtain the corresponding network number of network request to server-side According to.
In above scheme, optionally, the acquisition device of the network data can also include:
Cold signal assemble module, for will currently show page when detecting the trigger action for entering current display page The each network request being related in face is encapsulated as cold signal respectively.
In above scheme, optionally, thermal signal cache module may include:
Thermal signal cache unit, for thermal signal to be cached in memory.
In above scheme, optionally, thermal signal cache unit may include:
Queue is cached in memory by thermal signal caching subelement for thermal signal to be cached in queue;Wherein, team The buffer memory of column is less than or equal to default value.
In above scheme, optionally, the acquisition device of the network data can also include:
Thermal signal removing module is deleted if the current cache amount for queue is equal to default value and is in team in queue The thermal signal of head position.
The third aspect, the embodiment of the present disclosure additionally provide a kind of terminal device, may include:
One or more processors;
Memory, for storing one or more programs,
When one or more programs are executed by one or more processors, so that one or more processors realize the disclosure The acquisition methods of network data provided by any embodiment.
Fourth aspect, the embodiment of the present disclosure additionally provide a kind of computer readable storage medium, are stored thereon with computer Program realizes the acquisition side of network data provided by the disclosure any embodiment when computer program is executed by processor Method.
The technical solution of the embodiment of the present disclosure sends the trigger event of network request by detecting in current display page When, determine whether the trigger event meets preset cache condition;If it is satisfied, including in the data cached on the client Network data corresponding with the network request can then directly acquire net corresponding with the network request from the data cached Network data, without sending network request to server-side again;If do not met, i.e., do not wrapped in the data that have cached on the client Network data corresponding with network request is included, then needs to send the network request to server-side to obtain the corresponding net of network request Network data.Above-mentioned technical proposal, can the same display page or be switched to other display pages need to obtain again it is identical Network data when, the network data can be directly obtained from the data cached, without repeat to server-side send network Request has saved network flow to reduce the number that client sends network request.
Detailed description of the invention
Fig. 1 is the flow chart of the acquisition methods of one of the embodiment of the present disclosure one network data;
Fig. 2 is the flow chart of the acquisition methods of one of the embodiment of the present disclosure two network data;
Fig. 3 is the structural block diagram of the acquisition device of one of the embodiment of the present disclosure three network data;
Fig. 4 is the structural schematic diagram of one of the embodiment of the present disclosure four terminal device.
Specific embodiment
The disclosure is described in further detail with reference to the accompanying drawings and examples.It is understood that described herein Specific embodiment be used only for explaining the disclosure, rather than the restriction to the disclosure.It also should be noted that for the ease of It describes, illustrates only part relevant to the disclosure rather than entire infrastructure in attached drawing.
In following each embodiments, optional feature and example are provided simultaneously in each embodiment, that records in embodiment is each A feature can be combined, and form multiple optinal plans, and the embodiment of each number should not be considered merely as to a technical solution.
Embodiment one
Fig. 1 is a kind of flow chart of the acquisition methods of the network data provided in the embodiment of the present disclosure one.The present embodiment can The case where suitable for obtaining network data, it is particularly suitable for the case where repeatedly obtaining identical network data.This method can be by The acquisition device for the network data that the embodiment of the present disclosure provides executes, which can be real by the mode of software and/or hardware Existing, which can integrate on various subscriber terminal equipments or server.Referring to Fig. 1, the method for the embodiment of the present disclosure is specific Include the following steps:
S110, when current display page detects the trigger event for sending network request, determine whether trigger event full Sufficient preset cache condition.
Wherein, there are many kinds of the forms of preset cache condition, for example, preset cache condition can be for the first time with trigger event Triggering still triggers related again, and it is related and whether to be cached with network data corresponding with network request, can also be simultaneously It is related with the caching situation of the triggering times of trigger event and network data.
Specifically, for determining whether to be cached with there are many kinds of the modes of network data corresponding with network request, for example, If there is the corresponding network data of some network request in the client, the network data and the network request can go out in pairs It is existing, particularly, since each network request can be associated with unique cryptographic Hash, then the network data and with the network request Associated cryptographic Hash can occur in pairs, wherein the cryptographic Hash may include that server-side institute that the network request is sent to The cryptographic Hash of corresponding address.In turn, it can search whether to be cached with network request corresponding with trigger event on the client Associated cryptographic Hash, and if it exists, illustrate that network data corresponding with network request has cached on the client.
Specifically, for determine trigger event be trigger for the first time or the mode that triggers again there are many kinds of, illustratively, If each trigger event is associated with a preset flag bit, it can determine that the trigger event is first according to the flag bit Secondary triggering still triggers again.For example, it is assumed that the flag bit for the trigger event not being triggered is NO, if the trigger event category It is triggered in for the first time, then the flag bit in trigger time is NO, and after trigger event generation, the APP in client can be incited somebody to action The flag bit is changed into YES by NO;If the trigger event triggers again, the flag bit in trigger time is YES, After trigger event occurs, APP will not execute any operation to the flag bit.It should be noted that the mark of each trigger event Position caches in memory, and only when APP will be discharged from memory, the flag bit of the APP can be just changed by YES NO is equivalent to the trigger event and was never triggered.On this basis, illustratively, transmission is detected in current display page When the trigger event of network request, if the flag bit of the trigger event is NO, illustrate that the trigger event is to trigger for the first time;If The flag bit of the trigger event is YES, illustrates that the trigger event is to trigger again, for example, the trigger event may be second Triggering, third time triggering, the 4th triggering etc..
S120, if so, obtaining corresponding with network request network data from the data cached.
Wherein, if trigger event meets preset cache condition, i.e., include and net in the data cached on the client Network requests corresponding network data, then network data corresponding with network request can be directly acquired from the data cached. Illustratively, if trigger event is to trigger again, i.e., the network request is to send again, then in certain position ratios of client Such as memory, hard disk may be cached with the corresponding network data of the network request.Therefore, with network data and with the network request In case where associated cryptographic Hash occurs in pairs, for example, if finding in the data cached includes that the network is asked When seeking corresponding cryptographic Hash, illustrate that the corresponding network data of the network request has cached on the client.Particularly, due to network Data cache on the client, subsequent in the same display page or when being switched to other display pages, if needed again Identical network data is obtained, corresponding network data can be directly got and shown according to the cryptographic Hash, that is, is no longer needed to It is secondary to send the network request to server-side, to reduce the number that client sends network request, save network flow.
S130, if it is not, then to server-side send network request to obtain the corresponding network data of network request.
Wherein, if trigger event does not meet preset cache condition, i.e., do not include in the data cached on the client Network data corresponding with network request needs to send network request to server-side then to obtain the corresponding network number of network request According to.Illustratively, if trigger event is to trigger for the first time, i.e., the network request is to send for the first time, is illustrated in any of client Position is impossible to be cached with the corresponding network data of the network request.Therefore, the APP in client needs to send to server-side The network request, to download the network data of institute's request of server-side transmission.It is illustrative again, if the trigger event is It triggers again, but not finding in the data cached includes the corresponding network data of the network request, illustrates possibility For some purposes, client deletes the corresponding network data of the network request cached.At this point, client needs again Network request, the network data of request to re-download are sent to server-side.
The technical solution of the embodiment of the present disclosure sends the trigger event of network request by detecting in current display page When, determine whether the trigger event meets preset cache condition;If it is satisfied, including in the data cached on the client Network data corresponding with the network request can then directly acquire net corresponding with the network request from the data cached Network data, without sending network request to server-side again;If do not met, i.e., do not wrapped in the data that have cached on the client Network data corresponding with network request is included, then needs to send the network request to server-side to obtain the corresponding net of network request Network data.Above-mentioned technical proposal, can the same display page or be switched to other display pages need to obtain again it is identical Network data when, the network data can be directly obtained from the data cached, without repeat to server-side send network Request has saved network flow to reduce the number that client sends network request.
Embodiment two
Fig. 2 is a kind of flow chart of the acquisition methods of the network data provided in the embodiment of the present disclosure two.The present embodiment with It is optimized based on above-described embodiment one.In the present embodiment, network request is being sent to obtain network request to server-side After corresponding network data, the acquisition methods of the network data can also include: by the corresponding cold signal conversion of network request For thermal signal, and cache thermal signal, wherein the thermal signal cached includes the corresponding network data of network request.Correspondingly, such as Shown in Fig. 2, the method for the present embodiment can specifically include following steps:
S210, when current display page detects the trigger event for sending network request, determine whether trigger event full Sufficient preset cache condition.
S220, if so, obtaining corresponding with network request network data from the data cached
S230, if it is not, then send network request to server-side to obtain the corresponding network data of network request, and by network It requests corresponding cold signal to be converted to thermal signal, caches thermal signal, wherein the thermal signal cached includes that network request is corresponding Network data.
Wherein, after getting network data, the corresponding cold signal of the network request can be converted to thermal signal by APP, And the thermal signal is cached in client, which may include the corresponding network data of the network request, It at the same time, can also include the corresponding cryptographic Hash of the network request.
The cold signal that above-mentioned steps are related to may be considered the encapsulation again of network request, be a kind of with fixed grating The data type of formula.The cold signal is only used for request network data, can not cache the network data got from server-side.Phase It answers, thermal signal may be considered after converting to cold signal as a result, thermal signal may include the corresponding net of the cold signal The corresponding network data of network request, i.e. thermal signal is can to cache the network data got from server-side;At the same time, hot Signal can also include cryptographic Hash corresponding to the corresponding network request of cold signal.
However, can not directly be encapsulated as thermal signal, i.e., in client since network request can only be encapsulated as cold signal APP can not send network request by way of thermal signal, and therefore, APP needs for network request to be encapsulated as cold signal, and is obtaining After getting network data, which is converted into thermal signal.In fact, the mistake of network request is sent to server-side in client Cheng Zhong, client can directly transmit network request, can also send the corresponding cold signal of the network request.Because of no eristic What family end was sent is network request or cold signal, and what server-side received is network request, i.e., server-side can not know visitor Family end is which kind of technological means to carry out network request by actually, and what server-side received is only the corresponding essence of the network request Content.
Correspondingly, it is illustrative, if the corresponding cold signal of network request is converted to thermal signal, and cache hot letter Number, and the thermal signal cached includes the corresponding network data of network request, then if so, obtained from the data cached with The corresponding network data of network request, if may include: in the thermal signal cached includes net corresponding with network request Network data then obtain network data corresponding with network request from the thermal signal cached;Then if it is not, then being sent to server-side Network request is to obtain the corresponding network data of network request, if may include: trigger event is to trigger for the first time, alternatively, touching Hair event is triggering again and does not include the corresponding network data of network request in the thermal signal cached, then sends out to server-side SCN Space Cable Network is requested to obtain the corresponding network data of network request.
The technical solution of the embodiment of the present disclosure by the way that the corresponding cold signal of network request is converted to thermal signal, and caches It, can be when needing to obtain network data corresponding with the network request again, directly from the thermal signal cached when thermal signal Middle acquisition network data sends network request to server-side without repeating, so that reducing client sends network request Number has saved network flow.
Based on the above technical solution, optionally, APP can be grasped detecting the triggering into current display page When making, each network request being related in current display page is encapsulated as cold signal respectively, so that each network request It is associated with a preset cold signal, and each cold signal can be different.But it is asked at this point, APP does not execute the network It asks or the transmission of the cold signal operates.The advantages of this arrangement are as follows when APP monitor it is any in the current display page When network request, cold signal corresponding with the network request can be immediately obtained, it is more convenient to operate.Particularly, due to only relating to And it is encapsulated as cold signal to by the network request of current display page, it is not each display page being related in APP Network request is all encapsulated as cold signal, this is fewer to the occupancy of resource, and then relatively low to the performance requirement of system.
Based on the above technical solution, optionally, the property of thermal signal allows thermal signal to be buffered in client Memory in, for example by forms such as queue, array, storehouses thermal signal is cached in memory.It is straight compared to by network data It connects in the hard disk for being cached in client, the advantages of this arrangement are as follows, the reading for the network data in the thermal signal that has cached Take speed faster.Moreover, all information related with the APP will be from memory when the APP in client is discharged from memory Middle auto-destruct, such as the flag bit of trigger event, the network data etc. in thermal signal, this is it is possible to prevente effectively from client Data stacking the problem of, and destroy data manually without user;Correspondingly, if being switched to by current display page other When showing the page, as long as the APP is not discharged from memory, even if being switched to remaining display page, in the current display page Network data is still existing, that is, is still that can directly acquire.From the foregoing, it will be observed that being made by the way that thermal signal to be cached in memory In current display page or when being switched to other display pages, can quickly read the corresponding network number of the thermal signal According to;Moreover, the network data can be with the release of APP and auto-destruct, resource occupation are fewer.
Particularly, compared to cold signal, thermal signal is that initiatively, it can initiatively send network data into memory, I.e. network data can be initiatively cached in memory by thermal signal, and the caching be in the sub thread of client into Row;Correspondingly, the interface display of APP and user are to the main thread that the response processing of the various operations of the APP is all in client It carrying out, i.e., the caching of thermal signal will not impact such as Caton problem to any operation directly related with user, While saving network flow, it can also be ensured that the smooth application of APP.Further, when in the thermal signal cached include network When requesting corresponding cryptographic Hash, main thread directly can ask for the corresponding network data of the cryptographic Hash to sub thread.
Based on the above technical solution, optionally, thermal signal can be cached in queue, queue is cached in interior In depositing;Wherein, the buffer memory of queue is less than or equal to default value.Specifically, it is optional, if the current cache amount of queue is equal to Default value can delete the thermal signal in team's head position in queue, then thermal signal is cached in queue, queue is delayed It is stored in memory.Wherein, the quantity for the thermal signal that can be cached in buffer memory, that is, queue of queue can be limited, to avoid The problem of data stacking.If moreover, the characteristic of the first in first out of queue make queue current cache amount be equal to default value, The thermal signal for coming team's head can be deleted, directly to cache the thermal signal of newest acquisition.Compared to other thermal signals, team is come The cache-time of the thermal signal of head is earliest.It should be noted that network request corresponding for those deleted thermal signals, visitor The network request can be re-packaged into cold signal by family end, send the relevant operation when network request again to execute.
Embodiment three
Fig. 3 is the structural block diagram of the acquisition device for the network data that the embodiment of the present disclosure three provides, and the device is for executing The acquisition methods of network data provided by above-mentioned any embodiment.The acquisition of the network data of the device and the various embodiments described above Method belongs to the same inventive concept, the detail content of not detailed description in the embodiment of the acquisition device of network data, can With the embodiment of the acquisition methods with reference to above-mentioned network data.Referring to Fig. 3, the device is specific can include: caching condition judges mould Block 310, network data acquisition module 320 and network data request module 330.
Wherein, condition judgment module 310 is cached, for detecting the triggering thing for sending network request in current display page When part, determine whether trigger event meets preset cache condition;
Network data acquisition module 320, for if so, obtaining net corresponding with network request from the data cached Network data;
Network data request module 330, for being corresponded to if it is not, then sending network request to server-side with obtaining network request Network data.
In above scheme, optionally, the acquisition device of the network data can also include:
Thermal signal cache module for the corresponding cold signal of network request to be converted to thermal signal, and caches thermal signal, In, the thermal signal cached includes the corresponding network data of network request.
In above scheme, optionally, network data acquisition module 320 specifically can be used for:
If in the thermal signal cached including network data corresponding with network request, from the thermal signal cached It is middle to obtain network data corresponding with network request.
In above scheme, optionally, network data request module 330 specifically can be used for:
If trigger event be trigger for the first time, alternatively, trigger event be again triggering and in the thermal signal cached not Including the corresponding network data of network request, then network request is sent to obtain the corresponding network number of network request to server-side According to.
In above scheme, optionally, the acquisition device of the network data can also include:
Cold signal assemble module, for will currently show page when detecting the trigger action for entering current display page The each network request being related in face is encapsulated as cold signal respectively.
In above scheme, optionally, thermal signal cache module may include:
Thermal signal cache unit, for thermal signal to be cached in memory.
In above scheme, optionally, thermal signal cache unit may include:
Queue is cached in memory by thermal signal caching subelement for thermal signal to be cached in queue;Wherein, team The buffer memory of column is less than or equal to default value.
In above scheme, optionally, the acquisition device of the network data can also include:
Thermal signal removing module is deleted if the current cache amount for queue is equal to default value and is in team in queue The thermal signal of head position.
The acquisition device for the network data that the embodiment of the present disclosure three provides may be implemented by caching condition judgment module When current display page detects the trigger event for sending network request, determine whether the trigger event meets preset cache item Part;Network data acquisition module may be implemented if it is satisfied, including asking in the data cached on the client with the network Corresponding network data is sought, then can directly acquire network data corresponding with network request from the data cached, be not necessarily to Network request is sent to server-side again;If network data request module may be implemented not meet, i.e., delay on the client Do not include network data corresponding with network request in the data deposited, then needs to send network request to server-side to obtain network Request corresponding network data.Above-mentioned apparatus can obtain phase in the same display page or while being switched to other display pages again With network data when, the network data can be directly obtained from the data cached, without repeat to server-side send net Network request has saved network flow to reduce the number that client sends network request.
The acquisition device of network data provided by the embodiment of the present disclosure can be performed provided by disclosure any embodiment The acquisition methods of network data have the corresponding functional module of execution method and beneficial effect.
It is worth noting that, in the embodiment of the acquisition device of above-mentioned network data, included each unit and module It is only divided according to the functional logic, but is not limited to the above division, as long as corresponding functions can be realized; In addition, the specific name of each functional unit is also only for convenience of distinguishing each other, it is not limited to the protection scope of the disclosure.
Example IV
Below with reference to Fig. 4, it illustrates the structural representations for the terminal device 800 for being suitable for being used to realize the embodiment of the present disclosure Figure.Terminal device in the embodiment of the present disclosure can include but is not limited to such as mobile phone, laptop, digital broadcasting and connect Receive device, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle Carry navigation terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.End shown in Fig. 4 End equipment is only an example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in figure 4, terminal device 800 may include processing unit (such as central processing unit, graphics processor etc.) 801, random access can be loaded into according to the program being stored in read-only memory (ROM) 802 or from storage device 808 Program in memory (RAM) 803 and execute various movements appropriate and processing.In RAM 803, it is also stored with terminal device Various programs and data needed for 800 operations.Processing unit 801, ROM 802 and RAM 803 pass through the phase each other of bus 804 Even.Input/output (I/O) interface 805 is also connected to bus 804.
In general, following device can connect to I/O interface 805: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 806 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 807 of dynamic device etc.;Storage device 808 including such as tape, hard disk etc.;And communication device 809.Communication device 809, which can permit terminal device 800, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 4 shows tool There is the terminal device 800 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.
Embodiment five
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer storage medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 809, or from storage device 808 It is mounted, or is mounted from ROM 802.When the computer program is executed by processing unit 801, the embodiment of the present disclosure is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer storage medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer storage medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include in computer storage medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer storage medium can be included in above-mentioned terminal device;It is also possible to individualism, and not It is fitted into the terminal device.
Above-mentioned computer storage medium carries one or more program, when said one or multiple programs are by the end When end equipment executes, so that the terminal device: when current display page detects the trigger event for sending network request, determining Whether trigger event meets preset cache condition;If so, obtaining network corresponding with network request from the data cached Data;If it is not, then sending network request to server-side to obtain the corresponding network data of network request.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in module involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of module does not constitute the restriction to the module itself under certain conditions, for example, slow The condition judgment module of depositing is also described as " when current display page detects the trigger event for sending network request, really Determine whether trigger event meets preset cache condition ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (11)

1. a kind of acquisition methods of network data characterized by comprising
When current display page detects the trigger event for sending network request, it is default to determine whether the trigger event meets Caching condition;
If so, obtaining network data corresponding with the network request from the data cached;
If it is not, then sending the network request to server-side to obtain the corresponding network data of the network request.
2. the method according to claim 1, wherein sending the network request to server-side described to obtain After the corresponding network data of the network request, further includes:
The corresponding cold signal of the network request is converted into thermal signal, and caches the thermal signal, wherein the heat letter cached Number include the corresponding network data of the network request.
3. according to the method described in claim 2, it is characterized in that, it is described if so, from the data cached obtain and institute State the corresponding network data of network request, comprising:
If including network data corresponding with the network request in the thermal signal cached, cached from described Thermal signal in obtain corresponding with network request network data.
4. according to the method described in claim 2, it is characterized in that, described if it is not, then sending the network request to server-side To obtain the corresponding network data of the network request, comprising:
If the trigger event is to trigger for the first time, alternatively, the trigger event is triggered again and in the heat cached Do not include the corresponding network data of the network request in signal, then sends the network request to server-side to obtain the net Network requests corresponding network data.
5. according to the method described in claim 2, it is characterized by further comprising:
It is each by what is be related in the current display page when detecting the trigger action for entering the current display page The network request is encapsulated as the cold signal respectively.
6. according to the method described in claim 2, it is characterized in that, the caching thermal signal, comprising: by the thermal signal It is cached in memory.
7. according to the method described in claim 6, it is characterized in that, described be cached in the thermal signal in memory, comprising: will The thermal signal is cached in queue, and the queue is cached in memory;Wherein, the buffer memory of the queue is less than or equal to Default value.
8. the method according to the description of claim 7 is characterized in that it is described the thermal signal is cached in queue before, If further include: the current cache amount of the queue is equal to the default value, deletes in the queue in team's head position The thermal signal.
9. a kind of acquisition device of network data characterized by comprising
Caching condition judgment module, for determining institute when current display page detects the trigger event for sending network request State whether trigger event meets preset cache condition;
Network data acquisition module, for if so, obtaining network corresponding with the network request from the data cached Data;
Network data request module, for if it is not, then sending the network request to server-side to obtain the network request pair The network data answered.
10. a kind of terminal device, which is characterized in that the terminal device includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as the acquisition methods of network data described in any one of claims 1-8.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The acquisition methods such as network data described in any one of claims 1-8 are realized when being executed by processor.
CN201910554535.6A 2019-06-25 2019-06-25 Method, device, equipment and storage medium for acquiring network data Active CN110300163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910554535.6A CN110300163B (en) 2019-06-25 2019-06-25 Method, device, equipment and storage medium for acquiring network data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910554535.6A CN110300163B (en) 2019-06-25 2019-06-25 Method, device, equipment and storage medium for acquiring network data

Publications (2)

Publication Number Publication Date
CN110300163A true CN110300163A (en) 2019-10-01
CN110300163B CN110300163B (en) 2022-04-22

Family

ID=68028873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910554535.6A Active CN110300163B (en) 2019-06-25 2019-06-25 Method, device, equipment and storage medium for acquiring network data

Country Status (1)

Country Link
CN (1) CN110300163B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120323987A1 (en) * 2011-06-16 2012-12-20 International Business Machines Corporation Shared network response cache
CN106909690A (en) * 2017-03-07 2017-06-30 四川驹马企业管理有限公司 Network data caching method
CN107491320A (en) * 2017-06-26 2017-12-19 北京五八信息技术有限公司 Loading method and device based on mixed mode Mobile solution
CN108153783A (en) * 2016-12-06 2018-06-12 腾讯科技(北京)有限公司 A kind of method and apparatus of data buffer storage
CN108563470A (en) * 2018-03-06 2018-09-21 北京酷我科技有限公司 The loaded and optimized strategy of web page under a kind of iOS
US20180338015A1 (en) * 2017-05-16 2018-11-22 Sap Se Progressive hybrid web application

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120323987A1 (en) * 2011-06-16 2012-12-20 International Business Machines Corporation Shared network response cache
CN108153783A (en) * 2016-12-06 2018-06-12 腾讯科技(北京)有限公司 A kind of method and apparatus of data buffer storage
CN106909690A (en) * 2017-03-07 2017-06-30 四川驹马企业管理有限公司 Network data caching method
US20180338015A1 (en) * 2017-05-16 2018-11-22 Sap Se Progressive hybrid web application
CN107491320A (en) * 2017-06-26 2017-12-19 北京五八信息技术有限公司 Loading method and device based on mixed mode Mobile solution
CN108563470A (en) * 2018-03-06 2018-09-21 北京酷我科技有限公司 The loaded and optimized strategy of web page under a kind of iOS

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BYUNGSOO LIM,JOONOO KIM: ""Page flip contents caching method using user request on digital media server"", 《INTERNATIONAL CONGRESS ON ULTRA MODERN TELECOMMUNICATIONS AND CONTROL SYSTEMS》 *
向广利等: "代理缓存技术在流媒体中的应用", 《湖北教育学院学报》 *

Also Published As

Publication number Publication date
CN110300163B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN110086895A (en) Domain name analytic method, device, medium and electronic equipment
CN110147398A (en) A kind of data processing method, device, medium and electronic equipment
CN109871388A (en) Data cache method, device, whole electronic equipment and storage medium
CN109542578A (en) A kind of display methods of list interface, device, equipment and storage medium
WO2021190129A1 (en) Method and device for page processing, electronic device, and computer-readable storage medium
CN107197359B (en) Video file caching method and device
CN109543080A (en) A kind of caching data processing method, device, electronic equipment and storage medium
CN110365796A (en) Service request processing method, device
CN110535661A (en) Method for processing business, device, electronic equipment and storage medium based on block chain
CN110286928A (en) Interface element update method, device, electronic equipment and the storage medium of application program
WO2021082600A1 (en) Webpage image monitoring method and apparatus, electronic device, and computer readable storage medium
CN109885593A (en) Method and apparatus for handling information
WO2003046727A1 (en) Information providing system, information providing method, and information providing program
WO2020199659A1 (en) Method and apparatus for determining push priority information
CN111309496A (en) Method, system, device, equipment and storage medium for realizing delay task
CN109697034A (en) A kind of method for writing data, device, electronic equipment and storage medium
CN108965984A (en) A kind of method, apparatus and equipment/terminal/server file transmission and played
CN111241137B (en) Data processing method, device, electronic equipment and storage medium
CN110300163A (en) A kind of acquisition methods of network data, device, equipment and storage medium
CN110059260A (en) A kind of recommended method, device, equipment and medium
CN109408387A (en) Page test method and device
CN109862069A (en) Message treatment method and device
CN110147368A (en) Data capture method and device for server
WO2021082599A1 (en) Wed page image monitoring method and device, electronic equipment and computer readable storage medium
CN110730251B (en) Method, device, medium and electronic equipment for analyzing domain name

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