WO2015014308A1 - A method and a device for data processing - Google Patents

A method and a device for data processing Download PDF

Info

Publication number
WO2015014308A1
WO2015014308A1 PCT/CN2014/083515 CN2014083515W WO2015014308A1 WO 2015014308 A1 WO2015014308 A1 WO 2015014308A1 CN 2014083515 W CN2014083515 W CN 2014083515W WO 2015014308 A1 WO2015014308 A1 WO 2015014308A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
target package
package
unit
error detection
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.)
Ceased
Application number
PCT/CN2014/083515
Other languages
French (fr)
Inventor
Shengyu GUAN
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Publication of WO2015014308A1 publication Critical patent/WO2015014308A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at the receiver end
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/565Static detection by checking file integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Definitions

  • the present disclosure relates to the field of the Internet technologies, particularly to a method and a device for data processing.
  • the Android application package (APK) needs to be run on the terminal.
  • a user can download APKs by using a large number of APK download links provided on existing websites.
  • the downloaded APK may not be the APK requested by the user and consequently fails to be installed locally.
  • the downloaded APK may be a download software APK, instead of the game APK requested by the user.
  • MD5 Message Digest Algorithm 5
  • an APK is partitioned into multiple sub-packages according to the specified data size for convenient transmission on a network. This gives rise to the problem that some of these sub- packages may get lost during the transmission. In such as case, the APK received by the terminal is incomplete.
  • An APK is a compressed file in the *.zip format. Therefore, currently, the Cyclic
  • CRC Redundancy Check
  • a method and a device for data processing provided by the present disclosure, capable of solving the problem of low success rates of local APK installations.
  • the present disclosure provides a method for data processing implemented in a device including a processor.
  • the method includes: verifying a stored target package based on a preset encrypted hash function; if said verification is successful, performing error detection on said target package according to a preset error detection standard; if said error detection is successful, checking the validity of said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, installing said target package.
  • the present disclosure further provides a device for data processing.
  • the device includes a hardware processor and a non-transitory storage medium.
  • the non-transitory storage medium is configured to store units including: a verification unit, an error detection unit, a validity check unit, and an installation unit.
  • the verification unit is configured to verify a target package stored in the storage unit based on a preset encrypted hash function.
  • the error detection unit is configured to, if the verification performed by said verification unit is successful, perform error detection on said target package based on a preset error detection standard.
  • the validity check unit is configured to, if the detection performed by said error detection unit is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed.
  • the installation unit is configured to, if the check performed by said validity check unit is successful, install said target package.
  • the method and device provided by the present disclosure for data processing may be configured to verify a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request; if said
  • Verification of a stored target package based on a preset encrypted hash function can ensure that the downloaded target package is the requested package, namely, ensuring that the target package is unique.
  • Error detection on said target package according to a preset error detection standard can ensure that the target package is integral.
  • Validity check on said target package by invoking a verification function can ensure that the target package is valid. The existing art only checks either the integrity or the uniqueness of the target package.
  • the present disclosure can improve the check efficiency, capable of eliminating, by a larger proportion compared with the existing art, the target packages that cannot be installed. If the target package passes the above-mentioned three checks, said target package is installed. Thus, the installation success rate increases. In addition, unnecessary installation operations are avoided and system resources saved.
  • Figure 1 shows the flowchart of a first data processing method provided by the embodiments of the present disclosure.
  • Figure 2 shows the flowchart of a second data processing method provided by the embodiments of the present disclosure.
  • Figure 3 shows the flowchart of a third data processing method provided by the embodiments of the present disclosure.
  • Figure 4 shows the flowchart of a fourth data processing method provided by the embodiments of the present disclosure.
  • Figure 5 shows the flowchart of a fifth data processing method provided by the embodiments of the present disclosure.
  • Figure 6 shows the structural diagram of a data processing device provided by the embodiments of the present disclosure.
  • Figure 7 shows the structural diagram of another data processing device provided by the embodiments of the present disclosure.
  • Figure 8 shows the structural diagram of an example terminal device for embodiments of the disclosure.
  • module or “unit” may refer to, be part of, or include an
  • ASIC Application Specific Integrated Circuit
  • FPGA field programmable gate array
  • processor shared, dedicated, or group
  • module or unit may include memory (shared, dedicated, or group) that stores code executed by the processor.
  • the exemplary environment may include a server, a client, and a communication network.
  • the server and the client may be coupled through the communication network for information exchange, such as sending/receiving identification information, sending/receiving data files such as splash screen images, etc.
  • information exchange such as sending/receiving identification information, sending/receiving data files such as splash screen images, etc.
  • client and one server are shown in the environment, any number of terminals or servers may be included, and other devices may also be included.
  • the communication network may include any appropriate type of communication network for providing network connections to the server and client or among multiple servers or clients.
  • communication network may include the Internet or other types of computer networks or telecommunication networks, either wired or wireless.
  • the disclosed methods and apparatus may be implemented, for example, in a wireless network that includes at least one client.
  • the client may refer to any appropriate user terminal with certain
  • the client may include a network access device.
  • the client may be stationary or mobile.
  • a server may refer to one or more server computers configured to provide certain server functionalities, such as database management and search engines.
  • a server may also include one or more processors to execute computer programs in parallel.
  • the embodiments of the present disclosure provide a data processing method, and said method is applicable to terminals such as smartphones and tablet PCs. As shown in Figure 1, said method comprises:
  • Step 101 Verify a stored target package based on a preset encrypted hash function, the target package being a package sent by a network-side server according to a user request.
  • Verification of the target package can determine whether the received target package is the package requested by the user. If the target package passes the verification, the verification is successful and the received target package is the package requested by the user. Otherwise, the verification fails and the received target package is not the package requested by the user.
  • the target package is encoded on the basis of the hash function to obtain a string.
  • the network-side server encodes the package requested by the user based on the same hash function to obtain another string.
  • the data encoded using the hash function is unique. Therefore, if the string obtained by means of encoding on the terminal is the same as the string obtained by means of encoding on the network-side server, the target package received by the terminal is the package requested by the user.
  • the string obtained by means of encoding is a hash, which is a message digest.
  • a hash has a fixed length, which is much smaller than that of the encoded package.
  • a vigorously- encrypted hash must be irreversible. None of the original information about the encoded package can be deduced by using a hash result.
  • one-way hash functions include the MD5 and Secure Hash Algorithm (SHA).
  • Step 102 If the verification is successful, perform error detection on the target package according to a preset error detection standard.
  • the preset error detection standard is the same as the compression mode adopted to generate the target package.
  • error detection is performed on the target package based on the CRC.
  • a CRC algorithm is selected according to the number of bits of the system running on the terminal. For example, in the case of a 32-bit system, the CRC32 algorithm is selected, in the case of a 64-bit system, the CRC64 algorithm is selected.
  • error detection is performed on the target package based on parity check.
  • Step 103 If the error detection is successful, check the validity of the target package by invoking a verification function, the validity check being configured to check whether the target package can be parsed.
  • a preset function in the Package Manager class is invoked. Based on a parameter, the function checks whether the target package can be parsed by the system.
  • the preset function is the information acquisition function getPackagelnfo in the Package Manager class.
  • Step 104 If the validity check is successful, install the target package.
  • the target package is an APK
  • the target package passes the checks performed in steps 101 to 103, the target package is installed.
  • the data processing method provided by the present disclosure can be configured to verify a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request; if said verification is successful, perform error detection on said target package according to a preset error detection standard; if said error detection is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, install said target package. Verification of a stored target package based on a preset encrypted hash function can ensure that the downloaded target package is the requested package, namely, ensuring that the target package is unique.
  • Error detection on said target package can ensure that the target package is integral.
  • Validity check on said target package by invoking a verification function can ensure that the target package is valid.
  • the existing art only checks either the integrity or the uniqueness of the target package.
  • the present disclosure can improve the check efficiency, capable of eliminating, by a larger proportion compared with the existing art, the target packages that cannot be installed. If the target package passes the above-mentioned three checks, said target package is installed. Thus, the installation success rate increases. In addition, unnecessary installation operations are avoided and system resources saved.
  • the embodiments of the present disclosure provide another data processing method to further describe the method as shown in Figure 1.
  • Said method before step 101 "verifying a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request", further comprises:
  • Step 202 Receive a user-trigged selection instruction, which is configured to select the target package to be downloaded.
  • Step 202 Send to the network-side server an acquisition request corresponding to the selection instruction, the acquisition request being configured to obtain the target package.
  • an acquisition request is sent to the network-side server to obtain the target data specified by the selection instruction. For example, when a user clicks a software download link, triggering a selection instruction, an acquisition request is sent to the network-side server to request the server for download of the package corresponding to the link.
  • Step 203 Receive the target package and verification string sent by the network-side server, the verification string being a string generated by encoding the target package based on the preset encrypted hash function.
  • the network-side server encodes the target package requested by the acquisition request to obtain a verification string, and sends the verification string along with the target package to the terminal.
  • Step 204 Save the target package and verification string.
  • the terminal On receiving the target package and verification string, the terminal saves the target package and verification string.
  • the data processing method provided by the embodiments of the present disclosure can be configured to send an acquisition request to the network-side server according to the user request, receive and save the target package and verification string sent by the network-side server, providing an operation object for subsequently checking whether the target package is complete and valid.
  • step 101 of verifying a stored target package based on a preset encrypted hash function can be implemented as follows:
  • Step 301 Encode a stored target package based on a preset encrypted hash function to obtain the target string.
  • the preset encrypted hash functions may include MD5, MD4, MD3, and SHA-1.
  • a typical application of MD5 is to generate a message digest of a message, thus preventing message falsification.
  • the message is the target package and the generated message digest is the target string.
  • MD5 uses an irreversible string conversion algorithm to generate a unique MD5 message digest, namely, the target string.
  • Step 302 Check whether the target string matches the verification string.
  • the network-side server uses the same MD5 algorithm to encode the requested package and obtain the verification string. Therefore, if the target string matches the verification string, the downloaded target package is consistent with the requested package.
  • the data processing method provided by the embodiments of the present disclosure can be configured to encode the target package and obtain the target string. If the target string matches the verification string, the target package is consistent with the requested package.
  • step 102 of performing error detection on the target package according to a preset error detection standard can be implemented as follows:
  • Step 401 Partition the target package to generate at least two target sub-packages.
  • the target package is partitioned according to the specified data size.
  • the format of each target sub-package obtained through partitioning is the same as the format of the target package.
  • the format of each target sub- package is the same as that of the APK, namely, the *.zip format.
  • the size of a target sub-package is decided by the memory capacity and the running capability of the terminal. For example, a 1 MB APK is partitioned into ten target sub-packages, each of which is 100 KB in size. In this case, the memory performs error detection on these ten target sub-packages respectively, shortening the time required for error detection compared with the error detection directly performed on the APK.
  • Step 402 Perform error detection on each target sub-package based on a preset error detection standard.
  • each target sub-package is the same as the format of the target package. Therefore, a preset error detection standard is configured to perform error detection on both the target package and target sub-packages.
  • step 103 namely, checking the validity of the target package by invoking a verification function if the error detection is successful
  • step 403 If the error detection on each target sub-package is successful, invoke a verification function to perform validity check on the target package.
  • the target package can be partitioned into multiple target sub-packages so that each target sub- package is much smaller than the target package.
  • the complexity of and system resource consumption in error detection are reduced to improve the efficiency of error detection.
  • inventions of the present embodiment provide another data processing method to further describe the method as shown in Figure 1. As shown in Figure 5, said method further comprises:
  • Step 151 Display an error report if the check fails.
  • step 102 If the check is successful, step 102 is performed; if the check fails, step 151 is performed.
  • Step 152 Display an error report if the error detection fails.
  • step 103 If the error detection is successful, step 103 is performed; if the error detection fails, step
  • Step 153 Display an error report if the validity check fails, the error report being configured to inform the user that the package cannot be run.
  • step 104 is performed; if the error detection fails, step 104
  • An error report can contain audios, images, or text. For example, an error report is displayed in a pop-up window, showing the text "APK installation failed. Please download again.”
  • said step of verifying a stored target package based on a preset encrypted hash function comprises verifying the stored target package based on the MD5.
  • Said step of performing error detection on said target package according to a preset error detection standard comprises performing error detection on said target package according to the CRC.
  • Said step of invoking a verification function to perform validity check on said target package comprises performing validity check on said target APK by invoking a preset function in the Android Package Manager class.
  • Said target package is an Android package.
  • the target package is an APK
  • MD5 is used as the preset encrypted hash function
  • CRC is used as the preset error detection standard
  • the invoked verification function is a preset function in the Android Package Manager class.
  • the embodiments of the present disclosure further provide a data processing device as shown in Figure 6.
  • the device 600 includes a non-transitory storage medium 610 and a hardware processor 620.
  • the non-transitory storage medium 610 is accessible to the hardware processor 620 and is configured to store units including:
  • a verification unit 611 configured to verify a target package stored in the storage unit 6110 based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request.
  • an error detection unit 612 configured to, if the verification performed by said
  • a validity check unit 613 configured to, if the detection performed by said error detection unit 612 is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed.
  • an installation unit 614 configured to, if the check performed by said validity check unit 613 is successful, install said target package.
  • the data processing device 600 can be configured to verify a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request; if said verification is successful, perform error detection on said target package according to a preset error detection standard; if said error detection is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, install said target package. Verification of a stored target package based on a preset encrypted hash function can ensure that the downloaded target package is the requested package, namely, ensuring that the target package is unique.
  • Error detection on said target package can ensure that the target package is integral.
  • Validity check on said target package by invoking a verification function can ensure that the target package is valid.
  • the existing art only checks either the integrity or the uniqueness of the target package.
  • the present disclosure can improve the check efficiency, capable of eliminating, by a larger proportion compared with the existing art, the target packages that cannot be installed. If the target package passes the above-mentioned three checks, said target package is installed. Thus, the installation success rate increases. In addition, unnecessary installation operations are avoided and system resources saved.
  • the example device 600 may further include the receiving unit 615, the sending unit 616, the first report unit 617, the second report unit 618, and the third report unit 619.
  • Said receiving unit 615 is configured to receive a user-trigged selection instruction, which is configured to select the target package to be downloaded.
  • the sending unit 616 is configured to send to the network-side server an acquisition request corresponding to said selection instruction received by said receiving unit 615, said acquisition request being configured to obtain said target package.
  • Said receiving unit 615 is further configured to receive the target package and verification string sent by the network-side server, said verification string being a string generated by encoding the target package based on the preset encrypted hash function.
  • Said storage unit 6110 is further configured to store said target package and verification string received by said receiving unit 615.
  • the data processing device 600 provided by the embodiments of the present disclosure can be configured to send an acquisition request to the network-side server according to the user request, receive and save the target package and verification string sent by the network-side server, providing an operation object for subsequently checking whether the target package is complete and valid.
  • said verification unit 611 comprises:
  • an encoding sub-unit 6111 configured to encode a target package stored in the storage unit 6110 based on a preset encrypted hash function to obtain the target string;
  • a verification sub-unit 6112 configured to check whether said target string obtained by said encoding sub-unit 6111 matches said verification string received by the receiving unit 615.
  • the data processing device 600 provided by the embodiments of the present disclosure can be configured to encode the target package and obtain the target string. If the target string matches the verification string, the target package is consistent with the requested package.
  • said error detection unit 612 comprises:
  • a partition sub-unit 6121 configured to partition said target package to generate at least two target sub-packages
  • a detection sub-unit 6122 configured to perform error detection on each of the target sub- packages obtained by partitioning each of said sub-units based on a preset error detection standard.
  • Said validity check unit 613 is further configured to, if the detection sub-unit detects that the error detection on each target sub-package is successful, perform validity check on said target package by invoking a verification function.
  • the target package can be partitioned into multiple target sub-packages so that each target sub-package is much smaller than the target package.
  • the complexity of and system resource consumption in error detection are reduced to improve the efficiency of error detection.
  • Said device 600 further comprises:
  • a first report unit 617 configured to display an error report if the verification performed by said verification unit 611 fails
  • a second report unit 618 configured to display an error report if the error detection performed by said error detection unit 612 fails;
  • a third report unit 619 configured to display an error report if the check performed by said validity check unit 613 fails, said error report being configured to inform the user that the package cannot be run.
  • said verification unit 611 is configured to verify the stored target package based on MD5.
  • Said error detection unit 612 is further configured to perform error detection on said target package based on the CRC.
  • Said validity check unit 613 is further configured to perform validity check on said target APK by invoking a preset function in the Android Package Manager class.
  • FIG. 8 is a block diagram of a partial device related to a terminal device such as a mobile phone.
  • the terminal device includes a radio frequency (RF) circuit 510, a memory 520, an input unit 530, a display unit 540, a sensor 550, an audio circuit 560, a wireless fidelity (WiFi) module 570, a processor 580, and a power 590, etc.
  • RF radio frequency
  • the structure of a terminal device illustrated in Figure 8 is not limited, some components can be added or omitted, or some combinations or arrangement can be included.
  • the RF circuit 510 is configured to receive and sending signals during calling or process of receiving and sending message. Specially, the RF circuit 510 will receive downlink information from the base station and send it to the processor 580; or send uplink data to the base station.
  • the RF circuit 510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a diplexer, and the like.
  • the RF circuit 40 can communicate with network or other devices by wireless communication.
  • Such wireless communication can use any one communication standard or protocol, which includes, but is not limited to, Global System of Mobile communication (GSM), (General Packet Radio Service, GPRS), (Code Division Multiple Access, CDMA), (Wideband Code Division Multiple Access, WCDMA), (Long Term Evolution, LTE), email, or (Short Messaging Service, SMS).
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the memory 520 is configured to store software program and module which will be run by the processor 580, so as to perform multiple functional applications of the terminal device and data processing.
  • the memory 530 mainly includes storing program area and storing data area.
  • the storing program area can store the operating system, at least one application program with required function (such as sound playing function, image playing function, etc.).
  • the storing data area can store data established by terminal device according to actual using demand (such as audio data, phonebook, etc.)
  • the memory 520 can be high-speed random access memory, or nonvolatile memory, such as disk storage, flash memory device, or other volatile solid- state memory devices.
  • the input unit 530 is configured to receive the entered number or character information, and the entered key signal related to user setting and function control of the terminal device 500.
  • the input unit 530 includes at least one of: a touch panel 531, other input devices 532, and a camera 533.
  • the touch panel 531 may include a touch screen, which can collect user's touch operations thereon or nearby (for example the operations generated by fingers of user or stylus pen, and the like, touching on the touch panel 531 or touching near the touch panel 531), and drive the corresponding connection device according to the preset program.
  • the touch panel 531 includes two portions including a touch detection device and a touch controller.
  • the touch detection device is configured to detect touch position of the user and detecting signals accordingly, and then sending the signals to the touch controller. Subsequently, the touch controller receives touch information from the touch detection device, and converts it to contact coordinates which are to be sent to the processor 580, and then receives command sent by the processor 580 to perform.
  • the touch panel 531 can be implemented is forms of resistive type, capacitive type, infrared type and surface acoustic wave type.
  • the input unit 530 can include, but is not limited to other input devices 532, such as one or more selected from physical keyboard, function keys (such as volume control keys, switch key-press, etc.), a trackball, a mouse, and an operating lever, etc..
  • the camera 533 may be an optical device configured to record images in a digital format.
  • the display unit 540 is configured to display information entered by the user or information supplied to the user, and menus of the terminal device.
  • the display unit 540 includes a display panel 541, such as a Liquid Crystal Display (LCD), or an Organic Light-Emitting Diode (OLED).
  • the display panel 541 can be covered by the touch panel 531, after touch operations are detected on or near the touch panel 531, they will be sent to the processor 580 to determine the type of the touching event. Subsequently, the processor 580 supplies the corresponding visual output to the display panel 541 according to the type of the touching event.
  • the touch panel 531 and the display panel 541 are two individual components to implement input and output of the terminal device, but they can be integrated together to implement the input and output in some embodiments.
  • the terminal device 500 includes at least one sensor 550, such as light sensors, motion sensors, or other sensors.
  • the light sensors includes ambient light sensors for adjusting brightness of the display panel 541 according to the ambient light, and proximity sensors for turning off the display panel 541 and/or maintaining backlight when the terminal device is moved to the ear side.
  • Accelerometer sensor as one of the motion sensors can detect the magnitude of accelerations in every direction (Triaxial, generally), and detect the magnitude and direction of gravity in an immobile status, which is applicable to applications of identifying attitudes of the mobile (such as switching between horizontal and vertical screens, related games, magnetometer attitude calibration, etc.), vibration recognition related functions (such as pedometer, percussion, etc.).
  • the terminal device 500 also can configure other sensors (such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc.) whose detailed descriptions are omitted here.
  • the audio circuit 560, the speaker 561 and the microphone 562 supply an audio interface between the user and the terminal device. Specifically, the audio data is received and converted to electrical signals by audio circuit 560, and then transmitted to the speaker 561, which are converted to sound signal to output. On the other hand, the sound signal collected by the speaker is then converted to electrical signals which will be received and converted to audio data. Subsequently, the audio data are output to the processor 580 to process, and then sent to another terminal device via the RF circuit 510, or sent to the memory 520 to process further.
  • WiFi pertains to short-range wireless transmission technology providing a wireless broadband Internet, by which the terminal device can help the user to receive and send email, browse web, and access streaming media, etc.
  • WiFi module 570 is illustrated in Figure 8, it should be understood that, WiFi module 570 is not a necessary for the terminal device, which can be omitted according the actual demand without changing the essence of the present disclosure.
  • the processor 580 is a control center of the terminal device, which connects with every part of the terminal device by various interfaces or circuits, and performs various functions and processes data by running or performing software program/module stored in the memory 520 or calling data stored in the memory 520, so as to monitor the terminal device.
  • the processor 580 may include one or more processing units.
  • the processor 580 can integrate with application processors and modem processors, for example, the application processors include processing operating system, user interface and applications, etc.; the modern processors are used for performing wireless communication. It can be understood that, it's an option to integrate the modern processors to the processor 580.
  • the processor 580 is configured to control a photographic equipment such as the camera 533 to scan target picture and analyze the target picture on basis of preset graphic code processing library; on condition that matched graphic code information is obtained in the analysis, determine the target picture as graphic code and transmit the matched graphic code information obtained in the analysis; on condition that the analysis fails, photograph the target picture to obtain a photo under identification comprising the target picture, transmit the photo under identification to server and receive the information of content matched with features of the identified picture and returned by the server after identification of picture features of the target picture.
  • the processor 580 is configured to control the display unit 540.
  • the display 540 is configured to display the output of the matched graphic code information obtained in the analysis or display the content information returned by the server and matched with picture features of identified picture.
  • the terminal device 500 may include a power supply (such as battery) supplying power for each component, preferably, the power supply can connect with the processor 580 by power management system, so as to manage charging, discharging and power consuming.
  • the terminal device 500 may include a Bluetooth module and other hardware circuits, etc., which are not illustrated.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A method and a device are provided for solving the problem of low success rates of local Android application package (APK) installations. The method includes: verifying a stored target package based on a preset encrypted hash function; if said verification is successful, performing error detection on said target package according to a preset error detection standard; if said error detection is successful, checking the validity of said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, installing said target package.

Description

A METHOD AND A DEVICE FOR DATA PROCESSING
CROSS-REFERENCE TO RELATED APPLICATIONS
[001] This application claims priority to Chinese Patent Application No. 201310334412.4, filed on August 2, 2013, which is hereby incorporated by reference in its entirety.
FIELD
[002] The present disclosure relates to the field of the Internet technologies, particularly to a method and a device for data processing.
BACKGROUND
[003] With the existing art, before application can be installed on a terminal running on an Android™ system, the Android application package (APK) needs to be run on the terminal. A user can download APKs by using a large number of APK download links provided on existing websites. However, due to an original data error or network transmission error that may occur during APK download, the downloaded APK may not be the APK requested by the user and consequently fails to be installed locally.
[004] Generally, for the sake of commercial profits, operators add downlinks to APKs, Such a practice is called download hijack. Download hijack often causes errors in downloaded file streams, namely, original data errors. For example, the downloaded APK may be a download software APK, instead of the game APK requested by the user. Currently, the Message Digest Algorithm 5 (MD5) is configured to check whether an APK downloaded by a user is the APK requested by the user. In addition, an APK is partitioned into multiple sub-packages according to the specified data size for convenient transmission on a network. This gives rise to the problem that some of these sub- packages may get lost during the transmission. In such as case, the APK received by the terminal is incomplete. An APK is a compressed file in the *.zip format. Therefore, currently, the Cyclic
Redundancy Check (CRC) is configured to check whether any part of a user-downloaded APK is lost.
[005] Even if the APK downloaded by a user is complete and also the APK requested by the user, parsing of the APK may fail due to a system problem, leading to an APK installation failure. As a result, the success rate of local APK installations is low.
SUMMARY
[006] A method and a device for data processing provided by the present disclosure, capable of solving the problem of low success rates of local APK installations.
[007] In one aspect, the present disclosure provides a method for data processing implemented in a device including a processor. The method includes: verifying a stored target package based on a preset encrypted hash function; if said verification is successful, performing error detection on said target package according to a preset error detection standard; if said error detection is successful, checking the validity of said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, installing said target package.
[008] In another aspect, the present disclosure further provides a device for data processing. The device includes a hardware processor and a non-transitory storage medium. The non-transitory storage medium is configured to store units including: a verification unit, an error detection unit, a validity check unit, and an installation unit. The verification unit is configured to verify a target package stored in the storage unit based on a preset encrypted hash function. The error detection unit is configured to, if the verification performed by said verification unit is successful, perform error detection on said target package based on a preset error detection standard. The validity check unit is configured to, if the detection performed by said error detection unit is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed. The installation unit is configured to, if the check performed by said validity check unit is successful, install said target package.
[009] The method and device provided by the present disclosure for data processing may be configured to verify a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request; if said
verification is successful, perform error detection on said target package according to a preset error detection standard; if said error detection is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, install said target package. Verification of a stored target package based on a preset encrypted hash function can ensure that the downloaded target package is the requested package, namely, ensuring that the target package is unique. Error detection on said target package according to a preset error detection standard can ensure that the target package is integral. Validity check on said target package by invoking a verification function can ensure that the target package is valid. The existing art only checks either the integrity or the uniqueness of the target package. By checking the uniqueness, integrity, and validity of target packages, the present disclosure can improve the check efficiency, capable of eliminating, by a larger proportion compared with the existing art, the target packages that cannot be installed. If the target package passes the above-mentioned three checks, said target package is installed. Thus, the installation success rate increases. In addition, unnecessary installation operations are avoided and system resources saved. BRIEF DESCRIPTION OF THE DRAWINGS
[010] To more clearly describe the embodiments of the present disclosure or the existing technical solutions, the following gives an overview of the drawings needed to describe the embodiments or the existing technology. Obviously, the following drawings show only some of the embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative work.
[011] Figure 1 shows the flowchart of a first data processing method provided by the embodiments of the present disclosure.
[012] Figure 2 shows the flowchart of a second data processing method provided by the embodiments of the present disclosure.
[013] Figure 3 shows the flowchart of a third data processing method provided by the embodiments of the present disclosure.
[014] Figure 4 shows the flowchart of a fourth data processing method provided by the embodiments of the present disclosure.
[015] Figure 5 shows the flowchart of a fifth data processing method provided by the embodiments of the present disclosure.
[016] Figure 6 shows the structural diagram of a data processing device provided by the embodiments of the present disclosure.
[017] Figure 7 shows the structural diagram of another data processing device provided by the embodiments of the present disclosure.
[018] Figure 8 shows the structural diagram of an example terminal device for embodiments of the disclosure.
DETAILED DESCRIPTION OF THE DRAWINGS
[019] Reference throughout this specification to "embodiments," "an embodiment," "example embodiment," or the like in the singular or plural means that one or more particular features, structures, or characteristics described in connection with an embodiment is included in at least embodiments of the present disclosure. Thus, the appearances of the phrases "in embodiments" or "in an embodiment," "in an example embodiment," or the like in the singular or plural in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[020] The terminology used in the description of the disclosure herein is for the purpose of describing particular examples only and is not intended to be limiting of the disclosure. As used in the description of the disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Also, as used in the description herein and throughout the claims that follow, the meaning of "in" includes "in" and "on" unless the context clearly dictates otherwise. It will also be understood that the term
"and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms "may include," "including," "comprises," and/or "comprising," when used in this specification, specify the presence of stated features, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, operations, elements, components, and/or groups thereof.
[021] As used herein, the term "module" or "unit" may refer to, be part of, or include an
Application Specific Integrated Circuit (ASIC); an electronic circuit; a combinational logic circuit; a field programmable gate array (FPGA); a processor (shared, dedicated, or group) that executes code; other suitable hardware components that provide the described functionality; or a combination of some or all of the above, such as in a system-on-chip. The term module or unit may include memory (shared, dedicated, or group) that stores code executed by the processor.
[022] The exemplary environment may include a server, a client, and a communication network. The server and the client may be coupled through the communication network for information exchange, such as sending/receiving identification information, sending/receiving data files such as splash screen images, etc. Although only one client and one server are shown in the environment, any number of terminals or servers may be included, and other devices may also be included.
[023] The communication network may include any appropriate type of communication network for providing network connections to the server and client or among multiple servers or clients. For example, communication network may include the Internet or other types of computer networks or telecommunication networks, either wired or wireless. In a certain embodiment, the disclosed methods and apparatus may be implemented, for example, in a wireless network that includes at least one client.
[024] In some cases, the client may refer to any appropriate user terminal with certain
computing capabilities, such as a personal computer (PC), a work station computer, a server computer, a hand-held computing device (tablet), a smart phone or mobile phone, or any other user- side computing device. In various embodiments, the client may include a network access device. The client may be stationary or mobile.
[025] A server, as used herein, may refer to one or more server computers configured to provide certain server functionalities, such as database management and search engines. A server may also include one or more processors to execute computer programs in parallel.
[026] The solutions in the embodiments of the present disclosure are clearly and completely described in combination with the attached drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part, but not all, of the embodiments of the present disclosure. On the basis of the embodiments of the present disclosure, all other embodiments acquired by those of ordinary skill in the art under the precondition that no creative efforts have been made shall be covered by the protective scope of the present disclosure.
[027] In order to make the objectives, technical solutions, and advantages of the present disclosure more comprehensible, the present disclosure is further described in detail below with reference to embodiments and the accompanying drawings.
[028] Obviously, embodiments are only described partly below, rather than all of them. Any other embodiment made by person of skill in the art without creative labor is in protection of the disclosure.
[029] In conjunction with the drawings of the embodiments of the present disclosure, the following clearly and completely describes the technical solutions provided by the embodiments of the present disclosure. Obviously, the described embodiments are only some, but not all, of the embodiments of the present disclosure. All the other embodiments which are obtained by those of ordinary skill in the art on the basis of the embodiments of the present disclosure without creative work shall fall within the protection scope of the present disclosure.
[030] The embodiments of the present disclosure provide a data processing method, and said method is applicable to terminals such as smartphones and tablet PCs. As shown in Figure 1, said method comprises:
[031] Step 101 : Verify a stored target package based on a preset encrypted hash function, the target package being a package sent by a network-side server according to a user request.
[032] Verification of the target package can determine whether the received target package is the package requested by the user. If the target package passes the verification, the verification is successful and the received target package is the package requested by the user. Otherwise, the verification fails and the received target package is not the package requested by the user.
[033] During the verification, the target package is encoded on the basis of the hash function to obtain a string. The network-side server encodes the package requested by the user based on the same hash function to obtain another string. The data encoded using the hash function is unique. Therefore, if the string obtained by means of encoding on the terminal is the same as the string obtained by means of encoding on the network-side server, the target package received by the terminal is the package requested by the user.
[034] The string obtained by means of encoding is a hash, which is a message digest. Generally, a hash has a fixed length, which is much smaller than that of the encoded package. A vigorously- encrypted hash must be irreversible. None of the original information about the encoded package can be deduced by using a hash result. Optionally, one-way hash functions include the MD5 and Secure Hash Algorithm (SHA). [035] Step 102: If the verification is successful, perform error detection on the target package according to a preset error detection standard.
[036] The preset error detection standard is the same as the compression mode adopted to generate the target package. Preferably, error detection is performed on the target package based on the CRC. When error detection is performed on the basis of the CRC, a CRC algorithm is selected according to the number of bits of the system running on the terminal. For example, in the case of a 32-bit system, the CRC32 algorithm is selected, in the case of a 64-bit system, the CRC64 algorithm is selected.
[037] Optionally, error detection is performed on the target package based on parity check.
[038] Step 103 : If the error detection is successful, check the validity of the target package by invoking a verification function, the validity check being configured to check whether the target package can be parsed.
[039] If an Android system runs on the terminal, a preset function in the Package Manager class is invoked. Based on a parameter, the function checks whether the target package can be parsed by the system. The preset function is the information acquisition function getPackagelnfo in the Package Manager class.
[040] Step 104: If the validity check is successful, install the target package.
[041] When the target package is an APK, if the target package passes the checks performed in steps 101 to 103, the target package is installed.
[042] The data processing method provided by the present disclosure can be configured to verify a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request; if said verification is successful, perform error detection on said target package according to a preset error detection standard; if said error detection is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, install said target package. Verification of a stored target package based on a preset encrypted hash function can ensure that the downloaded target package is the requested package, namely, ensuring that the target package is unique. Error detection on said target package according to a preset error detection standard can ensure that the target package is integral. Validity check on said target package by invoking a verification function can ensure that the target package is valid. The existing art only checks either the integrity or the uniqueness of the target package. By performing uniqueness check, integrity check, and validity check on target packages, the present disclosure can improve the check efficiency, capable of eliminating, by a larger proportion compared with the existing art, the target packages that cannot be installed. If the target package passes the above-mentioned three checks, said target package is installed. Thus, the installation success rate increases. In addition, unnecessary installation operations are avoided and system resources saved.
[043] The embodiments of the present disclosure provide another data processing method to further describe the method as shown in Figure 1. Said method, before step 101 "verifying a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request", further comprises:
[044] Step 202: Receive a user-trigged selection instruction, which is configured to select the target package to be downloaded.
[045] The user clicks the download link of the target package on the download page displayed on the terminal, triggering a selection instruction.
[046] Step 202: Send to the network-side server an acquisition request corresponding to the selection instruction, the acquisition request being configured to obtain the target package.
[047] When the user-triggered selection instruction is received, an acquisition request is sent to the network-side server to obtain the target data specified by the selection instruction. For example, when a user clicks a software download link, triggering a selection instruction, an acquisition request is sent to the network-side server to request the server for download of the package corresponding to the link.
[048] Step 203 : Receive the target package and verification string sent by the network-side server, the verification string being a string generated by encoding the target package based on the preset encrypted hash function.
[049] Based on the preset encrypted hash function, the network-side server encodes the target package requested by the acquisition request to obtain a verification string, and sends the verification string along with the target package to the terminal.
[050] Step 204: Save the target package and verification string.
[051] On receiving the target package and verification string, the terminal saves the target package and verification string.
[052] The data processing method provided by the embodiments of the present disclosure can be configured to send an acquisition request to the network-side server according to the user request, receive and save the target package and verification string sent by the network-side server, providing an operation object for subsequently checking whether the target package is complete and valid.
[053] The embodiments of the present disclosure provide another data processing method to further describe the method as shown in Figure 1. As shown in Figure 3, step 101 of verifying a stored target package based on a preset encrypted hash function can be implemented as follows:
[054] Step 301 : Encode a stored target package based on a preset encrypted hash function to obtain the target string. [055] The preset encrypted hash functions may include MD5, MD4, MD3, and SHA-1.
[056] For example, a typical application of MD5 is to generate a message digest of a message, thus preventing message falsification. In the embodiments of the present disclosure, the message is the target package and the generated message digest is the target string. Treating the entire target package as a text message, MD5 uses an irreversible string conversion algorithm to generate a unique MD5 message digest, namely, the target string.
[057] Step 302: Check whether the target string matches the verification string.
[058] The network-side server uses the same MD5 algorithm to encode the requested package and obtain the verification string. Therefore, if the target string matches the verification string, the downloaded target package is consistent with the requested package.
[059] The data processing method provided by the embodiments of the present disclosure can be configured to encode the target package and obtain the target string. If the target string matches the verification string, the target package is consistent with the requested package.
[060] The embodiments of the present disclosure provide another data processing method to further describe the method as shown in Figure 1. As shown in Figure 4, step 102 of performing error detection on the target package according to a preset error detection standard can be implemented as follows:
[061] Step 401 : Partition the target package to generate at least two target sub-packages.
[062] The target package is partitioned according to the specified data size. The format of each target sub-package obtained through partitioning is the same as the format of the target package. For example, after the target package, which is an APK, is partitioned, the format of each target sub- package is the same as that of the APK, namely, the *.zip format. The size of a target sub-package is decided by the memory capacity and the running capability of the terminal. For example, a 1 MB APK is partitioned into ten target sub-packages, each of which is 100 KB in size. In this case, the memory performs error detection on these ten target sub-packages respectively, shortening the time required for error detection compared with the error detection directly performed on the APK.
[063] Step 402: Perform error detection on each target sub-package based on a preset error detection standard.
[064] Parallel error detection or serial error detection is performed on each target sub-package based on a preset error detection standard.
[065] The format of each target sub-package is the same as the format of the target package. Therefore, a preset error detection standard is configured to perform error detection on both the target package and target sub-packages.
[066] In this case, step 103, namely, checking the validity of the target package by invoking a verification function if the error detection is successful, can be implemented as follows: [067] Step 403 : If the error detection on each target sub-package is successful, invoke a verification function to perform validity check on the target package.
[068] If the error detection on all the target sub-packages is successful, it is determined that the error detection on the target package is successful. In this case, a verification function is invoked to perform validity check on said target package.
[069] With the data processing method provided by the embodiments of the present disclosure, the target package can be partitioned into multiple target sub-packages so that each target sub- package is much smaller than the target package. Thus, the complexity of and system resource consumption in error detection are reduced to improve the efficiency of error detection.
[070] The embodiments of the present embodiment provide another data processing method to further describe the method as shown in Figure 1. As shown in Figure 5, said method further comprises:
[071 ] Step 151 : Display an error report if the check fails.
[072] If the check is successful, step 102 is performed; if the check fails, step 151 is performed.
[073] Step 152: Display an error report if the error detection fails.
[074] If the error detection is successful, step 103 is performed; if the error detection fails, step
152 is performed.
[075] Step 153 : Display an error report if the validity check fails, the error report being configured to inform the user that the package cannot be run.
[076] If the error detection is successful, step 104 is performed; if the error detection fails, step
153 is performed.
[077] An error report can contain audios, images, or text. For example, an error report is displayed in a pop-up window, showing the text "APK installation failed. Please download again."
[078] With the data processing method provided by the embodiments of the present disclosure, when verification, error detection, or validity check fails, an error report is displayed, informing the user about the installation of the target package; meanwhile, the installation of the original package is canceled to save system resources.
[079] Further, said step of verifying a stored target package based on a preset encrypted hash function comprises verifying the stored target package based on the MD5.
[080] Said step of performing error detection on said target package according to a preset error detection standard comprises performing error detection on said target package according to the CRC.
[081] Said step of invoking a verification function to perform validity check on said target package comprises performing validity check on said target APK by invoking a preset function in the Android Package Manager class.
[082] Said target package is an Android package. [083] In a preferred embodiment of the present disclosure, if the target package is an APK, MD5 is used as the preset encrypted hash function; CRC is used as the preset error detection standard; the invoked verification function is a preset function in the Android Package Manager class.
[084] The embodiments of the present disclosure further provide a data processing device as shown in Figure 6. The device 600 includes a non-transitory storage medium 610 and a hardware processor 620. The non-transitory storage medium 610 is accessible to the hardware processor 620 and is configured to store units including:
[085] a verification unit 611, configured to verify a target package stored in the storage unit 6110 based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request.
[086] an error detection unit 612, configured to, if the verification performed by said
verification unit 611 is successful, perform error detection on said target package based on a preset error detection standard.
[087] a validity check unit 613, configured to, if the detection performed by said error detection unit 612 is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed.
[088] an installation unit 614, configured to, if the check performed by said validity check unit 613 is successful, install said target package.
[089] The data processing device 600 provided by the present disclosure can be configured to verify a stored target package based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request; if said verification is successful, perform error detection on said target package according to a preset error detection standard; if said error detection is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; if said validity check is successful, install said target package. Verification of a stored target package based on a preset encrypted hash function can ensure that the downloaded target package is the requested package, namely, ensuring that the target package is unique. Error detection on said target package according to a preset error detection standard can ensure that the target package is integral. Validity check on said target package by invoking a verification function can ensure that the target package is valid. The existing art only checks either the integrity or the uniqueness of the target package. By performing uniqueness check, integrity check, and validity check on target packages, the present disclosure can improve the check efficiency, capable of eliminating, by a larger proportion compared with the existing art, the target packages that cannot be installed. If the target package passes the above-mentioned three checks, said target package is installed. Thus, the installation success rate increases. In addition, unnecessary installation operations are avoided and system resources saved.
[090] Further, as shown in Figure 7, the example device 600 may further include the receiving unit 615, the sending unit 616, the first report unit 617, the second report unit 618, and the third report unit 619.
[091] Said receiving unit 615 is configured to receive a user-trigged selection instruction, which is configured to select the target package to be downloaded.
[092] The sending unit 616 is configured to send to the network-side server an acquisition request corresponding to said selection instruction received by said receiving unit 615, said acquisition request being configured to obtain said target package.
[093] Said receiving unit 615 is further configured to receive the target package and verification string sent by the network-side server, said verification string being a string generated by encoding the target package based on the preset encrypted hash function.
[094] Said storage unit 6110 is further configured to store said target package and verification string received by said receiving unit 615.
[095] The data processing device 600 provided by the embodiments of the present disclosure can be configured to send an acquisition request to the network-side server according to the user request, receive and save the target package and verification string sent by the network-side server, providing an operation object for subsequently checking whether the target package is complete and valid.
[096] Further, said verification unit 611 comprises:
[097] an encoding sub-unit 6111, configured to encode a target package stored in the storage unit 6110 based on a preset encrypted hash function to obtain the target string;
[098] a verification sub-unit 6112, configured to check whether said target string obtained by said encoding sub-unit 6111 matches said verification string received by the receiving unit 615.
[099] The data processing device 600 provided by the embodiments of the present disclosure can be configured to encode the target package and obtain the target string. If the target string matches the verification string, the target package is consistent with the requested package.
[0100] Further, said error detection unit 612 comprises:
[0101] a partition sub-unit 6121, configured to partition said target package to generate at least two target sub-packages;
[0102] a detection sub-unit 6122, configured to perform error detection on each of the target sub- packages obtained by partitioning each of said sub-units based on a preset error detection standard. [0103] Said validity check unit 613 is further configured to, if the detection sub-unit detects that the error detection on each target sub-package is successful, perform validity check on said target package by invoking a verification function.
[0104] With the data processing device 600 provided by the embodiments of the present disclosure, the target package can be partitioned into multiple target sub-packages so that each target sub-package is much smaller than the target package. Thus, the complexity of and system resource consumption in error detection are reduced to improve the efficiency of error detection.
[0105] Said device 600 further comprises:
[0106] a first report unit 617, configured to display an error report if the verification performed by said verification unit 611 fails;
[0107] a second report unit 618, configured to display an error report if the error detection performed by said error detection unit 612 fails;
[0108] a third report unit 619, configured to display an error report if the check performed by said validity check unit 613 fails, said error report being configured to inform the user that the package cannot be run.
[0109] With the data processing device 600 provided by the embodiments of the present disclosure, when verification, error detection, or validity check fails, an error report is displayed, informing the user about the installation of the target package; meanwhile, the installation of the original package is canceled to save system resources.
[0110] Further, said verification unit 611 is configured to verify the stored target package based on MD5.
[0111] Said error detection unit 612 is further configured to perform error detection on said target package based on the CRC.
[0112] Said validity check unit 613 is further configured to perform validity check on said target APK by invoking a preset function in the Android Package Manager class.
[0113] Those of ordinary skill in the existing art can clearly understand that, for convenience and brevity of description, examples are given only based on the division of the function modules. In actual application, the above-mentioned functions can be allocated as needed to different function modules for completion. That is, the internal structure of the device can be divided into different function modules to complete all or some of the above-mentioned functions. For details about the working processes of the above-mentioned systems, devices, and units, see the description of the corresponding processes in the above-mentioned method embodiments.
[0114] While the present disclosure has been particularly disclosed and described above with reference to embodiments, it should be understood that the description is not intended to limit the present disclosure. Various modifications and alterations may be made by those skilled in the present art without departing from the spirit and scope of the present disclosure as defined by the Claims.
[0115] With further reference to Figure 8, which shows the structural diagram of an example terminal device for embodiments of the disclosure,
[0116] Figure 8 is a block diagram of a partial device related to a terminal device such as a mobile phone. For example, the terminal device includes a radio frequency (RF) circuit 510, a memory 520, an input unit 530, a display unit 540, a sensor 550, an audio circuit 560, a wireless fidelity (WiFi) module 570, a processor 580, and a power 590, etc.. It's understood for persons skilled in the art that, the structure of a terminal device illustrated in Figure 8 is not limited, some components can be added or omitted, or some combinations or arrangement can be included.
[0117] Following is a detailed description of the structure of the terminal device by combining with Figure 8.
[0118] The RF circuit 510 is configured to receive and sending signals during calling or process of receiving and sending message. Specially, the RF circuit 510 will receive downlink information from the base station and send it to the processor 580; or send uplink data to the base station.
Generally, the RF circuit 510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a diplexer, and the like. In addition, the RF circuit 40 can communicate with network or other devices by wireless communication. Such wireless communication can use any one communication standard or protocol, which includes, but is not limited to, Global System of Mobile communication (GSM), (General Packet Radio Service, GPRS), (Code Division Multiple Access, CDMA), (Wideband Code Division Multiple Access, WCDMA), (Long Term Evolution, LTE), email, or (Short Messaging Service, SMS).
[0119] The memory 520 is configured to store software program and module which will be run by the processor 580, so as to perform multiple functional applications of the terminal device and data processing. The memory 530 mainly includes storing program area and storing data area. For example, the storing program area can store the operating system, at least one application program with required function (such as sound playing function, image playing function, etc.). The storing data area can store data established by terminal device according to actual using demand (such as audio data, phonebook, etc.) Furthermore, the memory 520 can be high-speed random access memory, or nonvolatile memory, such as disk storage, flash memory device, or other volatile solid- state memory devices.
[0120] The input unit 530 is configured to receive the entered number or character information, and the entered key signal related to user setting and function control of the terminal device 500. For example, the input unit 530 includes at least one of: a touch panel 531, other input devices 532, and a camera 533. [0121] The touch panel 531 may include a touch screen, which can collect user's touch operations thereon or nearby (for example the operations generated by fingers of user or stylus pen, and the like, touching on the touch panel 531 or touching near the touch panel 531), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 531 includes two portions including a touch detection device and a touch controller. Specifically, the touch detection device is configured to detect touch position of the user and detecting signals accordingly, and then sending the signals to the touch controller. Subsequently, the touch controller receives touch information from the touch detection device, and converts it to contact coordinates which are to be sent to the processor 580, and then receives command sent by the processor 580 to perform. In addition, the touch panel 531 can be implemented is forms of resistive type, capacitive type, infrared type and surface acoustic wave type. Besides the touch panel 531, the input unit 530 can include, but is not limited to other input devices 532, such as one or more selected from physical keyboard, function keys (such as volume control keys, switch key-press, etc.), a trackball, a mouse, and an operating lever, etc.. The camera 533 may be an optical device configured to record images in a digital format.
[0122] The display unit 540 is configured to display information entered by the user or information supplied to the user, and menus of the terminal device. For example, the display unit 540 includes a display panel 541, such as a Liquid Crystal Display (LCD), or an Organic Light-Emitting Diode (OLED). Furthermore, the display panel 541 can be covered by the touch panel 531, after touch operations are detected on or near the touch panel 531, they will be sent to the processor 580 to determine the type of the touching event. Subsequently, the processor 580 supplies the corresponding visual output to the display panel 541 according to the type of the touching event. As shown in Figure 8, the touch panel 531 and the display panel 541 are two individual components to implement input and output of the terminal device, but they can be integrated together to implement the input and output in some embodiments.
[0123] Furthermore, the terminal device 500 includes at least one sensor 550, such as light sensors, motion sensors, or other sensors. Specifically, the light sensors includes ambient light sensors for adjusting brightness of the display panel 541 according to the ambient light, and proximity sensors for turning off the display panel 541 and/or maintaining backlight when the terminal device is moved to the ear side. Accelerometer sensor as one of the motion sensors can detect the magnitude of accelerations in every direction (Triaxial, generally), and detect the magnitude and direction of gravity in an immobile status, which is applicable to applications of identifying attitudes of the mobile (such as switching between horizontal and vertical screens, related games, magnetometer attitude calibration, etc.), vibration recognition related functions (such as pedometer, percussion, etc.). And the terminal device 500 also can configure other sensors (such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc.) whose detailed descriptions are omitted here.
[0124] The audio circuit 560, the speaker 561 and the microphone 562 supply an audio interface between the user and the terminal device. Specifically, the audio data is received and converted to electrical signals by audio circuit 560, and then transmitted to the speaker 561, which are converted to sound signal to output. On the other hand, the sound signal collected by the speaker is then converted to electrical signals which will be received and converted to audio data. Subsequently, the audio data are output to the processor 580 to process, and then sent to another terminal device via the RF circuit 510, or sent to the memory 520 to process further.
[0125] WiFi pertains to short-range wireless transmission technology providing a wireless broadband Internet, by which the terminal device can help the user to receive and send email, browse web, and access streaming media, etc.. Although the WiFi module 570 is illustrated in Figure 8, it should be understood that, WiFi module 570 is not a necessary for the terminal device, which can be omitted according the actual demand without changing the essence of the present disclosure.
[0126] The processor 580 is a control center of the terminal device, which connects with every part of the terminal device by various interfaces or circuits, and performs various functions and processes data by running or performing software program/module stored in the memory 520 or calling data stored in the memory 520, so as to monitor the terminal device. Optionally, the processor 580 may include one or more processing units. Preferably, the processor 580 can integrate with application processors and modem processors, for example, the application processors include processing operating system, user interface and applications, etc.; the modern processors are used for performing wireless communication. It can be understood that, it's an option to integrate the modern processors to the processor 580.
[0127] The processor 580 is configured to control a photographic equipment such as the camera 533 to scan target picture and analyze the target picture on basis of preset graphic code processing library; on condition that matched graphic code information is obtained in the analysis, determine the target picture as graphic code and transmit the matched graphic code information obtained in the analysis; on condition that the analysis fails, photograph the target picture to obtain a photo under identification comprising the target picture, transmit the photo under identification to server and receive the information of content matched with features of the identified picture and returned by the server after identification of picture features of the target picture.
[0128] The processor 580 is configured to control the display unit 540. The display 540 is configured to display the output of the matched graphic code information obtained in the analysis or display the content information returned by the server and matched with picture features of identified picture. [0129] Furthermore, the terminal device 500 may include a power supply (such as battery) supplying power for each component, preferably, the power supply can connect with the processor 580 by power management system, so as to manage charging, discharging and power consuming.
[0130] In addition, the terminal device 500 may include a Bluetooth module and other hardware circuits, etc., which are not illustrated.
[0131] Person of skill in the art can get aware that the whole or part of method in embodiments above may be realized through relevant hardware under instruction of computer program, in which the program may be stored in a computer-readable memory medium. When the program is executed, flow processes in embodiments of method above may be contained. Therein, the memory medium above may be diskette, optical disk, Read-Only Memory (ROM) or Random Access Memory (RAM), or the like.
[0132] All disclosures above are just some of the preferred embodiments of the disclosure, which are descried specifically and particularly but not intending to limit the range of the disclosure. It should be noticed that person of skill in the art can make various changes and modifications within the scope of the disclosure, therefore, the protection scope of the present disclosure is defined by the claims.

Claims

Claims
1. A method for data processing, comprising:
verifying, by a device comprising a processor, a target package based on a preset encrypted hash function;
if said verification is successful, performing error detection on said target package according to a preset error detection standard;
if said error detection is successful, checking the validity of said target package by invoking a verification function configured to check whether said target package can be parsed; and
if said validity check is successful, installing said target package to the device.
2. The method according to claim 1, further comprising:
receiving a user-trigged selection instruction configured to select the target package to be downloaded;
sending to a network-side server an acquisition request corresponding to said selection instruction, said acquisition request being configured to obtain said target package;
receiving the target package and a verification string sent by the network-side server, said verification string being a string generated by encoding the target package based on the preset encrypted hash function; and
saving said target package and verification string.
3. The method according to claim 2, wherein said step of verifying a stored target package based on the preset encrypted hash function comprises:
encoding a stored target package based on a preset encrypted hash function to obtain the target string; and
checking whether said target string matches said verification string.
4. The method according to claim 3, wherein said step of performing error detection on said target package according to a preset error detection standard comprises:
partitioning said target package to generate at least two target sub-packages; and
performing error detection on each target sub-package based on a preset error detection standard, and
wherein said step of, if said error detection is successful, checking the validity of said target package by invoking a verification function comprises:
if the error detection on each target sub-package is successful, invoking a verification function to perform validity check on said target package.
5. The method according to claim 4, further comprising:
displaying an error report if said check fails;
displaying an error report if said error detection fails; and displaying an error report if said validity check fails, said error report being configured to inform the user that the package cannot be run.
6. The method according to any of claims 1 to 5, wherein:
said step of verifying a stored target package based on a preset encrypted hash function comprises:
verifying a stored target package based on the Message Digest Algorithm 5 (MD5);
said step of performing error detection on said target package according to a preset error detection standard comprises:
performing error detection on said target package based on a cyclic redundancy check (CRC); said step of invoking a verification function to perform validity check on said target package comprises:
invoking a preset verification function to perform validity check on said target package.
7. A device for data processing, comprising a hardware processor and a non-transitory storage medium configured to store units comprising:
a verification unit, configured to verify a target package stored in the storage unit based on a preset encrypted hash function, said target package being a package sent by a network-side server according to a user request;
an error detection unit, configured to, if the verification performed by said verification unit is successful, perform error detection on said target package based on a preset error detection standard; a validity check unit, configured to, if the detection performed by said error detection unit is successful, perform validity check on said target package by invoking a verification function, said validity check being configured to check whether said target package can be parsed; and
an installation unit, configured to, if the check performed by said validity check unit is successful, install said target package.
8. The device according to claim 7, wherein said non-transitory storage medium further configured to store:
a receiving unit, configured to receive a user-trigged selection instruction, which is configured to select the target package to be downloaded;
a sending unit, configured to send to the network-side server an acquisition request corresponding to said selection instruction received by said receiving unit, said acquisition request being configured to obtain said target package;
said receiving unit is further configured to receive the target package and verification string sent by the network-side server, said verification string being a string generated by encoding the target package based on the preset encrypted hash function; and
said storage unit is further configured to store said target package and verification string received by said receiving unit.
9. The device according to claim 8, wherein said verification unit comprises:
an encoding sub-unit, configured to encode a target package stored in the storage unit based on a preset encrypted hash function to obtain the target string; and
a verification sub-unit, configured to check whether said target string obtained by said encoding sub-unit matches said verification string received by the receiving unit.
10. The device according to claim 9, wherein said error detection unit comprises:
a partition sub-unit, configured to partition said target package to generate at least two target sub-packages; and
a detection sub-unit, configured to perform error detection on each of the target sub-packages obtained by partitioning each of said sub-units based on a preset error detection standard;
wherein aid validity check unit is further configured to, if the detection sub-unit detects that the error detection on each target sub-package is successful, perform validity check on said target package by invoking a verification function.
11. The device according to claim 10, further comprising:
a first report unit, configured to display an error report if the verification performed by said verification unit fails;
a second report unit, configured to display an error report if the detection performed by said error detection unit fails;
a third report unit, configured to display an error report if the check performed by said validity check unit fails, said error report being configured to inform the user that the package cannot be run.
12. The device according to any of claims 7 to 11, wherein said verification unit is further configured to verify a stored target package based on Message Digest Algorithm 5 (MD5);
said error detection unit is further configured to perform error detection on said target package based on a cyclic redundancy check (CRC);
said validity check unit is further configured to perform validity check on said target package by invoking a preset function.
PCT/CN2014/083515 2013-08-02 2014-08-01 A method and a device for data processing Ceased WO2015014308A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310334412.4A CN104348578B (en) 2013-08-02 2013-08-02 The method and device of data processing
CN201310334412.4 2013-08-02

Publications (1)

Publication Number Publication Date
WO2015014308A1 true WO2015014308A1 (en) 2015-02-05

Family

ID=52431022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083515 Ceased WO2015014308A1 (en) 2013-08-02 2014-08-01 A method and a device for data processing

Country Status (2)

Country Link
CN (1) CN104348578B (en)
WO (1) WO2015014308A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416545A (en) * 2020-11-04 2021-02-26 北京五八信息技术有限公司 Task processing method and device
CN112600848A (en) * 2020-12-17 2021-04-02 上海芯安信息科技有限公司 Software upgrading package encapsulation method and device and software upgrading package decapsulation method and device
CN113114659A (en) * 2021-04-08 2021-07-13 深圳市元征科技股份有限公司 Diagnostic equipment detection method and device, terminal equipment and storage medium
CN115909382A (en) * 2022-11-28 2023-04-04 五八有限公司 Image recognition method, device, electronic device and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105631313A (en) * 2015-12-25 2016-06-01 东软集团股份有限公司 Method and device for processing operating system file
CN106982210B (en) * 2017-03-28 2021-01-15 联想(北京)有限公司 Data downloading method and electronic equipment
CN107729198B (en) * 2017-10-18 2020-04-21 深圳合纵富科技有限公司 Android system firmware verification method and device
CN116232443B (en) * 2023-05-09 2023-08-29 中国科学技术大学 Ambient WiFi Backscatter System and Method Based on Single Commercial AP Receiver

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895457A (en) * 2009-05-20 2010-11-24 灰熊(北京)科技有限公司 Method for ensuring data transmission integrity in transmission control protocol (TCP) communication process
CN101990239A (en) * 2009-07-30 2011-03-23 中兴通讯股份有限公司 Method and system for improving reliability of data transmission and wireless communication equipment
CN102034058A (en) * 2010-11-25 2011-04-27 中国联合网络通信集团有限公司 Method for controlling safety of application software and terminal
CN102087605A (en) * 2011-01-28 2011-06-08 宇龙计算机通信科技(深圳)有限公司 Android-based platform application installation control method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002124952A (en) * 2000-10-12 2002-04-26 Furukawa Electric Co Ltd:The Authentication method for wireless terminal in wireless network and authentication system for wireless terminal in wireless network
GB0129065D0 (en) * 2001-12-05 2002-01-23 Philips Electronics Uk Ltd Method and apparatus for verifying the integrity of system data
JP2011049667A (en) * 2009-08-25 2011-03-10 Panasonic Corp Data processor and data processing method
CN102082664A (en) * 2009-11-30 2011-06-01 腾讯科技(深圳)有限公司 Network data safety transmission system and network data safety transmission method
CN102082784A (en) * 2010-11-11 2011-06-01 广东欧珀电子工业有限公司 A method for online software upgrade
CN102387152A (en) * 2011-11-03 2012-03-21 北京锐安科技有限公司 Preset-key-based symmetric encryption communication method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895457A (en) * 2009-05-20 2010-11-24 灰熊(北京)科技有限公司 Method for ensuring data transmission integrity in transmission control protocol (TCP) communication process
CN101990239A (en) * 2009-07-30 2011-03-23 中兴通讯股份有限公司 Method and system for improving reliability of data transmission and wireless communication equipment
CN102034058A (en) * 2010-11-25 2011-04-27 中国联合网络通信集团有限公司 Method for controlling safety of application software and terminal
CN102087605A (en) * 2011-01-28 2011-06-08 宇龙计算机通信科技(深圳)有限公司 Android-based platform application installation control method and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416545A (en) * 2020-11-04 2021-02-26 北京五八信息技术有限公司 Task processing method and device
CN112600848A (en) * 2020-12-17 2021-04-02 上海芯安信息科技有限公司 Software upgrading package encapsulation method and device and software upgrading package decapsulation method and device
CN112600848B (en) * 2020-12-17 2023-03-24 上海芯安信息科技有限公司 Software upgrading package encapsulation method and device and software upgrading package decapsulation method and device
CN113114659A (en) * 2021-04-08 2021-07-13 深圳市元征科技股份有限公司 Diagnostic equipment detection method and device, terminal equipment and storage medium
CN113114659B (en) * 2021-04-08 2022-12-23 深圳市元征科技股份有限公司 Diagnostic equipment detection method and device, terminal equipment and storage medium
CN115909382A (en) * 2022-11-28 2023-04-04 五八有限公司 Image recognition method, device, electronic device and storage medium

Also Published As

Publication number Publication date
CN104348578A (en) 2015-02-11
CN104348578B (en) 2019-01-29

Similar Documents

Publication Publication Date Title
WO2015014308A1 (en) A method and a device for data processing
CN111142930B (en) Installation package file packaging method and device, terminal device and storage medium
US20160241589A1 (en) Method and apparatus for identifying malicious website
US20160314219A1 (en) Method and apparatus for invoking application programming interface
CN105320598A (en) Software testing method and device
CN107329901B (en) Data packet capturing method, terminal, server and storage medium
US10691819B2 (en) Method and apparatus for remotely deleting information
CN108039963B (en) Container configuration method and device and storage medium
WO2015027849A1 (en) Methods, devices, and systems for correlating terminals
CN106453767A (en) Fault detection method and device after drop
CN108089977A (en) A kind of abnormality eliminating method of application program, device and mobile terminal
WO2015035947A1 (en) Method for realizing cellphone without card, cellphone and server
CN107783906A (en) Method of testing, device and storage medium
CN108900386A (en) Production method, device and the electronic equipment of warning information
CN113395337A (en) Method and device for preventing browser webpage from being hijacked, electronic equipment and storage medium
CN110213313B (en) File uploading method, related device and system
WO2018161540A1 (en) Fingerprint registration method and related product
CN107967427A (en) Monitor the method, apparatus and terminal device of loophole attack
CN105610878B (en) Directory uploading method, data publishing method, terminal and server
CN111209031B (en) Data acquisition method, device, terminal equipment and storage medium
CN111177612B (en) Page login authentication method and related device
CN107844318B (en) An operating system upgrade method, mobile terminal and server
CN107765922B (en) Card screen detection and solution method, mobile terminal and computer readable storage medium
CN112787769B (en) Method, device, equipment and storage medium for determining NFI
WO2022183552A1 (en) Communication device test method and apparatus, storage medium, terminal, and test system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14832377

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29/06/2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14832377

Country of ref document: EP

Kind code of ref document: A1