CN113448602B - Version update method and device - Google Patents

Version update method and device Download PDF

Info

Publication number
CN113448602B
CN113448602B CN202010229564.8A CN202010229564A CN113448602B CN 113448602 B CN113448602 B CN 113448602B CN 202010229564 A CN202010229564 A CN 202010229564A CN 113448602 B CN113448602 B CN 113448602B
Authority
CN
China
Prior art keywords
updated
version number
version
updating
client
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
CN202010229564.8A
Other languages
Chinese (zh)
Other versions
CN113448602A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010229564.8A priority Critical patent/CN113448602B/en
Publication of CN113448602A publication Critical patent/CN113448602A/en
Application granted granted Critical
Publication of CN113448602B publication Critical patent/CN113448602B/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/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

本发明公开了版本更新的方法和装置,涉及计算机技术领域。该方法的一具体实施方式包括:拦截更新应用版本的请求;其中,所述请求包含发出请求的客户端版本号;利用配置中心配置的映射关系,确定与所述客户端版本号匹配的待更新版本号;根据所述待更新版本号对待更新的应用进行更新。该实施方式避免了现有技术在版本进行更新时需要遍历服务端中的大量逻辑代码才能获取是否能够更新的技术缺陷,进而达到使得代码逻辑相对于现有技术而言更简单、容易维护的技术效果。

The present invention discloses a method and device for version updating, and relates to the field of computer technology. A specific implementation of the method includes: intercepting a request to update an application version; wherein the request includes the version number of the client that issued the request; using a mapping relationship configured by a configuration center to determine a version number to be updated that matches the client version number; and updating the application to be updated according to the version number to be updated. This implementation avoids the technical defect of the prior art that a large amount of logic code in the server side needs to be traversed to obtain whether the version can be updated when the version is updated, thereby achieving the technical effect of making the code logic simpler and easier to maintain compared to the prior art.

Description

Version updating method and device
Technical Field
The invention relates to the technical field of computers, in particular to version updating.
Background
When the product requirement corresponding to the application is changed or the code corresponding to the application is loophole, the server is required to update the version of the application in the client.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
1. The codes used for updating the application version of the client side in the server side have a large number of branch sentences, so that the logic is chaotic and difficult to maintain;
2. When a demand change occurs, the code of multiple branches can be modified, and the error rate is high;
3. The testing cost is high, and the maintenance cost is high.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a method and an apparatus for version update, which can avoid the technical defect that in the prior art, when a version is updated, a large number of logic codes in a server need to be traversed to obtain whether the version can be updated, so as to achieve the technical effect that the code logic is simpler and easy to maintain compared with the prior art.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for version update, including:
Intercepting a request for updating an application version, wherein the request comprises a client version number for sending the request;
Determining a version number to be updated, which is matched with the version number of the client, by utilizing a mapping relation configured by a configuration center;
And updating the application to be updated according to the version number to be updated.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
configuring mapping relations between each version number to be updated and each client version number in a configuration center;
Or configuring mapping relations among the version numbers of the clients, the version numbers to be updated and the branch methods corresponding to the version numbers to be updated in the configuration center.
Optionally, updating the application to be updated according to the version number to be updated includes:
determining a parent class corresponding to the version number to be updated;
determining a subclass corresponding to the version number to be updated according to the parent class;
and updating the application to be updated by utilizing the basic method in the parent class and the branch method in the subclass.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
Establishing a parent class corresponding to each version number to be updated;
Writing basic methods corresponding to the version numbers to be updated in the parent class;
based on the parent class, respectively establishing subclasses corresponding to the version numbers to be updated;
respectively writing a branch method corresponding to each version number to be updated in each subclass;
and configuring the mapping relation between each version number to be updated and the branch method.
Optionally, updating the application to be updated according to the version number to be updated includes:
Determining the class corresponding to the version number to be updated;
Judging whether the class exists in the branch method corresponding to the version number to be updated;
if not, updating the application to be updated according to the basic method in the class;
And if so, updating the application to be updated according to the branching method corresponding to the version number to be updated.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
Establishing a class corresponding to each version number to be updated;
Respectively writing a branch method corresponding to each version number to be updated in the class;
Writing a base method in the class;
And configuring mapping relations among the version numbers to be updated, the branch methods and the basic methods.
According to still another aspect of an embodiment of the present invention, there is provided an apparatus for version update, including:
the system comprises a request interception module, a request updating module and a request updating module, wherein the request interception module is used for intercepting a request for updating an application version, and the request comprises a client version number for sending out the request;
the judging module is used for determining a version number to be updated, which is matched with the version number of the client, by utilizing the mapping relation configured by the configuration center;
and the updating module is used for updating the application to be updated according to the version number to be updated if the version number to be updated is the same.
Optionally, the system comprises a configuration module, which is used for determining the version number to be updated matched with the version number of the client before utilizing the mapping relation configured by the configuration center,
Configuring mapping relations between each version number to be updated and each client version number in a configuration center;
Or configuring mapping relations among the version numbers of the clients, the version numbers to be updated and the branch methods corresponding to the version numbers to be updated in the configuration center.
According to another aspect of an embodiment of the present invention, there is provided a version-update electronic device including:
One or more processors;
Storage means for storing one or more programs,
When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the version updating method provided by the present invention.
According to a further aspect of an embodiment of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the version update method provided by the present invention.
One embodiment of the above invention has the following advantages or benefits:
The technical means of configuring the version number to be updated corresponding to the version number of the client side in the configuration center avoids the technical defect that whether the version number can be updated or not can be obtained only by traversing a large number of logic codes in the server side when the version is updated in the prior art, and further achieves the technical effect that the code logic is simpler and is easy to maintain compared with the prior art.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a version updating method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a server for updating a client version;
FIG. 3 is a flow diagram of a client for updating a client version;
FIG. 4 is a schematic diagram of the main modules of an apparatus 400 for version updating according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 6 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main flow of a version updating method according to an embodiment of the present invention, as shown in fig. 1, including:
s101, intercepting a request for updating an application version, wherein the request comprises a client version number for sending out the request;
Step S102, determining a version number to be updated, which is matched with the version number of the client, by using a mapping relation configured by a configuration center;
and step S103, updating the application to be updated according to the version number to be updated.
When the server updates the version of the application, the request sent by the application to be updated needs to be acquired first. The server updates the application of the server with the information contained in the request.
By the technical means of configuring the version number to be updated corresponding to the version number of the client in the configuration center, the technical defect that whether updating can be achieved or not only can be achieved by traversing a large number of logic codes in the server when the version is updated in the prior art is avoided, and further the technical effect that the code logic is simpler and easy to maintain compared with the prior art is achieved.
When the configuration center is determined to have the version number to be updated, which is matched with the version number of the client, a subsequent version updating operation can be performed.
In the application, the configuration center stores at least the mapping relation between the version number of the client and the version number to be updated. Mapping relations between version numbers to be updated and corresponding classes and methods in the classes can also be stored in the configuration center. In alternative embodiments of the present application, the configuration center may be replaced with a configuration file.
By setting the configuration center, the mapping relation is only required to be changed at the configuration center when the version to be updated needs to be maintained, so that the maintenance cost is reduced, the configuration center can be independently tested during testing, the technical defect that all codes of the version to be updated need to be tested in the prior art is avoided, and the aim of reducing the testing cost is fulfilled.
According to the application, through the steps S101-S103, the configuration center is used for determining the version number to be updated, which is matched with the version number of the client, and then the technical means of updating the application to be updated according to the version number to be updated is adopted, so that the technical defects that the logic is disordered and difficult to maintain due to a large number of branch sentences in the code for updating the application version of the client in the server in the prior art are overcome, the test cost is reduced, the maintenance cost is reduced, and the technical effect of improving the efficiency of updating the application version is achieved.
The embodiment of the application can hide calling details for the client when the code is updated, so that the client does not need to consider the problem of multiple versions when the version is updated, and the service logic of other versions can not be influenced when the service logic of a certain version to be updated is modified directly according to the version number to be updated determined in the configuration center, thereby achieving the technical effect of reducing the workload of testers.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
configuring mapping relations between each version number to be updated and each client version number in a configuration center;
Or configuring mapping relations among the version numbers of the clients, the version numbers to be updated and the branch methods corresponding to the version numbers to be updated in the configuration center.
The configuration center may be zookeeper, spring Cloud Eureka, consul, etc., which are not listed here.
When the configuration center adopts the zookeeper, real-time dynamic version control adjustment can be realized without restarting the server.
Optionally, updating the application to be updated according to the version number to be updated includes:
determining a parent class corresponding to the version number to be updated;
determining a subclass corresponding to the version number to be updated according to the parent class;
and updating the application to be updated by utilizing the basic method in the parent class and the branch method in the subclass.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
Establishing a parent class corresponding to each version number to be updated;
Writing basic methods corresponding to the version numbers to be updated in the parent class;
based on the parent class, respectively establishing subclasses corresponding to the version numbers to be updated;
respectively writing a branch method corresponding to each version number to be updated in each subclass;
and configuring the mapping relation between each version number to be updated and the branch method.
Specifically, the basic method can also be put into a parent class, and each method to be called by the version to be updated is put into a different subclass and covers the methods in the parent class. The configuration in the configuration center may be a mapping of client version numbers to corresponding subclasses.
In an alternative embodiment of the present application, each version to be updated corresponding to an application may be written in a parent class, in which a basic method and a branch method are defined, and in this example, the basic method refers to a method shared by each version to be updated, that is, the basic method needs to be invoked no matter any version to be updated is adopted. And updating the application to be updated by a preset method corresponding to the version number to be updated in the parent class.
In an alternative embodiment of the present application, updating the application to be updated according to the version number to be updated includes:
Determining the class corresponding to the version number to be updated;
Judging whether the class exists in the branch method corresponding to the version number to be updated;
if not, updating the application to be updated according to the basic method in the class;
And if so, updating the application to be updated according to the branching method corresponding to the version number to be updated.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
Establishing a class corresponding to each version number to be updated;
Respectively writing a branch method corresponding to each version number to be updated in the class;
Writing a base method in the class;
And configuring mapping relations among the version numbers to be updated, the branch methods and the basic methods.
By configuring technical means of methods corresponding to different version numbers to be updated in the class, the technical defect that when the requirement is changed, multi-branch codes are possibly involved in modification, and the error rate is high is overcome.
When updating the application to be updated, whether the application to be updated has a corresponding branching method or not can be judged according to the mapping relation, and then the application is updated according to the branching method.
In an alternative embodiment of the present application, different methods corresponding to the client may be set in one class, and when the application needs to be updated, the different methods corresponding to the client are called to the class, and then the application is updated.
Specifically, in one class, a method that needs to be invoked by different client versions, such as a1, a2, a3, is defined, and then an agent transparent to the client is set in the server. The agent firstly judges whether a method corresponding to the client exists in the configuration center, and if so, the method corresponding to the client is used for updating the application.
The pseudo code for the class is as follows:
based on the pseudo code of the class, the mapping relationship between the version number to be updated and the version number of the client configured in the configuration center may be:
The basic methods for updating the application version { "=android_3.0.1": branch method 1"," < android_3.0.1": branch method 2", "< ios_3.0.1": branch method 3"}
The mapping relation indicates that the client of android 3.0.1 calls the branch method 1, the client with version number smaller than android 3.0.1 calls the branch method 2, and the client with version number smaller than < ios_3.0.1 calls the branch method 3. And if the matched version is not available in the configuration center, calling a basic method.
The relationship between the configuration center and the version to be updated is further described in detail below in one embodiment.
Fig. 2 is a schematic diagram of a server for updating a client version.
As shown in fig. 2, the server has a server portal, which is configured to receive a request sent by the client to update a server version.
Setting a proxy transparent to the client in the server for judging whether a method corresponding to the client exists in the configuration center or not;
the server also comprises a configuration center, a basic method A, a branch method B, a branch method C and a branch method D.
Optionally, a mapping relation between the version number to be updated and the corresponding preset method is configured in the configuration center, then the corresponding preset method of the version number to be updated can be directly determined through the configuration center, and then the preset method is called to directly update the application.
The alternative embodiment of the application realizes the hiding of version calling details for a calling party (namely a client) through the technical means of dynamic proxy, so that service personnel do not need to excessively care about the problem of version branch control when developing programs, any if else branch statement does not need to be written in calling codes, and the technical defects that a large number of branch statements exist in codes for updating the application version of the client in a server in the prior art, logic is disordered and difficult to maintain are overcome.
The application achieves the method of flexibly calling different client versions through the form of the configuration center, reduces the test cost and the maintenance cost, reduces the complexity of modifying branches, and further achieves the technical effect of reducing the error rate.
The steps for version updating by the client are described in detail in one embodiment.
Fig. 3 is a flow diagram of a client for updating a client version.
Step S301, intercepting an update request by utilizing a section-oriented programming (AOP);
Step S302, receiving whether the configuration center zookeeper configures the mapping relation between each version number to be updated of the client and each client version number, if so, executing step S303, otherwise, executing step S305;
Step S303, accepting and judging whether the version number of the client has a corresponding version number to be updated, if so, executing step S304, otherwise, executing step S305;
step S304, updating the client according to the version number to be updated corresponding to the version number of the client;
Step S305, receiving information that cannot be updated to the client.
Fig. 4 is a schematic diagram of main modules of an apparatus 400 for version update according to an embodiment of the present invention, as shown in fig. 4, including:
a request interception module 401, configured to intercept a request for updating an application version, where the request includes a client version number for sending the request;
a determining module 402, configured to determine whether a version number to be updated that matches the version number of the client exists in the configuration center;
and the updating module 403 is configured to update the application to be updated according to the version number to be updated if yes.
Optionally, the system comprises a configuration module, which is used for determining the version number to be updated matched with the version number of the client before utilizing the mapping relation configured by the configuration center,
Configuring mapping relations between each version number to be updated and each client version number in a configuration center;
Or configuring mapping relations among the version numbers of the clients, the version numbers to be updated and the branch methods corresponding to the version numbers to be updated in the configuration center.
Optionally, updating the application to be updated according to the version number to be updated includes:
determining a parent class corresponding to the version number to be updated;
determining a subclass corresponding to the version number to be updated according to the parent class;
and updating the application to be updated by utilizing the basic method in the parent class and the branch method in the subclass.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
Establishing a parent class corresponding to each version number to be updated;
Writing basic methods corresponding to the version numbers to be updated in the parent class;
based on the parent class, respectively establishing subclasses corresponding to the version numbers to be updated;
respectively writing a branch method corresponding to each version number to be updated in each subclass;
and configuring the mapping relation between each version number to be updated and the branch method.
Optionally, updating the application to be updated according to the version number to be updated includes:
Determining the class corresponding to the version number to be updated;
Judging whether the class exists in the branch method corresponding to the version number to be updated;
if not, updating the application to be updated according to the basic method in the class;
And if so, updating the application to be updated according to the branching method corresponding to the version number to be updated.
Optionally, before determining the version number to be updated matched with the client version number by using the mapping relation configured by the configuration center, the method includes:
Establishing a class corresponding to each version number to be updated;
Respectively writing a branch method corresponding to each version number to be updated in the class;
Writing a base method in the class;
And configuring mapping relations among the version numbers to be updated, the branch methods and the basic methods.
Fig. 5 illustrates an exemplary system architecture 500 in which a version-up method or version-up apparatus of embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using the terminal devices 501, 502, 503. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the version updating method provided in the embodiment of the present invention is generally executed by the server 505, and accordingly, the version updating device is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Connected to the I/O interface 605 are an input section 606 including a keyboard, a mouse, and the like, an output section 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like, a storage section 608 including a hard disk, and the like, and a communication section 609 including a network interface card such as a LAN card, a modem, and the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, a processor may be described as comprising a sending module, an obtaining module, a determining module and a first processing module. The names of these modules do not in some cases limit the module itself, and for example, the transmitting module may also be described as "a module that transmits a picture acquisition request to a connected server".
As a further aspect, the invention also provides a computer readable medium which may be comprised in the device described in the above embodiments or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include:
Intercepting a request for updating an application version, wherein the request comprises a client version number for sending the request;
Determining a version number to be updated, which is matched with the version number of the client, by utilizing a mapping relation configured by a configuration center;
And updating the application to be updated according to the version number to be updated.
According to the technical scheme provided by the embodiment of the invention, the following beneficial effects can be achieved:
The technical means of configuring the version number to be updated corresponding to the version number of the client side in the configuration center avoids the technical defect that whether the version number can be updated or not can be obtained only by traversing a large number of logic codes in the server side when the version is updated in the prior art, and further achieves the technical effect that the code logic is simpler and is easy to maintain compared with the prior art.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A method of version updating, comprising:
Intercepting a request for updating an application version, wherein the request comprises a client version number for sending the request;
Determining a version number to be updated, which is matched with the version number of the client, by utilizing a mapping relation configured by a configuration center;
the method comprises the steps of determining a parent class corresponding to the version number to be updated, determining a child class corresponding to the version number to be updated according to the parent class, and updating the application to be updated by utilizing a basic method in the parent class and a branching method in the child class.
2. The method of claim 1, wherein determining the version number to be updated that matches the client version number using the mapping relationship configured by the configuration center comprises:
configuring mapping relations between each version number to be updated and each client version number in a configuration center;
Or configuring mapping relations among the version numbers of the clients, the version numbers to be updated and the branch methods corresponding to the version numbers to be updated in the configuration center.
3. The method of claim 1, wherein determining the version number to be updated that matches the client version number using the mapping relationship configured by the configuration center comprises:
Establishing a parent class corresponding to each version number to be updated;
Writing basic methods corresponding to the version numbers to be updated in the parent class;
based on the parent class, respectively establishing subclasses corresponding to the version numbers to be updated;
respectively writing a branch method corresponding to each version number to be updated in each subclass;
and configuring the mapping relation between each version number to be updated and the branch method.
4. The method of claim 2, wherein updating the application to be updated according to the version number to be updated comprises:
Determining the class corresponding to the version number to be updated;
Judging whether the class exists in the branch method corresponding to the version number to be updated;
if not, updating the application to be updated according to the basic method in the class;
And if so, updating the application to be updated according to the branching method corresponding to the version number to be updated.
5. The method of claim 4, wherein determining the version number to be updated that matches the client version number using the mapping relationship configured by the configuration center comprises:
Establishing a class corresponding to each version number to be updated;
Respectively writing a branch method corresponding to each version number to be updated in the class;
Writing a base method in the class;
And configuring mapping relations among the version numbers to be updated, the branch methods and the basic methods.
6. An apparatus for version updating, comprising:
the system comprises a request interception module, a request updating module and a request updating module, wherein the request interception module is used for intercepting a request for updating an application version, and the request comprises a client version number for sending out the request;
the judging module is used for determining a version number to be updated, which is matched with the version number of the client, by utilizing the mapping relation configured by the configuration center;
The updating module is used for updating the application to be updated according to the version number to be updated if the application to be updated is the version number to be updated, and comprises determining a parent class corresponding to the version number to be updated, determining a sub-class corresponding to the version number to be updated according to the parent class, and updating the application to be updated by utilizing a basic method in the parent class and a branching method in the sub-class.
7. The apparatus of claim 6, comprising a configuration module configured to determine a version number to be updated that matches the client version number prior to utilizing a mapping relationship configured by a configuration center,
Configuring mapping relations between each version number to be updated and each client version number in a configuration center;
Or configuring mapping relations among the version numbers of the clients, the version numbers to be updated and the branch methods corresponding to the version numbers to be updated in the configuration center.
8. A version-up electronic device, comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
CN202010229564.8A 2020-03-27 2020-03-27 Version update method and device Active CN113448602B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010229564.8A CN113448602B (en) 2020-03-27 2020-03-27 Version update method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010229564.8A CN113448602B (en) 2020-03-27 2020-03-27 Version update method and device

Publications (2)

Publication Number Publication Date
CN113448602A CN113448602A (en) 2021-09-28
CN113448602B true CN113448602B (en) 2025-01-14

Family

ID=77807774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010229564.8A Active CN113448602B (en) 2020-03-27 2020-03-27 Version update method and device

Country Status (1)

Country Link
CN (1) CN113448602B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416396A (en) * 2021-12-29 2022-04-29 北京房多多信息技术有限公司 Interface version control method and device, electronic equipment and storage medium
CN114448803B (en) * 2022-01-29 2024-06-28 网宿科技股份有限公司 Configuration issuing method, electronic equipment and storage medium
CN114546457B (en) * 2022-02-25 2025-05-30 掌阅科技股份有限公司 Plug-in implementation method, electronic device and storage medium for multi-version application

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731733A (en) * 2013-12-19 2014-04-16 乐视网信息技术(北京)股份有限公司 Version upgrading method and electronic device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6360363B1 (en) * 1997-12-31 2002-03-19 Eternal Systems, Inc. Live upgrade process for object-oriented programs
US20160078386A1 (en) * 2014-09-12 2016-03-17 Wolfgang Herzog Branch Versioning for Process Management
CN104598262A (en) * 2014-11-25 2015-05-06 深圳市腾讯计算机系统有限公司 Method and device for updating mobile application
CN104503789B (en) * 2014-12-17 2017-11-17 华为技术有限公司 The control method and ICT equipment of version updating
CN105812483A (en) * 2016-04-20 2016-07-27 努比亚技术有限公司 Method and server for updating application and mobile terminal
CN109656599A (en) * 2018-12-28 2019-04-19 苏州思必驰信息科技有限公司 The method and system updated for client release
CN110058873B (en) * 2019-03-12 2021-09-17 天津五八到家科技有限公司 Application page updating method, device, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731733A (en) * 2013-12-19 2014-04-16 乐视网信息技术(北京)股份有限公司 Version upgrading method and electronic device

Also Published As

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

Similar Documents

Publication Publication Date Title
CN110019350B (en) Data query method and device based on configuration information
CN113448602B (en) Version update method and device
CN109766127B (en) Methods for updating application version information
CN113010405B (en) A method and device for testing an application program
CN110795328A (en) Interface testing method and device
CN112817562B (en) Service processing method and device
CN110019158A (en) A kind of method and apparatus of monitoring data quality
CN112579447A (en) Browser testing method and device
CN109981546B (en) Method and device for acquiring remote call relation between application modules
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN113468067A (en) Application program debugging method and device, electronic equipment and computer readable medium
CN116561013B (en) Test methods, devices, electronic equipment and media based on the target service framework
CN110851194A (en) Method and device for acquiring code for realizing new interface
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN112559001B (en) Method and device for updating application
CN113821519B (en) Data processing method and domain drive design architecture
CN112860447B (en) Interaction method and system between different applications
CN113704080B (en) Automatic test method and device
CN113535185B (en) A method and device for implementing sharing
CN114925066A (en) Data processing method and device, electronic equipment and storage medium
CN113110898A (en) Transaction task execution method and device
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
CN110727739B (en) Data storage method and device
CN112099841A (en) Method and system for generating configuration file
CN112882741A (en) Application management system and method

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
GR01 Patent grant
GR01 Patent grant