Movatterモバイル変換


[0]ホーム

URL:


CN113835717B - Installation package acquisition method, device, equipment and storage medium - Google Patents

Installation package acquisition method, device, equipment and storage medium
Download PDF

Info

Publication number
CN113835717B
CN113835717BCN202010582394.1ACN202010582394ACN113835717BCN 113835717 BCN113835717 BCN 113835717BCN 202010582394 ACN202010582394 ACN 202010582394ACN 113835717 BCN113835717 BCN 113835717B
Authority
CN
China
Prior art keywords
installation package
query
parameters
parameter
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010582394.1A
Other languages
Chinese (zh)
Other versions
CN113835717A (en
Inventor
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co LtdfiledCriticalWuhan Douyu Network Technology Co Ltd
Priority to CN202010582394.1ApriorityCriticalpatent/CN113835717B/en
Publication of CN113835717ApublicationCriticalpatent/CN113835717A/en
Application grantedgrantedCritical
Publication of CN113835717BpublicationCriticalpatent/CN113835717B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明实施例公开了一种安装包获取方法、装置、设备及存储介质。该方法包括:在监测到获取安装包的触发事件时,获取与触发事件对应的安装包获取参数;以安装包获取参数为入参参数,调用已构建完成的安装包获取函数,以使安装包获取函数对安装包查询参数进行解密,根据解密结果更新安装包查询参数;将安装包获取参数传递至已构建完成的签名校验函数中,根据签名校验函数的输出结果,判断签名校验是否成功;若是,以安装包查询参数为入参参数,调用已构建完成的安装包查询函数,根据安装包查询函数的输出结果,得到待获取安装包;根据安装包获取函数的输出结果,得到待获取安装包。本发明实施例的技术方案,解决了安装包的获取效率低下的问题。

The embodiment of the present invention discloses a method, device, equipment and storage medium for obtaining an installation package. The method includes: when a triggering event for obtaining an installation package is detected, obtaining the installation package obtaining parameter corresponding to the triggering event; using the installation package obtaining parameter as an input parameter, calling the constructed installation package obtaining function, so that the installation package obtaining function decrypts the installation package query parameter, and updating the installation package query parameter according to the decryption result; passing the installation package obtaining parameter to the constructed signature verification function, and judging whether the signature verification is successful according to the output result of the signature verification function; if so, using the installation package query parameter as an input parameter, calling the constructed installation package query function, and obtaining the installation package to be obtained according to the output result of the installation package query function; obtaining the installation package to be obtained according to the output result of the installation package obtaining function. The technical solution of the embodiment of the present invention solves the problem of low efficiency in obtaining installation packages.

Description

Installation package acquisition method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer application, in particular to a method, a device, equipment and a storage medium for acquiring an installation package.
Background
In the Android system, all installed installation packages of an application program are usually stored in a local folder, and when a specific installation package needs to be acquired, a user needs to manually search in the folder in the prior art, so that the acquisition efficiency of the installation package is low.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for acquiring an installation package, which solve the problem of lower acquisition efficiency of the installation package.
In a first aspect, an embodiment of the present invention provides an installation package obtaining method, which may include:
When a triggering event of acquiring an installation package is monitored, acquiring an installation package acquisition parameter corresponding to the triggering event, wherein the installation package acquisition parameter comprises an installation package query parameter of the installation package to be acquired and an object signature parameter of an installation package acquisition object;
taking the installation package acquisition parameters as the parameter entry parameters, calling the constructed installation package acquisition function, and obtaining an installation package to be acquired according to the output result of the installation package acquisition function;
wherein, the installation package acquisition function realizes the installation package acquisition function through the following steps:
Decrypting the query parameters of the installation package, and updating the query parameters of the installation package according to the decryption result;
transmitting the acquired parameters of the installation package to the constructed signature verification function, and judging whether the signature verification is successful or not according to the output result of the signature verification function;
If so, calling the constructed installation package query function by taking the installation package query parameter as the parameter entry parameter, and obtaining the installation package to be obtained according to the output result of the installation package query function.
In a second aspect, an embodiment of the present invention further provides an installation package obtaining apparatus, which may include:
the installation package acquisition parameter acquisition module is used for acquiring installation package acquisition parameters corresponding to a triggering event when the triggering event of acquiring the installation package is monitored, wherein the installation package acquisition parameters comprise installation package query parameters of the installation package to be acquired and object signature parameters of an installation package acquisition object;
The installation package obtaining module to be obtained is used for calling the constructed installation package obtaining function by taking the installation package obtaining parameters as the parameter entering parameters, and obtaining the installation package to be obtained according to the output result of the installation package obtaining function;
wherein, the installation package acquisition function realizes the installation package acquisition function through the following units:
The installation package query parameter decryption unit is used for acquiring access token information, decrypting the installation package query parameters based on the access token information, and updating the installation package query parameters according to a decryption result;
the signature verification judging unit is used for transmitting the acquired parameters of the installation package to the constructed signature verification function and judging whether the signature verification is successful or not according to the output result of the signature verification function;
and the installation package obtaining unit to be obtained is used for calling the constructed installation package query function by taking the installation package query parameter as the parameter entering parameter if the installation package query parameter is the parameter entering parameter, and obtaining the installation package to be obtained according to the output result of the installation package query function.
In a third aspect, an embodiment of the present invention further provides an apparatus, which may include:
One or more processors;
a memory for storing one or more programs;
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the installation package obtaining method provided by any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the installation package obtaining method provided by any embodiment of the present invention.
According to the technical scheme, when the triggering event of acquiring the installation package is monitored, the constructed installation package acquisition function is called by taking the installation package acquisition parameter corresponding to the triggering event as the parameter entry parameter, so that the installation package acquisition function decrypts the installation package query parameter, the installation package query parameter is updated according to the decryption result, the installation package acquisition parameter is further transferred to the constructed signature verification function, when the signature verification is determined to be successful according to the output result of the signature verification function, the installation package query parameter is transferred to the constructed installation package query function, and at the moment, the output result of the installation package query function is the output result of the installation package acquisition function, so that the corresponding installation package to be acquired can be obtained according to the output result of the installation package acquisition function. According to the technical scheme, the installation package to be acquired is automatically acquired based on the installation package acquisition function, the installation package to be acquired is matched with the installation package acquisition parameters, the problem that the acquisition efficiency of the installation package is low is solved, and the effect of automatically and rapidly acquiring the installation package is achieved.
Drawings
FIG. 1 is a flow chart of a method of acquiring an installation package according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for acquiring an installation package in a second embodiment of the present invention;
FIG. 3 is a flow chart of a method of acquiring an installation package in accordance with a third embodiment of the present invention;
Fig. 4 is a block diagram showing a configuration of an installation package acquiring apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus in a fifth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of an installation package obtaining method according to a first embodiment of the present invention. The embodiment is applicable to the case of acquiring an installation package, and is particularly applicable to the case of acquiring an installation package matched with an installation package query parameter from all installed installation packages of a certain application program. The method may be performed by an installation package obtaining device provided by an embodiment of the present invention, where the device may be implemented by software and/or hardware, and the device may be integrated on various user terminals or servers.
Referring to fig. 1, the method of the embodiment of the present invention specifically includes the following steps:
s110, acquiring installation package acquisition parameters corresponding to a triggering event when the triggering event of acquiring the installation package is monitored, wherein the installation package acquisition parameters comprise installation package query parameters of the installation package to be acquired and object signature parameters of an installation package acquisition object.
The trigger event may be an event triggered by an installation package obtaining object for obtaining an installation package to be obtained, where the installation package obtaining object may be an object for pre-obtaining the installation package to be obtained, and the installation package to be obtained may be some installation package in all installed installation packages of an application program, where each installation package in all installation packages may have different version numbers, may originate from different channels, and so on, and such installation package to be obtained may be referred to as a history installation package.
The installation package acquisition parameters may include an installation package query parameter of an installation package to be acquired and an object signature parameter of an installation package acquisition object. Specifically, the query parameter of the installation package may be a query condition to be satisfied by the installation package to be obtained, which may be at least one of an application name, an application version number and an application channel, or may be other application information, which is not specifically limited herein. For example, the installation package query parameter may be an application name+an application version number, an application name+an application channel, an application name+an application version number+an application channel, or the like. The object signature parameter is a signature provided by the installation package acquisition object when the installation package is pre-acquired, and can prove whether the installation package acquisition object is a legal object or an illegal object.
In practical applications, optionally, the type of the object signature parameter may be a String type, the type of the installation package query parameter may be a PAGEPARAM type, where PAGEPARAM is a custom type, and the description information may include at least one of the number of pages of the database, the number of entries per page, and the database paging parameter, and exemplary, PAGEPARAM description information is as follows:
S120, calling the constructed installation package acquisition function by taking the installation package acquisition parameters as the parameter entry parameters, so that the installation package acquisition function executes S130-S150 according to the installation package acquisition parameters.
The installation package acquisition function takes the installation package acquisition parameters as the parameter entry parameters, and the corresponding installation package to be acquired can be obtained according to the installation package acquisition parameters. In practical applications, optionally, the type of parameter of the installation package acquisition function may be CommonResult < ListRes < AppPageVo > > type, where ListRes < AppPageVo > is a generic parameter of CommonResult, appPageVo is a generic parameter of ListRes, and the combination setting of multiple generalizations may return multiple pieces of data on one result set, which greatly improves the capacity of data return. Note that AppPageVo is a custom type, and description information thereof may include at least one of identification information, a title, a package name, a support platform, creation time, update time, a mark number, and an operator, and may also include other information, which is not specifically limited herein. Illustratively, appPageVo describe the following:
On this basis, exemplary specific forms of the installation package acquisition function are shown as follows :public CommonResult<ListRes<AppPageVo>>pagelist(PageParam appQueryReq,String sign)throws VenusException,, wherein pagelist is a function name of the installation package acquisition function, appQueryReq is an installation package query parameter, sign is an object signature parameter, the installation package acquisition function may throw a custom exception, the name of the custom exception is VenusException, and the custom exception may be continuously thrown outwards through throws VenusException.
Still alternatively, a preset request note of @ RequestMapping (value= "/applist", method = { request method. POST }) may be set in the installation package acquisition function, which describes the request manner of the installation package acquisition function, which means that the request manner can only be a POST request, and the request path must be "/applist", which is, of course, an optional setting, not particularly limited.
Still alternatively, a preset serialization annotation may be further set in the installation package obtaining function, where the preset serialization annotation may be @ ResponseBody, and an automatic serialization function for an output result of the installation package obtaining function may be implemented through @ ResponseBody, and the output result may be automatically serialized into data in a preset format, where the preset format may be JSON format, so that convenience of data transmission and analysis efficiency of the front end on data are improved. In practical applications, the preset serialization annotation may be optionally set in an installation package query function in the installation package acquisition function.
S130, decrypting the query parameters of the installation package, and updating the query parameters of the installation package according to the decryption result.
The installation package query parameter may be considered as a string of scrambled codes after encryption, so that the installation package query parameter may be decrypted based on a verification key, where the verification key may be a key held by each of the front end and the back end. The front end performs encryption processing on the installation package query parameters based on the verification key, and sends the encrypted installation package query parameters to the rear end, and then the rear end performs decryption processing on the installation package query parameters based on the verification key, and updates the installation package query parameters according to a decryption processing result, wherein the installation package query parameters are not a string of messy codes but a string of character strings with substantial meaning.
And S140, transmitting the acquired parameters of the installation package to the constructed signature verification function, and judging whether the signature verification is successful or not according to the output result of the signature verification function.
The signature verification function can generate a signature verification result according to the installation package query parameter, when the signature verification result is consistent with the object signature parameter, the installation package obtaining object is a legal object, and the signature verification is successful, otherwise, the installation package obtaining object is an illegal object, and the signature verification is failed, and at the moment, an error code can be returned to inform that the installation package obtaining object is an illegal request.
On the basis, optionally, before checking whether the installation package acquisition object is a legal object, the signature checking function can also check whether the installation package query parameter is abnormal data, and in general, if the installation package query parameter only includes an application version number and/or an application channel and does not include an application name, the installation package to be acquired, which is matched with the installation package query parameter, cannot be accurately positioned.
And S150, if so, calling the constructed installation package query function by taking the installation package query parameter as the parameter entry parameter, and obtaining the installation package to be acquired according to the output result of the installation package query function.
After the signature verification is successful, the installation package query parameters are transmitted to the constructed installation package query function, and the installation package query function can query the installation package to be acquired, which is matched with the installation package query parameters. In practical applications, optionally, the storage paths of all installed installation packages of each application program may be stored in a created list, and the storage paths of all installation packages may be the same or different, which is not specifically limited herein. Therefore, the application item matched with the installation package query parameter can be searched from the created list according to the installation package query parameter, and the installation package to be obtained matched with the installation package query parameter can be obtained according to the storage path in the application item.
S160, obtaining the installation package to be obtained according to the output result of the installation package obtaining function.
According to the technical scheme, when the triggering event of acquiring the installation package is monitored, the constructed installation package acquisition function is called by taking the installation package acquisition parameter corresponding to the triggering event as the parameter entry parameter, so that the installation package acquisition function decrypts the installation package query parameter, the installation package query parameter is updated according to the decryption result, the installation package acquisition parameter is further transferred to the constructed signature verification function, when the signature verification is determined to be successful according to the output result of the signature verification function, the installation package query parameter is transferred to the constructed installation package query function, and at the moment, the output result of the installation package query function is the output result of the installation package acquisition function, so that the corresponding installation package to be acquired can be obtained according to the output result of the installation package acquisition function. According to the technical scheme, the installation package to be acquired is automatically acquired based on the installation package acquisition function, the installation package to be acquired is matched with the installation package acquisition parameters, the problem that the acquisition efficiency of the installation package is low is solved, and the effect of automatically and rapidly acquiring the installation package is achieved.
On this basis, an optional technical solution may be that an installation package obtaining function is set in an installation package obtaining class, which is a custom class, wherein at least one of a first preset annotation for indicating that the installation package obtaining class is a control class, a second preset annotation for indicating path information for accessing the installation package obtaining class, a third preset annotation for indicating that the installation package obtaining class realizes log injection at a preset speed, and a fourth preset annotation for indicating that the installation package obtaining class realizes cross-service access, which are function annotations capable of automatically enhancing functions for the installation package obtaining class, may be set. The specific form of the installation acquisition class is illustrated by way of example as follows:
@RestController
@Slf4j
@RequestMapping("/venus/luban/android/pkg")
@NotValid
public class AppPkgController{}
Wherein AppPkgController is a class name of an installation package acquisition class, @ RestController is a first preset annotation indicating that the installation package acquisition class is a class for implementing specific business logic, requestMapping ("/venus/luban/android/pkg") is a second preset annotation indicating path information of business function accessing the installation package acquisition class, @ Slf j is a third preset annotation indicating that the installation package acquisition class can quickly implement log injection, thereby improving log transmission efficiency, and @ NotValid is a fourth preset annotation indicating that the installation package acquisition class can implement cross-service call among a plurality of servers, thereby improving acquisition efficiency of an installation package to be acquired.
Example two
Fig. 2 is a flowchart of an installation package obtaining method according to a second embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In the embodiment, the installation package query function is optionally realized by determining the number of installation packages of the installation package to be acquired according to the installation package query parameters, screening application items matched with the installation package query parameters from the created list, recording storage paths and configuration information of the installation package to be acquired in the application items, acquiring identity information of the installation package to be acquired from the application items if the number of the application items is consistent with the number of the installation packages, determining the installation package query information according to the identity information, acquiring configuration information and the storage paths from the application items according to the installation package query information, acquiring the installation package to be acquired from the database based on the storage paths, converting the installation package to be acquired and the configuration information, and packaging conversion results. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 2, the method of this embodiment may specifically include the following steps:
S210, acquiring installation package acquisition parameters corresponding to a triggering event when the triggering event of acquiring the installation package is monitored, wherein the installation package acquisition parameters comprise installation package query parameters of the installation package to be acquired and object signature parameters of an installation package acquisition object.
S220, calling the constructed installation package acquisition function by taking the installation package acquisition parameters as the parameter entry parameters, so that the installation package acquisition function executes S230-S270 according to the installation package acquisition parameters.
S230, decrypting the query parameters of the installation package, and updating the query parameters of the installation package according to the decryption result.
S240, transmitting the acquired parameters of the installation package to the constructed signature verification function, and judging whether the signature verification is successful or not according to the output result of the signature verification function.
S250, if so, determining the quantity of the installation packages to be acquired according to the installation package query parameters, and screening application items matched with the installation package query parameters from the created list, wherein the application items record storage paths and configuration information of the installation packages to be acquired.
In practical application, optionally, the decrypted installation package query parameter is a character string with a substantial meaning, and then the string number of the character string is the number of the installation packages to be obtained, and the number of the installation packages can be one, two or more, which is not specifically limited herein.
The created list is a pre-created application list, and each application entry in the application list records a storage path of an installed installation package of an application program and configuration information, wherein the configuration information may be a package name, an application name, a current version number, and the like. Thus, according to the query parameters of the installation package, the application items matched with the installation package can be screened from the created list, and the storage paths and configuration information of the installation package to be acquired are recorded in the application items. For example, if the installation package query parameter is XX application+xx version number+xx channel, configuration information corresponding to the installation package query parameter can be searched from a creation list, and an application entry where the configuration information is located is an application entry corresponding to the installation package query parameter.
S260, if the number of the application items is consistent with the number of the installation packages, acquiring the identity information of the installation packages to be acquired from the application items, determining the installation package query information according to the identity information, and acquiring the configuration information and the storage path from the application items according to the installation package query information.
If the number of application entries is consistent with the number of installation packages, this indicates that the installation package query parameter at this time is an effective parameter, thus, identification (id) information of the installation package to be acquired may be obtained from the screened application entries, and according to the identification information, the installation package query information may be constructed, so that, according to the constructed installation package query information, configuration information and a storage path of the installation package to be acquired may be obtained from the application entries that satisfy the query condition (i.e., the installation package query parameter).
S270, acquiring an installation package to be acquired from the database based on the storage path, converting the installation package to be acquired and the configuration information, and packaging the conversion result.
After the storage path of the installation package to be acquired is acquired, the installation package to be acquired can be acquired from the database according to the storage path. On the basis, the installation package to be acquired and the configuration information thereof can be converted, and the conversion result is packaged and then output. On the basis, optionally, after the conversion result is packaged, the packaging result can be automatically serialized into data in a JSON format based on a preset serialization annotation arranged in the installation package query function, and then the data in the JSON format is output.
S280, obtaining the installation package to be obtained according to the output result of the installation package obtaining function.
According to the technical scheme, the quantity of the installation packages to be acquired is determined through the installation package query parameters, the application items matched with the installation package query parameters are screened out from the created list, when the quantity of the application items is consistent with the quantity of the installation packages, the installation package query parameters are effective parameters, the identity identification information of the installation packages to be acquired can be acquired from the application items, so that the installation package query information is determined according to the identity identification information, the configuration information and the storage path are acquired from the application items according to the installation package query information, the installation packages to be acquired can be acquired from the database based on the storage path, the installation packages to be acquired and the configuration information are converted, and the conversion results are packaged, so that the effect of effective query of the installation packages to be acquired, which are matched with the installation package query parameters, is achieved.
Example III
Fig. 3 is a flowchart of an installation package obtaining method provided in the third embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, the signature verification function is optionally implemented by converting the installation package query parameter into a first query parameter and converting the first query parameter into a second query parameter, where the type of the installation package query parameter is Object, the type of the first query parameter is Map, the type of the second query parameter is List < String >, sorting the second query parameter based on a preset sorting function and packaging the sorting result into a preset package Object, where the type of the preset package Object includes a String builder, generating a signature verification result based on the preset package Object via a message digest algorithm, and determining whether the signature verification result and the Object signature parameter are consistent, if yes, the signature verification is successful, and if not, the signature verification is failed. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 3, the method of this embodiment may specifically include the following steps:
S310, acquiring installation package acquisition parameters corresponding to a triggering event when the triggering event of acquiring the installation package is monitored, wherein the installation package acquisition parameters comprise installation package query parameters of the installation package to be acquired and object signature parameters of an installation package acquisition object.
S320, calling the constructed installation package acquisition function by taking the installation package acquisition parameters as the parameter entry parameters, so that the installation package acquisition function executes S330-S360 according to the installation package acquisition parameters.
S330, decrypting the query parameters of the installation package, and updating the query parameters of the installation package according to the decryption result.
S340, converting the query parameters of the installation package into first query parameters, converting the first query parameters into second query parameters, sorting the second query parameters based on a preset sorting function, and packaging the sorting result into a preset packaging object.
The type of the query parameter of the installation package is Object, the type of the first query parameter is Map, and the purpose of converting the query parameter of the installation package into the first query parameter is that the first query parameter of the Map type has higher efficiency of removing data, so that the execution efficiency of a program can be effectively improved. On the basis, optionally, considering that some parameters to be removed which are irrelevant to signature verification may be related in the query parameters of the installation package, the parameters to be removed in the first query parameters can be removed, the accuracy of subsequent signature verification is improved due to the effective removal of the parameters to be removed, and the first query parameters are updated according to the removal result.
Furthermore, the first query parameters are converted into second query parameters with the type of List < String >, and the aim of the arrangement is that the data sorting is a step which must be executed before signature verification, the sorting efficiency of the Map type first query parameters is very low, the sorting efficiency of the List < String > type second query parameters can be effectively improved, and preparation conditions are prepared for subsequent signature verification. On the basis, optionally, the second query parameter is subjected to evacuation processing based on a preset evacuation processing function, the second query parameter is updated according to the evacuation processing result, and the accuracy of subsequent signature verification is improved through the second query parameter after the evacuation processing. Still further, the sorting result is packaged into a preset packaging object of which the type is StringBuilder.
S350, generating a signature verification result based on a preset packaged object through a message digest algorithm, and if the signature verification result is consistent with the object signature parameters, performing signature verification successfully, otherwise, performing signature verification failure.
The method comprises the steps of calculating a preset encapsulation object based on a message digest Algorithm (MESSAGE DIGEST Algorithm, MD), generating a signature verification result, and determining whether signature verification is successful according to whether the signature verification result is consistent with object signature parameters. On this basis, the message digest algorithm may optionally be a fifth version of the message digest algorithm (MD 5).
S360, if signature verification is successful, calling the constructed installation package query function by taking the installation package query parameter as the parameter entry parameter, and obtaining the installation package to be obtained according to the output result of the installation package query function.
S370, obtaining the installation package to be obtained according to the output result of the installation package obtaining function.
According to the technical scheme, the query parameters of the installation package with the type of Object are converted into the first query parameters with the type of Map, and then the first query parameters are converted into the second query parameters with the type of List < String >, so that the second query parameters can be sequenced based on a preset sequencing function, and the sequencing result is packaged into a preset packaging Object with the type of StringBuilder, further, a signature verification result can be generated based on the preset packaging Object through a message digest algorithm, and whether signature verification is successful or not is determined according to whether the signature verification result is consistent with the Object signature parameters, so that the effect of accurate signature verification is achieved.
In order to better understand the specific implementation procedure of the above steps, an exemplary description will be given below of the installation package acquisition method of the present embodiment in conjunction with specific examples. Illustratively, a specific form of the installation package acquisition function is shown below :public CommonResult<ListRes<AppPageVo>>pagelist(PageParam appQueryReq,String sign)throws VenusException,, where pagelist is the function name of the installation package acquisition function, appQueryReq is the installation package query parameter, sign is the object signature parameter. pagelist the internal implementation is as follows:
Before the installation package acquisition function is realized, legal signature verification of both parties is customized on a calling party (namely, an installation package acquisition object), so that the safety of data can be effectively ensured. Specifically, in order to implement signature verification, a signature verification function may be customized, where private boolean checkAuth (Object dto, STRING SECRET, string accessToken) throws VenusException is shown, dto is an installation packet acquisition object to be verified, secret is a verification key, accessToken is token data carried by the installation packet acquisition object, a return value of the signature verification function is a variable of a bootan type, true indicates that verification is successful, and false indicates that verification is failed. The specific implementation process of the signature verification function is as follows:
Firstly, defining a Map < String > params, receiving the installation package acquisition parameters by the object, and then converting dto objects into params objects by calling params=org. Considering that some parameters to be removed which are irrelevant to signature verification may be carried in the installation package acquisition parameters, the parameters to be removed may be removed, and the removal logic is as follows:
params.remove("access_token");
params.remove("class");
params.remove("operatorId");
params.remove("operatorName");
params.remove("sign");
params.remove("page");
params.remove("numPerPage");
params.remove("pageStartNum");
params.remove("accessDataSql");
next by calling List<String>signParams=params.entrySet().stream().filter(e->Objects.nonNull(e.getKey())&&Objects.nonNull(e.getValue()))
Map (e- > e.getKey ()) collect (collectors.tolist ())), emptying the objects in the params, and converting them into a List < String > SIGNPARAMS object by calling collectors.tolist (). The advantage of this is that params is a map type object that is more efficient in removing data, and that the main goal of converting param objects to SIGNPARAMS objects is to remove all empty data and to make ordering preparations for subsequent signature verification. The sorting efficiency of Map is very low, so that the sorting efficiency can be effectively improved after SIGNPARAMS is converted.
Next by calling signalparams. Sort (); the SIGNPARAMS sets are ordered naturally, which is alphabetically. Next by calling
The ordered data is encapsulated into stringBuilder objects, which does not cause additional memory overhead.
The MD5 information is then calculated by calling String realAuth =digestulils.md5hex (stringbuilding.tostring ()) toLowerCase ()), generating the final signature verification result realAuth. By calling return string links.equality (), accesstoken.tolowercase ()), a determination is made as to whether realAuth and accessToken are equal, if equal, the verification is successful, otherwise the verification fails.
Returning to the implementation of pagelist functions, firstly, a user-defined signature verification function boolean signResult = checkAuth (appQueryReq, SIGN _key, SIGN) is called to realize validity detection, then the detection result is judged through the following functions of if (| signResult) { throw new VenusException (ERROR_SIGN_ERROR, signature failure ") } if the detection result fails, an exception is thrown out, a subsequent flow is ended, and if the detection result is successful, a subsequent flow is executed.
Next, obtaining the installation package to be obtained by calling an installation package query function, wherein the specific form of the installation package query function is ListRes < AppPageVo > res=appservice. Page List (appQueryReq), and the specific implementation process of the appservice. Page List (appQueryReq) is as follows, namely, firstly, obtaining the number of the installation packages to be obtained by calling int count=appmap. Count (appQueryReq), secondly, obtaining all application items apps by calling List < App > apps=appmap. Page List (appQueryReq), and finally, obtaining all application items apps by calling if (collecti. Isempty (apps)) }
return new ListRes(appQueryReq,count,Lists.newArrayList());
It is determined whether the installation package query parameter is abnormal data. Then, by calling List < inter > ids=apps.stream (). Map (x- > { return x.getid ();}) collect (collectors.tolist ())), obtaining all the identification information (id) in app, and constructing the installation package query information by the following contents:
Map<String,Object>params=new HashMap<>();
params.put("ids",ids);
params.put("confKey",
AppConfKeyEnum.SILENCE_UPGRADE.getKey());
Configuration information of the app is then obtained by calling List < AppConf > appConfs = appconfmapper.select byappids (params), such as the rest of the configuration information is obtained by id. By calling
List<AppPageVo>appVos=apps.stream().map(x->{
return convert2Vo(x,appConfs);
}).collect(Collectors.toList())
Data conversion is realized, then return NEW LISTRES (appQueryReq, count, appVos) is called, and the converted data is packaged and returned. Finally, the data output by the installation package query function is packaged and returned through calling return new CommonResult < > (constant. SUC_ CODE, constant.SUC _MSG, res).
Example IV
Fig. 4 is a block diagram of an installation package obtaining apparatus according to a fourth embodiment of the present invention, where the installation package obtaining apparatus is configured to perform the installation package obtaining method according to any of the above embodiments. The device and the installation package acquisition method of the above embodiments belong to the same inventive concept, and reference may be made to the above embodiments of the installation package acquisition method for details that are not described in detail in the embodiments of the installation package acquisition device. Referring to fig. 4, the apparatus may specifically include an installation package acquisition parameter acquisition module 410 and an installation package to be acquired acquisition module 420.
The installation package acquisition parameter acquisition module 410 is configured to acquire an installation package acquisition parameter corresponding to a trigger event when the trigger event for acquiring the installation package is monitored, where the installation package acquisition parameter includes an installation package query parameter of an installation package to be acquired and an object signature parameter of an installation package acquisition object;
The to-be-acquired installation package obtaining module 420 is configured to call the constructed installation package obtaining function by using the installation package obtaining parameter as the parameter, and obtain the to-be-acquired installation package according to the output result of the installation package obtaining function, where the installation package obtaining function implements the installation package obtaining function through the following submodule:
The installation package query parameter decryption sub-module 4201 is configured to obtain access token information, decrypt the installation package query parameter based on the access token information, and update the installation package query parameter according to a decryption result;
the signature verification judging submodule 4202 is configured to transfer the installation package acquisition parameter to the constructed signature verification function, and judge whether the signature verification is successful according to the output result of the signature verification function;
And a to-be-acquired installation package obtaining submodule 4203, configured to call the constructed installation package query function with the installation package query parameter as the parameter entry parameter if yes, and obtain the to-be-acquired installation package according to the output result of the installation package query function.
Optionally, the installation package query function implements the installation package query function by:
The application item screening unit is used for determining the quantity of the installation packages to be acquired according to the installation package query parameters, and screening application items matched with the installation package query parameters from the created list, wherein the storage paths and the configuration information of the installation packages to be acquired are recorded in the application items;
The identity information acquisition unit is used for acquiring the identity information of the installation package to be acquired from the application items if the number of the application items is consistent with the number of the installation packages;
The storage path acquisition unit is used for determining the query information of the installation package according to the identity identification information and acquiring the configuration information and the storage path from the application item according to the query information of the installation package;
The first encapsulation unit is used for acquiring the installation package to be acquired from the database based on the storage path, converting the installation package to be acquired and the configuration information, and encapsulating the conversion result.
Optionally, the above installation package query function may further implement an installation package query function through the following units:
and the serialization unit is used for automatically serializing the encapsulation result into data in a preset format based on the preset serialization annotation arranged in the installation package query function, wherein the preset format comprises a JSON format.
Alternatively, the signature verification function may implement the signature verification function by:
The parameter conversion unit is used for converting the query parameters of the installation package into first query parameters and converting the first query parameters into second query parameters, wherein the type of the query parameters of the installation package is an Object type, the type of the first query parameters is a Map type, and the type of the second query parameters is a List < String > type;
the second packaging unit is used for sorting the second query parameters based on a preset sorting function, packaging the sorting result into a preset packaging object, wherein the type of the preset packaging object comprises a StringBuilder type;
The signature verification unit is used for generating a signature verification result based on a preset packaging object through a message digest algorithm, judging whether the signature verification result is consistent with the object signature parameters, if so, performing signature verification successfully, and if not, performing signature verification failure.
Optionally, the signature verification function may implement a signature verification function through the following units:
The removing unit is used for removing the parameters to be removed in the first query parameters and updating the first query parameters according to the removing result, wherein the parameters to be removed are parameters irrelevant to a message digest algorithm;
and the draining unit is used for draining the second query parameter based on a preset draining function and updating the second query parameter according to the draining result.
Optionally, the type of installation package query parameters includes PAGEPARAM types, wherein the description information of PAGEPARAM includes at least one of a database page number, a per page entry number, and a database paging parameter, and/or the installation package query parameters include an application name, and an application channel and/or an application version number, and/or the type of parameter of the installation package get function includes CommonResult < ListRes < AppPageVo > > types, wherein ListRes < AppPageVo > is a generic parameter of CommonResult, and AppPageVo is a generic parameter of ListRes.
Alternatively, the installation package obtaining function may be set in an installation package obtaining class, and at least one of the following preset annotations may be set on the installation package obtaining class:
A first preset annotation for indicating that the installation package acquisition class is a control class;
a second preset annotation for representing path information for accessing the install package acquisition class;
A third preset annotation for indicating that the installation package acquisition class implements log injection at a preset speed, and
A fourth preset annotation indicating that the installation package acquisition class implements cross-service access.
According to the installation package acquisition device provided by the fourth embodiment of the invention, when the triggering event of acquiring the installation package is monitored, the installation package acquisition parameter acquisition module and the installation package acquisition module to be acquired are mutually matched, the installation package acquisition parameter corresponding to the triggering event is taken as the parameter entry parameter, the constructed installation package acquisition function is called, so that the installation package acquisition function decrypts the installation package query parameter, the installation package query parameter is updated according to the decryption result, the installation package acquisition parameter is further transmitted to the constructed signature verification function, and when the signature verification is determined to be successful according to the output result of the signature verification function, the installation package query parameter is transmitted to the constructed installation package query function, and at the moment, the output result of the installation package query function is the output result of the installation package acquisition function, so that the corresponding installation package to be acquired can be obtained according to the output result of the installation package acquisition function. The device automatically acquires the installation package to be acquired, which is matched with the acquisition parameters of the installation package, based on the acquisition function of the installation package, solves the problem that the acquisition efficiency of the installation package is lower, and achieves the effect of automatically and rapidly acquiring the installation package.
The installation package acquisition device provided by the embodiment of the invention can execute the installation package acquisition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the embodiment of the installation package obtaining device, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented, and the specific names of the functional units are only for convenience of distinguishing each other, and are not used for limiting the protection scope of the present invention.
Example five
Fig. 5 is a schematic structural diagram of an apparatus according to a fifth embodiment of the present invention, and as shown in fig. 5, the apparatus includes a memory 510, a processor 520, an input device 530, and an output device 540. The number of processors 520 in the device may be one or more, one processor 520 being illustrated in fig. 5, and the memory 510, the processor 520, the input means 530 and the output means 540 in the device may be connected by a bus or other means, illustrated in fig. 5 as being connected by a bus 550.
The memory 510 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and a module, such as program instructions/modules corresponding to the installation package obtaining method in the embodiment of the present invention (for example, an installation package obtaining parameter obtaining module 410 and an installation package obtaining module 420 to be obtained in the installation package obtaining device). The processor 520 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory 510, i.e., implements the installation package acquisition method described above.
The memory 510 may mainly include a storage program area that may store an operating system, application programs required for at least one function, and a storage data area that may store data created according to the use of the device, etc. In addition, memory 510 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 510 may further include memory located remotely from processor 520, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 530 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output 540 may include a display device such as a display screen.
Example six
A sixth embodiment of the present invention provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing an installation package acquisition method, comprising:
When a triggering event of acquiring an installation package is monitored, acquiring an installation package acquisition parameter corresponding to the triggering event, wherein the installation package acquisition parameter comprises an installation package query parameter of the installation package to be acquired and an object signature parameter of an installation package acquisition object;
taking the installation package acquisition parameters as the parameter entry parameters, calling the constructed installation package acquisition function, and obtaining an installation package to be acquired according to the output result of the installation package acquisition function;
wherein, the installation package acquisition function realizes the installation package acquisition function through the following steps:
Decrypting the query parameters of the installation package, and updating the query parameters of the installation package according to the decryption result;
transmitting the acquired parameters of the installation package to the constructed signature verification function, and judging whether the signature verification is successful or not according to the output result of the signature verification function;
If so, calling the constructed installation package query function by taking the installation package query parameter as the parameter entry parameter, and obtaining the installation package to be obtained according to the output result of the installation package query function.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform the related operations in the installation package obtaining method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. In light of such understanding, the technical solution of the present invention may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), FLASH Memory (FLASH), hard disk, optical disk, or the like, of a computer, which may be a personal computer, a server, a network device, or the like, including instructions for causing a computer device (which may be a personal computer, a server, or the like) to perform the methods described in the various embodiments of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

CN202010582394.1A2020-06-232020-06-23 Installation package acquisition method, device, equipment and storage mediumActiveCN113835717B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010582394.1ACN113835717B (en)2020-06-232020-06-23 Installation package acquisition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010582394.1ACN113835717B (en)2020-06-232020-06-23 Installation package acquisition method, device, equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN113835717A CN113835717A (en)2021-12-24
CN113835717Btrue CN113835717B (en)2025-02-25

Family

ID=78964150

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010582394.1AActiveCN113835717B (en)2020-06-232020-06-23 Installation package acquisition method, device, equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN113835717B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106453448A (en)*2015-08-062017-02-22北京奇虎科技有限公司Method for downloading target file and device thereof

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8832676B2 (en)*2009-09-302014-09-09Zynga Inc.Apparatuses, methods and systems for a social networking application updater
CN103019722B (en)*2012-12-142016-03-30北京中电普华信息技术有限公司A kind of method and device extracting Java network application AKU
US20160132420A1 (en)*2014-11-102016-05-12Institute For Information IndustryBackup method, pre-testing method for environment updating and system thereof
CN106293779B (en)*2015-05-112019-11-08广州爱九游信息技术有限公司A kind of method and device identifying application installation package
US10303458B2 (en)*2016-09-292019-05-28Hewlett Packard Enterprise Development LpMulti-platform installer
CN106599017B (en)*2016-10-202019-09-17广州优视网络科技有限公司Scanning analytic method, device and the mobile terminal of installation kit
CN109343968B (en)*2018-08-022020-09-04武汉斗鱼网络科技有限公司Method and related device for acquiring data
CN114662159A (en)*2018-10-262022-06-24蚂蚁双链科技(上海)有限公司Data processing method, device and equipment
CN110298018B (en)*2019-05-142023-07-07深圳市雄帝科技股份有限公司Text data processing method, device, computer equipment and storage medium
CN110516172B (en)*2019-07-312022-06-03深圳市铭数信息有限公司Resource calling method and device, computer equipment and storage medium
CN110830559B (en)*2019-10-242022-08-09北京城市网邻信息技术有限公司Channel package automatic batch processing method, device, equipment and storage medium
CN110990022A (en)*2019-11-292020-04-10上海庆科信息技术有限公司Software project development method and device, processor and electronic device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106453448A (en)*2015-08-062017-02-22北京奇虎科技有限公司Method for downloading target file and device thereof

Also Published As

Publication numberPublication date
CN113835717A (en)2021-12-24

Similar Documents

PublicationPublication DateTitle
US20250150469A1 (en)Detection of replacement/copy-paste attacks through monitoring and classifying api function invocations
CN109933629B (en)Data synchronization method and device, computer equipment and readable storage medium
CN108881265B (en)Network attack detection method and system based on artificial intelligence
US9253154B2 (en)Configuration management for a capture/registration system
US10574658B2 (en)Information security apparatus and methods for credential dump authenticity verification
US20160134495A1 (en)Logging device and log aggregation device
CN114357189B (en) A method, device, equipment and storage medium for determining vulnerability exploitation relationship
CN107239381A (en)The processing method of crash info, apparatus and system
CN108764902B (en)Method, node and blockchain system for storing data
CN114208114B (en)Multi-view security context per participant
CN112711496A (en)Log information full link tracking method and device, computer equipment and storage medium
CN112232957A (en) Transaction consensus method, device and electronic device
CN108848079A (en) Method, system, device and computer system for realizing information verification
CN105184559A (en)System and method for payment
CN111464312A (en)Method and device for processing account address in block chain and electronic equipment
CN113835717B (en) Installation package acquisition method, device, equipment and storage medium
CN111814204B (en)Block chain-based data consensus method, related equipment and storage medium
KR102393913B1 (en)Apparatus and method for detecting abnormal behavior and system having the same
CN111367867B (en)Log information processing method and device, electronic equipment and storage medium
CN110958267B (en) A method and system for monitoring internal threat behavior in a virtual network
CN113169900B (en)Method and device for tracking service execution process in distributed system
CN111026423A (en)Software upgrading method, device, equipment and storage medium
CN111786938A (en)Method, system and electronic equipment for preventing malicious resource acquisition
CN107026739B (en) SMS signature authentication method and device
CN115114361A (en)Resource retrieval method and system based on container cloud platform unified interface

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp