CN113448584A - 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
CN113448584A
CN113448584A CN202010216550.2A CN202010216550A CN113448584A CN 113448584 A CN113448584 A CN 113448584A CN 202010216550 A CN202010216550 A CN 202010216550A CN 113448584 A CN113448584 A CN 113448584A
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.)
Granted
Application number
CN202010216550.2A
Other languages
Chinese (zh)
Other versions
CN113448584B (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
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 Ltd filed Critical Wuhan Douyu Network 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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an APP version management method, device, medium and computer equipment, comprising: judging whether a target application program APP exists or not; if the target APP exists, judging whether a version number to be added of the target APP exists; if the target APP is determined to have no version number to be added, an entity object is constructed based on an entity class; acquiring version information corresponding to a 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; inserting each field information in the entity class into a corresponding database table in a database; therefore, when the target APP has a newly added version to be added and the latest version of the target APP does not exist in the system, the version information of the version to be added can be acquired based on the 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 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, device, medium and computer equipment.
Background
APP means third-party application programs installed on mobile terminals such as smart phones, and in an IOS system, in order to enable the APP to realize more functions, different requirements are met, and APP new versions can be continuously researched and developed.
When the newly added version of the APP needs to be added to the database for a user to download and update, in the prior art, the information of the newly added version is generally manually added to the database by a human, which not only results in low efficiency, but also ensures the security and effectiveness of the data.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides an APP version management method, device, medium and computer equipment, which are used for solving the technical problems that in the prior art, new versions of APP information are manually added into a database for being downloaded by a user, so that the efficiency is low and the data security cannot be 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, continuously judging whether the version number to be added of the target APP exists;
if the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation;
acquiring 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 using an Object Relational Mapping (ORM) frame;
inserting the information of each field 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 compiling 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;
calling 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;
calling a first execution method in a mapping object to execute the query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set;
and judging whether the value in the first result set is greater than 0, and if the value in the first result set is greater than 0, determining that the target APP exists.
Optionally, the continuously determining whether the version number to be added of the target APP exists includes:
building 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;
calling 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, calling a filtering method in the stream object to filter elements in the second result set, and obtaining a third result set;
and judging whether the value of the third result set is greater than 0, and if the value of the third result set is less than 0, determining that the version number to be added of the target APP does not exist.
Optionally, the invoking a filtering method in the stream object to filter 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 obtaining method to obtain various formal version numbers and various 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 compilation version number is consistent with a preset compilation version number to be added or not;
and if the acquired formal version number is consistent with the preset formal version number to be added and the acquired compilation version number is consistent with the preset compilation version number to be added, adding the acquired formal version number and the acquired compilation version number to 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 constructed based on the entity class constructed in advance, the method includes:
acquiring data information in a preset version information table structure; the data information includes: the 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 compilation 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 the 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 process, wherein the abnormal prompt information comprises: 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, continuously judging whether the version number to be added of the target APP exists;
the building unit is used for building an entity object based on a pre-built entity class if the fact that the version number to be added of the target APP does not exist is determined, and the bearing logic of the entity class is realized according to a preset annotation;
an obtaining unit, configured to obtain, based on the entity object, version information corresponding to the version number to be added, and write the version information corresponding to the version number to be added into a corresponding field in the entity class by using an ORM frame;
the inserting unit is used for inserting the information of each field 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 compiling version number of the version to be added.
Optionally, the determining unit is specifically configured to:
constructing a first query object by using an object construction function;
calling 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;
calling a first execution method in a mapping object to execute the query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set;
and judging whether the value in the first result set is greater than 0, and if the value in the first result set is greater than 0, determining that the target APP exists.
The invention also provides a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements the method of any one 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 one of the above when executing the program.
The invention provides an APP version management method, device, 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, continuously judging whether the version number to be added of the target APP exists; if the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation; acquiring 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 using an Object Relational Mapping (ORM) frame; inserting the information of each field 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 compilation version number of the version to be added; therefore, when the target APP has a newly added version to be added and the latest version of the target APP does not exist in the system, the version information of the version to be added can be obtained based on the 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 method for acquiring the data directly provided in the annotation is realized by the bearing logic of the entity class according to the preset annotation, so that when the version information is acquired, each data acquisition method does not need to be called independently, the code length of the entity class is simplified, and the APP can be managed more conveniently.
Drawings
Fig. 1 is a schematic flowchart 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 apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a computer device for parsing a log file according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer medium 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, a new version of APP information is manually added to a database for a user to download, so that efficiency is low and data security is not guaranteed, embodiments of the present invention provide an APP version management method, an apparatus, a medium and a computer device.
The technical solution of the present invention is further described in detail by the accompanying drawings and the specific embodiments.
Example one
The embodiment provides an APP version management method, which is applied to an IOS system, and when an 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 a new version, the addition is also completed through the addition function.
Here, the adding function specifically includes: public laptop add a lapversion (Integer appId, String version code, String build version code) front end
}
It can be seen that the adding function has 3 parameter entries, which are: appId, which refers to APP ID; the substitute refers to a formal version number versionCode of the version to be added and a compiled version number buildVersionCode of the version to be added.
Here, usually before an added version is completed, the version needs to be compiled to test the added version, but after each compilation, the version number changes, which results in a messy version management. Therefore, the version number is split into a formal version number and a compiled version number, where the formal version number can be understood as a total version number (for example, the version number is 5.0.1), and the compiled version number can be understood as a sub-version number included in the formal version number (5.0.1.1). For example, after the first compilation, the formal version number is 5.0.1, and the compilation 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 management of the version number is more convenient, and only the compiling version number is changed during compiling, so that frequent change of the formal version number is avoided.
A specific implementation method for adding the function inside in this embodiment may be as shown in fig. 1, and the method includes:
s110, judging whether a target application program APP exists or not;
firstly, before inserting a new version of a target APP, whether the target APP exists or not needs to be judged, and if yes, a subsequent version information insertion process can be carried out.
As an optional embodiment, the determining whether the target APP exists includes:
constructing a first query object by using an object construction function;
calling 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;
calling a first execution method in a mapping object to execute the query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set;
and judging whether the value in the result set is greater than 0, and if the value in the result set is greater than 0, determining that the target APP exists.
Specifically, an object construction function iosappreleaseinstance () is used as a new iosappreleaseinstance (); constructing a first query object iosappReleaseExample; calling a query method createCritieria () in a first query object iosAppRepleseExample to obtain a conditional query object, wherein the conditional query object is a Critieria object; the query condition applid is passed into the query object using the condition addition method andappIdEqualto (applid). The query condition is generated according to the ID of the target APP, that is, the ID appId of the target APP in the query condition is the same as the parameter appId of the entry parameter in the add function.
Calling a first execution method selectbyexample (iosappreleaseexample) in a mapping object iosappreleasemanager to execute a query logic in a first query object, obtaining a first query result, and storing the first query result into a preset first result set appList.
And calling a judgment 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 inquired, determining that the target APP exists.
And if the value in the appList is equal to 0, the target APP is determined not to exist if the information of the target APP is not inquired.
Further, if the target APP does not exist, sending an exception prompting message by using a sending function throw new venussexception (400), wherein the exception prompting message may be that the target APP is not added, and then ending the adding process.
S111, if the target APP is determined to exist, continuously judging whether a version number to be added of the target APP exists;
if the target APP is determined to exist, whether the version number to be added of the target APP exists needs to be continuously judged, and if the version number to be added of the target APP already exists, a subsequent version information adding process does not need to be executed.
As an optional embodiment, the continuously determining whether the version number to be added of the target APP exists includes:
building 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;
calling 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, calling a filtering method in the stream object to filter elements in the second result set, and obtaining a third result set;
and judging whether the value of the third result set is greater than 0, and if the value of the third result set is less than 0, determining that the version number to be added of the target APP does not exist.
As an optional embodiment, the invoking a filtering method in the stream object to filter 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 obtaining method to obtain various formal version numbers and various 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 compilation version number is consistent with a preset compilation version number to be added or not;
and if the obtained formal version number is consistent with a preset formal version number to be added and the obtained compilation version number is consistent with a preset compilation version number to be added, adding the obtained formal version number and the compilation version number to a preset third result set.
Specifically, a second query object IosVersionExample is constructed by using the new keyword new, and the implementation manner of the new keyword new is as follows: IosVersionExample New IosVersionExample (). The second query object iosversisioninstance does not contain any query condition, so that all version numbers of the target APP can be queried without condition limitation.
And calling a second execution method iosVersionMapper. selectByExample (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 finished.
Then, it is determined whether a version number corresponding to the parameter to be added in the function exists in the second result set, where the version number corresponding to the parameter to be added includes: formal version number and compiled version number of target APP. The method is realized as follows:
in order to improve the judgment efficiency, the judgment is carried out through a stream function. The method comprises the following steps: stream () of a call stream function iosVersionList to construct a stream object stream, and a filter method in the call stream object stream filters elements in the second result set to obtain a third result set;
here, the program of the filtering method filter is implemented as follows:
Figure BDA0002424627640000081
wherein item represents each element in the iosversisionlist in the second result set, so that when filtering the elements in the second result set, first traverse the second result set, and filter the elements in the second result set by using a preset lambda expression to obtain version numbers of the target APP, where each version number includes: formal version numbers and compiled version numbers.
Here, since the target APP may have a plurality of version numbers, the version number obtaining 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 equals (), and comparing whether the obtained compilation version number is consistent with a preset compilation 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 compilation version number is consistent with the preset compilation version number to be added, returning to true and adding the obtained formal version number and the compilation version number to 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 compilation version number is inconsistent with the preset compilation version number to be added, returning false.
Thus, a third result set tmpList is obtained after filtering, and the size of the third result set is obtained by calling a function tmpList.
If the value of the third result set is greater than 0, it indicates that the version to be added already exists, and at this time, a send function throw new Venus exception (400, "version number already exists") is called; sending abnormal prompt information and ending the process, wherein the abnormal prompt information comprises: the version to be added already exists.
S112, if it is determined that the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation;
if it is determined that the version number to be added of the target APP does not exist, an entity object needs to be constructed based on a pre-constructed 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 the follow-up situation that when version information is acquired, various codes are required to be set in the entity class to acquire data, so that the codes in the entity class are very long, the installation package of the APP is enlarged, the management of the whole APP is further influenced, and the bearing logic of the entity class is realized according to preset annotations in the application. The preset annotation is the @ Data annotation, and when version information Data needs to be acquired, the @ Data annotation provides a corresponding acquisition method (such as a set method and a get method) to acquire the Data, so that the writing of codes can be simplified, the length of the codes can be shortened, and the management efficiency of the target APP can be improved.
Then before building the entity object, the entity class needs to be built as follows:
firstly, acquiring data information in a preset version information table structure;
the version information table structure is defined as follows:
Figure BDA0002424627640000101
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 an 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-increment and is used for representing the uniqueness of the version information table structure.
And then, constructing an entity class, and creating corresponding field information in the entity class based on the preset mapping rule and the data information in the version information table structure. Wherein, 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 underline is set as a capital letter. The mapping has the advantages that when the version information is acquired subsequently, the version information can be directly written into the field information corresponding to the entity class by using the ORM framework, and the efficiency is improved.
And finally, marking the class name of the entity class by using an annotation mark corresponding to the annotation, so that the entity class is equivalent to an entity container class, and when data is acquired, methods such as get and set can be avoided from being written frequently, 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, acquiring 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 frame;
after the entity object is constructed, as can be seen from step S112, the entity object is iosVersion, and its parameters are appId, app.getaid (), versionCode, and buildVersionCode, then based on the parameters of the entity object, in the entity class, the Data corresponding to each parameter is acquired by using the acquisition method provided by the annotation @ Data, and the acquired Data is the 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 and the compilation version number of the version to be added. Wherein the application encoded aid information may be obtained from the first result set appList.
And after the version information corresponding to the version number to be added is acquired, writing the version information corresponding to the version number to be added into a corresponding field in the entity class by using the ORM framework.
S114, inserting the information of each field in the entity class into a corresponding database table in a database;
after the information of each field in the entity class is written, 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 newly-added version of the target APP can be automatically completed without manual operation, automatic verification can be realized, the operation efficiency is improved, and the safety and the effectiveness of data are improved.
Based on the same inventive concept, the application also provides an APP version management device, which is described in detail in embodiment two.
Example two
The present embodiment provides an APP version management apparatus, as shown in fig. 2, the apparatus includes: a judging unit 21, a constructing unit 22, an obtaining unit 23 and an inserting unit 24; wherein the content of the first and second substances,
a judging unit 21 configured to judge whether the target application APP exists;
if the target APP exists, continuously judging whether the version number to be added of the target APP exists;
the building unit 22 is configured to build an entity object based on a pre-built entity class if it is determined that the version number to be added of the target APP does not exist, where the bearer logic of the entity class is implemented according to a preset annotation;
the obtaining unit 23 is configured to obtain version information corresponding to the 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 frame;
the inserting unit 24 is 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 and the compilation version number of the version to be added.
Here, 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 the target APP has a new version, the addition is also completed through the addition function.
Here, the adding function specifically includes: public laptop add a lapversion (Integer appId, String version code, String build version code) front end
}
It can be seen that the adding function has 3 parameter entries, which are: appId, which refers to APP ID; the substitute refers to a formal version number versionCode of the version to be added and a compiled version number buildVersionCode of the version to be added.
Here, usually before an added version is completed, the version needs to be compiled to test the added version, but after each compilation, the version number changes, which results in a messy version management. Therefore, the version number is split into a formal version number and a compiled version number, where the formal version number can be understood as a total version number (for example, the version number is 5.0.1), and the compiled version number can be understood as a sub-version number included in the formal version number (5.0.1.1). For example, after the first compilation, the formal version number is 5.0.1, and the compilation 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 management of the version number is more convenient, and only the compiling version number is changed during compiling, so that frequent change of the formal version number is avoided.
The specific implementation logic inside the added function in this embodiment is as follows:
first, before inserting a new version of the target APP, the determining unit 21 needs to determine whether the target APP exists, and if so, a subsequent version information inserting process may be performed.
As an alternative embodiment, the determining unit 21 determines whether the target APP exists, including:
constructing a first query object by using an object construction function;
calling 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;
calling a first execution method in a mapping object to execute the query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set;
and judging whether the value in the result set is greater than 0, and if the value in the result set is greater than 0, determining that the target APP exists.
Specifically, an object construction function iosappreleaseinstance () is used as a new iosappreleaseinstance (); constructing a first query object iosappReleaseExample; calling a query method createCritieria () in a first query object iosAppRepleseExample to obtain a conditional query object, wherein the conditional query object is a Critieria object; the query condition applid is passed into the query object using the condition addition method andappIdEqualto (applid). The query condition is generated according to the ID of the target APP, that is, the ID appId of the target APP in the query condition is the same as the parameter appId of the entry parameter in the add function.
Calling a first execution method selectbyexample (iosappreleaseexample) in a mapping object iosappreleasemanager to execute a query logic in a first query object, obtaining a first query result, and storing the first query result into a preset first result set appList.
And calling a judgment 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 inquired, determining that the target APP exists.
And if the value in the appList is equal to 0, the target APP is determined not to exist if the information of the target APP is not inquired.
Further, if the target APP does not exist, sending an exception prompting message by using a sending function throw new venussexception (400), wherein the exception prompting message may be that the target APP is not added, and then ending the adding process.
If it is determined that the target APP exists, the determining unit 21 further needs to continue determining 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 process.
As an optional embodiment, the determining unit 21 continues to determine whether the version number to be added of the target APP exists, including:
building 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;
calling 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, calling a filtering method in the stream object to filter elements in the second result set, and obtaining a third result set;
and judging whether the value of the third result set is greater than 0, and if the value of the third result set is less than 0, determining that the version number to be added of the target APP does not exist.
As an optional embodiment, the invoking a filtering method in the stream object to filter 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 obtaining method to obtain various formal version numbers and various 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 compilation version number is consistent with a preset compilation version number to be added or not;
and if the obtained formal version number is consistent with a preset formal version number to be added and the obtained compilation version number is consistent with a preset compilation version number to be added, adding the obtained formal version number and the compilation version number to a preset third result set.
Specifically, a second query object IosVersionExample is constructed by using the new keyword new, and the implementation manner of the new keyword new is as follows: IosVersionExample New IosVersionExample (). The second query object iosversisioninstance does not contain any query condition, so that all version numbers of the target APP can be queried without condition limitation.
And calling a second execution method iosVersionMapper. selectByExample (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 finished.
Then, it is determined whether a version number corresponding to the parameter to be added in the function exists in the second result set, where the version number corresponding to the parameter to be added includes: formal version number and compiled version number of target APP. The method is realized as follows:
in order to improve the judgment efficiency, the judgment is carried out through a stream function. The method comprises the following steps: stream () of a call stream function iosVersionList to construct a stream object stream, and a filter method in the call stream object stream filters elements in the second result set to obtain a third result set;
here, the program of the filtering method filter is implemented as follows:
Figure BDA0002424627640000151
wherein item represents each element in the iosversisionlist in the second result set, so that when filtering the elements in the second result set, first traverse the second result set, and filter the elements in the second result set by using a preset lambda expression to obtain version numbers of the target APP, where each version number includes: formal version numbers and compiled version numbers.
Here, since the target APP may have a plurality of version numbers, the version number obtaining 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 equals (), and comparing whether the obtained compilation version number is consistent with a preset compilation 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 compilation version number is consistent with the preset compilation version number to be added, returning to true and adding the obtained formal version number and the compilation version number to 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 compilation version number is inconsistent with the preset compilation version number to be added, returning false.
Thus, a third result set tmpList is obtained after filtering, and the size of the third result set is obtained by calling a function tmpList.
If the value of the third result set is greater than 0, it indicates that the version to be added already exists, and at this time, a send function throw new Venus exception (400, "version number already exists") is called; sending abnormal prompt information and ending the process, 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 constructing 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 the follow-up situation that when version information is acquired, various codes are required to be set in the entity class to acquire data, so that the codes in the entity class are very long, the installation package of the APP is enlarged, the management of the whole APP is further influenced, and the bearing logic of the entity class is realized according to preset annotations in the application. The preset annotation is the @ Data annotation, and when version information Data needs to be acquired, the @ Data annotation provides a corresponding acquisition method (such as a set method and a get method) to acquire the Data, so that the writing of codes can be simplified, the length of the codes can be shortened, and the management efficiency of the target APP can be improved.
Then the building unit 22 needs to build the entity class before building the entity object, which is implemented as follows:
firstly, acquiring data information in a preset version information table structure;
the version information table structure is defined as follows:
Figure BDA0002424627640000171
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 an 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-increment and is used for representing the uniqueness of the version information table structure.
And then, constructing an entity class, and creating corresponding field information in the entity class based on the preset mapping rule and the data information in the version information table structure. Wherein, 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 underline is set as a capital letter. The mapping has the advantages that when the version information is acquired subsequently, the version information can be directly written into the field information corresponding to the entity class by using the ORM framework, and the efficiency is improved.
And finally, marking the class name of the entity class by using an annotation mark corresponding to the annotation, so that the entity class is equivalent to an entity container class, and when data is acquired, methods such as get and set can be avoided from being written frequently, 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, and the parameters of the entity object are appId, app. 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 and the compilation version number of the version to be added. Wherein the application encoded aid information may be obtained from the first result set appList.
And after the version information corresponding to the version number to be added is acquired, writing the version information corresponding to the version number to be added into a corresponding field in the entity class by using the ORM framework.
After writing the information of each field in the entity class, the inserting unit 24 is configured to insert the information of each field in the entity class into a corresponding database table in the database by using an inserting function iosversionmapper. Therefore, the insertion of the newly-added version of the target APP can be automatically completed without manual operation, automatic verification can be realized, the operation efficiency is improved, and the safety and the effectiveness of data are 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, device, 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, continuously judging whether the version number to be added of the target APP exists; if the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation; acquiring 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 (object relational mapping) frame; inserting the information of each field 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 compilation version number of the version to be added; therefore, when the target APP has a newly added version to be added and the latest version of the target APP does not exist in the system, the version information of the version to be added can be obtained based on the 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 method for acquiring the data directly provided in the annotation is realized by the bearing logic of the entity class according to the preset annotation, so that when the version information is acquired, each data acquisition method does not need to be called independently, the code length of the entity class is simplified, and the APP can be managed more conveniently.
EXAMPLE III
The present embodiment provides a computer apparatus, as shown in fig. 3, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320, where the processor 320 executes the computer program 311 to implement the following steps:
judging whether a target application program APP exists or not;
if the target APP exists, continuously judging whether the version number to be added of the target APP exists;
if the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation;
acquiring 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 (object relational mapping) frame;
inserting the information of each field 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 compiling version number of the version to be added.
In particular, when the processor 320 executes the computer program 311, any one of the first embodiment can be implemented.
Since the computer device described in this embodiment is a device used for implementing the method for parsing a log file in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a person skilled in the art can understand a specific implementation manner of the computer device in this embodiment and various variations thereof, so that a detailed description of how the server implements the method in the embodiment of the present application is not given here. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium 400, as shown in fig. 4, on which a computer program 411 is stored, which computer program 411, when being executed by a processor, realizes the steps of:
judging whether a target application program APP exists or not;
if the target APP exists, continuously judging whether the version number to be added of the target APP exists;
if the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation;
acquiring 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 (object relational mapping) frame;
inserting the information of each field 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 compiling version number of the version to be added.
In a specific implementation, when the computer program 411 is executed by a processor, any one of the first embodiment may be implemented.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 the 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. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
The above description is only exemplary of the present application and should not be taken as limiting the scope of the present application, as any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the scope of the present application.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.

Claims (10)

1. An APP version management method, the method comprising:
judging whether a target application program APP exists or not;
if the target APP exists, continuously judging whether the version number to be added of the target APP exists;
if the version number to be added of the target APP does not exist, an entity object is constructed based on a pre-constructed entity class, and the bearing logic of the entity class is realized according to a preset annotation;
acquiring 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 using an Object Relational Mapping (ORM) frame;
inserting the information of each field 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 compiling version number of the version to be added.
2. The method of claim 1, wherein said determining whether a target APP exists comprises:
constructing a first query object by using an object construction function;
calling 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;
calling a first execution method in a mapping object to execute the query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set;
and judging whether the value in the first result set is greater than 0, and if the value in the first result set is greater than 0, determining that the target APP exists.
3. The method of claim 1, wherein said continuously determining whether a version number to be added of the target APP exists comprises:
building 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;
calling 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, calling a filtering method in the stream object to filter elements in the second result set, and obtaining a third result set;
and judging whether the value of the third result set is greater than 0, and if the value of the third result set is less 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 a filter method in the stream object to filter elements in the second result set to obtain a third result set comprises:
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 obtaining method to obtain various formal version numbers and various 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 compilation version number is consistent with a preset compilation version number to be added or not;
and if the acquired formal version number is consistent with the preset formal version number to be added and the acquired compilation version number is consistent with the preset compilation version number to be added, adding the acquired formal version number and the acquired compilation version number to a preset third result set.
5. The method of claim 1, wherein if it is determined that the version number to be added of the target APP does not exist, before constructing an entity object based on a pre-constructed entity class, the method includes:
acquiring data information in a preset version information table structure; the data information includes: a primary key ID of the version information table structure, an ID of an APP, application coding information of the APP, a formal version number of the APP and a compilation 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 the annotation mark corresponding to the annotation.
6. 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 process, wherein the abnormal prompt information comprises: the version number to be added already exists.
7. An APP version management apparatus, characterized in that the apparatus comprises:
the judging unit is used for judging whether the target application program APP exists or not;
if the target APP exists, continuously judging whether the version number to be added of the target APP exists;
the building unit is used for building an entity object based on a pre-built entity class if the fact that the version number to be added of the target APP does not exist is determined, and the bearing logic of the entity class is realized according to a preset annotation;
an obtaining unit, configured to obtain, based on the entity object, version information corresponding to the version number to be added, and write the version information corresponding to the version number to be added into a corresponding field in the entity class by using an ORM frame;
the inserting unit is used for inserting the information of each field 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 compiling version number of the version to be added.
8. The apparatus according to claim 7, wherein the determining unit is specifically configured to:
constructing a first query object by using an object construction function;
calling 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;
calling a first execution method in a mapping object to execute the query logic in the first query object, obtaining a first query result, and storing the first query result into a preset first result set;
and judging whether the value in the first result set is greater than 0, and if the value in the first result set is greater than 0, determining that the target APP exists.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 6.
10. 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 6 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 true CN113448584A (en) 2021-09-28
CN113448584B 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 (13)

* 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
US20050138013A1 (en) * 2003-12-19 2005-06-23 Webplan International Extended database engine providing versioning and embedded analytics
CN1929389A (en) * 2005-09-09 2007-03-14 中兴通讯股份有限公司 Method compatible with proxy different editions in network management
US7421458B1 (en) * 2003-10-16 2008-09-02 Informatica Corporation Querying, versioning, and dynamic deployment of database objects
CN102375731A (en) * 2010-08-23 2012-03-14 融建信息技术(厦门)有限公司 Coding-free integrated application platform system
US20120317543A1 (en) * 2011-06-08 2012-12-13 International Business Machines Corporation Computer aided visualization of a business object model lifecycle
US8719226B1 (en) * 2009-07-16 2014-05-06 Juniper Networks, Inc. Database version control
CN104679500A (en) * 2013-12-03 2015-06-03 南京中兴力维软件有限公司 Automatic generation realizing method and device for entity classes
CN106357923A (en) * 2016-10-14 2017-01-25 努比亚技术有限公司 Version management method and version management device as well as mobile terminal
US20170286077A1 (en) * 2016-03-31 2017-10-05 Ca, Inc. Interface definition language compiler with version reconciliation
US20170322934A1 (en) * 2016-05-09 2017-11-09 International Business Machines Corporation Software version control without affecting a deployed container
CN110716936A (en) * 2019-10-12 2020-01-21 浪潮云信息技术有限公司 Database optimistic lock implementation method and system based on SpringBoot + JPA

Patent Citations (13)

* 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
US20050138013A1 (en) * 2003-12-19 2005-06-23 Webplan International Extended database engine providing versioning and embedded analytics
CN1929389A (en) * 2005-09-09 2007-03-14 中兴通讯股份有限公司 Method compatible with proxy different editions in network management
US8719226B1 (en) * 2009-07-16 2014-05-06 Juniper Networks, Inc. Database version control
CN102375731A (en) * 2010-08-23 2012-03-14 融建信息技术(厦门)有限公司 Coding-free integrated application platform system
US20120317543A1 (en) * 2011-06-08 2012-12-13 International Business Machines Corporation Computer aided visualization of a business object model lifecycle
CN104679500A (en) * 2013-12-03 2015-06-03 南京中兴力维软件有限公司 Automatic generation realizing method and device for entity classes
US20170286077A1 (en) * 2016-03-31 2017-10-05 Ca, Inc. Interface definition language compiler with version reconciliation
US20170322934A1 (en) * 2016-05-09 2017-11-09 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
CN110716936A (en) * 2019-10-12 2020-01-21 浪潮云信息技术有限公司 Database optimistic lock implementation method and system based on SpringBoot + JPA

Also Published As

Publication number Publication date
CN113448584B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN103984582B (en) A kind of hot update method and device
CN108196878B (en) Method and device for generating application program installation package, electronic equipment and storage medium
US8869111B2 (en) Method and system for generating test cases for a software application
CN109388403B (en) Dependency injection method, device, equipment and storage medium
US10127037B2 (en) Method for recognizing application type
CN106843820B (en) Code processing method and device
US10853347B2 (en) Dependency-based metadata retrieval and update
CN109743346B (en) Session flow configuration method, device and computer-readable storage medium
CN108132808B (en) Channel package generation method and device
US20160019266A1 (en) Query generating method and query generating device
CN106445514B (en) Method and device for managing Activity instance of Android platform
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN106886446B (en) Software source code verification method and device
CN111984666B (en) Database access method, apparatus, computer readable storage medium and computer device
CN110555185A (en) Page customization method and system based on PC client
CN113553301A (en) Header file processing method and device, computer readable storage medium and processor
CN113448584A (en) APP version management method, device, medium and computer equipment
CN107133539B (en) Smart card personalization method and related device and system
CN113495723B (en) Method, device and storage medium for calling functional component
US20120227029A1 (en) Method for code transformation supporting temporal abstraction of parameters
CN108614868B (en) Automatic database upgrading method
CN108829888B (en) Non-relational database document management method and device
CN107463374B (en) Subset model extraction method and system based on inheritance and association automatic deduction
US20150268938A1 (en) Method for creating a computer software compiler for client server computing
CN107239395B (en) Method and equipment for searching invalid function in source code

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