Installation package storage method and device, electronic equipment and storage medium
By performing feature extraction and verification on the installation package stored on the server side, the problem of low server storage resource utilization is solved, and the uniqueness verification of the installation package and storage efficiency improvement are achieved.
Patent Information
- Application Number
- CN202410870135.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-15
AI Technical Summary
The server has duplicate storage when storing installation packages, making it difficult to effectively utilize storage resources. How to improve the utilization of server-side storage resources.
By extracting features from the application file information sent by the client, application features are obtained to identify the target application, and the target installation package is verified based on the pre-stored default installation package. If it is different, the target installation package is stored to reduce duplication. storage.
It improves the accuracy of uniqueness verification of target installation packages, reduces the storage of installation packages with the same characteristics, and improves the effective utilization of server-side storage resources.
Smart Images

Figure CN118779295A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an installation package storage method, device, electronic device and storage medium. Background Art
[0002] As the number of users increases, the number of installation packages uploaded by users when using the server increases, and many installation packages are stored repeatedly. For example, the vehicle cloud space server stores the installation package of music player software, but there are still a large number of users uploading the installation package of music player software to the vehicle cloud space server. This causes huge consumption of storage resources on the server, making it difficult to effectively use the storage resources on the server. Therefore, how to improve the effective utilization rate of storage resources on the server has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose an installation package storage method, device, electronic device and storage medium, aiming to improve the effective utilization of server-side storage resources.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes an installation package storage method, which is applied to a server, and the method includes:
[0005] In response to an application operation request carrying application file information sent by a user terminal, feature extraction is performed on the application file information to obtain application features, wherein the application features are used to identify a target application;
[0006] Acquire a target installation package of the target application based on the application feature;
[0007] Verify the target installation package according to the pre-stored preset installation package to obtain a verification result;
[0008] If the verification result indicates that the target installation package is different from the preset installation package, the target installation package is stored.
[0009] In some embodiments, in response to the application operation request carrying the application file information sent by the user end, extracting features from the application file information to obtain application features includes:
[0010] Extracting the identification of the application file information to obtain an application identification;
[0011] Performing hash calculation on the application file information to obtain an application hash value;
[0012] The application identifier and the application hash value are combined to obtain the application feature.
[0013] In some embodiments, extracting the identifier of the application file information to obtain the application identifier includes:
[0014] Extracting signature information from the application file information to obtain an application signature;
[0015] Extracting package name information from the application file information to obtain an application package name;
[0016] The application signature and the application package name are combined to obtain the application identifier.
[0017] In some embodiments, performing hash calculation on the application file information to obtain an application hash value includes:
[0018] Extracting a content character string of the application file information;
[0019] Filling the content character string with data to obtain a filled character string;
[0020] Grouping the filling character strings to obtain grouped character strings;
[0021] Calculating the grouped character string using a preset round function to obtain an updated character string;
[0022] The update character strings are concatenated to obtain the application hash value.
[0023] In some embodiments, before verifying the target installation package according to the pre-stored preset installation package and obtaining the verification result, the method further includes:
[0024] In response to a preset application operation request sent by the user terminal and carrying preset application file information, feature extraction is performed on the preset application file information to obtain a preset application feature, wherein the preset application feature is used to identify the preset application;
[0025] Acquire an application installation package of the preset application based on the preset application feature;
[0026] The application installation package is stored in the server to obtain the preset installation package.
[0027] In some embodiments, the preset installation package includes preset features, and the verifying the target installation package according to the pre-stored preset installation package to obtain the verification result includes:
[0028] Acquire preset attribute information of the preset feature;
[0029] Obtaining target attribute information of each of the application features in the target installation package;
[0030] Based on the preset attribute information and the target attribute information, the preset installation package is used to compare and verify the target installation package to obtain the verification result.
[0031] In some embodiments, if the verification result indicates that the target installation package is different from the preset installation package, before storing the target installation package, the method further includes:
[0032] Performing feature extraction on the verification result to obtain a first feature, a second feature, and a third feature;
[0033] Performing signature verification on the target installation package according to the first feature to obtain a signature verification result;
[0034] Performing package name verification on the target installation package according to the second feature to obtain a package name verification result;
[0035] Performing hash value verification on the target installation package according to the third feature to obtain a hash value verification result;
[0036] If the signature verification result fails, the package name verification result fails, and the hash value verification result fails, it is determined that the target installation package is different from the preset installation package.
[0037] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes an installation package storage device, which is applied to a server, and the device includes:
[0038] An application feature extraction module, configured to extract features of the application file information in response to an application operation request sent by a user terminal and carrying the application file information, and obtain application features, wherein the application features are used to identify a target application;
[0039] An installation package acquisition module, used to acquire a target installation package of the target application based on the application characteristics;
[0040] An installation package verification module is used to verify the target installation package according to a pre-stored preset installation package to obtain a verification result;
[0041] The installation package storage module is used to store the target installation package if the verification result indicates that the target installation package is different from the preset installation package.
[0042] To achieve the above-mentioned purpose, an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect above is implemented.
[0043] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0044] The installation package storage method, device, electronic device and storage medium proposed in the present application perform feature extraction through application file information to obtain application features for identifying the target application, thereby verifying the uniqueness of the target installation package, and verifying the target installation package according to a pre-stored preset installation package to obtain a verification result, thereby improving the accuracy of the uniqueness verification of the target installation package. Furthermore, when the verification result indicates that the target installation package is different from the preset installation package, the target installation package is stored, reducing the storage of installation packages with the same features on the server side, thereby improving the effective utilization of storage resources on the server side. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flowchart of the installation package storage method provided in an embodiment of the present application;
[0046] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.
[0047] Figure 3 yes Figure 2 Flow chart of step S201 in FIG.
[0048] Figure 4 yes Figure 2 Flow chart of step S202 in FIG.
[0049] Figure 5 is a flowchart of an installation package storage method provided by another embodiment of the present application;
[0050] Figure 6 yes Figure 1 Flow chart of step S103 in FIG.
[0051] Figure 7 is a flowchart of an installation package storage method provided by another embodiment of the present application;
[0052] Figure 8 is a schematic diagram of the structure of the installation package storage device provided in an embodiment of the present application;
[0053] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] First, some nouns involved in this application are analyzed:
[0058] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0059] As the number of users increases, the number of installation packages uploaded by users when using the server increases. Among them, many installation packages are stored repeatedly, resulting in huge consumption of storage resources on the server, making it difficult to effectively utilize the storage resources on the server. Therefore, how to improve the effective utilization rate of storage resources on the server has become a technical problem that needs to be solved urgently.
[0060] Based on this, the embodiments of the present application provide an installation package storage method, device, electronic device and storage medium, aiming to improve the effective utilization of server-side storage resources.
[0061] The installation package storage method, device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the installation package storage method in the embodiments of the present application is described.
[0062] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0063] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0064] The installation package storage method provided in the embodiment of the present application relates to the field of data storage technology. The installation package storage method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the installation package storage method, etc., but is not limited to the above forms.
[0065] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0066] Figure 1 is an optional flowchart of the installation package storage method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S104.
[0067] Step S101, in response to an application operation request carrying application file information sent by a user terminal, feature extraction is performed on the application file information to obtain application features, wherein the application features are used to identify a target application;
[0068] Step S102, obtaining a target installation package of a target application based on application characteristics;
[0069] Step S103, verifying the target installation package according to the pre-stored preset installation package to obtain a verification result;
[0070] Step S104: If the verification result indicates that the target installation package is different from the preset installation package, the target installation package is stored.
[0071] Steps S101 to S104 shown in the embodiment of the present application, by receiving an application operation request carrying application file information sent by the user end, extracting features in the application file information, obtaining application features for identifying the target application, further, obtaining the target installation package corresponding to the target application according to the application features, secondly, using the preset installation package stored in advance on the server end, verifying the target installation package, obtaining the verification result of the target installation package, and finally, when the verification result indicates that the target installation package is different from the preset installation package, storing the target installation package contained in the application operation request sent by the user end. Therefore, the present application extracts features through application file information to obtain application features for identifying the target application, thereby verifying the uniqueness of the target installation package, verifying the target installation package according to the pre-stored preset installation package, obtaining the verification result, improving the accuracy of the uniqueness verification of the target installation package, further, when the verification result indicates that the target installation package is different from the preset installation package, storing the target installation package, reducing the storage of installation packages with the same features on the server end, thereby improving the effective utilization of the storage resources on the server end.
[0072] In one application scenario, taking the example of a vehicle user end uploading a vehicle application installation package to a vehicle cloud space server, when the vehicle cloud space server receives a vehicle application upload request carrying vehicle application information sent by the vehicle user end, it extracts features of the vehicle application information to obtain vehicle application features for identifying vehicle applications, and obtains the vehicle application installation package corresponding to the vehicle application from the on-board application upload request based on the vehicle application features, and then uses the on-board application installation package stored in advance on the vehicle cloud space server to verify the vehicle application installation package to obtain a verification result of the vehicle application installation package. If the verification result indicates that the vehicle application installation package is different from the on-board application installation package, the vehicle application installation package is stored.
[0073] In another application scenario, taking the example of a vehicle user terminal downloading a vehicle-mounted application installation package from a vehicle cloud space server, when the vehicle cloud space server receives a vehicle-mounted application download request carrying vehicle-mounted application information sent by the vehicle user terminal, it extracts the characteristics of the vehicle-mounted application information, obtains the vehicle-mounted application characteristics used to identify the vehicle-mounted application, and obtains the vehicle-mounted application installation package corresponding to the vehicle-mounted application from the vehicle cloud space server based on the vehicle-mounted application characteristics, and then uses the vehicle-mounted application download installation package stored in advance on the vehicle-mounted application management server to verify the vehicle-mounted application installation package to obtain the verification result of the vehicle-mounted application installation package. If the verification result indicates that the vehicle-mounted application installation package is different from the vehicle-mounted application download installation package, the vehicle-mounted application installation package is stored.
[0074] In step S101 of some embodiments, the server includes a cloud space server and an application management server, wherein the cloud space server is used to store the installation package uploaded by the user, and the application management server is used to store the installation package downloaded by the user. The application file information may be information such as the executable file, library file, configuration file, icon and identity identification of the application, wherein the identity identification information may be information such as the signature, package name and hash value. The application operation request is an application operation request sent by the user to the server. It should be noted that the application operation request may be a request to upload the application, and the application operation request may also be an application download request, wherein the application upload request includes the application file information and the target application, and the application download request includes the application file information. The target application is an application identified by the application feature. It should be noted that when the application operation request is an application upload request, the target application is stored as request data in the application upload request, and when the application operation request is an application download request, the target application is stored as storage data in the server. In the server, the present application extracts the application feature that can identify the target application in the application file information by responding to the application operation request carrying the application file information sent by the user.
[0075] It should be noted that when the application operation request is different, the application features that need to be extracted from the application file information are also different.
[0076] Specifically, when the application operation request is an application upload request, see Figure 2 In some embodiments, step S101 includes but is not limited to steps S201 to S203:
[0077] Step S201, extracting the identifier of the application file information to obtain the application identifier;
[0078] Step S202, performing hash calculation on the application file information to obtain an application hash value;
[0079] Step S203: Merge the application identifier and the application hash value to obtain application features.
[0080] In step S201 of some embodiments, the application identifier refers to information used to verify the authenticity, integrity and uniqueness of the target application, and the application identifier may be information such as the signature and package name of the target application. The present application first needs to clearly extract the application identifier, then generate an information extraction instruction for extracting the application identifier, and finally use the information extraction instruction to extract the application identifier from the application file information, thereby realizing the extraction of the application identifier.
[0081] See also Figure 3 In some embodiments, step S201 may include, but is not limited to, steps S301 to S303:
[0082] Step S301, extracting signature information from application file information to obtain an application signature;
[0083] Step S302, extracting package name information from the application file information to obtain the application package name;
[0084] Step S303: Merge the application signature and the application package name to obtain an application identifier.
[0085] In step S301 of some embodiments, the application signature refers to a digital signature used to verify the authenticity and integrity of the application package, and the application signature includes the certificate issuer, certificate serial number, certificate fingerprint, etc. It should be noted that the application signature can also be used to verify whether the application package has been tampered with. The application can extract the corresponding application signature from the application file information by using the signature extraction instruction.
[0086] In step S302 of some embodiments, the application package name is a unique identifier for distinguishing an application package, and the application package name generally refers to a Java package name of the application package, such as com.example.app. The present application can extract the corresponding application package name from the application file information by using a package name extraction instruction.
[0087] In step S303 of some embodiments, after obtaining the application signature and the application package name, in order to simultaneously verify the integrity, authenticity and uniqueness of the application file, it is necessary to merge the application signature and the application package name to obtain the application identifier.
[0088] It should be noted that in the application identification, the application signature and the application package name exist as independent data.
[0089] In steps S301 to S303 shown in this embodiment, the application signature is obtained by extracting the signature information in the application file information, the application package name is obtained by extracting the package name information in the application file information, and then the application signature and the application package name are merged to obtain the application identifier, which can verify the integrity and authenticity of the application file information, thereby reducing the probability of duplication of the target installation package stored in the server.
[0090] In step S202 of some embodiments, the hash value can verify the integrity, authenticity and uniqueness of the data. Therefore, the present application also needs to calculate the hash value of the application file information to further avoid duplication between the target installation package uploaded by the user and the preset installation package stored by the server.
[0091] In an optional embodiment, the present application uses the md5 verification algorithm to calculate the hash value of the application file information.
[0092] Specifically, see Figure 4In some embodiments, step S301 may include but is not limited to steps S401 to S405:
[0093] Step S401, extracting the content character string of the application file information;
[0094] Step S402, filling the content character string with data to obtain a filled character string;
[0095] Step S403, grouping the filling character string to obtain a grouped character string;
[0096] Step S404, using a preset round function to calculate the grouped character string to obtain an updated character string;
[0097] Step S405: concatenate the updated character strings to obtain an application hash value.
[0098] In step S401 of some embodiments, a character string is extracted from the content in the application file information to obtain a content character string.
[0099] In step S402 of some embodiments, when the length of the binary data in the content string does not meet the preset length in the md5 verification algorithm, a 1 is added to the end of the content string, and then 0 is filled after the 1 until the length of the binary data in the content string after filling meets the preset length in the md5 verification algorithm.
[0100] In step S403 of some embodiments, based on the data grouping rule of the md5 verification algorithm, the data in the filling character string is grouped to obtain a grouped character string. It should be noted that the length of each grouped character string is the same.
[0101] In step S404 of some embodiments, the preset round function is a function for performing multiple rounds of bit operations and permutation operations on each grouped string. Based on the preset round function, the present application performs multiple rounds of bit operations and permutation operations on each grouped string to obtain an updated string.
[0102] In step S405 of some embodiments, after obtaining the update string obtained by calculating each grouped string, all the update strings are concatenated according to the grouping order of the grouped strings to obtain the hash value of the application file information.
[0103] In steps S401 to S405 shown in this embodiment, an application hash value is obtained by performing md5 verification calculation on the content character string of the application file information, thereby improving the accuracy of the uniqueness verification of the application file information.
[0104] In step S203 of some embodiments, in order to improve the verification accuracy of the uniqueness of the application file information, the application feature is obtained by packaging the application identifier and the application hash value.
[0105] It should be noted that in the application feature information, the application identifier and the application hash value exist as independent data.
[0106] In steps S201 to S203 shown in the present embodiment, the uniqueness of the application file information can be verified by extracting the application identifier in the application file information. Furthermore, the application hash value of the application file information is calculated to achieve a secondary verification of the uniqueness of the application file information, thereby improving the accuracy and credibility of the uniqueness verification of the application file information.
[0107] In an optional embodiment of the present application, when an application operation requests an application download request, the application characteristics are obtained by calculating the application hash value of the application file information.
[0108] In step S102 of some embodiments, the target installation package includes the target application and application file information. This application obtains the target installation package based on the application features that can represent the target application. It should be noted that when the application operation request is different, the storage location of the target installation package is different, so the way to obtain the target installation package is also different. For example, when the application operation request is an application upload request, the target installation package is stored as request data in the application upload request. At this time, the target installation package needs to be obtained from the application upload request. When the application operation request is an application download request, the target installation package is stored as storage data in the server. At this time, the target installation package needs to be obtained from the server.
[0109] In step S103 of some embodiments, the preset installation package refers to an installation package stored in the server. After the target installation package is determined, the preset installation packages stored in the server are traversed, and the target installation package is verified using the preset installation package to obtain a verification result.
[0110] For details, see Figure 5 In some embodiments, before step S103, the installation package storage method may also include but is not limited to steps S501 to S503:
[0111] Step S501, in response to a preset application operation request carrying preset application file information sent by a user terminal, extracting features of the preset application file information to obtain preset application features, wherein the preset application features are used to identify the preset application;
[0112] Step S502, obtaining an application installation package of a preset application based on the preset application characteristics;
[0113] Step S503: store the application installation package to the server to obtain a preset installation package.
[0114] In step S501 of some embodiments, preset application file information refers to application file information that has not been stored in the server. Preset application features refer to application features that have not been stored in the server. Preset applications refer to applications that have not been stored in the server. The present application obtains preset application features by extracting features from preset application file information in a preset application operation request. It should be noted that the method of extracting features from preset application file information to obtain preset application features is similar to the method of extracting features from application file information to obtain application features, so they are not repeated here.
[0115] In step S502 of some embodiments, the application installation package refers to an installation package that has not been stored in the server. The present application extracts the application installation package of the preset application from the preset application operation request according to the preset application feature.
[0116] In step S503 of some embodiments, there is no installation package on the server side that is completely identical to the application installation package, so the application installation package is stored on the server side to obtain a preset installation package.
[0117] It should be noted that the cloud space server in the server is used to store application installation packages uploaded by the user, and the application management server in the server is used to store application installation packages downloaded by the user. The user can be any user with a server account. Therefore, the preset installation package can be an installation package uploaded or downloaded by the same user, or an installation package uploaded or downloaded by different users. For example, after user A uploads installation package X to the server, user B uploads installation package Y. Installation package X can be used as the preset installation package to verify installation package Y.
[0118] For further information, see Figure 6 In some embodiments, step S102 includes but is not limited to steps S601 to S603:
[0119] Step S601, obtaining preset attribute information of a preset feature;
[0120] Step S602, obtaining target attribute information of each application feature in the target installation package;
[0121] Step S603: Based on the preset attribute information and the target attribute information, the preset installation package is used to compare and verify the target installation package to obtain a verification result.
[0122] In step S601 of some embodiments, the preset feature refers to the application feature of the preset installation package, and the preset feature includes the preset signature feature, the preset package name feature, and the preset hash value feature of the preset installation package. It should be noted that the preset feature is data stored in the preset installation package, so the preset feature can be directly obtained. The preset attribute information refers to the attribute information of each preset feature in the preset installation package, and the attribute information includes information such as the application signature, the application package name, and the application hash value. The present application obtains the preset attribute information of each preset feature in the preset installation package by performing an attribute search on each preset feature in the preset installation package.
[0123] In step S602 of some embodiments, the target attribute information refers to the attribute information of each application feature in the target installation package. The present application obtains the target attribute information of each application feature in the target installation package by performing attribute search on the application feature of the target installation package.
[0124] In step S603 of some embodiments, based on preset attribute information and target attribute information, the preset features in the preset installation package are compared with application features with the same attributes in the target installation package to obtain feature verification results, and then the feature verification results of each application feature in the target installation package are merged to obtain verification results.
[0125] In steps S601 to S603 shown in this embodiment, by comparing the preset features in the preset installation package with the application features with the same attributes in the target installation package, the effectiveness and accuracy of the verification result are improved, thereby reducing the storage of installation packages with the same features on the server side and improving the effective utilization of storage resources on the server side.
[0126] In step S104 of some embodiments, when the verification result indicates that the target installation package is different from the preset installation package, it means that the server has not stored the target installation package. At this time, the server responds to the application operation request sent by the user terminal by storing the target installation package.
[0127] See also Figure 7 In some embodiments, in step S104, the installation package storage method may also include but is not limited to steps S701 to S705:
[0128] Step S701, extracting features from the verification results to obtain a first feature, a second feature, and a third feature;
[0129] Step S702, performing signature verification on the target installation package according to the first feature to obtain a signature verification result;
[0130] Step S703, verifying the package name of the target installation package according to the second feature to obtain a package name verification result;
[0131] Step S704, performing hash value verification on the target installation package according to the third feature to obtain a hash value verification result;
[0132] Step S705: If the signature verification result fails, the package name verification result fails, and the hash value verification result fails, it is determined that the target installation package is different from the preset installation package.
[0133] In step S701 of some embodiments, the present application extracts features of the verification results by splitting the verification results to obtain verification results of each application feature of the target installation package, thereby facilitating determination of whether the target installation package is the same as the preset installation package.
[0134] In step S702 of some embodiments, the signature verification result of the target installation package is obtained by comparing and verifying the application signature in the application feature of the target installation package with the corresponding preset feature in the preset installation package.
[0135] In step S703 of some embodiments, the package name verification result of the target installation package is obtained by comparing and verifying the application package name in the application feature of the target installation package with the corresponding preset feature in the preset installation package.
[0136] In step S704 of some embodiments, the hash value verification result of the target installation package is obtained by comparing and verifying the application hash value in the application feature of the target installation package with the corresponding preset feature in the preset installation package.
[0137] In step S705 of some embodiments, the signature verification result failure means that the application signature of the target installation package is different from the corresponding preset feature in the preset installation package, the package name verification result failure means that the application package name of the target installation package is different from the corresponding preset feature in the preset installation package, and the hash value verification result failure means that the application hash value of the target installation package is different from the corresponding preset feature in the preset installation package. The present application determines that the target installation package is different from the preset installation package when the signature verification result fails, the package name verification result fails, and the hash value verification result fails.
[0138] In steps S701 to S705 shown in the present embodiment, feature extraction is performed on the verification result to obtain the first feature, the second feature, and the third feature, and the signature of the target installation package is verified according to the first feature, the package name of the target installation package is verified according to the second feature, and the hash value of the target installation package is verified according to the third feature. This can reduce the probability of duplication of the target installation package stored on the server, reduce the storage of installation packages with the same features on the server, and thus improve the effective use of storage resources on the server.
[0139] The embodiment of the present application performs feature extraction through application file information to obtain application features for identifying the target application, thereby verifying the uniqueness of the target installation package, and verifies the target installation package according to a pre-stored preset installation package to obtain a verification result, thereby improving the accuracy of the uniqueness verification of the target installation package. Furthermore, when the verification result indicates that the target installation package is different from the preset installation package, the target installation package is stored, reducing the storage of installation packages with the same features on the server side, thereby improving the effective utilization of storage resources on the server side.
[0140] See also Figure 8 The embodiment of the present application further provides an installation package storage device, which can implement the above installation package storage method, and the installation package storage device includes:
[0141] The application feature extraction module 801 is used to extract the feature of the application file information in response to the application operation request carrying the application file information sent by the user end, and obtain the application feature; wherein the application feature is used to identify the target application;
[0142] An installation package acquisition module 802 is used to acquire a target installation package of a target application based on application characteristics;
[0143] The installation package verification module 803 is used to verify the target installation package according to the pre-stored preset installation package to obtain a verification result;
[0144] The installation package storage module 804 is configured to store the target installation package if the verification result indicates that the target installation package is different from the preset installation package.
[0145] The specific implementation of the installation package storage device is basically the same as the specific implementation of the above-mentioned installation package storage method, and will not be repeated here.
[0146] An embodiment of the present application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above-mentioned installation package storage method when executing the computer program.
[0147] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0148] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0149] The memory 902 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 may store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the installation package storage method of the embodiment of this application;
[0150] Input / output interface 903, used to implement information input and output;
[0151] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0152] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0153] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0154] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned installation package storage method is implemented.
[0155] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0156] The installation package storage method, installation package storage device, electronic device and storage medium provided in the embodiments of the present application perform feature extraction through application file information to obtain application features for identifying the target application, thereby verifying the uniqueness of the target installation package, and verifying the target installation package according to a pre-stored preset installation package to obtain a verification result, thereby improving the accuracy of the uniqueness verification of the target installation package, and further, when the verification result indicates that the target installation package is different from the preset installation package, the target installation package is stored, reducing the storage of installation packages with the same features on the server side, thereby improving the effective utilization of storage resources on the server side.
[0157] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0158] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0159] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0160] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0161] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0162] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0163] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0164] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0167] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for storing an installation package, It is characterized in that Applied to the server, the method includes: In response to an application operation request carrying application file information sent by a user terminal, feature extraction is performed on the application file information to obtain application features, wherein the application features are used to identify a target application; Acquire a target installation package of the target application based on the application feature; Verify the target installation package according to the pre-stored preset installation package to obtain a verification result; If the verification result indicates that the target installation package is different from the preset installation package, the target installation package is stored.
2. The method according to claim 1, It is characterized in that The step of extracting features of the application file information in response to the application operation request sent by the user end and carrying the application file information to obtain application features includes: Extracting the identification of the application file information to obtain an application identification; Performing hash calculation on the application file information to obtain an application hash value; The application identifier and the application hash value are combined to obtain the application feature.
3. The method according to claim 2, It is characterized in that The step of extracting the identification of the application file information to obtain the application identification includes: Extracting signature information from the application file information to obtain an application signature; Extracting package name information from the application file information to obtain an application package name; The application signature and the application package name are combined to obtain the application identifier.
4. The method according to claim 3, It is characterized in that The performing hash calculation on the application file information to obtain an application hash value includes: Extracting a content character string of the application file information; Filling the content character string with data to obtain a filled character string; Grouping the filling character strings to obtain grouped character strings; Calculating the grouped character string using a preset round function to obtain an updated character string; The update character strings are concatenated to obtain the application hash value.
5. The method according to claim 1, It is characterized in that Before verifying the target installation package according to the pre-stored preset installation package and obtaining the verification result, the method further includes: In response to a preset application operation request sent by the user terminal and carrying preset application file information, feature extraction is performed on the preset application file information to obtain a preset application feature, wherein the preset application feature is used to identify the preset application; Acquire an application installation package of the preset application based on the preset application feature; The application installation package is stored in the server to obtain the preset installation package.
6. The method according to any one of claims 1 to 5, It is characterized in that The preset installation package includes preset features, and the target installation package is verified according to the pre-stored preset installation package to obtain a verification result, including: Acquire preset attribute information of the preset feature; Obtaining target attribute information of each of the application features in the target installation package; Based on the preset attribute information and the target attribute information, the preset installation package is used to compare and verify the target installation package to obtain the verification result.
7. The method according to any one of claims 1 to 5, It is characterized in that If the verification result indicates that the target installation package is different from the preset installation package, before storing the target installation package, the method further includes: Performing feature extraction on the verification result to obtain a first feature, a second feature, and a third feature; Performing signature verification on the target installation package according to the first feature to obtain a signature verification result; Performing package name verification on the target installation package according to the second feature to obtain a package name verification result; Performing hash value verification on the target installation package according to the third feature to obtain a hash value verification result; If the signature verification result fails, the package name verification result fails, and the hash value verification result fails, it is determined that the target installation package is different from the preset installation package.
8. An installation package storage device, It is characterized in that Applied to the server, the device comprises: An application feature extraction module, configured to extract features of the application file information in response to an application operation request sent by a user terminal and carrying the application file information, and obtain application features, wherein the application features are used to identify a target application; An installation package acquisition module, used to acquire a target installation package of the target application based on the application characteristics; An installation package verification module is used to verify the target installation package according to a pre-stored preset installation package to obtain a verification result; The installation package storage module is used to store the target installation package if the verification result indicates that the target installation package is different from the preset installation package.
9. An electronic device, It is characterized in that The electronic device memory and processor, the memory stores a computer program, and the processor implements the installation package storage method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the installation package storage method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Repeated APK removing method and device in APK downloading
CN104077422A
Installation method, device, computer device and storage medium for application program
CN109408074A
Application management method and device, equipment and medium
CN115509556A
File verification method and device, electronic equipment and computer storage medium
CN117610083A
