CN113360213A - Application program version switching method, device, equipment and system - Google Patents

Application program version switching method, device, equipment and system Download PDF

Info

Publication number
CN113360213A
CN113360213A CN202110736172.5A CN202110736172A CN113360213A CN 113360213 A CN113360213 A CN 113360213A CN 202110736172 A CN202110736172 A CN 202110736172A CN 113360213 A CN113360213 A CN 113360213A
Authority
CN
China
Prior art keywords
switch value
service
application
version
remote dictionary
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.)
Pending
Application number
CN202110736172.5A
Other languages
Chinese (zh)
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202110736172.5A priority Critical patent/CN113360213A/en
Publication of CN113360213A publication Critical patent/CN113360213A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions

Landscapes

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

Abstract

The application provides an application program version switching method, device, equipment and system, wherein the method comprises the following steps: and responding to the switch value input by the user, setting the switch value currently stored in the remote dictionary service as the input switch value, and controlling and executing the application program of the corresponding version according to the switch value currently stored in the remote dictionary service if a service request is received. According to the method, the switch value is stored in the remote dictionary service, the switch value is managed through the switch value visual management end page, when emergency switching is carried out, the switch value stored currently in the remote dictionary service can be set as the input switch value in real time only by inputting the switch value on the switch value visual management end page, at the moment, if a service request is received, the application program of the corresponding version can be controlled and executed according to the switch value stored currently in the remote dictionary service, and therefore convenient operation and timely application program version switching are achieved.

Description

Application program version switching method, device, equipment and system
Technical Field
The present application relates to the field of software system emergency disposal technologies, and in particular, to a method, an apparatus, a device, and a system for switching application versions.
Background
With the development of software services, the customer requirements present a trend of urgent and diverse needs, so that the requirements on the continuous delivery of product upgrading, the frequency and quality of rapid iteration are higher and higher, and in the process of high-frequency research and development project iteration, the non-stop emergency treatment of an application program is particularly important for ensuring the smooth production and the stable system operation.
At present, a common non-stop emergency disposal method includes that a configuration file or a database parameter is used to control program logic branch execution, so as to realize switching of application program versions. That is, the method requires that before the new version of the application is released, a parameter value, for example, a parameter name of switch, with a value of 1, is maintained in the configuration file or database to indicate that the new version logic branch is executed. When the new version of the application program has a problem, the value of the parameter name in the configuration file or the database is manually switched to 0, and at the moment, the old version logic branch is executed.
However, when the method is used for switching the application program versions, the corresponding configuration file or the corresponding database needs to be searched first and then the parameter values in the configuration file or the database need to be modified each time, so that the operation is inconvenient, and the application program versions cannot be switched in time. In addition, when the distributed scenario is addressed, parameter values in the configuration file or the database need to be modified for each server, which is time-consuming and labor-consuming.
Disclosure of Invention
The application provides an application program version switching method, device, equipment and system, which are used for realizing convenient and timely application program version switching.
In a first aspect, an embodiment of the present application provides an application version switching method, including:
setting a currently stored switch value in a remote dictionary service as the input switch value in response to the user input switch value;
and if a service request is received, controlling and executing the application programs of the corresponding versions according to the switch value currently stored in the remote dictionary service, wherein different switch values correspond to the application programs of different versions.
Further, the method as described above, further comprising:
updating the switch value currently stored in a database or a configuration file according to the switch value currently stored in the remote dictionary service;
the method further comprises the following steps:
and if the switch value is not stored in the remote dictionary service currently, reading the switch value in a configuration file or a database and storing the switch value in the remote dictionary service.
Further, the method as described above, if the switch value is not currently stored in the remote dictionary service, after reading the switch value in the configuration file or the database, further includes:
if the switch value is not stored in the configuration file or the database, storing a preset default switch value in the remote dictionary service; the default switch value corresponds to a preset application program of a default version;
the controlling and executing the application program of the corresponding version according to the switch value currently stored in the remote dictionary service comprises the following steps:
and controlling to execute the application program of the default version according to the switch value currently stored in the remote dictionary service.
Further, the method as described above, the controlling the execution of the corresponding version of the application program according to the currently stored switch value in the remote dictionary service includes:
if the switch value currently stored in the remote dictionary service is a first switch value, controlling to execute the application program of a first version;
and if the switch value currently stored in the remote dictionary service is a second switch value, controlling to execute an application program of a second version, wherein the first switch value and the second switch value have different values, and the first version is different from the second version.
Further, according to the method described above, if a service request is received, controlling to execute an application program of a corresponding version according to a switch value currently stored in the remote dictionary service includes:
if a service request is received, calling a service interface which is configured in advance, wherein the service interface comprises a plurality of implementation classes, and different implementation classes correspond to application programs of different versions;
and controlling to execute the application program of the version corresponding to the corresponding implementation class according to the switch value currently stored in the remote dictionary service, wherein different switch values correspond to different implementation classes.
Further, according to the method, the application version switching method is applied to a current master server under a remote dictionary service architecture, the remote dictionary service architecture comprises the master server and slave servers, and each slave server is deployed with the application version switching method.
In a second aspect, an embodiment of the present application provides an apparatus for switching application versions, including:
the setting module is used for responding to the switch value input by the user and setting the currently stored switch value in the remote dictionary service as the input switch value;
and the control module is used for controlling and executing the application programs of the corresponding versions according to the switch values currently stored in the remote dictionary service if the service request is received, wherein different switch values correspond to the application programs of different versions.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
a memory: a memory for storing the processor-executable instructions;
wherein the processor is configured to call program instructions in the memory to perform the application version switching method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, the computer-readable storage medium is configured to implement the application version switching method according to the first aspect.
In a fifth aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the application version switching method according to the first aspect is implemented.
In a sixth aspect, an embodiment of the present application provides a service system, including: the system comprises a service control module and a plurality of remote dictionary service architectures, wherein different remote dictionary service architectures correspond to different application services; each remote dictionary service architecture comprises a master server and a slave server, wherein the master server is used for executing the application program version switching method according to the first aspect;
the service control module is used for receiving a service request, wherein the service request comprises information of a first application service; determining a first remote dictionary service architecture corresponding to the first application service; and sending the service request to a current main server under the first remote dictionary service architecture.
Further, the system as described above, the remote dictionary service architecture comprises a master-slave switching module;
and the master-slave switching module is used for switching a server which normally operates in the slave servers into the current master server and switching the master server which abnormally operates before switching into the current slave server if the master server operates abnormally under the remote dictionary service architecture.
The application provides an application program version switching method, device, equipment and system, wherein the switching value currently stored in a remote dictionary service is set as the input switching value in response to the switching value input by a user, and if a service request is received, the application program of the corresponding version is controlled and executed according to the switching value currently stored in the remote dictionary service. That is to say, the application stores the switch value in the remote dictionary service, and manages the switch value through the switch value visual management end page, when performing emergency switching, a user (also called a developer) only needs to input the switch value on the switch value visual management end page, and can set the currently stored switch value in the remote dictionary service as the input switch value in real time.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flowchart of an application version switching method according to an embodiment of the present application;
fig. 2 is a flowchart of an application version switching method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a service interface provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of a switch value loading process provided in an embodiment of the present application;
fig. 5 is a schematic flowchart of application version switching according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an application version switching apparatus according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of an electronic device of the present application;
fig. 8 is a schematic diagram of a service system provided in an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
With the development of software services, the requirements of customers for services are changing, so that the version of an application program needs to be upgraded continuously. However, the application program of the upgraded version belongs to a newly developed program, and since the program is not verified for a long time, the program may be abnormal, which affects the normal operation of the software system. Therefore, in order to deal with the situation, emergency treatment needs to be performed without shutdown, and the application program is switched to an un-upgraded version, that is, a program which is verified for a long time and can be normally used, so that the normal operation of the software system is ensured.
At present, a common non-stop emergency disposal method includes that a configuration file or a database parameter is used to control program logic branch execution, so as to realize switching of application program versions. That is, the method requires that before the new version of the application is released, a parameter value, for example, a parameter name of switch, with a value of 1, is maintained in the configuration file or database to indicate that the new version logic branch is executed. When the new version of the application program has a problem, the value of the parameter name in the configuration file or the database is manually switched to 0, and at the moment, the old version logic branch is executed.
However, when the method is used for switching the application program versions, the corresponding configuration file or the corresponding database needs to be searched first and then the parameter values in the configuration file or the database need to be modified each time, so that the operation is inconvenient, and the application program versions cannot be switched in time. In addition, when the distributed scenario is addressed, parameter values in the configuration file or the database need to be modified for each server, which is time-consuming and labor-consuming.
The application program version switching method, device, equipment and system provided by the application aim to solve the technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The terms referred to in this application are explained first:
emergency disposal without shutdown: the method is characterized in that a client request is shunted to a logic branch of which the last version is verified to be error-free by modifying a configuration attribute value written in a program in advance. The attribute value configured in the program is usually written in the memory of the server, and the attribute value in the memory is usually immediately effective after being updated, so that the service can be quickly recovered and the loss is reduced by the quick non-stop processing mode.
Interface-oriented programming: it is meant that in a system, the various functions of the system are implemented by different interfaces. In the Java programming language specification, the interface is only responsible for defining each method, and the specific implementation logic of the method needs to be completed by an instance object (i.e. implementation class). When an external request comes, the actual logic processing and operation are also the instance objects. The specific implementation of each object module is completely transparent to the system, and the system does not need to know complex logic in the module and only concerns data and information feedback of the module.
Remote Dictionary service (Remote Dictionary Server, Redis): refers to an open-source memory-based key-value pair (key-value) storage system.
Example one
Fig. 1 is a flowchart of an application version switching method according to an embodiment of the present application, and as shown in fig. 1, the application version switching method according to the embodiment includes the following steps:
step 101, responding to a switch value input by a user, setting the switch value currently stored in the remote dictionary service as the input switch value.
And 102, if a service request is received, controlling and executing the application programs of the corresponding versions according to the switch values currently stored in the remote dictionary service, wherein different switch values correspond to the application programs of different versions.
It should be noted that the execution main body of the application version switching method provided in this embodiment may be an application version switching device. In practical applications, the application version switching device may be implemented by a computer program, such as application software, a computer program, or a medium storing a related computer program, such as a usb disk, an optical disk, or the like; alternatively, it may be implemented by a physical device, such as a chip, etc., into which the relevant computer program is integrated or installed.
In this embodiment, in order to ensure that the software system operates normally, it is necessary to perform non-stop emergency treatment when necessary, that is, when an application program of a current version (that is, a new version) is abnormal, the application program of another version (that is, an old version) is timely switched to. Thus, to enable timely switching of application versions, the switch values currently stored in Redis may be modified. The switch value currently stored in the Redis may be a switch value read from a configuration file or a database.
It should be noted that, unlike the existing method of controlling the program logic branch execution by using the configuration file or the database parameter, the present embodiment controls the program logic branch execution by using the switch value stored in the Redis, so as to implement the switching of the application program version. Wherein, different switch values correspond to different program logic branches, i.e. different versions of application programs.
Further, the switch value stored in Redis may be managed by the switch value visualization management side page.
Specifically, after a user (i.e., a developer) inputs a switch value on a page of the switch value visual management end, the application version switching device may respond to the switch value input by the user and set the currently stored switch value in the Redis as the input switch value in real time. At this time, if the application version switching device receives a service request sent by a client, the application version switching device can control and execute the application of the corresponding version according to the currently stored switch value in the Redis, so that the application version can be switched in time.
Fig. 2 is a flowchart of an application version switching method according to an embodiment of the present application, where on the basis of the first embodiment, step 102 specifically includes the following steps:
step 201, if a service request is received, a service interface configured in advance is called, the service interface includes a plurality of implementation classes, and different implementation classes correspond to application programs of different versions.
Step 202, controlling and executing the application program of the version corresponding to the corresponding implementation class according to the switch value currently stored in the remote dictionary service, wherein different switch values correspond to different implementation classes.
In this embodiment, if an application version switching device receives a service request sent by a client, a service interface configured in advance is called, fig. 3 is a schematic diagram of the service interface provided in this embodiment of the present application, as shown in fig. 3, the service interface (i.e., interface a) is configured in an interface-oriented programming manner, a name of a method (i.e., a corresponding application service, such as a transfer function) is defined in interface a, and two implementation classes are included under the service interface and respectively correspond to an application of a new version and an old version, i.e., an old version implementation class B and a new version implementation class C.
The service request sent by the client is executed by the specific implementation class of the service interface, that is, the application version switching device can control and execute the application program of the version corresponding to the corresponding implementation class according to the switch value currently stored in the Redis. Wherein different switch values correspond to different implementation classes.
By the method, the application programs of different versions can be separated, the readability of the program is increased, the program maintenance is easy, if new application programs of different versions for switching are required to be added subsequently, only the implementation class D, the implementation class E, the implementation class F and the like are required to be newly established under the service interface, the implementation class D, the implementation class E, the implementation class F and the like correspond to the application programs of different versions respectively, and the corresponding application programs of the versions corresponding to the implementation classes are controlled to be executed by different switch values, so that the maintenance cost of the program is reduced.
In a possible implementation manner, on the basis of the first embodiment, the application version switching method is applied to a current master server under a remote dictionary service architecture, where the remote dictionary service architecture includes the master server and slave servers, and each slave server is deployed with the application version switching method.
In the embodiment, in order to solve the bottleneck problem of a single storage server in a traditional centralized storage system and improve the reliability, availability and expansibility of the system, an application program and data in a master server may be distributed over a plurality of slave servers through a network, that is, distributed. The Redis architecture is an architecture supporting distributed caching, and a master server is usually used for responding to a service request, so that the application version switching method provided by the embodiment of the application can be realized by the current master server under the Redis architecture, and the method is deployed in each slave server under the Redis architecture, so that the reliability of the system can be improved.
In addition, in an implementation manner, the switch value currently stored in the Redis of each slave server can be sent to the master server through a network, so that the application version switching device in the master server uniformly manages the switch values of the master server and the slave servers through the switch value visualization management end page, and thus, the switch value currently stored in the Redis of the master server and the slave server can be modified by one key, which is convenient and fast.
In the method for switching versions of an application program provided in this embodiment, in response to a switch value input by a user, a switch value currently stored in a remote dictionary service is set as the input switch value, and if a service request is received, an application program of a corresponding version is controlled to be executed according to the switch value currently stored in the remote dictionary service. That is to say, in the embodiment of the present application, the switch value is stored in the remote dictionary service, and the switch value is managed through the switch value visual management end page, when an emergency switching is performed, a user (i.e. a developer) can set the currently stored switch value in the remote dictionary service as the input switch value in real time only by inputting the switch value on the switch value visual management end page, and because different switch values correspond to different versions of the application program, at this time, if a service request is received, the application program of the corresponding version can be controlled and executed according to the currently stored switch value in the remote dictionary service, thereby implementing convenient and timely switching of application program versions.
Example two
On the basis of the first embodiment, in order to further explain the application version switching method of the present application, the method further includes: and updating the switch value currently stored in a database or a configuration file according to the switch value currently stored in the remote dictionary service.
Accordingly, the method further comprises: and if the switch value is not stored in the remote dictionary service currently, reading the switch value in a configuration file or a database and storing the switch value in the remote dictionary service.
In this embodiment, after the application version switching device sets the switch value currently stored in the Redis to the switch value input by the user, there may be a case where the switch value currently stored in the Redis is lost due to an instruction error or the like, and to cope with this case, the application version switching device may update the switch value currently stored in the database or the configuration file according to the switch value currently stored in the Redis for reading by the Redis.
Accordingly, if the switch value is not currently stored in the Redis, the application version switching device may read the switch value in the configuration file or the database and store the switch value in the Redis.
In an example, fig. 4 is a schematic flowchart of a switch value loading process provided in an embodiment of the present application, and as shown in fig. 4, when an application is initially started, a switch value is not currently stored in the Redis, at this time, the application version switching device may read the switch value in a configuration file or a database according to a setting, and store the read switch value in the Redis.
The scheme is suitable for Redis architectures including but not limited to a sentinel mode and a cluster mode. In combination with an actual scene, in a sentinel model, each Redis database can store the full amount of data, and the method is characterized in that data backup is complete and is suitable for an application scene with small data amount; the cluster mode cluster adopts distributed storage, each Redis instance stores different contents, and the keys are distributed to different Redis instances by calculating the hash value of the keys to be stored.
Combining the scheme with a cluster mode for example, the switching value loading process of the scheme mainly comprises the following steps: the cluster connection pool created by the springboot integration redis is used for expanding the Redis connection class in the original org.ff4j.redis library, StringRedistemperate generated by a springcontainer is directly used in the constructor of the cluster connection pool to assign to the local joddisCluster, and meanwhile, the getJedis () method is modified, and the joddisPool is not created any more and is directly returned to the joddisCluster. In addition, the configuration class FF4jConfiguration of the new definition FF4j adjusts the loading sequence through annotation configuration, so that the loading sequence is loaded after the redis cluster configuration is loaded, an FF4j instance is created in the configuration class, and the cache class featuretorredis instantiated by using the extended RedisConnection, thereby completing the loading of the switch value.
By the mode, the switch value can be stored in Redis, and a foundation is laid for realizing timely application program version switching in the follow-up process.
On the basis of the second embodiment, after reading the switch value in the configuration file or the database if the switch value is not currently stored in the remote dictionary service, the method further includes: if the switch value is not stored in the configuration file or the database, storing a preset default switch value in the remote dictionary service; the default switch value corresponds to a preset default version of the application program.
Correspondingly, in step 102, the controlling and executing the application program of the corresponding version according to the switch value currently stored in the remote dictionary service includes: and controlling to execute the application program of the default version according to the switch value currently stored in the remote dictionary service.
In this embodiment, if the switch value is not currently stored in the Redis, the application version switching device reads the switch value in the configuration file or the database in order to obtain the switch value, and at this time, if the switch value is not also stored in the configuration file or the database, the application version switching device stores a preset default switch value in the Redis. The default switch value corresponds to a preset default version of the application program. Accordingly, the application version switching means may control execution of the application of the default version according to the switch value currently stored in the Redis.
On the basis of any other implementation manner, in step 102, the controlling and executing the corresponding version of the application program according to the switch value currently stored in the remote dictionary service includes: if the switch value currently stored in the remote dictionary service is a first switch value, controlling to execute the application program of a first version; and if the switch value currently stored in the remote dictionary service is a second switch value, controlling to execute an application program of a second version, wherein the first switch value and the second switch value have different values, and the first version is different from the second version.
In this embodiment, if the switch value currently stored in the Redis is the first switch value, the application version switching device controls to execute the application of the first version. In practical applications, the first switch value may be true, the first version of the application program may be an upgraded version of the application program, and in a possible case, the application program corresponding to the class C may also be implemented for a new version under the service interface a. If the switch value currently stored in Redis is the second switch value, the application program version switching device controls to execute the application program of the second version. In practical applications, the second switch value may be false, the second version of the application program may be an un-upgraded version of the application program, and in a possible case, the application program corresponding to the class B may also be implemented for an old version under the service interface a.
The first switch value and the second switch value have different values, and the first version is different from the second version.
The default switch value may be the first switch value or the second switch value, and accordingly, the application program of the default version may be the application program of the first version or the application program of the second version.
Fig. 5 is a schematic flowchart of an application version switching process provided in an embodiment of the present application, and as shown in fig. 5, after an application version switching device receives a service request sent by a client, it may check whether a switch value is currently stored in a Redis, if the switch value is not currently stored in the Redis, read the switch value in a configuration file or a database and store the switch value in the Redis, if the switch value is not also configured in the configuration file or the database, store a preset default switch value (e.g., switch true) in the Redis, if the switch value is currently stored in the Redis, the application version switching device uses an Aspect Oriented Programming (AOP) dynamic proxy to invoke a preconfigured service interface, and if the switch value currently stored in the Redis is a first switch value (e.g., switch true), the application version switching device controls to execute an application corresponding to a new version implementation class C, if the switch value currently stored in the Redis is the second switch value (for example, the switch is false), the application version switching device controls to execute the application corresponding to the old version implementation class B, and returns the result after the application execution to the client, for example, returns the recharge result.
According to the method for switching the versions of the application programs, the application programs of different versions are controlled to be executed according to the switch value currently stored in the Redis, and the versions of the application programs are switched.
EXAMPLE III
Fig. 6 is a schematic structural diagram of an application version switching device according to an embodiment of the present application, and as shown in fig. 6, the application version switching device according to the embodiment includes: a setting module 51 and a control module 52. The setting module 51 is configured to set, in response to a switch value input by a user, a switch value currently stored in the remote dictionary service to the input switch value. And the control module 52 is configured to, if a service request is received, control execution of an application program of a corresponding version according to a switch value currently stored in the remote dictionary service, where different switch values correspond to application programs of different versions.
The application program version switching apparatus provided in this embodiment sets the switch value currently stored in the remote dictionary service as the input switch value in response to the switch value input by the user, and controls to execute the application program of the corresponding version according to the switch value currently stored in the remote dictionary service if the service request is received. That is to say, in the embodiment of the present application, the switch value is stored in the remote dictionary service, and the switch value is managed through the switch value visual management end page, when an emergency switching is performed, a user (i.e. a developer) can set the currently stored switch value in the remote dictionary service as the input switch value in real time only by inputting the switch value on the switch value visual management end page, and since different switch values correspond to different versions of the application program, at this time, if a service request is received, the application program of the corresponding version can be controlled and executed according to the currently stored switch value in the remote dictionary service, thereby implementing the application program version switching that is convenient to operate and timely.
In an optional implementation manner, the apparatus for switching application versions further includes: an update module 53 and a storage module 54. The updating module 53 is configured to update the currently stored switch value in the database or the configuration file according to the currently stored switch value in the remote dictionary service. And a storage module 54, configured to, if a switch value is not currently stored in the remote dictionary service, read the switch value in a configuration file or a database, and store the switch value in the remote dictionary service.
In an optional embodiment, the storage module 54 is further configured to store a preset default switch value in the remote dictionary service if the switch value is not stored in the configuration file or the database; the default switch value corresponds to a preset default version of the application program. The control module 52 is further configured to control execution of the application program of the default version according to the switch value currently stored in the remote dictionary service.
In an optional embodiment, the control module 52 is further configured to control to execute a first version of the application program if the switch value currently stored in the remote dictionary service is a first switch value; and if the switch value currently stored in the remote dictionary service is a second switch value, controlling to execute an application program of a second version, wherein the first switch value and the second switch value have different values, and the first version is different from the second version.
In an optional embodiment, the control module 52 is further configured to, if a service request is received, invoke a service interface configured in advance, where the service interface includes multiple implementation classes, and different implementation classes correspond to application programs of different versions; and controlling to execute the application program of the version corresponding to the corresponding implementation class according to the switch value currently stored in the remote dictionary service, wherein different switch values correspond to different implementation classes.
In an alternative embodiment, the remote dictionary service architecture comprises a master server and slave servers, and the master server and each slave server are deployed with the application version switching device.
It should be noted that, for the technical solution and the effect executed by the application version switching device provided in this embodiment, reference may be made to the related contents of the foregoing method embodiments, and details are not described herein again.
Example four
Fig. 7 is a schematic structural diagram of an electronic device according to the present application, and as shown in fig. 7, the present application further provides an electronic device 600, including: a memory 601 and a processor 602.
The memory 601 stores programs. In particular, the program may include program code comprising computer-executable instructions. Memory 601 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
A processor 602 for executing the programs stored in the memory 601.
The computer program is stored in the memory 601 and configured to be executed by the processor 602 to implement the application version switching method provided in any embodiment of the present application. The related descriptions and effects corresponding to the steps in the drawings can be correspondingly understood, and redundant description is not repeated here.
In this embodiment, the memory 601 and the processor 602 are connected by a bus. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
EXAMPLE five
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the application version switching method provided in any embodiment of the present application.
EXAMPLE six
The embodiment of the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for switching the application program version provided in any embodiment of the present application is implemented.
EXAMPLE seven
Fig. 8 is a schematic view of a service system provided in the embodiment of the present application, and as shown in fig. 8, the service system provided in the embodiment of the present application includes: the system comprises a service control module and a plurality of remote dictionary service architectures, wherein different remote dictionary service architectures correspond to different application services; each remote dictionary service architecture comprises a master server and a slave server, wherein the master server is used for executing the application program version switching method provided by any one embodiment of the application program version switching method.
The service control module is used for receiving a service request, wherein the service request comprises information of a first application service; determining a first remote dictionary service architecture corresponding to the first application service; and sending the service request to a current main server under the first remote dictionary service architecture.
In an example, in a distributed cache-based micro-service application scenario, an embodiment of the present application further provides a service system. The system includes a service control module and a plurality of Redis architectures. Different Redis architectures correspond to different application services, such as a recharge service and a transfer service. Each Redis architecture comprises a master server and a slave server, wherein the master server is used for executing the application program version switching method provided by any one of the embodiments of the application. In addition, each slave server is deployed with the application version switching method provided by any one of the embodiments of the present application, and the master server and the slave servers are connected through a network.
Accordingly, the service control module may be configured to receive a service request, where the service request includes information of a first application service, and the first application service may be a recharge service, a transfer service, and the like. In addition, the service control module may further determine a Redis architecture corresponding to the first application service, and send the service request to a current primary server under the Redis architecture.
For example, if the service control module receives a service request including information of the recharge service, a Redis architecture corresponding to the recharge service may be determined, and the service request may be sent to a current host server under the Redis architecture corresponding to the recharge service, so that the host server may execute the method for switching the application version provided in any embodiment of the present application.
In a possible implementation manner, on the basis of the seventh embodiment, the remote dictionary service architecture includes a master-slave switching module; and the master-slave switching module is used for switching a server which normally operates in the slave servers into the current master server and switching the master server which abnormally operates before switching into the current slave server if the master server operates abnormally under the remote dictionary service architecture.
In one example, the Redis architecture may include a master-slave switching module, that is, when the operation of a master server under the Redis architecture is abnormal, in order to ensure stable operation of the system, the master-slave switching module may send a master-slave switching request to a server that operates normally in the slave servers, so that the server that operates normally in the slave servers is switched to a current master server according to the request, and the master server that operates abnormally before switching is switched to the current slave server.
According to the application program version switching method provided by the embodiment, the master server with abnormal operation is switched to the current slave server through master-slave switching, and the slave server with normal operation is switched to the current master server, so that the stable operation of the system is ensured, and the reliability of the system is improved.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware form, and can also be realized in a form of hardware and a software functional module.
Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable application version switching device such that the program codes, when executed by the processor or controller, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
Further, while operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the application. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (12)

1. An application version switching method is characterized by comprising the following steps:
setting a currently stored switch value in a remote dictionary service as the input switch value in response to the user input switch value;
and if a service request is received, controlling and executing the application programs of the corresponding versions according to the switch value currently stored in the remote dictionary service, wherein different switch values correspond to the application programs of different versions.
2. The method of claim 1, further comprising:
updating the switch value currently stored in a database or a configuration file according to the switch value currently stored in the remote dictionary service;
the method further comprises the following steps:
and if the switch value is not stored in the remote dictionary service currently, reading the switch value in a configuration file or a database and storing the switch value in the remote dictionary service.
3. The method of claim 2, wherein after reading the switch value in the configuration file or the database if the switch value is not currently stored in the remote dictionary service, further comprising:
if the switch value is not stored in the configuration file or the database, storing a preset default switch value in the remote dictionary service; the default switch value corresponds to a preset application program of a default version;
the controlling and executing the application program of the corresponding version according to the switch value currently stored in the remote dictionary service comprises the following steps:
and controlling to execute the application program of the default version according to the switch value currently stored in the remote dictionary service.
4. The method of claim 1, wherein controlling execution of the corresponding version of the application program according to the currently stored switch value in the remote dictionary service comprises:
if the switch value currently stored in the remote dictionary service is a first switch value, controlling to execute the application program of a first version;
and if the switch value currently stored in the remote dictionary service is a second switch value, controlling to execute an application program of a second version, wherein the first switch value and the second switch value have different values, and the first version is different from the second version.
5. The method according to claim 1, wherein if a service request is received, controlling execution of a corresponding version of an application according to a currently stored switch value in the remote dictionary service, comprises:
if a service request is received, calling a service interface which is configured in advance, wherein the service interface comprises a plurality of implementation classes, and different implementation classes correspond to application programs of different versions;
and controlling to execute the application program of the version corresponding to the corresponding implementation class according to the switch value currently stored in the remote dictionary service, wherein different switch values correspond to different implementation classes.
6. The method according to any one of claims 1 to 5, wherein the application version switching method is applied to a current master server under a remote dictionary service architecture, the remote dictionary service architecture comprises the master server and slave servers, and each slave server is deployed with the application version switching method.
7. An application version switching apparatus, comprising:
the setting module is used for responding to the switch value input by the user and setting the currently stored switch value in the remote dictionary service as the input switch value;
and the control module is used for controlling and executing the application programs of the corresponding versions according to the switch values currently stored in the remote dictionary service if the service request is received, wherein different switch values correspond to the application programs of different versions.
8. An electronic device, comprising: a memory, a processor;
a memory: a memory for storing the processor-executable instructions;
wherein the processor is configured to invoke program instructions in the memory to perform the application version switching method of any one of claims 1-6.
9. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, implement the application version switching method of any one of claims 1-6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the application version switching method according to any one of claims 1 to 6 when executed by a processor.
11. A service system, comprising: the system comprises a service control module and a plurality of remote dictionary service architectures, wherein different remote dictionary service architectures correspond to different application services; each remote dictionary service architecture comprises a master server and a slave server, the master server being configured to perform the application version switching method according to any one of claims 1 to 6;
the service control module is used for receiving a service request, wherein the service request comprises information of a first application service; determining a first remote dictionary service architecture corresponding to the first application service; and sending the service request to a current main server under the first remote dictionary service architecture.
12. The system of claim 11, wherein the remote dictionary service architecture comprises a master-slave switching module;
and the master-slave switching module is used for switching a server which normally operates in the slave servers into the current master server and switching the master server which abnormally operates before switching into the current slave server if the master server operates abnormally under the remote dictionary service architecture.
CN202110736172.5A 2021-06-30 2021-06-30 Application program version switching method, device, equipment and system Pending CN113360213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110736172.5A CN113360213A (en) 2021-06-30 2021-06-30 Application program version switching method, device, equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110736172.5A CN113360213A (en) 2021-06-30 2021-06-30 Application program version switching method, device, equipment and system

Publications (1)

Publication Number Publication Date
CN113360213A true CN113360213A (en) 2021-09-07

Family

ID=77537328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110736172.5A Pending CN113360213A (en) 2021-06-30 2021-06-30 Application program version switching method, device, equipment and system

Country Status (1)

Country Link
CN (1) CN113360213A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416173A (en) * 2022-03-28 2022-04-29 荣耀终端有限公司 Version switching method and terminal equipment
CN114710550A (en) * 2022-03-18 2022-07-05 中国建设银行股份有限公司 Request response method, device, equipment and computer storage medium
CN115484163A (en) * 2022-08-30 2022-12-16 海尔优家智能科技(北京)有限公司 System switching method and device, storage medium and electronic device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106649669A (en) * 2016-12-14 2017-05-10 咪咕数字传媒有限公司 Data storage method and system based on remote dictionary server
CN107103035A (en) * 2017-03-22 2017-08-29 福建榕基软件股份有限公司 This earth's surface data-updating method and device
US9891906B1 (en) * 2014-12-31 2018-02-13 Wells Fargo Bank, N.A. Software versioning
CN107809445A (en) * 2016-08-31 2018-03-16 阿里巴巴集团控股有限公司 Service request handling system, method and apparatus
CN108279924A (en) * 2018-01-30 2018-07-13 北京小米移动软件有限公司 Program dissemination method and device
CN110213435A (en) * 2019-05-24 2019-09-06 广东小天才科技有限公司 Function display state processing method and system
CN110321254A (en) * 2019-07-09 2019-10-11 西安点告网络科技有限公司 Software version rollback method, device, server and storage medium
CN110908702A (en) * 2019-10-12 2020-03-24 中国平安财产保险股份有限公司 Version switching method, version switching device, computer equipment and storage medium
CN111831628A (en) * 2020-07-28 2020-10-27 中国平安财产保险股份有限公司 System operation and maintenance monitoring method and device, electronic equipment and storage medium
CN112114905A (en) * 2020-09-29 2020-12-22 中国银行股份有限公司 Software version switching method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9891906B1 (en) * 2014-12-31 2018-02-13 Wells Fargo Bank, N.A. Software versioning
CN107809445A (en) * 2016-08-31 2018-03-16 阿里巴巴集团控股有限公司 Service request handling system, method and apparatus
CN106649669A (en) * 2016-12-14 2017-05-10 咪咕数字传媒有限公司 Data storage method and system based on remote dictionary server
CN107103035A (en) * 2017-03-22 2017-08-29 福建榕基软件股份有限公司 This earth's surface data-updating method and device
CN108279924A (en) * 2018-01-30 2018-07-13 北京小米移动软件有限公司 Program dissemination method and device
CN110213435A (en) * 2019-05-24 2019-09-06 广东小天才科技有限公司 Function display state processing method and system
CN110321254A (en) * 2019-07-09 2019-10-11 西安点告网络科技有限公司 Software version rollback method, device, server and storage medium
CN110908702A (en) * 2019-10-12 2020-03-24 中国平安财产保险股份有限公司 Version switching method, version switching device, computer equipment and storage medium
CN111831628A (en) * 2020-07-28 2020-10-27 中国平安财产保险股份有限公司 System operation and maintenance monitoring method and device, electronic equipment and storage medium
CN112114905A (en) * 2020-09-29 2020-12-22 中国银行股份有限公司 Software version switching method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710550A (en) * 2022-03-18 2022-07-05 中国建设银行股份有限公司 Request response method, device, equipment and computer storage medium
CN114416173A (en) * 2022-03-28 2022-04-29 荣耀终端有限公司 Version switching method and terminal equipment
CN115484163A (en) * 2022-08-30 2022-12-16 海尔优家智能科技(北京)有限公司 System switching method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN113360213A (en) Application program version switching method, device, equipment and system
US20210097043A1 (en) Data processing method, device, and a storage medium
CN110673853B (en) Compiling method, device and system
US20150169386A1 (en) Automating software availability management based on api versioning
CN105468717A (en) Database operation method and device
CN101025698A (en) Apparatus for forcibly terminating thread blocked on input/output operation and method for the same
CN111782339A (en) Container creation method and device, electronic equipment and storage medium
CN111695827A (en) Business process management method and device, electronic equipment and storage medium
CN112434008A (en) Distributed database upgrading method, device and medium
CN111666088A (en) Pod replacement method and device, electronic equipment and computer-readable storage medium
US11983519B2 (en) Abort installation of firmware bundles
CN115202686A (en) Virtualization system upgrading method and device, electronic equipment and storage medium
CN113760306A (en) Method and device for installing software, electronic equipment and storage medium
CN114327484A (en) Multi-architecture supporting K8S integration and deployment method, system and storage medium
KR102106449B1 (en) Method, device and server for checking a defective function
CN107168719A (en) Application program running method and device, terminal and computer readable storage medium
CN110968339B (en) Method and device for front-end building tool and electronic equipment
JP2021131897A (en) Scheduling method, device, equipment, storage equipment, and program
CN113127430B (en) Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment
CN115543393B (en) Upgrade method, electronic device and storage medium
CN111258618A (en) File configuration method and device, computer equipment and storage medium
CN116775613A (en) Data migration method, device, electronic equipment and computer readable medium
US20230315038A1 (en) Method and system for providing engineering of an industrial device in a cloud computing environment
CN114816482A (en) Method and device for upgrading block storage service, computer equipment and storage medium
CN113051122B (en) Performance data acquisition method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination