CN113448584B - APP version management method, device, medium and computer equipment - Google Patents

APP version management method, device, medium and computer equipment Download PDF

Info

Publication number
CN113448584B
CN113448584B CN202010216550.2A CN202010216550A CN113448584B CN 113448584 B CN113448584 B CN 113448584B CN 202010216550 A CN202010216550 A CN 202010216550A CN 113448584 B CN113448584 B CN 113448584B
Authority
CN
China
Prior art keywords
version
version number
added
app
query
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
CN202010216550.2A
Other languages
Chinese (zh)
Other versions
CN113448584A (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.)
Zhejiang Manqu Technology Co ltd
Original Assignee
Zhejiang Manqu 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 Zhejiang Manqu Technology Co ltd filed Critical Zhejiang Manqu Technology Co ltd
Priority to CN202010216550.2A priority Critical patent/CN113448584B/en
Publication of CN113448584A publication Critical patent/CN113448584A/en
Application granted granted Critical
Publication of CN113448584B publication Critical patent/CN113448584B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides an APP version management method, an APP version management device, a medium and computer equipment, comprising the following steps: judging whether a target application program APP exists or not; if the target APP exists, judging whether the version number to be added of the target APP exists or not; if the version number to be added of the target APP does not exist, constructing an entity object based on the entity class; based on the entity object, version information corresponding to the version number to be added is obtained, and the version information corresponding to the version number to be added is written into a corresponding field in the entity class; inserting each field information in the entity class into a corresponding database table in the database; therefore, when the target APP has a new version to be added and the latest version of the target APP does not exist in the system, version information of the version to be added can be obtained based on a preset entity class, and then the version information is inserted into the database, so that manual participation is not needed, the insertion efficiency is improved, and the safety and the effectiveness of data can be ensured.

Description

APP version management method, device, medium and computer equipment
Technical Field
The invention belongs to the technical field of Internet, and particularly relates to an APP version management method, an APP version management device, an APP version management medium and computer equipment.
Background
APP refers to a third party application program installed on a mobile terminal such as a smart phone, and in an IOS system, in order to enable the APP to achieve more functions, different requirements are met, and new versions of the APP can be continuously researched and developed.
When a new version of the APP needs to be added into a database for downloading and updating by a user, the prior art generally adds the information of the new version into the database manually, which not only results in lower efficiency, but also ensures the safety and effectiveness of the data.
Disclosure of Invention
Aiming at the problems existing in the prior art, the embodiment of the invention provides an APP version management method, an APP version management device, an APP version management medium and an APP version management computer, which are used for solving the technical problems that in the prior art, new version APP information is manually added into a database for downloading by a user, so that the efficiency is low and the data security is not guaranteed.
The invention provides an APP version management method, which comprises the following steps:
judging whether a target application program APP exists or not;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation;
Based on the entity object, version information corresponding to the version number to be added is obtained, and the version information corresponding to the version number to be added is written into a corresponding field in the entity class by utilizing an Object Relation Mapping (ORM) framework;
inserting each field information in the entity class into a corresponding database table in a database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added.
Optionally, the determining whether the target APP exists includes:
constructing a first query object by using an object construction function;
invoking an object generation method in the query object to generate a conditional query object;
generating a query condition based on the ID of the target APP, and transmitting the query condition into the query object;
invoking a first execution method in a mapping object to execute query logic in the first query object to obtain a first query result, and storing the first query result into a preset first result set;
judging whether the value in the first result set is larger than 0, and if the value in the first result set is larger than 0, determining that the target APP exists.
Optionally, the continuing to determine whether the version number to be added of the target APP exists includes:
constructing a second query object by using the new keyword, wherein the second query object is used for querying all version numbers of the target APP;
invoking a second execution method in the mapping object to execute the query logic in the second query object to obtain a second result set;
calling a stream function to construct a stream object, and calling a filtering method in the stream object to filter elements in the second result set to obtain a third result set;
judging whether the value of the third result set is larger than 0, and if the value of the third result set is smaller than 0, determining that the version number to be added of the target APP does not exist.
Optionally, the calling the filtering method in the flow object filters elements in the second result set to obtain a third result set, including:
traversing the second result set, and filtering elements in the second result set by using a preset lambda expression to obtain each version number of the target APP;
calling a version number acquisition method to acquire all formal version numbers and all compiled version numbers of the target APP;
Judging whether the obtained formal version number is consistent with a preset formal version number to be added or not, and judging whether the obtained compiling version number is consistent with the preset compiling version number to be added or not;
and if the obtained formal version number is consistent with the preset formal version number to be added and the obtained compiling version number is consistent with the preset compiling version number to be added, adding the obtained formal version number and the obtained compiling version number into a preset third result set.
Optionally, if it is determined that the version number to be added of the target APP does not exist, before the entity object is built based on the pre-built entity class, the method includes:
acquiring data information in a preset version information table structure; the data information includes: the version information table structure comprises an ID of the APP, application coding information of the APP, a formal version number of the APP and a compiled version number of the APP;
creating corresponding field information in the entity class based on a preset mapping rule and data information in the version information table structure;
and marking the class name of the entity class by using an annotation mark corresponding to the annotation.
Optionally, if the value of the third result set is greater than 0, the method further includes:
sending abnormal prompt information and ending the flow, wherein the abnormal prompt information comprises the following steps: the version number to be added already exists.
The invention also provides an APP version management device, which comprises:
the judging unit is used for judging whether the target application program APP exists or not;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
the construction unit is used for constructing an entity object based on a pre-constructed entity class if the version number to be added of the target APP does not exist, and the bearing logic of the entity class is realized according to a preset annotation;
the acquisition unit is used for acquiring the version information corresponding to the version number to be added based on the entity object, and writing the version information corresponding to the version number to be added into a corresponding field in the entity class by utilizing an ORM framework;
the inserting unit is used for inserting the field information in the entity class into a corresponding database table in the database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added.
Optionally, the judging unit is specifically configured to:
constructing a first query object by using an object construction function;
invoking an object generation method in the query object to generate a conditional query object;
generating a query condition based on the ID of the target APP, and transmitting the query condition into the query object;
invoking a first execution method in a mapping object to execute query logic in the first query object to obtain a first query result, and storing the first query result into a preset first result set;
judging whether the value in the first result set is larger than 0, and if the value in the first result set is larger than 0, determining that the target APP exists.
The invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of any of the above.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the preceding claims when executing the program.
The invention provides an APP version management method, an APP version management device, a medium and computer equipment, wherein the method comprises the following steps: judging whether a target application program APP exists or not; if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not; if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation; based on the entity object, version information corresponding to the version number to be added is obtained, and the version information corresponding to the version number to be added is written into a corresponding field in the entity class by utilizing an object relation mapping (ORM, object Relational Mapping) framework; inserting each field information in the entity class into a corresponding database table in a database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added; thus, when the target APP has a new version to be added and the latest version of the target APP does not exist in the system, version information of the version to be added can be obtained based on a preset entity class, and then the version information is inserted into the database, so that manual participation is not needed, the insertion efficiency is improved, and the safety and the effectiveness of data can be ensured; in addition, the load logic of the entity class in the application is realized according to the preset annotation, and the method for acquiring the data is directly provided in the annotation, so that when version information is acquired, each data acquisition method is not required to be independently called, the code length of the entity class is simplified, and further, the APP is more convenient to manage.
Drawings
FIG. 1 is a schematic flow chart of an APP version management method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an APP version management device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device for parsing a log file according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a computer medium structure for parsing a log file according to an embodiment of the present application.
Detailed Description
In order to solve the technical problems that in the prior art, the efficiency is low and the data security cannot be ensured due to the fact that new version APP information is manually added into a database for downloading by a user, the embodiment of the invention provides an APP version management method, an APP version management device, an APP version management medium and computer equipment.
The technical scheme of the invention is further described in detail through the attached drawings and specific embodiments.
Example 1
The embodiment provides an APP version management method, which is applied to an IOS system, when a certain APP has a new version, the addition of the new version of the APP is completed through a preset addition function in the embodiment, and when a target APP has the new version, the addition is completed through the addition function.
Here, the adding function specifically includes: public boolean addAppVersion (Integer appId, string versionCode, string buildVersionCode) {
}
It can be seen that the addition function has 3 parameter parameters, respectively: APP ID, an ID of APP; refer to the formal version number version code of the version to be added and the compiled version number buildversion code of the version to be added.
Here, it is generally necessary to compile a new version before the version is completed to test the new version, but the version number is changed after each compilation, which results in a confusing management of the version number. Therefore, the present embodiment splits the version number into a formal version number, which can be understood as a total version number (e.g., 5.0.1 version number), and a compiled version number, which can be understood as a sub-version number included under the formal version number (5.0.1.1). For example, after the first compiling, the formal version number is 5.0.1, and the compiling version number is 5.0.1.1; after the first compiling, the formal version number is still 5.0.1, and the compiling version number is 5.0.1.2; therefore, the version number is more convenient to manage, and only the compiled version number is changed during compiling, so that frequent changes of the formal version number are avoided.
The specific implementation method of adding the function in this embodiment may be as shown in fig. 1, where the method includes:
S110, judging whether a target application program APP exists or not;
firstly, before the new version of the target APP is inserted, whether the target application APP exists or not needs to be judged, and if so, the subsequent version information insertion flow can be carried out.
As an alternative embodiment, the determining whether the target APP exists includes:
constructing a first query object by using an object construction function;
invoking an object generation method in the query object to generate a conditional query object;
generating a query condition based on the ID of the target APP, and transmitting the query condition into the query object;
invoking a first execution method in a mapping object to execute query logic in the first query object to obtain a first query result, and storing the first query result into a preset first result set;
judging whether the value in the result set is larger than 0, and if the value in the result set is larger than 0, determining that the target APP exists.
Specifically, the object construction function IosAppReleaseExample iosAppReleaseExample = new IosAppReleaseExample (); constructing a first query object iosapp releaseexample; calling a query method createcriterion () in a first query object iosapp releaseExample to obtain a conditional query object, wherein the conditional query object is a criterion object; the query condition appId is passed into the query object using the conditional addition method andAppIdEqualTo (appId). Wherein the query condition is generated according to the ID of the target APP, i.e. the ID appId of the target APP in the query condition is the same as the parameter appId in the add function.
And calling a first execution method selectByExample (iosAppReleaseExample) in the mapping object iosapp releasemapper to execute query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set appList.
And (3) calling a judging function appList.size () to judge the size of the appList, and if the value in the appList is larger than 0, indicating that the information of the target APP is queried, determining that the target APP exists.
If the value in the appList is equal to 0, which indicates that the information of the target APP is not queried, determining that the target APP does not exist.
Further, if the target APP does not exist, the sending function throw new VenusException (400) is used to send an exception prompt message, where the exception prompt message may be "target APP does not add", and then the adding process is ended.
S111, if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
if the target APP exists, whether the version number to be added of the target APP exists or not needs to be continuously judged, and if the version number to be added of the target APP exists, a subsequent version information adding process is not required to be executed.
As an optional embodiment, the continuing to determine whether the version number to be added of the target APP exists includes:
Constructing a second query object by using the new keyword, wherein the second query object is used for querying all version numbers of the target APP;
invoking a second execution method in the mapping object to execute the query logic in the second query object to obtain a second result set;
calling a stream function to construct a stream object, and calling a filtering method in the stream object to filter elements in the second result set to obtain a third result set;
judging whether the value of the third result set is larger than 0, and if the value of the third result set is smaller than 0, determining that the version number to be added of the target APP does not exist.
As an optional embodiment, the calling the filtering method in the stream object to filter the elements in the second result set to obtain a third result set includes:
traversing the second result set, and filtering elements in the second result set by using a preset lambda expression to obtain each version number of the target APP;
calling a version number acquisition method to acquire all formal version numbers and all current compiling version numbers of the target APP;
judging whether the obtained formal version number is consistent with a preset formal version number to be added or not, and judging whether the obtained compiling version number is consistent with the preset compiling version number to be added or not;
And if the obtained formal version number is consistent with the preset formal version number to be added and the obtained compiling version number is consistent with the preset compiling version number to be added, adding the obtained formal version number and compiling version number into a preset third result set.
Specifically, the new keyword new is utilized to construct a second query object iosversion example, and the implementation mode of the new keyword new is as follows: iosVersionExample iosVersionExample = new IosVersionExample (). The second query object iosversion sample does not contain any query condition, so that all version numbers of the target APP can be queried by unconditional restriction.
And calling a second execution method iosversionmapper.select byexample (iosVersionExample) in the mapping object to execute the query logic in the second query object, and obtaining a second result set iosVersionList after the query is completed.
Then, it is required to determine whether a version number corresponding to the parameter in the function is added in the second result set, where the version number corresponding to the parameter includes: the formal version number and compiled version number of the target APP. The realization is as follows:
in order to improve judging efficiency, the method judges through a flow function. Comprising the following steps: calling a stream function iosversion list, constructing a stream object stream, and calling a filter method in the stream object stream to filter elements in the second result set to obtain a third result set;
Here, the procedure of the filtering method filter is implemented as follows:
when filtering the elements in the second result set, traversing the second result set, and filtering the elements in the second result set by using a preset lambda expression to obtain each version number of the target APP, wherein each version number comprises: each formal version number and each compiled version number.
Here, since there may be a plurality of version numbers of the target APP, the calling version number acquisition method item. And comparing whether the obtained formal version number is consistent with a preset formal version number to be added or not by using a comparison function equivalent (), and comparing whether the obtained compiled version number is consistent with the preset compiled version number to be added or not.
And if the obtained formal version number is consistent with the preset formal version number to be added and the obtained compiling version number is consistent with the preset compiling version number to be added, returning true, and adding the obtained formal version number and compiling version number into a preset third result set.
And if the obtained formal version number is inconsistent with the preset formal version number to be added, and/or the obtained compiling version number is inconsistent with the preset compiling version number to be added, returning to false.
In this way, a third result set tmplaylist is obtained after filtering, and the function tmplaylist.size () is called to obtain the size of the third result set, if the value of the third result set is smaller than 0, it is determined that the version to be added of the target APP does not exist, and the subsequent adding function needs to be continuously executed.
If the value of the third result set is greater than 0, then it indicates that the version to be added already exists, at which point the send function throw new VenusException is called (400, "version number already exists"); and sending abnormal prompt information and ending the flow, wherein the abnormal prompt information comprises: the version to be added already exists.
S112, if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation;
if the version number to be added of the target APP does not exist, an entity object needs to be built based on a pre-built entity class, so that version information corresponding to the version number to be added can be obtained based on the entity object. The construction process is as follows:
IosVersion iosVersion=new IosVersion(appId,app.getAid(),versionCode,buildVersionCode);
In order to avoid that a plurality of codes need to be set in the entity class to acquire data when version information is acquired later, the codes in the entity class are long, and the installation package of the APP is enlarged, so that the management of the whole APP is further influenced. When version information Data needs to be acquired, the @ Data annotation provides a corresponding acquisition method (such as a set method, a get method and the like) to acquire the Data, so that code writing can be simplified, the length of the code can be shortened, and the management efficiency of the target APP can be improved.
Then the entity class needs to be built before building the entity object, as follows:
firstly, acquiring data information in a preset version information table structure;
the definition of the version information table structure is as follows:
as can be seen, the data information includes: the version information table comprises a main key ID of the version information table structure, an ID of the APP, application coding information of the APP, a formal version number of the APP and a compiling version number of the APP. The primary key ID is self-increasing and used for representing the uniqueness of the version information table structure.
Then, constructing an entity class, and creating corresponding field information in the entity class based on a preset mapping rule and data information in a version information table structure. The preset mapping rule may include: the underline of the data information in the version information table structure is deleted, and the first letter after the underline is set as an uppercase letter. The mapping method has the advantages that when the version information is obtained later, the version information can be directly written into the field information corresponding to the entity class by using the ORM framework, so that the efficiency is improved.
Finally, the class name of the entity class is marked by using the annotation mark corresponding to the annotation, so that the entity class is equivalent to an entity container class, and the frequent writing of the get, the set and other methods can be avoided when the data is acquired, and the entity class has the function of a version container.
The resulting entity class IosVersion is then as follows:
@Data
Class IosVersion{
Privat Integer id;
Private Integer appId;
Private String aid;
Private String versionCode;
Private String BuildVersionCode;
}
s113, based on the entity object, obtaining version information corresponding to the version number to be added, and writing the version information corresponding to the version number to be added into a corresponding field in the entity class by using an ORM framework;
after the entity object is constructed, as can be seen from step S112, the entity object is iosVersion, the parameter thereof is appId, app.getaid (), version code, buildwersion code, and then based on the parameter of the entity object, in the entity class, the Data corresponding to each parameter is obtained by using the obtaining method provided by the annotation @ Data, and the obtained Data is version information corresponding to the version number to be added. Then, the version information may include: the ID of the target APP, the application code of the version to be added, the formal version number of the version to be added and the compiled version number. Wherein the application encoding aid information may be obtained from the first result set appList.
After the version information corresponding to the version number to be added is obtained, the version information corresponding to the version number to be added is written into the corresponding field in the entity class by using the ORM framework.
S114, inserting each field information in the entity class into a corresponding database table in a database;
after the information of each field in the entity class is written, the information of each field in the entity class is inserted into a corresponding database table in the database by using an insertion function iosversionmapper. Therefore, the insertion of the new version of the target APP can be automatically completed without manual operation, and the insertion can be automatically checked, so that the operation efficiency is improved, and meanwhile, the safety and the effectiveness of data are also improved.
Based on the same inventive concept, the application also provides an APP version management device, and the details are shown in the second embodiment.
Example two
The present embodiment provides an APP version management device, as shown in fig. 2, including: a judging unit 21, a constructing unit 22, an acquiring unit 23, and an inserting unit 24; wherein, the liquid crystal display device comprises a liquid crystal display device,
a judging unit 21 for judging whether the target application APP exists;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
A construction unit 22, configured to construct an entity object based on a pre-constructed entity class if it is determined that the version number to be added of the target APP does not exist, where the load-bearing logic of the entity class is implemented according to a preset annotation;
an obtaining unit 23, configured to obtain version information corresponding to a version number to be added based on the entity object, and write the version information corresponding to the version number to be added into a corresponding field in the entity class by using the ORM framework;
an inserting unit 24, configured to insert each field information in the entity class into a corresponding database table in the database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number of the version to be added and the compiled version number.
Here, when a certain APP has a new version, in this embodiment, the addition of the new version of the APP is completed through a preset addition function, and when the target APP has a new version, the addition is also completed through the addition function.
Here, the adding function specifically includes: public boolean addAppVersion (Integer appId, string versionCode, string buildVersionCode) {
}
It can be seen that the addition function has 3 parameter parameters, respectively: APP ID, an ID of APP; refer to the formal version number version code of the version to be added and the compiled version number buildversion code of the version to be added.
Here, it is generally necessary to compile a new version before the version is completed to test the new version, but the version number is changed after each compilation, which results in a confusing management of the version number. Therefore, the present embodiment splits the version number into a formal version number, which can be understood as a total version number (e.g., 5.0.1 version number), and a compiled version number, which can be understood as a sub-version number included under the formal version number (5.0.1.1). For example, after the first compiling, the formal version number is 5.0.1, and the compiling version number is 5.0.1.1; after the first compiling, the formal version number is still 5.0.1, and the compiling version number is 5.0.1.2; therefore, the version number is more convenient to manage, and only the compiled version number is changed during compiling, so that frequent changes of the formal version number are avoided.
The specific implementation logic of the internal addition function in this embodiment is specifically as follows:
first, before inserting the new version of the target APP, the determining unit 21 needs to determine whether the target APP exists, and if so, the subsequent version information insertion process can be performed.
As an alternative embodiment, the judging unit 21 judges whether the target APP exists, including:
Constructing a first query object by using an object construction function;
invoking an object generation method in the query object to generate a conditional query object;
generating a query condition based on the ID of the target APP, and transmitting the query condition into the query object;
invoking a first execution method in a mapping object to execute query logic in the first query object to obtain a first query result, and storing the first query result into a preset first result set;
judging whether the value in the result set is larger than 0, and if the value in the result set is larger than 0, determining that the target APP exists.
Specifically, the object construction function IosAppReleaseExample iosAppReleaseExample = new IosAppReleaseExample (); constructing a first query object iosapp releaseexample; calling a query method createcriterion () in a first query object iosapp releaseExample to obtain a conditional query object, wherein the conditional query object is a criterion object; the query condition appId is passed into the query object using the conditional addition method andAppIdEqualTo (appId). Wherein the query condition is generated according to the ID of the target APP, i.e. the ID appId of the target APP in the query condition is the same as the parameter appId in the add function.
And calling a first execution method selectByExample (iosAppReleaseExample) in the mapping object iosapp releasemapper to execute query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set appList.
And (3) calling a judging function appList.size () to judge the size of the appList, and if the value in the appList is larger than 0, indicating that the information of the target APP is queried, determining that the target APP exists.
If the value in the appList is equal to 0, which indicates that the information of the target APP is not queried, determining that the target APP does not exist.
Further, if the target APP does not exist, the sending function throw new VenusException (400) is used to send an exception prompt message, where the exception prompt message may be "target APP does not add", and then the adding process is ended.
If it is determined that the target APP exists, the determining unit 21 further needs to continuously determine whether the version number to be added of the target APP exists, and if the version number to be added of the target APP already exists, it is not necessary to execute a subsequent version information adding procedure.
As an alternative embodiment, the determining unit 21 continues to determine whether the version number to be added of the target APP exists, including:
Constructing a second query object by using the new keyword, wherein the second query object is used for querying all version numbers of the target APP;
invoking a second execution method in the mapping object to execute the query logic in the second query object to obtain a second result set;
calling a stream function to construct a stream object, and calling a filtering method in the stream object to filter elements in the second result set to obtain a third result set;
judging whether the value of the third result set is larger than 0, and if the value of the third result set is smaller than 0, determining that the version number to be added of the target APP does not exist.
As an optional embodiment, the calling the filtering method in the stream object to filter the elements in the second result set to obtain a third result set includes:
traversing the second result set, and filtering elements in the second result set by using a preset lambda expression to obtain each version number of the target APP;
calling a version number acquisition method to acquire all formal version numbers and all current compiling version numbers of the target APP;
judging whether the obtained formal version number is consistent with a preset formal version number to be added or not, and judging whether the obtained compiling version number is consistent with the preset compiling version number to be added or not;
And if the obtained formal version number is consistent with the preset formal version number to be added and the obtained compiling version number is consistent with the preset compiling version number to be added, adding the obtained formal version number and compiling version number into a preset third result set.
Specifically, the new keyword new is utilized to construct a second query object iosversion example, and the implementation mode of the new keyword new is as follows: iosVersionExample iosVersionExample = new IosVersionExample (). The second query object iosversion sample does not contain any query condition, so that all version numbers of the target APP can be queried by unconditional restriction.
And calling a second execution method iosversionmapper.select byexample (iosVersionExample) in the mapping object to execute the query logic in the second query object, and obtaining a second result set iosVersionList after the query is completed.
Then, it is required to determine whether a version number corresponding to the parameter in the function is added in the second result set, where the version number corresponding to the parameter includes: the formal version number and compiled version number of the target APP. The realization is as follows:
in order to improve judging efficiency, the method judges through a flow function. Comprising the following steps: calling a stream function iosversion list, constructing a stream object stream, and calling a filter method in the stream object stream to filter elements in the second result set to obtain a third result set;
Here, the procedure of the filtering method filter is implemented as follows:
when filtering the elements in the second result set, traversing the second result set, and filtering the elements in the second result set by using a preset lambda expression to obtain each version number of the target APP, wherein each version number comprises: each formal version number and each compiled version number.
Here, since there may be a plurality of version numbers of the target APP, the calling version number acquisition method item. And comparing whether the obtained formal version number is consistent with a preset formal version number to be added or not by using a comparison function equivalent (), and comparing whether the obtained compiled version number is consistent with the preset compiled version number to be added or not.
And if the obtained formal version number is consistent with the preset formal version number to be added and the obtained compiling version number is consistent with the preset compiling version number to be added, returning true, and adding the obtained formal version number and compiling version number into a preset third result set.
And if the obtained formal version number is inconsistent with the preset formal version number to be added, and/or the obtained compiling version number is inconsistent with the preset compiling version number to be added, returning to false.
In this way, a third result set tmplaylist is obtained after filtering, and the function tmplaylist.size () is called to obtain the size of the third result set, if the value of the third result set is smaller than 0, it is determined that the version to be added of the target APP does not exist, and the subsequent adding function needs to be continuously executed.
If the value of the third result set is greater than 0, then it indicates that the version to be added already exists, at which point the send function throw new VenusException is called (400, "version number already exists"); and sending abnormal prompt information and ending the flow, wherein the abnormal prompt information comprises: the version to be added already exists.
If it is determined that the version number to be added of the target APP does not exist, the construction unit 22 needs to construct an entity object based on a pre-constructed entity class, so as to obtain version information corresponding to the version number to be added based on the entity object. The construction process is as follows:
IosVersion iosVersion=new IosVersion(appId,app.getAid(),versionCode,buildVersionCode);
in order to avoid that a plurality of codes need to be set in the entity class to acquire data when version information is acquired later, the codes in the entity class are long, and the installation package of the APP is enlarged, so that the management of the whole APP is further influenced. When version information Data needs to be acquired, the @ Data annotation provides a corresponding acquisition method (such as a set method, a get method and the like) to acquire the Data, so that code writing can be simplified, the length of the code can be shortened, and the management efficiency of the target APP can be improved.
The construction unit 22 needs to construct the entity class before constructing the entity object as follows:
firstly, acquiring data information in a preset version information table structure;
the definition of the version information table structure is as follows:
as can be seen, the data information includes: the version information table comprises a main key ID of the version information table structure, an ID of the APP, application coding information of the APP, a formal version number of the APP and a compiling version number of the APP. The primary key ID is self-increasing and used for representing the uniqueness of the version information table structure.
Then, constructing an entity class, and creating corresponding field information in the entity class based on a preset mapping rule and data information in a version information table structure. The preset mapping rule may include: the underline of the data information in the version information table structure is deleted, and the first letter after the underline is set as an uppercase letter. The mapping method has the advantages that when the version information is obtained later, the version information can be directly written into the field information corresponding to the entity class by using the ORM framework, so that the efficiency is improved.
Finally, the class name of the entity class is marked by using the annotation mark corresponding to the annotation, so that the entity class is equivalent to an entity container class, and the frequent writing of the get, the set and other methods can be avoided when the data is acquired, and the entity class has the function of a version container.
The resulting entity class IosVersion is then as follows:
@Data
Class IosVersion{
Privat Integer id;
Private Integer appId;
Private String aid;
Private String versionCode;
Private String BuildVersionCode;
}
after the entity object is constructed, as can be seen from the above description, the entity object is iosVersion, the parameter thereof is appId, app.getaid (), version code, buildwersion code, and then based on the parameter of the entity object, in the entity class, the obtaining unit 23 may obtain the Data corresponding to each parameter by using the obtaining method provided by the annotation @ Data, where the obtained Data is version information corresponding to the version number of the version to be added. Then, the version information may include: the ID of the target APP, the application code of the version to be added, the formal version number of the version to be added and the compiled version number. Wherein the application encoding aid information may be obtained from the first result set appList.
After the version information corresponding to the version number to be added is obtained, the version information corresponding to the version number to be added is written into the corresponding field in the entity class by using the ORM framework.
After writing the field information in the entity class, the inserting unit 24 is configured to insert the field information in the entity class into a corresponding database table in the database by using an insertion function iosversionmapper. Therefore, the insertion of the new version of the target APP can be automatically completed without manual operation, and the insertion can be automatically checked, so that the operation efficiency is improved, and meanwhile, the safety and the effectiveness of data are also improved.
The APP version management method and device provided by the embodiment of the invention have the following beneficial effects:
the invention provides an APP version management method, an APP version management device, a medium and computer equipment, wherein the method comprises the following steps: judging whether a target application program APP exists or not; if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not; if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation; based on the entity object, obtaining version information corresponding to the version number to be added, and writing the version information corresponding to the version number to be added into a corresponding field in the entity class by using an ORM framework; inserting each field information in the entity class into a corresponding database table in a database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added; thus, when the target APP has a new version to be added and the latest version of the target APP does not exist in the system, version information of the version to be added can be obtained based on a preset entity class, and then the version information is inserted into the database, so that manual participation is not needed, the insertion efficiency is improved, and the safety and the effectiveness of data can be ensured; in addition, the load logic of the entity class in the application is realized according to the preset annotation, and the method for acquiring the data is directly provided in the annotation, so that when version information is acquired, each data acquisition method is not required to be independently called, the code length of the entity class is simplified, and further, the APP is more convenient to manage.
Example III
The present embodiment provides a computer device, as shown in fig. 3, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and capable of running on the processor 320, wherein the processor 320 implements the following steps when executing the computer program 311:
judging whether a target application program APP exists or not;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation;
based on the entity object, obtaining version information corresponding to the version number to be added, and writing the version information corresponding to the version number to be added into a corresponding field in the entity class by using an ORM framework;
inserting each field information in the entity class into a corresponding database table in a database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added.
In a specific implementation, when the processor 320 executes the computer program 311, any implementation of the first embodiment may be implemented.
Since the computer device described in this embodiment is a device for implementing the method for parsing a log file in the first embodiment of the present application, those skilled in the art will be able to understand the specific implementation of the computer device and various modifications thereof based on the method described in the first embodiment of the present application, so how the method in the embodiment of the present application is implemented by the server will not be described in detail herein. The apparatus used to implement the methods of the embodiments of the present application are within the scope of what is intended to be protected by the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the first embodiment, and the details of the fourth embodiment are described in detail.
Example IV
The present embodiment provides a computer readable storage medium 400, as shown in fig. 4, having stored thereon a computer program 411, which computer program 411 when executed by a processor performs the steps of:
judging whether a target application program APP exists or not;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation;
Based on the entity object, obtaining version information corresponding to the version number to be added, and writing the version information corresponding to the version number to be added into a corresponding field in the entity class by using an ORM framework;
inserting each field information in the entity class into a corresponding database table in a database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added.
In a specific implementation, the computer program 411 may implement any implementation of the first embodiment when executed by a processor.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
The foregoing description of the preferred embodiments of the present application is not intended to limit the scope of the present application, but is intended to cover any modifications, equivalents, and alternatives falling within the spirit and principles of the present application.
The above description is not intended to limit the scope of the invention, but is intended to cover any modifications, equivalents, and improvements within the spirit and principles of the invention.
The above description is not intended to limit the scope of the invention, but is intended to cover any modifications, equivalents, and improvements within the spirit and principles of the invention.

Claims (9)

1. An APP version management method, the method comprising:
judging whether a target application program APP exists or not;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
if the fact that the version number to be added of the target APP does not exist is determined, building an entity object based on a pre-built entity class, wherein the bearing logic of the entity class is realized according to a preset annotation;
based on the entity object, version information corresponding to the version number to be added is obtained, and the version information corresponding to the version number to be added is written into a corresponding field in the entity class by utilizing an Object Relation Mapping (ORM) framework;
inserting each field information in the entity class into a corresponding database table in a database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added;
If it is determined that the version number to be added of the target APP does not exist, before the entity object is built based on the pre-built entity class, the method includes:
acquiring data information in a preset version information table structure; the data information includes: the main key ID of the version information table structure, the ID of the APP, the application coding information of the APP, the formal version number of the APP and the compiled version number of the APP;
creating corresponding field information in the entity class based on a preset mapping rule and data information in the version information table structure;
and marking the class name of the entity class by using an annotation mark corresponding to the annotation.
2. The method of claim 1, wherein the determining whether the target APP is present comprises:
constructing a first query object by using an object construction function;
invoking an object generation method in the query object to generate a conditional query object;
generating a query condition based on the ID of the target APP, and transmitting the query condition into the query object;
invoking a first execution method in a mapping object to execute query logic in the first query object to obtain a first query result, and storing the first query result into a preset first result set;
Judging whether the value in the first result set is larger than 0, and if the value in the first result set is larger than 0, determining that the target APP exists.
3. The method of claim 1, wherein the continuing to determine whether the version number to be added of the target APP exists comprises:
constructing a second query object by using the new keyword, wherein the second query object is used for querying all version numbers of the target APP;
invoking a second execution method in the mapping object to execute the query logic in the second query object to obtain a second result set;
calling a stream function to construct a stream object, and calling a filtering method in the stream object to filter elements in the second result set to obtain a third result set;
judging whether the value of the third result set is larger than 0, and if the value of the third result set is smaller than 0, determining that the version number to be added of the target APP does not exist.
4. The method of claim 3, wherein said invoking the filtering method in the flow object filters elements in the second result set to obtain a third result set, comprising:
traversing the second result set, and filtering elements in the second result set by using a preset lambda expression to obtain each version number of the target APP;
Calling a version number acquisition method to acquire all formal version numbers and all compiled version numbers of the target APP;
judging whether the obtained formal version number is consistent with a preset formal version number to be added or not, and judging whether the obtained compiling version number is consistent with the preset compiling version number to be added or not;
and if the obtained formal version number is consistent with the preset formal version number to be added and the obtained compiling version number is consistent with the preset compiling version number to be added, adding the obtained formal version number and the obtained compiling version number into a preset third result set.
5. The method of claim 3, wherein if the value of the third result set is greater than 0, further comprising:
sending abnormal prompt information and ending the flow, wherein the abnormal prompt information comprises the following steps: the version number to be added already exists.
6. An APP version management device, the device comprising:
the judging unit is used for judging whether the target application program APP exists or not;
if the target APP exists, continuing to judge whether the version number to be added of the target APP exists or not;
The construction unit is used for constructing an entity object based on a pre-constructed entity class if the version number to be added of the target APP does not exist, and the bearing logic of the entity class is realized according to a preset annotation;
the acquisition unit is used for acquiring the version information corresponding to the version number to be added based on the entity object, and writing the version information corresponding to the version number to be added into a corresponding field in the entity class by utilizing an ORM framework;
the inserting unit is used for inserting the field information in the entity class into a corresponding database table in the database; wherein the version information includes: the identification ID of the target APP, the application code of the version to be added, the formal version number and the compiled version number of the version to be added;
the building unit needs to build entity classes before building entity objects, including:
acquiring data information in a preset version information table structure; the data information includes: the main key ID of the version information table structure, the ID of the APP, the application coding information of the APP, the formal version number of the APP and the compiled version number of the APP;
creating corresponding field information in the entity class based on a preset mapping rule and data information in the version information table structure;
And marking the class name of the entity class by using an annotation mark corresponding to the annotation.
7. The apparatus of claim 6, wherein the determining unit is specifically configured to:
constructing a first query object by using an object construction function;
invoking an object generation method in the query object to generate a conditional query object;
generating a query condition based on the ID of the target APP, and transmitting the query condition into the query object;
invoking a first execution method in a mapping object to execute query logic in the first query object to obtain a first query result, and storing the first query result into a preset first result set;
judging whether the value in the first result set is larger than 0, and if the value in the first result set is larger than 0, determining that the target APP exists.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method of any one of claims 1 to 5.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 5 when executing the program.
CN202010216550.2A 2020-03-25 2020-03-25 APP version management method, device, medium and computer equipment Active CN113448584B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010216550.2A CN113448584B (en) 2020-03-25 2020-03-25 APP version management method, device, medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010216550.2A CN113448584B (en) 2020-03-25 2020-03-25 APP version management method, device, medium and computer equipment

Publications (2)

Publication Number Publication Date
CN113448584A CN113448584A (en) 2021-09-28
CN113448584B true CN113448584B (en) 2023-07-21

Family

ID=77806679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010216550.2A Active CN113448584B (en) 2020-03-25 2020-03-25 APP version management method, device, medium and computer equipment

Country Status (1)

Country Link
CN (1) CN113448584B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6345288B1 (en) * 1989-08-31 2002-02-05 Onename Corporation Computer-based communication system and method using metadata defining a control-structure
WO2005029313A1 (en) * 2003-08-21 2005-03-31 Microsoft Corporation Systems and methods for data modeling in an item-based storage platform
US7421458B1 (en) * 2003-10-16 2008-09-02 Informatica Corporation Querying, versioning, and dynamic deployment of database objects
US8719226B1 (en) * 2009-07-16 2014-05-06 Juniper Networks, Inc. Database version control

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7698348B2 (en) * 2003-12-19 2010-04-13 Kinaxis Holdings Inc. Extended database engine providing versioning and embedded analytics
CN100454832C (en) * 2005-09-09 2009-01-21 中兴通讯股份有限公司 Method compatible with proxy different editions in network management
CN102375731B (en) * 2010-08-23 2014-11-05 融建信息技术(厦门)有限公司 Coding-free integrated application platform system
US8826227B2 (en) * 2011-06-08 2014-09-02 International Business Machines Corporation Computer aided visualization of a business object model lifecycle
CN104679500B (en) * 2013-12-03 2020-02-14 南京中兴力维软件有限公司 Method and device for realizing automatic generation of entity class
US9804829B2 (en) * 2016-03-31 2017-10-31 Ca, Inc. Interface definition language compiler with version reconciliation
US10341409B2 (en) * 2016-05-09 2019-07-02 International Business Machines Corporation Software version control without affecting a deployed container
CN106357923A (en) * 2016-10-14 2017-01-25 努比亚技术有限公司 Version management method and version management device as well as mobile terminal
CN110716936B (en) * 2019-10-12 2022-04-05 浪潮云信息技术股份公司 Database optimistic lock implementation method and system based on SpringBoot + JPA

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6345288B1 (en) * 1989-08-31 2002-02-05 Onename Corporation Computer-based communication system and method using metadata defining a control-structure
WO2005029313A1 (en) * 2003-08-21 2005-03-31 Microsoft Corporation Systems and methods for data modeling in an item-based storage platform
US7421458B1 (en) * 2003-10-16 2008-09-02 Informatica Corporation Querying, versioning, and dynamic deployment of database objects
US8719226B1 (en) * 2009-07-16 2014-05-06 Juniper Networks, Inc. Database version control

Also Published As

Publication number Publication date
CN113448584A (en) 2021-09-28

Similar Documents

Publication Publication Date Title
CN108196878B (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN109032825B (en) Fault injection method, device and equipment
CN108319858B (en) Data dependency graph construction method and device for unsafe function
CN111158741B (en) Method and device for monitoring dependency relationship change of service module on third party class library
CN104679500B (en) Method and device for realizing automatic generation of entity class
CN111008154B (en) Android application automatic test method and system based on reinforcement learning
WO2016130551A1 (en) Machine-based instruction editing
CN104866764B (en) A kind of Android phone malware detection method based on object reference figure
CN104992083A (en) Code obfuscation method and system for application
CN101901184B (en) Method, device and system for inspecting vulnerability of application program
CN110968296B (en) Data acquisition method, device, equipment and readable storage medium
CN108694049B (en) Method and equipment for updating software
US9367307B2 (en) Staged points-to analysis for large code bases
CN116560642A (en) Code generation method and device, electronic equipment and storage medium
CN106528422B (en) A kind of method and apparatus of detection java applet page disturbance
CN113448584B (en) APP version management method, device, medium and computer equipment
CN111625225A (en) Program specified data output method and device
CN109240696A (en) A kind of Oftware updating method and device
CN113495723B (en) Method, device and storage medium for calling functional component
CN109672608A (en) The method for sending message according to the time
CN109558153B (en) Method, device and system for determining version consistency
CN108614868B (en) Automatic database upgrading method
CN107451050B (en) Function acquisition method and device and server
CN110555185A (en) Page customization method and system based on PC client
CN117215591A (en) Software project compiling method, system, computer equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230621

Address after: 313299 Room 503-1, Building 2, No. 611, Yunxiu South Road, Wuyang Street, Deqing County, Huzhou, Zhejiang Province (Mount Mogan National High tech Zone)

Applicant after: Zhejiang Manqu Technology Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Applicant before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant