CN112685097B - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN112685097B
CN112685097B CN202011583781.3A CN202011583781A CN112685097B CN 112685097 B CN112685097 B CN 112685097B CN 202011583781 A CN202011583781 A CN 202011583781A CN 112685097 B CN112685097 B CN 112685097B
Authority
CN
China
Prior art keywords
data packet
file
target
time length
target data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011583781.3A
Other languages
Chinese (zh)
Other versions
CN112685097A (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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011583781.3A priority Critical patent/CN112685097B/en
Publication of CN112685097A publication Critical patent/CN112685097A/en
Application granted granted Critical
Publication of CN112685097B publication Critical patent/CN112685097B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a data processing method and device, relates to the field of internet application, and aims to at least solve the problem that in the prior art, the starting speed of an application program is low due to the fact that multiple addressing is required. The data processing method comprises the following steps: receiving an acquisition request, wherein the acquisition request comprises an identifier of a target program, and the running of the target program does not need to execute an installation operation; responding to the acquisition request, and acquiring the identification of a target data packet, wherein the target data packet is a data packet which corresponds to the identification of a target program and has the shortest reading time; and sending the identification of the target data packet, wherein the identification of the target data packet is used for indicating the terminal to load the file in the target data packet and starting the target program.

Description

Data processing method and device
Technical Field
The present disclosure relates to the field of internet applications, and in particular, to a data processing method and apparatus.
Background
An applet is an application that can be used without installation and that runs in the environment provided by the host application. In the scenario of running the applet for the first time, the terminal needs to download the data packet of the applet from the server, then parse the data packet, and load the file in the data packet to start the applet.
The data package typically includes a plurality of files. Even though the storage paths of these files are identical, their storage addresses at the physical disk are not contiguous. Therefore, the terminal needs to perform addressing several times to complete the loading of the file. Thus, in the case where the data packet includes a larger number of files, the terminal loads the files at a lower speed, which in turn results in a lower starting speed of the applet.
Disclosure of Invention
The disclosure provides a data processing method and device, which at least solve the problem in the prior art that the starting speed of an application program is low due to the fact that multiple addressing is required. The technical scheme of the present disclosure is as follows:
according to a first aspect of the present disclosure, there is provided a data processing method, applied to a server, the data processing method including: receiving an acquisition request, wherein the acquisition request comprises an identifier of a target program, and the running of the target program does not need to execute an installation operation; responding to the acquisition request, and acquiring the identification of a target data packet, wherein the target data packet is a data packet which corresponds to the identification of a target program and has the shortest reading time; and sending the identification of the target data packet, wherein the identification of the target data packet is used for indicating the terminal to load the file in the target data packet and starting the target program.
Optionally, in response to the acquiring request, acquiring the identifier of the target data packet includes: responding to the acquisition request, analyzing a development data packet of the target program, and obtaining a plurality of source files in the development data packet; splicing the plurality of source files to obtain spliced files; determining a first time length and a second time length; the first time length is the time length for reading a plurality of source files, and the second time length is the time length for reading spliced files; determining a data packet corresponding to a target time length as a target data packet, wherein the target time length is the shorter time length of the first time length and the second time length; and obtaining the identification of the target data packet.
Optionally, in the case that the second time period is determined to be the target time period, the data processing method further includes: generating a spliced data packet corresponding to the spliced file; the determining the data packet corresponding to the target duration as the target data packet includes: and determining the spliced data packet as a target data packet.
Optionally, in the case that the first time length is determined to be the target time length, determining the data packet corresponding to the target time length as the target data packet includes: and determining the development data packet of the target program as a target data packet.
Optionally, the spliced file includes a file header, a file index area and a file data area; the file header includes the total size of the file and the number of source files; the file index area comprises a file name of each source file in the plurality of source files, a file offset value of each source file and a file size of each source file; the file data area includes valid data for each source file.
According to a second aspect of the present disclosure, there is provided a data processing method, applied to a terminal, the data processing method including: responding to a starting instruction of a target program to acquire a target data packet; the target data packet is a data packet which corresponds to the identification of the target program and has the shortest reading time; the running of the target program does not need to execute an installation operation; analyzing the target data packet to obtain a file in the target data packet; determining a loading mode of a file in a target data packet; and loading the files in the target data packet according to the loading mode of the files in the target data packet, and starting the target program.
Optionally, the determining the loading manner of the file in the target data packet includes: under the condition that the files in the target data packet are spliced files, determining that the loading mode of the files in the target data packet is a single file loading mode; and under the condition that the files in the target data packet are determined to be a plurality of files, determining that the loading mode of the files in the target data packet is a multi-file loading mode.
Optionally, the obtaining the target data packet in response to the start instruction of the target program includes: responding to a starting instruction of a target program, and sending an acquisition request; receiving an identification of a target data packet; and downloading the target data packet according to the identification of the target data packet.
According to a third aspect of the present disclosure, there is provided a server including an acquisition module and a transmission module. The acquisition module is configured to receive an acquisition request, wherein the acquisition request comprises an identifier of a target program, and the target program is not required to run by executing an installation operation; the acquisition module is further configured to execute the steps of responding to the acquisition request and acquiring the identification of a target data packet, wherein the target data packet is a data packet which corresponds to the identification of the target program and has the shortest reading time; and the sending module is configured to execute the identification of the target data packet, wherein the identification of the target data packet is used for indicating the terminal to load the file in the target data packet and starting the target program.
Optionally, the acquiring module is specifically configured to perform: responding to the acquisition request, analyzing a development data packet of the target program, and obtaining a plurality of source files in the development data packet; splicing the plurality of source files to obtain spliced files; determining a first time length and a second time length; the first time length is the time length for reading a plurality of source files, and the second time length is the time length for reading spliced files; determining a data packet corresponding to a target time length as a target data packet, wherein the target time length is the shorter time length of the first time length and the second time length; and obtaining the identification of the target data packet.
Optionally, the data processing device further comprises a processing module and a determining module; the processing module is further configured to generate a spliced data packet corresponding to the spliced file under the condition that the second time length is determined to be the target time length; the determining module is specifically configured to perform: and determining the spliced data packet as a target data packet.
Optionally, the data processing device further comprises a determining module; the determining module is specifically configured to determine a development data packet of the target program as a target data packet when the first time length is determined to be the target time length.
Optionally, the spliced file includes a file header, a file index area and a file data area; the file header includes the total size of the file and the number of source files; the file index area comprises a file name of each source file in the plurality of source files, a file offset value of each source file and a file size of each source file; the file data area includes valid data for each source file.
According to a fourth aspect of the present disclosure, there is provided a terminal including a transmitting module, an acquiring module, a processing module, and a determining module. The acquisition module is configured to execute a start instruction responding to a target program and acquire a target data packet; the target data packet is a data packet which corresponds to the identification of the target program and has the shortest reading time; the running of the target program does not need to execute an installation operation; the processing module is configured to execute analysis of the target data packet to obtain a file in the target data packet; the determining module is configured to determine the loading mode of the file in the target data packet; and the processing module is also configured to execute the loading of the files in the target data packet according to the loading mode of the files in the target data packet and start the target program.
Optionally, the determining module is specifically configured to perform: under the condition that the files in the target data packet are spliced files, determining that the loading mode of the files in the target data packet is a single file loading mode; and under the condition that the files in the target data packet are determined to be a plurality of files, determining that the loading mode of the files in the target data packet is a multi-file loading mode.
Optionally, the acquiring module is specifically configured to perform: responding to a starting instruction of a target program, and sending an acquisition request; receiving an identification of a target data packet; and downloading the target data packet according to the identification of the target data packet.
According to a fifth aspect of the present disclosure, there is provided a server comprising: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute instructions to implement the optional data processing method as in any of the first aspects above.
According to a sixth aspect of the present disclosure, there is provided a terminal comprising: a processor and a memory for storing instructions executable by the processor; wherein the processor is configured to execute instructions to implement the data processing method as in the second aspect described above.
According to a seventh aspect of the present disclosure, there is provided a data processing system comprising a server and a terminal. The server is configured to perform the optional data processing method according to any of the first aspects described above, and the terminal is configured to perform the optional data processing method according to any of the second aspects described above.
According to an eighth aspect of the present disclosure, there is provided a computer readable storage medium having instructions stored thereon which, when executed by a processor of a server, enable the server to perform the data processing method as optional in any of the first aspects above.
According to a ninth aspect of the present disclosure, there is provided a computer readable storage medium having instructions stored thereon which, when executed by a processor of a terminal, enable the terminal to perform the data processing method as optional in any of the second aspects above.
According to a tenth aspect of the present disclosure, there is provided a computer program product comprising instructions which, when executed by a processor, implement the data processing method as optional in any of the first aspects described above.
According to an eleventh aspect of the present disclosure, there is provided a computer program product comprising instructions which, when executed by a processor, implement the data processing method as optional in any of the second aspects described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
In the above scheme, the server determines the target data packet corresponding to the target program and having the shortest reading time according to the identifier of the target program, and sends the identifier of the target program packet to the terminal. The terminal receives the identification of the target program package, downloads and analyzes the target data package to obtain the file in the target data package, loads the file in the target data package according to the loading mode of the file in the target data package, and starts the target program. Therefore, the server can adaptively send the data packet of the target program with high reading speed to the terminal, and the starting speed of the target program is improved.
In addition, when the files in the target data packet are spliced files, the problem that multiple times of addressing is needed when the terminal loads multiple files is avoided, and the starting speed of the target program is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of a data processing system, according to an example embodiment.
FIG. 2 is one of the flowcharts of a data processing method according to an exemplary embodiment.
FIG. 3 is a second flowchart illustrating a method of data processing according to an exemplary embodiment.
Fig. 4 is a schematic diagram showing a structure of a header of a spliced file according to an exemplary embodiment.
Fig. 5 is a schematic diagram illustrating a structure of a file index area of a spliced file according to an exemplary embodiment.
FIG. 6 is a third flowchart illustrating a method of data processing according to an exemplary embodiment.
FIG. 7 is a flowchart illustrating a method of data processing according to an exemplary embodiment.
Fig. 8 is one of schematic structural diagrams of a data processing apparatus according to an exemplary embodiment.
Fig. 9 is a second schematic diagram of a data processing apparatus according to an exemplary embodiment.
Fig. 10 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment.
Fig. 11 is a block diagram illustrating a structure of a server according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The data referred to in this disclosure may be data authorized by the user or sufficiently authorized by the parties. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and/or components.
First, an application scenario of the embodiment of the present disclosure will be described.
The data processing method of the embodiment of the disclosure is applied to a scene of starting the applet by a user. The starting of the applet is divided into two stages of file downloading and file loading of the applet, and when the terminal starts the applet under specific conditions (for example, the first starting, the applet version updating, the user deleting the file of the applet, etc.), the data packet of the applet is downloaded from the server for analysis to obtain the file of the data packet, and the file of the data packet is loaded to start the applet. In this way, in the case where the data packet includes a larger number of files, since the storage addresses of the files of the applet are not consecutive by the terminal, the terminal needs to perform a plurality of addresses when loading the files of the data packet, resulting in a slower starting speed of the applet.
In order to solve the above-mentioned problems, an embodiment of the present disclosure provides a data processing method, where a server determines, according to an identifier of a target program, a target data packet corresponding to the target program and having a shortest reading time, and sends the identifier of the target program packet to a terminal, so that the terminal loads a file in the target data packet, starts the target program, and can adaptively issue the target data packet with a fast reading speed to the terminal, thereby improving a starting speed of the target data packet.
Next, an implementation environment of the embodiments of the present disclosure will be described.
FIG. 1 is a schematic diagram of a data processing system according to an embodiment of the present disclosure, where the data processing method according to the embodiment of the present disclosure may be applied to a data processing system. As shown in fig. 1, a terminal 11 and a server 12 may be included in the data processing system. Wherein, the terminal 11 communicates with the server 12 by a wired communication mode or a wireless communication mode; the object program runs on the terminal 11 depending on the host application, and the environment in which the object program runs is provided by the host application.
In some embodiments, the server 12 may be one server or may be a server cluster composed of a plurality of servers, which is not limited in this disclosure.
The server 12 is mainly configured to receive an acquisition request of the terminal 12, where the acquisition request includes an identifier of a target program, and the operation of the target program does not need to execute an installation operation; responding to the acquisition request, and acquiring the identification of a target data packet, wherein the target data packet is a data packet which corresponds to the identification of a target program and has the shortest reading time; and sending an identifier of the target data packet to the terminal 11, wherein the identifier of the target data packet is used for indicating the terminal to load the file in the target data packet and starting the target program.
In some embodiments, terminal 11 may include, but is not limited to, such as: intelligent mobile terminals, intelligent home devices, wearable devices, intelligent medical devices, personal computing (personal computer, PC) machines, etc. Wherein the smart mobile device may include, for example, a cell phone, tablet computer, notebook computer, personal digital assistant (personal digital assistant, PDA), internet car, etc. The smart home devices may include smart home devices such as smart televisions, smart speakers, and the like. The wearable device may include, for example, a smart watch, smart glasses, smart wristband, virtual reality device, augmented reality device, mixed reality device (i.e., a device that can support virtual reality and augmented reality), and so forth, which is not limited by the present disclosure.
Multiple host applications may be included on the same terminal 11, with the terminal 11 including one host application being illustrated in fig. 1. Multiple target programs may also be run in one host application, and different host applications may run different target programs, or may run the same target program. As shown in fig. 1, a target program 2, and a target program 3 are run in a host application.
The terminal 11 is mainly configured to send an acquisition request to the server 12 and receive an identifier of a target data packet from the server 12; downloading and analyzing the target data packet according to the identification of the target data packet to obtain a file in the target data packet; determining a loading mode of a file in a target data packet; and loading the files in the target data packet according to the loading mode of the files in the target data packet, and starting the target program.
It should be understood that the number of terminals, host applications, object programs, servers in fig. 1 is merely illustrative. There may be any number of terminals, host applications, object programs, servers, as desired for implementation.
After an application scenario and an implementation environment of the embodiments of the present disclosure are described, a data processing method provided by the embodiments of the present disclosure is described in detail.
Fig. 2 is a flow chart illustrating a data processing method according to an exemplary embodiment, which may include the following steps when the method is applied to a server, as shown in fig. 2.
201. The server receives the acquisition request.
Wherein the acquisition request includes an identification of the target program; the target program is run without performing an installation operation. For example, the object program is an applet that can run depending on the running environment of the host application.
202. And the server responds to the acquisition request to acquire the identification of the target data packet.
The target data packet corresponds to the identification of the target program and has the shortest reading time.
Specifically, the server responds to the acquisition request to acquire the identification method of the target data packet, as shown in fig. 3, and includes the following steps:
s1, the server responds to the acquisition request, analyzes a development data packet of the target program, and obtains a plurality of source files in the development data packet.
Specifically, after the developer of the target program completes the development of the target program, a plurality of source files of the target program are generated. When the target program is deployed online, a related person compresses a plurality of source files of the target program by using a compression algorithm to generate a development data packet, for example, compresses the plurality of source files into a compressed packet (i.e., a development data packet) in a ZIP format by using a ZIP compression algorithm. And then uploading the development data packet to a server so that the subsequent terminal can download the development data packet of the target program from the server.
In this way, after the server acquires the development data packet uploaded by the relevant person, the development data packet is parsed by the decompression algorithm, and a plurality of source files (i.e., a plurality of source files of the target program) in the development data packet are obtained.
S2, the server performs splicing processing on the plurality of source files to obtain spliced files.
Specifically, the spliced file comprises a file header, a file index area and a file data area. Illustratively, the format of the spliced file may be as shown in Table 1 below, with the file header adjacent to the file index region, and the file index region adjacent to the file data region.
TABLE 1
File header
File index area
File data area
The file header includes the total size of the file and the number of source files, and also includes a start code, a version number, reserved bits, a file index field check value, and a file data field check value. Illustratively, the header of the spliced file is shown in fig. 4, and the header includes a start code, a version number, reserved bits, a total file size, the number of source files, a file index area check value, and a file data area check value.
The start code represents a start address of the file header, and is used for representing a file header area from the start address. The version number is used for comparing with the version of the development data packet to determine whether the spliced file needs to be updated. The total file size is used to characterize the size of the plurality of source files in the development data package. The number of source files is used to characterize the number of source files in the development data package. The file index area check value and the file data area check value are used for checking whether the spliced file is read correctly.
The file index area includes a file name of each source file of the plurality of source files, a file offset value of each source file, and a file size of each source file, and further includes a start code of the file index area and a file name length of each source file. Illustratively, as shown in fig. 5, the file index area of the first source file in the spliced file includes a start code, a file name length of the first source file, a file name of the first source file, a file offset value of the first source file, and a file size of the first source file, where the first source file is any source file of the plurality of source files.
The file data area includes valid data for each source file. Wherein the number of source files in the file data area is determined by the source file number field in the file header.
In the scheme, the server performs splicing processing on the plurality of source files to obtain spliced files. The problem that multiple times of addressing are needed when the terminal loads multiple files is avoided, and the reading speed of the files in multiple scenes is increased.
S3, the server determines a first duration and a second duration.
The first time length is the time length for reading a plurality of source files, and the second time length is the time length for reading spliced files.
Specifically, the server may determine the first duration and the second duration by the following implementation manner.
The implementation mode is as follows: the server continuously reads a plurality of source files for n times, acquires total reading time, calculates average time length for reading the plurality of source files according to the total reading time length and the reading times, and takes the average time length for reading the plurality of source files as a first time length. Similarly, the server calculates the average time length of reading the spliced file, and takes the average time length of reading the spliced file as the second time length.
The implementation mode II is as follows: the server continuously reads a plurality of source files n times, and takes the mth reading time length as a first time length, wherein the mth reading time length is any one of n times of reading. And similarly, the server continuously reads the spliced file n times, and takes the m-th reading time length as a second time length, wherein the m-th reading time length is any reading in the n times.
S4, the server determines the data packet corresponding to the target duration as a target data packet.
The target time length is the shorter time length of the first time length and the second time length.
Specifically, the server determines the development data packet of the target program as the target data packet when determining the first time length as the target time length.
And under the condition that the second time length is determined to be the target time length, the server generates a spliced data packet corresponding to the spliced file, and determines the spliced data packet as the target data packet. For example, the spliced file is compressed into a compressed packet (i.e., spliced data packet) in the ZIP format using the ZIP compression algorithm.
S5, the server acquires the identification of the target data packet.
In the scheme, the server performs splicing processing on the plurality of source files to obtain the spliced file, compares the time length for reading the plurality of source files with the time length for reading the spliced file, and determines the target time length so as to conveniently send the identification of the target data packet after determining the target data packet according to the target time length.
203. The server sends the identification of the target data packet.
The identification of the target data packet is used for indicating the terminal to load the file in the target data packet and starting the target program. Specifically, the identifier of the destination packet is information uniquely indicating the destination packet, for example, a download address of the destination packet, a name of the destination packet including the download address of the destination packet, and the like.
Optionally, when the server sends the identifier of the target data packet, the file format of the file in the target data packet is carried at the same time, and the file format is used for indicating the loading mode of the file in the target data packet.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the above scheme, the server determines the target data packet corresponding to the target program and having the shortest reading time according to the identifier of the target program, and sends the identifier of the target program packet to the terminal. The terminal downloads the target data packet according to the identification of the target data packet, and loads the file in the data packet. Therefore, the server can adaptively send the data packet of the target program with high reading speed to the terminal, and the starting speed of the target program is improved.
Fig. 6 is a flowchart illustrating a data processing method according to an exemplary embodiment, which may include the following steps when the method is applied to a terminal, as shown in fig. 6.
301. And the terminal responds to the starting instruction of the target program to acquire the target data packet.
The target data packet is a data packet which corresponds to the identification of the target program and has the shortest reading time; the target program is run without performing an installation operation.
Specifically, the terminal transmits an acquisition request in response to a start instruction of the target program. And then, the terminal receives the identification of the target data packet and downloads the target data packet according to the identification of the target data packet. The starting instruction may be a first starting instruction; after the version of the target program is updated, a starting instruction of the target program is provided; after deleting the source file of the target program, the user starts the instruction of the target program, etc.
In the above scheme, the terminal downloads the target data packet according to the identifier of the target data packet. The identification of the target data packet comes from the server, and the server can adaptively send the data packet of the target program with higher reading speed to the terminal, so that the starting speed of the target program is improved.
302. And the terminal analyzes the target data packet to obtain a file in the target data packet.
Wherein, in the case that the target data packet is a development data packet, the files in the target data packet are a plurality of source files in the development data packet; and under the condition that the target data packet is a spliced data packet, the file in the target data packet is a spliced file.
303. The terminal determines the loading mode of the file in the target data packet.
First, the terminal determines the file format of the file in the target data packet by the following implementation manner.
The implementation mode is as follows: and receiving the file format of the file in the target data packet sent by the server.
The implementation mode II is as follows: under the condition that the terminal determines that the file in the target data packet has only one suffix name, determining that the file format of the file (corresponding to the spliced file in the embodiment of the disclosure) in the target data packet is a single file format; in the case that the file in the target data packet is determined to include at least two suffix names, the file format of the file (corresponding to the plurality of files in the embodiment of the present disclosure) in the target data packet is determined to be a multi-file format.
And then, the terminal determines the loading mode of the files in the target data packet according to the file format of the files in the target data packet. Specifically, under the condition that the files in the target data packet are determined to be in a multi-file format (i.e. a plurality of files), the terminal determines that the loading mode of the files in the target data packet is a multi-file loading mode; under the condition that the files in the target data packet are determined to be in a single file format (namely spliced files), the terminal determines that the loading mode of the files in the target data packet is a single file loading mode. The single file loading mode is to load one file according to the storage address of the one file, and the multi-file loading mode is to load at least one file according to the storage address of the at least one file.
In the scheme, when the terminal determines that the file in the target data packet is the spliced file, the spliced file is loaded in a single file loading mode, so that the problem that the terminal needs to address for multiple times when loading a plurality of files is solved, and the starting speed of the target program is improved.
304. The terminal loads the files in the target data packet according to the loading mode of the files in the target data packet, and starts the target program.
Specifically, the single file loading mode is to load a file according to the storage address of the file, and the corresponding loading is to load the spliced file. For example, when it is determined that a certain source file in the spliced file has a loading requirement, firstly, reading a file header and a file index area of the spliced file according to a file name (storage address) of the spliced file; according to the file name of the source file in the loading requirement of the source file, matching a file offset value and a file size corresponding to the file name of the source file in an index area; and finally, reading the source file in a file data area of the spliced file according to the file offset value and the file size of the source file.
The multi-file loading mode is to load at least one file according to the storage address of the at least one file, and correspondingly, a plurality of source files are loaded. For example, when it is determined that several source files in the spliced file have loading requirements, file names (storage addresses) of the several source files are acquired, and the several source files are loaded respectively according to the storage addresses corresponding to the file names of the several source files.
The file names of the files related to the disclosure are file names with a path structure (storage address) and are used for loading the corresponding files according to the path structure.
In the above scheme, the terminal responds to the starting instruction of the target program, sends an acquisition request to the server, acquires the identification of the target data packet, downloads and analyzes the target data packet according to the identification of the target data packet, and obtains the file in the target data packet. And then loading the files in the target data packet according to the loading mode of the files in the target data packet. Therefore, the server can adaptively send the data packet of the target program with higher reading speed to the terminal, so that the speed of the terminal for reading the data packet of the target program is increased, and the starting speed of the target program is further increased.
FIG. 7 is a flowchart illustrating a data processing method that, when applied to a data processing system, may include the following steps, as shown in FIG. 4, according to an exemplary embodiment.
401. And the terminal responds to the starting instruction of the target program and sends an acquisition request to the server.
The running of the target program does not need to execute an installation operation; the acquisition request includes an identification of the target program.
402. And the server responds to the acquisition request to acquire the identification of the target data packet.
The target data packet corresponds to the identification of the target program and has the shortest reading time.
403. The server sends the identification of the target data packet to the terminal.
The target data packet is a data packet which corresponds to the identification of the target program and has the shortest reading time;
404. and the terminal downloads and analyzes the target data packet according to the identification of the target data packet to obtain the file in the target data packet.
405. The terminal determines the loading mode of the files in the target data packet, loads the files in the target data packet according to the loading mode of the files in the target data packet, and starts the target program.
The embodiment of the disclosure may divide the functional modules of the data processing apparatus according to the embodiment of the method described above, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present disclosure, the division of the modules is merely a logic function division, and other division manners may be implemented in actual practice.
The methods provided by embodiments of the present disclosure are described in detail above in connection with fig. 2-7. The following describes in detail a data processing apparatus provided in an embodiment of the present disclosure with reference to fig. 8 to 11. It should be understood that the descriptions of the apparatus embodiments and the descriptions of the method embodiments correspond to each other, and thus, descriptions of details not described may be referred to the above method embodiments, which are not repeated herein for brevity.
Fig. 8 is a schematic structural view of a data processing apparatus according to an exemplary embodiment, applied to a server, and shown with reference to fig. 8, the data processing apparatus including: an acquisition module 81 and a transmission module 82.
An acquisition module 81 configured to perform receiving an acquisition request including an identification of a target program, the target program being run without performing an installation operation; for example, referring to fig. 2, the acquisition module 81 is configured to perform step 201. The acquiring module 81 is further configured to perform acquiring, in response to the acquiring request, an identifier of a target data packet, where the target data packet corresponds to the identifier of the target program and has a shortest reading time; for example, referring to FIG. 2, the acquisition module 81 is further configured to perform step 202. The sending module 82 is configured to perform sending an identification of a target data packet, where the identification of the target data packet is used to instruct the terminal to load a file in the target data packet, and start a target program. For example, referring to fig. 2, the transmitting module 82 is configured to perform step 203.
Optionally, the obtaining module 81 is specifically configured to perform: responding to the acquisition request, analyzing a development data packet of the target program, and obtaining a plurality of source files in the development data packet; splicing the plurality of source files to obtain spliced files; determining a first time length and a second time length; the first time length is the time length for reading a plurality of source files, and the second time length is the time length for reading spliced files; determining a data packet corresponding to a target time length as a target data packet, wherein the target time length is the shorter time length of the first time length and the second time length; and obtaining the identification of the target data packet. For example, referring to FIG. 3, the acquisition module is specifically configured to perform steps S1-S4.
Optionally, the data processing device further comprises a processing module 83 and a determining module 84. The processing module 83 is further configured to generate a splice data packet corresponding to the splice file if the second duration is determined to be the target duration; the determination module 84 is specifically configured to perform: and determining the spliced data packet as a target data packet.
Optionally, the data processing apparatus further comprises a determination module. The determining module 84 is specifically configured to determine the development data packet of the target program as the target data packet in the case where the first time period is determined to be the target time period.
Optionally, the spliced file includes a file header, a file index area and a file data area; the file header includes the total size of the file and the number of source files; the file index area comprises a file name of each source file in the plurality of source files, a file offset value of each source file and a file size of each source file; the file data area includes valid data for each source file.
The specific manner in which the respective modules perform the operations in the data processing apparatus in the above-described embodiments has been described in detail in relation to the embodiments of the method, and will not be described in detail here.
Fig. 9 is a schematic structural view of a data processing apparatus according to an exemplary embodiment, which is applied to a terminal, and which is shown with reference to fig. 9, and includes: an acquisition module 91, a processing module 92, and a determination module 93.
An acquisition module 91 configured to execute a start instruction in response to a target program, to acquire a target packet; the target data packet is a data packet which corresponds to the identification of the target program and has the shortest reading time; the running of the target program does not need to execute an installation operation; the acquisition module 91 is configured to perform step 301. A processing module 92 configured to perform parsing of the target data packet to obtain a file in the target data packet; for example, referring to FIG. 6, the processing module 92 is configured to perform step 302. A determining module 93 configured to determine a loading manner of the file in the target data packet; for example, referring to fig. 6, the determination module 93 is configured to perform step 303. The processing module 92 is further configured to execute loading the file in the target data packet according to the loading mode of the file in the target data packet, and start the target program. For example, referring to FIG. 6, the processing module 92 is further configured to perform step 304.
Optionally, the determining module 93 is specifically configured to perform: under the condition that the files in the target data packet are spliced files, determining that the loading mode of the files in the target data packet is a single file loading mode; and under the condition that the files in the target data packet are determined to be a plurality of files, determining that the loading mode of the files in the target data packet is a multi-file loading mode.
Optionally, the obtaining module 91 is specifically configured to perform: responding to a starting instruction of a target program, and sending an acquisition request; receiving an identification of a target data packet; and downloading the target data packet according to the identification of the target data packet. The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 10 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment, which may be: smart phones, tablet computers, notebook computers or desktop computers.
The terminal may comprise at least one processor 101, a communication bus 102, a memory 103, and at least one communication interface 104.
The processor 101 may be a processor (central processingunits, CPU), microprocessor unit, application specific integrated circuit (application specific integrated circuit, ASIC), or one or more integrated circuits for controlling the execution of programs of the present disclosure.
Communication bus 102 may include a pathway to transfer information between the aforementioned components.
The communication interface 104 uses any transceiver-like means for communicating with other devices or communication networks, such as servers, ethernet, radio access network (radio access network, RAN), wireless local area network (wireless local area networks, WLAN), etc.
The memory 103 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be stand alone and be connected to the processing unit by a bus. The memory may also be integrated with the processing unit.
Wherein the memory 103 is used for storing application program codes for executing the disclosed scheme and is controlled to be executed by the processor 101. The processor 101 is configured to execute application code stored in the memory 103 to implement the functions in the methods of the present disclosure.
In a particular implementation, as one embodiment, processor 101 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 10.
In a particular implementation, as one embodiment, a terminal may include multiple processors, such as processor 101 and processor 105 in FIG. 10. Each of these processors may be a single-core (single-CPU) processor or may be a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a specific implementation, the terminal may also include an input device 106 and an output device 107, as one embodiment. The input device 106 is in communication with the processor 101 and may accept user input in a variety of ways. For example, the input device 106 may be a mouse, a keyboard, a touch screen device, a sensing device, or the like. The output device 107 communicates with the processor 101 and may display information in a variety of ways. For example, the output device 107 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 10 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 11 is a schematic diagram showing a structure of a server according to an exemplary embodiment. The server may vary considerably in configuration or performance and may include one or more processors 111 and one or more memories 112. Wherein the memory 112 stores at least one instruction, which is loaded and executed by the processor 111 to implement the data processing method provided in each of the above-mentioned method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
Another embodiment of the present disclosure also provides a data processing system, including: a server for performing the data processing method of any of the embodiments of fig. 2-5, and a terminal for performing the data processing method of any of the embodiments of fig. 6.
Another embodiment of the present disclosure also provides a computer-readable storage medium having instructions stored therein that, when executed on a terminal, perform a data processing method as in any of the embodiments of fig. 6 described above, or that, when executed on a server, perform a data processing method as in any of the embodiments of fig. 2-5 described above.
In another embodiment of the present disclosure, there is also provided a computer program product comprising computer-executable instructions stored in a computer-readable storage medium. The processor of the terminal may read the computer-executable instructions from the computer-readable storage medium and execute the computer-executable instructions to cause the terminal to perform a data processing method as shown in any of the embodiments of fig. 6. Alternatively, the processor of the server may read the computer-executable instructions from a computer-readable storage medium and execute the computer-executable instructions to cause the server to perform a data processing method as shown in any of the embodiments of fig. 2-5.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (19)

1. A data processing method applied to a server, comprising:
receiving an acquisition request, wherein the acquisition request comprises an identification of a target program, and the target program runs without executing an installation operation;
responding to the acquisition request, analyzing a development data packet of the target program, and obtaining a plurality of source files in the development data packet;
Splicing the plurality of source files to obtain spliced files;
determining a first time length and a second time length; the first time length is the time length for reading the plurality of source files, and the second time length is the time length for reading the spliced file;
determining a data packet corresponding to a target time length as a target data packet, wherein the target time length is the shorter time length of the first time length and the second time length;
acquiring the identification of a target data packet;
and sending the identification of the target data packet, wherein the identification of the target data packet is used for indicating a terminal to load the file in the target data packet and starting the target program.
2. The data processing method according to claim 1, wherein in the case where the second time period is determined to be the target time period, the method further comprises:
generating a spliced data packet corresponding to the spliced file;
the determining the data packet corresponding to the target duration as the target data packet includes:
and determining the spliced data packet as the target data packet.
3. The data processing method according to claim 1, wherein in the case where the first time period is determined to be the target time period, the determining the data packet corresponding to the target time period as the target data packet includes:
And determining the development data packet of the target program as the target data packet.
4. A data processing method according to claim 2 or 3, wherein the spliced file comprises a file header, a file index area and a file data area; the file header comprises the total size of the file and the number of source files; the file index area comprises a file name of each source file in the plurality of source files, a file offset value of each source file and a file size of each source file; the file data area includes valid data for each source file.
5. A data processing method applied to a terminal, comprising:
responding to a starting instruction of a target program to acquire a target data packet; the target data packet is a data packet corresponding to a target time length, the target time length is a shorter time length of a first time length and a second time length, the first time length is a time length for reading a plurality of source files, the second time length is a time length for reading a spliced file, the plurality of source files are obtained by analyzing a development data packet of the target program, and the spliced file is obtained by splicing the plurality of source files; the operation of the target program does not need to execute an installation operation;
Analyzing the target data packet to obtain a file in the target data packet;
determining a loading mode of a file in the target data packet;
and loading the file in the target data packet according to the loading mode of the file in the target data packet, and starting the target program.
6. The method for processing data according to claim 5, wherein determining the loading mode of the file in the target data packet includes:
under the condition that the files in the target data packet are spliced files, determining that the loading mode of the files in the target data packet is a single file loading mode;
and under the condition that the files in the target data packet are determined to be a plurality of files, determining that the loading mode of the files in the target data packet is a multi-file loading mode.
7. The method according to claim 5, wherein the acquiring the target packet in response to the start instruction of the target program includes:
responding to a starting instruction of a target program, and sending an acquisition request;
receiving an identification of a target data packet;
and downloading the target data packet according to the identification of the target data packet.
8. A data processing apparatus for use with a server, comprising:
An acquisition module configured to perform receiving an acquisition request, the acquisition request including an identification of a target program, the target program being run without performing an installation operation;
the acquisition module is further configured to execute the steps of responding to the acquisition request, analyzing a development data packet of the target program, and obtaining a plurality of source files in the development data packet; splicing the plurality of source files to obtain spliced files; determining a first time length and a second time length; the first time length is the time length for reading the plurality of source files, and the second time length is the time length for reading the spliced file; determining a data packet corresponding to a target time length as a target data packet, wherein the target time length is the shorter time length of the first time length and the second time length; acquiring the identification of a target data packet;
and the sending module is configured to send the identification of the target data packet, wherein the identification of the target data packet is used for indicating a terminal to load the file in the target data packet and starting the target program.
9. The data processing apparatus of claim 8, wherein the data processing apparatus further comprises a processing module and a determination module;
The processing module is further configured to execute, when the second duration is determined to be the target duration, to generate a spliced data packet corresponding to the spliced file;
the determination module is specifically configured to perform: and determining the spliced data packet as the target data packet.
10. The data processing apparatus of claim 8, wherein the data processing apparatus further comprises a determination module;
the determining module is specifically configured to determine a development data packet of the target program as the target data packet when the first duration is determined to be the target duration.
11. The data processing device according to any of the claims 8-10, characterized in that,
the spliced file comprises a file header, a file index area and a file data area; the file header comprises the total size of the file and the number of source files; the file index area comprises a file name of each source file in the plurality of source files, a file offset value of each source file and a file size of each source file; the file data area includes valid data for each source file.
12. A data processing apparatus, applied to a terminal, comprising:
The acquisition module is configured to execute a start instruction responding to a target program and acquire a target data packet; the target data packet is a data packet corresponding to a target time length, the target time length is a shorter time length of a first time length and a second time length, the first time length is a time length for reading a plurality of source files, the second time length is a time length for reading a spliced file, the plurality of source files are obtained by analyzing a development data packet of the target program, and the spliced file is obtained by splicing the plurality of source files; the operation of the target program does not need to execute an installation operation;
the processing module is configured to execute the analysis of the target data packet to obtain a file in the target data packet;
the determining module is configured to determine the loading mode of the file in the target data packet;
the processing module is further configured to execute loading the files in the target data packet according to the loading mode of the files in the target data packet, and start the target program.
13. The data processing apparatus of claim 12, wherein the data processing apparatus further comprises a data processing device,
the determination module is specifically configured to perform:
Under the condition that the files in the target data packet are spliced files, determining that the loading mode of the files in the target data packet is a single file loading mode;
and under the condition that the files in the target data packet are determined to be a plurality of files, determining that the loading mode of the files in the target data packet is a multi-file loading mode.
14. The data processing apparatus of claim 12, wherein the data processing apparatus further comprises a data processing device,
the acquisition module is specifically configured to perform:
responding to a starting instruction of a target program, and sending an acquisition request;
receiving an identification of a target data packet;
and downloading the target data packet according to the identification of the target data packet.
15. A server, the server comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of any of claims 1-4.
16. A terminal, the terminal comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of any of claims 5-7.
17. A data processing system comprising a server for performing the data processing method of any of claims 1-4 and a terminal for performing the data processing method of any of claims 5-7.
18. A computer readable storage medium having instructions stored thereon, which, when executed by a processor of a server, enable the server to perform the data processing method according to any one of claims 1-4, or which, when executed by a processor of a terminal, enable the terminal to perform the data processing method according to any one of claims 5-7.
19. A computer program product comprising computer instructions which, when executed by a processor, implement a data processing method as claimed in any one of claims 1 to 4 or a data processing method as claimed in any one of claims 5 to 7.
CN202011583781.3A 2020-12-28 2020-12-28 Data processing method and device Active CN112685097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011583781.3A CN112685097B (en) 2020-12-28 2020-12-28 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011583781.3A CN112685097B (en) 2020-12-28 2020-12-28 Data processing method and device

Publications (2)

Publication Number Publication Date
CN112685097A CN112685097A (en) 2021-04-20
CN112685097B true CN112685097B (en) 2024-04-16

Family

ID=75454162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011583781.3A Active CN112685097B (en) 2020-12-28 2020-12-28 Data processing method and device

Country Status (1)

Country Link
CN (1) CN112685097B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104426925A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Webpage resource obtaining method and apparatus
CN109165050A (en) * 2018-07-05 2019-01-08 腾讯科技(深圳)有限公司 The operation method of program, calculates equipment and storage medium at device
CN110609966A (en) * 2018-05-29 2019-12-24 阿里巴巴集团控股有限公司 Page display method, device and equipment
CN111049870A (en) * 2018-10-15 2020-04-21 华为技术有限公司 Application downloading and sending method, device and system
CN111629075A (en) * 2020-08-03 2020-09-04 腾讯科技(深圳)有限公司 Data downloading method and related device
CN111708990A (en) * 2020-05-15 2020-09-25 支付宝(杭州)信息技术有限公司 Applet starting method, signature method, device, server and medium
CN112052011A (en) * 2020-10-10 2020-12-08 腾讯科技(深圳)有限公司 Method and device for combining small programs, electronic equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104426925A (en) * 2013-08-21 2015-03-18 腾讯科技(深圳)有限公司 Webpage resource obtaining method and apparatus
CN110609966A (en) * 2018-05-29 2019-12-24 阿里巴巴集团控股有限公司 Page display method, device and equipment
CN109165050A (en) * 2018-07-05 2019-01-08 腾讯科技(深圳)有限公司 The operation method of program, calculates equipment and storage medium at device
CN111049870A (en) * 2018-10-15 2020-04-21 华为技术有限公司 Application downloading and sending method, device and system
CN111708990A (en) * 2020-05-15 2020-09-25 支付宝(杭州)信息技术有限公司 Applet starting method, signature method, device, server and medium
CN111629075A (en) * 2020-08-03 2020-09-04 腾讯科技(深圳)有限公司 Data downloading method and related device
CN112052011A (en) * 2020-10-10 2020-12-08 腾讯科技(深圳)有限公司 Method and device for combining small programs, electronic equipment and medium

Also Published As

Publication number Publication date
CN112685097A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN109145238B (en) Card display method and device and mobile device
CN111274512A (en) Page loading method, device and medium
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN111079048B (en) Page loading method and device
CN111803917B (en) Resource processing method and device
CN113157274A (en) Software development method and device based on micro front end, electronic equipment and storage medium
CN104050001A (en) Resource processing method, device and equipment based on Android system
CN110825425A (en) Configuration data management method and device, electronic equipment and storage medium
CN113608800A (en) Project starting method and device, electronic equipment and storage medium
CN114218175A (en) Resource cross-platform sharing method and device, terminal equipment and storage medium
CN112685097B (en) Data processing method and device
CN112650804A (en) Big data access method, device, system and storage medium
CN112732302A (en) Configuration updating method and device of application program and electronic equipment
CN116483470A (en) Method for acquiring configuration information, electronic equipment and medium
CN113377423B (en) Service providing method and device and electronic equipment
CN113626099B (en) Application program starting method and device and electronic equipment
CN114124883B (en) Data access method and device based on cloud storage address, computer equipment and medium
CN111796878B (en) Resource splitting and loading method and device applied to single-page application
CN111797009B (en) Method and device for detecting code compatibility and electronic equipment
CN114928556A (en) Interface service test method and related equipment
CN113704120A (en) Data transmission method, device, equipment and storage medium
CN113391882A (en) Virtual machine memory management method and device, storage medium and electronic equipment
CN114625402A (en) Application updating method and device, electronic equipment and computer readable storage medium
CN113391813A (en) Program compiling method and device, storage medium and electronic equipment
CN110489469B (en) Data transmission method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant