Disclosure of Invention
The embodiment of the disclosure provides a data loading method and device.
In a first aspect, an embodiment of the present disclosure provides a data loading method, including: receiving user operation; responding to the user operation which accords with the preset operation of triggering the loading request, the loading information stored in the local buffer region does not meet the loading condition of the loading request and the local transmission identifier represents that the data of the server is not loaded completely, generating a first transmission request based on the loading request and the transmission strategy, and sending the first transmission request to the server; receiving first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data and storing the analyzed information at the tail part of the local buffer area; and loading all the loading information indicated by the loading request from the local buffer.
In some embodiments, whether the load information stored in the local buffer satisfies the load condition of the load request is determined by: analyzing the loading request data packet to obtain the information sequence number of the first piece of loading information indicated by the loading request and the information number of all pieces of loading information indicated by the loading request; inquiring whether information exists in a local buffer area after the last piece of loading information corresponding to the loading request according to the information sequence number and the information number, wherein the local buffer area is used for storing each piece of information in sequence; responding to no information after the last piece of loading information corresponding to the loading request in the local buffer area, and judging that the loading information stored in the local buffer area does not meet the loading condition of the loading request; and in response to the fact that the information is in the local buffer area after the last piece of loading information corresponding to the loading request, judging that the loading information stored in the local buffer area meets the loading condition of the loading request.
In some embodiments, generating a first transmission request based on the loading request and the transmission policy, and sending the first transmission request to the server, includes: analyzing the data of the local buffer area to obtain the information serial number of the last piece of information in the local buffer area; and generating a first transmission request according to the information sequence number and the information number of the last piece of information in the local buffer area, and sending the first transmission request to the server.
In some embodiments, after receiving the user operation, the method further comprises: and in response to the user operation meeting the preset operation of triggering the loading request and the loading information stored in the local buffer area meeting the loading condition of the loading request, loading all the loading information indicated by the loading request from the local buffer area.
In some embodiments, after receiving the user operation, the method further comprises: and judging whether a local buffer area exists, if not, creating the local buffer area, storing the current time, and setting a local transmission identifier as representing that the data of the server end is not loaded completely.
In some embodiments, after receiving the first transmission data corresponding to the first transmission request returned by the server, parsing the first transmission data, and storing the parsed information in the tail of the local buffer, the method further includes: and inquiring the length of the local buffer area, and if the length of the local buffer area is greater than a threshold value, storing the analyzed information in a file list, wherein the file list is used for information interaction with the local buffer area.
In some embodiments, after loading all the loading information indicated by the loading request from the local buffer, the method further comprises: judging whether the loading information stored in the local buffer area meets the loading condition of the next loading request or not according to the loading sequence; responding to the situation that the loading information stored in the local buffer area does not meet the loading condition of the next loading request and the local transmission identifier represents that the server data is not loaded completely, generating a second transmission request based on the next loading request and the transmission strategy, and sending the second transmission request to the server; and receiving second transmission data corresponding to the second transmission request returned by the server, analyzing the second transmission data and storing the analyzed information at the tail part of the local buffer area.
In a second aspect, an embodiment of the present disclosure provides a data loading method, including: receiving a transmission request sent by a client; and acquiring transmission data corresponding to the transmission request and returning the transmission data to the client.
In some embodiments, obtaining transmission data corresponding to the transmission request and returning the transmission data to the client includes: analyzing the transmission request data packet to obtain the serial number of the first data requested by the transmission request and the total number of the data requested by the transmission request; and judging whether all transmission data corresponding to the transmission request exist or not according to the serial number of the first data and the total number of the data, responding to the existence of all transmission data corresponding to the transmission request, acquiring all transmission data corresponding to the transmission request and returning all the transmission data to the client, responding to the absence of all transmission data corresponding to the transmission request, acquiring the transmission data corresponding to the transmission request in the library and returning the transmission data to the client.
In a third aspect, an embodiment of the present disclosure provides a data loading apparatus, including: a receiving unit configured to receive a user operation; the transmission unit is configured to respond to the situation that user operation meets the preset operation of triggering a loading request, loading information stored in a local buffer does not meet the loading condition of the loading request, and the data of the local transmission identifier representation server is not loaded completely, generate a first transmission request based on the loading request and a transmission strategy, and send the first transmission request to the server; the analysis unit is configured to receive first transmission data corresponding to the first transmission request returned by the server, analyze the first transmission data and store the analyzed information at the tail part of the local buffer area; and the first loading unit is configured to load all the loading information indicated by the loading request from the local buffer.
In some embodiments, the transmission unit comprises: the analysis module is configured to analyze the loading request data packet to acquire an information serial number of first loading information indicated by the loading request and the number of information pieces of all loading information indicated by the loading request; the judging module is configured to inquire whether information exists in the local buffer area after the last piece of loading information corresponding to the loading request according to the information sequence number and the information number, wherein the local buffer area is used for storing each piece of information in sequence; responding to no information after the last piece of loading information corresponding to the loading request in the local buffer area, and judging that the loading information stored in the local buffer area does not meet the loading condition of the loading request; and in response to the fact that the information is in the local buffer area after the last piece of loading information corresponding to the loading request, judging that the loading information stored in the local buffer area meets the loading condition of the loading request.
In some embodiments, the transmission unit comprises: the acquisition module is configured to analyze the data of the local buffer area and acquire the information serial number of the last piece of information in the local buffer area; and the sending module is configured to generate a first transmission request according to the information sequence number and the information number of the last piece of information in the local buffer area and send the first transmission request to the server.
In some embodiments, the apparatus further comprises: and the second loading unit is configured to respond to the user operation which accords with the preset operation of triggering the loading request, and the loading information stored in the local buffer area meets the loading condition of the loading request, and load all the loading information indicated by the loading request from the local buffer area.
In a fourth aspect, an embodiment of the present disclosure provides a terminal, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fifth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The data loading method and the device provided by the embodiment of the disclosure generate a first transmission request by judging that the loading information stored in the local buffer does not satisfy the loading condition of the loading request and the local transmission identifier represents that the server data is not loaded completely, based on the loading request and the transmission policy, send the first transmission request to the server, load all the loading information indicated by the loading request from the local buffer, realize that the client judges the loading condition locally and determines whether there is any data to be transmitted, and load the data locally, save the work of judging the loading condition and determining the transmission condition by the server, overcome the problem of dependence on the processing speed of the server and the network, improve the data transmission and processing speed, improve the data loading efficiency, generate the first transmission request based on the loading request and the transmission policy, the method comprises the steps of sending a first transmission request to a server, receiving first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data and storing the analyzed information at the tail part of a local buffer area, so that the data transmission with the server is transmitted according to a transmission strategy when conditions are met, rather than the data transmission is carried out continuously in real time, the frequency of requesting data from the server is reduced, the concurrence pressure of the server is reduced, and the data transmission efficiency is improved.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which a data loading method or a data loading apparatus of an embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to send transmission requests or to receive transmission data or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a shopping application, a pick-up application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like. The terminal devices 101, 102, 103 may perform processing such as analysis on the transmission data to present the processing result (e.g., loading information) to the user.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and support, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services, such as a server that provides support for transmission requests of the terminal apparatuses 101, 102, 103. The server may perform processing such as determination on the received data such as the transmission request, and feed back the processing result (for example, transmission data) to the terminal device.
It should be noted that the data loading method provided by the embodiment of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and the corresponding data loading apparatus is generally disposed in the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a data loading method applied to a client is shown in accordance with the present disclosure. The data loading method comprises the following steps:
step 201, receiving user operation.
In this embodiment, when a user performs various user operations such as browsing, querying, and the like on an execution main body (for example, a terminal device shown in fig. 1) of the method, the execution main body may receive the user operation, so as to trigger a loading request when the user operation conforms to a preset operation of the loading request.
Step 202, in response to that the user operation meets the preset operation of triggering the loading request, the loading information stored in the local buffer does not meet the loading condition of the loading request, and the local transmission identifier represents that the data of the server is not loaded completely, generating a first transmission request based on the loading request and the transmission policy, and sending the first transmission request to the server.
In this embodiment, the execution main body, in response to an operation that a user operation meets a preset trigger loading request, determines whether loading information stored in the local buffer area meets loading conditions of the loading request and queries contents represented by the local transmission identifier, and when it is determined that the loading information stored in the local buffer area does not meet the loading conditions of the loading request and the data of the server end is not completely loaded by the local transmission identifier, generates a first transmission request according to the loading request and a preset transmission policy, and sends the first transmission request to the server end. The data structure of the local buffer zone can be one of an array, a list and a file; the local transport identifier may be a boolean variable, and when the local transport identifier is not 0, the local transport identifier indicates that the server data is not loaded.
As an example, the terminal, in response to a user operation meeting a preset operation triggering a loading request, determines whether loading information stored in the local buffer array meets a loading condition of the loading request, generates a first transmission request according to a total number of the loading information requested by the loading request when the loading information stored in the local buffer array does not meet the loading condition of the loading request and a local transmission identifier is not 0, wherein the total number of data requested to be transmitted is equal to the total number of the loading information in the loading request plus the preset value, and finally sends the first transmission request to the server.
Step 203, receiving the first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data, and storing the analyzed information in the tail of the local buffer.
In this embodiment, after the execution main body receives the first transmission data corresponding to the first transmission request returned by the server, the execution main body parses the first transmission data according to a parsing method, and stores the parsed information in the tail of the ordered local buffer.
And step 204, loading all the loading information indicated by the loading request from the local buffer.
In this embodiment, the execution main body loads all the loading information from the stored local buffer according to the loading request, so as to be displayed to the user. The total loading information is used to characterize the sum of each piece of loading information indicated by the loading request.
Generally, whether the loading information stored in the local buffer satisfies the loading condition of the loading request is determined as follows: analyzing the loading request data packet to obtain the information sequence number of the first piece of loading information indicated by the loading request and the information number of all pieces of loading information indicated by the loading request; inquiring whether information exists in a local buffer area after the last piece of loading information corresponding to the loading request according to the information sequence number and the information number, wherein the local buffer area is used for storing each piece of information in sequence; responding to no information after the last piece of loading information corresponding to the loading request in the local buffer area, and judging that the loading information stored in the local buffer area does not meet the loading condition of the loading request; and in response to the fact that the information is in the local buffer area after the last piece of loading information corresponding to the loading request, judging that the loading information stored in the local buffer area meets the loading condition of the loading request. Because the loading information is judged before loading, the problems that loading is judged to be completed by mistake and a user is prompted by mistake when the number of the last remaining pieces of loading data is just equal to the number of pieces of loading request data in the prior art are solved, the accuracy of data recording is improved, and the user experience is improved.
With continued reference to fig. 3, fig. 3 is a schematic diagram 300 of an application scenario of the data loading method applied to the client according to the present embodiment. The user performs inquiry operation through the mobile phone to request to display the next 10 information items from the 11 th information item, after the mobile phone receives the user operation, when the user operation is judged to meet the preset operation of triggering the loading request, the loading information stored in the local buffer area meets the loading condition of the loading request and the local transmission identifier represents that the server data is not loaded completely, generating a first transmission request based on the loading request and the transmission strategy, sending the first transmission request to the server, receiving first transmission data corresponding to the first transmission request returned by the server by the mobile phone, analyzing the first transmission data and storing 10 analyzed pieces of information at the tail part of the local buffer area, enabling the mobile phone to transmit the first transmission data to the server from the local buffer area, the next 10 pieces of information from the 11 th piece of information indicated by the load request are loaded, and all the information of the user query is popped up as indicated by reference numeral 301.
The data loading method provided by the embodiment of the disclosure generates a first transmission request based on a loading request and a transmission policy by judging that the loading information stored in a local buffer does not satisfy the loading condition of the loading request and the local transmission identifier represents that the server data is not loaded completely, transmits the first transmission request to the server, loads all loading information indicated by the loading request from the local buffer, realizes that a client judges the loading condition locally and determines whether data to be transmitted still exists, and loads the data locally, overcomes the problem of dependence on the processing speed of a server and a network, saves the work of judging the loading condition and determining the transmission condition by the server in the prior art, improves the data transmission and processing speed, improves the data loading efficiency, generates the first transmission request based on the loading request and the transmission policy, the method comprises the steps of sending a first transmission request to a server, receiving first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data and storing the analyzed information at the tail part of a local buffer area, so that the data transmission with the server is transmitted according to a transmission strategy when conditions are met, rather than the data transmission is carried out continuously in real time, the frequency of requesting data from the server is reduced, the concurrence pressure of the server is reduced, and the data transmission efficiency is improved.
With further reference to FIG. 4, a flow diagram of yet another embodiment of a data loading method applied to a client is shown. The flow 400 of the data loading method includes the following steps:
step 401, receiving a user operation.
Step 402, in response to that the user operation meets the preset operation of triggering the loading request, the loading information stored in the local buffer does not meet the loading condition of the loading request, and the local transmission identifier represents that the server data is not loaded completely, analyzing the data in the local buffer to obtain the information sequence number of the last piece of information in the local buffer.
In this embodiment, in response to an operation that a user operation meets a preset trigger loading request, the execution main body determines whether loading information stored in the local buffer area meets loading conditions of the loading request and queries contents represented by the local transmission identifier, and when it is determined that the loading information stored in the local buffer area does not meet the loading conditions of the loading request and data of the local transmission identifier represented by the server is not loaded, analyzes the data of the local buffer area to obtain an information sequence number of the last piece of information in the local buffer area.
Step 403, generating a first transmission request according to the information sequence number and the information number of the last piece of information in the local buffer, and sending the first transmission request to the server.
In this embodiment, the execution main body uses the information sequence number of the last piece of information in the local buffer as the initial transmission data sequence number of the first transmission request, uses the number of the pieces of information as the total number of transmission data requested by the first transmission request, generates the first transmission request, and sends the first transmission request to the server.
Step 404, receiving the first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data, and storing the analyzed information in the tail of the local buffer.
Step 405, load all the load information indicated by the load request from the local buffer.
In this embodiment, the specific operations of steps 401, 404, and 405 are substantially the same as the operations of steps 201, 203, and 204 in the embodiment shown in fig. 2, and are not described again here.
Generally, after receiving first transmission data corresponding to a first transmission request returned by a server, analyzing the first transmission data and storing the analyzed information at the tail of a local buffer, an execution main body judges whether the number of the analyzed information pieces is smaller than the number of the information pieces requested by the first transmission request, and if the number of the analyzed information pieces is smaller than the number of the information pieces requested by the first transmission request, sets a local transmission identifier as that the data of the representative server is completely loaded.
In some optional implementation manners of this embodiment, after receiving first transmission data corresponding to the first transmission request returned by the server, parsing the first transmission data, and storing the parsed information in the tail of the local buffer, the method further includes: and inquiring the length of the local buffer area, and if the length of the local buffer area is greater than a threshold value, storing the analyzed information in a file list, wherein the file list is used for information interaction with the local buffer area. By executing an effective memory use scheme, when the length of the local buffer area is greater than a threshold value, the analyzed information is stored in a file list, and only a few pages of data before and after the current request data are reserved in the local buffer area (the specific page number can be calculated according to the size of the buffer area), so that the data loading and displaying can be quickly carried out when a user triggers a loading request without occupying too much memory, meanwhile, a part of data is stored in the local file list, the frequency of acquiring the data from a server side is saved, and the loading efficiency is improved.
Generally, after receiving a user operation, the execution main body loads all loading information indicated by the loading request from the local buffer area in response to that the user operation conforms to a preset operation for triggering the loading request and that the local transport identifier represents that the server data has been loaded.
In some optional implementations of this embodiment, after receiving the user operation, the method further includes: and judging whether a local buffer area exists, if not, creating the local buffer area, storing the current time, and setting a local transmission identifier as representing that the data of the server end is not loaded completely. When a loading request is received, a local buffer area is created in real time instead of the local buffer area existing all the time, so that the occupation of a memory is saved.
Generally, the execution main body judges whether the current time is greater than the effective time of the local buffer area, if the current time is greater than the effective time of the local buffer area, the local buffer area is emptied, and a local transmission identifier is set to represent that the data loading of the server is not completed, wherein the effective time is used for representing the last time point of the local buffer area within the effective time length. The buffer management class periodically checks whether the managed buffer has expired through a timer, and if so, the buffer management class will be destroyed immediately. By effectively managing the local buffer area, the memory is prevented from being excessively occupied for a long time, the processing speed is increased, and the data loading is more efficient.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, in the process 400 of data loading in this embodiment, the data in the local buffer is analyzed to obtain the information sequence number of the last piece of information in the local buffer, and according to the information sequence number and the number of pieces of information of the last piece of information in the local buffer, a first transmission request is generated and sent to the server.
With further reference to FIG. 5, a flow diagram of yet another embodiment of a data loading method applied to a client is shown. The process 500 of the data loading method includes the following steps:
step 501, receiving a user operation.
Step 502, in response to that the user operation meets the preset operation of triggering the loading request and the loading information stored in the local buffer area meets the loading condition of the loading request, loading all the loading information indicated by the loading request from the local buffer area.
In this embodiment, the execution main body determines whether the loading information stored in the local buffer area meets the loading condition of the loading request in response to the user operation meeting a preset operation of triggering the loading request, and loads all the loading information from the local buffer area when the loading information stored in the local buffer area meets the loading condition of the loading request, so as to be displayed to the user.
Step 503, according to the loading sequence, determining whether the loading information stored in the local buffer satisfies the loading condition of the next loading request.
In this embodiment, the execution main body determines whether the loading information stored in the local buffer satisfies the loading condition of the next loading request according to a loading order, where the loading order may be determined as an information increasing order or an information decreasing order according to an operation habit of a user.
Step 504, in response to that the loading information stored in the local buffer does not satisfy the loading condition of the next loading request and the local transmission identifier indicates that the server data is not loaded completely, generating a second transmission request based on the next loading request and the transmission policy, and sending the second transmission request to the server.
In this embodiment, the execution main body determines whether the loading information stored in the local buffer satisfies the loading condition of the next loading request and queries the content represented by the local transmission identifier, and when it is determined that the loading information stored in the local buffer does not satisfy the loading condition of the next loading request and the local transmission identifier represents that the data loading at the server is not completed, generates a second transmission request according to the next loading request and a preset transmission policy, and sends the second transmission request to the server.
And 505, receiving second transmission data corresponding to the second transmission request returned by the server, analyzing the second transmission data, and storing the analyzed information in the tail part of the local buffer.
In this embodiment, after receiving second transmission data corresponding to the second transmission request returned by the server, the execution main body analyzes the second transmission data by using an analysis method, and stores the analyzed information in the tail of the ordered local buffer.
Generally, after receiving second transmission data corresponding to the second transmission request returned by the server, the execution main body analyzes the second transmission data and stores the analyzed information at the tail of the local buffer, and then determines whether the number of the analyzed information pieces is smaller than the number of the information pieces requested by the second transmission request, and if the number of the analyzed information pieces is smaller than the number of the information pieces requested by the second transmission request, sets the local transmission identifier as that the data loading of the server is completed.
Generally, after receiving second transmission data corresponding to a second transmission request returned by the server, the execution main body parses the second transmission data and stores parsed information at the tail of the local buffer, queries the length of the local buffer, and stores the parsed information in a file list if the length of the local buffer is greater than a threshold, where the file list is used for information interaction with the local buffer.
In this embodiment, the specific operation of step 501 is substantially the same as the operation of step 201 in the embodiment shown in fig. 2, and is not described herein again.
As can be seen from fig. 5, compared with the embodiment corresponding to fig. 2, in the data loading process 500 in this embodiment, by determining whether the loading information stored in the local buffer satisfies the loading condition of the next loading request, in response to that the loading information stored in the local buffer does not satisfy the loading condition of the next loading request and the local transmission identifier indicates that the data of the server is not loaded completely, based on the next loading request and the transmission policy, a second transmission request is generated, a second transmission request is sent to the server, second transmission data corresponding to the second transmission request returned by the server is received, the second transmission data is analyzed and the analyzed information is stored at the tail of the local buffer, because the data storage of the next loading request is completed while the information is loaded this time, preparation is made for the next loading request, and time for obtaining the transmission data from the server is saved, the data loading efficiency is improved.
With further reference to FIG. 6, a flow diagram of one embodiment of a data loading method applied to a server is shown. The flow 600 of the data loading method includes the following steps:
step 601, receiving a transmission request sent by a client.
In this embodiment, an execution subject (for example, a server shown in fig. 1) of the data loading method receives a transmission request sent by a client.
Step 602, obtaining transmission data corresponding to the transmission request and returning the transmission data to the client.
In this embodiment, after receiving a transmission request sent by a client, an execution main body obtains transmission data corresponding to the transmission request and returns the transmission data to the client.
In some optional implementation manners of this embodiment, obtaining transmission data corresponding to the transmission request and returning the transmission data to the client includes: analyzing the transmission request data packet to obtain the serial number of the first data requested by the transmission request and the total number of the data requested by the transmission request; and judging whether all transmission data corresponding to the transmission request exist or not according to the serial number of the first data and the total number of the data, responding to the existence of all transmission data corresponding to the transmission request, acquiring all transmission data corresponding to the transmission request and returning all the transmission data to the client, responding to the absence of all transmission data corresponding to the transmission request, acquiring the transmission data corresponding to the transmission request in the library and returning the transmission data to the client.
The data loading method applied to the server side provided by the above embodiment of the present disclosure obtains the transmission data corresponding to the transmission request by receiving the transmission request sent by the client side and returns the transmission data to the client side, so that the server side returns the transmission data to the client side according to the transmission request, so as to meet the requirement for loading the data.
With further reference to fig. 7, as an implementation of the method shown in fig. 2 to fig. 5, the present disclosure provides an embodiment of a data loading apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 7, the data loading apparatus 700 of the present embodiment includes: a receiving unit 701, a transmitting unit 702, a parsing unit 703 and a first loading unit 704. Wherein, the receiving unit 701 is configured to receive a user operation; a transmission unit 702, configured to generate a first transmission request based on the loading request and a transmission policy and send the first transmission request to the server, in response to that the user operation meets a preset operation for triggering the loading request, the loading information stored in the local buffer does not meet a loading condition of the loading request, and the local transmission identifier indicates that the data of the server is not loaded completely; the analysis unit 703 is configured to receive first transmission data corresponding to the first transmission request returned by the server, analyze the first transmission data, and store the analyzed information in the tail of the local buffer; a first loading unit 704 configured to load all loading information indicated by the load request from the local buffer.
In this embodiment, specific processing of the receiving unit 701, the transmitting unit 702, the analyzing unit 703 and the first loading unit 704 of the data loading apparatus 700 and technical effects thereof may refer to the related descriptions of step 201 to step 204 in the embodiment corresponding to fig. 2, and are not described herein again.
In some optional implementations of this embodiment, the transmission unit includes: the analysis module is configured to analyze the loading request data packet to acquire an information serial number of first loading information indicated by the loading request and the number of information pieces of all loading information indicated by the loading request; the judging module is configured to inquire whether information exists in the local buffer area after the last piece of loading information corresponding to the loading request according to the information sequence number and the information number, wherein the local buffer area is used for storing each piece of information in sequence; responding to no information after the last piece of loading information corresponding to the loading request in the local buffer area, and judging that the loading information stored in the local buffer area does not meet the loading condition of the loading request; and in response to the fact that the information is in the local buffer area after the last piece of loading information corresponding to the loading request, judging that the loading information stored in the local buffer area meets the loading condition of the loading request.
In some optional implementations of this embodiment, the transmission unit includes: the acquisition module is configured to analyze the data of the local buffer area and acquire the information serial number of the last piece of information in the local buffer area; and the sending module is configured to generate a first transmission request according to the information sequence number and the information number of the last piece of information in the local buffer area and send the first transmission request to the server.
In some optional implementations of this embodiment, the apparatus further includes: and the second loading unit is configured to respond to the user operation which accords with the preset operation of triggering the loading request, and the loading information stored in the local buffer area meets the loading condition of the loading request, and load all the loading information indicated by the loading request from the local buffer area.
The data loading device provided by the embodiment of the disclosure generates a first transmission request based on a loading request and a transmission strategy by judging that loading information stored in a local buffer region does not satisfy the loading condition of the loading request and a local transmission identifier represents that data of a server end is not loaded completely, and sends the first transmission request to the server end, and loads all loading information indicated by the loading request from the local buffer region, so that a client end judges the loading condition locally and determines whether data needing to be transmitted still exists, and loads the data locally, thereby saving the work of judging the loading condition and determining the transmission condition through the server end, overcoming the dependence problem on the processing speed of a server and a network, improving the data transmission and processing speed, and improving the data loading efficiency; the method comprises the steps of generating a first transmission request based on a loading request and a transmission strategy, sending the first transmission request to a server, receiving first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data and storing the analyzed information at the tail part of a local buffer area, so that the data transmission with the server is transmitted according to the transmission strategy when the conditions are met, rather than the data transmission without stopping in real time, the frequency of requesting data from the server is reduced, the concurrency pressure of the server is reduced, and the data transmission efficiency is improved.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use in implementing a terminal device of an embodiment of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present disclosure.
As shown in fig. 8, a computer system 800 may include a processing device (e.g., central processing unit, graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage device 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the computer system 800 to communicate with other devices wirelessly or by wire to exchange data. While fig. 8 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 8 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving user operation; responding to the user operation which accords with the preset operation of triggering the loading request, the loading information stored in the local buffer region does not meet the loading condition of the loading request and the local transmission identifier represents that the data of the server is not loaded completely, generating a first transmission request based on the loading request and the transmission strategy, and sending the first transmission request to the server; receiving first transmission data corresponding to the first transmission request returned by the server, analyzing the first transmission data and storing the analyzed information at the tail part of the local buffer area; and loading all the loading information indicated by the loading request from the local buffer.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a transmitting unit, a parsing unit, and a loading unit. The names of these units do not form a limitation on the unit itself in some cases, for example, the transmission unit may also be described as "a unit that generates a first transmission request and sends the first transmission request to the server based on the load request and the transmission policy in response to that the user operation meets a preset operation for triggering the load request, the load information stored in the local buffer does not meet the load condition of the load request, and the local transmission identifier indicates that the data at the server is not completely loaded".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.